1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DocumentSpreadsheetPreview-BJcChBnu.js","assets/lib-DtN8gI3K.js","assets/en-us-ClVoWMyT-BJmIZfaz.js","assets/lib-CgXw1v6I.css","assets/FinanceSpreadsheetEditor-3rgF2lnV.js"])))=>i.map(i=>d[i]); 2(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`4187687326cc3f82f30376dff5c9753d7622de33`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`faf5c391-84fa-41c4-bf93-ff27e44ba6b3`,e._sentryDebugIdIdentifier=`sentry-dbid-faf5c391-84fa-41c4-bf93-ff27e44ba6b3`)}catch{}})();var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=e=>{let n={};for(var r in e)t(n,r,{get:e[r],enumerable:!0});return n},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>l(t({},`__esModule`,{value:!0}),e),f=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var p=s((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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pen
2ding`&&(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 N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not val
2id 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 P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=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)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()}
vendor: 11,149 bytes, line 2
2,e.version=`19.2.4`})),m=s(((e,t)=>{t.exports=p()})),h=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),g=s(((e,t)=>{t.exports=h()})),_=s((e=>{var t=m();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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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=i,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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.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,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,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=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.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=c(n,t.crossOrigin);i.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=c(t.as,t.crossOrigin);i.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})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),v=s(((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=_()})),y=s((e=>{var t=g(),n=m(),r=v();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},R=[],te=-1;function ne(e){return{current:e}}function re(e){0>te||(e.current=R[te],R[te]=null,te--)}function ie(e,t){te++,R[te]=e.current,e.current=t}var z=ne(null),ae=ne(null),oe=ne(null),se=ne(null);function ce(e,t){switch(ie(oe,t),ie(ae,e),ie(z,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?jd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=jd(t),e=Md(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}re(z),ie(z,e)}function le(){re(z),re(ae),re(oe)}function ue(e){e.memoizedState!==null&&ie(se,e);var t=z.current,n=Md(t,e.type);t!==n&&(ie(ae,e),ie(z,n))}function de(e){ae.current===e&&(re(z),re(ae)),se.current===e&&(re(se),zf._currentValue=ee)}
vendor: 13,770 bytes, lines 2-9
2var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(` 3 at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return` 4`+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(` 5`),l=s.split(` 6`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=` 7`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return` 8Error generating stack: `+e.message+` 9`+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,we=t.unstable_now,Te=t.unstable_getCurrentPriorityLevel,Ee=t.unstable_ImmediatePriority,De=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,ke=t.unstable_LowPriority,Ae=t.unstable_IdlePriority,je=t.log,Me=t.unstable_setDisableYieldValue,Ne=null,Pe=null;function Fe(e){if(typeof je==`function`&&Me(e),Pe&&typeof Pe.setStrictMode==`function`)try{Pe.setStrictMode(Ne,e)}catch{}}var Ie=Math.clz32?Math.clz32:ze,Le=Math.log,Re=Math.LN2;function ze(e){return e>>>=0,e===0?32:31-(Le(e)/Re|0)|0}var Be=256,Ve=262144,He=4194304;function Ue(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function We(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ue(n))):i=Ue(o):i=Ue(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ue(n))):i=Ue(o)):i=Ue(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qe(){var e=He;return He<<=1,!(He&62914560)&&(He=4194304),e}function Je(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ie(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ze(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ze(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ie(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ie(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function $e(e,t){var n=t&-t;return n=n&42?1:et(n),(n&(e.suspendedLanes|t))===0?n:0}function et(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function tt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function nt(){var e=L.p;return e===0?(e=window.event,e===void 0?32:ep(e.type)):e}function rt(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var it=Math.random().toString(36).slice(2),at=`__reactFiber$`+it,ot=`__reactProps$`+it,st=`__reactContainer$`+it,ct=`__reactEvents$`+it,lt=`__reactListeners$`+it,eee=`__reactHandles$`+it,ut=`__reactResources$`+it,dt=`__reactMarker$`+it;function ft(e){delete e[at],delete e[ot],delete e[ct],delete e[lt],delete e[eee]}function pt(e){var t=e[at];if(t)return t;for(var n=e.parentNode;n;){if(t=n[st]||n[at]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$d(e);e!==null;){if(n=e[at])return n;e=$d(e)}return t}e=n,n=e.parentNode}return null}function mt(e){if(e=e[at]||e[st]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ht(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function gt(e){var t=e[ut];return t||=e[ut]={hoistableStyles:new Map,hoistableScripts:new Map},t}function _t(e){e[dt]=!0}var vt=new Set,yt={};function bt(e,t){xt(e,t),xt(e+`Capture`,t)}function xt(e,t){for(yt[e]=t,e=0;e<t.length;e++)vt.add(t[e])}var St=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Ct={},wt={};function Tt(e){return ye.call(wt,e)?!0:ye.call(Ct,e)?!1:St.test(e)?wt[e]=!0:(Ct[e]=!0,!1)}function Et(e,t,n){if(Tt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Dt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Ot(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function kt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function At(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function jt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Mt(e){if(!e._valueTracker){var t=At(e)?`checked`:`value`;e._valueTracker=jt(e,t,``+e[t])}}function Nt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=At(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Pt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ft=/[\n"\\]/g;function It(e){return e.replace(Ft,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Lt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+kt(t)):e.value!==``+kt(t)&&(e.value=``+kt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):zt(e,o,kt(n)):zt(e,o,kt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+kt(s):e.removeAttribute(`name`)}function Rt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Mt(e);return}n=n==null?``:``+kt(n),t=t==null?n:``+kt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Mt(e)}function zt(e,t,n){t===`number`&&Pt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Bt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+kt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Vt(e,t,n){if(t!=null&&(t=``+kt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+kt(n)}function Ht(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=kt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Mt(e)}function Ut(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Gt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Wt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Kt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Gt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Gt(e,o,t[o])}function qt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var tee=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`
9clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Jt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yt(e){return Jt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Xt(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=mt(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Lt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+It(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ot]||null;if(!a)throw Error(i(90));Lt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Nt(r)}break a;case`textarea`:Vt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Bt(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(du(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ot]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,`passive`,{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=f({},_n,{view:0,detail:0}),nee=gn(yn),bn,xn,Sn,Cn=f({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:On,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Sn&&(Sn&&e.type===`mousemove`?(bn=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=bn=0,Sn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:xn}}),wn=gn(Cn),Tn=gn(f({},Cn,{dataTransfer:0})),En=gn(f({},yn,{relatedTarget:0})),ree=gn(f({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),iee=gn(f({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Dn=gn(f({},_n,{data:0})),aee={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},oee={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F
95`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},see={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function cee(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=see[e])?!!t[e]:!1}function On(){return cee}var lee=gn(f({},yn,{key:function(e){if(e.key){var t=aee[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?oee[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:On,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),kn=gn(f({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),uee=gn(f({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:On})),An=gn(f({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),jn=gn(f({},Cn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Mn=gn(f({},_n,{newState:0,oldState:0})),Nn=[9,13,27,32],Pn=on&&`CompositionEvent`in window,Fn=null;on&&`documentMode`in document&&(Fn=document.documentMode);var dee=on&&`TextEvent`in window&&!Fn,In=on&&(!Pn||Fn&&8<Fn&&11>=Fn),Ln=` `,Rn=!1;function zn(e,t){switch(e){case`keyup`:return Nn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Bn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Vn=!1;function Hn(e,t){switch(e){case`compositionend`:return Bn(t);case`keypress`:return t.which===32?(Rn=!0,Ln):null;case`textInput`:return e=t.data,e===Ln&&Rn?null:e;default:return null}}function fee(e,t){if(Vn)return e===`compositionend`||!Pn&&zn(e,t)?(e=fn(),dn=un=ln=null,Vn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return In&&t.locale!==`ko`?null:t.data;default:return null}}var Un={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Un[e.type]:t===`textarea`}function Gn(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=gd(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Kn=null,qn=null;function Jn(e){cd(e,0)}function Yn(e){if(Nt(ht(e)))return e}function Xn(e,t){if(e===`change`)return t}var Zn=!1;if(on){var Qn;if(on){var $n=`oninput`in document;if(!$n){var er=document.createElement(`div`);er.setAttribute(`oninput`,`return;`),$n=typeof er.oninput==`function`}Qn=$n}else Qn=!1;Zn=Qn&&(!document.documentMode||9<document.documentMode)}function tr(){Kn&&(Kn.detachEvent(`onpropertychange`,nr),qn=Kn=null)}function nr(e){if(e.propertyName===`value`&&Yn(qn)){var t=[];Gn(t,qn,e,Qt(e)),rn(Jn,t)}}function rr(e,t,n){e===`focusin`?(tr(),Kn=t,qn=n,Kn.attachEvent(`onpropertychange`,nr)):e===`focusout`&&tr()}function ir(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Yn(qn)}function ar(e,t){if(e===`click`)return Yn(t)}function or(e,t){if(e===`input`||e===`change`)return Yn(t)}function sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var cr=typeof Object.is==`function`?Object.is:sr;function lr(e,t){if(cr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ye.call(t,i)||!cr(e[i],t[i]))return!1}return!0}function ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dr(e,t){var n=ur(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=ur(n)}}function fr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pt(e.document)}return t}function mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var pee=on&&`documentMode`in document&&11>=document.documentMode,hr=null,gr=null,_r=null,vr=!1;function yr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vr||hr==null||hr!==Pt(r)||(r=hr,`selectionStart`in r&&mr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 72,208 bytes, line 9
9sNode:r.focusNode,focusOffset:r.focusOffset}),_r&&lr(_r,r)||(_r=r,r=gd(gr,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=hr)))}function br(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var xr={animationend:br(`Animation`,`AnimationEnd`),animationiteration:br(`Animation`,`AnimationIteration`),animationstart:br(`Animation`,`AnimationStart`),transitionrun:br(`Transition`,`TransitionRun`),transitionstart:br(`Transition`,`TransitionStart`),transitioncancel:br(`Transition`,`TransitionCancel`),transitionend:br(`Transition`,`TransitionEnd`)},Sr={},Cr={};on&&(Cr=document.createElement(`div`).style,`AnimationEvent`in window||(delete xr.animationend.animation,delete xr.animationiteration.animation,delete xr.animationstart.animation),`TransitionEvent`in window||delete xr.transitionend.transition);function wr(e){if(Sr[e])return Sr[e];if(!xr[e])return e;var t=xr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Cr)return Sr[e]=t[n];return e}var Tr=wr(`animationend`),Er=wr(`animationiteration`),Dr=wr(`animationstart`),Or=wr(`transitionrun`),kr=wr(`transitionstart`),Ar=wr(`transitioncancel`),jr=wr(`transitionend`),Mr=new Map,Nr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Nr.push(`scrollEnd`);function Pr(e,t){Mr.set(e,t),bt(t,[e])}var Fr=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)},Ir=[],Lr=0,Rr=0;function zr(){for(var e=Lr,t=Rr=Lr=0;t<e;){var n=Ir[t];Ir[t++]=null;var r=Ir[t];Ir[t++]=null;var i=Ir[t];Ir[t++]=null;var a=Ir[t];if(Ir[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ur(n,i,a)}}function Br(e,t,n,r){Ir[Lr++]=e,Ir[Lr++]=t,Ir[Lr++]=n,Ir[Lr++]=r,Rr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Vr(e,t,n,r){return Br(e,t,n,r),Wr(e)}function Hr(e,t){return Br(e,null,null,t),Wr(e)}function Ur(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ie(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Wr(e){if(50<nu)throw nu=0,ru=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Gr={};function Kr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qr(e,t,n,r){return new Kr(e,t,n,r)}function Jr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yr(e,t){var n=e.alternate;return n===null?(n=qr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Xr(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Zr(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)Jr(e)&&(s=1);else if(typeof e==`string`)s=Af(e,n,z.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=qr(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return Qr(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=qr(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=qr(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=qr(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=qr(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Qr(e,t,n,r){return e=qr(7,e,r,t),e.lanes=n,e}function $r(e,t,n){return e=qr(6,e,null,t),e.lanes=n,e}function ei(e){var t=qr(18,null,null,0);return t.stateNode=e,t}function ti(e,t,n){return t=qr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ni=new WeakMap;function ri(e,t){if(typeof e==`object`&&e){var n=ni.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},ni.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var ii=[],ai=0,oi=null,si=0,ci=[],li=0,ui=null,di=1,fi=``;function pi(e,t){ii[ai++]=si,ii[ai++]=oi,oi=e,si=t}function mi(e,t,n){ci[li++]=di,ci[li++]=fi,ci[li++]=ui,ui=e;var r=di;e=fi;var i=32-Ie(r)-1;r&=~(1<<i),n+=1;var a=32-Ie(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,di=1<<32-Ie(t)+i|n<<i|r,fi=a+e}else di=1<<a|n<<i|r,fi=e}function hi(e){e.return!==null&&(pi(e,1),mi(e,1,0))}function gi(e){for(;e===oi;)oi=ii[--ai],ii[ai]=null,si=ii[--ai],ii[ai]=null;for(;e===ui;)ui=ci[--li],ci[li]=null,fi=ci[--li],ci[li]=null,di=ci[--li],ci[li]=null}function _i(e,t){ci[li++]=di,ci[li++]=fi,ci[li++]=ui,di=t.id,fi=t.overflow,ui=e}var vi=null,yi=null,bi=!1,xi=null,Si=!1,Ci=Error(i(519));function wi(e){throw Ai(ri(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ci}function Ti(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[at]=e,t[ot]=r,n){case`dialog`:ld(`cancel`,t),ld(`close`,t);break;case`iframe`:case`object`:case`embed`:ld(`load`,t);break;case`video`:case`audio`:for(n=0;n<od.length;n++)ld(od[n],t);break;case`source`:ld(`error`,t);break;case`img`:case`image`:case`link`:ld(`error`,t),ld(`load`,t);break;case`details`:ld(`toggle`,t);break;case`input`:ld(`invalid`,t),Rt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:ld(`invalid`,t);break;case`textarea`:ld(`invalid`,t),Ht(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Sd(t.textContent,n)?(r.popover!=null&&(ld(`beforetoggle`,t),ld(`toggle`,t)),r.onScroll!=null&&ld(`scroll`,t),r.onScrollEnd!=null&&ld(`scrollend`,t),r.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||wi(e,!0)}function Ei(e){for(vi=e.return;vi;)switch(vi.tag){case 5:case 31:case 13:Si=!1;return;case 27:case 3:Si=!0;return;default:vi=vi.return}}function Di(e){if(e!==vi)return!1;if(!bi)return Ei(e),bi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Nd(e.type,e.memoizedProps)),n=!n),n&&yi&&wi(e),Ei(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));yi=Qd(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));yi=Qd(e)}else t===27?(t=yi,Vd(e.type)?(e=Zd,Zd=null,yi=e):yi=t):yi=vi?Xd(e.stateNode.nextSibling):null;return!0}function Oi(){yi=vi=null,bi=!1}function ki(){var e=xi;return e!==null&&(Hl===null?Hl=e:Hl.push.apply(Hl,e),xi=null),e}function Ai(e){xi===null?xi=[e]:xi.push(e)}var ji=ne(null),Mi=null,Ni=null;function Pi(e,t,n){ie(ji,t._currentValue),t._currentValue=n}function Fi(e){e._currentValue=ji.current,re(ji)}function Ii(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Li(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ii(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ii(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ri(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[zf]:e.push(zf))}a=a.return}e!==null&&Li(t,e,n,r),t.flags|=262144}function zi(e){for(e=e.firstContext;e!==null;){if(!cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Bi(e){Mi=e,Ni=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Vi(e){return Ui(Mi,e)}function Hi(e,t){return Mi===null&&Bi(e),Ui(e,t)}function Ui(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ni===null){if(e===null)throw Error(i(308));Ni=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ni=Ni.next=t;return n}var Wi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Gi=t.unstable_scheduleCallback,Ki=t.unstable_NormalPriority,qi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ji(){return{controller:new Wi,data:new Map,refCount:0}}function Yi(e){e.refCount--,e.refCount===0&&Gi(Ki,function(){e.controller.abort()})}var Xi=null,Zi=0,Qi=0,$i=null;function ea(e,t){if(Xi===null){var n=Xi=[];Zi=0,Qi=ed(),$i={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Zi++,t.then(ta,ta),t}function ta(){if(--Zi===0&&Xi!==null){$i!==null&&($i.status=`fulfilled`);var e=Xi;Xi=null,Qi=0,$i=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function na(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ra=I.S;I.S=function(e,t){Gl=we(),typeof t==`object`&&t&&typeof t.then==`function`&&ea(e,t),ra!==null&&ra(e,t)};var ia=ne(null);function aa(){var e=ia.current;return e===null?El.pooledCache:e}function oa(e,t){t===null?ie(ia,ia.current):ie(ia,t.pool)}function sa(){var e=aa();return e===null?null:{parent:qi._currentValue,pool:e}}var ca=Error(i(460)),la=Error(i(474)),ua=Error(i(542)),da={then:function(){}};function fa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function pa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,_a(e),e;default:if(typeof t.status==`string`)t.then(Xt,Xt);else{if(e=El,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,_a(e),e}throw ha=t,ca}}function ma(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ha=e,ca):e}}var ha=null;function ga(){if(ha===null)throw Error(i(459));var e=ha;return ha=null,e}function _a(e){if(e===ca||e===ua)throw Error(i(483))}var va=null,ya=0;function ba(e){var t=ya;return ya+=1,va===null&&(va=[]),pa(va,e,t)}function xa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Sa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ca(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Yr(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=$r(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&ma(i)===t.type)?(t=a(t,n.props),xa(t,n),t.return=e,t):(t=Zr(n.type,n.key,n.props,null,e.mode,r),xa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ti(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Qr(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=$r(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case h:return n=Zr(t.type,t.key,t.props,null,e.mode,n),xa(n,t),n.return=e,n;case _:return t=ti(t,e.mode,n),t.return=e,t;case O:return t=ma(t),f(e,t,n)}if(F(t)||M(t))return t=Qr(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ba(t),n);if(t.$$typeof===C)return f(e,Hi(e,t),n);Sa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case h:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case O:return n=ma(n),p(e,t,n,r)}if(F(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ba(n),r);if(n.$$typeof===C)return p(e,t,Hi(e,n),r);Sa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case h:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case _:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=ma(r),m(e,t,n,r,i)}if(F(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ba(r),i);if(r.$$typeof===C)return m(e,t,n,Hi(t,r),i);Sa(t,r)}return null}function g(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),bi&&pi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return bi&&pi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),bi&&pi(i,h),l}function v(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),bi&&pi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return bi&&pi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),bi&&pi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&ma(l)===r.type){n(e,r.sibling),c=a(r,o.props),xa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=Qr(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=Zr(o.type,o.key,o.props,null,e.mode,c),xa(c,o),c.return=e,e=c)}return s(e);case _:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=ti(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=ma(o),b(e,r,o,c)}if(F(o))return g(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),v(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ba(o),c);if(o.$$typeof===C)return b(e,r,Hi(e,o),c);Sa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=$r(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ya=0;var i=b(e,t,n,r);return va=null,i}catch(t){if(t===ca||t===ua)throw t;var a=qr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var wa=Ca(!0),Ta=Ca(!1),Ea=!1;function Da(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Aa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Tl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Wr(e),Ur(e,null,n),t}return Br(e,r,t,n),Wr(e)}function ja(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}function Ma(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Na=!1;function Pa(){if(Na){var e=$i;if(e!==null)throw e}}function Fa(e,t,n,r){Na=!1;var i=e.updateQueue;Ea=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Ol&p)===p:(r&p)===p){p!==0&&p===Qi&&(Na=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ea=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Il|=o,e.lanes=o,e.memoizedState=d}}function Ia(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function La(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ia(n[e],t)}var Ra=ne(null),za=ne(0);function Ba(e,t){e=Pl,ie(za,e),ie(Ra,t),Pl=e|t.baseLanes}function Va(){ie(za,Pl),ie(Ra,Ra.current)}function Ha(){Pl=za.current,re(Ra),re(za)}var Ua=ne(null),Wa=null;function Ga(e){var t=e.alternate;ie(Xa,Xa.current&1),ie(Ua,e),Wa===null&&(t===null||Ra.current!==null||t.memoizedState!==null)&&(Wa=e)}function Ka(e){ie(Xa,Xa.current),ie(Ua,e),Wa===null&&(Wa=e)}function qa(e){e.tag===22?(ie(Xa,Xa.current),ie(Ua,e),Wa===null&&(Wa=e)):Ja(e)}function Ja(){ie(Xa,Xa.current),ie(Ua,Ua.current)}function Ya(e){re(Ua),Wa===e&&(Wa=null),re(Xa)}var Xa=ne(0);function Za(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Jd(n)||Yd(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Qa=0,$a=null,eo=null,to=null,no=!1,ro=!1,io=!1,ao=0,oo=0,so=null,co=0;function lo(){throw Error(i(321))}function uo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cr(e[n],t[n]))return!1;return!0}function fo(e,t,n,r,i,a){return Qa=a,$a=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Ds:Os,io=!1,a=n(r,i),io=!1,ro&&(a=mo(t,n,r,i)),po(e),a}function po(e){I.H=Es;var t=eo!==null&&eo.next!==null;if(Qa=0,to=eo=$a=null,no=!1,oo=0,so=null,t)throw Error(i(300));e===null||Hs||(e=e.dependencies,e!==null&&zi(e)&&(Hs=!0))}function mo(e,t,n,r){$a=e;var a=0;do{if(ro&&(so=null),oo=0,ro=!1,25<=a)throw Error(i(301));if(a+=1,to=eo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=ks,o=t(n,r)}while(ro);return o}function ho(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?So(t):t,e=e.useState()[0],(eo===null?null:eo.memoizedState)!==e&&($a.flags|=1024),t}function go(){var e=ao!==0;return ao=0,e}function _o(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function vo(e){if(no){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}no=!1}Qa=0,to=eo=$a=null,ro=!1,oo=ao=0,so=null}function yo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return to===null?$a.memoizedState=to=e:to=to.next=e,to}function bo(){if(eo===null){var e=$a.alternate;e=e===null?null:e.memoizedState}else e=eo.next;var t=to===null?$a.memoizedState:to.next;if(t!==null)to=t,eo=e;else{if(e===null)throw $a.alternate===null?Error(i(467)):Error(i(310));eo=e,e={memoizedState:eo.memoizedState,baseState:eo.baseState,baseQueue:eo.baseQueue,queue:eo.queue,next:null},to===null?$a.memoizedState=to=e:to=to.next=e}return to}function xo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function So(e){var t=oo;return oo+=1,so===null&&(so=[]),e=pa(so,e,t),t=$a,(to===null?t.memoizedState:to.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Ds:Os),e}function Co(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return So(e);if(e.$$typeof===C)return Vi(e)}throw Error(i(438,String(e)))}function wo(e){var t=null,n=$a.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=$a.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=xo(),$a.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function To(e,t){return typeof t==`function`?t(e):t}function Eo(e){return Do(bo(),eo,e)}function Do(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Qa&f)===f:(Ol&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Qi&&(d=!0);else if((Qa&p)===p){u=u.next,p===Qi&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,$a.lanes|=p,Il|=p;f=u.action,io&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,$a.lanes|=f,Il|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!cr(o,e.memoizedState)&&(Hs=!0,d&&(n=$i,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Oo(e){var t=bo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);cr(o,t.memoizedState)||(Hs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ko(e,t,n){var r=$a,a=bo(),o=bi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!cr((eo||a).memoizedState,n);if(s&&(a.memoizedState=n,Hs=!0),a=a.queue,$o(Mo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||to!==null&&to.memoizedState.tag&1){if(r.flags|=2048,Jo(9,{destroy:void 0},jo.bind(null,r,a,n,t),null),El===null)throw Error(i(349));o||Qa&127||Ao(r,t,n)}return n}function Ao(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$a.updateQueue,t===null?(t=xo(),$a.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jo(e,t,n,r){t.value=n,t.getSnapshot=r,No(t)&&Po(e)}function Mo(e,t,n){return n(function(){No(t)&&Po(e)})}function No(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cr(e,n)}catch{return!0}}function Po(e){var t=Hr(e,2);t!==null&&ou(t,e,2)}function Fo(e){var t=yo();if(typeof e==`function`){var n=e;if(e=n(),io){Fe(!0);try{n()}finally{Fe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:To,lastRenderedState:e},t}function Io(e,t,n,r){return e.baseState=n,Do(e,eo,typeof r==`function`?r:To)}function mee(e,t,n,r,a){if(Cs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Lo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Lo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Ro(e,t,s)}catch(n){Bo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Ro(e,t,a)}catch(n){Bo(e,t,n)}}function Ro(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){zo(e,t,n)},function(n){return Bo(e,t,n)}):zo(e,t,n)}function zo(e,t,n){t.status=`fulfilled`,t.value=n,Vo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Lo(e,n)))}function Bo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Vo(t),t=t.next;while(t!==r)}e.action=null}function Vo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ho(e,t){return t}function Uo(e,t){if(bi){var n=El.formState;if(n!==null){a:{var r=$a;if(bi){if(yi){b:{for(var i=yi,a=Si;i.nodeType!==8;){if(!a){i=null;break b}if(i=Xd(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){yi=Xd(i.nextSibling),r=i.data===`F!`;break a}}wi(r)}r=!1}r&&(t=n[0])}}return n=yo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:t},n.queue=r,n=bs.bind(null,$a,r),r.dispatch=n,r=Fo(!1),a=Ss.bind(null,$a,!1,r.queue),r=yo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=mee.bind(null,$a,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Wo(e){return Go(bo(),eo,e)}function Go(e,t,n){if(t=Do(e,t,Ho)[0],e=Eo(To)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=So(t)}catch(e){throw e===ca?ua:e}else r=t;t=bo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&($a.flags|=2048,Jo(9,{destroy:void 0},Ko.bind(null,i,n),null)),[r,a,e]}function Ko(e,t){e.action=t}function qo(e){var t=bo(),n=eo;if(n!==null)return Go(t,n,e);bo(),t=t.memoizedState,n=bo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Jo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=$a.updateQueue,t===null&&(t=xo(),$a.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Yo(){return bo().memoizedState}function Xo(e,t,n,r){var i=yo();$a.flags|=e,i.memoizedState=Jo(1|t,{destroy:void 0},n,r===void 0?null:r)}function Zo(e,t,n,r){var i=bo();r=r===void 0?null:r;var a=i.memoizedState.inst;eo!==null&&r!==null&&uo(r,eo.memoizedState.deps)?i.memoizedState=Jo(t,a,n,r):($a.flags|=e,i.memoizedState=Jo(1|t,a,n,r))}function Qo(e,t){Xo(8390656,8,e,t)}function $o(e,t){Zo(2048,8,e,t)}function es(e){$a.flags|=4;var t=$a.updateQueue;if(t===null)t=xo(),$a.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ts(e){var t=bo().memoizedState;return es({ref:t,nextImpl:e}),function(){if(Tl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ns(e,t){return Zo(4,2,e,t)}function rs(e,t){return Zo(4,4,e,t)}function is(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function as(e,t,n){n=n==null?null:n.concat([e]),Zo(4,4,is.bind(null,t,e),n)}function ss(){}function cs(e,t){var n=bo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&uo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ls(e,t){var n=bo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&uo(t,r[1]))return r[0];if(r=e(),io){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r}function us(e,t,n){return n===void 0||Qa&1073741824&&!(Ol&261930)?e.memoizedState=t:(e.memoizedState=n,e=au(),$a.lanes|=e,Il|=e,n)}function ds(e,t,n,r){return cr(n,t)?n:Ra.current===null?!(Qa&42)||Qa&1073741824&&!(Ol&261930)?(Hs=!0,e.memoizedState=n):(e=au(),$a.lanes|=e,Il|=e,t):(e=us(e,n,r),cr(e,t)||(Hs=!0),e)}function fs(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,Ss(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?xs(e,t,na(c,r),iu(e)):xs(e,t,r,iu(e))}catch(n){xs(e,t,{then:function(){},status:`rejected`,reason:n},iu())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function ps(){}function ms(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=hs(e).queue;fs(e,a,t,ee,n===null?ps:function(){return gs(e),n(r)})}function hs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:To,lastRenderedState:ee},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:To,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function gs(e){var t=hs(e);t.next===null&&(t=e.alternate.memoizedState),xs(e,t.next.queue,{},iu())}function _s(){return Vi(zf)}function vs(){return bo().memoizedState}function ys(){return bo().memoizedState}function hee(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=iu();e=ka(n);var r=Aa(t,e,n);r!==null&&(ou(r,t,n),ja(r,t,n)),t={cache:Ji()},e.payload=t;return}t=t.return}}function gee(e,t,n){var r=iu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Cs(e)?ws(t,n):(n=Vr(e,t,n,r),n!==null&&(ou(n,e,r),Ts(n,t,r)))}function bs(e,t,n){xs(e,t,n,iu())}function xs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cs(e))ws(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,cr(s,o))return Br(e,t,i,0),El===null&&zr(),!1}catch{}if(n=Vr(e,t,i,r),n!==null)return ou(n,e,r),Ts(n,t,r),!0}return!1}function Ss(e,t,n,r){if(r={lane:2,revertLane:ed(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Cs(e)){if(t)throw Error(i(479))}else t=Vr(e,n,r,2),t!==null&&ou(t,e,2)}function Cs(e){var t=e.alternate;return e===$a||t!==null&&t===$a}function ws(e,t){ro=no=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ts(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}var Es={readContext:Vi,use:Co,useCallback:lo,useContext:lo,useEffect:lo,useImperativeHandle:lo,useLayoutEffect:lo,useInsertionEffect:lo,useMemo:lo,useReducer:lo,useRef:lo,useState:lo,useDebugValue:lo,useDeferredValue:lo,useTransition:lo,useSyncExternalStore:lo,useId:lo,useHostTransitionStatus:lo,useFormState:lo,useActionState:lo,useOptimistic:lo,useMemoCache:lo,useCacheRefresh:lo};Es.useEffectEvent=lo;var Ds={readContext:Vi,use:Co,useCallback:function(e,t){return yo().memoizedState=[e,t===void 0?null:t],e},useContext:Vi,useEffect:Qo,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Xo(4194308,4,is.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xo(4194308,4,e,t)},useInsertionEffect:function(e,t){Xo(4,2,e,t)},useMemo:function(e,t){var n=yo();t=t===void 0?null:t;var r=e();if(io){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=yo();if(n!==void 0){var i=n(t);if(io){Fe(!0);try{n(t)}finally{Fe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=gee.bind(null,$a,e),[r.memoizedState,e]},useRef:function(e){var t=yo();return e={current:e},t.memoizedState=e},useState:function(e){e=Fo(e);var t=e.queue,n=bs.bind(null,$a,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ss,useDeferredValue:function(e,t){return us(yo(),e,t)},useTransition:function(){var e=Fo(!1);return e=fs.bind(null,$a,e.queue,!0,!1),yo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=$a,a=yo();if(bi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),El===null)throw Error(i(349));Ol&127||Ao(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Qo(Mo.bind(null,r,o,e),[e]),r.flags|=2048,Jo(9,{destroy:void 0},jo.bind(null,r,o,n,t),null),n},useId:function(){var e=yo(),t=El.identifierPrefix;if(bi){var n=fi,r=di;n=(r&~(1<<32-Ie(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ao++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=co++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:_s,useFormState:Uo,useActionState:Uo,useOptimistic:function(e){var t=yo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ss.bind(null,$a,!0,n),n.dispatch=t,[e,t]},useMemoCache:wo,useCacheRefresh:function(){return yo().memoizedState=hee.bind(null,$a)},useEffectEvent:function(e){var t=yo(),n={impl:e};return t.memoizedState=n,function(){if(Tl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Os={readContext:Vi,use:Co,useCallback:cs,useContext:Vi,useEffect:$o,useImperativeHandle:as,useInsertionEffect:ns,useLayoutEffect:rs,useMemo:ls,useReducer:Eo,useRef:Yo,useState:function(){return Eo(To)},useDebugValue:ss,useDeferredValue:function(e,t){return ds(bo(),eo.memoizedState,e,t)},useTransition:function(){var e=Eo(To)[0],t=bo().memoizedState;return[typeof e==`boolean`?e:So(e),t]},useSyncExternalStore:ko,useId:vs,useHostTransitionStatus:_s,useFormState:Wo,useActionState:Wo,useOptimistic:function(e,t){return Io(bo(),eo,e,t)},useMemoCache:wo,useCacheRefresh:ys};Os.useEffectEvent=ts;var ks={readContext:Vi,use:Co,useCallback:cs,useContext:Vi,useEffect:$o,useImperativeHandle:as,useInsertionEffect:ns,useLayoutEffect:rs,useMemo:ls,useReducer:Oo,useRef:Yo,useState:function(){return Oo(To)},useDebugValue:ss,useDeferredValue:function(e,t){var n=bo();return eo===null?us(n,e,t):ds(n,eo.memoizedState,e,t)},useTransition:function(){var e=Oo(To)[0],t=bo().memoizedState;return[typeof e==`boolean`?e:So(e),t]},useSyncExternalStore:ko,useId:vs,useHostTransitionStatus:_s,useFormState:qo,useActionState:qo,useOptimistic:function(e,t){var n=bo();return eo===null?(n.baseState=e,[e,n.queue.dispatch]):Io(n,eo,e,t)},useMemoCache:wo,useCacheRefresh:ys};ks.useEffectEvent=ts;function As(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var js={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=iu(),i=ka(r);i.payload=t,n!=null&&(i.callback=n),t=Aa(e,i,r),t!==null&&(ou(t,e,r),ja(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=iu(),i=ka(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Aa(e,i,r),t!==null&&(ou(t,e,r),ja(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=iu(),r=ka(n);r.tag=2,t!=null&&(r.callback=t),t=Aa(e,r,n),t!==null&&(ou(t,e,n),ja(t,e,n))}};function Ms(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!lr(n,r)||!lr(i,a):!0}function Ns(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&js.enqueueReplaceState(t,t.state,null)}function Ps(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Fs(e){Fr(e)}function _ee(e){console.error(e)}function vee(e){Fr(e)}function Is(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ls(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Rs(e,t,n){return n=ka(n),n.tag=3,n.payload={element:null},n.callback=function(){Is(e,t)},n}function zs(e){return e=ka(e),e.tag=3,e}function Bs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ls(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ls(t,n,r),typeof i!=`function`&&(Jl===null?Jl=new Set([this]):Jl.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function yee(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ri(t,n,a,!0),n=Ua.current,n!==null){switch(n.tag){case 31:case 13:return Wa===null?vu():n.alternate===null&&Fl===0&&(Fl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===da?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Lu(e,r,a)),!1;case 22:return n.flags|=65536,r===da?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Lu(e,r,a)),!1}throw Error(i(435,n.tag))}return Lu(e,r,a),vu(),!1}if(bi)return t=Ua.current,t===null?(r!==Ci&&(t=Error(i(423),{cause:r}),Ai(ri(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ri(r,n),a=Rs(e.stateNode,r,a),Ma(e,a),Fl!==4&&(Fl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ci&&(e=Error(i(422),{cause:r}),Ai(ri(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ri(o,n),Vl===null?Vl=[o]:Vl.push(o),Fl!==4&&(Fl=2),t===null)return!0;r=ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Rs(n.stateNode,r,e),Ma(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Jl===null||!Jl.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=zs(a),Bs(a,e,n,r),Ma(n,a),!1}n=n.return}while(n!==null);return!1}var Vs=Error(i(461)),Hs=!1;function Us(e,t,n,r){t.child=e===null?Ta(t,null,n,r):wa(t,e.child,n,r)}function Ws(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Bi(t),r=fo(e,t,n,o,a,i),s=go(),e!==null&&!Hs?(_o(e,t,i),pc(e,t,i)):(bi&&s&&hi(t),t.flags|=1,Us(e,t,r,i),t.child)}function Gs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Jr(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Ks(e,t,a,r,i)):(e=Zr(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!mc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?lr:n,n(o,r)&&e.ref===t.ref)return pc(e,t,i)}return t.flags|=1,e=Yr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ks(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(lr(a,r)&&e.ref===t.ref)if(Hs=!1,t.pendingProps=r=a,mc(e,i))e.flags&131072&&(Hs=!0);else return t.lanes=e.lanes,pc(e,t,i)}return $s(e,t,n,r,i)}function qs(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Ys(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&oa(t,a===null?null:a.cachePool),a===null?Va():Ba(t,a),qa(t);else return r=t.lanes=536870912,Ys(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&oa(t,null),Va(),Ja(t)):(oa(t,a.cachePool),Ba(t,a),Ja(t),t.memoizedState=null);return Us(e,t,i,n),t.child}function Js(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ys(e,t,n,r,i){var a=aa();return a=a===null?null:{parent:qi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&oa(t,null),Va(),qa(t),e!==null&&Ri(e,t,r,!0),t.childLanes=i,null}function Xs(e,t){return t=cc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Zs(e,t,n){return wa(t,e.child,null,n),e=Xs(t,t.pendingProps),e.flags|=2,Ya(t),t.memoizedState=null,e}function bee(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(bi){if(r.mode===`hidden`)return e=Xs(t,r),t.lanes=536870912,Js(null,e);if(Ka(t),(e=yi)?(e=qd(e,Si),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ui===null?null:{id:di,overflow:fi},retryLane:536870912,hydrationErrors:null},n=ei(e),n.return=t,t.child=n,vi=t,yi=null)):e=null,e===null)throw wi(t);return t.lanes=536870912,null}return Xs(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ka(t),a)if(t.flags&256)t.flags&=-257,t=Zs(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Hs||Ri(e,t,n,!1),a=(n&e.childLanes)!==0,Hs||a){if(r=El,r!==null&&(s=$e(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Hr(e,s),ou(r,e,s),Vs;vu(),t=Zs(e,t,n)}else e=o.treeContext,yi=Xd(s.nextSibling),vi=t,bi=!0,xi=null,Si=!1,e!==null&&_i(t,e),t=Xs(t,r),t.flags|=4096;return t}return e=Yr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Qs(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function $s(e,t,n,r,i){return Bi(t),n=fo(e,t,n,r,void 0,i),r=go(),e!==null&&!Hs?(_o(e,t,i),pc(e,t,i)):(bi&&r&&hi(t),t.flags|=1,Us(e,t,n,i),t.child)}function ec(e,t,n,r,i,a){return Bi(t),t.updateQueue=null,n=mo(t,r,n,i),po(e),r=go(),e!==null&&!Hs?(_o(e,t,a),pc(e,t,a)):(bi&&r&&hi(t),t.flags|=1,Us(e,t,n,a),t.child)}function tc(e,t,n,r,i){if(Bi(t),t.stateNode===null){var a=Gr,o=n.contextType;typeof o==`object`&&o&&(a=Vi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=js,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Da(t),o=n.contextType,a.context=typeof o==`object`&&o?Vi(o):Gr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(As(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&js.enqueueReplaceState(a,a.state,null),Fa(t,r,a,i),Pa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ps(n,s);a.props=c;var l=a.context,u=n.contextType;o=Gr,typeof u==`object`&&u&&(o=Vi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ns(t,a,r,o),Ea=!1;var f=t.memoizedState;a.state=f,Fa(t,r,a,i),Pa(),l=t.memoizedState,s||f!==l||Ea?(typeof d==`function`&&(As(t,n,d,r),l=t.memoizedState),(c=Ea||Ms(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Oa(e,t),o=t.memoizedProps,u=Ps(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Gr,typeof l==`object`&&l&&(c=Vi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ns(t,a,r,c),Ea=!1,f=t.memoizedState,a.state=f,Fa(t,r,a,i),Pa();var p=t.memoizedState;o!==d||f!==p||Ea||e!==null&&e.dependencies!==null&&zi(e.dependencies)?(typeof s==`function`&&(As(t,n,s,r),p=t.memoizedState),(u=Ea||Ms(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Qs(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=wa(t,e.child,null,i),t.child=wa(t,null,n,i)):Us(e,t,n,i),t.memoizedState=a.state,e=t.child):e=pc(e,t,i),e}function nc(e,t,n,r){return Oi(),t.flags|=256,Us(e,t,n,r),t.child}var rc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ic(e){return{baseLanes:e,cachePool:sa()}}function ac(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=zl),e}function oc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(Xa.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(bi){if(a?Ga(t):Ja(t),(e=yi)?(e=qd(e,Si),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ui===null?null:{id:di,overflow:fi},retryLane:536870912,hydrationErrors:null},n=ei(e),n.return=t,t.child=n,vi=t,yi=null)):e=null,e===null)throw wi(t);return Yd(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(Ja(t),a=t.mode,c=cc({mode:`hidden`,children:c},a),r=Qr(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=ic(n),r.childLanes=ac(e,s,n),t.memoizedState=rc,Js(null,r)):(Ga(t),sc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Ga(t),t.flags&=-257,t=lc(e,t,n)):t.memoizedState===null?(Ja(t),c=r.fallback,a=t.mode,r=cc({mode:`visible`,children:r.children},a),c=Qr(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,wa(t,e.child,null,n),r=t.child,r.memoizedState=ic(n),r.childLanes=ac(e,s,n),t.memoizedState=rc,t=Js(null,r)):(Ja(t),t.child=e.child,t.flags|=128,t=null);else if(Ga(t),Yd(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ai({value:r,source:null,stack:null}),t=lc(e,t,n)}else if(Hs||Ri(e,t,n,!1),s=(n&e.childLanes)!==0,Hs||s){if(s=El,s!==null&&(r=$e(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Hr(e,r),ou(s,e,r),Vs;Jd(c)||vu(),t=lc(e,t,n)}else Jd(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,yi=Xd(c.nextSibling),vi=t,bi=!0,xi=null,Si=!1,e!==null&&_i(t,e),t=sc(t,r.children),t.flags|=4096);return t}return a?(Ja(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=Yr(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=Qr(c,a,n,null),c.flags|=2):c=Yr(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,Js(null,r),r=t.child,c=e.child.memoizedState,c===null?c=ic(n):(a=c.cachePool,a===null?a=sa():(l=qi._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=ac(e,s,n),t.memoizedState=rc,Js(e.child,r)):(Ga(t),n=e.child,e=n.sibling,n=Yr(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function sc(e,t){return t=cc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function cc(e,t){return e=qr(22,e,null,t),e.lanes=0,e}function lc(e,t,n){return wa(t,e.child,null,n),e=sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function uc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ii(e.return,t,n)}function dc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function fc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Xa.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,ie(Xa,o),Us(e,t,r,n),r=bi?si:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&uc(e,n,t);else if(e.tag===19)uc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Za(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),dc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Za(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}dc(t,!0,n,null,a,r);break;case`together`:dc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function pc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Il|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ri(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Yr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function mc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&zi(e))):!0}function hc(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Pi(t,qi,e.memoizedState.cache),Oi();break;case 27:case 5:ue(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Pi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ka(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ga(t),e=pc(e,t,n),e===null?null:e.sibling):oc(e,t,n):(Ga(t),t.flags|=128,null);Ga(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ri(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return fc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ie(Xa,Xa.current),r)break;return null;case 22:return t.lanes=0,qs(e,t,n,t.pendingProps);case 24:Pi(t,qi,e.memoizedState.cache)}return pc(e,t,n)}function gc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Hs=!0;else{if(!mc(e,n)&&!(t.flags&128))return Hs=!1,hc(e,t,n);Hs=!!(e.flags&131072)}else Hs=!1,bi&&t.flags&1048576&&mi(t,si,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ma(t.elementType),t.type=e,typeof e==`function`)Jr(e)?(r=Ps(e,r),t.tag=1,t=tc(null,t,e,r,n)):(t.tag=0,t=$s(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=Ws(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=Gs(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return $s(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ps(r,t.pendingProps),tc(e,t,r,a,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Oa(e,t),Fa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Pi(t,qi,r),r!==o.cache&&Li(t,[qi],n,!0),Pa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=nc(e,t,r,n);break a}else if(r!==a){a=ri(Error(i(424)),t),Ai(a),t=nc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(yi=Xd(e.firstChild),vi=t,bi=!0,xi=null,Si=!0,n=Ta(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Oi(),r===a){t=pc(e,t,n);break a}Us(e,t,r,n)}t=t.child}return t;case 26:return Qs(e,t),e===null?(n=gf(t.type,null,t.pendingProps,null))?t.memoizedState=n:bi||(n=t.type,e=t.pendingProps,r=Ad(oe.current).createElement(n),r[at]=t,r[ot]=e,Td(r,n,e),_t(r),t.stateNode=r):t.memoizedState=gf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&bi&&(r=t.stateNode=ef(t.type,t.pendingProps,oe.current),vi=t,Si=!0,a=yi,Vd(t.type)?(Zd=a,yi=Xd(r.firstChild)):yi=a),Us(e,t,t.pendingProps.children,n),Qs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&bi&&((a=r=yi)&&(r=Gd(r,t.type,t.pendingProps,Si),r===null?a=!1:(t.stateNode=r,vi=t,yi=Xd(r.firstChild),Si=!1,a=!0)),a||wi(t)),ue(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Nd(a,o)?r=null:s!==null&&Nd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=fo(e,t,ho,null,null,n),zf._currentValue=a),Qs(e,t),Us(e,t,r,n),t.child;case 6:return e===null&&bi&&((e=n=yi)&&(n=Kd(n,t.pendingProps,Si),n===null?e=!1:(t.stateNode=n,vi=t,yi=null,e=!0)),e||wi(t)),null;case 13:return oc(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wa(t,null,r,n):Us(e,t,r,n),t.child;case 11:return Ws(e,t,t.type,t.pendingProps,n);case 7:return Us(e,t,t.pendingProps,n),t.child;case 8:return Us(e,t,t.pendingProps.children,n),t.child;case 12:return Us(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Pi(t,t.type,r.value),Us(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Bi(t),a=Vi(a),r=r(a),t.flags|=1,Us(e,t,r,n),t.child;case 14:return Gs(e,t,t.type,t.pendingProps,n);case 15:return Ks(e,t,t.type,t.pendingProps,n);case 19:return fc(e,t,n);case 31:return bee(e,t,n);case 22:return qs(e,t,n,t.pendingProps);case 24:return Bi(t),r=Vi(qi),e===null?(a=aa(),a===null&&(a=El,o=Ji(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Da(t),Pi(t,qi,a)):((e.lanes&n)!==0&&(Oa(e,t),Fa(t,null,null,n),Pa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Pi(t,qi,r),r!==a.cache&&Li(t,[qi],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Pi(t,qi,r))),Us(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function _c(e){e.flags|=4}function vc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(hu())e.flags|=8192;else throw ha=da,la}else e.flags&=-16777217}function yc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!jf(t))if(hu())e.flags|=8192;else throw ha=da,la}function bc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:qe(),e.lanes|=t,Bl|=t)}function xc(e,t){if(!bi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Sc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Cc(e,t,n){var r=t.pendingProps;switch(gi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Sc(t),null;case 1:return Sc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Fi(qi),le(),n.pendingContext&&=(n.context=n.pendingContext,null),(e===null||e.child===null)&&(Di(t)?_c(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ki())),Sc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(_c(t),o===null?(Sc(t),vc(t,a,null,r,n)):(Sc(t),yc(t,o))):o?o===e.memoizedState?(Sc(t),t.flags&=-16777217):(_c(t),Sc(t),yc(t,o)):(e=e.memoizedProps,e!==r&&_c(t),Sc(t),vc(t,a,e,r,n)),null;case 27:if(de(t),n=oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&_c(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Sc(t),null}e=z.current,Di(t)?Ti(t,e):(e=ef(a,r,n),t.stateNode=e,_c(t))}return Sc(t),null;case 5:if(de(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&_c(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Sc(t),null}if(o=z.current,Di(t))Ti(t,o);else{var s=Ad(oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[at]=t,o[ot]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Td(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&_c(t)}}return Sc(t),vc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&_c(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=oe.current,Di(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=vi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Sd(e.nodeValue,n)),e||wi(t,!0)}else e=Ad(e).createTextNode(r),e[at]=t,t.stateNode=e}return Sc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Di(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[at]=t}else Oi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Sc(t),e=!1}else n=ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ya(t),t):(Ya(t),null);if(t.flags&128)throw Error(i(558))}return Sc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Di(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[at]=t}else Oi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Sc(t),a=!1}else a=ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ya(t),t):(Ya(t),null)}return Ya(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),bc(t,t.updateQueue),Sc(t),null);case 4:return le(),e===null&&fd(t.stateNode.containerInfo),Sc(t),null;case 10:return Fi(t.type),Sc(t),null;case 19:if(re(Xa),r=t.memoizedState,r===null)return Sc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)xc(r,!1);else{if(Fl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Za(e),o!==null){for(t.flags|=128,xc(r,!1),e=o.updateQueue,t.updateQueue=e,bc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Xr(n,e),n=n.sibling;return ie(Xa,Xa.current&1|2),bi&&pi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&we()>Kl&&(t.flags|=128,a=!0,xc(r,!1),t.lanes=4194304)}else{if(!a)if(e=Za(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,bc(t,e),xc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!bi)return Sc(t),null}else 2*we()-r.renderingStartTime>Kl&&n!==536870912&&(t.flags|=128,a=!0,xc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Sc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=we(),e.sibling=null,n=Xa.current,ie(Xa,a?n&1|2:n&1),bi&&pi(t,r.treeForkCount),e);case 22:case 23:return Ya(t),Ha(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Sc(t),t.subtreeFlags&6&&(t.flags|=8192)):Sc(t),n=t.updateQueue,n!==null&&bc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&re(ia),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Fi(qi),Sc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function wc(e,t){switch(gi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fi(qi),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(Ya(t),t.alternate===null)throw Error(i(340));Oi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ya(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Oi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(Xa),null;case 4:return le(),null;case 10:return Fi(t.type),null;case 22:case 23:return Ya(t),Ha(),e!==null&&re(ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fi(qi),null;case 25:return null;default:return null}}function Tc(e,t){switch(gi(t),t.tag){case 3:Fi(qi),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&Ya(t);break;case 13:Ya(t);break;case 19:re(Xa);break;case 10:Fi(t.type);break;case 22:case 23:Ya(t),Ha(),e!==null&&re(ia);break;case 24:Fi(qi)}}function Ec(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Iu(t,t.return,e)}}function Dc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Iu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Iu(t,t.return,e)}}function Oc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{La(t,n)}catch(t){Iu(e,e.return,t)}}}function kc(e,t,n){n.props=Ps(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Iu(e,t,n)}}function Ac(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Iu(e,t,n)}}function jc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Iu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Iu(e,t,n)}else n.current=null}function Mc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Iu(e,e.return,t)}}function Nc(e,t,n){try{var r=e.stateNode;Ed(r,e.type,n,t),r[ot]=t}catch(t){Iu(e,e.return,t)}}function Pc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vd(e.type)||e.tag===4}function Fc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Pc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Vd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ic(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xt));else if(r!==4&&(r===27&&Vd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Ic(e,t,n),e=e.sibling;e!==null;)Ic(e,t,n),e=e.sibling}function Lc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Vd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Lc(e,t,n),e=e.sibling;e!==null;)Lc(e,t,n),e=e.sibling}function Rc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Td(t,r,n),t[at]=e,t[ot]=n}catch(t){Iu(e,e.return,t)}}var zc=!1,Bc=!1,Vc=!1,Hc=typeof WeakSet==`function`?WeakSet:Set,Uc=null;function Wc(e,t){if(e=e.containerInfo,Od=qf,e=pr(e),mr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(kd={focusedElem:e,selectionRange:n},qf=!1,Uc=t;Uc!==null;)if(t=Uc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Uc=e;else for(;Uc!==null;){switch(t=Uc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ps(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Iu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Wd(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:Wd(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Uc=e;break}Uc=t.return}}
vendor: 5,668 bytes, line 9
9function Gc(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ol(e,n),r&4&&Ec(5,n);break;case 1:if(ol(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Iu(n,n.return,e)}else{var i=Ps(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Iu(n,n.return,e)}}r&64&&Oc(n),r&512&&Ac(n,n.return);break;case 3:if(ol(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{La(e,t)}catch(e){Iu(n,n.return,e)}}break;case 27:t===null&&r&4&&Rc(n);case 26:case 5:ol(e,n),t===null&&r&4&&Mc(n),r&512&&Ac(n,n.return);break;case 12:ol(e,n);break;case 31:ol(e,n),r&4&&Zc(e,n);break;case 13:ol(e,n),r&4&&Qc(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=See.bind(null,n),Tee(e,n))));break;case 22:if(r=n.memoizedState!==null||zc,!r){t=t!==null&&t.memoizedState!==null||Bc,i=zc;var a=Bc;zc=r,(Bc=t)&&!a?cl(e,n,(n.subtreeFlags&8772)!=0):ol(e,n),zc=i,Bc=a}break;case 30:break;default:ol(e,n)}}function Kc(e){var t=e.alternate;t!==null&&(e.alternate=null,Kc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ft(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var qc=null,Jc=!1;function Yc(e,t,n){for(n=n.child;n!==null;)Xc(e,t,n),n=n.sibling}function Xc(e,t,n){if(Pe&&typeof Pe.onCommitFiberUnmount==`function`)try{Pe.onCommitFiberUnmount(Ne,n)}catch{}switch(n.tag){case 26:Bc||jc(n,t),Yc(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Bc||jc(n,t);var r=qc,i=Jc;Vd(n.type)&&(qc=n.stateNode,Jc=!1),Yc(e,t,n),tf(n.stateNode),qc=r,Jc=i;break;case 5:Bc||jc(n,t);case 6:if(r=qc,i=Jc,qc=null,Yc(e,t,n),qc=r,Jc=i,qc!==null)if(Jc)try{(qc.nodeType===9?qc.body:qc.nodeName===`HTML`?qc.ownerDocument.body:qc).removeChild(n.stateNode)}catch(e){Iu(n,t,e)}else try{qc.removeChild(n.stateNode)}catch(e){Iu(n,t,e)}break;case 18:qc!==null&&(Jc?(e=qc,Hd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),gp(e)):Hd(qc,n.stateNode));break;case 4:r=qc,i=Jc,qc=n.stateNode.containerInfo,Jc=!0,Yc(e,t,n),qc=r,Jc=i;break;case 0:case 11:case 14:case 15:Dc(2,n,t),Bc||Dc(4,n,t),Yc(e,t,n);break;case 1:Bc||(jc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&kc(n,t,r)),Yc(e,t,n);break;case 21:Yc(e,t,n);break;case 22:Bc=(r=Bc)||n.memoizedState!==null,Yc(e,t,n),Bc=r;break;default:Yc(e,t,n)}}function Zc(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gp(e)}catch(e){Iu(t,t.return,e)}}}function Qc(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gp(e)}catch(e){Iu(t,t.return,e)}}function $c(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Hc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Hc),t;default:throw Error(i(435,e.tag))}}function el(e,t){var n=$c(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Cee.bind(null,e,t);t.then(r,r)}})}function tl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Vd(c.type)){qc=c.stateNode,Jc=!1;break a}break;case 5:qc=c.stateNode,Jc=!1;break a;case 3:case 4:qc=c.stateNode.containerInfo,Jc=!0;break a}c=c.return}if(qc===null)throw Error(i(160));Xc(o,s,a),qc=null,Jc=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)rl(t,e),t=t.sibling}var nl=null;function rl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:tl(t,e),il(e),r&4&&(Dc(3,e,e.return),Ec(3,e),Dc(5,e,e.return));break;case 1:tl(t,e),il(e),r&512&&(Bc||n===null||jc(n,n.return)),r&64&&zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=nl;if(tl(t,e),il(e),r&512&&(Bc||n===null||jc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[dt]||o[at]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Td(o,r,n),o[at]=e,_t(o),r=o;break a;case`link`:var s=Of(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Td(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Of(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Td(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[at]=e,_t(o),r=o}e.stateNode=r}else kf(a,e.type,e.stateNode);else e.stateNode=Cf(a,r,e.memoizedProps);
vendor: 23,091 bytes, line 9
9else o===r?r===null&&e.stateNode!==null&&Nc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?kf(a,e.type,e.stateNode):Cf(a,r,e.memoizedProps))}break;case 27:tl(t,e),il(e),r&512&&(Bc||n===null||jc(n,n.return)),n!==null&&r&4&&Nc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(tl(t,e),il(e),r&512&&(Bc||n===null||jc(n,n.return)),e.flags&32){a=e.stateNode;try{Ut(a,``)}catch(t){Iu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Nc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Vc=!0);break;case 6:if(tl(t,e),il(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Iu(e,e.return,t)}}break;case 3:if(Df=null,a=nl,nl=af(t.containerInfo),tl(t,e),nl=a,il(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{gp(t.containerInfo)}catch(t){Iu(e,e.return,t)}Vc&&(Vc=!1,al(e));break;case 4:r=nl,nl=af(e.stateNode.containerInfo),tl(t,e),il(e),nl=r;break;case 12:tl(t,e),il(e);break;case 31:tl(t,e),il(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,el(e,r)));break;case 13:tl(t,e),il(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Wl=we()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,el(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=zc,d=Bc;if(zc=u||a,Bc=d||l,tl(t,e),Bc=d,zc=u,il(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||zc||Bc||sl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Iu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Iu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?Ud(m,!0):Ud(l.stateNode,!1)}catch(e){Iu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,el(e,n))));break;case 19:tl(t,e),il(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,el(e,r)));break;case 30:break;case 21:break;default:tl(t,e),il(e)}}function il(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Pc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Lc(e,Fc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ut(o,``),n.flags&=-33),Lc(e,Fc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Ic(e,Fc(e),s);break;default:throw Error(i(161))}}catch(t){Iu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function al(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;al(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ol(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Gc(e,t.alternate,t),t=t.sibling}function sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Dc(4,t,t.return),sl(t);break;case 1:jc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&kc(t,t.return,n),sl(t);break;case 27:tf(t.stateNode);case 26:case 5:jc(t,t.return),sl(t);break;case 22:t.memoizedState===null&&sl(t);break;case 30:sl(t);break;default:sl(t)}e=e.sibling}}function cl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:cl(i,a,n),Ec(4,a);break;case 1:if(cl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Iu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ia(c[i],s)}catch(e){Iu(r,r.return,e)}}n&&o&64&&Oc(a),Ac(a,a.return);break;case 27:Rc(a);case 26:case 5:cl(i,a,n),n&&r===null&&o&4&&Mc(a),Ac(a,a.return);break;case 12:cl(i,a,n);break;case 31:cl(i,a,n),n&&o&4&&Zc(i,a);break;case 13:cl(i,a,n),n&&o&4&&Qc(i,a);break;case 22:a.memoizedState===null&&cl(i,a,n),Ac(a,a.return);break;case 30:break;default:cl(i,a,n)}t=t.sibling}}function ll(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Yi(n))}function ul(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Yi(e))}function dl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)fl(e,t,n,r),t=t.sibling}function fl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:dl(e,t,n,r),i&2048&&Ec(9,t);break;case 1:dl(e,t,n,r);break;case 3:dl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Yi(e)));break;case 12:if(i&2048){dl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Iu(t,t.return,e)}}else dl(e,t,n,r);break;case 31:dl(e,t,n,r);break;case 13:dl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?dl(e,t,n,r):(a._visibility|=2,pl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?dl(e,t,n,r):ml(e,t),i&2048&&ll(o,t);break;case 24:dl(e,t,n,r),i&2048&&ul(t.alternate,t);break;default:dl(e,t,n,r)}}function pl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:pl(a,o,s,c,i),Ec(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,pl(a,o,s,c,i)):u._visibility&2?pl(a,o,s,c,i):ml(a,o),i&&l&2048&&ll(o.alternate,o);break;case 24:pl(a,o,s,c,i),i&&l&2048&&ul(o.alternate,o);break;default:pl(a,o,s,c,i)}t=t.sibling}}function ml(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:ml(n,r),i&2048&&ll(r.alternate,r);break;case 24:ml(n,r),i&2048&&ul(r.alternate,r);break;default:ml(n,r)}t=t.sibling}}var hl=8192;function gl(e,t,n){if(e.subtreeFlags&hl)for(e=e.child;e!==null;)_l(e,t,n),e=e.sibling}function _l(e,t,n){switch(e.tag){case 26:gl(e,t,n),e.flags&hl&&e.memoizedState!==null&&Mf(n,nl,e.memoizedState,e.memoizedProps);break;case 5:gl(e,t,n);break;case 3:case 4:var r=nl;nl=af(e.stateNode.containerInfo),gl(e,t,n),nl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=hl,hl=16777216,gl(e,t,n),hl=r):gl(e,t,n));break;default:gl(e,t,n)}}function vl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function yl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Uc=r,Sl(r,e)}vl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)bl(e),e=e.sibling}function bl(e){switch(e.tag){case 0:case 11:case 15:yl(e),e.flags&2048&&Dc(9,e,e.return);break;case 3:yl(e);break;case 12:yl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,xl(e)):yl(e);break;default:yl(e)}}function xl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Uc=r,Sl(r,e)}vl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Dc(8,t,t.return),xl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,xl(t));break;default:xl(t)}e=e.sibling}}function Sl(e,t){for(;Uc!==null;){var n=Uc;switch(n.tag){case 0:case 11:case 15:Dc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Yi(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Uc=r;else a:for(n=e;Uc!==null;){r=Uc;var i=r.sibling,a=r.return;if(Kc(r),r===n){Uc=null;break a}if(i!==null){i.return=a,Uc=i;break a}Uc=a}}}var Cl={getCacheForType:function(e){var t=Vi(qi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Vi(qi).controller.signal}},wl=typeof WeakMap==`function`?WeakMap:Map,Tl=0,El=null,Dl=null,Ol=0,kl=0,Al=null,jl=!1,Ml=!1,Nl=!1,Pl=0,Fl=0,Il=0,Ll=0,Rl=0,zl=0,Bl=0,Vl=null,Hl=null,Ul=!1,Wl=0,Gl=0,Kl=1/0,ql=null,Jl=null,Yl=0,Xl=null,Zl=null,Ql=0,$l=0,eu=null,tu=null,nu=0,ru=null;function iu(){return Tl&2&&Ol!==0?Ol&-Ol:I.T===null?nt():ed()}function au(){if(zl===0)if(!(Ol&536870912)||bi){var e=Ve;Ve<<=1,!(Ve&3932160)&&(Ve=262144),zl=e}else zl=536870912;return e=Ua.current,e!==null&&(e.flags|=32),zl}function ou(e,t,n){(e===El&&(kl===2||kl===9)||e.cancelPendingCommit!==null)&&(pu(e,0),uu(e,Ol,zl,!1)),Ye(e,n),(!(Tl&2)||e!==El)&&(e===El&&(!(Tl&2)&&(Ll|=n),Fl===4&&uu(e,Ol,zl,!1)),Ku(e))}function su(e,t,n){if(Tl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ge(e,t),a=r?xu(e,t):yu(e,t,!0),o=r;do{if(a===0){Ml&&!r&&uu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!lu(n)){a=yu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Vl;var l=c.current.memoizedState.isDehydrated;if(l&&(pu(c,s).flags|=256),s=yu(c,s,!1),s!==2){if(Nl&&!l){c.errorRecoveryDisabledLanes|=o,Ll|=o,a=4;break a}o=Hl,Hl=a,o!==null&&(Hl===null?Hl=o:Hl.push.apply(Hl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){pu(e,0),uu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:uu(r,t,zl,!jl);break a;case 2:Hl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Wl+300-we(),10<a)){if(uu(r,t,zl,!jl),We(r,0,!0)!==0)break a;Ql=t,r.timeoutHandle=Id(cu.bind(null,r,n,Hl,ql,Ul,t,zl,Ll,Bl,jl,o,`Throttled`,-0,0),a);break a}cu(r,n,Hl,ql,Ul,t,zl,Ll,Bl,jl,o,null,-0,0)}}break}while(1);Ku(e)}function cu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},_l(t,a,d);var m=(a&62914560)===a?Wl-we():(a&4194048)===a?Gl-we():0;if(m=Pf(d,m),m!==null){Ql=a,e.cancelPendingCommit=m(Ou.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),uu(e,a,o,!l);return}}Ou(e,t,a,n,r,i,o,s,c)}function lu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!cr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function uu(e,t,n,r){t&=~Rl,t&=~Ll,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ie(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ze(e,n,t)}function du(){return Tl&6?!0:(qu(0,!1),!1)}function fu(){if(Dl!==null){if(kl===0)var e=Dl.return;else e=Dl,Ni=Mi=null,vo(e),va=null,ya=0,e=Dl;for(;e!==null;)Tc(e.alternate,e),e=e.return;Dl=null}}function pu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Ld(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ql=0,fu(),El=e,Dl=n=Yr(e.current,null),Ol=t,kl=0,Al=null,jl=!1,Ml=Ge(e,t),Nl=!1,Bl=zl=Rl=Ll=Il=Fl=0,Hl=Vl=null,Ul=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ie(r),a=1<<i;t|=e[i],r&=~a}return Pl=t,zr(),n}function mu(e,t){$a=null,I.H=Es,t===ca||t===ua?(t=ga(),kl=3):t===la?(t=ga(),kl=4):kl=t===Vs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Al=t,Dl===null&&(Fl=1,Is(e,ri(t,e.current)))}function hu(){var e=Ua.current;return e===null?!0:(Ol&4194048)===Ol?Wa===null:(Ol&62914560)===Ol||Ol&536870912?e===Wa:!1}function gu(){var e=I.H;return I.H=Es,e===null?Es:e}function _u(){var e=I.A;return I.A=Cl,e}function vu(){Fl=4,jl||(Ol&4194048)!==Ol&&Ua.current!==null||(Ml=!0),!(Il&134217727)&&!(Ll&134217727)||El===null||uu(El,Ol,zl,!1)}function yu(e,t,n){var r=Tl;Tl|=2;var i=gu(),a=_u();(El!==e||Ol!==t)&&(ql=null,pu(e,t)),t=!1;var o=Fl;a:do try{if(kl!==0&&Dl!==null){var s=Dl,c=Al;switch(kl){case 8:fu(),o=6;break a;case 3:case 2:case 9:case 6:Ua.current===null&&(t=!0);var l=kl;if(kl=0,Al=null,Tu(e,s,c,l),n&&Ml){o=0;break a}break;default:l=kl,kl=0,Al=null,Tu(e,s,c,l)}}bu(),o=Fl;break}catch(t){mu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ni=Mi=null,Tl=r,I.H=i,I.A=a,Dl===null&&(El=null,Ol=0,zr()),o}function bu(){for(;Dl!==null;)Cu(Dl)}function xu(e,t){var n=Tl;Tl|=2;var r=gu(),a=_u();El!==e||Ol!==t?(ql=null,Kl=we()+500,pu(e,t)):Ml=Ge(e,t);a:do try{if(kl!==0&&Dl!==null){t=Dl;var o=Al;b:switch(kl){case 1:kl=0,Al=null,Tu(e,t,o,1);break;case 2:case 9:if(fa(o)){kl=0,Al=null,wu(t);break}t=function(){kl!==2&&kl!==9||El!==e||(kl=7),Ku(e)},o.then(t,t);break a;case 3:kl=7;break a;case 4:kl=5;break a;case 7:fa(o)?(kl=0,Al=null,wu(t)):(kl=0,Al=null,Tu(e,t,o,7));break;case 5:var s=null;switch(Dl.tag){case 26:s=Dl.memoizedState;case 5:case 27:var c=Dl;if(s?jf(s):c.stateNode.complete){kl=0,Al=null;var l=c.sibling;if(l!==null)Dl=l;else{var u=c.return;u===null?Dl=null:(Dl=u,Eu(u))}break b}}kl=0,Al=null,Tu(e,t,o,5);break;case 6:kl=0,Al=null,Tu(e,t,o,6);break;case 8:fu(),Fl=6;break a;default:throw Error(i(462))}}Su();break}catch(t){mu(e,t)}while(1);return Ni=Mi=null,I.H=r,I.A=a,Tl=n,Dl===null?(El=null,Ol=0,zr(),Fl):0}function Su(){for(;Dl!==null&&!Se();)Cu(Dl)}function Cu(e){var t=gc(e.alternate,e,Pl);e.memoizedProps=e.pendingProps,t===null?Eu(e):Dl=t}function wu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=ec(n,t,t.pendingProps,t.type,void 0,Ol);break;case 11:t=ec(n,t,t.pendingProps,t.type.render,t.ref,Ol);break;case 5:vo(t);default:Tc(n,t),t=Dl=Xr(t,Pl),t=gc(n,t,Pl)}e.memoizedProps=e.pendingProps,t===null?Eu(e):Dl=t}function Tu(e,t,n,r){Ni=Mi=null,vo(t),va=null,ya=0;var i=t.return;try{if(yee(e,i,t,n,Ol)){Fl=1,Is(e,ri(n,e.current)),Dl=null;return}}catch(t){if(i!==null)throw Dl=i,t;Fl=1,Is(e,ri(n,e.current)),Dl=null;return}t.flags&32768?(bi||r===1?e=!0:Ml||Ol&536870912?e=!1:(jl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ua.current,r!==null&&r.tag===13&&(r.flags|=16384))),Du(t,e)):Eu(t)}function Eu(e){var t=e;do{if(t.flags&32768){Du(t,jl);return}e=t.return;var n=Cc(t.alternate,t,Pl);if(n!==null){Dl=n;return}if(t=t.sibling,t!==null){Dl=t;return}Dl=t=e}while(t!==null);Fl===0&&(Fl=5)}function Du(e,t){do{var n=wc(e.alternate,e);if(n!==null){n.flags&=32767,Dl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Dl=e;return}Dl=e=n}while(e!==null);Fl=6,Dl=null}function Ou(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Nu();while(Yl!==0);if(Tl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Rr,Xe(e,n,o,s,c,l),e===El&&(Dl=El=null,Ol=0),Zl=t,Xl=e,Ql=n,$l=o,eu=a,tu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,zu(Oe,function(){return Pu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=I.T,I.T=null,a=L.p,L.p=2,s=Tl,Tl|=4;try{Wc(e,t,n)}finally{Tl=s,L.p=a,I.T=r}}Yl=1,ku(),Au(),ju()}}function ku(){if(Yl===1){Yl=0;var e=Xl,t=Zl,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Tl;Tl|=4;try{rl(t,e);var a=kd,o=pr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&fr(s.ownerDocument.documentElement,s)){if(c!==null&&mr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=dr(s,h),v=dr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}qf=!!Od,kd=Od=null}finally{Tl=i,L.p=r,I.T=n}}e.current=t,Yl=2}}function Au(){if(Yl===2){Yl=0;var e=Xl,t=Zl,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Tl;Tl|=4;try{Gc(e,t.alternate,t)}finally{Tl=i,L.p=r,I.T=n}}Yl=3}}function ju(){if(Yl===4||Yl===3){Yl=0,Ce();var e=Xl,t=Zl,n=Ql,r=tu;t.subtreeFlags&10256||t.flags&10256?Yl=5:(Yl=0,Zl=Xl=null,Mu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Jl=null),tt(n),t=t.stateNode,Pe&&typeof Pe.onCommitFiberRoot==`function`)try{Pe.onCommitFiberRoot(Ne,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=I.T,i=L.p,L.p=2,I.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{I.T=t,L.p=i}}Ql&3&&Nu(),Ku(e),i=e.pendingLanes,n&261930&&i&42?e===ru?nu++:(nu=0,ru=e):nu=0,qu(0,!1)}}function Mu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Yi(t)))}function Nu(){return ku(),Au(),ju(),Pu()}function Pu(){if(Yl!==5)return!1;var e=Xl,t=$l;$l=0;var n=tt(Ql),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=eu,eu=null;var o=Xl,s=Ql;if(Yl=0,Zl=Xl=null,Ql=0,Tl&6)throw Error(i(331));var c=Tl;if(Tl|=4,bl(o.current),fl(o,o.current,s,n),Tl=c,qu(0,!1),Pe&&typeof Pe.onPostCommitFiberRoot==`function`)try{Pe.onPostCommitFiberRoot(Ne,o)}catch{}return!0}finally{L.p=a,I.T=r,Mu(e,t)}}function Fu(e,t,n){t=ri(n,t),t=Rs(e.stateNode,t,2),e=Aa(e,t,2),e!==null&&(Ye(e,2),Ku(e))}function Iu(e,t,n){if(e.tag===3)Fu(e,e,n);else for(;t!==null;){if(t.tag===3){Fu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Jl===null||!Jl.has(r))){e=ri(n,e),n=zs(2),r=Aa(t,n,2),r!==null&&(Bs(n,r,t,e),Ye(r,2),Ku(r));break}}t=t.return}}function Lu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new wl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Nl=!0,i.add(n),e=xee.bind(null,e,t,n),t.then(e,e))}function xee(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,El===e&&(Ol&n)===n&&(Fl===4||Fl===3&&(Ol&62914560)===Ol&&300>we()-Wl?!(Tl&2)&&pu(e,0):Rl|=n,Bl===Ol&&(Bl=0)),Ku(e)}function Ru(e,t){t===0&&(t=qe()),e=Hr(e,t),e!==null&&(Ye(e,t),Ku(e))}function See(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ru(e,n)}function Cee(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ru(e,n)}function zu(e,t){return be(e,t)}var Bu=null,Vu=null,Hu=!1,Uu=!1,Wu=!1,Gu=0;function Ku(e){e!==Vu&&e.next===null&&(Vu===null?Bu=Vu=e:Vu=Vu.next=e),Uu=!0,Hu||(Hu=!0,$u())}function qu(e,t){if(!Wu&&Uu){Wu=!0;do for(var n=!1,r=Bu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ie(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Qu(r,a))}else a=Ol,a=We(r,r===El?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ge(r,a)||(n=!0,Qu(r,a));r=r.next}while(n);Wu=!1}}function Ju(){Yu()}function Yu(){Uu=Hu=!1;var e=0;Gu!==0&&Fd()&&(e=Gu);for(var t=we(),n=null,r=Bu;r!==null;){var i=r.next,a=Xu(r,t);a===0?(r.next=null,n===null?Bu=i:n.next=i,i===null&&(Vu=n)):(n=r,(e!==0||a&3)&&(Uu=!0)),r=i}Yl!==0&&Yl!==5||qu(e,!1),Gu!==0&&(Gu=0)}function Xu(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ie(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ke(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=El,n=Ol,n=We(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(kl===2||kl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ge(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),tt(n)){case 2:case 8:n=De;break;case 32:n=Oe;break;case 268435456:n=Ae;break;default:n=Oe}return r=Zu.bind(null,e),n=be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xe(r),e.callbackPriority=2,e.callbackNode=null,2}function Zu(e,t){if(Yl!==0&&Yl!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Nu()&&e.callbackNode!==n)return null;var r=Ol;return r=We(e,e===El?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(su(e,r,t),Xu(e,we()),e.callbackNode!=null&&e.callbackNode===n?Zu.bind(null,e):null)}function Qu(e,t){if(Nu())return null;su(e,t,!0)}function $u(){zd(function(){Tl&6?be(Ee,Ju):Yu()})}function ed(){if(Gu===0){var e=Qi;e===0&&(e=Be,Be<<=1,!(Be&261888)&&(Be=256)),Gu=e}return Gu}function td(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Yt(``+e)}function nd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function rd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=td((i[ot]||null).action),o=r.submitter;o&&(t=(t=o[ot]||null)?td(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Gu!==0){var e=o?nd(i,o):new FormData(i);ms(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?nd(i,o):new FormData(i),ms(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var id=0;id<Nr.length;id++){var ad=Nr[id];Pr(ad.toLowerCase(),`on`+(ad[0].toUpperCase()+ad.slice(1)))}Pr(Tr,`onAnimationEnd`),Pr(Er,`onAnimationIteration`),Pr(Dr,`onAnimationStart`),Pr(`dblclick`,`onDoubleClick`),Pr(`focusin`,`onFocus`),Pr(`focusout`,`onBlur`),Pr(Or,`onTransitionRun`),Pr(kr,`onTransitionStart`),Pr(Ar,`onTransitionCancel`),Pr(jr,`onTransitionEnd`),xt(`onMouseEnter`,[`mouseout`,`mouseover`]),xt(`onMouseLeave`,[`mouseout`,`mouseover`]),xt(`onPointerEnter`,[`pointerout`,`pointerover`]),xt(`onPointerLeave`,[`pointerout`,`pointerover`]),bt(`onCh
9ange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var od=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(od));function cd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Fr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Fr(e)}i.currentTarget=null,a=c}}}}function ld(e,t){var n=t[ct];n===void 0&&(n=t[ct]=new Set);var r=e+`__bubble`;n.has(r)||(pd(t,e,2,!1),n.add(r))}function ud(e,t,n){var r=0;t&&(r|=4),pd(n,e,r,t)}var dd=`_reactListening`+Math.random().toString(36).slice(2);function fd(e){if(!e[dd]){e[dd]=!0,vt.forEach(function(t){t!==`selectionchange`&&(sd.has(t)||ud(t,!1,e),ud(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[dd]||(t[dd]=!0,ud(`selectionchange`,!1,t))}}function pd(e,t,n,r){switch(ep(t)){case 2:var i=Jf;break;case 8:i=Yf;break;default:i=Xf}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function md(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=pt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}rn(function(){var r=a,i=Qt(n),s=[];a:{var c=Mr.get(e);if(c!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=lee;break;case`focusin`:u=`focus`,l=En;break;case`focusout`:u=`blur`,l=En;break;case`beforeblur`:case`afterblur`:l=En;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Tn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=uee;break;case Tr:case Er:case Dr:l=ree;break;case jr:l=An;break;case`scroll`:case`scrollend`:l=nee;break;case`wheel`:l=jn;break;case`copy`:case`cut`:case`paste`:l=iee;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=kn;break;case`toggle`:case`beforetoggle`:l=Mn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=an(m,p),g!=null&&d.push(hd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Zt&&(u=n.relatedTarget||n.fromElement)&&(pt(u)||u[st]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?pt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=kn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ht(l),h=u==null?c:ht(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,pt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=_d,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&vd(s,c,l,d,!1),u!==null&&f!==null&&vd(s,f,u,d,!0)}}a:{if(c=r?ht(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=Xn;else if(Wn(c))if(Zn)v=or;else{v=ir;var y=rr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&qt(r.elementType)&&(v=Xn):v=ar;if(v&&=v(e,r)){Gn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&zt(c,`number`,c.value)}switch(y=r?ht(r):window,e){case`focusin`:(Wn(y)||y.contentEditable===`true`)&&(hr=y,gr=r,_r=null);break;case`focusout`:_r=gr=hr=null;break;case`mousedown`:vr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:vr=!1,yr(s,n,i);break;case`selectionchange`:if(pee)break;case`keydown`:case`keyup`:yr(s,n,i)}var b;if(Pn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Vn?zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(In&&n.locale!==`ko`&&(Vn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Vn&&(b=fn()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Vn=!0)),y=gd(r,x),0<y.length&&(x=new Dn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Bn(n),b!==null&&(x.data=b)))),(b=dee?Hn(e,n):fee(e,n))&&(x=gd(r,`onBeforeInput`),0<x.length&&(y=new Dn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),rd(s,e,r,n,i)}cd(s,t)})}
vendor: 11,239 bytes, lines 9-10
9function hd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function gd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=an(e,n),i!=null&&r.unshift(hd(e,i,a)),i=an(e,t),i!=null&&r.push(hd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function _d(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function vd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=an(n,a),l!=null&&o.unshift(hd(n,l,c))):i||(l=an(n,a),l!=null&&o.push(hd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var yd=/\r\n?/g,bd=/\u0000|\uFFFD/g;function xd(e){return(typeof e==`string`?e:``+e).replace(yd,` 10`).replace(bd,``)}function Sd(e,t){return t=xd(t),xd(e)===t}function Cd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ut(e,``+r);break;case`className`:Dt(e,`class`,r);break;case`tabIndex`:Dt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Dt(e,n,r);break;case`style`:Kt(e,r,o);break;case`data`:if(t!==`object`){Dt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Cd(e,t,`name`,a.name,a,null),Cd(e,t,`formEncType`,a.formEncType,a,null),Cd(e,t,`formMethod`,a.formMethod,a,null),Cd(e,t,`formTarget`,a.formTarget,a,null)):(Cd(e,t,`encType`,a.encType,a,null),Cd(e,t,`method`,a.method,a,null),Cd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`onScroll`:r!=null&&ld(`scroll`,e);break;case`onScrollEnd`:r!=null&&ld(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Yt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:ld(`beforetoggle`,e),ld(`toggle`,e),Et(e,`popover`,r);break;case`xlinkActuate`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Et(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=tee.get(n)||n,Et(e,n,r))}}function wd(e,t,n,r,a,o){switch(n){case`style`:Kt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ut(e,``+r);break;case`onScroll`:r!=null&&ld(`scroll`,e);break;case`onScrollEnd`:r!=null&&ld(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!yt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ot]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Et(e,n,r)}}}function Td(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:ld(`error`,e),ld(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Cd(e,t,o,s,n,null)}}a&&Cd(e,t,`srcSet`,n.srcSet,n,null),r&&Cd(e,t,`src`,n.src,n,null);return;case`input`:ld(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Cd(e,t,r,d,n,null)}}Rt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in ld(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Cd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Bt(e,!!r,n,!0):Bt(e,!!r,t,!1);return;case`textarea`:for(s in ld(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Cd(e,t,s,c,n,null)}Ht(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Cd(e,t,l,r,n,null)}return;case`dialog`:ld(`beforetoggle`,e),ld(`toggle`,e),ld(`cancel`,e),ld(`close`,e);break;case`iframe`:case`object`:ld(`load`,e);break;case`video`:case`audio`:for(r=0;r<od.length;r++)ld(od[r],e);break;case`image`:ld(`error`,e),ld(`load`,e);break;case`details`:ld(`toggle`,e);break;case`embed`:case`source`:case`link`:ld(`error`,e),ld(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Cd(e,t,u,r,n,null)}return;default:if(qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&wd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Cd(e,t,c,r,n,null))}function Ed(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Cd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Cd(e,t,p,m,r,f)}}Lt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Cd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Cd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Bt(e,!!n,n?[]:``,!1):Bt(e,!!n,t,!0)):Bt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Cd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Cd(e,t,s,a,r,o)}Vt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Cd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Cd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Cd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Cd(e,t,u,p,r,m)}return;default:if(qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&wd(e,t,_,void 0,r,p);
vendor: 4,465 bytes, line 10
10for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||wd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Cd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Cd(e,t,f,p,r,m)}function Dd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function wee(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Dd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Dd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Od=null,kd=null;function Ad(e){return e.nodeType===9?e:e.ownerDocument}function jd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Md(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Nd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pd=null;function Fd(){var e=window.event;return e&&e.type===`popstate`?e===Pd?!1:(Pd=e,!0):(Pd=null,!1)}var Id=typeof setTimeout==`function`?setTimeout:void 0,Ld=typeof clearTimeout==`function`?clearTimeout:void 0,Rd=typeof Promise==`function`?Promise:void 0,zd=typeof queueMicrotask==`function`?queueMicrotask:Rd===void 0?Id:function(e){return Rd.resolve(null).then(e).catch(Bd)};function Bd(e){setTimeout(function(){throw e})}function Vd(e){return e===`head`}function Hd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),gp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)tf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,tf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[dt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&tf(e.ownerDocument.body);n=i}while(n);gp(t)}function Ud(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function Wd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:Wd(n),ft(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function Gd(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(r){if(!e[dt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}}else if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;if(e=Xd(e.nextSibling),e===null)break}return null}function Kd(e,t,n){if(t===``)return null;for(;
vendor: 20,919 bytes, line 10
10e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Xd(e.nextSibling),e===null))return null;return e}function qd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Xd(e.nextSibling),e===null))return null;return e}function Jd(e){return e.data===`$?`||e.data===`$~`}function Yd(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function Tee(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function Xd(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var Zd=null;function Qd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Xd(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function $d(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ef(e,t,n){switch(t=Ad(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function tf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ft(e)}var nf=new Map,rf=new Set;function af(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var of=L.d;L.d={f:Eee,r:Dee,D:lf,C:uf,L:df,m:ff,X:mf,S:pf,M:hf};function Eee(){var e=of.f(),t=du();return e||t}function Dee(e){var t=mt(e);t!==null&&t.tag===5&&t.type===`form`?gs(t):of.r(e)}var sf=typeof document>`u`?null:document;function cf(e,t,n){var r=sf;if(r&&typeof t==`string`&&t){var i=It(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),rf.has(i)||(rf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Td(t,`link`,e),_t(t),r.head.appendChild(t)))}}function lf(e){of.D(e),cf(`dns-prefetch`,e,null)}function uf(e,t){of.C(e,t),cf(`preconnect`,e,t)}function df(e,t,n){of.L(e,t,n);var r=sf;if(r&&e&&t){var i=`link[rel="preload"][as="`+It(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+It(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+It(n.imageSizes)+`"]`)):i+=`[href="`+It(e)+`"]`;var a=i;switch(t){case`style`:a=_f(e);break;case`script`:a=xf(e)}nf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),nf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(vf(a))||t===`script`&&r.querySelector(Sf(a))||(t=r.createElement(`link`),Td(t,`link`,e),_t(t),r.head.appendChild(t)))}}function ff(e,t){of.m(e,t);var n=sf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+It(r)+`"][href="`+It(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=xf(e)}if(!nf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),nf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Sf(a)))return}r=n.createElement(`link`),Td(r,`link`,e),_t(r),n.head.appendChild(r)}}}function pf(e,t,n){of.S(e,t,n);var r=sf;if(r&&e){var i=gt(r).hoistableStyles,a=_f(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(vf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=nf.get(a))&&Tf(e,n);var c=o=r.createElement(`link`);_t(c),Td(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,wf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function mf(e,t){of.X(e,t);var n=sf;if(n&&e){var r=gt(n).hoistableScripts,i=xf(e),a=r.get(i);a||(a=n.querySelector(Sf(i)),a||(e=f({src:e,async:!0},t),(t=nf.get(i))&&Ef(e,t),a=n.createElement(`script`),_t(a),Td(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function hf(e,t){of.M(e,t);var n=sf;if(n&&e){var r=gt(n).hoistableScripts,i=xf(e),a=r.get(i);a||(a=n.querySelector(Sf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=nf.get(i))&&Ef(e,t),a=n.createElement(`script`),_t(a),Td(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function gf(e,t,n,r){var a=(a=oe.current)?af(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=_f(n.href),n=gt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=_f(n.href);var o=gt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(vf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),nf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},nf.set(e,n),o||bf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=xf(n),n=gt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function _f(e){return`href="`+It(e)+`"`}function vf(e){return`link[rel="stylesheet"][`+e+`]`}function yf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function bf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Td(t,`link`,n),_t(t),e.head.appendChild(t))}function xf(e){return`[src="`+It(e)+`"]`}function Sf(e){return`script[async]`+e}function Cf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+It(n.href)+`"]`);if(r)return t.instance=r,_t(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),_t(r),Td(r,`style`,a),wf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=_f(n.href);var o=e.querySelector(vf(a));if(o)return t.state.loading|=4,t.instance=o,_t(o),o;r=yf(n),(a=nf.get(a))&&Tf(r,a),o=(e.ownerDocument||e).createElement(`link`),_t(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Td(o,`link`,r),t.state.loading|=4,wf(o,n.precedence,e),t.instance=o;case`script`:return o=xf(n.src),(a=e.querySelector(Sf(o)))?(t.instance=a,_t(a),a):(r=n,(a=nf.get(o))&&(r=f({},n),Ef(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),_t(a),Td(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,wf(r,n.precedence,e));return t.instance}function wf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Tf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ef(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Df=null;function Of(e,t,n){if(Df===null){var r=new Map,i=Df=new Map;i.set(n,r)}else i=Df,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[dt]||a[at]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Af(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function jf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Mf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=_f(r.href),a=t.querySelector(vf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Ff.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,_t(a);return}a=t.ownerDocument||t,r=yf(r),(i=nf.get(i))&&Tf(r,i),a=a.createElement(`link`),_t(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Td(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Ff.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Nf=0;function Pf(e,t){return e.stylesheets&&e.count===0&&Lf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Lf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Nf===0&&(Nf=62500*wee());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Lf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Nf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Ff(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var If=null;function Lf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,If=new Map,t.forEach(Rf,e),If=null,Ff.call(e))}function Rf(e,t){if(!(t.state.loading&4)){var n=If.get(e);if(n)var r=n.get(null);else{n=new Map,If.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Ff.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var zf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function Bf(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Je(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Je(0),this.hiddenUpdates=Je(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function Oee(e,t,n,r,i,a,o,s,c,l,u,d){return e=new Bf(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=qr(3,null,null,t),e.current=a,a.stateNode=e,t=Ji(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Da(a),e}function Vf(e){return e?(e=Gr,e):Gr}function Hf(e,t,n,r,i,a){i=Vf(i),r.context===null?r.context=i:r.pendingContext=i,r=ka(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Aa(e,r,t),n!==null&&(ou(n,e,t),ja(n,e,t))}function Uf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Wf(e,t){Uf(e,t),(e=e.alternate)&&Uf(e,t)}function Gf(e){if(e.tag===13||e.tag===31){var t=Hr(e,67108864);t!==null&&ou(t,e,67108864),Wf(e,67108864)}}function Kf(e){if(e.tag===13||e.tag===31){var t=iu();t=et(t);var n=Hr(e,t);n!==null&&ou(n,e,t),Wf(e,t)}}var qf=!0;function Jf(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,Xf(e,t,n,r)}finally{L.p=a,I.T=i}}function Yf(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,Xf(e,t,n,r)}finally{L.p=a,I.T=i}}function Xf(e,t,n,r){if(qf){var i=Zf(r);if(i===null)md(e,t,r,Qf,n),cp(e,r);else if(Aee(i,e,t,n,r))r.stopPropagation();else if(cp(e,r),t&4&&-1<kee.indexOf(e)){for(;i!==null;){var a=mt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ue(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ie(o);s.entanglements[1]|=c,o&=~c}Ku(a),!(Tl&6)&&(Kl=we()+500,qu(0,!1))}}break;case 31:case 13:s=Hr(a,2),s!==null&&ou(s,a,2),du(),Wf(a,2)}if(a=Zf(r),a===null&&md(e,t,r,Qf,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else md(e,t,r,null,n)}}function Zf(e){return e=Qt(e),$f(e)}var Qf=null;function $f(e){if(Qf=null,e=pt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Qf=e,null}function ep(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Te()){case Ee:return 2;case De:return 8;case Oe:case ke:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var tp=!1,np=null,rp=null,ip=null,ap=new Map,op=new Map,sp=[],kee=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function cp(e,t){switch(e){case`focusin`:case`focusout`:np=null;break;case`dragenter`:case`dragleave`:rp=null;break;case`mouseover`:case`mouseout`:ip=null;break;case`pointerover`:case`pointerout`:ap.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:op.delete(t.pointerId)}}function lp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=mt(t),t!==null&&Gf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Aee(e,t,n,r,i){switch(t){case`focusin`:return np=lp(np,e,t,n,r,i),!0;case`dragenter`:return rp=lp(rp,e,t,n,r,i),!0;case`mouseover`:return ip=lp(ip,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return ap.set(a,lp(ap.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,op.set(a,lp(op.get(a)||null,e,t,n,r,i)),!0}return!1}function up(e){var t=pt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,rt(e.priority,function(){Kf(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,rt(e.priority,function(){Kf(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zf(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=mt(n),t!==null&&Gf(t),e.blockedOn=n,!1;t.shift()}return!0}function fp(e,t,n){dp(e)&&n.delete(t)}function jee(){tp=!1,np!==null&&dp(np)&&(np=null),rp!==null&&dp(rp)&&(rp=null),ip!==null&&dp(ip)&&(ip=null),ap.forEach(fp),op.forEach(fp)}function pp(e,n){e.blockedOn===n&&(e.blockedOn=null,tp||(tp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jee)))}var mp=null;function hp(e){mp!==e&&(mp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){mp===e&&(mp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if($f(r||n)===null)continue;break}var a=mt(n);a!==null&&(e.splice(t,3),t-=3,ms(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function gp(e){function t(t){return pp(t,e)}np!==null&&pp(np,e),rp!==null&&pp(rp,e),ip!==null&&pp(ip,e),ap.forEach(t),op.forEach(t);for(var n=0;n<sp.length;n++){var r=sp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<sp.length&&(n=sp[0],n.blockedOn===null);)up(n),n.blockedOn===null&&sp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ot]||null;if(typeof a==`function`)o||hp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ot]||null)s=o.formAction;else if($f(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),hp(n)}}}function _p(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function vp(e){this._internalRoot=e}yp.prototype.render=vp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Hf(n,iu(),e,t,null,null)},yp.prototype.unmount=vp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hf(e.current,2,null,e,null,null),du(),t[st]=null}};function yp(e){this._internalRoot=e}yp.prototype.unstable_scheduleHydration=function(e){if(e){var t=nt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<sp.length&&t!==0&&t<sp[n].priority;n++);sp.splice(n,0,e),n===0&&up(e)}};var bp=n.version;if(bp!==`19.2.4`)throw Error(i(527,bp,`19.2.4`));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var xp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.4`};
10if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Sp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sp.isDisabled&&Sp.supportsFiber)try{Ne=Sp.inject(xp),Pe=Sp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Fs,s=_ee,c=vee;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Oee(e,1,!1,null,null,n,r,null,o,s,c,_p),e[st]=t.current,fd(e),new vp(t)}})),b=s(((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=y()})),x=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,S=globalThis,C=`10.51.0`;function w(){return T(S),S}function T(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.51.0`,t[C]=t[`10.51.0`]||{}}function E(e,t,n=S){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[C]=r[`10.51.0`]||{};return i[e]||(i[e]=t())}var D=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],O=`Sentry Logger `,k={};function A(e){if(!(`console`in S))return e();let t=S.console,n={},r=Object.keys(k);r.forEach(e=>{let r=k[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function j(){ee().enabled=!0}function M(){ee().enabled=!1}function N(){return ee().enabled}function P(...e){L(`log`,...e)}function F(...e){L(`warn`,...e)}function I(...e){L(`error`,...e)}function L(e,...t){x&&N()&&A(()=>{S.console[e](`${O}[${e}]:`,...t)})}function ee(){return x?E(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var R={enable:j,disable:M,isEnabled:N,log:P,warn:F,error:I},te=50,ne=/\(error: (.*)\)/,re=/captureMessage|captureException/;function ie(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(` 11`);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=ne.test(n)?n.replace(ne,`$1`):n;if(!o.includes(`Error: `)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=te+r)break}}return ae(i.slice(r))}}function z(e){return Array.isArray(e)?ie(...e):e}function ae(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(oe(t).function||``)&&t.pop(),t.reverse(),re.test(oe(t).function||``)&&(t.pop(),re.test(oe(t).function||``)&&t.pop()),t.slice(0,te).map(e=>({...e,filename:e.filename||oe(t).filename,function:e.function||`?`}))}function oe(e){return e[e.length-1]||{}}var se=`<anonymous>`;function ce(e){try{return!e||typeof e!=`function`?se:e.name||se}catch{return se}}function le(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function ue(e){return`__v_isVNode`in e&&e.__v_isVNode?`[VueVNode]`:`[VueViewModel]`}var de={},fe={};function pe(e,t){return de[e]=de[e]||[],de[e].push(t),()=>{let n=de[e];if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}function me(e,t){if(!fe[e]){fe[e]=!0;try{t()}catch(t){x&&R.error(`Error while instrumenting ${e}`,t)}}}function he(e,t){let n=e&&de[e];if(n)for(let r of n)try{r(t)}catch(t){x&&R.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${ce(r)}\nError:`,t)}}var ge=null;function _e(e){let t=`error`;pe(t,e),me(t,ve)}function ve(){ge=S.onerror,S.onerror=function(e,t,n,r,i){return he(`error`,{column:r,error:i,line:n,msg:e,url:t}),ge?ge.apply(this,arguments):!1},S.onerror.__SENTRY_INSTRUMENTED__=!0}var ye=null;function be(e){let t=`unhandledrejection`;pe(t,e),me(t,xe)}function xe(){ye=S.onunhandledrejection,S.onunhandledrejection=function(e){return he(`unhandledrejection`,e),ye?ye.apply(this,arguments):!0},S.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Se=Object.prototype.toString;function Ce(e){switch(Se.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return Le(e,Error)}}function we(e,t){return Se.call(e)===`[object ${t}]`}function Te(e){return we(e,`ErrorEvent`)}function Ee(e){return we(e,`DOMError`)}function De(e){return we(e,`DOMException`)}function Oe(e){return we(e,`String`)}function ke(e){return typeof e==`object`&&!!e&&`__sentry_template_str
11ing__`in e&&`__sentry_template_values__`in e}function Ae(e){return e===null||ke(e)||typeof e!=`object`&&typeof e!=`function`}function je(e){return we(e,`Object`)}function Me(e){return typeof Event<`u`&&Le(e,Event)}function Ne(e){return typeof Element<`u`&&Le(e,Element)}function Pe(e){return we(e,`RegExp`)}function Fe(e){return!!(e?.then&&typeof e.then==`function`)}function Ie(e){return je(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function Le(e,t){try{return e instanceof t}catch{return!1}}function Re(e){return!!(typeof e==`object`&&e&&(e.__isVue||e._isVue||e.__v_isVNode))}function ze(e){return typeof Request<`u`&&Le(e,Request)}var Be=S,Ve=80;function He(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||Ve;for(;n&&i++<5&&(o=Ue(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n.parentNode;return r.reverse().join(` > `)}catch{return`<unknown>`}}function Ue(e,t){let n=e,r=[];if(!n?.tagName)return``;if(Be.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(i?.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let e=n.className;if(e&&Oe(e)){let t=e.split(/\s+/);for(let e of t)r.push(`.${e}`)}}for(let e of[`aria-label`,`type`,`name`,`title`,`alt`]){let t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join(``)}function We(){try{return Be.document.location.href}catch{return``}}function Ge(e,t=5){if(!Be.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}function Ke(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&Je(i,r);try{e[t]=i}catch{x&&R.log(`Failed to replace method "${t}" in object`,e)}}function qe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{x&&R.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Je(e,t){try{e.prototype=t.prototype=t.prototype||{},qe(e,`__sentry_original__`,t)}catch{}}function Ye(e){return e.__sentry_original__}function Xe(e){if(Ce(e))return{message:e.message,name:e.name,stack:e.stack,...Qe(e)};if(Me(e)){let t={type:e.type,target:Ze(e.target),currentTarget:Ze(e.currentTarget),...Qe(e)};return typeof CustomEvent<`u`&&Le(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Ze(e){try{return Ne(e)?He(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function Qe(e){return typeof e==`object`&&e?Object.fromEntries(Object.entries(e)):{}}function $e(e){let t=Object.keys(Xe(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var et;function tt(e){if(et!==void 0)return et?et(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=S;return t in n&&typeof n[t]==`function`?(et=n[t],et(e)):(et=null,e())}function nt(){return tt(()=>Math.random())}function rt(){return tt(()=>Date.now())}function it(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function at(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{Re(r)?n.push(ue(r)):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function ot(e,t,n=!1){return Oe(e)?Pe(t)?t.test(e):Oe(t)?n?e===t:e.includes(t):typeof t==`function`?t(e):!1:!1}function st(e,t=[],n=!1){return t.some(t=>ot(e,t,n))}function ct(){let e=S;return e.crypto||e.msCrypto}var lt;function eee(){return nt()*16}function ut(e=ct()){try{if(e?.randomUUID)return tt(()=>e.randomUUID()).replace(/-/g,``)}catch{}return lt||=`10000000100040008000100000000000`,lt.replace(/[018]/g,e=>(e^(eee()&15)>>e/4).toString(16))}function dt(e){return e.exception?.values?.[0]}function ft(e){let{message:t,event_id:n}=e;if(t)return t;let r=dt(e);return r?r.type&&r.value?`${r.type}: ${r.value}
11`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function pt(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function mt(e,t){let n=dt(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function ht(e){if(gt(e))return!0;try{qe(e,`__sentry_captured__`,!0)}catch{}return!1}function gt(e){try{return e.__sentry_captured__}catch{}}var _t=1e3;function vt(){return rt()/_t}function yt(){let{performance:e}=S;if(!e?.now||!e.timeOrigin)return vt;let t=e.timeOrigin;return()=>(t+tt(()=>e.now()))/_t}var bt;function xt(){return(bt??=yt())()}var St=null;function Ct(){let{performance:e}=S;if(!e?.now)return;let t=3e5,n=tt(()=>e.now()),r=rt(),i=e.timeOrigin;if(typeof i==`number`&&Math.abs(i+n-r)<t)return i;let a=e.timing?.navigationStart;return typeof a==`number`&&Math.abs(a+n-r)<t?a:r-n}function wt(){return St===null&&(St=Ct()),St}function Tt(e){let t=xt(),n={sid:ut(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>Ot(n)};return e&&Et(n,e),n}function Et(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||xt(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:ut()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Dt(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),Et(e,n)}function Ot(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function kt(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=kt(r[e],t[e],n-1));return r}function At(){return ut()}function jt(){return ut().substring(16)}var Mt=`_sentrySpan`;function Nt(e,t){t?qe(e,Mt,t):delete e[Mt]}function Pt(e){return e[Mt]}var Ft=100,It=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:At(),sampleRand:nt()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Nt(t,Pt(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Et(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():je(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Nt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:At(),sampleRand:nt(
11)}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:Ft;if(n<=0)return this;let r={timestamp:vt(),...e,message:e.message?it(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Pt(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=kt(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||ut();if(!this._client)return x&&R.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||ut();if(!this._client)return x&&R.warn(`No client configured on scope - will not capture message!`),r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||ut();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(x&&R.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function Lt(){return E(`defaultCurrentScope`,()=>new It)}function Rt(){return E(`defaultIsolationScope`,()=>new It)}var zt=e=>e instanceof Promise&&!e[Bt],Bt=Symbol(`chained PromiseLike`),Vt=(e,t,n)=>{let r=e.then(e=>(t(e),e),e=>{throw n(e),e});return zt(r)&&zt(e)?r:Ht(e,r)},Ht=(e,t)=>{let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i==`function`?Object.defineProperty(t,r,{value:(...t)=>i.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[Bt]:!0}),t},Ut=class{constructor(e,t){let n;n=e||new It;let r;r=t||new It,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return Fe(n)?Vt(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Wt(){let e=T(w());return e.stack=e.stack||new Ut(Lt(),Rt())}function Gt(e){return Wt().withScope(e)}function Kt(e,t){let n=Wt();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function qt(e){return Wt().withScope(()=>e(Wt().getIsolationScope()))}function tee(){return{withIsolationScope:qt,withScope:Gt,withSetScope:Kt,withSetIsolationScope:(e,t)=>qt(t),getCurrentScope:()=>Wt().getScope(),getIsolationScope:()=>Wt().getIsolationScope()}}function Jt(e){let t=T(e);return t.acs?t.acs:tee()}var Yt;function Xt(){return Yt?.()}function Zt(){return Yt!==void 0}function Qt(){return Jt(w()).getCurrentScope()}function $t(){return Jt(w()).getIsolationScope()}function en(){return E(`globalScope`,()=>new It)}function tn(...e){let t=Jt(w());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function nn(){return Qt().getClient()}function rn(e){let t=Xt();if(t)return{trace_id:t.traceId,span_id:t.spanId};let{traceId:n,parentSpanId:r,propagationSpanId:i}=e.getPropagationContext(),a={trace_id:n,span_id:i||jt()};return r&&(a.parent_span_id=r),a}var an=`sentry.source`,on=`sentry.sample_rate`,sn=`sentry.previous_trace_sample_rate`,cn=`sentry.op`,ln=`sentry.origin`,un=`sentry.idle_span_finish_reason`,dn=`sentry.measurement_unit`,fn=`sentry.measurement_value`,pn=`sentry.custom_span_name`,mn=`sentry.profile_id`,hn=`sentry.exclusive_time`,gn=`sentry.link.type`,_n=`gen_ai.conversation.id`;function vn(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:`unauthenticated`};case 403:return{code:2,message:`permission_denied`};case 404:return{code:2,message:`not_found`};case 409:return{code:2,message:`already_exists`};case 413:return{code:2,message:`failed_precondition`};case 429:return{code:2,message:`resource_exhausted`};case 499:return{code:2,message:`cancelled`};default:return{code:2,message:`invalid_argument`}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:`unimplemented`};case 503:return{code:2,message:`unavailable`};case 504:return{code:2,message:`deadline_exceeded`};default:return{code:2,message:`internal_error`}}return{code:2,message:`internal_error`}}function yn(e,t){e.setAttribute(`http.response.status_code`,t);let n=vn(t);n.message!==`unknown_error`&&e.setStatus(n)}function nee(e){try{let t=S.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function bn(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}var xn=`_sentryScope`,Sn=`_sentryIsolationScope`;function Cn(e,t,n){e&&(qe(e,Sn,nee(n)),qe(e,xn,t))}function wn(e){let t=e;return{scope:t[xn],isolationScope:bn(t[Sn])}}var Tn=`sentry-`;function En(e){let t=iee(e);
11if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function ree(e){if(e)return aee(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${Tn}${t}`]=n),e),{}))}function iee(e){if(!(!e||!Oe(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=Dn(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Dn(e)}function Dn(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function aee(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?(x&&R.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}var oee=/^o(\d+)\./,see=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function cee(e){return e===`http`||e===`https`}function On(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function lee(e){let t=see.exec(e);if(!t){A(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return kn({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function kn(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function uee(e){if(!x)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>e[t]?!1:(R.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?cee(r)?t&&isNaN(parseInt(t,10))?(R.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(R.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(R.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function An(e){return e.match(oee)?.[1]}function jn(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=An(n)),r}function Mn(e){let t=typeof e==`string`?lee(e):kn(e);if(!(!t||!uee(t)))return t}function Nn(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var Pn=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function Fn(e){if(!e)return;let t=e.match(Pn);if(!t)return;let n;return t[3]===`1`?n=!0:t[3]===`0`&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function dee(e,t){let n=Fn(e),r=En(t);if(!n?.traceId)return{traceId:At(),sampleRand:nt()};let i=Rn(n,r);r&&(r.sample_rand=i.toString());let{traceId:a,parentSpanId:o,parentSampled:s}=n;return{traceId:a,parentSpanId:o,sampled:s,dsc:r||{},sampleRand:i}}function In(e=At(),t=jt(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function Ln(e=At(),t=jt(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function Rn(e,t){let n=Nn(t?.sample_rand);if(n!==void 0)return n;let r=Nn(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?nt()*r:r+nt()*(1-r):nt()}var zn=!1;function Bn(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=qn(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function Vn(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:qn(e).parent_span_id,a=wn(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||jt():t,trace_id:n}}function Hn(e){let{traceId:t,spanId:n}=e.spanContext();return In(t,n,Qn(e))}function fee(e){let{traceId:t,spanId:n}=e.spanContext();return Ln(t,n,Qn(e))}function Un(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function Wn(e){if(e?.length)return e.map(({context:{spanId:e,traceId:t,traceFlags:n},attributes:r})=>({span_id:e,trace_id:t,sampled:n===1,attributes:r}))}function Gn(e){return typeof e==`number`?Kn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Kn(e.getTime()):xt()}function Kn(e){return e>9999999999?e/1e3:e}function qn(e){if(Zn(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Xn(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:Yn(e),start_timestamp:Gn(i),timestamp:Gn(o)||void 0,status:$n(s),op:r[cn],origin:r[ln],links:Un(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Jn(e){if(Zn(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Xn(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{name:a,span_id:t,trace_id:n,parent_span_id:Yn(e),start_timestamp:Gn(i),end_timestamp:Gn(o),is_segment:e===sr(e),status:er(s),attributes:r,links:Wn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:``,end_timestamp:0,status:`ok`,is_segment:e===sr(e)}}function Yn(e){return`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0}function Xn(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Zn(e){return typeof e.getSpanJSON==`function`}function Qn(e){let{traceFlags:t}=e.spanContext();return t===1}function $n(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}function er(e){return!e||e.code===1||e.code===0||e.message===`cancelled`?`ok`:`error`}var tr=`_sentryChildSpans`,nr=`_sentryRootSpan`;function rr(e,t){qe(t,nr,e[nr]||e),e[tr]?e[tr].add(t):qe(e,tr,new Set([t]))}function ir(e,t){e[tr]&&e[tr].delete(t)}function ar(e){let t=new Set;function n(e){if(!t.has(e)&&Qn(e)){t.add(e);let r=e[tr]?Array.from(e[tr]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}var or=sr;function sr(e){return e[nr]||e}function cr(){let e=Jt(w());return e.getActiveSpan?e.getActiveSpan():Pt(Qt())}function lr(){zn||=(A(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}var ur=!1;function dr(){if(ur)return;function e(){let e=cr(),t=e&&or(e);
11if(t){let e=`internal_error`;x&&R.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}e.tag=`sentry_tracingErrorCallback`,ur=!0,_e(e),be(e)}function fr(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||nn()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function pr(e){R.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function mr(e,t){if(!t?.length)return!1;for(let n of t){if(gr(n)){if(e.description&&ot(e.description,n))return x&&pr(e),!0;continue}let t=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!t)continue;let r=n.name?e.description&&ot(e.description,n.name):!0,i=n.op?e.op&&ot(e.op,n.op):!0,a=n.attributes?Object.entries(n.attributes).every(([t,n])=>pee(e.attributes?.[t],n)):!0;if(r&&i&&a)return x&&pr(e),!0}return!1}function pee(e,t){return typeof e==`string`&&(typeof t==`string`||t instanceof RegExp)?ot(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function hr(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function gr(e){return typeof e==`string`||e instanceof RegExp}var _r=`production`,vr=`_frozenDsc`;function yr(e,t){qe(e,vr,t)}function br(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:jn(t)};return t.emit(`createDsc`,i),i}function xr(e,t){let n=t.getPropagationContext();return n.dsc||br(n.traceId,e)}function Sr(e){let t=nn();if(!t)return{};let n=or(e),r=qn(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[vr];if(c)return s(c);let l=a?.get(`sentry.dsc`),u=l&&En(l);if(u)return s(u);let d=br(e.spanContext().traceId,t),f=i[`sentry.source`]??i[`sentry.span.source`],p=r.description;return f!==`url`&&p&&(d.transaction=p),fr()&&(d.sampled=String(Qn(n)),d.sample_rand=a?.get(`sentry.sample_rand`)??wn(n).scope?.getPropagationContext().sampleRand.toString()),s(d),t.emit(`createDsc`,d,n),d}var Cr=class{constructor(e={}){this._traceId=e.traceId||At(),this._spanId=e.spanId||jt(),this.dropReason=e.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function wr(e){return!!e&&typeof e==`function`&&`_streamed`in e&&!!e._streamed}var Tr=Symbol.for(`sentry.skipNormalization`),Er=Symbol.for(`sentry.overrideNormalizationDepth`);function Dr(e){return!!e[Tr]}function Or(e){let t=e[Er];return typeof t==`number`?t:void 0}function kr(e,t=100,n=1/0){try{return jr(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Ar(e,t=3,n=100*1024){let r=kr(e,t);return Fr(r)>n?Ar(e,t-1,n):r}function jr(e,t,n=1/0,r=1/0,i=Ir()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=Mr(e,t);if(!s.startsWith(`[object `))return s;if(Dr(t))return t;let c=Or(t),l=c===void 0?n:c;if(l===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let u=t;if(u&&typeof u.toJSON==`function`)try{return jr(``,u.toJSON(),l-1,r,i)}catch{}let d=Array.isArray(t)?[]:{},f=0,p=Xe(t);for(let e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(f>=r){d[e]=`[MaxProperties ~]`;break}let t=p[e];d[e]=jr(e,t,l-1,r,i),f++}return o(t),d}function Mr(e,t){try{if(e===`domain`&&t&&typeof t==`object`&&t._events)return`[Domain]`;if(e===`domainEmitter`)return`[DomainEmitter]`;if(typeof global<`u`&&t===global)return`[Global]`;if(typeof window<`u`&&t===window)return`[Window]`;if(typeof document<`u`&&t===document)return`[Document]`;if(Re(t))return ue(t);if(Ie(t))return`[SyntheticEvent]`;if(typeof t==`number`&&!Number.isFinite(t))return`[${t}]`;if(typeof t==`function`)return`[Function: ${ce(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=Nr(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}function Nr(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function Pr(e){return~-encodeURI(e).split(/%..|./).length}function Fr(e){return Pr(JSON.stringify(e))}function Ir(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function Lr(e,t=[]){return[e,t]}function Rr(e,t){let[n,r]=e;return[n,[...r,t]]}function zr(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function Br(e,t){return zr(e,(e,n)=>t.includes(n))}function Vr(e){let t=T(S);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Hr(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[Vr(r),e]:r.push(typeof e==`string`?Vr(e):e)}for(let e of n){let[t,n]=e;if(i(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(kr(n))}i(e)}}return typeof r==`string`?r:Ur(r)}function Ur(e){let t=e.reduce((e,t)=>
11e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Wr(e){return[{type:`span`},e]}function Gr(e){let t=typeof e.data==`string`?Vr(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Kr={sessions:`session`,event:`error`,client_report:`internal`,user_report:`default`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,raw_security:`security`,log:`log_item`,trace_metric:`metric`};function qr(e){return e in Kr}function Jr(e){return qr(e)?Kr[e]:e}function Yr(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Xr(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:On(r)},...i&&{trace:i}}}function Zr(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function Qr(e,t,n,r){let i=Yr(n);return Lr({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:On(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function $r(e,t,n,r){let i=Yr(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;Zr(e,n?.sdk);let o=Xr(e,i,r,t);return delete e.sdkProcessingMetadata,Lr(o,[[{type:a},e]])}function ei(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=Sr(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:On(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>{let t=qn(e);return!mr({description:t.description,op:t.op,attributes:t.data},c)}):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=qn(e);return(wr(s)?t:s(t))||(lr(),t)}:qn,f=[];for(let e of l){let t=d(e);t&&f.push(Wr(t))}return Lr(o,f)}function ti(e){if(!x)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`,parent_span_id:r}=qn(e),{spanId:i}=e.spanContext(),a=Qn(e),o=or(e),s=o===e,c=`[Tracing] Starting ${a?`sampled`:`unsampled`} ${s?`root `:``}span`,l=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!s){let{op:e,description:t}=qn(o);l.push(`root ID: ${o.spanContext().spanId}`),e&&l.push(`root op: ${e}`),t&&l.push(`root description: ${t}`)}R.log(`${c} 12 ${l.join(` 13 `)}`)}function ni(e){if(!x)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`}=qn(e),{spanId:r}=e.spanContext(),i=`[Tracing] Finishing "${n}" ${or(e)===e?`root `:``}span "${t}" with ID ${r}`;R.log(i)}function ri(e,t,n,r=cr()){let i=r&&or(r);i&&(x&&R.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[fn]:t,[dn]:n}))}function ii(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[dn],i=n[fn];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}function ai(e){return e.getOptions().traceLifecycle===`stream`}var oi=1e3,si=class{constructor(e={}){this._traceId=e.traceId||At(),this._spanId=e.spanId||jt(),this._startTime=e.startTimestamp||xt(),this._links=e.links,this._attributes={},this.setAttributes({[ln]:`manual`,[cn]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:n?1:0}}setAttribute(e,t){return t===void 0?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=Gn(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(an,`custom`),this}end(e){this._endTime||(this._endTime=Gn(e),ni(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[cn],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:$n(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ln],profile_id:this._attributes[mn],exclusive_time:this._attributes[hn],measurements:ii(this._events),is_segment:this._isStandaloneSpan&&or(this)===this||void 0,segment_id:this._isStandaloneSpan?or(this).spanContext().spanId:void 0,links:Un(this._links)}}getStreamedSpanJSON(){return{name:this._name??``,span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===or(this),status:er(this._status),attributes:this._attributes,links:Wn(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){x&&R.log(`[Tracing] Adding an event to span:`,e);let r=ci(t)?t:n||xt(),i=ci(t)?{}:t||{},a={name:e,time:Gn(r),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=nn();if(e&&(e.emit(`spanEnd`,this),this._isStandaloneSpan||e.emit(`afterSpanEnd`,this)),!(this._isStandaloneSpan||this===or(this)))return;if(this._isStandaloneSpan){this._sampled?di(ei([this],e)):(x&&R.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}else if(e&&ai(e)){e.emit(`afterSegmentSpanEnd`,this);return}let t=this._convertSpanToTransaction();t&&(wn(this).scope||Qt()).captureEvent(t)}_convertSpanToTransaction(){if(!li(qn(this)))return;this._name||=(x&&R.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:e,isolationScope:t}=wn(this),n=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let r=ar(this).filter(e=>e!==this&&!ui(e)).map(e=>qn(e)).filter(li),i=this._attributes[an];
13delete this._attributes[pn],r.forEach(e=>{delete e.data[pn]});let a={contexts:{trace:Bn(this)},spans:r.length>oi?r.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,oi):r,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,dynamicSamplingContext:Sr(this)},request:n,...i&&{transaction_info:{source:i}}},o=ii(this._events);return o&&Object.keys(o).length&&(x&&R.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(o,void 0,2)),a.measurements=o),a}};function ci(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function li(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function ui(e){return e instanceof si&&e.isStandaloneSpan()}function di(e){let t=nn();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}function fi(e,t,n){if(!fr(e))return[!1];let r,i;typeof e.tracesSampler==`function`?(i=e.tracesSampler({...t,inheritOrSampleWith:e=>typeof t.parentSampleRate==`number`?t.parentSampleRate:typeof t.parentSampled==`boolean`?Number(t.parentSampled):e}),r=!0):t.parentSampled===void 0?e.tracesSampleRate!==void 0&&(i=e.tracesSampleRate,r=!0):i=t.parentSampled;let a=Nn(i);if(a===void 0)return x&&R.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return x&&R.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),[!1,a,r];let o=n<a;return o||x&&R.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[o,a,r]}var pi=`__SENTRY_SUPPRESS_TRACING__`;function mi(e){let t=vi();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=_i(e),{forceTransaction:r,parentSpan:i}=e;return(e.scope?t=>tn(e.scope,t):i===void 0?e=>e():e=>hi(i,e))(()=>{let t=Qt(),a=xi(t,i),o=nn();return e.onlyIfParent&&!a?(o?.recordDroppedEvent(`no_parent_span`,`span`),new Cr):gi({parentSpan:a,spanArguments:n,forceTransaction:r,scope:t})})}function hi(e,t){let n=vi();return n.withActiveSpan?n.withActiveSpan(e,t):tn(n=>(Nt(n,e||void 0),t(n)))}function gi({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!fr()){let r=new Cr;return(n||!e)&&yr(r,{sampled:`false`,sample_rate:`0`,transaction:t.name,...Sr(r)}),r}let i=nn();if(Si(i,t))return Ci(r)||i?.recordDroppedEvent(`ignored`,`span`),new Cr({dropReason:`ignored`,traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let a=$t(),o;if(e&&!n)o=bi(e,r,t),rr(e,o);else if(e){let n=Sr(e),{traceId:i,spanId:a}=e.spanContext(),s=Qn(e);o=yi({traceId:i,parentSpanId:a,...t},r,s),yr(o,n)}else{let{traceId:e,dsc:n,parentSpanId:i,sampled:s}={...a.getPropagationContext(),...r.getPropagationContext()};o=yi({traceId:e,parentSpanId:i,...t},r,s),n&&yr(o,n)}return ti(o),Cn(o,r,a),o}function _i(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=Gn(e.startTime),delete n.startTime,n}return t}function vi(){return Jt(w())}function yi(e,t,n){let r=nn(),i=r?.getOptions()||{},{name:a=``}=e,o={spanAttributes:{...e.attributes},spanName:a,parentSampled:n};r?.emit(`beforeSampling`,o,{decision:!1});let s=o.parentSampled??n,c=o.spanAttributes,l=t.getPropagationContext(),u=Ci(t),[d,f,p]=u?[!1]:fi(i,{name:a,parentSampled:s,attributes:c,parentSampleRate:Nn(l.dsc?.sample_rate)},l.sampleRand),m=new si({...e,attributes:{[an]:`custom`,[on]:f!==void 0&&p?f:void 0,...c},sampled:d});return!d&&r&&!u&&(x&&R.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),r.recordDroppedEvent(`sample_rate`,ai(r)?`span`:`transaction`)),r&&r.emit(`spanStart`,m),m}function bi(e,t,n){let{spanId:r,traceId:i}=e.spanContext(),a=Ci(t),o=a?!1:Qn(e),s=o?new si({...n,parentSpanId:r,traceId:i,sampled:o}):new Cr({traceId:i});rr(e,s);let c=nn();return c?(ai(c)&&s instanceof Cr&&(e instanceof Cr&&e.dropReason?(s.dropReason=e.dropReason,c.recordDroppedEvent(e.dropReason,`span`)):a||(s.dropReason=`sample_rate`,c.recordDroppedEvent(`sample_rate`,`span`))),c.emit(`spanStart`,s),n.endTimestamp&&(c.emit
13(`spanEnd`,s),c.emit(`afterSpanEnd`,s)),s):s}function xi(e,t){if(t)return t;if(t===null)return;let n=Pt(e);if(!n)return;let r=nn();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?or(n):n}function Si(e,t){let n=e?.getOptions().ignoreSpans;return!e||!ai(e)||!n?.length?!1:mr({description:t.name||``,op:t.attributes?.[`sentry.op`]||t.op,attributes:t.attributes},n)}function Ci(e){return e.getScopeData().sdkProcessingMetadata[pi]===!0}var wi={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Ti=`heartbeatFailed`,Ei=`idleTimeout`,Di=`finalTimeout`,Oi=`externalFinish`;function ki(e,t={}){let n=new Map,r=!1,i,a=Oi,o=!t.disableAutoFinish,s=[],{idleTimeout:c=wi.idleTimeout,finalTimeout:l=wi.finalTimeout,childSpanTimeout:u=wi.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:f=!0}=t,p=nn();if(!p||!fr()){let e=new Cr;return yr(e,{sample_rate:`0`,sampled:`false`,...Sr(e)}),e}let m=Qt(),h=cr(),g=Ai(e);g.end=new Proxy(g.end,{apply(e,t,n){if(d&&d(g),t instanceof Cr)return;let[r,...i]=n,a=Gn(r||xt()),o=ar(g).filter(e=>e!==g),s=qn(g);if(!o.length||!f)return C(a),Reflect.apply(e,t,[a,...i]);let c=p.getOptions().ignoreSpans,u=o?.reduce((e,t)=>{let n=qn(t);return!n.timestamp||c&&mr({description:n.description,op:n.op,attributes:n.data},c)?e:e?Math.max(e,n.timestamp):n.timestamp},void 0),m=s.start_timestamp,h=Math.min(m?m+l/1e3:1/0,Math.max(m||-1/0,Math.min(a,u||1/0)));return C(h),Reflect.apply(e,t,[h,...i])}});function _(){i&&=(clearTimeout(i),void 0)}function v(e){_(),i=setTimeout(()=>{!r&&n.size===0&&o&&(a=Ei,g.end(e))},c)}function y(e){i=setTimeout(()=>{!r&&o&&(a=Ti,g.end(e))},u)}function b(e){_(),n.set(e,!0),y(xt()+u/1e3)}function S(e){n.has(e)&&n.delete(e),n.size===0&&v(xt()+c/1e3)}function C(e){r=!0,n.clear(),s.forEach(e=>e()),Nt(m,h);let t=qn(g),{start_timestamp:i}=t;if(!i)return;t.data[`sentry.idle_span_finish_reason`]||g.setAttribute(un,a);let o=t.status;(!o||o===`unknown`)&&g.setStatus({code:1}),R.log(`[Tracing] Idle span "${t.op}" finished`);let u=ar(g).filter(e=>e!==g),d=0;u.forEach(t=>{t.isRecording()&&(t.setStatus({code:2,message:`cancelled`}),t.end(e),x&&R.log(`[Tracing] Cancelling span since span ended early`,JSON.stringify(t,void 0,2)));let{timestamp:n=0,start_timestamp:r=0}=qn(t),i=r<=e,a=(l+c)/1e3,o=n-r<=a;if(x){let e=JSON.stringify(t,void 0,2);i?o||R.log(`[Tracing] Discarding span since it finished after idle span final timeout`,e):R.log(`[Tracing] Discarding span since it happened after idle span was finished`,e)}(!o||!i)&&(ir(g,t),d++)}),d>0&&g.setAttribute(`sentry.idle_span_discarded_spans`,d)}return s.push(p.on(`spanStart`,e=>{r||e===g||qn(e).timestamp||e instanceof si&&e.isStandaloneSpan()||ar(g).includes(e)&&b(e.spanContext().spanId)})),s.push(p.on(`spanEnd`,e=>{r||S(e.spanContext().spanId)})),s.push(p.on(`idleSpanEnableAutoFinish`,e=>{e===g&&(o=!0,v(),n.size&&y())})),t.disableAutoFinish||v(),setTimeout(()=>{r||(g.setStatus({code:2,message:`deadline_exceeded`}),a=Di,g.end())},l),g}function Ai(e){let t=mi(e);return Nt(Qt(),t),x&&R.log(`[Tracing] Started span is an idle span`),t}function ji(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;Fi(e,t),r&&Ri(e,r),zi(e,n),Ii(e,i),Li(e,a)}function Mi(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;Ni(e,`extra`,n),Ni(e,`tags`,r),Ni(e,`attributes`,i),Ni(e,`user`,a),Ni(e,`contexts`,o),e.sdkProcessingMetadata=kt(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Ni(e,t,n){e[t]=kt(e[t],n,1)}function Pi(e,t){let n=en().getScopeData();return e&&Mi(n,e.getScopeData()),t&&Mi(n,t.getScopeData()),n}function Fi(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function Ii(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Li(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Ri(e,t){e.contexts={trace:Vn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Sr(t),...e.sdkProcessingMetadata};let n=qn(or(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function zi(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function Bi(e,t){let n=e.attributes??={};Object.entries(t).forEach(([e,t])=>{t!=null&&!(e in n)&&(n[e]=t)})}var Vi=0,Hi=1,Ui=2;function Wi(e){return new Ki(t=>{t(e)})}function Gi(e){return new Ki((t,n)=>{n(e)})}var Ki=class e{constructor(e){this._state=Vi,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>
13{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===Vi)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===Hi&&e[1](this._value),this._state===Ui&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===Vi){if(Fe(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(Hi,e)},r=e=>{t(Ui,e)};try{e(n,r)}catch(e){r(e)}}};function qi(e,t,n,r=0){try{let i=Ji(t,n,e,r);return Fe(i)?i:Wi(i)}catch(e){return Gi(e)}}function Ji(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return x&&a===null&&R.log(`Event processor "${i.id||`?`}" dropped event`),Fe(a)?a.then(e=>Ji(e,t,n,r+1)):Ji(a,t,n,r+1)}var Yi,Xi,Zi,Qi;function $i(e){let t=S._sentryDebugIds,n=S._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Qi&&r.length===Xi&&i.length===Zi)return Qi;Xi=r.length,Zi=i.length,Qi={},Yi||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=Yi?.[r];if(i&&Qi&&t)Qi[i[0]]=t,Yi&&(Yi[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&Qi&&Yi){Qi[i]=t,Yi[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),Qi}function ea(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||ut(),timestamp:t.timestamp||vt()},l=n.integrations||e.integrations.map(e=>e.name);ta(c,e),ia(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&na(c,e.stackParser);let u=oa(r,n.captureContext);n.mechanism&&mt(c,n.mechanism);let d=i?i.getEventProcessors():[],f=Pi(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),ji(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Wi(c):qi(m,c,n)).then(e=>(e&&ra(e),typeof o==`number`&&o>0?aa(e,o,s):e))}function ta(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=it(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=it(e.value,a)})}function na(e,t){let n=$i(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function ra(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function ia(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function aa(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:kr(e.data,t,n)}}))},...e.user&&{user:kr(e.user,t,n)},...e.contexts&&{contexts:kr(e.contexts,t,n)},...e.extra&&{extra:kr(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=kr(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:kr(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=kr(e.contexts.flags,3,n)),r}function oa(e,t){if(!t)return e;let n=e?e.clone():new It;return n.update(t),n}function sa(e){if(e)return ca(e)||ua(e)?{captureContext:e}:e}function ca(e){return e instanceof It||typeof e==`function`}var la=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function ua(e){return Object.keys(e).some(e=>la.includes(e))}function da(e,t){return Qt().captureException(e,sa(t))}function fa(e,t){let n=typeof t==`string`?t:void 0,r=typeof t==`string`?void 0:{captureContext:t};return Qt().captureMessage(e,n,r)}function pa(e,t){return Qt().captureEvent(e,t)}function ma(e,t){$t().setContext(e,t)}function ha(){return $t().lastEventId()}function ga(){let e=nn();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function _a(e){$t().addEventProcessor(e)}function va(e){let t=$t(),{user:n}=Pi(t,Qt()),{userAgent:r}=S.navigator||{},i=Tt({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&Et(a,{status:`exited`}),ya(),t.setSession(i),i}function ya(){let e=$t(),t=Qt().getSession()||e.getSession();t&&Dt(t),ba(),e.setSession()}function ba(){let e=$t(),t=nn(),n=e.getSession();n&&t&&t.captureSession(n)}function xa(e=!1){if(e){ya();return}ba()}function Sa(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function Ca(e){return`${Sa(e)}${e.projectId}/envelope/`}function wa(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Ta(e,t,n){return t||`${Ca(e)}?${wa(e,n)}`}function Ea(e,t){let n=Mn(e);if(!n)return``;let r=`${Sa(n)}embed/error-page/`,i=`dsn=${On(n)}`;for(let e in t)if(e!==`dsn`&&e!==`onClose`)if(e===`user`){let e=t.user;if(!e)continue;e.name&&(i+=`&name=${encodeURIComponent(e.name)}
13`),e.email&&(i+=`&email=${encodeURIComponent(e.email)}`)}else i+=`&${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`;return`${r}?${i}`}var Da=[];function Oa(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function ka(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return Oa(r)}function Aa(e,t){let n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&Ma(e,t,n)}),n}function ja(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Ma(e,t,n){if(n[t.name]){x&&R.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Da.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),Da.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}[`processSpan`,`processSegmentSpan`].forEach(n=>{let r=t[n];typeof r==`function`&&e.on(n,n=>r.call(t,n,e))}),x&&R.log(`Integration installed: ${t.name}`)}function Na(e){return e}function Pa(e){return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{items:e}]}function Fa(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=On(r)),Lr(i,[Pa(e)])}function Ia(e,t){let n=t??La(e)??[];if(n.length===0)return;let r=e.getOptions(),i=Fa(n,r._metadata,r.tunnel,e.getDsn());Ra().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function La(e){return Ra().get(e)}function Ra(){return E(`clientToLogBufferMap`,()=>new WeakMap)}function za(e){return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{items:e}]}function Ba(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=On(r)),Lr(i,[za(e)])}function Va(e,t){let n=t??Ha(e)??[];if(n.length===0)return;let r=e.getOptions(),i=Ba(n,r._metadata,r.tunnel,e.getDsn());Ua().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function Ha(e){return Ua().get(e)}function Ua(){return E(`clientToMetricBufferMap`,()=>new WeakMap)}function Wa(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}var Ga=Symbol.for(`SentryBufferFullError`);function Ka(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return Gi(Ga);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return Wi(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>Wa(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}var qa=60*1e3;function Ja(e,t=rt()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?qa:r-t}function Ya(e,t){return e[t]||e.all||0}function Xa(e,t,n=rt()){return Ya(e,t)>n}function Za(e,{statusCode:t,headers:n},r=rt()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+Ja(o,r):t===429&&(i.all=r+60*1e3);return i}function Qa(e,t,n=Ka(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(zr(i,(t,n)=>{let i=Jr(n);Xa(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=Lr(i[0],a),s=t=>{if(Br(o,[`client_report`])){x&&R.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}zr(o,(n,r)=>{e.recordDroppedEvent(t,Jr(r))})};return n.add(()=>t({body:Hr(o)}).then(e=>e.statusCode===413?(x&&R.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(x&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&R.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Za(r,e),e),e=>{throw s(`network_error`),x&&R.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>
13{if(e===Ga)return x&&R.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function $a(e,t,n){let r=[{type:`client_report`},{timestamp:n||vt(),discarded_events:e}];return Lr(t?{dsn:t}:{},[r])}function eo(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function to(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[mn],exclusive_time:o?.[hn],measurements:e.measurements,is_segment:!0}}function no(e){return{type:`transaction`,timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var ro=`Not capturing exception because it's already been captured.`,io=`Discarded session because of missing or non-string release`,ao=Symbol.for(`SentryInternalError`),oo=Symbol.for(`SentryDoNotSendEventError`),so=5e3;function co(e){return{message:e,[ao]:!0}}function lo(e){return{message:e,[oo]:!0}}function uo(e){return!!e&&typeof e==`object`&&ao in e}function fo(e){return!!e&&typeof e==`object`&&oo in e}function po(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{a+=r(t),a>=8e5?i(e):s||(s=!0,o=Wa(setTimeout(()=>{i(e)},so)))}),e.on(`flush`,()=>{i(e)})}var mo=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Ka(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=Mn(e.dsn):x&&R.warn(`No DSN provided, client will not send events.`),this._dsn){let t=Ta(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&po(this,`afterCaptureLog`,`flushLogs`,xo,Ia),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&po(this,`afterCaptureMetric`,`flushMetrics`,bo,Va)}captureException(e,t,n){let r=ut();if(ht(e))return x&&R.log(ro),r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:ut(),...n},a=ke(e)?e:String(e),o=Ae(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=ut();if(t?.originalException&&ht(t.originalException))return x&&R.log(ro),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=ho(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),Et(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(!t)return!0;this.emit(`flush`);let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){Ia(this);let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),Ma(this,e,this._integrations),t||ja(this,[e])}sendEvent(e,t={}
13){this.emit(`beforeSendEvent`,e,t);let n=$r(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=Rr(n,Gr(e));this.sendEnvelope(n).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=_r}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){x&&R.warn(io);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){x&&R.warn(io);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=Qr(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;x&&R.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return x&&R.error(`Error while sending envelope:`,e),{}}return x&&R.error(`Transport disabled`),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Aa(this,e),ja(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(Et(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a?.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),ea(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:{...e.contexts?.trace,...rn(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:xr(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=Qt(),r=$t()){return x&&vo(e)&&R.log(`Captured error event \`${eo(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{x&&(fo(e)?R.log(e.message):uo(e)?R.warn(e.message):R.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=yo(e),s=vo(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:Nn(a);if(s&&typeof l==`number`&&nt()>l)return this.recordDroppedEvent(`sample_rate`,`error`),Gi(lo(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let u=ho(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),lo("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?e:go(_o(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw lo(`${c} returned \`null\`, will not send event.`)}let a=n.getSession()||r.getSession();if(s&&a&&this._updateSessionFromEvent(a,i),o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let l=i.transaction_info;return o&&l&&i.transaction!==e.transaction&&(i.transaction_info={...l,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw fo(e)||uo(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),co(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===Ga&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){x&&R.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){x&&R.log(`No outcomes to send`);return}if(!this._dsn){x&&R.log(`No dsn provided, will not send outcomes`);return}x&&R.log(`Sending outcomes:`,e);let t=$a(e,this._options.tunnel&&On(this._dsn));this.sendEnvelope(t)}};
13function ho(e){return e===`replay_event`?`replay`:e||`error`}function go(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Fe(e))return e.then(e=>{if(!je(e)&&e!==null)throw co(n);return e},e=>{throw co(`${t} rejected with ${e}`)});if(!je(e)&&e!==null)throw co(n);return e}function _o(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,ignoreSpans:o}=t,s=!wr(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(vo(c)&&i)return i(c,r);if(yo(c)){if(s||o){let t=to(c);if(o?.length&&mr({description:t.description,op:t.op,attributes:t.data},o))return null;if(s){let e=s(t);e?c=kt(n,no(e)):lr()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(o?.length&&mr({description:e.description,op:e.op,attributes:e.data},o)){hr(n,e);continue}if(s){let n=s(e);n?t.push(n):(lr(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function vo(e){return e.type===void 0}function yo(e){return e.type===`transaction`}function bo(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+So(e.attributes)}function xo(e){let t=0;return e.message&&(t+=e.message.length*2),t+So(e.attributes)}function So(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Co(e[0]):Ae(e)?t+=Co(e):t+=100}),t}function Co(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function wo(e){return Ce(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function To(e){return wo(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function Eo(e,t){t.debug===!0&&(x?R.enable():A(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Qt().update(t.initialScope);let n=new e(t);return Do(n),n.init(),n}function Do(e){Qt().setClient(e)}var Oo=`thismessage:/`;function ko(e){return`isRelative`in e}function Ao(e,t){let n=e.indexOf(`://`)<=0&&e.indexOf(`//`)!==0,r=t??(n?Oo:void 0);try{if(`canParse`in URL&&!URL.canParse(e,r))return;let t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}}function jo(e){if(ko(e))return e.pathname;let t=new URL(e);return t.search=``,t.hash=``,[`80`,`443`].includes(t.port)&&(t.port=``),t.password&&=`%filtered%`,t.username&&=`%filtered%`,t.toString()}function Mo(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function No(e){return e.split(/[?#]/,1)[0]}function Po(e,t=!0){if(e.startsWith(`data:`)){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:`text/plain`,i=e.includes(`;base64,`),a=e.indexOf(`,`),o=``;if(t&&a!==-1){let t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${i?`,base64`:``}${o?`,${o}`:``}`}return e}function Fo(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return mee(e,n)||Io(e,r)}function Io(e,t){return t?Ro(e)===Ro(t):!1}function mee(e,t){let n=Ao(e);return!n||ko(n)||!t?!1:Lo(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function Lo(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function Ro(e){return e[e.length-1]===`/`?e.slice(0,-1):e}function zo(e){`aggregates`in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:`{{auto}}`}):e.ipAddress===void 0&&(e.ipAddress=`{{auto}}`)}function Bo(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:C})),i.version=C)}function Vo(e={}){let t=e.client||nn();if(!ga()||!t)return{};let n=Jt(w());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||Qt(),i=e.span||cr();if(!i&&Zt())return{};let a=i?Hn(i):Ho(r),o=ree(i?Sr(i):xr(t,r));if(!Pn.test(a))return R.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let s={"sentry-trace":a,baggage:o};return e.propagateTraceparent&&(s.traceparent=i?fee(i):Uo(r)),s}function Ho(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return In(t,r,n)}function Uo(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Ln(t,r,n)}function Wo(e,t,n){let r,i,a,o=n?.maxWait?Math.max(n.maxWait,t):0,s=n?.setTimeoutImpl||setTimeout;function c(){return l(),r=e(),r}function l(){i!==void 0&&clearTimeout(i),a!==void 0&&clearTimeout(a),i=a=void 0}function u(){return i!==void 0||a!==void 0?c():r}function d(){return i&&clearTimeout(i),i=s(c,t),o&&a===void 0&&(a=s(c,o)),r}return d.cancel=l,d.flush=u,d}var Go=100;function Ko(e,t){let n=nn(),r=$t();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Go}=n.getOptions();if(a<=0)return;let o={timestamp:vt(),...e},s=i?A(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}var qo,Jo=`FunctionToString`,Yo=new WeakMap,Xo=Na((()=>({name:Jo,setupOnce(){qo=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=Ye(this),n=Yo.has(nn())&&t!==void 0?t:this;return qo.apply(n,e)}}catch{}},setup(e){Yo.set(e,!0)}}))),Zo=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],Qo=`EventFilters`,$o=Na((e={})=>{let t;return{name:Qo,setup(n){t=ts(e,n.getOptions())},processEvent(n,r,i){return t||=ts(e,i.getOptions()),ns(n,t)?null:n}}}),es=Na(((e={})=>({...$o(e),name:`InboundFilters`})));function ts(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Zo],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function ns(e,t){if(e.type){if(e.type===`transaction`&&is(e,t.ignoreTransactions))return x&&R.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${ft(e)}`),!0}else{if(rs(e,t.ignoreErrors))return x&&R.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${ft(e)}`),!0;if(us(e))return x&&R.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${ft(e)}`),!0;if(as(e,t.denyUrls))return x&&R.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${ft(e)}.\nUrl: ${ls(e)}`),!0;if(!ss(e,t.allowUrls))return x&&R.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${ft(e)}.\nUrl: ${ls(e)}`),!0}return!1}function rs(e,t){return t?.length?eo(e).some(e=>st(e,t)):!1}function is(e,t){if(!t?.length)return!1;let n=e.transaction;return n?st(n,t):!1}function as(e,t){if(!t?.length)return!1;let n=ls(e);return n?st(n,t):!1}function ss(e,t){if(!t?.length)return!0;let n=ls(e);return n?st(n,t):!0}function cs(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function ls(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?cs(t):null}catch{return x&&R.error(`Cannot extract url for event ${ft(e)}`),null}}function us(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function ds(e,t,n,r,i,a){if(!i.exception?.values||!a||!Le(a.originalException,Error))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=fs(e,t,r,a.originalException,n,i.exception.values,o,0))}
13function fs(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(Le(r[i],Error)){ms(o,s,r);let a=e(t,r[i]),l=c.length;hs(a,i,l,s),c=fs(e,t,n,r[i],i,[a,...c],a,l)}return ps(r)&&r.errors.forEach((a,l)=>{if(Le(a,Error)){ms(o,s,r);let u=e(t,a),d=c.length;hs(u,`errors[${l}]`,d,s),c=fs(e,t,n,a,i,[u,...c],u,d)}}),c}function ps(e){return Array.isArray(e.errors)}function ms(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...ps(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function hs(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function gs(e){let t=`console`,n=pe(t,e);return me(t,_s),n}function _s(){`console`in S&&D.forEach(function(e){e in S.console&&Ke(S.console,e,function(t){return k[e]=t,function(...t){he(`console`,{args:t,level:e}),k[e]?.apply(S.console,t)}})})}function vs(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var ys=`Dedupe`,hee=Na((()=>{let e;return{name:ys,processEvent(t){if(t.type)return t;try{if(gee(t,e))return x&&R.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function gee(e,t){return t?!!(bs(e,t)||xs(e,t)):!1}function bs(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Cs(e,t)||!Ss(e,t))}function xs(e,t){let n=ws(t),r=ws(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Cs(e,t)||!Ss(e,t))}function Ss(e,t){let n=le(e),r=le(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Cs(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function ws(e){return e.exception?.values?.[0]}var Ts=`ConversationId`,Es=Na((()=>({name:Ts,setup(e){e.on(`spanStart`,e=>{let t=Qt().getScopeData(),n=$t().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=qn(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(_n,r)}})}})));function Ds(e,t,n,r,i){if(!e.fetchData)return;let{method:a,url:o}=e.fetchData,s=fr()&&t(o);if(e.endTimestamp){let t=e.fetchData.__span;if(!t)return;let n=r[t];n&&(s&&(As(n,e),Os(n,e,i)),delete r[t]);return}let{spanOrigin:c=`auto.http.browser`,propagateTraceparent:l=!1}=typeof i==`object`?i:{spanOrigin:i},u=nn(),d=!!cr(),f=s&&d?mi(Ps(o,a,c)):new Cr;if(s&&!d&&u?.recordDroppedEvent(`no_parent_span`,`span`),e.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f,n(e.fetchData.url)){let t=e.args[0],n={...e.args[1]||{}},r=ks(t,n,fr()&&d?f:void 0,l);r&&(e.args[1]=n,n.headers=r)}if(u){let t={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit(`beforeOutgoingRequestSpan`,f,t)}return f}function Os(e,t,n){(typeof n==`object`&&n?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function ks(e,t,n,r){let i=Vo({span:n,propagateTraceparent:r}),a=i[`sentry-trace`],o=i.baggage,s=i.traceparent;if(!a)return;let c=t.headers||(ze(e)?e.headers:void 0);if(c)if(Ms(c)){let e=new Headers(c);if(e.get(`sentry-trace`)||e.set(`sentry-trace`,a),r&&s&&!e.get(`traceparent`)&&e.set(`traceparent`,s),o){let t=e.get(`baggage`);t?js(t)||e.set(`baggage`,`${t},${o}`):e.set(`baggage`,o)}return e}else if(Ns(c)){let e=[...c];e.find(e=>e[0]===`sentry-trace`)||e.push([`sentry-trace`,a]),r&&s&&!e.find(e=>e[0]===`traceparent`)&&e.push([`traceparent`,s]);let t=c.find(e=>e[0]===`baggage`&&typeof e[1]==`string`&&js(e[1]));return o&&!t&&e.push([`baggage`,o]),e}else{let e=`sentry-trace`in c?c[`sentry-trace`]:void 0,t=`traceparent`in c?c.traceparent:void 0,n=`baggage`in c?c.baggage:void 0,i=n?Array.isArray(n)?[...n]:[n]:[],l=n&&(Array.isArray(n)?n.find(e=>js(e)):js(n));o&&!l&&i.push(o);let u=Object.assign({},c,{"sentry-trace":e??a,baggage:i.length>0?i.join(`,`):void 0});return r&&s&&!t&&(u.traceparent=s),u}else return{...i}}function As(e,t){if(t.response){yn(e,t.response.status);let n=t.response?.headers?.get(`content-length`);if(n){let t=parseInt(n);t>0&&e.setAttribute(`http.response_content_length`,t)}}else t.error&&e.setStatus({code:2,message:`internal_error`});e.end()}function js(e){return typeof e==`string`?e.split(`,`).some(e=>e.trim().startsWith(Tn)):!1}function Ms(e){return typeof Headers<`u`&&Le(e,Headers)}function Ns(e){return Array.isArray(e)?e.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`string`):!1}function Ps(e,t,n){if(e.startsWith(`data:`))return{name:`${t} ${Po(e)}`,attributes:Fs(e,void 0,t,n)};let r=Ao(e);return{name:`${t} ${r?jo(r):e}`,attributes:Fs(e,r,t,n)}}function Fs(e,t,n,r){let i={url:Po(e),type:`fetch`,"http.method":n,[ln]:r,[cn]:`http.client`};return t&&(ko(t)||(i[`http.url`]=Po(t.href),i[`server.address`]=t.host),t.search&&(i[`http.query`]=t.search),t.hash&&(i[`http.fragment`]=t.hash)),i}function _ee(){return typeof __SENTRY_BROWSER_BUNDLE__<`u`&&!!__SENTRY_BROWSER_BUNDLE__}function vee(){return`npm`}function Is(){return!_ee()&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`}function Ls(){return typeof window<`u`&&(!Is()||Rs())}function Rs(){return S.process?.type===`renderer`}function zs(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var Bs=S;function yee(){return`history`in Bs&&!!Bs.history}function Vs(){if(!(`fetch`in Bs))return!1;
13try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function Hs(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Us(){if(typeof EdgeRuntime==`string`)return!0;if(!Vs())return!1;if(Hs(Bs.fetch))return!0;let e=!1,t=Bs.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Hs(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){x&&R.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function Ws(e,t){let n=`fetch`,r=pe(n,e);return me(n,()=>Ks(void 0,t)),r}function Gs(e){let t=`fetch-body-resolved`,n=pe(t,e);return me(t,()=>Ks(Js)),n}function Ks(e,t=!1){t&&!Us()||Ke(S,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=Zs(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:xt()*1e3,virtualError:r,headers:bee(n)};return e||he(`fetch`,{...o}),t.apply(S,n).then(async t=>(e?e(t):he(`fetch`,{...o,endTimestamp:xt()*1e3,response:t}),t),e=>{he(`fetch`,{...o,endTimestamp:xt()*1e3,error:e}),Ce(e)&&e.stack===void 0&&(e.stack=r.stack,qe(e,`framesToPop`,1));let t=nn()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&e instanceof TypeError&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let n=new URL(o.fetchData.url).host;t===`always`?e.message=`${e.message} (${n})`:qe(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}async function qs(e,t){if(e?.body){let n=e.body,r=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3),a=!0;for(;a;){let e;try{e=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:i}=await r.read();clearTimeout(e),i&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(e)}}clearTimeout(i),r.releaseLock(),n.cancel().then(null,()=>{})}}function Js(e){let t;try{t=e.clone()}catch{return}qs(t,()=>{he(`fetch-body-resolved`,{endTimestamp:xt()*1e3,response:e})})}function Ys(e,t){return!!e&&typeof e==`object`&&!!e[t]}function Xs(e){return typeof e==`string`?e:e?Ys(e,`url`)?e.url:e.toString?e.toString():``:``}function Zs(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:Xs(t),method:Ys(n,`method`)?String(n.method).toUpperCase():ze(t)&&Ys(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:Xs(t),method:Ys(t,`method`)?String(t.method).toUpperCase():`GET`}}function bee(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(ze(t))return new Headers(t.headers)}catch{}}var Qs=S,$s=0;function ec(){return $s>0}function tc(){$s++,setTimeout(()=>{$s--})}function nc(e,t={}){function n(e){return typeof e==`function`}if(!n(e))return e;try{let t=e.__sentry_wrapped__;if(t)return typeof t==`function`?t:e;if(Ye(e))return e}catch{return e}let r=function(...n){try{let r=n.map(e=>nc(e,t));return e.apply(this,r)}catch(e){throw tc(),tn(r=>{r.addEventProcessor(e=>(t.mechanism&&(pt(e,void 0,void 0),mt(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),da(e)}),e}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}Je(r,e),qe(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,`name`,{get(){return e.name}})}catch{}return r}function rc(){let e=We(),{referrer:t}=Qs.document||{},{userAgent:n}=Qs.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function ic(e,t){let n=sc(e,t),r={type:fc(t),value:pc(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function ac(e,t,n,r){let i=nn()?.getOptions().normalizeDepth,a=bc(t),o={__serialized__:Ar(t,i)};if(a)return{exception:{values:[ic(e,a)]},extra:o};let s={exception:{values:[{type:Me(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:vc(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=sc(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function oc(e,t){return{exception:{values:[ic(e,t)]}}}function sc(e,t){let n=t.stacktrace||t.stack||``,r=lc(t),i=uc(t);try{return e(n,r,i)}catch{}return[]}var cc=/Minified React error #\d+;/i;function lc(e){return e&&cc.test(e.message)?1:0}function uc(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function dc(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0?e instanceof WebAssembly.Exception:!1}function fc(e){let t=e?.name;return!t&&dc(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function pc(e){let t=e?.message;return dc(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?To(t.error):To(e):`No error message`}function mc(e,t,n,r){let i=gc(e,t,n?.syntheticException||void 0,r);
13return mt(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),Wi(i)}function hc(e,t,n=`info`,r,i){let a=_c(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),Wi(a)}function gc(e,t,n,r,i){let a;if(Te(t)&&t.error)return oc(e,t.error);if(Ee(t)||De(t)){let i=t;if(`stack`in t)a=oc(e,t);else{let t=i.name||(Ee(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=_c(e,o,n,r),pt(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return Ce(t)?oc(e,t):je(t)||Me(t)?(a=ac(e,t,n,i),mt(a,{synthetic:!0}),a):(a=_c(e,t,n,r),pt(a,`${t}`,void 0),mt(a,{synthetic:!0}),a)}function _c(e,t,n,r){let i={};if(r&&n){let r=sc(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),mt(i,{synthetic:!0})}if(ke(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function vc(e,{isUnhandledRejection:t}){let n=$e(e),r=t?`promise rejection`:`exception`;return Te(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Me(e)?`Event \`${yc(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function yc(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function bc(e){return Object.values(e).find(e=>e instanceof Error)}var xc=class extends mo{constructor(e){let t=Sc(e);Bo(t,`browser`,[`browser`],Qs.SENTRY_SDK_SOURCE||vee()),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?`auto`:`never`,...t._metadata.sdk.settings}),super(t);let{sendDefaultPii:n,sendClientReports:r,enableLogs:i,_experiments:a,enableMetrics:o}=this._options,s=o??a?.enableMetrics??!0;Qs.document&&(r||i||s)&&Qs.document.addEventListener(`visibilitychange`,()=>{Qs.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),i&&Ia(this),s&&Va(this))}),n&&this.on(`beforeSendSession`,zo)}eventFromException(e,t){return mc(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return hc(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function Sc(e){return{release:typeof __SENTRY_RELEASE__==`string`?__SENTRY_RELEASE__:Qs.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var Cc=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,wc=S,Tc=(e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`,Ec=(e,t,n,r)=>{let i,a;return o=>{t.value>=0&&(o||r)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=Tc(t.value,n),e(t)))}},Dc=(e=!0)=>{let t=wc.performance?.getEntriesByType?.(`navigation`)[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Oc=()=>Dc()?.activationStart??0;function kc(e,t,n){wc.document&&wc.addEventListener(e,t,n)}function Ac(e,t,n){wc.document&&wc.removeEventListener(e,t,n)}var jc=-1,Mc=new Set,Nc=()=>wc.document?.visibilityState===`hidden`&&!wc.document?.prerendering?0:1/0,Pc=e=>{if(Ic(e)&&jc>-1){if(e.type===`visibilitychange`||e.type===`pagehide`)for(let e of Mc)e();isFinite(jc)||(jc=e.type===`visibilitychange`?e.timeStamp:0,Ac(`prerenderingchange`,Pc,!0))}},Fc=()=>{if(wc.document&&jc<0){let e=Oc();jc=(wc.document.prerendering?void 0:globalThis.performance.getEntriesByType(`visibility-state`).filter(t=>t.name===`hidden`&&t.startTime>e)[0]?.startTime)??Nc(),kc(`visibilitychange`,Pc,!0),kc(`pagehide`,Pc,!0),kc(`prerenderingchange`,Pc,!0)}return{get firstHiddenTime(){return jc},onHidden(e){Mc.add(e)}}};function Ic(e){return e.type===`pagehide`||wc.document?.visibilityState===`hidden`}var Lc=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+0xe8d4a51000}`,Rc=(e,t=-1)=>{let n=Dc(),r=`navigate`;return n&&(wc.document?.prerendering||Oc()>0?r=`prerender`:wc.document?.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:Lc(),navigationType:r}},zc=new WeakMap;function Bc(e,t){try{return zc.get(e)||zc.set(e,new t),zc.get(e)}catch{return new t}}var Vc=class e{constructor(){e.prototype.__init.call(this),e.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;let t=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}},Hc=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},Uc=e=>{let t=!1;return()=>{t||=(e(),!0)}},Wc=e=>{wc.document?.prerendering?addEventListener(`prerenderingchange`,()=>e(),!0):e()},Gc=[1800,3e3],Kc=(e,t={})=>{Wc(()=>{let n=Fc(),r=Rc(`FCP`),i,a=Hc(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Oc(),0),r.entries.push(t),i(!0)))});a&&(i=Ec(e,r,Gc,t.reportAllChanges))})},qc=[.1,.25],Jc=(e,t={})=>{Kc(Uc(()=>{let n=Rc(`CLS`,0),r,i=Fc(),a=Bc(t,Vc),o=e=>{for(let t of e)a._processEntry(t);a._sessionValue>
13n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,r())},s=Hc(`layout-shift`,o);s&&(r=Ec(e,n,qc,t.reportAllChanges),i.onHidden(()=>{o(s.takeRecords()),r(!0)}),wc?.setTimeout?.(r))}))},Yc=0,Xc=1/0,Zc=0,Qc=e=>{e.forEach(e=>{e.interactionId&&(Xc=Math.min(Xc,e.interactionId),Zc=Math.max(Zc,e.interactionId),Yc=Zc?(Zc-Xc)/7+1:0)})},$c,el=()=>$c?Yc:performance.interactionCount||0,tl=()=>{`interactionCount`in performance||$c||($c=Hc(`event`,Qc,{type:`event`,buffered:!0,durationThreshold:0}))},nl=10,rl=0,il=()=>el()-rl,al=class e{constructor(){e.prototype.__init.call(this),e.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){rl=el(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(il()/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!(e.interactionId||e.entryType===`first-input`))return;let t=this._longestInteractionList.at(-1),n=this._longestInteractionMap.get(e.interactionId);if(n||this._longestInteractionList.length<nl||e.duration>t._latency){if(n?e.duration>n._latency?(n.entries=[e],n._latency=e.duration):e.duration===n._latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((e,t)=>t._latency-e._latency),this._longestInteractionList.length>nl){let e=this._longestInteractionList.splice(nl);for(let t of e)this._longestInteractionMap.delete(t.id)}this._onAfterProcessingINPCandidate?.(n)}}},ol=e=>{let t=wc.requestIdleCallback||wc.setTimeout;wc.document?.visibilityState===`hidden`?e():(e=Uc(e),kc(`visibilitychange`,e,{once:!0,capture:!0}),kc(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),Ac(`visibilitychange`,e,{capture:!0}),Ac(`pagehide`,e,{capture:!0})}))},sl=[200,500],cl=40,ll=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&`interactionId`in PerformanceEventTiming.prototype))return;let n=Fc();Wc(()=>{tl();let r=Rc(`INP`),i,a=Bc(t,al),o=e=>{ol(()=>{for(let t of e)a._processEntry(t);let t=a._estimateP98LongestInteraction();t&&t._latency!==r.value&&(r.value=t._latency,r.entries=t.entries,i())})},s=Hc(`event`,o,{durationThreshold:t.durationThreshold??cl});i=Ec(e,r,sl,t.reportAllChanges),s&&(s.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{o(s.takeRecords()),i(!0)}))})},ul=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}},dl=[2500,4e3],fl=(e,t={})=>{Wc(()=>{let n=Fc(),r=Rc(`LCP`),i,a=Bc(t,ul),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a._processEntry(t),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Oc(),0),r.entries=[t],i())},s=Hc(`largest-contentful-paint`,o);if(s){i=Ec(e,r,dl,t.reportAllChanges);let n=Uc(()=>{o(s.takeRecords()),s.disconnect(),i(!0)}),a=e=>{e.isTrusted&&(ol(n),Ac(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])kc(e,a,{capture:!0})}})},pl=[800,1800],ml=e=>{wc.document?.prerendering?Wc(()=>ml(e)):wc.document?.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>ml(e),!0)},hl=(e,t={})=>{let n=Rc(`TTFB`),r=Ec(e,n,pl,t.reportAllChanges);ml(()=>{let e=Dc();e&&(n.value=Math.max(e.responseStart-Oc(),0),n.entries=[e],r(!0))})},gl={},_l={},vl,yl,bl,xl;function Sl(e,t=!1){return Ml(`cls`,e,Ol,vl,t)}function Cl(e,t=!1){return Ml(`lcp`,e,kl,yl,t)}function wl(e){return Ml(`ttfb`,e,Al,bl)}function Tl(e){return Ml(`inp`,e,jl,xl)}function El(e,t){return Pl(e,t),_l[e]||(Nl(e),_l[e]=!0),Fl(e,t)}function Dl(e,t){let n=gl[e];if(n?.length)for(let r of n)try{r(t)}catch(t){Cc&&R.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${ce(r)}\nError:`,t)}}function Ol(){return Jc(e=>{Dl(`cls`,{metric:e}),vl=e},{reportAllChanges:!0})}function kl(){return fl(e=>{Dl(`lcp`,{metric:e}),yl=e},{reportAllChanges:!0})}function Al(){return hl(e=>{Dl(`ttfb`,{metric:e}),bl=e})}function jl(){return ll(e=>{Dl(`inp`,{metric:e}),xl=e})}function Ml(e,t,n,r,i=!1){Pl(e,t);let a;return _l[e]||(a=n(),_l[e]=!0),r&&t({metric:r}),Fl(e,t,i?a:void 0)}function Nl(e){let t={};e===`event`&&(t.durationThreshold=0),Hc(e,t=>{Dl(e,{entries:t})},t)}function Pl(e,t){gl[e]=gl[e]||[],gl[e].push(t)}function Fl(e,t,n){return()=>{n&&n();let r=gl[e];if(!r)return;let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}function Il(e){return`duration`in e}var Ll=e=>{let t=t=>{(t.type===`pagehide`||wc.document?.visibilityState===`hidden`)&&e(t)};kc(`visibilitychange`,t,{capture:!0,once:!0}),kc(`pagehide`,t,{capture:!0,once:!0})};function Rl(e){return typeof e==`number`&&isFinite(e)}function zl(e,t,n,{...r}){let i=qn(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime==`function`&&e.updateStartTime(t),hi(e,()=>{let e=mi({startTime:t,...r});return e&&e.end(n),e})}function Bl(e){let t=nn();if(!t)return;let{name:n,transaction:r,attributes:i,startTime:a}=e,{release:o,environment:s,sendDefaultPii:c}=t.getOptions(),l=t.getIntegrationByName(`Replay`)?.getReplayId(),u=Qt(),d=u.getUser(),f=d===void 0?void 0:d.email||d.id||d.ip_address,p;try{p=u.getScopeData().contexts.profile.profile_id}catch{}return mi({name:n,attributes:{release:o,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:l||void 0,transaction:r,"user_agent.original":wc.navigator?.userAgent,"client.address":c?`{{auto}}`:void 0,...i},startTime:a,experimental:{standalone:!0}})}function Vl(){return wc.addEventListener&&wc.performance}function Hl(e){return e/1e3}function Ul(e){let t=`unknown`,n=`unknown`,r=``;for(let i of e){if(i===`/`){[t,n]=e.split(`/`);break}if(!isNaN(Number(i))){t=r===`h`?`http`:r,n=e.split(r)[1];break}r+=i}
13return r===e&&(t=r),{name:t,version:n}}function Wl(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Gl(e,t){let n,r=!1;function i(e){!r&&n&&t(e,n.spanContext().spanId,n),r=!0}Ll(()=>{i(`pagehide`)});let a=e.on(`beforeStartNavigationSpan`,(e,t)=>{t?.isRedirect||(i(`navigation`),a(),o())}),o=e.on(`afterStartPageLoadSpan`,e=>{n=e,o()})}function Kl(e){let t=0,n;if(!Wl(`layout-shift`))return;let r=Sl(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);Gl(e,(e,i)=>{ql(t,n,i,e),r()})}function ql(e,t,n,r){Cc&&R.log(`Sending CLS span (${e})`);let i=t?Hl((wt()||0)+t.startTime):xt(),a=Qt().getScopeData().transactionName,o=t?He(t.sources[0]?.node):`Layout shift`,s={[ln]:`auto.http.browser.cls`,[cn]:`ui.webvital.cls`,[hn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((e,t)=>{s[`cls.source.${t+1}`]=He(e.node)});let c=Bl({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`cls`,{[dn]:``,[fn]:e}),c.end(i))}function Jl(e){return e!=null&&e>0&&e<=6e4}function Yl(e){let t=0,n;if(!Wl(`largest-contentful-paint`))return;let r=Cl(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!Jl(e.value)||(t=e.value,n=r)},!0);Gl(e,(e,i)=>{Xl(t,n,i,e),r()})}function Xl(e,t,n,r){if(!Jl(e))return;Cc&&R.log(`Sending LCP span (${e})`);let i=Hl((wt()||0)+(t?.startTime||0)),a=Qt().getScopeData().transactionName,o=t?He(t.element):`Largest contentful paint`,s={[ln]:`auto.http.browser.lcp`,[cn]:`ui.webvital.lcp`,[hn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(s[`lcp.element`]=He(t.element)),t.id&&(s[`lcp.id`]=t.id),t.url&&(s[`lcp.url`]=t.url),t.loadTime!=null&&(s[`lcp.loadTime`]=t.loadTime),t.renderTime!=null&&(s[`lcp.renderTime`]=t.renderTime),t.size!=null&&(s[`lcp.size`]=t.size));let c=Bl({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`lcp`,{[dn]:`millisecond`,[fn]:e}),c.end(i))}function Zl(e){return e&&((wt()||performance.timeOrigin)+e)/1e3}function Ql(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=Ul(e.nextHopProtocol);t[`network.protocol.version`]=r,t[`network.protocol.name`]=n}return wt()||Vl()?.timeOrigin?$l({...t,"http.request.redirect_start":Zl(e.redirectStart),"http.request.redirect_end":Zl(e.redirectEnd),"http.request.worker_start":Zl(e.workerStart),"http.request.fetch_start":Zl(e.fetchStart),"http.request.domain_lookup_start":Zl(e.domainLookupStart),"http.request.domain_lookup_end":Zl(e.domainLookupEnd),"http.request.connect_start":Zl(e.connectStart),"http.request.secure_connection_start":Zl(e.secureConnectionStart),"http.request.connection_end":Zl(e.connectEnd),"http.request.request_start":Zl(e.requestStart),"http.request.response_start":Zl(e.responseStart),"http.request.response_end":Zl(e.responseEnd),"http.request.time_to_first_byte":e.responseStart==null?void 0:e.responseStart/1e3}):t}function $l(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null))}var eu=2147483647,tu=0,nu={},ru,iu;function au({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=Vl();if(r&&wt()){r.mark&&wc.performance.mark(`sentry-tracing-init`);let i=t?Yl(n):t===!1?uu():void 0,a=e?Kl(n):e===!1?lu():void 0,o=du();return()=>{o(),i?.(),a?.()}}return()=>void 0}function ou(){El(`longtask`,({entries:e})=>{let t=cr();if(!t)return;let{op:n,start_timestamp:r}=qn(t);for(let i of e){let e=Hl(wt()+i.startTime),a=Hl(i.duration);n===`navigation`&&r&&e<r||zl(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-task`,attributes:{[ln]:`auto.ui.browser.metrics`}})}})}function su(){new PerformanceObserver(e=>{let t=cr();if(t)for(let n of e.getEntries()){if(!n.scripts[0])continue;let e=Hl(wt()+n.startTime),{start_timestamp:r,op:i}=qn(t);if(i===`navigation`&&r&&e<r)continue;let a=Hl(n.duration),o={[ln]:`auto.ui.browser.metrics`},{invoker:s,invokerType:c,sourceURL:l,sourceFunctionName:u,sourceCharPosition:d}=n.scripts[0];o[`browser.script.invoker`]=s,o[`browser.script.invoker_type`]=c,l&&(o[`code.filepath`]=l),u&&(o[`code.function`]=u),d!==-1&&(o[`browser.script.source_char_position`]=d),zl(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-animation-frame`,attributes:o})}}).observe({type:`long-animation-frame`,buffered:!0})}function cu(){El(`event`,({entries:e})=>{let t=cr();if(t){for(let n of e)if(n.name===`click`){let e=Hl(wt()+n.startTime),r=Hl(n.duration),i={name:He(n.target),op:`ui.interaction.${n.name}`,startTime:e,attributes:{[ln]:`auto.ui.browser.metrics`}},a=Ge(n.target);a&&(i.attributes[`ui.component_name`]=a),zl(t,e,e+r,i)}}})}function lu(){return Sl(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(nu.cls={value:e.value,unit:``},iu=t)},!0)}function uu(){return Cl(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!Jl(e.value)||(nu.lcp={value:e.value,unit:`millisecond`},ru=t)},!0)}function du(){return wl(({metric:e})=>{e.entries[e.entries.length-1]&&(nu.ttfb={value:e.value,unit:`millisecond`})})}function fu(e,t){let n=Vl(),r=wt();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:i,ignorePerformanceApiSpans:a,ignoreResourceSpans:o,recordClsOnPageloadSpan:s,recordLcpOnPageloadSpan:c}=t,l=Hl(r),u=n.getEntries(),{op:d,start_timestamp:f}=qn(e);if(u.slice(tu).forEach(t=>{let n=Hl(t.startTime),r=Hl(Math.max(0,t.duration));if(!(d===`navigation`&&f&&l+n<f))switch(t.entryType){case`navigation`:gu(e,t,l);break;case`mark`:case`paint`:case`measure`:{mu(e,t,n,r,l,a);let i=Fc(),o=t.startTime<i.firstHiddenTime;t.name===`first-paint`&&o&&(nu.fp={value:t.startTime,unit:`millisecond`}),t.name===`first-contentful-paint`&&o&&(nu.fcp={value:t.startTime,unit:`millisecond`});break}case`resource`:bu(e,t,t.name,n,r,l,o);break}}),tu=Math.max(u.length-1,0),xu(e,i),d===`pageload`){if(wu(nu),i){let t=(t,n,r)=>{let i=r??`browser.web_vital.${t}.value`;e.setAttribute(i,n),Cc&&R.log(`Setting web vital attribute`,{[i]:n},`on pageload span`)};
13[`ttfb`,`fp`,`fcp`].forEach(e=>{nu[e]&&t(e,nu[e].value)}),nu[`ttfb.requestTime`]&&t(`ttfb.requestTime`,nu[`ttfb.requestTime`].value,`browser.web_vital.ttfb.request_time`)}else s||delete nu.cls,c||delete nu.lcp,Object.entries(nu).forEach(([e,t])=>{ri(e,t.value,t.unit)}),Su(e,t);e.setAttribute(i?`browser.performance.time_origin`:`performance.timeOrigin`,l),e.setAttribute(i?`browser.performance.navigation.activation_start`:`performance.activationStart`,Oc())}ru=void 0,iu=void 0,nu={}}function pu(e){if(e?.entryType===`measure`)try{return e.detail.devtools.track===`Components â`}catch{return}}function mu(e,t,n,r,i,a){if(pu(t)||[`mark`,`measure`].includes(t.entryType)&&st(t.name,a))return;let o=Dc(!1),s=Hl(o?o.requestStart:0),c=i+Math.max(n,s),l=i+n,u=l+r,d={[ln]:`auto.resource.browser.metrics`};c!==l&&(d[`sentry.browser.measure_happened_before_request`]=!0,d[`sentry.browser.measure_start_time`]=c),hu(d,t),c<=u&&zl(e,c,u,{name:t.name,op:t.entryType,attributes:d})}function hu(e,t){try{let n=t.detail;if(!n)return;if(typeof n==`object`){for(let[t,r]of Object.entries(n))if(r&&Ae(r))e[`sentry.browser.measure.detail.${t}`]=r;else if(r!==void 0)try{e[`sentry.browser.measure.detail.${t}`]=JSON.stringify(r)}catch{}return}if(Ae(n)){e[`sentry.browser.measure.detail`]=n;return}try{e[`sentry.browser.measure.detail`]=JSON.stringify(n)}catch{}}catch{}}function gu(e,t,n){[`unloadEvent`,`redirect`,`domContentLoadedEvent`,`loadEvent`,`connect`].forEach(r=>{_u(e,t,r,n)}),_u(e,t,`secureConnection`,n,`TLS/SSL`),_u(e,t,`fetch`,n,`cache`),_u(e,t,`domainLookup`,n,`DNS`),yu(e,t,n)}function _u(e,t,n,r,i=n){let a=t[vu(n)],o=t[`${n}Start`];!o||!a||zl(e,r+Hl(o),r+Hl(a),{op:`browser.${i}`,name:t.name,attributes:{[ln]:`auto.ui.browser.metrics`,...n===`redirect`&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function vu(e){return e===`secureConnection`?`connectEnd`:e===`fetch`?`domainLookupStart`:`${e}End`}function yu(e,t,n){let r=n+Hl(t.requestStart),i=n+Hl(t.responseEnd),a=n+Hl(t.responseStart);t.responseEnd&&(zl(e,r,i,{op:`browser.request`,name:t.name,attributes:{[ln]:`auto.ui.browser.metrics`}}),zl(e,a,i,{op:`browser.response`,name:t.name,attributes:{[ln]:`auto.ui.browser.metrics`}}))}function bu(e,t,n,r,i,a,o){if(t.initiatorType===`xmlhttprequest`||t.initiatorType===`fetch`)return;let s=t.initiatorType?`resource.${t.initiatorType}`:`resource.other`;if(o?.includes(s))return;let c={[ln]:`auto.resource.browser.metrics`},l=Mo(n);l.protocol&&(c[`url.scheme`]=l.protocol.split(`:`).pop()),l.host&&(c[`server.address`]=l.host),c[`url.same_origin`]=n.includes(wc.location.origin),Cu(t,c,[[`responseStatus`,`http.response.status_code`],[`transferSize`,`http.response_transfer_size`],[`encodedBodySize`,`http.response_content_length`],[`decodedBodySize`,`http.decoded_response_content_length`],[`renderBlockingStatus`,`resource.render_blocking_status`],[`deliveryType`,`http.response_delivery_type`]]);let u={...c,...Ql(t)},d=a+r;zl(e,d,d+i,{name:n.replace(wc.location.origin,``),op:s,attributes:u})}function xu(e,t){let n=wc.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?`network.connection.effective_type`:`effectiveConnectionType`,r.effectiveType),r.type&&e.setAttribute(t?`network.connection.type`:`connectionType`,r.type),Rl(r.rtt)&&(nu[`connection.rtt`]={value:r.rtt,unit:`millisecond`},t&&e.setAttribute(`network.connection.rtt`,r.rtt))),Rl(n.deviceMemory)&&(t?e.setAttribute(`device.memory.estimated_capacity`,n.deviceMemory):e.setAttribute(`deviceMemory`,`${n.deviceMemory} GB`)),Rl(n.hardwareConcurrency)&&(t?e.setAttribute(`device.processor_count`,n.hardwareConcurrency):e.setAttribute(`hardwareConcurrency`,String(n.hardwareConcurrency)))}function Su(e,t){ru&&t.recordLcpOnPageloadSpan&&(ru.element&&e.setAttribute(`lcp.element`,He(ru.element)),ru.id&&e.setAttribute(`lcp.id`,ru.id),ru.url&&e.setAttribute(`lcp.url`,ru.url.trim().slice(0,200)),ru.loadTime!=null&&e.setAttribute(`lcp.loadTime`,ru.loadTime),ru.renderTime!=null&&e.setAttribute(`lcp.renderTime`,ru.renderTime),e.setAttribute(`lcp.size`,ru.size)),iu?.sources&&t.recordClsOnPageloadSpan&&iu.sources.forEac
13h((t,n)=>e.setAttribute(`cls.source.${n+1}`,He(t.node)))}function Cu(e,t,n){n.forEach(([n,r])=>{let i=e[n];i!=null&&(typeof i==`number`&&i<eu||typeof i==`string`)&&(t[r]=i)})}function wu(e){let t=Dc(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e[`ttfb.requestTime`]={value:n-r,unit:`millisecond`})}var Tu=[],Eu=new Map,Du=new Map;function Ou(){if(Vl()&&wt()){let e=Au();return()=>{e()}}return()=>void 0}var ku={click:`click`,pointerdown:`click`,pointerup:`click`,mousedown:`click`,mouseup:`click`,touchstart:`click`,touchend:`click`,mouseover:`hover`,mouseout:`hover`,mouseenter:`hover`,mouseleave:`hover`,pointerover:`hover`,pointerout:`hover`,pointerenter:`hover`,pointerleave:`hover`,dragstart:`drag`,dragend:`drag`,drag:`drag`,dragenter:`drag`,dragleave:`drag`,dragover:`drag`,drop:`drag`,keydown:`press`,keyup:`press`,keypress:`press`,input:`press`};function Au(){return Tl(ju)}var ju=({metric:e})=>{if(e.value==null)return;let t=Hl(e.value);if(t>60)return;let n=e.entries.find(t=>t.duration===e.value&&ku[t.name]);if(!n)return;let{interactionId:r}=n,i=ku[n.name],a=Hl(wt()+n.startTime),o=cr(),s=o?or(o):void 0,c=r==null?void 0:Eu.get(r),l=c?.span||s,u=l?qn(l).description:Qt().getScopeData().transactionName,d=Bl({name:c?.elementName||He(n.target),transaction:u,attributes:{[ln]:`auto.http.browser.inp`,[cn]:`ui.interaction.${i}`,[hn]:n.duration},startTime:a});d&&(d.addEvent(`inp`,{[dn]:`millisecond`,[fn]:e.value}),d.end(a+t))};function Mu(e){return e==null?void 0:Eu.get(e)}function Nu(){let e=Object.keys(ku);Ls()&&e.forEach(e=>{wc.addEventListener(e,t,{capture:!0,passive:!0})});function t(e){let t=e.target;if(!t)return;let n=He(t),r=Math.round(e.timeStamp);if(Du.set(r,n),Du.size>50){let e=Du.keys().next().value;e!==void 0&&Du.delete(e)}}function n(e){let t=Math.round(e.startTime),n=Du.get(t);if(!n)for(let e=-5;e<=5;e++){let r=Du.get(t+e);if(r){n=r;break}}return n||`<unknown>`}let r=({entries:e})=>{let t=cr(),r=t&&or(t);e.forEach(e=>{if(!Il(e))return;let t=e.interactionId;if(t==null||Eu.has(t))return;let i=e.target?He(e.target):n(e);if(Tu.length>10){let e=Tu.shift();Eu.delete(e)}Tu.push(t),Eu.set(t,{span:r,elementName:i})})};El(`event`,r),El(`first-input`,r)}function Pu(e){let{name:t,op:n,origin:r,metricName:i,value:a,attributes:o,parentSpan:s,reportEvent:c,startTime:l,endTime:u}=e,d=Qt().getScopeData().transactionName,f={[ln]:r,[cn]:n,[hn]:0,[`browser.web_vital.${i}.value`]:a,"sentry.transaction":d,"user_agent.original":wc.navigator?.userAgent,...o};s&&Jn(s).attributes?.[`sentry.op`]===`pageload`&&(f[`sentry.pageload.span_id`]=s.spanContext().spanId),c&&(f[`browser.web_vital.${i}.report_event`]=c);let p=mi({name:t,attributes:f,startTime:l,parentSpan:s});p&&p.end(u??l)}function Fu(e){let t=0,n;if(!Wl(`largest-contentful-paint`))return;let r=Cl(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!Jl(e.value)||(t=e.value,n=r)},!0);Gl(e,(e,i,a)=>{Iu(t,n,a,e),r()})}function Iu(e,t,n,r){if(!Jl(e))return;Cc&&R.log(`Sending LCP span (${e})`);let i=wt()||0,a=Hl(i),o=Hl(i+(t?.startTime||0)),s=t?He(t.element):`Largest contentful paint`,c={};t?.element&&(c[`browser.web_vital.lcp.element`]=He(t.element)),t?.id&&(c[`browser.web_vital.lcp.id`]=t.id),t?.url&&(c[`browser.web_vital.lcp.url`]=t.url),t?.loadTime!=null&&(c[`browser.web_vital.lcp.load_time`]=t.loadTime),t?.renderTime!=null&&(c[`browser.web_vital.lcp.render_time`]=t.renderTime),t?.size!=null&&(c[`browser.web_vital.lcp.size`]=t.size),Pu({name:s,op:`ui.webvital.lcp`,origin:`auto.http.browser.lcp`,metricName:`lcp`,value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:a,endTime:o})}function Lu(e){let t=0,n;if(!Wl(`layout-shift`))return;let r=Sl(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);Gl(e,(e,i,a)=>{xee(t,n,a,e),r()})}function xee(e,t,n,r){Cc&&R.log(`Sending CLS span (${e})`);let i=t?Hl((wt()||0)+t.startTime):xt(),a=t?He(t.sources[0]?.node):`Layout shift`,o={};t?.sources&&t.sources.forEach((e,t)=>{o[`browser.web_vital.cls.source.${t+1}`]=He(e.node)}),Pu({name:a,op:`ui.webvital.cls`,origin:`auto.http.browser.cls`,metricName:`cls`,value:e,attributes:o,parentSpan:n,reportEvent:r,startTime:i})}function Ru(){!Vl()||!wt()||Tl(({metric:e})=>
13{if(e.value==null||Hl(e.value)>60)return;let t=e.entries.find(t=>t.duration===e.value&&ku[t.name]);t&&See(e.value,t)})}function See(e,t){Cc&&R.log(`Sending INP span (${e})`);let n=Hl(wt()+t.startTime),r=Hl(e),i=ku[t.name],a=Mu(t.interactionId),o=cr(),s=o?or(o):void 0,c=a?.span||s,l=c?Jn(c).name:Qt().getScopeData().transactionName;Pu({name:a?.elementName||He(t.target),op:`ui.interaction.${i}`,origin:`auto.http.browser.inp`,metricName:`inp`,value:e,attributes:{[hn]:t.duration,"sentry.transaction":l},startTime:n,endTime:n+r,parentSpan:c})}var Cee=1e3,zu,Bu,Vu;function Hu(e){pe(`dom`,e),me(`dom`,Uu)}function Uu(){if(!wc.document)return;let e=he.bind(null,`dom`),t=Ku(e,!0);wc.document.addEventListener(`click`,t,!1),wc.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=wc[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(Ke(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){let r=Ku(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),Ke(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function Wu(e){if(e.type!==Bu)return!1;try{if(!e.target||e.target._sentryId!==Vu)return!1}catch{}return!0}function Gu(e,t){return e===`keypress`?t?.tagName?!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!0:!1}function Ku(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=qu(n);if(Gu(n.type,r))return;qe(n,`_sentryCaptured`,!0),r&&!r._sentryId&&qe(r,`_sentryId`,ut());let i=n.type===`keypress`?`input`:n.type;Wu(n)||(e({event:n,name:i,global:t}),Bu=n.type,Vu=r?r._sentryId:void 0),clearTimeout(zu),zu=wc.setTimeout(()=>{Vu=void 0,Bu=void 0},Cee)}}function qu(e){try{return e.target}catch{return null}}var Ju;function Yu(e){let t=`history`;pe(t,e),me(t,Xu)}function Xu(){if(wc.addEventListener(`popstate`,()=>{let e=wc.location.href,t=Ju;Ju=e,t!==e&&he(`history`,{from:t,to:e})}),!yee())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=Ju,i=Zu(String(n));if(Ju=i,r===i)return e.apply(this,t);he(`history`,{from:r,to:i})}return e.apply(this,t)}}Ke(wc.history,`pushState`,e),Ke(wc.history,`replaceState`,e)}function Zu(e){try{return new URL(e,wc.location.origin).toString()}catch{return e}}var Qu={};function $u(e){let t=Qu[e];if(t)return t;let n=wc[e];if(Hs(n))return Qu[e]=n.bind(wc);let r=wc.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){Cc&&R.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(Qu[e]=n.bind(wc))}function ed(e){Qu[e]=void 0}function td(...e){return $u(`setTimeout`)(...e)}var nd=`__sentry_xhr_v3__`;function rd(e){pe(`xhr`,e),me(`xhr`,id)}function id(){if(!wc.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=xt()*1e3,a=Oe(n[0])?n[0].toUpperCase():void 0,o=ad(n[1]);if(!a||!o)return e.apply(t,n);t[nd]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[nd];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}he(`xhr`,{endTimestamp:xt()*1e3,startTimestamp:i,xhr:t,virtualError:r})}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return s(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,a=t[nd];return a&&Oe(r)&&Oe(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[nd];
13return r?(n[0]!==void 0&&(r.body=n[0]),he(`xhr`,{startTimestamp:xt()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function ad(e){if(Oe(e))return e;try{return e.toString()}catch{}}var od=Symbol.for(`sentry__originalRequestBody`);function sd(e){return new URLSearchParams(e).toString()}function cd(e,t=R){try{if(typeof e==`string`)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[sd(e)];if(!e)return[void 0]}catch(n){return Cc&&t.error(n,`Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return Cc&&t.log(`Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function ld(e=[]){if(e.length>=2&&e[1]&&typeof e[1]==`object`&&`body`in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){let t=e[0][od];return t===void 0?void 0:t}}function ud(e){let t;try{t=e.getAllResponseHeaders()}catch(t){return Cc&&R.error(t,`Failed to get xhr response headers`,e),{}}return t?t.split(`\r 14`).reduce((e,t)=>{let[n,r]=t.split(`: `);return r&&(e[n.toLowerCase()]=r),e},{}):{}}var dd=40;function fd(e,t=$u(`fetch`)){let n=0,r=0;async function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get(`X-Sentry-Rate-Limits`),"retry-after":n.headers.get(`Retry-After`)}}}catch(e){throw ed(`fetch`),e}finally{n-=a,r--}}return Qa(e,i,Ka(e.bufferSize||dd))}var pd=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,md=30,hd=50;function gd(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var _d=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,vd=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yd=/\((\S*)(?::(\d+))(?::(\d+))\)/,bd=/at (.+?) ?\(data:(.+?),/,xd=[md,e=>{let t=e.match(bd);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=_d.exec(e);if(n){let[,e,t,r]=n;return gd(e,`?`,+t,+r)}let r=vd.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=yd.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=Td(r[1]||`?`,r[2]);return gd(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],Sd=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Cd=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,wd=ie(xd,[hd,e=>{let t=Sd.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=Cd.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;return[n,e]=Td(n,e),gd(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),Td=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Ed=1024,Dd=`Breadcrumbs`,wee=Na(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Dd,setup(e){t.console&&gs(Ad(e)),t.dom&&Hu(kd(e,t.dom)),t.xhr&&rd(jd(e)),t.fetch&&Ws(Md(e)),t.history&&Yu(Nd(e)),t.sentry&&e.on(`beforeSendEvent`,Od(e))}}}));function Od(e){return function(t){nn()===e&&Ko({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:ft(t)},{event:t})}}function kd(e,t){return function(n){if(nn()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>Ed&&(pd&&R.warn(`\`dom.maxStringLength\` cannot exceed ${Ed}, but a value of ${o} was configured. Sentry will use ${Ed} instead.`),o=Ed),typeof a==`string`&&(a=[a]);try{let e=n.event,t=Pd(e)?e.target:e;r=He(t,{keyAttrs:a,maxStringLength:o}),i=Ge(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),Ko(s,{event:n.event,name:n.name,global:n.global})}}function Ad(e){return function(t){if(nn()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:vs(t.level),message:at(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${at(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;Ko(n,{input:t.args,level:t.level})}}
14function jd(e){return function(t){if(nn()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[nd];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:`xhr`,data:l,type:`http`,level:zs(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),Ko(d,u)}}function Md(e){return function(t){if(nn()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`))if(t.error){let i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},a={category:`fetch`,data:t.fetchData,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,a,i),Ko(a,i)}else{let i=t.response,a={...t.fetchData,status_code:i?.status},o={input:t.args,response:i,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:a,type:`http`,level:zs(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),Ko(s,o)}}}function Nd(e){return function(t){if(nn()!==e)return;let n=t.from,r=t.to,i=Mo(Qs.location.href),a=n?Mo(n):void 0,o=Mo(r);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),Ko({category:`navigation`,data:{from:n,to:r}})}}function Pd(e){return!!e&&!!e.target}var Fd=`EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload`.split(`,`),Id=`BrowserApiErrors`,Ld=Na(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Id,setupOnce(){t.setTimeout&&Ke(Qs,`setTimeout`,Rd),t.setInterval&&Ke(Qs,`setInterval`,Rd),t.requestAnimationFrame&&Ke(Qs,`requestAnimationFrame`,zd),t.XMLHttpRequest&&`XMLHttpRequest`in Qs&&Ke(XMLHttpRequest.prototype,`send`,Bd);let e=t.eventTarget;e&&(Array.isArray(e)?e:Fd).forEach(e=>Vd(e,t))}}}));function Rd(e){return function(...t){let n=t[0];return t[0]=nc(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${ce(e)}`}}),e.apply(this,t)}}function zd(e){return function(t){return e.apply(this,[nc(t,{mechanism:{data:{handler:ce(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function Bd(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&Ke(n,e,function(t){let n={mechanism:{data:{handler:ce(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=Ye(t);return r&&(n.mechanism.data.handler=ce(r)),nc(t,n)})}),e.apply(this,t)}}function Vd(e,t){let n=Qs[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(Ke(n,`addEventListener`,function(n){return function(r,i,a){try{Hd(i)&&(i.handleEvent=nc(i.handleEvent,{mechanism:{data:{handler:ce(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&Ud(this,r,i),n.apply(this,[r,nc(i,{mechanism:{data:{handler:ce(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),Ke(n,`removeEventListener`,function(e){return function(t,n,r){try{let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch{}return e.call(this,t,n,r)}}))}function Hd(e){return typeof e.handleEvent==`function`}function Ud(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var Wd=Na((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(Qs.document===void 0){pd&&R.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}va({ignoreDuration:!0}),xa();let e=$t(),n=e.getUser();e.addScopeListener(e=>{let t=e.getUser();
14(n?.id!==t?.id||n?.ip_address!==t?.ip_address)&&(xa(),n=t)}),t===`route`&&Yu(({from:e,to:t})=>{e!==t&&(va({ignoreDuration:!0}),xa())})}}}),Gd=`CultureContext`,Kd=Na((()=>({name:Gd,preprocessEvent(e){let t=qd();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=qd();t&&Bi(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})));function qd(){try{let e=Qs.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var Jd=`GlobalHandlers`,Yd=Na(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:Jd,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(Tee(e),ef(`onerror`)),t.onunhandledrejection&&(Xd(e),ef(`onunhandledrejection`))}}}));function Tee(e){_e(t=>{let{stackParser:n,attachStacktrace:r}=tf();if(nn()!==e||ec())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=$d(gc(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,pa(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function Xd(e){be(t=>{let{stackParser:n,attachStacktrace:r}=tf();if(nn()!==e||ec())return;let i=Zd(t),a=Ae(i)?Qd(i):gc(n,i,void 0,r,!0);a.level=`error`,pa(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function Zd(e){if(Ae(e))return e;try{if(`reason`in e)return e.reason;if(`detail`in e&&`reason`in e.detail)return e.detail.reason}catch{}return e}function Qd(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function $d(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:nf(t)??We(),function:`?`,in_app:!0}),e}function ef(e){pd&&R.log(`Global Handler attached: ${e}`)}function tf(){return nn()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function nf(e){if(!(!Oe(e)||e.length===0))return e.startsWith(`data:`)?`<${Po(e,!1)}>`:e}var rf=Na(()=>({name:`HttpContext`,preprocessEvent(e){if(!Qs.navigator&&!Qs.location&&!Qs.document)return;let t=rc(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){if(!Qs.navigator&&!Qs.location&&!Qs.document)return;let t=rc();Bi(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers[`User-Agent`],"http.request.header.referer":t.headers.Referer})}})),af=`cause`,of=5,Eee=`LinkedErrors`,Dee=Na(((e={})=>{let t=e.limit||of,n=e.key||af;return{name:Eee,preprocessEvent(e,r,i){ds(ic,i.getOptions().stackParser,n,t,e,r)}}}));function sf(){return cf()?(pd&&A(()=>{console.error(`[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/`)}),!0):!1}function cf(){if(Qs.window===void 0)return!1;let e=Qs;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=We();return!(Qs===Qs.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function lf(e){return[es(),Xo(),Es(),Ld(),wee(),Yd(),Dee(),hee(),rf(),Kd(),Wd()]}function uf(e={}){let t=!e.skipBrowserExtensionCheck&&sf(),n=e.defaultIntegrations==null?lf():e.defaultIntegrations;return Eo(xc,{...e,enabled:t?!1:e.enabled,stackParser:z(e.stackParser||wd),integrations:ka({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||fd})}function df(e={}){let t=Qs.document,n=t?.head||t?.body;if(!n){pd&&R.error(`[showReportDialog] Global document not defined`);return}let r=Qt(),i=nn()?.getDsn();if(!i){pd&&R.error(`[showReportDialog] DSN not configured`);return}let a={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||ha()},o=Qs.document.createElement(`script`);o.async=!0,o.crossOrigin=`anonymous`,o.src=Ea(i,a);let{onLoad:s,onClose:c}=a;if(s&&(o.onload=s),c){let e=t=>{if(t.data===`__sentry_reportdialog_closed__`)try{c()}finally{Qs.removeEventListener(`message`,e)}};Qs.addEventListener(`message`,e)}n.appendChild(o)}var ff=S,pf=`sentryReplaySession`,mf=`replay_event`,hf=`Unable to send Replay`,gf=3e5,_f=9e5,vf=5e3,yf=5500,bf=6e4,xf=5e3,Sf=3,Cf=15e4,wf=5e3,Tf=3e3,Ef=300,Df=2e7,Of=4999,kf=5e4,Af=36e5,jf=Object.defineProperty,Mf=(e,t,n
14)=>t in e?jf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nf=(e,t,n)=>Mf(e,typeof t==`symbol`?t:t+``,n),Pf=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(Pf||{});function Ff(e){return e.nodeType===e.ELEMENT_NODE}function If(e){return e?.host?.shadowRoot===e}function Lf(e){return Object.prototype.toString.call(e)===`[object ShadowRoot]`}function Rf(e){return e.includes(` background-clip: text;`)&&!e.includes(` -webkit-background-clip: text;`)&&(e=e.replace(/\sbackground-clip:\s*text;/g,` -webkit-background-clip: text; background-clip: text;`)),e}function zf(e){let{cssText:t}=e;if(t.split(`"`).length<3)return t;let n=[`@import`,`url(${JSON.stringify(e.href)})`];return e.layerName===``?n.push(`layer`):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(` `)+`;`}function Bf(e){try{let t=e.rules||e.cssRules;return t?Rf(Array.from(t,Vf).join(``)):null}catch{return null}}function Oee(e){let t=``;for(let n=0;n<e.style.length;n++){let r=e.style,i=r[n],a=r.getPropertyPriority(i);t+=`${i}:${r.getPropertyValue(i)}${a?` !important`:``};`}return`${e.selectorText} { ${t} }`}function Vf(e){let t;if(Uf(e))try{t=Bf(e.styleSheet)||zf(e)}catch{}else if(Wf(e)){let t=e.cssText,n=e.selectorText.includes(`:`),r=typeof e.style.all==`string`&&e.style.all;if(r&&(t=Oee(e)),n&&(t=Hf(t)),n||r)return t}return t||e.cssText}function Hf(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,`$1\\$2`)}function Uf(e){return`styleSheet`in e}function Wf(e){return`selectorText`in e}var Gf=class{constructor(){Nf(this,`idNodeMap`,new Map),Nf(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Kf(){return new Gf}function qf({maskInputOptions:e,tagName:t,type:n}){return t===`OPTION`&&(t=`SELECT`),!!(e[t.toLowerCase()]||n&&e[n]||n===`password`||t===`INPUT`&&!n&&e.text)}function Jf({isMasked:e,element:t,value:n,maskInputFn:r}){let i=n||``;return e?(r&&(i=r(i,t)),`*`.repeat(i.length)):i}function Yf(e){return e.toLowerCase()}function Xf(e){return e.toUpperCase()}var Zf=`__rrweb_original__`;function Qf(e){let t=e.getContext(`2d`);if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData,a=Zf in i?i[Zf]:i;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>e!==0))return!1}return!0}function $f(e){let t=e.type;return e.hasAttribute(`data-rr-is-password`)?`password`:t?Yf(t):null}function ep(e,t,n){return t===`INPUT`&&(n===`radio`||n===`checkbox`)?e.getAttribute(`value`)||``:e.value}function tp(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}return n.pathname.match(/\.([0-9a-z]+)(?:$)/i)?.[1]??null}var np={};function rp(e){let t=np[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return np[e]=r.bind(window)}function ip(...e){return rp(`setTimeout`)(...e)}function ap(...e){return rp(`clearTimeout`)(...e)}function op(e){try{return e.contentDocument}catch{}}var sp=1,kee=RegExp(`[^a-z0-9-_:]`),cp=-2;function lp(){return sp++}function Aee(e){if(e instanceof HTMLFormElement)return`form`;let t=Yf(e.tagName);return kee.test(t)?`div`:t}function up(e){let t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var dp,fp,jee=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,pp=/^(?:[a-z+]+:)?\/\//i,mp=/^www\..*/i,hp=/^(data:)([^,]*),(.*)/i;function gp(e,t){if(!e||t.size===0)return e;try{let n=e.split(`;`),r=[];for(let e of n){if(e=e.trim(),!e)continue;let n=e.indexOf(`:`);
14if(n===-1){r.push(e);continue}let i=e.slice(0,n).trim();t.has(i)||r.push(e)}return r.join(`; `)+(r.length>0&&e.endsWith(`;`)?`;`:``)}catch(t){return console.warn(`Error filtering CSS properties:`,t),e}}function _p(e,t){return(e||``).replace(jee,(e,n,r,i,a,o)=>{let s=r||a||o,c=n||i||``;if(!s)return e;if(pp.test(s)||mp.test(s)||hp.test(s))return`url(${c}${s}${c})`;if(s[0]===`/`)return`url(${c}${up(t)+s}${c})`;let l=t.split(`/`),u=s.split(`/`);l.pop();for(let e of u)if(e===`.`)continue;else e===`..`?l.pop():l.push(e);return`url(${c}${l.join(`/`)}${c})`})}var vp=/^[^ \t\n\r\u000c]+/,yp=/^[, \t\n\r\u000c]+/;function bp(e,t){if(t.trim()===``)return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}let i=[];for(;r(yp),!(n>=t.length);){let a=r(vp);if(a.slice(-1)===`,`)a=Sp(e,a.substring(0,a.length-1)),i.push(a);else{let r=``;a=Sp(e,a);let o=!1;for(;;){let e=t.charAt(n);if(e===``){i.push((a+r).trim());break}else if(o)e===`)`&&(o=!1);else if(e===`,`){n+=1,i.push((a+r).trim());break}else e===`(`&&(o=!0);r+=e,n+=1}}}return i.join(`, `)}var xp=new WeakMap;function Sp(e,t){return!t||t.trim()===``?t:Cp(e,t)}function Mee(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function Cp(e,t){let n=xp.get(e);if(n||(n=e.createElement(`a`),xp.set(e,n)),!t)t=``;else if(t.startsWith(`blob:`)||t.startsWith(`data:`))return t;return n.setAttribute(`href`,t),n.href}function Nee(e,t,n,r,i,a,o){if(!r)return r;if(n===`src`||n===`href`&&!(t===`use`&&r[0]===`#`)||n===`xlink:href`&&r[0]!==`#`||n===`background`&&(t===`table`||t===`td`||t===`th`))return Sp(e,r);if(n===`srcset`)return bp(e,r);if(n===`style`){let t=_p(r,Cp(e));return o&&o.size>0&&(t=gp(t,o)),t}else if(t===`object`&&n===`data`)return Sp(e,r);return typeof a==`function`?a(n,r,i):r}function Pee(e,t,n){return(e===`video`||e===`audio`)&&t===`autoplay`}function Fee(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch{}return!1}function Iee(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function wp(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:wp(e.parentNode,t,n,r+1)}function Tp(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e==`string`){if(r.matches(`.${e}`))return!0}else if(Iee(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Ep(e,t,n,r,i,a){try{let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName===`INPUT`){let e=o.getAttribute(`autocomplete`);if([`current-password`,`new-password`,`cc-number`,`cc-exp`,`cc-exp-month`,`cc-exp-year`,`cc-csc`].includes(e))return!0}let s=-1,c=-1;if(a){if(c=wp(o,Tp(r,i)),c<0)return!0;s=wp(o,Tp(t,n),c>=0?c:1/0)}else{if(s=wp(o,Tp(t,n)),s<0)return!1;c=wp(o,Tp(r,i),s>=0?s:1/0)}return s>=0?c>=0?s<=c:!0:c>=0?!1:!!a}catch{}return!!a}function Lee(e,t,n){let r=e.contentWindow;if(!r)return;let i=!1,a;try{a=r.document.readyState}catch{return}if(a!==`complete`){let r=ip(()=>{i||=(t(),!0)},n);e.addEventListener(`load`,()=>{ap(r),i=!0,t()});return}let o=`about:blank`;if(r.location.href!==o||e.src===o||e.src===``)return ip(t,0),e.addEventListener(`load`,t);e.addEventListener(`load`,t)}function Ree(e,t,n){let r=!1,i;try{i=e.sheet}catch{return}if(i)return;let a=ip(()=>{r||=(t(),!0)},n);e.addEventListener(`load`,()=>{ap(a),r=!0,t()})}function zee(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:m={},maskTextFn:h,maskInputFn:g,dataURLOptions:_={},inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x=!1,ignoreCSSAttributes:S}=t,C=Bee(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:Pf.Document,childNodes:[]}:{type:Pf.Document,childNodes:[],compatMode:e.compatMode};case e.DOCUMENT_TYPE_NODE:return{type:Pf.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return Hee(e,{doc:n,blockClass:i,blockSelector:a,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:_,inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x,rootId:C,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,ignoreCSSAttributes:S});case e.TEXT_NODE:return Vee(e,{doc:n,maskAllText:s,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:
14h,maskInputOptions:m,maskInputFn:g,rootId:C});case e.CDATA_SECTION_NODE:return{type:Pf.CDATA,textContent:``,rootId:C};case e.COMMENT_NODE:return{type:Pf.Comment,textContent:e.textContent||``,rootId:C};default:return!1}}function Bee(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function Vee(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:a,unmaskTextSelector:o,maskTextFn:s,maskInputOptions:c,maskInputFn:l,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName,f=e.textContent,p=d===`STYLE`?!0:void 0,m=d===`SCRIPT`?!0:void 0,h=d===`TEXTAREA`?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(f=Bf(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}f=_p(f,Cp(t.doc))}m&&(f=`SCRIPT_PLACEHOLDER`);let g=Ep(e,r,a,i,o,n);return!p&&!m&&!h&&f&&g&&(f=s?s(f,e.parentElement):f.replace(/[\S]/g,`*`)),h&&f&&(c.textarea||g)&&(f=l?l(f,e.parentNode):f.replace(/[\S]/g,`*`)),d===`OPTION`&&f&&(f=Jf({isMasked:Ep(e,r,a,i,o,qf({type:null,tagName:d,maskInputOptions:c})),element:e,value:f,maskInputFn:l})),{type:Pf.Text,textContent:f||``,isStyle:p,rootId:u}}function Hee(e,t){let{doc:n,blockClass:r,blockSelector:i,unblockSelector:a,inlineStylesheet:o,maskInputOptions:s={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:h,maskTextClass:g,unmaskTextClass:_,maskTextSelector:v,unmaskTextSelector:y,ignoreCSSAttributes:b}=t,x=Fee(e,r,i,a),S=Aee(e),C={},w=e.attributes.length;for(let t=0;t<w;t++){let r=e.attributes[t];r.name&&!Pee(S,r.name,r.value)&&(C[r.name]=Nee(n,S,Yf(r.name),r.value,e,c,b))}if(S===`link`&&o){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=Bf(t)),r&&(C.rel=null,C.href=null,C.crossorigin=null,C._cssText=_p(r,t.href))}if(S===`style`&&e.sheet&&!(e.innerText||e.textContent||``).trim().length){let t=Bf(e.sheet);t&&(C._cssText=_p(t,Cp(n)))}if(S===`input`||S===`textarea`||S===`select`||S===`option`){let t=e,n=$f(t),r=ep(t,Xf(S),n),i=t.checked;n!==`submit`&&n!==`button`&&r&&(C.value=Jf({isMasked:Ep(t,g,v,_,y,qf({type:n,tagName:Xf(S),maskInputOptions:s})),element:t,value:r,maskInputFn:l})),i&&(C.checked=i)}if(S===`option`&&(e.selected&&!s.select?C.selected=!0:delete C.selected),S===`canvas`&&f){if(e.__context===`2d`)Qf(e)||(C.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!(`__context`in e)){let t=e.toDataURL(u.type,u.quality),r=n.createElement(`canvas`);r.width=e.width,r.height=e.height,t!==r.toDataURL(u.type,u.quality)&&(C.rr_dataURL=t)}}if(S===`img`&&d){dp||(dp=n.createElement(`canvas`),fp=dp.getContext(`2d`));let t=e,r=t.currentSrc||t.getAttribute(`src`)||`<unknown-src>`,i=t.crossOrigin,a=()=>{t.removeEventListener(`load`,a);try{dp.width=t.naturalWidth,dp.height=t.naturalHeight,fp.drawImage(t,0,0),C.rr_dataURL=dp.toDataURL(u.type,u.quality)}catch(e){if(t.crossOrigin!==`anonymous`){t.crossOrigin=`anonymous`,t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a);return}else console.warn(`Cannot inline img src=${r}! Error: ${e}`)}t.crossOrigin===`anonymous`&&(i?C.crossOrigin=i:t.removeAttribute(`crossorigin`))};t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a)}if((S===`audio`||S===`video`)&&(C.rr_mediaState=e.paused?`paused`:`played`,C.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),x){let{width:t,height:n}=e.getBoundingClientRect();C={class:C.class,rr_width:`${t}px`,rr_height:`${n}px`}}S===`iframe`&&!p(C.src)&&(!x&&!op(e)&&(C.rr_src=C.src),delete C.src);let T;try{customElements.get(S)&&(T=!0)}catch{}return{type:Pf.Element,tagName:S,attributes:C,childNodes:[],isSVG:Mee(e)||void 0,needBlock:x,rootId:h,isCustom:T}}function Dp(e){return e==null?``:e.toLowerCase()}function Uee(e,t){return!!(t.comment&&e.type===Pf.Comment||e.type===Pf.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&(e.attributes.rel===`preload`||e.attributes.rel===`modulepreload`)||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&tp(e.attributes.href)===`js`)||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(Dp(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Dp(e.attributes.name)===`application-name`||Dp(e.attributes.rel)===`icon`||Dp(e.attributes.rel)===`apple-touch-icon`||Dp(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&Dp(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(Dp(e.attributes.property).match(/^(og|twitter|fb):/)||Dp(e.attributes.name).match(/^(og|twitter):/)||Dp(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(Dp(e.attributes.name)===`robots`||Dp(e.attributes.name)===`googlebot`||Dp(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(Dp(e.attributes.name)===`author`||Dp(e.attributes.name)===`generator`||Dp(e.attributes.name)===`framework`||Dp(e.attributes.name)===`publisher`||Dp(e.attributes.name)===`progid`||Dp(e.attributes.property).match(/^article:/)||Dp(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(Dp(e.attributes.name)===`google-site-verification`||Dp(e.attributes.name)===`yandex-verification`||Dp(e.attributes.name)===`csrf-token`||Dp(e.attributes.name)===`p:domain_verify`||Dp(e.attributes.name)===`verify-v1`||Dp(e.attributes.name)===`verification`||Dp(e.attributes.name)===`shopify-checkout-api-token`)))
14)}function Op(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:x=!1,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w=5e3,onBlockedImageLoad:T,onStylesheetLoad:E,stylesheetLoadTimeout:D=5e3,keepIframeSrcFn:O=()=>!1,newlyAddedElement:k=!1,ignoreCSSAttributes:A}=t,{preserveWhiteSpace:j=!0}=t,M=zee(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,dataURLOptions:y,inlineImages:b,recordCanvas:x,keepIframeSrcFn:O,newlyAddedElement:k,ignoreCSSAttributes:A});if(!M)return console.warn(e,`not serialized`),null;let N;N=r.hasNode(e)?r.getId(e):Uee(M,v)||!j&&M.type===Pf.Text&&!M.isStyle&&!M.textContent.replace(/^\s+|\s+$/gm,``).length?cp:lp();let P=Object.assign(M,{id:N});if(r.add(e,P),N===cp)return null;S&&S(e);let F=!f;if(P.type===Pf.Element){F&&=!P.needBlock;let t=e.shadowRoot;t&&Lf(t)&&(P.isShadowHost=!0)}if((P.type===Pf.Document||P.type===Pf.Element)&&F){v.headWhitespace&&P.type===Pf.Element&&P.tagName===`head`&&(j=!1);let t={doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onBlockedImageLoad:T,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:O,ignoreCSSAttributes:A},k=e.childNodes?Array.from(e.childNodes):[];for(let e of k){let n=Op(e,t);n&&P.childNodes.push(n)}if(Ff(e)&&e.shadowRoot)for(let n of Array.from(e.shadowRoot.childNodes)){let r=Op(n,t);r&&(Lf(e.shadowRoot)&&(r.isShadow=!0),P.childNodes.push(r))}}if(e.parentNode&&If(e.parentNode)&&Lf(e.parentNode)&&(P.isShadow=!0),P.type===Pf.Element&&P.tagName===`iframe`&&!P.needBlock&&Lee(e,()=>{let t=op(e);if(t&&C){let n=Op(t,{doc:t,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:O,ignoreCSSAttributes:A});n&&C(e,n)}},w),P.type===Pf.Element&&P.tagName===`img`&&!e.complete&&P.needBlock){let t=e,n=()=>{if(t.isConnected&&!t.complete&&T)try{let e=t.getBoundingClientRect();e.width>0&&e.height>0&&T(t,P,e)}catch{}t.removeEventListener(`load`,n)};t.isConnected&&t.addEventListener(`load`,n)}return P.type===Pf.Element&&P.tagName===`link`&&typeof P.attributes.rel==`string`&&(P.attributes.rel===`stylesheet`||P.attributes.rel===`preload`&&typeof P.attributes.href==`string`&&tp(P.attributes.href)===`css`)&&Ree(e,()=>{if(E){let t=Op(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:E,stylesheetLoadTimeout:D,keepIframeSrcFn:O,ignoreCSSAttributes:A});t&&E(e,t)}},D),P.type===Pf.Element&&delete P.needBlock,P}function Wee(e,t){let{mirror:n=new Gf,blockClass:r=`rr-block`,blockSelector:i=null,unblockSelector:a=null,maskAllText:o=!1,maskTextClass:s=`rr-mask`,unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOM:v=!1,dataURLOptions:y,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onBlockedImageLoad:w,onStylesheetLoad:T,stylesheetLoadTimeout:E,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:O=new Set([])}=t||{};return Op(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:s,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v===!0||v===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}
14:v===!1?{}:v,dataURLOptions:y,inlineImages:f,recordCanvas:p,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onBlockedImageLoad:w,onStylesheetLoad:T,stylesheetLoadTimeout:E,keepIframeSrcFn:D,newlyAddedElement:!1,ignoreCSSAttributes:O})}function kp(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Ap=`Please stop import mirror directly. Instead of that,\r 15now you can use replayer.getMirror() to access the mirror instance of a replayer,\r 16or you can use record.mirror to access the mirror instance during recording.`,Gee={map:{},getId(){return console.error(Ap),-1},getNode(){return console.error(Ap),null},removeNodeFromMap(){console.error(Ap)},has(){return console.error(Ap),!1},reset(){console.error(Ap)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(Gee=new Proxy(Gee,{get(e,t,n){return t===`map`&&console.error(Ap),Reflect.get(e,t,n)}}));function jp(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(lte(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=zp(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function Kee(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){zp(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>Kee(e,t,a||{},!0)}function Mp(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var Np=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Np=()=>new Date().getTime());function qee(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function Jee(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Yee(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Xee(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Pp(e,t,n,r,i){if(!e)return!1;let a=Xee(e);if(!a)return!1;let o=Tp(t,n);if(!i){let e=r&&a.matches(r);return o(a)&&!e}let s=wp(a,o),c=-1;return s<0?!1:(r&&(c=wp(a,Tp(null,r))),s>-1&&c<0?!0:s<c)}function Zee(e,t){return t.getId(e)!==-1}function Fp(e,t){return t.getId(e)===cp}function Qee(e,t){if(If(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Qee(e.parentNode,t):!0:!0}function Ip(e){return!!e.changedTouches}function $ee(e=window){`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw TypeError(`1 argument is required`);do if(this===t)return!0;while(t&&=t.parentNode);return!1})}function ete(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function tte(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function Lp(e){return!!e?.shadowRoot}var nte=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function rte(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function ite(e){let t=e,n;for(;n=rte(t);)t=n;return t}function ate(e){let t=e.ownerDocument;if(!t)return!1;let n=ite(e);return t.contains(n)}function ote(e){let t=e.ownerDocument;return t?t.contains(e)||ate(e):!1}var ste={};function Rp(e){let t=ste[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return ste[e]=r.bind(window)}function cte(...e){return Rp(`requestAnimationFrame`)(...e)}function zp(...e){return Rp(`setTimeout`)(...e)}function lte(...e){return Rp(`clearTimeout`)(...e)}var Bp=(e=>(e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`,e))(Bp||{}),Vp=(e=>(e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`,e[e.Selection=14]=`Selection`,e[e.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,e[e.CustomElement=16]=`CustomElement`,e))(Vp||{}),Hp=(e=>(e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`,e))(Hp||{}),Up=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(Up||{}),Wp=(e=>(e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`,e[e.RateChange=4]=`RateChange`,e))(Wp||{});function Gp(e){try{return e.contentDocument}catch{}}function ute(e){try{return e.contentWindow}catch{}}function dte(e){return`__ln`in e}var fte=class{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw Error(`Position outside of list range`);let t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&dte(e.previousSibling)){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&
16(n.previous=t)}else if(e.nextSibling&&dte(e.nextSibling)&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},pte=(e,t)=>`${e}@${t}`,mte=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new fte,r=e=>{let t=e,n=cp;for(;n===cp;)t&&=t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!ote(i))return;let a=If(i.parentNode)?this.mirror.getId(rte(i)):this.mirror.getId(i.parentNode),o=r(i);if(a===-1||o===-1)return n.addNode(i);let s=Op(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{ete(e,this.mirror)&&!Pp(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(e),tte(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Lp(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{Pp(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(e,t),e.contentWindow&&this.canvasManager.addWindow(e.contentWindow),this.shadowDomManager.observeAttachShadow(e))},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});s&&(e.push({parentId:a,nextId:o,node:s}),t.add(s.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)hte(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(let e of this.addedSet)!_te(this.droppedSet,e)&&!hte(this.removes,e,this.mirror)||_te(this.movedSet,e)?i(e):this.droppedSet.add(e);let a=null;for(;n.length;){let e=null;if(a){let t=this.mirror.getId(a.value.parentNode),n=r(a.value);t!==-1&&n!==-1&&(e=a)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(n.value.parentNode);if(r(n.value)===-1)continue;if(t!==-1){e=n;break}else{let t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let r=t.parentNode.host;if(this.mirror.getId(r)!==-1){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}a=e.previous,n.removeNode(e.value),i(e.value)}let o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!o.texts.length&&!o.attributes.length&&!o.removes.length&&!o.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(!Fp(e.target,this.mirror))switch(e.type){case`characterData`:{let t=e.target.textContent;!Pp(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Ep(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,Xee(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if(n===`value`){let n=$f(t),i=t.tagName;r=ep(t,i,n);let a=qf({maskInputOptions:this.maskInputOptions,tagName:i,type:n});r=Jf({isMasked:Ep(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a),element:t,value:r,maskInputFn:this.maskInputFn})}if(Pp(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName===`IFRAME`&&n===`src`&&!this.keepIframeSrcFn(r))if(!Gp(t))n=`rr_src`;else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}
16,this.attributes.push(i),this.attributeMap.set(e.target,i)),n===`type`&&t.tagName===`INPUT`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!Pee(t.tagName,n)&&(i.attributes[n]=Nee(this.doc,Yf(t.tagName),Yf(n),r,t,this.maskAttributeFn),n===`style`)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let n=this.unattachedDoc.createElement(`span`);e.oldValue&&n.setAttribute(`style`,e.oldValue);for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||a!==n.style.getPropertyPriority(e)?a===``?i.styleDiff[e]=r:i.styleDiff[e]=[r,a]:i._unchangedStyles[e]=[r,a]}for(let e of Array.from(n.style))t.style.getPropertyValue(e)===``&&(i.styleDiff[e]=!1)}break}case`childList`:if(Pp(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=If(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Pp(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Fp(t,this.mirror)||!Zee(t,this.mirror)||(this.addedSet.has(t)?(Kp(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||Qee(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[pte(n,r)]?Kp(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:If(e.target)&&Lf(e.target)?!0:void 0})),this.mapRemoves.push(t))});break}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Fp(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[pte(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Pp(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(e=>this.genAdds(e)),Lp(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){`mutationCb.blockClass.blockSelector.unblockSelector.maskAllText.maskTextClass.unmaskTextClass.maskTextSelector.unmaskTextSelector.inlineStylesheet.maskInputOptions.maskAttributeFn.maskTextFn.maskInputFn.keepIframeSrcFn.recordCanvas.inlineImages.slimDOMOptions.dataURLOptions.doc.mirror.iframeManager.stylesheetManager.shadowDomManager.canvasManager.processedNodeManager.ignoreCSSAttributes`.split(`.`).forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Kp(e,t){e.delete(t),t.childNodes?.forEach(t=>Kp(e,t))}function hte(e,t,n){return e.length===0?!1:gte(e,t,n)}function gte(e,t,n){let r=t.parentNode;for(;r;){let t=n.getId(r);if(e.some(e=>e.id===t))return!0;r=r.parentNode}return!1}function _te(e,t){return e.size===0?!1:vte(e,t)}function vte(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:vte(e,n):!1}var qp;function yte(e){qp=e}function bte(){qp=void 0}var Jp=e=>qp?(...t)=>{try{return e(...t)}catch(e){if(qp&&qp(e)===!0)return()=>{};throw e}}:e,Yp=[];function Xp(e){try{if(`composedPath`in e){let t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Zp(e,t){let n=new mte;Yp.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,i=window?.Zone?.__symbol__?.(`MutationObserver`);i&&window[i]&&(r=window[i]);let a=new r(Jp(t=>{e.onMutation&&e.onMutation(t)===!1||n.processMutations.bind(n)(t)}));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function xte({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=jp(Jp(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=Jp(jp(Jp(e=>{let t=Xp(e),{clientX:n,clientY:i}=Ip(e)?e.changedTouches[0]:e;s||=Np(),o.push({x:n,y:i,id:r.getId(t),timeOffset:Np()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?Vp.Drag:e instanceof MouseEvent?Vp.MouseMove:Vp.TouchMove)}),i,{trailing:!1})),u=[kp(`mousemove`,l,n),kp(`touchmove`,l,n),kp(`drag`,l,n)];return Jp(()=>
16{u.forEach(e=>e())})}function Ste({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],l=null,u=t=>o=>{let s=Xp(o);if(Pp(s,r,i,a,!0))return;let c=null,u=t;if(`pointerType`in o){switch(o.pointerType){case`mouse`:c=Up.Mouse;break;case`touch`:c=Up.Touch;break;case`pen`:c=Up.Pen;break}c===Up.Touch?Hp[t]===Hp.MouseDown?u=`TouchStart`:Hp[t]===Hp.MouseUp&&(u=`TouchEnd`):Up.Pen}else Ip(o)&&(c=Up.Touch);c===null?Hp[t]===Hp.Click&&(c=l,l=null):(l=c,(u.startsWith(`Touch`)&&c===Up.Touch||u.startsWith(`Mouse`)&&c===Up.Mouse)&&(c=null));let d=Ip(o)?o.changedTouches[0]:o;if(!d)return;let f=n.getId(s),{clientX:p,clientY:m}=d;Jp(e)({type:Hp[u],id:f,x:p,y:m,...c!==null&&{pointerType:c}})};return Object.keys(Hp).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&s[e]!==!1).forEach(e=>{let n=Yf(e),r=u(e);if(window.PointerEvent)switch(Hp[e]){case Hp.MouseDown:case Hp.MouseUp:n=n.replace(`mouse`,`pointer`);break;case Hp.TouchStart:case Hp.TouchEnd:return}c.push(kp(n,r,t))}),Jp(()=>{c.forEach(e=>e())})}function Qp({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){return kp(`scroll`,Jp(jp(Jp(o=>{let s=Xp(o);if(!s||Pp(s,r,i,a,!0))return;let c=n.getId(s);if(s===t&&t.defaultView){let n=qee(t.defaultView);e({id:c,x:n.left,y:n.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}function Cte({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return kp(`resize`,Jp(jp(Jp(()=>{let t=Jee(),i=Yee();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}var wte=[`INPUT`,`TEXTAREA`,`SELECT`],$p=new WeakMap;function Tte({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,ignoreClass:o,ignoreSelector:s,maskInputOptions:c,maskInputFn:l,sampling:u,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:p,maskTextSelector:m,unmaskTextSelector:h}){function g(e){let n=Xp(e),u=e.isTrusted,g=n&&Xf(n.tagName);if(g===`OPTION`&&(n=n.parentElement),!n||!g||wte.indexOf(g)<0||Pp(n,r,i,a,!0))return;let v=n;if(v.classList.contains(o)||s&&v.matches(s))return;let y=$f(n),b=ep(v,g,y),x=!1,S=qf({maskInputOptions:c,tagName:g,type:y}),C=Ep(n,f,m,p,h,S);(y===`radio`||y===`checkbox`)&&(x=n.checked),b=Jf({isMasked:C,element:n,value:b,maskInputFn:l}),_(n,d?{text:b,isChecked:x,userTriggered:u}:{text:b,isChecked:x});let w=n.name;y===`radio`&&w&&x&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach(e=>{if(e!==n){let t=Jf({isMasked:C,element:e,value:ep(e,g,y),maskInputFn:l});_(e,d?{text:t,isChecked:!x,userTriggered:!1}:{text:t,isChecked:!x})}})}function _(t,r){let i=$p.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){$p.set(t,r);let i=n.getId(t);Jp(e)({...r,id:i})}}let v=(u.input===`last`?[`change`]:[`input`,`change`]).map(e=>kp(e,Jp(g),t)),y=t.defaultView;if(!y)return()=>{v.forEach(e=>e())};let b=y.Object.getOwnPropertyDescriptor(y.HTMLInputElement.prototype,`value`),x=[[y.HTMLInputElement.prototype,`value`],[y.HTMLInputElement.prototype,`checked`],[y.HTMLSelectElement.prototype,`value`],[y.HTMLTextAreaElement.prototype,`value`],[y.HTMLSelectElement.prototype,`selectedIndex`],[y.HTMLOptionElement.prototype,`selected`]];return b&&b.set&&v.push(...x.map(e=>Kee(e[0],e[1],{set(){Jp(g)({target:this,isTrusted:!1})}},!1,y))),Jp(()=>{v.forEach(e=>e())})}function em(e){let t=[];function n(e,t){if(rm(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||rm(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||rm(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||rm(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function tm(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function Ete({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Jp((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=tm(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),r.apply(i,a)})});let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Jp((r,i,a)=>{let[o]=a,{id:s,styleId:c}=tm(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),r.apply(i,a)})});let o;
16r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Jp((r,i,a)=>{let[o]=a,{id:s,styleId:c}=tm(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Jp((r,i,a)=>{let[o]=a,{id:s,styleId:c}=tm(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};im(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:(im(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),im(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),im(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Jp((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=tm(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...em(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Jp((r,i,a)=>{let[o]=a,{id:s,styleId:c}=tm(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...em(i),o]}]}),r.apply(i,a)})})}),Jp(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function nm({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(n.host);let i=n.nodeName===`#document`?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,a=i?.prototype?Object.getOwnPropertyDescriptor(i?.prototype,`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,`adoptedStyleSheets`,{configurable:a.configurable,enumerable:a.enumerable,get(){return a.get?.call(this)},set(e){let n=a.set?.call(this,e);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),Jp(()=>{Object.defineProperty(n,`adoptedStyleSheets`,{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Dte({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jp((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=tm(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:em(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Jp((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=tm(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:em(a.parentRule)}),i.apply(a,s)})}),Jp(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Ote({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:i,sampling:a,doc:o}){let s=Jp(o=>jp(Jp(a=>{let s=Xp(a);if(!s||Pp(s,t,n,r,!0))return;let{currentTime:c,volume:l,muted:u,playbackRate:d}=s;e({type:o,id:i.getId(s),currentTime:c,volume:l,muted:u,playbackRate:d})}),a.media||500)),c=[kp(`play`,s(Wp.Play),o),kp(`pause`,s(Wp.Pause),o),kp(`seeked`,s(Wp.Seeked),o),kp(`volumechange`,s(Wp.VolumeChange),o),kp(`ratechange`,s(Wp.RateChange),o)];return Jp(()=>{c.forEach(e=>e())})}function kte({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=Mp(t.fonts,`add`,function(t){return function(n){return zp(Jp(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),Jp(()=>
16{r.forEach(e=>e())})}function Ate(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,selectionCb:o}=e,s=!0,c=Jp(()=>{let e=t.getSelection();if(!e||s&&e?.isCollapsed)return;s=e.isCollapsed||!1;let c=[],l=e.rangeCount||0;for(let t=0;t<l;t++){let{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=e.getRangeAt(t);Pp(o,r,i,a,!0)||Pp(l,r,i,a,!0)||c.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:c})});return c(),kp(`selectionchange`,c)}function jte({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Mp(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{}return e.apply(this,[n,r,i])}})}function Mte(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=Zp(e,e.doc));let i=xte(e),a=Ste(e),o=Qp(e),s=Cte(e,{win:n}),c=Tte(e),l=Ote(e),u=()=>{},d=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(u=Ete(e,{win:n}),d=nm(e,e.doc),f=Dte(e,{win:n}),e.collectFonts&&(p=kte(e)));let m=Ate(e),h=jte(e),g=[];for(let t of e.plugins)g.push(t.observer(t.callback,n,t.options));return Jp(()=>{Yp.forEach(e=>e.reset()),r?.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g.forEach(e=>e())})}function rm(e){return window[e]!==void 0}function im(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}for(var am=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}
16getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},Nte=class{constructor(){this.crossOriginIframeMirror=new am(lp),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},Pte=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new am(lp),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new am(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener(`message`,this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&e.contentWindow?.addEventListener(`message`,this.handleMessage.bind(this)),this.loadListener?.(e);let n=Gp(e);n&&n.adoptedStyleSheets&&n.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(n.adoptedStyleSheets,this.mirror.getId(n))}handleMessage(e){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case Bp.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Bp.IncrementalSnapshot,data:{source:Vp.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Bp.Meta:case Bp.Load:case Bp.DomContentLoaded:return!1;case Bp.Plugin:return t;case Bp.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case Bp.IncrementalSnapshot:switch(t.data.source){case Vp.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case Vp.Drag:case Vp.TouchMove:case Vp.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case Vp.ViewportResize:return!1;case Vp.MediaInteraction:case Vp.MouseInteraction:case Vp.Scroll:case Vp.CanvasMutation:case Vp.Input:return this.replaceIds(t.data,e,[`id`]),t;case Vp.StyleSheetRule:case Vp.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case Vp.Font:return t;case Vp.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case Vp.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),t.data.styles?.forEach(t=>{this.replaceStyleIds(t,e,[`styleId`])}),t}}return!1}replace(e,t,n,r){for(let i of r)!Array.isArray(t[i])&&typeof t[i]!=`number`||(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEac
16h(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==Pf.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},Fte=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},Ite=class{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Lf(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);let n=Zp({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Qp({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),zp(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(nm({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){let t=Gp(e),n=ute(e);!t||!n||this.patchAttachShadow(n.Element,t)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(Mp(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r);return this.shadowRoot&&ote(this)&&n.addShadowRoot(this.shadowRoot,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},om=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Lte=typeof Uint8Array>`u`?[]:new Uint8Array(256),sm=0;sm<om.length;sm++)Lte[om.charCodeAt(sm)]=sm;var cm=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}},Rte=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new nte,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){`_cssText`in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,t)=>({rule:Vf(e),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},zte=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,cte(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},lm,um;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}var dm=Kf();function fm(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,unblockSelector:o=null,ignoreClass:s=`rr-ignore`,ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u=`rr-mask`,unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:h,maskInputOptions:g,slimDOMOptions:_,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,maxCanvasSize:x=null,packFn:S,sampling:C={},dataURLOptions:w={},mousemoveWait:T,recordDOM:E=!0,recordCanvas:D=!1,recordCrossOriginIframes:O=!1,recordAfter:k=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:A=!1,collectFonts:j=!1,inlineImages:M=!1,plugins:N,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:F=new Set([]),errorHandler:I,onMutation:L,getCanvasManager:ee}=e;yte(I);let R=O?window.parent===window:!0,te=!1;if(!R)try{window.parent.document&&(te=!1)}catch{te=!0}if(R&&!t)throw Error(`emit function is required`);if(!R&&!te)return()=>{};
16T!==void 0&&C.mousemove===void 0&&(C.mousemove=T),dm.reset();let ne=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:g===void 0?{}:g,re=_===!0||_===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:_===`all`,headMetaDescKeywords:_===`all`}:_||{};$ee();let ie,z=0,ae=e=>{for(let t of N||[])t.eventProcessor&&(e=t.eventProcessor(e));return S&&!te&&(e=S(e)),e};lm=(e,i)=>{let a=e;if(a.timestamp=Np(),Yp[0]?.isFrozen()&&a.type!==Bp.FullSnapshot&&!(a.type===Bp.IncrementalSnapshot&&a.data.source===Vp.Mutation)&&Yp.forEach(e=>e.unfreeze()),R)t?.(ae(a),i);else if(te){let e={type:`rrweb`,event:ae(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===Bp.FullSnapshot)ie=a,z=0;else if(a.type===Bp.IncrementalSnapshot){if(a.data.source===Vp.Mutation&&a.data.isAttachIframe)return;z++;let e=r&&z>=r,t=n&&ie&&a.timestamp-ie.timestamp>n;(e||t)&&me(!0)}};let oe=e=>{lm({type:Bp.IncrementalSnapshot,data:{source:Vp.Mutation,...e}})},se=e=>lm({type:Bp.IncrementalSnapshot,data:{source:Vp.Scroll,...e}}),ce=e=>lm({type:Bp.IncrementalSnapshot,data:{source:Vp.CanvasMutation,...e}}),le=new Rte({mutationCb:oe,adoptedStyleSheetCb:e=>lm({type:Bp.IncrementalSnapshot,data:{source:Vp.AdoptedStyleSheet,...e}})}),ue=typeof __RRWEB_EXCLUDE_IFRAME__==`boolean`&&__RRWEB_EXCLUDE_IFRAME__?new Nte:new Pte({mirror:dm,mutationCb:oe,stylesheetManager:le,recordCrossOriginIframes:O,wrappedEmit:lm});for(let e of N||[])e.getMirror&&e.getMirror({nodeMirror:dm,crossOriginIframeMirror:ue.crossOriginIframeMirror,crossOriginIframeStyleMirror:ue.crossOriginIframeStyleMirror});let de=new zte,fe=Vte(ee,{mirror:dm,win:window,mutationCb:e=>lm({type:Bp.IncrementalSnapshot,data:{source:Vp.CanvasMutation,...e}}),recordCanvas:D,blockClass:i,blockSelector:a,unblockSelector:o,maxCanvasSize:x,sampling:C.canvas,dataURLOptions:w,errorHandler:I}),pe=typeof __RRWEB_EXCLUDE_SHADOW_DOM__==`boolean`&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Fte:new Ite({mutationCb:oe,scrollCb:se,bypassOptions:{onMutation:L,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:ne,dataURLOptions:w,maskAttributeFn:v,maskTextFn:b,maskInputFn:y,recordCanvas:D,inlineImages:M,sampling:C,slimDOMOptions:re,iframeManager:ue,stylesheetManager:le,canvasManager:fe,keepIframeSrcFn:P,processedNodeManager:de,ignoreCSSAttributes:F},mirror:dm}),me=(e=!1)=>{if(!E)return;lm({type:Bp.Meta,data:{href:window.location.href,width:Yee(),height:Jee()}},e),le.reset(),pe.init(),Yp.forEach(e=>e.lock());let t=Wee(document,{mirror:dm,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:ne,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,slimDOM:re,dataURLOptions:w,recordCanvas:D,inlineImages:M,onSerialize:e=>{ete(e,dm)&&ue.addIframe(e),tte(e,dm)&&le.trackLinkElement(e),Lp(e)&&pe.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{ue.attachIframe(e,t),e.contentWindow&&fe.addWindow(e.contentWindow),pe.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{le.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{oe({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},keepIframeSrcFn:P,ignoreCSSAttributes:F});if(!t)return console.warn(`Failed to snapshot the document`);lm({type:Bp.FullSnapshot,data:{node:t,initialOffset:qee(window)}}),Yp.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&le.adoptStyleSheets(document.adoptedStyleSheets,dm.getId(document))};um=me;try{let e=[],t=e=>Jp(Mte)({onMutation:L,mutationCb:oe,mousemoveCb:(e,t)=>lm({type:Bp.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>lm({type:Bp.IncrementalSnapshot,data:{source:Vp.MouseInteraction,...e}}),scrollCb:se,viewportResizeCb:e=>lm({type:Bp.IncrementalSnapshot,data:{source:Vp.ViewportResize,...e}}),inputCb:e=>lm({type:Bp.IncrementalSnapshot,data:{source:Vp.Input,...e}}),mediaInteractionCb:e=>lm({type:Bp.IncrementalSnapshot,data:{source:Vp.MediaInteraction,...e}}),styleSheetRuleCb:e=>lm({type:Bp.IncrementalSnapshot,data:{source:Vp.StyleSheetRule,...e}}),styleDeclarationCb:e=>lm({type:Bp.IncrementalSnapshot,data:{source:Vp.StyleDeclaration,...e}}),canvasMutationCb:ce,fontCb:e=>lm({type:Bp.IncrementalSnapshot,data:{source:Vp.Font,...e}}),selectionCb:e=>{lm({type:Bp.IncrementalSnapshot,data:{source:Vp.Selection,...e}})},customElementCb:e=>{lm({type:Bp.IncrementalSnapshot,data:{source:Vp.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:ne,inlineStylesheet:m,sampling:C,recordDOM:E,recordCanvas:D,inlineImages:M,userTr
16iggeredOnInput:A,collectFonts:j,doc:e,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,keepIframeSrcFn:P,blockSelector:a,unblockSelector:o,slimDOMOptions:re,dataURLOptions:w,mirror:dm,iframeManager:ue,stylesheetManager:le,shadowDomManager:pe,processedNodeManager:de,canvasManager:fe,ignoreCSSAttributes:F,plugins:N?.filter(e=>e.observer)?.map(e=>({observer:e.observer,options:e.options,callback:t=>lm({type:Bp.Plugin,data:{plugin:e.name,payload:t}})}))||[]},{});ue.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{me(),e.push(t(document))};return document.readyState===`interactive`||document.readyState===`complete`?n():(e.push(kp(`DOMContentLoaded`,()=>{lm({type:Bp.DomContentLoaded,data:{}}),k===`DOMContentLoaded`&&n()})),e.push(kp(`load`,()=>{lm({type:Bp.Load,data:{}}),k===`load`&&n()},window))),()=>{e.forEach(e=>e()),de.destroy(),um=void 0,bte()}}catch(e){console.warn(e)}}function Bte(e){if(!um)throw Error(`please take full snapshot after start recording`);um(e)}fm.mirror=dm,fm.takeFullSnapshot=Bte;function Vte(e,t){try{return e?e(t):new cm}catch{return console.warn(`Unable to initialize CanvasManager`),new cm}}var Hte;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(Hte||={});var Ute=3,Wte=5;function pm(e){return e>9999999999?e:e*1e3}function mm(e){return e>9999999999?e/1e3:e}function hm(e,t){t.category!==`sentry.transaction`&&([`ui.click`,`ui.input`].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:Bp.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:`breadcrumb`,payload:kr(t,10,1e3)}}),t.category===`console`)))}var Gte=`button,a`;function gm(e){return e.closest(Gte)||e}function _m(e){let t=vm(e);return!t||!(t instanceof Element)?t:gm(t)}function vm(e){return Kte(e)?e.target:e}function Kte(e){return typeof e==`object`&&!!e&&`target`in e}var ym;function qte(e){return ym||(ym=[],Jte()),ym.push(e),()=>{let t=ym?ym.indexOf(e):-1;t>-1&&ym.splice(t,1)}}function Jte(){Ke(ff,`open`,function(e){return function(...t){if(ym)try{ym.forEach(e=>e())}catch{}return e.apply(ff,t)}})}var Yte=new Set([Vp.Mutation,Vp.StyleSheetRule,Vp.StyleDeclaration,Vp.AdoptedStyleSheet,Vp.CanvasMutation,Vp.Selection,Vp.MediaInteraction]);function Xte(e,t,n){e.handleClick(t,n)}var Zte=class{constructor(e,t,n=hm){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scrollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){let e=qte(()=>{this._lastMutation=bm()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if($te(t,this._ignoreSelector)||!ene(e))return;let n={timestamp:mm(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1)||(this._clicks.push(n),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=mm(e)}registerScroll(e=Date.now()){this._lastScroll=mm(e)}registerClick(e){let t=gm(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(e=>{e.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){let e=[],t=bm();this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)});for(let t of e){let e=this._clicks.indexOf(t);e>-1&&(this._generateBreadcrumbs(t),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){let t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!n&&!r,{clickCount:a,clickBreadcrumb:o}=e;if(i){let n=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,r=n<this._timeout*1e3?`mutation`:`timeout`,i={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.slowClickDetected`,data:{...o.data,url:ff.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:a||1}};this._addBreadcrumbEvent(t,i);return}if(a>1){let e={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.multiClick`,data:{...o.data,url:ff.location.href,route:t.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=td(()=>this._checkClicks(),1e3)}},Qte=[`A`,`BUTTON`,`INPUT`];function $te(e,t){return!!(!Qte.includes(e.tagName)||e.tagName===`INPUT`&&![`submit`,`button`].includes(e.getAttribute(`type`)||``)||e.tagName===`A`&&(e.hasAttribute(`download`)||e.hasAttribute(`target`)&&e.getAttribute(`target`)!==`_self`)||t&&e.matches(t))}
16function ene(e){return!!(e.data&&typeof e.data.nodeId==`number`&&e.timestamp)}function bm(){return Date.now()/1e3}function tne(e,t){try{if(!nne(t))return;let{source:n}=t.data;if(Yte.has(n)&&e.registerMutation(t.timestamp),n===Vp.Scroll&&e.registerScroll(t.timestamp),rne(t)){let{type:n,id:r}=t.data,i=fm.mirror.getNode(r);i instanceof HTMLElement&&n===Hp.Click&&e.registerClick(i)}}catch{}}function nne(e){return e.type===Ute}function rne(e){return e.data.source===Vp.MouseInteraction}function xm(e){return{timestamp:Date.now()/1e3,type:`default`,...e}}var Sm=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(Sm||{}),ine=new Set([`id`,`class`,`aria-label`,`role`,`name`,`alt`,`title`,`data-test-id`,`data-testid`,`disabled`,`aria-disabled`,`data-sentry-component`]);function ane(e){let t={};for(let n in!e[`data-sentry-component`]&&e[`data-sentry-element`]&&(e[`data-sentry-component`]=e[`data-sentry-element`]),e)if(ine.has(n)){let r=n;(n===`data-testid`||n===`data-test-id`)&&(r=`testId`),t[r]=e[n]}return t}var one=e=>t=>{if(!e.isEnabled())return;let n=sne(t);if(!n)return;let r=t.name===`click`,i=r?t.event:void 0;r&&e.clickDetector&&i?.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&Xte(e.clickDetector,n,_m(t.event)),hm(e,n)};function Cm(e,t){let n=fm.mirror.getId(e),r=n&&fm.mirror.getNode(n),i=r&&fm.mirror.getMeta(r),a=i&&lne(i)?i:null;return{message:t,data:a?{nodeId:n,node:{id:n,tagName:a.tagName,textContent:Array.from(a.childNodes).map(e=>e.type===Sm.Text&&e.textContent).filter(Boolean).map(e=>e.trim()).join(``),attributes:ane(a.attributes)}}:{}}}function sne(e){let{target:t,message:n}=cne(e);return xm({category:`ui.${e.name}`,...Cm(t,n)})}function cne(e){let t=e.name===`click`,n,r=null;try{r=t?_m(e.event):vm(e.event),n=He(r,{maxStringLength:200})||`<unknown>`}catch{n=`<unknown>`}return{target:r,message:n}}function lne(e){return e.type===Sm.Element}function une(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=dne(t);n&&hm(e,n)}function dne(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a,target:o}=e;if(!o||fne(o)||!a)return null;let s=t||r||i,c=a.length===1;if(!s&&c)return null;let l=He(o,{maxStringLength:200})||`<unknown>`;return xm({category:`ui.keyDown`,message:l,data:{...Cm(o,l).data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a}})}function fne(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable}var pne={resource:vne,paint:gne,navigation:_ne};function wm(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function mne(e){return e.map(hne).filter(Boolean)}function hne(e){let t=pne[e.entryType];return t?t(e):null}function Tm(e){return((wt()||ff.performance.timeOrigin)+e)/1e3}function gne(e){let{duration:t,entryType:n,name:r,startTime:i}=e,a=Tm(i);return{type:n,name:r,start:a,end:a+t,data:void 0}}function _ne(e){let{entryType:t,name:n,decodedBodySize:r,duration:i,domComplete:a,encodedBodySize:o,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:f,startTime:p,transferSize:m,type:h}=e;return i===0?null:{type:`${t}.${h}`,start:Tm(p),end:Tm(a),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:l,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:a,redirectCount:f}}}function vne(e){let{entryType:t,initiatorType:n,name:r,responseEnd:i,startTime:a,decodedBodySize:o,encodedBodySize:s,responseStatus:c,transferSize:l}=e;return[`fetch`,`xmlhttprequest`].includes(n)?null:{type:`${t}.${n}`,start:Tm(a),end:Tm(i),name:r,data:{size:l,statusCode:c,decodedBodySize:o,encodedBodySize:s}}}function yne(e){let t=e.entries[e.entries.length-1];return Em(e,`largest-contentful-paint`,t?.element?[t.element]:void 0)}function bne(e){return e.sources!==void 0}function xne(e){let t=[],n=[];for(let r of e.entries)if(bne(r)){let e=[];for(let t of r.sources)if(t.node){n.push(t.node);let r=fm.mirror.getId(t.node);r&&e.push(r)}t.push({value:r.value,nodeIds:e.length?e:void 0})}return Em(e,`cumulative-layout-shift`,n,t)}function Sne(e){let t=e.entries[e.entries.length-1];return Em(e,`interaction-to-next-paint`,t?.target?[t.target]:void 0)}function Em(e,t,n,r){let i=e.value,a=e.rating,o=Tm(i);return{type:`web-vital`,name:t,start:o,end:o,data:{value:i,size:i,rating:a,nodeIds:n?n.map(e=>fm.mirror.getId(e)):void 0,attributions:r}}}function Cne(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n({entries:e}){e.forEach(t)}let r=[];
16return[`navigation`,`paint`,`resource`].forEach(e=>{r.push(El(e,n))}),r.push(Cl(wm(yne,e)),Sl(wm(xne,e)),Tl(wm(Sne,e))),()=>{r.forEach(e=>e())}}var Dm=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,wne=
vendor: 10,332 bytes, line 16
16`var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});`;
16function Tne(){let e=new Blob([wne]);return URL.createObjectURL(e)}var Om=[`log`,`warn`,`error`],km=`[Replay] `;function Am(e,t=`info`){Ko({category:`console`,data:{logger:`replay`},level:t,message:`${km}${e}`},{level:t})}function Ene(){let e=!1,t=!1,n={exception:()=>void 0,infoTick:()=>void 0,setConfig:n=>{e=!!n.captureExceptions,t=!!n.traceInternals}};return Dm?(Om.forEach(e=>{n[e]=(...n)=>{R[e](km,...n),t&&Am(n.join(``),vs(e))}}),n.exception=(r,...i)=>{i.length&&n.error&&n.error(...i),R.error(km,r),e?da(r,{mechanism:{handled:!0,type:`auto.function.replay.debug`}}):t&&Am(r,`error`)},n.infoTick=(...e)=>{R.log(km,...e),t&&setTimeout(()=>Am(e[0]),0)}):Om.forEach(e=>{n[e]=()=>void 0}),n}var jm=Ene(),Mm=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Df}.`)}},Nm=class{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return`sync`}destroy(){this.events=[]}async addEvent(e){let t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>Df)throw new Mm;this.events.push(e)}finish(){return new Promise(e=>{let t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(let{timestamp:t}of this.events)(e===null||t<e)&&(e=t);return e===null?e:pm(e)}},Dne=class e{constructor(t){e.prototype.__init.call(this),this._worker=t,this._id=0,this._pending=new Map,this._worker.addEventListener(`message`,this._onMessage)}ensureReady(){return this._ensureReadyPromise||=new Promise((e,t)=>{this._worker.addEventListener(`message`,({data:n})=>{n.success?e():(Dm&&jm.warn(`Received worker message with unsuccessful status`,n),t(Error(`Received worker message with unsuccessful status`)))},{once:!0}),this._worker.addEventListener(`error`,e=>{Dm&&jm.warn(`Failed to load Replay compression worker`,e),t(Error(`Failed to load Replay compression worker: ${e instanceof ErrorEvent&&e.message?e.message:`Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load.`}`))},{once:!0})}),this._ensureReadyPromise}destroy(){Dm&&jm.log(`Destroying compression worker`),this._worker.removeEventListener(`message`,this._onMessage),this._pending.forEach(e=>e.reject(Error(`Worker destroyed`))),this._pending.clear(),this._worker.terminate()}postMessage(e,t){let n=this._getAndIncrementId();return new Promise((r,i)=>{this._pending.set(n,{method:e,resolve:r,reject:i});try{this._worker.postMessage({id:n,method:e,arg:t})}catch(e){this._pending.delete(n),i(e)}})}__init(){this._onMessage=({data:e})=>{let t=e;if(typeof t.id!=`number`)return;let n=this._pending.get(t.id);if(!(!n||n.method!==t.method)){if(this._pending.delete(t.id),!t.success){Dm&&jm.error(`Error in compression worker: `,t.response),n.reject(Error(`Error in compression worker`));return}n.resolve(t.response)}}}_getAndIncrementId(){return this._id++}},One=class{constructor(e){this._worker=new Dne(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return`worker`}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){let t=pm(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);let n=JSON.stringify(e);return this._totalSize+=n.length,this._totalSize>Df?Promise.reject(new Mm):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage(`clear`).then(null,e=>{Dm&&jm.exception(e,`Sending "clear" message to worker failed`,e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage(`addEvent`,e)}async _finishRequest(){let e=await this._worker.postMessage(`finish`);return this._earliestTimestamp=null,this._totalSize=0,e}},kne=class{constructor(e){this._fallback=new Nm,this._compression=new One(e),this._used=this._fallback,this._ensureWorkerIsLoadedProm
16ise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){Dm&&jm.exception(e,`Failed to load the compression worker, falling back to simple buffer`);return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:e,hasCheckout:t,waitForCheckout:n}=this._fallback,r=[];for(let t of e)r.push(this._compression.addEvent(t));this._compression.hasCheckout=t,this._compression.waitForCheckout=n,this._used=this._compression;try{await Promise.all(r),this._fallback.clear()}catch(e){Dm&&jm.exception(e,`Failed to add events when switching buffers.`)}}};function Ane({useCompression:e,workerUrl:t}){if(e&&window.Worker){let e=jne(t);if(e)return e}return Dm&&jm.log(`Using simple buffer`),new Nm}function jne(e){try{let t=e||Mne();return t?(Dm&&jm.log(`Using compression worker${e?` from ${e}`:``}`),new kne(new Worker(t))):void 0}catch(e){Dm&&jm.exception(e,`Failed to create compression worker`)}}function Mne(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>`u`||!__SENTRY_EXCLUDE_REPLAY_WORKER__?Tne():``}function Pm(){try{return`sessionStorage`in ff&&!!ff.sessionStorage}catch{return!1}}function Nne(e){Pne(),e.session=void 0}function Pne(){if(Pm())try{ff.sessionStorage.removeItem(pf)}catch{}}function Fm(e){return e===void 0?!1:Math.random()<e}function Im(e){if(Pm())try{ff.sessionStorage.setItem(pf,JSON.stringify(e))}catch{}}function Lm(e){let t=Date.now();return{id:e.id||ut(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId,dirty:e.dirty||!1}}function Fne(e,t){return Fm(e)?`session`:t?`buffer`:!1}function Rm({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let i=Lm({sampled:Fne(e,t),previousSessionId:r});return n&&Im(i),i}function Ine(){if(!Pm())return null;try{let e=ff.sessionStorage.getItem(pf);if(!e)return null;let t=JSON.parse(e);return Dm&&jm.infoTick(`Loading existing session`),Lm(t)}catch{return null}}function zm(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function Bm(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return zm(e.started,t,r)||zm(e.lastActivity,n,r)}function Vm(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!Bm(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled===`buffer`&&e.segmentId===0)}function Hm({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let i=r.stickySession&&Ine();return i?Vm(i,{sessionIdleExpire:e,maxReplayDuration:t})?(Dm&&jm.infoTick(`Session in sessionStorage is expired, creating new one...`),Rm(r,{previousSessionId:i.id})):i:(Dm&&jm.infoTick(`Creating new session`),Rm(r,{previousSessionId:n}))}function Lne(e){return e.type===Bp.Custom}function Um(e,t,n){return Gm(e,t)?(Wm(e,t,n),!0):!1}function Rne(e,t,n){return Gm(e,t)?Wm(e,t,n):Promise.resolve(null)}async function Wm(e,t,n){let{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;let i=e.recordingMode===`buffer`;try{n&&i&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let a=zne(t,e.getOptions().beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(t){let n=t&&t instanceof Mm,a=n?`eventBufferOverflow`:`eventBufferError`,o=nn();if(o){let e=n?`buffer_overflow`:`internal_sdk_error`;o.recordDroppedEvent(e,`replay`)}if(n&&i)return r.clear(),r.waitForCheckout=!0,null;e.handleException(t),await e.stop({reason:a})}}
16function Gm(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=pm(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(Dm&&jm.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function zne(e,t){try{if(typeof t==`function`&&Lne(e))return t(e)}catch(e){return Dm&&jm.exception(e,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Km(e){return!e.type}function qm(e){return e.type===`transaction`}function Bne(e){return e.type===`replay_event`}function Jm(e){return e.type===`feedback`}function Vne(e){return(t,n)=>{if(!e.isEnabled()||!Km(t)&&!qm(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(qm(t)){Hne(e,t);return}Une(e,t)}}}function Hne(e,t){let n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function Une(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!==`buffer`||!t.tags?.replayId)return;let{beforeErrorSampling:r}=e.getOptions();typeof r==`function`&&!r(t)||td(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(t){e.handleException(t)}})}function Wne(e){return t=>{!e.isEnabled()||!Km(t)||Gne(e,t)}}function Gne(e,t){let n=t.exception?.values?.[0]?.value;typeof n==`string`&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))&&hm(e,xm({category:`replay.hydrate-error`,data:{url:We()}}))}function Kne(e){let t=nn();t&&t.on(`beforeAddBreadcrumb`,t=>qne(e,t))}function qne(e,t){if(!e.isEnabled()||!Ym(t))return;let n=Jne(t);n&&hm(e,n)}function Jne(e){return!Ym(e)||[`fetch`,`xhr`,`sentry.event`,`sentry.transaction`].includes(e.category)||e.category.startsWith(`ui.`)?null:e.category===`console`?Yne(e):xm(e)}function Yne(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return xm(e);let n=!1,r=t.map(e=>{if(!e)return e;if(typeof e==`string`)return e.length>wf?(n=!0,`${e.slice(0,wf)}â¦`):e;if(typeof e==`object`)try{let t=kr(e,7);return JSON.stringify(t).length>wf?(n=!0,`${JSON.stringify(t,null,2).slice(0,wf)}â¦`):t}catch{}return e});return xm({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:[`CONSOLE_ARG_TRUNCATED`]}}:{}}})}function Ym(e){return!!e.category}function Xne(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Xm(){let e=Qt().getPropagationContext().dsc;e&&delete e.replay_id;let t=cr();if(t){let e=Sr(t);delete e.replay_id}}function Zne(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:Bp.Custom,timestamp:t.timestamp*1e3,data:{tag:`breadcrumb`,payload:{timestamp:t.timestamp,type:`default`,category:`sentry.feedback`,data:{feedbackId:t.event_id}}}}),!1):!0)}function Qne(e,t){return e.recordingMode!==`buffer`||t.message===hf||!t.exception||t.type?!1:Fm(e.getOptions().errorSampleRate)}function $ne(e){return Object.assign((t,n)=>{if(!e.isEnabled()||e.isPaused())return t;if(Bne(t))return delete t.breadcrumbs,t;if(!Km(t)&&!qm(t)&&!Jm(t))return t;if(!e.checkAndHandleExpiredSession())return Xm(),t;if(Jm(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),Zne(e,t),t;if(Xne(t,n)&&!e.getOptions()._experiments.captureExceptions)return Dm&&jm.log(`Ignoring error from rrweb internals`,t),null;let r=Qne(e,t);if((r||e.recordingMode===`session`)&&(t.tags={...t.tags,replayId:e.getSessionId()}),r&&e.recordingMode===`buffer`&&e.session?.sampled===`buffer`){let t=e.session;t.dirty=!0,e.getOptions().stickySession&&Im(t)}return t},{id:`Replay`})}function Zm(e,t){return t.map(({type:t,start:n,end:r,name:i,data:a})=>{let o=e.throttledAddEvent({type:Bp.Custom,timestamp:n,data:{tag:`performanceSpan`,payload:{op:t,description:i,startTimestamp:n,endTimestamp:r,data:a}}});return typeof o==`string`?Promise.resolve(null):o})}function ere(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:`navigation.push`,start:r,end:r,name:n,data:{previous:t}}}function tre(e){return t=>{if(!e.isEnabled())return;let n=ere(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Zm(e,[n]),!1)))}}function nre(e,t){return Dm&&e.getOptions()._experiments.traceInternals?!1:Fo(t,nn())}function Qm(e,t){e.isEnabled()&&t!==null&&(nre(e,t.name)||e.addUpdate(()=>(Zm(e,[t]),!0)))}function $m(e){if(!e)return;let t=new TextEncoder;try{if(typeof e==`string`)return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){let n=sd(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function eh(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function th(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n={...e._meta};return n.warnings=[...n.warnings||[],t],e._meta=n,e}function nh(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:i,method:a,statusCode:o,request:s,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:i,data:{method:a,statusCode:o,request:s,response:c}}}function rh(e){return{headers:{},size:e,_meta:{warnings:[`URL_SKIPPED`]}}}
16function ih(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:i,warnings:a}=rre(n);return r.body=i,a?.length&&(r._meta={warnings:a}),r}function ah(e,t){return Object.entries(e).reduce((n,[r,i])=>{let a=r.toLowerCase();return t.includes(a)&&e[r]&&(n[a]=i),n},{})}function rre(e){if(!e||typeof e!=`string`)return{body:e};let t=e.length>Cf,n=ire(e);if(t){let t=e.slice(0,Cf);return n?{body:t,warnings:[`MAYBE_JSON_TRUNCATED`]}:{body:`${t}â¦`,warnings:[`TEXT_TRUNCATED`]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function ire(e){let t=e[0],n=e[e.length-1];return t===`[`&&n===`]`||t===`{`&&n===`}`}function oh(e,t){return st(are(e),t)}function are(e,t=ff.document.baseURI){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(ff.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith(`/`)&&r.endsWith(`/`)?r.slice(0,-1):r}async function ore(e,t,n){try{let r=nh(`resource.fetch`,await cre(e,t,n));Qm(n.replay,r)}catch(e){Dm&&jm.exception(e,`Failed to capture fetch breadcrumb`)}}function sre(e,t){let{input:n,response:r}=t,i=$m(n?ld(n):void 0),a=r?eh(r.headers.get(`content-length`)):void 0;i!==void 0&&(e.data.request_body_size=i),a!==void 0&&(e.data.response_body_size=a)}async function cre(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r}=t,{url:o,method:s,status_code:c=0,request_body_size:l,response_body_size:u}=e.data,d=oh(o,n.networkDetailAllowUrls)&&!oh(o,n.networkDetailDenyUrls);return{startTimestamp:i,endTimestamp:a,url:o,method:s,statusCode:c,request:d?lre(n,t.input,l):rh(l),response:await ure(d,n,t.response,u)}}function lre({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let i=n?pre(n,t):{};if(!e)return ih(i,r,void 0);let[a,o]=cd(ld(n),jm),s=ih(i,r,a);return o?th(s,o):s}async function ure(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,i){if(!e&&i!==void 0)return rh(i);let a=r?sh(r.headers,n):{};if(!r||!t&&i!==void 0)return ih(a,i,void 0);let[o,s]=await fre(r),c=dre(o,{networkCaptureBodies:t,responseBodySize:i,captureDetails:e,headers:a});return s?th(c,s):c}function dre(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:i}){try{let a=e?.length&&n===void 0?$m(e):n;return r?t?ih(i,a,e):ih(i,a,void 0):rh(a)}catch(e){return Dm&&jm.exception(e,`Failed to serialize response body`),ih(i,n,void 0)}}async function fre(e){let t=mre(e);if(!t)return[void 0,`BODY_PARSE_ERROR`];try{return[await hre(t)]}catch(e){return e instanceof Error&&e.message.indexOf(`Timeout`)>-1?(Dm&&jm.warn(`Parsing text body from response timed out`),[void 0,`BODY_PARSE_TIMEOUT`]):(Dm&&jm.exception(e,`Failed to get text body from response`),[void 0,`BODY_PARSE_ERROR`])}}function sh(e,t){let n={};return t.forEach(t=>{e.get(t)&&(n[t]=e.get(t))}),n}function pre(e,t){return e.length===1&&typeof e[0]!=`string`?ch(e[0],t):e.length===2?ch(e[1],t):{}}function ch(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?sh(n,t):Array.isArray(n)?{}:ah(n,t):{}}function mre(e){try{return e.clone()}catch(e){Dm&&jm.exception(e,`Failed to clone response body`)}}function hre(e){return new Promise((t,n)=>{let r=td(()=>n(Error(`Timeout while trying to read response body`)),500);gre(e).then(e=>t(e),e=>n(e)).finally(()=>clearTimeout(r))})}async function gre(e){return await e.text()}async function _re(e,t,n){try{let r=nh(`resource.xhr`,yre(e,t,n));Qm(n.replay,r)}catch(e){Dm&&jm.exception(e,`Failed to capture xhr breadcrumb`)}}function vre(e,t){let{xhr:n,input:r}=t;if(!n)return;let i=$m(r),a=n.getResponseHeader(`content-length`)?eh(n.getResponseHeader(`content-length`)):Sre(n.response,n.responseType);i!==void 0&&(e.data.request_body_size=i),a!==void 0&&(e.data.response_body_size=a)}function yre(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r,input:o,xhr:s}=t,{url:c,method:l,status_code:u=0,request_body_size:d,response_body_size:f}=e.data;if(!c)return null;if(!s||!oh(c,n.networkDetailAllowUrls)||oh(c,n.networkDetailDenyUrls))return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:rh(d),response:rh(f)};let p=s[nd],m=p?ah(p.request_headers,n.networkRequestHeaders):{},h=ah(ud(s),n.networkResponseHeaders),[g,_]=n.networkCaptureBodies?cd(o,jm):[void 0],[v,y]=n.networkCaptureBodies?bre(s):[void 0],b=ih(m,d,g),x=ih(h,f,v);return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:_?th(b,_):b,response:y?th(x,y):x}}function bre(e){let t=[];try{return[e.responseText]}catch(e){t.push(e)}try{return xre(e.response,e.responseType)}catch(e){t.push(e)}return Dm&&jm.warn(`Failed to get xhr response body`,...t),[void 0]}function xre(e,t){try{if(typeof e==`string`)return[e];if(e instanceof Document)return[e.body.outerHTML];if(t===`json`&&e&&typeof e==`object`)return[JSON.stringify(e)];if(!e)return[void 0]}catch(t){return Dm&&jm.exception(t,`Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return Dm&&jm.log(`Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function Sre(e,t){try{return $m(t===`json`&&e&&typeof e==`object`?JSON.stringify(e):e)}catch{return}}function Cre(e){let t=nn();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o}=e.getOptions(),s={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o};t&&t.on(`beforeAddBreadcrumb`,(e,t)=>wre(s,e,t))}catch{}}function wre(e,t,n){if(t.data)try{Tre(t)&&Dre(n)&&(vre(t,n),_re(t,n,e)),Ere(t)&&Ore(n)&&(sre(t,n),ore(t,n,e))}catch(e){Dm&&jm.exception(e,`Error when enriching network breadcrumb`)}}function Tre(e){return e.category===`xhr`}function Ere(e){return e.category===`fetch`}function Dre(e){return e?.xhr}function Ore(e){return e?.response}function kre(e){let t=nn();Hu(one(e)),Yu(tre(e)),Kne(e),Cre(e),_a($ne(e)),t&&(t.on(`beforeSendEvent`,Wne(e)),t.on(`afterSendEvent`,Vne(e)),t.on(`createDsc`,t=>{let n=e.getSessionId();n&&e.isEnabled()&&e.recordingMode===`session`&&e.checkAndHandleExpiredSession()&&(t.replay_id=n)}),t.on(`spanStart`,t=>{e.lastActiveSpan=t}),t.on(`spanEnd`,t=>{e.lastActiveSpan=t}),t.on(`beforeSendFeedback`,async(t,n)=>{let r=e.getSessionId();n?.includeReplay&&e.isEnabled()&&r&&t.contexts?.feedback&&(t.contexts.feedback.source===`api`&&await e.sendBufferedReplayOrFlush(),t.contexts.feedback.replay_id=r)}),t.on(`openFeedbackWidget`,async()=>{await e.sendBufferedReplayOrFlush()}))}async function Are(e){try{return Promise.all(Zm(e,[jre(ff.performance.memory)]))}catch{return[]}}function jre(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,i=Date.now()/1e3;return{type:`memory`,name:`memory`,start:i,end:i,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Mre(e,t,n){return Wo(e,t,{...n,setTimeoutImpl:td})}var lh=S.navigator;function Nre(){return/iPhone|iPad|iPod/i.test(lh?.userAgent??``)||/Macintosh/i.test(lh?.userAgent??``)&&lh?.maxTouchPoints&&lh?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function Pre(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){Dm&&jm.warn(`Received replay event after session expired.`);return}let i=r||!t;t=!0,Fre(n),e.clickDetector&&tne(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode===`buffer`&&i&&e.setInitialState(),!Um(e,n,i)
16)return!0;if(!i)return!1;let t=e.session;if(Lre(e,i),e.recordingMode===`buffer`&&t&&e.eventBuffer&&!t.dirty){let n=e.eventBuffer.getEarliestTimestamp();n&&(Dm&&jm.log(`Updating session start time to earliest event in buffer to ${new Date(n)}`),t.started=n,e.getOptions().stickySession&&Im(t))}return t?.previousSessionId||e.recordingMode===`session`&&e.flush(),!0})}}function Fre(e){let t=e.data;if(!(e.type!==Bp.IncrementalSnapshot||!t||typeof t!=`object`||!(`source`in t)||t.source!==Vp.Mutation||!(`attributes`in t)||!Array.isArray(t.attributes)))for(let e of t.attributes){let t=fm.mirror.getNode(e.id),n=t&&fm.mirror.getMeta(t);if(n?.type===Sm.Element)for(let[t,r]of Object.entries(e.attributes))r===null?delete n.attributes[t]:n.attributes[t]=r}}function Ire(e){let t=e.getOptions();return{type:Bp.Custom,timestamp:Date.now(),data:{tag:`options`,payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type===`worker`:!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function Lre(e,t){!t||e.session?.segmentId!==0||Um(e,Ire(e),!1)}function Rre(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function zre(e,t,n,r){return Lr(Xr(e,Yr(e),r,n),[[{type:`replay_event`},e],[{type:`replay_recording`,length:typeof t==`string`?new TextEncoder().encode(t).length:t.length},t]])}function Bre({recordingData:e,headers:t}){let n,r=`${JSON.stringify(t)} 17`;if(typeof e==`string`)n=`${r}${e}`;else{let t=new TextEncoder().encode(r);n=new Uint8Array(t.length+e.length),n.set(t),n.set(e,t.length)}return n}async function Vre({client:e,scope:t,replayId:n,event:r}){let i={event_id:n,integrations:typeof e._integrations==`object`&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0};e.emit(`preprocessEvent`,r,i);let a=await ea(e.getOptions(),r,i,t,e,$t());if(!a)return null;e.emit(`postprocessEvent`,a,i),a.platform=a.platform||`javascript`;let{name:o,version:s,settings:c}=e.getSdkMetadata()?.sdk||{};return a.sdk={...a.sdk,name:o||`sentry.javascript.unknown`,version:s||`0.0.0`,settings:c},a}async function Hre({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:i,session:a}){let o=Bre({recordingData:e,headers:{segment_id:n}}),{urls:s,errorIds:c,traceIds:l,initialTimestamp:u}=r,d=nn(),f=Qt(),p=d?.getTransport(),m=d?.getDsn();if(!d||!p||!m||!a.sampled)return Promise.resolve({});let h=await Vre({scope:f,client:d,replayId:t,event:{type:mf,replay_start_timestamp:u/1e3,timestamp:i/1e3,error_ids:c,trace_ids:l,urls:s,replay_id:t,segment_id:n,replay_type:a.sampled}});if(!h)return d.recordDroppedEvent(`event_processor`,`replay`),Dm&&jm.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete h.sdkProcessingMetadata;let g=zre(h,o,m,d.getOptions().tunnel),_;try{_=await p.send(g)}catch(e){let t=Error(hf);try{t.cause=e}catch{}throw t}let v=Za({},_);if(Xa(v,`replay`))throw new dh(v);if(typeof _.statusCode==`number`&&(_.statusCode<200||_.statusCode>=300))throw new uh(_.statusCode);return _}var uh=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},dh=class extends Error{constructor(e){super(`Rate limit hit`),this.rateLimits=e}},fh=class extends Error{constructor(){super(`Session is too long, not sending replay`)}};async function ph(e,t={count:0,interval:xf}){let{recordingData:n,onError:r}=e;if(n.length)try{return await Hre(e),!0}catch(n){if(n instanceof uh||n instanceof dh)throw n;if(ma(`Replays`,{_retryCount:t.count}),r&&r(n),t.count>=Sf){let e=Error(`${hf} - max retries exceeded`);try{e.cause=n}catch{}throw e}return t.interval*=++t.count,new Promise((n,r)=>{td(async()=>{try{await ph(e,t),n(!0)}catch(e){r(e)}},t.interval)})}}var mh=`__THROTTLED`,Ure=`__SKIPPED`;function Wre(e,t,n){let r=new Map,i=e=>{let t=e-n;r.forEach((e,n)=>{n<t&&r.delete(n)})},a=()=>[...r.values()].reduce((e,t)=>
17e+t,0),o=!1;return(...n)=>{let s=Math.floor(Date.now()/1e3);if(i(s),a()>=t){let e=o;return o=!0,e?Ure:mh}o=!1;let c=r.get(s)||0;return r.set(s,c+1),e(...n)}}var Gre=class{constructor({options:e,recordingOptions:t}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode=`session`,this.timeouts={sessionIdlePause:gf,sessionIdleExpire:_f},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:``},this._recordingOptions=t,this._options=e,this._debouncedFlush=Mre(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Wre((e,t)=>Rne(this,e,t),300,5);let{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),i=n?{threshold:Math.min(Tf,n),timeout:n,scrollTimeout:Ef,ignoreSelector:r?r.join(`,`):``}:void 0;if(i&&(this.clickDetector=new Zte(this,i)),Dm){let t=e._experiments;jm.setConfig({captureExceptions:!!t.captureExceptions,traceInternals:!!t.traceInternals})}this._handleVisibilityChange=()=>{ff.document.visibilityState===`visible`?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let e=xm({category:`ui.blur`});this._doChangeToBackgroundTasks(e)},this._handleWindowFocus=()=>{let e=xm({category:`ui.focus`});this._doChangeToForegroundTasks(e)},this._handleKeyboardEvent=e=>{une(this,e)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){Dm&&jm.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){let{errorSampleRate:t,sessionSampleRate:n}=this._options,r=t<=0&&n<=0;if(this._requiresManualStart=r,!r){if(this._initializeSessionForSampling(e),!this.session){Dm&&jm.exception(Error(`Unable to initialize and create session`));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled===`buffer`&&this.session.segmentId===0?`buffer`:`session`,Dm&&jm.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode===`session`){Dm&&jm.log(`Recording is already in progress`);return}if(this._isEnabled&&this.recordingMode===`buffer`){Dm&&jm.log("Buffering is in progress, call `flush()` to save the replay");return}Dm&&jm.infoTick(`Starting replay in session mode`),this._updateUserActivity(),this.session=Hm({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1}),this.recordingMode=`session`,this._initializeRecording()}startBuffering(){if(this._isEnabled){Dm&&jm.log("Buffering is in progress, call `flush()` to save the replay");return}Dm&&jm.infoTick(`Starting replay in buffer mode`),this.session=Hm({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0}),this.recordingMode=`buffer`,this._initializeRecording()}startRecording(){try{let e=this._canvas;this._stopRecording=fm({...this._recordingOptions,...this.recordingMode===`buffer`?{checkoutEveryNms:bf}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:Pre(this),...Nre(),onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&=(this._stopRecording(),void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode=`buffer`;let n=t??`manual`;nn()?.emit(`replayEnd`,{sessionId:this.session?.id,reason:n});try{Dm&&jm.log(`Stopping Replay triggered by ${n}`),Xm(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,Nne(this)}catch(e){this.handleException(e)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Dm&&jm.log(`Pausing replay`))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Dm&&jm.log(`Resuming replay`))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode===`session`)return this.flushImmediate();let t=Date.now();
17Dm&&jm.log(`Converting buffer to session`),await this.flushImmediate();let n=this.stopRecording();!e||!n||this.recordingMode!==`session`&&(this.recordingMode=`session`,this.session&&(this.session.dirty=!1,this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession()),this.startRecording())}addUpdate(e){let t=e();this.recordingMode===`buffer`||!this._isEnabled||t!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode===`buffer`?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(e){if(!(e&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&zm(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled===`session`){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${ff.location.pathname}${ff.location.hash}${ff.location.search}`,t=`${ff.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){let n=this._throttledAddEvent(e,t);if(n===mh){let e=xm({category:`replay.throttled`});this.addUpdate(()=>!Um(this,{type:Wte,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e,metric:!0}}))}return n}getCurrentRoute(){let e=this.lastActiveSpan||cr(),t=e&&or(e),n=(t&&qn(t).data||{})[an];if(!(!t||!n||![`route`,`custom`].includes(n)))return qn(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Ane({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&nn()?.emit(`replayStart`,{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording()}_initializeSessionForSampling(e){let t=this._options.errorSampleRate>0;this.session=Hm({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t})}_checkSession(){if(!this.session)return!1;let e=this.session;return Vm(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(e),!1):!0}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:`sessionExpired`}),this.initializeSampling(e.id))}_addListeners(){try{ff.document.addEventListener(`visibilitychange`,this._handleVisibilityChange),ff.addEventListener(`blur`,this._handleWindowBlur),ff.addEventListener(`focus`,this._handleWindowFocus),ff.addEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||=(kre(this),!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=Cne(this)}_removeListeners(){try{ff.document.removeEventListener(`visibilitychange`,this._handleVisibilityChange),ff.removeEventListener(`blur`,this._handleWindowBlur),ff.removeEventListener(`focus`,this._handleWindowFocus),ff.removeEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){this.session&&(Bm(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush()))}_doChangeToForegroundTasks(e){if(this.session){if(!this.checkAndHandleExpiredSession()){Dm&&jm.log(`Document has become active, but session has expired`);return}e&&this._createCustomBreadcrumb(e)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:Bp.Custom,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e}})})}_addPerformanceEntries(){let e=mne(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let t=this._context.
17initialTimestamp/1e3;e=e.filter(e=>e.start>=t)}return Promise.all(Zm(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart||e.segmentId)return;let n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){let e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){let e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){Dm&&jm.error(`No session or eventBuffer found to flush.`);return}if(await this._addPerformanceEntries(),this.eventBuffer?.hasEvents&&(await Are(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new fh;let n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession(),await ph({replayId:e,recordingData:await this.eventBuffer.finish(),segmentId:r,eventContext:n,session:this.session,timestamp:t,onError:e=>this.handleException(e)})}catch(e){this.handleException(e),this.stop({reason:`sendError`});let t=nn();if(t){let n;n=e instanceof dh?`ratelimit_backoff`:e instanceof fh?`invalid`:`send_error`,t.recordDroppedEvent(n,`replay`)}}}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){Dm&&jm.error(`Attempting to finish replay event after session expired.`);return}if(!this.session)return;let t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();let r=n<this._options.minReplayDuration,i=n>this._options.maxReplayDuration+5e3;if(r||i){Dm&&jm.log(`Session duration (${Math.floor(n/1e3)}s) is too ${r?`short`:`long`}, not sending replay.`),r&&this._debouncedFlush();return}let a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&Dm&&jm.log(`Flushing initial segment without checkout.`);let o=!!this._flushLock;this._flushLock||=this._runFlush();try{await this._flushLock}catch(e){this.handleException(e)}finally{this._flushLock=void 0,o&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Im(this.session)}_onMutationHandler(e){let{ignoreMutations:t}=this._options._experiments;if(t?.length&&e.some(e=>{let n=Rre(e.target),r=t.join(`,`);return n?.matches(r)}))return!1;let n=e.length,r=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,a=r&&n>r;if(n>i||a){let e=xm({category:`replay.mutations`,data:{count:n,limit:a}});this._createCustomBreadcrumb(e)}return a?(this.stop({reason:`mutationLimit`,forceFlush:this.recordingMode===`session`}),!1):!0}};function hh(e,t){return[...e,...t].join(`,`)}function Kre({mask:e,unmask:t,block:n,unblock:r,ignore:i}){return{maskTextSelector:hh(e,[`.sentry-mask`,`[data-sentry-mask]`]),unmaskTextSelector:hh(t,[]),blockSelector:hh(n,[`.sentry-block`,`[data-sentry-block]`,...[`base`,`iframe[srcdoc]:not([src])`]]),unblockSelector:hh(r,[]),ignoreSelector:hh(i,[`.sentry-ignore`,`[data-sentry-ignore]`,`input[type="file"]`])}}function qre({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:i,value:a}){if(i.unmaskTextSelector&&e.matches(i.unmaskTextSelector))return a;let o=n.includes(t),s=r&&t===`value`&&e.tagName===`INPUT`&&[`submit`,`button`].includes(e.getAttribute(`type`)||``);return o||s?a.replace(/[\S]/g,`*`):a}var gh=`img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]`,Jre=[`content-length`,`content-type`,`accept`],Yre=Symbol.for(`sentry__originalRequestBody`),_h=!1,vh=!1;function Xre(){if(typeof Request>`u`||vh)return;let e=Request;try{let t=function(t,n){let r=new e(t,n);return n?.body!=null&&(r[Yre]=n.body),r};t.prototype=e.prototype,S.Request=t,vh=!0}catch{}}var Zre=(e=>new Qre(e)),Qre=class{constructor({flushMinDelay:e=vf,flushMaxDelay:t=yf,minReplayDuration:n=Of,maxReplayDuration:r=Af,stickySession:i=!0,useCompression:a=!0,workerUrl:o,_experiments:s={},maskAllText:c=!0,maskAllInputs:l=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:d=750,mutationLimit:f=1e4,slowClickTimeout:p=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:h=[],networkDetailDenyUrls:g=[],networkCaptureBodies:_=!0,networkRequestHeaders:v=[],networkResponseHeaders:y=[],mask:b=[],maskAttributes:x=[`title`,`placeholder`,`aria-label`],unmask:S=[],block:C=[],unblock:w=[],ignore:T=[],maskFn:E,beforeAddRecordingEvent:D,beforeErrorSampling:O,onError:k,attachRawBodyFromRequest:A=!1}={}){this.name=`Replay`;let j=Kre({mask:b,unmask:S,block:C,unblock:w,ignore:T});if(this._recordingOptions={maskAllInputs:l,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:E,maskInputFn:E,maskAttributeFn:(e,t,n)=>qre({maskAttributes:x,maskAllText:c,privacyOptions:j,key:e,value:t,el:n}),...j,slimDOMOptions:`all`,inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!s.recordCrossOriginIframes},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,kf),maxReplayDuration:Math.min(r,Af),stickySession:i,useCompression:a,workerUrl:o,blockAllMedia:u,maskAllInputs:l,maskAllText:c,mutationBreadcrumbLimit:d,mutationLimit:f,slowClickTimeout:p,slowClickIgnoreSelectors:m,networkDetailAllowUrls:h,networkDetailDenyUrls:g,networkCaptureBodies:_,networkRequestHeaders:yh(v),networkResponseHeaders:yh(y),beforeAddRecordingEvent:D,beforeErrorSampling:O,onError:k,attachRawBodyFromRequest:A,_experiments:s},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${gh}`:gh,this._recordingOptions.ignoreCSSAttributes=new Set([`background-image`])),this._isInitialized&&Ls())throw Error(`Multiple Sentry Session Replay instances are not supported`);this._isInitialized=!0}get _isInitialized(){return _h}set _isInitialized(e){_h=e}afterAllSetup(e){!Ls()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&Xre(),this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}
17startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode===`session`,reason:`manual`}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){this._replay=new Gre({options:$re(this._initialOptions,e),recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{let t=e.getIntegrationByName(`ReplayCanvas`);if(!t)return;this._replay._canvas=t.getOptions()}catch{}}};function $re(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},i=Nn(n.replaysSessionSampleRate),a=Nn(n.replaysOnErrorSampleRate);return i==null&&a==null&&A(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),i!=null&&(r.sessionSampleRate=i),a!=null&&(r.errorSampleRate=a),r}function yh(e){return[...Jre,...e.map(e=>e.toLowerCase())]}function eie(e){return e.split(`,`).some(e=>e.trim().startsWith(`sentry-`))}function bh(e){try{return new URL(e,Qs.location.origin).href}catch{return}}function tie(e){return e.entryType===`resource`&&`initiatorType`in e&&typeof e.nextHopProtocol==`string`&&(e.initiatorType===`fetch`||e.initiatorType===`xmlhttprequest`)}function xh(e){try{return new Headers(e)}catch{return}}var Sh=new WeakMap,Ch=new Map,wh={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function nie(e,t){let{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:a,enableHTTPTimings:o,tracePropagationTargets:s,onRequestSpanStart:c,onRequestSpanEnd:l}={...wh,...t},u=typeof a==`function`?a:e=>!0,d=e=>iie(e,s),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(e=>(e.type===`transaction`&&e.spans&&e.spans.forEach(e=>{if(e.op===`http.client`){let t=Ch.get(e.span_id);t&&(e.timestamp=t/1e3,Ch.delete(e.span_id))}}),e)),i&&Gs(e=>{if(e.response){let t=Sh.get(e.response);t&&e.endTimestamp&&Ch.set(t,e.endTimestamp)}}),Ws(t=>{let n=Ds(t,u,d,f,{propagateTraceparent:p,onRequestSpanEnd:l});if(t.response&&t.fetchData.__span&&Sh.set(t.response,t.fetchData.__span),n){let r=bh(t.fetchData.url),i=r?Mo(r).host:void 0;n.setAttributes({"http.url":r?Po(r):void 0,"server.address":i}),o&&Th(n,e),c?.(n,{headers:t.headers})}})),r&&rd(t=>{let n=aie(t,u,d,f,p,l);n&&(o&&Th(n,e),c?.(n,{headers:xh(t.xhr.__sentry_xhr_v3__?.request_headers)}))})}var rie=300;function Th(e,t){let{url:n}=qn(e).data;if(!n||typeof n!=`string`)return;let r=()=>void setTimeout(i);if(ai(t)){let t=e.end.bind(e);e.end=e=>{let n=e??xt(),a=!1,o=()=>{a||(a=!0,setTimeout(i),t(n),clearTimeout(s))};r=o;let s=setTimeout(o,rie)}}let i=El(`resource`,({entries:t})=>{t.forEach(t=>{tie(t)&&t.name.endsWith(n)&&(e.setAttributes(Ql(t)),r())})})}function iie(e,t){let n=We();if(n){let r,i;try{r=new URL(e,n),i=new URL(n).origin}catch{return!1}let a=r.origin===i;return t?st(r.toString(),t)||a&&st(r.pathname,t):a}else{let n=!!e.match(/^\/(?!\/)/);return t?st(e,t):n}}function aie(e,t,n,r,i,a){let o=e.xhr,s=o?.[nd];if(!o||o.__sentry_own_request__||!s)return;let{url:c,method:l}=s,u=fr()&&t(c);if(e.endTimestamp){let t=o.__sentry_xhr_span_id__;if(!t)return;let n=r[t];n&&(u&&s.status_code!==void 0&&(yn(n,s.status_code),n.end(),a?.(n,{headers:xh(ud(o)),error:e.error})),delete r[t]);return}let d=bh(c),f=Mo(d||c),p=Po(No(c)),m=nn(),h=!!cr(),g=u&&h?mi({name:`${l} ${p}`,attributes:{url:Po(c),type:`xhr`,"http.method":l,"http.url":d?Po(d):void 0,"server.address":f?.host,[ln]:`auto.http.browser`,[cn]:`http.client`,...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new Cr;return u&&!h&&m?.recordDroppedEvent(`no_parent_span`,`span`),o.__sentry_xhr_span_id__=g.spanContext().spanId,r[o.__sentry_xhr_span_id__]=g,n(c)&&oie(o,fr()&&h?g:void 0,i),m&&m.emit(`beforeOutgoingRequestSpan`,g,e),g}function oie(e,t,n){let{"sentry-trace":r,baggage:i,traceparent:a}=Vo({span:t,propagateTraceparent:n});r&&sie(e,r,i,a)}function sie(e,t,n,r){let i=e.__sentry_xhr_v3__?.request_headers;if(!(i?.[`sentry-trace`]||!e.setRequestHeader))try{if(e.setRequestHeader(`sentry-trace`,t),r&&!i?.traceparent&&e.setRequestHeader(`traceparent`,r),n){let t=i?.baggage;(!t||!eie(t))&&e.setRequestHeader(`baggage`,n)}}catch{}}function cie(){Qs.document?Qs.document.addEventListener(`visibilitychange`,()=>{let e=cr();if(!e)return;let t=or(e);if(Qs.document.hidden&&t){let e=`cancelled`,{op:n,status:r}=qn(t);pd&&R.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus({code:2,message:e}),t.setAttribute(`sentry.cancellation_reason`,`document.hidden`),t.end()}}):pd&&R.warn(`[Tracing] Could not set up background tab detection due to lack of global document`)}var Eh=`sentry_previous_trace`,lie=`sentry.previous_trace`;function uie(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t===`session-storage`,i=r?pie():void 0;e.on(`spanStart`,e=>{if(or(e)!==e)return;let t=Qt().getPropagationContext();i=die(i,e,t),r&&fie(i)});let a=!0;n&&e.on(`beforeSampling`,e=>{if(!i)return;let t=Qt(),n=t.getPropagationContext();if(a&&n.parentSpanId){a=!1;return}t.setPropagationContext({...n,dsc:{...n.dsc,sample_rate:String(i.sampleRate),sampled:String(Dh(i.spanContext))},sampleRand:i.sampleRand}),e.parentSampled=Dh(i.spanContext),e.parentSampleRate=i.sampleRate,e.spanAttributes={...e.spanAttributes,[sn]:i.sampleRate}})}function die(e,t,n){let r=qn(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[`sentry.sample_rate`])}catch{return 0}}let a={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;let o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(pd&&R.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[gn]:`previous_trace`}}),t.setAttribute(lie,`${o.traceId}-${o.spanId}-${Dh(o)?1:0}`)),a)}function fie(e){try{Qs.sessionStorage.setItem(Eh,JSON.stringify(e))}catch(e){pd&&R.warn(`Could not store previous trace in sessionStorage`,e)}}function pie(){try{let e=Qs.sessionStorage?.getItem(Eh);return JSON.parse(e)}catch{return}}function Dh(e){return e.traceFlags===1}var mie=`BrowserTracing`,hie=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function gie(){let e=Qs.navigator;return e?.userAgent?hie.test(e.userAgent):!1}var _ie={...wi,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroun
17dSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:`in-memory`,consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...wh},vie=((e={})=>{`enableElementTiming`in e&&A(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=Qs.document,{enableInp:r,enableLongTask:i,enableLongAnimationFrame:a,_experiments:{enableInteractions:o,enableStandaloneClsSpans:s,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:u,finalTimeout:d,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:m,traceXHR:h,trackFetchStreamPerformance:g,shouldCreateSpanForRequest:_,enableHTTPTimings:v,ignoreResourceSpans:y,ignorePerformanceApiSpans:b,instrumentPageLoad:x,instrumentNavigation:C,detectRedirects:w,linkPreviousTrace:T,consistentTraceSampling:E,enableReportPageLoaded:D,onRequestSpanStart:O,onRequestSpanEnd:k}={..._ie,...e},j=gie(),M,N,P;function F(e,r,i=!0){let a=r.op===`pageload`,o=r.name,p=l?l(r):r,m=p.attributes||{};if(o!==p.name&&(m[an]=`custom`,p.attributes=m),!i){let e=vt();mi({...p,startTime:e}).end(e);return}t.name=p.name,t.source=m[an];let h=ki(p,{idleTimeout:u,finalTimeout:d,childSpanTimeout:f,disableAutoFinish:a,beforeSpanEnd:t=>{M?.();let n=ai(e);fu(t,{recordClsOnPageloadSpan:!n&&!s,recordLcpOnPageloadSpan:!n&&!c,ignoreResourceSpans:y,ignorePerformanceApiSpans:b,spanStreamingEnabled:n}),Mh(e,void 0);let r=Qt(),i=r.getPropagationContext();r.setPropagationContext({...i,traceId:h.spanContext().traceId,sampled:Qn(h),dsc:Sr(t)}),a&&(P=void 0)},trimIdleSpanEndTimestamp:!D});a&&D&&(P=h),Mh(e,h);function g(){n&&[`interactive`,`complete`].includes(n.readyState)&&e.emit(`idleSpanEnableAutoFinish`,h)}a&&!D&&n&&(n.addEventListener(`readystatechange`,()=>{g()}),g())}return{name:mie,setup(e){if(j){pd&&R.log(`[Tracing] Skipping browserTracingIntegration setup for bot user agent.`);return}dr();let t=ai(e);if(M=au({recordClsStandaloneSpans:t?void 0:s||!1,recordLcpStandaloneSpans:t?void 0:c||!1,client:e}),t?(Fu(e),Lu(e),r&&Ru()):r&&Ou(),a&&S.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes(`long-animation-frame`)?su():i&&ou(),o&&cu(),w&&n){let e=()=>{N=xt()};addEventListener(`click`,e,{capture:!0}),addEventListener(`keydown`,e,{capture:!0,passive:!0})}function l(){let t=jh(e);t&&!qn(t).timestamp&&(pd&&R.log(`[Tracing] Finishing current active span with op: ${qn(t).op}`),t.setAttribute(un,`cancelled`),t.end())}e.on(`startNavigationSpan`,(t,n)=>{if(nn()!==e)return;if(n?.isRedirect){pd&&R.warn(`[Tracing] Detected redirect, navigation span will not be the root span, but a child span.`),F(e,{op:`navigation.redirect`,...t},!1);return}N=void 0,l(),$t().setPropagationContext({traceId:At(),sampleRand:Math.random(),propagationSpanId:fr()?void 0:jt()});let r=Qt();r.setPropagationContext({traceId:At(),sampleRand:Math.random(),propagationSpanId:fr()?void 0:jt()}),r.setSDKProcessingMetadata({normalizedRequest:void 0}),F(e,{op:`navigation`,...t,parentSpan:null,forceTransaction:!0})}),e.on(`startPageLoadSpan`,(t,n={})=>{if(nn()!==e)return;l();let r=dee(n.sentryTrace||Oh(`sentry-trace`)||kh(`sentry-trace`),n.baggage||Oh(`baggage`)||kh(`baggage`)),i=Qt();i.setPropagationContext(r),fr()||(i.getPropagationContext().propagationSpanId=jt()),i.setSDKProcessingMetadata({normalizedRequest:rc()}),F(e,{op:`pageload`,...t})}),e.on(`endPageloadSpan`,()=>{D&&P&&(P.setAttribute(un,`reportPageLoaded`),P.end())})},afterAllSetup(e){if(j)return;let n=We();if(T!==`off`&&uie(e,{linkPreviousTrace:T,consistentTraceSampling:E}),Qs.location){if(x){let t=wt();yie(e,{name:Qs.location.pathname,startTime:t?t/1e3:void 0,attributes:{[an]:`url`,[ln]:`auto.pageload.browser`}})}C&&Yu(({to:t,from:r})=>{if(r===void 0&&n?.indexOf(t)!==-1){n=void 0;return}n=void 0;let i=Ao(t),a=jh(e),o=a&&w&&Sie(a,N);bie(e,{name:i?.pathname||Qs.location.pathname,attributes:{[an]:`url`,[ln]:`auto.navigation.browser`}},{url:t,isRedirect:o})})}p&&cie(),o&&xie(e,u,d,f,t),r&&Nu(),nie(e,{traceFetch:m,traceXHR:h,trackFetchStreamPerformance:g,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:_,enableHTTPTimings:v,onRequestSpanStart:O,onRequestSpanEnd:k})}}});function yie(e,t,n){e.emit(`startPageLoadSpan`,t,n),Qt().setTransactionName(t.name);let r=jh(e);return r&&e.emit(`afterStartPageLoadSpan`,r),r}function bie(e,t,n){let{url:r,isRedirect:i}=n||{};e.emit(`beforeStartNavigationSpan`,t,{isRedirect:i}),e.emit(`startNavigationSpan`,t,{isRedirect:i});let a=Qt();return a.setTransactionName(t.name),r&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...rc(),url:r}}),jh(e)}function Oh(e){return(Qs.document?.querySelector(`meta[name=${e}]`))?.getAttribute(`content`)||void 0}function kh(e){return(Qs.performance?.getEntriesByType?.(`navigation`)[0])?.serverTiming?.find(t=>t.name===e)?.description}function xie(e,t,n,r,i){let a=Qs.document,o;a&&addEventListener(`click`,()=>{let a=`ui.action.click`,s=jh(e);if(s){let e=qn(s).op;if([`navigation`,`pageload`].includes(e)){pd&&R.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&=(o.setAttribute(un,`interactionInterrupted`),o.end(),void 0),!i.name){pd&&R.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}
17o=ki({name:i.name,op:a,attributes:{[an]:i.source||`url`}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})},{capture:!0})}var Ah=`_sentry_idleSpan`;function jh(e){return e[Ah]}function Mh(e,t){qe(e,Ah,t)}var Nh=1.5;function Sie(e,t){let n=qn(e),r=vt();return!(r-n.start_timestamp>Nh||t&&r-t<=Nh)}var B=m();function Cie(e){let t={...e};return Bo(t,`react`),ma(`react`,{version:B.version}),uf(t)}function wie(e){let t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function Tie(e,t){let n=new WeakSet;function r(e,t){if(!n.has(e)){if(e.cause)return n.add(e),r(e.cause,t);e.cause=t}}r(e,t)}function Eie(e,{componentStack:t},n){if(wie(B.version)&&Ce(e)&&t){let n=Error(e.message);n.name=`React ErrorBoundary ${e.name}`,n.stack=t,Tie(e,n)}return tn(r=>(r.setContext(`react`,{componentStack:t}),da(e,n)))}var Die=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Ph={componentStack:null,error:null,eventId:null},Oie=class extends B.Component{constructor(e){super(e),this.state=Ph,this._openFallbackReportDialog=!0;let t=nn();t&&e.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=t.on(`afterSendEvent`,t=>{!t.type&&this._lastEventId&&t.event_id===this._lastEventId&&df({...e.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(e,t){let{componentStack:n}=t,{beforeCapture:r,onError:i,showDialog:a,dialogOptions:o}=this.props;tn(s=>{r&&r(s,e,n);let c=Eie(e,t,{mechanism:{handled:this.props.handled==null?!!this.props.fallback:this.props.handled,type:`auto.function.react.error_boundary`}});i&&i(e,n,c),a&&(this._lastEventId=c,this._openFallbackReportDialog&&df({...o,eventId:c})),this.setState({error:e,componentStack:n,eventId:c})})}componentDidMount(){let{onMount:e}=this.props;e&&e()}componentWillUnmount(){let{error:e,componentStack:t,eventId:n}=this.state,{onUnmount:r}=this.props;r&&(this.state===Ph?r(null,null,null):r(e,t,n)),this._cleanupHook&&=(this._cleanupHook(),void 0)}resetErrorBoundary(){let{onReset:e}=this.props,{error:t,componentStack:n,eventId:r}=this.state;e&&e(t,n,r),this.setState(Ph)}render(){let{fallback:e,children:t}=this.props,n=this.state;if(n.componentStack===null)return typeof t==`function`?t():t;let r=typeof e==`function`?B.createElement(e,{error:n.error,componentStack:n.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:n.eventId}):e;return B.isValidElement(r)?r:(e&&Die&&R.warn(`fallback did not produce a valid ReactElement`),null)}},kie=b(),Fh=e=>typeof e==`string`,Ih=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Lh=e=>e==null?``:String(e),Aie=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},jie=/###/g,Rh=e=>e&&e.includes(`###`)?e.replace(jie,`.`):e,zh=e=>!e||Fh(e),Bh=(e,t,n)=>{let r=Fh(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(zh(e))return{};let t=Rh(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return zh(e)?{}:{obj:e,k:Rh(r[i])}},Vh=(e,t,n)=>{let{obj:r,k:i}=Bh(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=Bh(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Bh(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Mie=(e,t,n,r)=>{let{obj:i,k:a}=Bh(e,t,Object);i[a]=i[a]||[],i[a].push(n)},Hh=(e,t)=>{let{obj:n,k:r}=Bh(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Nie=(e,t,n)=>{let r=Hh(e,n);return r===void 0?Hh(t,n):r},Uh=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?Fh(e[r])||e[r]instanceof String||Fh(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Uh(e[r],t[r],n):e[r]=t[r]);return e},Wh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Pie={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},Fie=e=>Fh(e)?e.replace(/[&<>"'\/]/g,e=>Pie[e]):e,Iie=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Lie=[` `,`,`,`?`,`!`,`;`],Rie=new Iie(20),zie=(e,t,n)=>{t||=``,n||=``;let r=Lie.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=Rie.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);
vendor: 25,337 bytes, line 17
17if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},Gh=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},Kh=e=>e?.replace(/_/g,`-`),Bie={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},qh=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Bie,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>Fh(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),Fh(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},Jh=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},Yh=class extends Jh{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Fh(n)&&i?o.push(...n.split(i)):o.push(n)));let s=Hh(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!Fh(n)?s:Gh(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Vh(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(Fh(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=Hh(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Uh(s,n,i):s={...s,...n},Vh(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Xh={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},Zh=Symbol(`i18next/PATH_KEY`);function Vie(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===Zh?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Qh(e,t){let{[Zh]:n}=e(Vie()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var $h=e=>!Fh(e)&&typeof e!=`boolean`&&typeof e!=`number`,eg=class e extends Jh{constructor(e,t={}){super(),Aie([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=qh.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=$h(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!zie(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Fh(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:Fh(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=Qh(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?Qh(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!Fh(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=$h(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&!_.includes(O)&&!(Fh(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:$h(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&Fh(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,b&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=Fh(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!Fh(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=Fh(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Xh.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return Fh(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?Qh(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!Fh(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(Fh(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!Fh(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},tg=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=qh.create(`languageUtils`)}getScriptPartFromCode(e){if(e=Kh(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=Kh(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Fh(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),Fh(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Fh(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):Fh(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},ng={zero:0,one:1,two:2,few:3,many:4,other:5},rg={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},Hie=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=qh.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=Kh(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),rg;if(!e.match(/-|_/))return rg;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>ng[e]-ng[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},ig=(e,t,n,r=`.`,i=!0)=>{let a=Nie(e,t,n);return!a&&i&&Fh(n)&&(a=Gh(e,n,r),a===void 0&&(a=Gh(t,n,r))),a},ag=e=>e.replace(/\$/g,`$$$$`),og=class{constructor(e={}){this.logger=qh.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Fie:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?Wh(i):a||`{{`,this.suffix=o?Wh(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?Wh(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?Wh(l):``,this.nestingPrefix=d?Wh(d):f||Wh(`$t(`),this.nestingSuffix=p?Wh(p):m||Wh(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=ig(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(ig(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false â if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>ag(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?ag(this.escape(e)):ag(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=Fh(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !Fh(a)&&!this.useRawValueToEscape&&(a=Lh(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${Wh(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!Fh(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!Fh(i))return i;Fh(i)||(i=Lh(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Uie=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},sg=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(Kh(r),i),t[o]=s),s(n)}},Wie=e=>(t,n,r)=>e(Kh(n),r)(t),Gie=class{constructor(e={}){this.logger=qh.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?sg:Wie;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=sg(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&!i[0].includes(`)`)&&i.find(e=>e.includes(`)`))){let e=i.findIndex(e=>e.includes(`)`));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Uie(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Kie=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},qie=class extends Jh{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=qh.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};
vendor: 4,585 bytes, line 17
17return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Mie(n.loaded,[i],a),Kie(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();Fh(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Fh(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},cg=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),Fh(e[1])&&(t.defaultValue=e[1]),Fh(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),lg=e=>(Fh(e.ns)&&(e.ns=[e.ns]),Fh(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Fh(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),ug=()=>{},Jie=e=>
vendor: 7,637 bytes, line 17
17{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},dg=class e extends Jh{constructor(e={},t){if(super(),this.options=lg(e),this.services={},this.logger=qh,this.modules={external:[]},Jie(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(Fh(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=cg();this.options={...n,...this.options,...lg(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?qh.init(r(this.modules.logger),this.options):qh.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Gie;let t=new tg(this.options);this.store=new Yh(this.options.resources,this.options);let n=this.services;n.logger=qh,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new Hie(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new og(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new qie(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new eg(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=ug,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=Ih(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=ug){let n=t,r=Fh(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=Ih();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=ug,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&Xh.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=Ih();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=Fh(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Fh(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=Qh(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=Qh(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=Qh(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return Fh(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;
17if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=Ih();return this.options.ns?(Fh(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=Ih();Fh(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new tg(cg());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=ug){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Yh(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...cg().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new og(n)}return a.translator=new eg(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();dg.createInstance,dg.dir,dg.init,dg.loadResources,dg.reloadResources,dg.use,dg.changeLanguage,dg.getFixedT,dg.t,dg.exists,dg.setDefaultNamespace,dg.hasLoadedNamespace,dg.loadNamespaces,dg.loadLanguages;const Yie=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);_g(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)};var fg={};const pg=(e,t,n,r)=>{_g(n)&&fg[n]||(_g(n)&&(fg[n]=new Date),Yie(e,t,n,r))};var mg=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}};const hg=(e,t,n)=>{e.loadNamespaces(t,mg(e,n))},gg=(e,t,n,r)=>{if(_g(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return hg(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,mg(e,r))},Xie=(e,t,n={})=>!t.languages||!t.languages.length?(pg(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),_g=e=>typeof e==`string`,Zie=e=>typeof e==`object`&&!!e;var Qie=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,$ie={"&":`&`,"&":`&`,"<":`<`,"<":`<`,">":`>`,">":`>`,"'":`'`,"'":`'`,""":`"`,""":`"`," ":` `," ":` `,"©":`©`,"©":`©`,"®":`®`,"®":`®`,"…":`â¦`,"…":`â¦`,"/":`/`,"/":`/`},eae=e=>$ie[e],vg={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(Qie,eae),transDefaultProps:void 0};const tae=(e={})=>{vg={...vg,...e}},nae=()=>vg;var rae;const iae=e=>{rae=e},aae=()=>rae,oae={type:`3rdParty`,init(e){tae(e.options.react),iae(e)}},sae=(0,B.createContext)();var cae=class{constructor(){this.usedNamespaces={}}
17addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},lae=s((e=>{var t=m();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),yg=s(((e,t)=>{t.exports=lae()})),uae=yg(),dae={t:(e,t)=>{if(_g(t))return t;if(Zie(t)&&_g(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},fae=()=>()=>{};const V=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=(0,B.useContext)(sae)||{},a=n||r||aae();a&&!a.reportNamespaces&&(a.reportNamespaces=new cae),a||pg(a,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let o=(0,B.useMemo)(()=>({...nae(),...a?.options?.react,...t}),[a,t]),{useSuspense:s,keyPrefix:c}=o,l=e||i||a?.options?.defaultNS,u=_g(l)?[l]:l||[`translation`],d=(0,B.useMemo)(()=>u,u);a?.reportNamespaces?.addUsedNamespaces?.(d);let f=(0,B.useRef)(0),p=(0,B.useCallback)(e=>{if(!a)return fae;let{bindI18n:t,bindI18nStore:n}=o,r=()=>{f.current+=1,e()};return t&&a.on(t,r),n&&a.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>a.off(e,r)),n&&n.split(` `).forEach(e=>a.store.off(e,r))}},[a,o]),m=(0,B.useRef)(),h=(0,B.useCallback)(()=>{if(!a)return dae;let e=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(e=>Xie(e,a,o)),n=t.lng||a.language,r=f.current,i=m.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===c&&i.revision===r)return i;let s={t:a.getFixedT(n,o.nsMode===`fallback`?d:d[0],c,{scopeNs:d}),ready:e,lng:n,keyPrefix:c,revision:r};return m.current=s,s},[a,d,c,o,t.lng]),[g,_]=(0,B.useState)(0),{t:v,ready:y}=(0,uae.useSyncExternalStore)(p,h,h);(0,B.useEffect)(()=>{if(a&&!y&&!s){let e=()=>_(e=>e+1);t.lng?gg(a,t.lng,d,e):hg(a,d,e)}},[a,t.lng,d,y,s,g]);let b=a||{},x=(0,B.useRef)(null),S=(0,B.useRef)(),C=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,`__original`,{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},w=(0,B.useMemo)(()=>{let e=b,t=e?.language,n=e;e&&(x.current&&x.current.__original===e&&S.current===t?n=x.current:(n=C(e),x.current=n,S.current=t));let r=!y&&!s?(...e)=>(pg(a,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),v(...e)):v,i=[r,n,y];return i.t=r,i.i18n=n,i.ready=y,i},[v,b,y,b.resolvedLanguage,b.language,b.languages]);if(a&&s&&!y)throw new Promise(e=>{let n=()=>e();t.lng?gg(a,t.lng,d,n):hg(a,d,n)});return w};var{slice:pae,forEach:mae}=[];function hae(e){return mae.call(pae.call(arguments,1),t=>{if(t)for(let n in t)e[n]===void 0&&(e[n]=t[n])}),e}function gae(e){return typeof e==`string`?[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e)):!1}var _ae=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,vae=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:`/`},r=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){let e=n.maxAge-0;if(Number.isNaN(e))throw Error(`maxAge should be a Number`);r+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!_ae.test(n.domain))throw TypeError(`option domain is invali
17d`);r+=`; Domain=${n.domain}`}if(n.path){if(!_ae.test(n.path))throw TypeError(`option path is invalid`);r+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!=`function`)throw TypeError(`option expires is invalid`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite)switch(typeof n.sameSite==`string`?n.sameSite.toLowerCase():n.sameSite){case!0:r+=`; SameSite=Strict`;break;case`lax`:r+=`; SameSite=Lax`;break;case`strict`:r+=`; SameSite=Strict`;break;case`none`:r+=`; SameSite=None`;break;default:throw TypeError(`option sameSite is invalid`)}return n.partitioned&&(r+=`; Partitioned`),r},yae={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:`/`,sameSite:`strict`};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=vae(e,t,i)},read(e){let t=`${e}=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e];for(;r.charAt(0)===` `;)r=r.substring(1,r.length);if(r.indexOf(t)===0)return r.substring(t.length,r.length)}return null},remove(e,t){this.create(e,``,-1,t)}},bae={name:`cookie`,lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<`u`)return yae.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:a}=t;n&&typeof document<`u`&&yae.create(n,e,r,i,a)}},xae={name:`querystring`,lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<`u`){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf(`?`)>-1&&(e=window.location.hash.substring(window.location.hash.indexOf(`?`)));let r=e.substring(1).split(`&`);for(let e=0;e<r.length;e++){let i=r[e].indexOf(`=`);i>0&&r[e].substring(0,i)===t&&(n=r[e].substring(i+1))}}return n}},Sae={name:`hash`,lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<`u`){let{hash:e}=window.location;if(e&&e.length>2){let i=e.substring(1);if(t){let e=i.split(`&`);for(let n=0;n<e.length;n++){let i=e[n].indexOf(`=`);i>0&&e[n].substring(0,i)===t&&(r=e[n].substring(i+1))}}if(r)return r;if(!r&&n>-1){let t=e.match(/\/([a-zA-Z-]*)/g);
17return Array.isArray(t)?t[typeof n==`number`?n:0]?.replace(`/`,``):void 0}}}return r}},bg=null,Cae=()=>{if(bg!==null)return bg;try{if(bg=typeof window<`u`&&window.localStorage!==null,!bg)return!1;let e=`i18next.translate.boo`;window.localStorage.setItem(e,`foo`),window.localStorage.removeItem(e)}catch{bg=!1}return bg},wae={name:`localStorage`,lookup(e){let{lookupLocalStorage:t}=e;if(t&&Cae())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Cae()&&window.localStorage.setItem(n,e)}},xg=null,Tae=()=>{if(xg!==null)return xg;try{if(xg=typeof window<`u`&&window.sessionStorage!==null,!xg)return!1;let e=`i18next.translate.boo`;window.sessionStorage.setItem(e,`foo`),window.sessionStorage.removeItem(e)}catch{xg=!1}return xg},Eae={name:`sessionStorage`,lookup(e){let{lookupSessionStorage:t}=e;if(t&&Tae())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Tae()&&window.sessionStorage.setItem(n,e)}},Dae={name:`navigator`,lookup(e){let t=[];if(typeof navigator<`u`){let{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},Oae={name:`htmlTag`,lookup(e){let{htmlTag:t}=e,n,r=t||(typeof document<`u`?document.documentElement:null);return r&&typeof r.getAttribute==`function`&&(n=r.getAttribute(`lang`)),n}},kae={name:`path`,lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>`u`)return;let n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Array.isArray(n))return n[typeof t==`number`?t:0]?.replace(`/`,``)}},Aae={name:`subdomain`,lookup(e){let{lookupFromSubdomainIndex:t}=e,n=typeof t==`number`?t+1:1,r=typeof window<`u`&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}},jae=!1;try{document.cookie,jae=!0}catch{}var Mae=[`querystring`,`cookie`,`localStorage`,`sessionStorage`,`navigator`,`htmlTag`];jae||Mae.splice(1,1);var Nae=()=>({order:Mae,lookupQuerystring:`lng`,lookupCookie:`i18next`,lookupLocalStorage:`i18nextLng`,lookupSessionStorage:`i18nextLng`,caches:[`localStorage`],excludeCacheFor:[`cimode`],convertDetectedLanguage:e=>e}),Pae=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type=`languageDetector`,this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=hae(t,this.options||{},Nae()),typeof this.options.convertDetectedLanguage==`string`&&this.options.convertDetectedLanguage.indexOf(`15897`)>-1&&(this.options.convertDetectedLanguage=e=>e.replace(`-`,`_`)),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(bae),this.addDetector(xae),this.addDetector(wae),this.addDetector(Eae),this.addDetector(Dae),this.addDetector(Oae),this.addDetector(kae),this.addDetector(Aae),this.addDetector(Sae)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&typeof n==`string`&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>e!=null&&!gae(e)).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}};Pae.type=`languageDetector`;var Fae={_meta:{interpolation_note:`{{count}} is reserved for i18next plural detection (_one/_other). {{name}}, {{email}}, {{title}}, {{date}}, {{provider}}, {{value}}, {{total}} are preformatted strings. Never pass raw Date or number â caller formats via src/lib/format.ts first.`},ai:{activity:{thinking:`Thinkingâ¦`,analyzing:`Analyzingâ¦`,drafting_reply:`Drafting replyâ¦`,reviewing_redlines:`Reviewing redlinesâ¦`,generating_suggestions:`Generating suggestionsâ¦`,scoring:`Scoringâ¦`,processing:`Processingâ¦`,detecting_parties:`Detecting partiesâ¦`,generating_guidance:`Generating guidanceâ¦`,generating_reply:`Generating replyâ¦`,working:`Workingâ¦`}},common:{save:`Save`,save_changes:`Save changes`,saving:`Savingâ¦`,saved:`â Saved`,cancel:`Cancel`,delete:`Delete`,deleting:`Deletingâ¦`,edit:`Edit`,remove:`Remove`,unlink:`Unlink`,close:`Close`,dismiss:`Dismiss`,open:`Open`,create:`Create`,creating:`Creatingâ¦`,update:`Update`,updating:`Updatingâ¦`,retry:`Retry`,back:`Back`,next:`Next`,continue:`Continue`,confirm:`Confirm`,yes:`Yes`,no:`No`,search:`Search`,search_placeholder:`Searchâ¦`,filter:`Filter`,loading:`Loadingâ¦`,no_results:`No results`,no_data:`No data`,view:`View`,send:`Send`,sending:`Sendingâ¦`,sent:`Sent`,upload:`Upload`,uploading:`Uploadingâ¦`,download:`Download`,download_original:`Download original`,download_version:`Download version`,download_as_pdf:`Download as PDF`,n
17o_versions:`No saved versions`,copy:`Copy`,copied:`Copied`,select:`Select`,select_all:`Select all`,deselect_all:`Deselect all`,clear:`Clear`,clear_all:`Clear all`,apply:`Apply`,reset:`Reset`,submit:`Submit`,submitting:`Submittingâ¦`,done:`Done`,untitled:`Untitled`,back_to_login:`Back to login`,sign_in:`Sign in`,sign_up:`Sign up`,sign_out:`Sign out`,settings:`Settings`,all:`All`,none:`None`,more:`More`,less:`Less`,show:`Show`,hide:`Hide`,expand:`Expand`,collapse:`Collapse`,refresh:`Refresh`,name:`Name`,description:`Description`,status:`Status`,type:`Type`,date:`Date`,created:`Created`,updated:`Updated`,actions:`Actions`,options:`Options`,details:`Details`,optional:`optional`,required:`required`,unknown:`Unknown`,untitled_document:`Untitled document`,no_subject:`(no subject)`,no_sender:`(no sender)`,no_preview:`(no preview)`,or:`or`,and:`and`,you:`You`},errors:{generic:`Something went wrong`,try_again:`Please try again.`,could_not_load:`Could not load`,could_not_save:`Could not save`,could_not_delete:`Could not delete`,network:`Network error`,unauthorized:`You are not authorized to perform this action`,not_found:`Not found`,invalid_input:`Invalid input`,rate_limited:`You are doing that too quickly. Please slow down.`,unknown:`Unknown error`,server_processing_failed:`This didn't finish because of a problem on our end. Try again, and contact support if it keeps happening.`,upload_failed:`Could not upload file. Please try again.`,download_failed:`Could not download file. Please try again.`,preview_failed:`Could not load preview. The link may have expired.`,document_load_failed:`Could not load document`,document_delete_failed:`Could not delete document`,uploaded_but_not_in_kb:`Files were uploaded but couldn't be added to the knowledge base â find them under Unassigned.`,send_message_failed:`Could not send message. Please try again.`,stream_interrupted:`The response was interrupted. Please try again.`,save_failed:`Could not save changes. Please try again.`,create_failed:`Could not create. Please try again.`,fetch_failed:`Could not load data. Please try again.`,gmail_not_available_title:`Gmail isn't available on this Google account`,gmail_not_available_body:`The Google account you connected doesn't have Gmail enabled. To use email features, connect a different Google account.`,gmail_not_available_cta:`Manage integrations`},toasts:{common:{saved:`Saved`,save_failed:`Failed to save`,deleted:`Deleted`,delete_failed:`Failed to delete`,copied:`Copied to clipboard`,copy_failed:`Failed to copy`,loaded:`Loaded`,load_failed:`Failed to load`,created:`Created`,create_failed:`Failed to create`,updated:`Updated`,update_failed:`Failed to update`,sent:`Sent`,send_failed:`Failed to send`},auth:{login_failed:`Login failed`,logged_out:`Signed out`,session_expired:`Your session has expired. Please sign in again.`},settings:{profile_saved:`Changes submitted.`,profile_save_failed:`Failed to submit changes. Please try again.`,password_required:`Current password is required to set a new password.`,language_changed:`Language updated`},chat:{message_copied:`Message copied`,copy_failed:`Failed to copy message`,feedback_sent:`Thanks for your feedback`,feedback_failed:`Could not send feedback`,conversation_deleted:`Conversation deleted`,conversation_delete_failed:`Failed to delete conversation`,stream_failed:`Failed to generate response`,stream_cancelled:`Response cancelled`,no_documents_selected:`Select at least one document`,context_too_long:`The pasted content is too long. Saved as a document instead.`,context_save_failed:`Failed to save content as a document`,unpin_failed:`Failed to remove document from conversation`},documents:{uploaded:`Document uploaded`,upload_failed:`Failed to upload document`,deleted:`Document deleted`,delete_failed:`Failed to delete document`,renamed:`Document renamed`,rename_failed:`Failed to rename document`},kb:{created:`Knowledge base created`,create_failed:`Failed to create knowledge base`,deleted:`Knowledge base deleted`,delete_failed:`Failed to delete knowledge base`,updated:`Knowledge base updated`,update_failed:`Failed to update knowledge base`,documents_added:`Documents added`,documents_add_failed:`Failed to add documents`,documents_removed:`Documents removed`,documents_remove_failed:`Failed to remove documents`},matter:{created:`Matter created`,create_failed:`Failed to create matter`,updated:`Matter updated`,update_failed:`Failed to update matter`,deleted:`Matter deleted`,delete_failed:`Failed to delete matter`},redline:{saved:`Redline saved`,version_saved:`Version saved`,save_failed:`Failed to save redline`,accepted:`Change accepted`,rejected:`Change rejected`,suggestion_applied:`Suggestion applied`,suggestion_apply_failed:`Failed to apply suggestion`,suggestion_unapply_failed:`Failed to undo the applied suggestion`,suggestion_save_failed:`Couldn't save the suggested changes. Ask again to retry.`,partial_apply:`{{failed}} of {{total}} suggestions couldn't be matched and remain pending`,finalize_unapplied_warning:`{{count}} suggestion(s) not reviewed yet â they won't be included in the download`,suggestion_rejected:`Suggestion rejected`,reattribute_failed:`Couldn't re-attribute the tracked changes`},evaluation:{started:`Evaluation started`,start_failed:`Failed to start evaluation`,deleted:`Evaluation deleted`,delete_failed:`Failed to delete evaluation`},playbook:{created:`Playbook created`,create_failed:`Failed to create playbook`,deleted:`Playbook deleted`,delete_failed:`Failed to delete playbook`,uploaded:`Playbook uploaded`,upload_failed:`Failed to upload playbook`,processing:`We're processing your playbook, it'll appear shortly.`,unsupported_file:`Unsupported file type. Accepted: {{types}}`},mail:{archived:`Email archived`,archive_failed:`Failed to archive email`,deleted:`Email deleted`,delete_failed:`Failed to delete email`,marked_read:`Marked as read`,marked_unread:`Marked as unread`,mark_failed:`Failed to update email`,draft_saved:`Draft saved`,draft_save_failed:`Failed to save draft`,draft_sent:`Draft sent`,draft_send_failed:`Failed to send draft`,task_dismissed:`Task dismissed`,task_dismiss_failed:`Failed to dismiss task`,task_started:`Task started`,task_start_failed:`Failed to start task`,undo_archive:`Undo archive`,undo_delete:`Undo delete`,undo:`Undo`,undone:`Undone`,undo_failed:`Could not und
17o`,attachment_saved_to_kb:`Saved to knowledge base â processingâ¦`,attachment_save_failed:`Failed to save attachment to knowledge base`,attachment_download_failed:`Failed to download attachment`,attachment_open_failed:`Failed to open attachment`},booking:{link_created:`Booking link created`,link_create_failed:`Failed to create booking link`,link_deleted:`Booking link deleted`,link_delete_failed:`Failed to delete booking link`,link_saved:`Booking link saved`,link_save_failed:`Failed to save booking link`,link_url_copied:`Link URL copied`,booking_cancelled:`Booking cancelled`,booking_cancel_failed:`Failed to cancel booking`,booked:`Booking confirmed`,book_failed:`Failed to book`},calendar:{event_created:`Event created`,event_create_failed:`Failed to create event`},org:{switched:`Switched workspace`,invited:`Invitation sent`,invite_failed:`Failed to send invitation`,invite_revoked:`Invitation revoked`,invite_revoke_failed:`Failed to revoke invitation`,member_removed:`Member removed`,member_remove_failed:`Failed to remove member`,role_updated:`Role updated`,role_update_failed:`Failed to update role`,invite_accepted:`Invitation accepted`,invite_accept_failed:`Failed to accept invitation`},billing:{subscribed:`Subscription active`,subscribe_failed:`Failed to start subscription`,cancelled:`Subscription cancelled`,cancel_failed:`Failed to cancel subscription`,credits_purchased:`Credits purchased`,credits_purchase_failed:`Failed to purchase credits`},api_keys:{created:`API key created`,create_failed:`Failed to create API key`,deleted:`API key deleted`,delete_failed:`Failed to delete API key`,copied:`API key copied`,postman_failed:`Failed to download the Postman collection`,postman_downloaded:`Postman collection downloaded â paste your API key into the api_key variable to run it`,postman_downloaded_partial:`Downloaded â {{filled}} of {{total}} example ids filled in. Requests for resources you don't have yet will 404; re-download once you've added them.`},integrations:{gmail_connected:`Gmail connected`,gmail_disconnected:`Gmail disconnected`,outlook_connected:`Outlook connected`,outlook_disconnected:`Outlook disconnected`,slack_connected:`Slack connected`,slack_disconnected:`Slack disconnected`,connect_failed:`Failed to connect integration`,disconnect_failed:`Failed to disconnect integration`,gmail_not_provisioned:`Gmail isn't enabled on the Google account you connected.`,gmail_not_provisioned_action:`Manage`,imap_connected:`IMAP mailbox connected`,imap_disconnected:`IMAP mailbox disconnected`},notifications:{all_marked_read:`All notifications marked as read`,mark_read_failed:`Failed to mark as read`,cleared:`Notifications cleared`,clear_failed:`Failed to clear notifications`},finance:{saved:`Document saved`,save_failed:`Failed to save document`,created:`Document created`,create_failed:`Failed to create document`,deleted:`Document deleted`,delete_failed:`Failed to delete document`},password_reset:{link_sent:`Reset link sent`,link_failed:`Could not send reset link`,password_updated:`Password updated`,password_update_failed:`Could not update password`,invalid_token:`This reset link is invalid or has expired.`},feedback:{sent:`Feedback sent`,send_failed:`Failed to send feedback`},post_payment:{success:`Payment successful â thanks!`,cancelled:`Payment cancelled`}},auth:{login:{title:`Login to your account`,description:`Enter your email below to login to your account`,email_label:`Email`,password_label:`Password`,forgot_password:`Forgot your password?`,submit:`Login`,submitting:`Logging in...`,no_account:`Don't have an account?`,error_unauthorized:`Username or password incorrect.`,error_generic:`Login failed`,account_deleted_toast:`Account deleted.`},signup:{title:`Create an account`,description:`Enter your information below to create your account`,account_type_label:`Account type`,account_type_personal:`Personal`,account_type_organization:`Organization`,organization_name_label:`Organization name`,organization_name_placeholder:`Acme Inc.`,organization_name_description:`You'll be the admin owner. Invite teammates from settings.`,first_name_label:`First Name`,first_name_placeholder:`John`,last_name_label:`Last Name`,last_name_placeholder:`Doe`,email_label:`Email`,email_description:`We'll use this to contact you. We will not share your email with anyone else.`,phone_label:`Phone Number (optional)`,phone_description:`For SMS notifications about your contracts. Include your country code if you're outside the US.`,phone_invalid:`Enter a valid phone number, e.g. +1 (555) 123-4567.`,password_label:`Password`,password_description:`Must be at least 8 characters long.`,confirm_password_label:`Confirm Password`,confirm_password_description:`Please confirm your password.`,submit:`Create Account`,submitting:`Creating account...`,have_account:`Already have an account?`,error_password_short:`Password must be at least 8 characters long`,error_passwords_mismatch:`Passwords do not match`,error_generic:`Registration failed`},forgot_password:{title:`Forgot your password?`,description:`Enter your email and we'll send you a link to reset it.`,email_label:`Email`,submit:`Send reset link`,submitting:`Sending...`,remember_password:`Remember your password?`,error_generic:`Something went wrong. Please try again.`,confirmation_title:`Check your inbox`,confirmation_description:`If an account exists for {{email}}, we've sent a password reset link. The link expires in 30 minutes.`},reset_password:{title:`Reset your password`,description:`Choose a new password for your account.`,new_password_label:`New password`,confirm_password_label:`Confirm password`,submit:`Upd
17ate password`,submitting:`Updating...`,success_title:`Password updated`,success_description:`Your password has been updated. You can now sign in.`,error_token_missing:`This reset link is missing a token.`,error_token_invalid:`This reset link is invalid or has expired.`,error_password_short:`Password must be at least 8 characters long`,error_passwords_mismatch:`Passwords do not match`,error_generic:`Could not update password.`},signup_complete:{title:`Check your inbox`,description:`We sent a verification link to {{email}}. Click it to activate your account.`,resend:`Resend verification`,back:`Back to login`}},settings:{title:`Settings`,description:`Manage your account and document preferences.`,back_to_app:`Back to app`,groups:{account:`Account`,billing:`Billing`,notifications:`Notifications`,developer:`Developer`,support:`Support`},tabs:{profile:`Profile`,organization:`Organization`,billing:`Billing`,usage:`Usage`,extra_usage:`Extra Usage`,integrations:`Integrations`,notifications:`Notifications`,api_keys:`API Keys`,support:`Support`},profile:{description:`Your name, contact details, languages, and password.`,change_photo:`Change photo`,remove_photo:`Remove photo`,photo_uploading:`Uploadingâ¦`,photo_updated:`Profile photo updated`,photo_removed:`Profile photo removed`,photo_error:`Couldn't update your profile photo. Please try again.`,first_name:`First Name`,last_name:`Last Name`,email:`Email`,email_verification_note:`Verification email will be sent once enabled.`,phone_number:`Phone Number`,phone_verified:`Verified`,phone_unverified:`Unverified`,phone_placeholder:`+1 (555) 123-4567`,phone_help:`Used for SMS notifications. Include your country code if you're outside the US.`,phone_invalid:`Enter a valid phone number, e.g. +1 (555) 123-4567.`,response_language:`Response Language`,response_language_help:`The AI will reply in this language. Direct contract quotes stay in the original language.`,ui_language:`UI Language`,ui_language_help:`The language used for the application interface.`,timezone:`Timezone`,timezone_help:`Routines, the daily brief, and SMS recap run on this timezone.`,redline_author_name:`Redlines author name`,redline_author_name_help:`Shown as the author on tracked changes you apply. Leave blank to use your name.`,current_password:`Current Password`,new_password:`New Password`,new_password_placeholder:`Min. 8 characters`,delete_account:`Delete Account`,save_error_no_current_password:`Current password is required to set a new password.`,save_error_blank_name:`First and last name are required.`,save_error_generic:`Failed to save changes.`,save_success_toast:`Changes submitted.`,save_error_toast:`Failed to submit changes. Please try again.`,replay_tour:`Product tour`,replay_tour_help:`Replay the welcome tour from the dashboard.`,replay_tour_action:`Replay tour`},billing:{title:`Billing`,description:`Manage your subscription and payment methods.`,current_plan:`Current plan`,plan_free:`Free`,plan_pro:`Pro`,plan_unlimited:`Unlimited`,manage_subscription:`Manage subscription`,upgrade:`Upgrade`,upgrade_to_pro:`Upgrade to Pro`,downgrade:`Downgrade`,cancel_subscription:`Cancel subscription`,subscription_active:`Your subscription is active.`,subscription_cancels_on:`Subscription will cancel on {{date}}.`,billing_period:`Current billing period`,renews_on:`Renews on {{date}}`,no_subscription:`You don't have an active subscription.`,starting_checkout:`Opening checkoutâ¦`,opening_portal:`Opening billing portalâ¦`},usage:{title:`Usage`,description:`Track your usage in the current billing period.`,credits_used:`Credits used`,messages_sent:`Messages sent`,documents_processed:`Documents processed`,remaining_credits:`Remaining credits`,remaining_messages:`Remaining messages`,billing_period_start:`Period start`,billing_period_end:`Period end`,n
17o_usage:`No usage in this period.`,loading:`Loading usageâ¦`,used:`used`,left:`left`,remaining_label:`{{remaining}} / {{total}} left`},extra_usage:{title:`Extra Usage`,description:`Buy extra credits and cap what you spend beyond your plan.`,buy_credits:`Buy credits`,credits_available:`Credits available`,enable_overage:`Enable overage`,overage_enabled:`Overage enabled`,overage_disabled:`Overage disabled`,spend_cap:`Spend cap`,spend_cap_help:`Maximum extra spend per billing period.`,save_cap:`Save cap`},integrations:{title:`Integrations`,description:`Connect a mailbox or Slack workspace so modInsight can work with them.`,gmail:`Gmail`,gmail_description:`Sync inbox and process contract emails.`,outlook:`Outlook`,outlook_description:`Sync inbox and process contract emails.`,slack:`Slack`,slack_description:`Send notifications and chat from Slack.`,connect:`Connect`,connecting:`Connectingâ¦`,disconnect:`Disconnect`,disconnecting:`Disconnectingâ¦`,connected:`Connected`,connected_as:`Connected as {{email}}`,connection_error:`Connection failed`,reauthorize:`Reauthorize`,scope_missing:`Some permissions are missing. Reauthorize to grant them.`,temporarily_unavailable:`Temporarily unavailable`,imap:`IMAP / SMTP`,imap_description:`Connect any mailbox over IMAP/SMTP â for providers that aren't Google or Microsoft.`,imap_dialog:{title:`Connect IMAP mailbox`,title_reconnect:`Reconnect IMAP mailbox`,title_add:`Add IMAP mailbox`,description:`Connect any mailbox over IMAP/SMTP. We'll verify the connection before saving.`,email_label:`Email address`,username_label:`Username`,username_help:`Usually your full email address. Change it only if your provider uses a separate login name.`,password_label:`Password`,password_help:`Use an app password if your provider requires one.`,incoming_section:`Incoming mail (IMAP)`,outgoing_section:`Outgoing mail (SMTP)`,host_label:`Host`,host_placeholder:`imap.example.com`,smtp_host_placeholder:`smtp.example.com`,port_label:`Port`,ssl_label:`Use SSL/TLS`,submit:`Connect & verify`,verifying:`Verifyingâ¦`,connect_failed:`Could not connect. Check your settings and try again.`,caldav_section:`Calendar & tasks (CalDAV)`,caldav_url_label:`CalDAV URL (optional)`,caldav_url_placeholder:`dav.example.com`,caldav_url_help:`Your provider's CalDAV server â a bare domain or full URL (e.g. dav.privateemail.com). Leave empty to connect mail only.`,caldav_advanced:`Advanced: separate CalDAV credentials`,caldav_username_label:`CalDAV username`,caldav_password_label:`CalDAV password`,caldav_advanced_help:`Only needed when the CalDAV server uses different credentials than the mailbox.`,caldav_connect_failed:`Mail connected, but CalDAV could not be reached. Check the URL and credentials.`},imap_config:{title:`IMAP account details`,description:`Connection details for this mailbox. Passwords are never shown â reconnect to change them.`,mail_section:`Mail servers`,email:`Email`,imap_server:`IMAP server`,smtp_server:`SMTP server`,username:`Username`,password:`Password`,last_sync:`Last sync`,last_failure:`Last failure`,caldav_section:`Calendar & tasks (CalDAV)`,caldav_active:`Active`,caldav_disabled:`Disabled`,caldav_not_connected:`No CalDAV server connected. Reconnect the mailbox and add a CalDAV URL to sync calendar and tasks.`,caldav_url:`CalDAV URL`,caldav_override:`override`,caldav_collections:`Discovered collections`,component_events:`Events`,component_tasks:`Tasks`,caldav_disconnect:`Disconnect CalDAV`,caldav_disconnect_failed:`Failed to disconnect CalDAV.`}},notifications_view:{title:`Notifications`,description:`Choose whether updates reach you by email, SMS, or both.`,email_notifications:`Email notifications`,email_notifications_help:`Receive task and contract updates by email.`,sms_notifications:`SMS notifications`,sms_notifications_help:`Receive completion alerts by SMS.`,phone_required:`Add a verified phone number to enable SMS.`,verify_phone:`Verify phone`},api_keys:{description:`Grant programmatic access to document search, knowledge bases, and chat.`,view_docs:`View API docs`,download_postman:`Download Postman collection`,example_request:`Example request`,key_name:`Key name`,key_name_placeholder:`e.g. Production`,create:`Create`,creating:`Creatingâ¦`,save_key_warning:`Copy your key now. You won't be able to see it again.`,created_at:`Created`,last_used:`Last used`,revoked:`Revoked`,no_keys:`No API keys yet.`},organization:{title:`Organization`,description:`Manage your organization, members, and roles.`,no_org_active:`You are not in an organization workspace. Switch workspace to manage one.`,members:`Members`,pending_invites:`Pending invites`,invite_member:`Invite member`,leave_org:`Leave organization`,rename_org:`Rename organization`,org_name_label:`Organization name`,save_name:`Save name`},support:{description:`Your support tickets and replies from our team.`},footer_privacy:`Your data is encrypted, secure, and private`},nav:{dashboard:`Dashboard`,shared:`Shared`,chat:`Chat`,vault:`Vault`,matters:`Matters`,mail:`Inbox`,booking_links:`Calendar`,routines:`Routines`,console:`Console`,evaluations:`Evaluations`,playbooks:`Playbooks`,settings:`Settings`,user_menu:{usage_metrics:`Usage Metrics`,organizations:`Organizations`,settings:`Settings`,terms_of_service:`Terms of Service`,privacy_policy:`Privacy Policy`,contact_support:`Contact support`,sign_out:`Sign out`,guest:`Guest`},customers:`Customers`},sidebar:{collapse_panel:`Collapse panel`,collapse_rail:`Collapse sidebar`,expand_rail:`Expand sidebar`},personas:{default:`Default`,new_persona:`New persona`,manage_personas:`Manage personas`,personas:`Personas`,no_personas:`No personas`,create_first:`Create your first persona`,subt
17itle:`Standing instructions the assistant follows`,search_placeholder:`Search personasâ¦`,no_match:`No personas match â{{query}}â`,empty_hint:`Save reusable instructions to recall later`,set_default:`Set as default`,unset_default:`Remove default`,default_hint:`Applied automatically to new chats`,description_label:`Description`,description_placeholder:`A short summary shown in the picker`,name_placeholder:`Persona name`,content_label:`Instructions`,content_placeholder:`# Title 18 19Write standing instructions in markdownâ¦`,markdown_hint:`Markdown supported`,chars_of_max:`{{count}} / 20,000`,tokens_estimate:`~{{tokens}} tokens`,source:`Source`,rendered:`Rendered`,download_md:`Download .md`,import_md:`Import .md`,import_hint:`Drop a .md, .markdown, or .txt file, or click to browse`,import_failed:`Could not read that file`,start_from_template:`Start from a template`,blank:`Blank`,detail_sr:`Persona details`,dialog_title:`New persona`,dialog_description:`A reusable sheet of instructions for the assistant.`,load_failed:`Could not load this persona`,templates:{inhouse_counsel:{name:`In-house counsel`,description:`Practical, risk-aware review from the company's side.`,content:`# In-house counsel 20 21You are acting as pragmatic in-house counsel. Protect the company while keeping deals moving. 22 23## Priorities 24 25- Flag material risk first: liability caps, indemnities, termination, IP ownership, data protection. 26- Separate true blockers from nice-to-haves. Say which is which. 27- Prefer standard market positions over bespoke language. 28 29## Style 30 31- Lead with the recommendation, then the reasoning. 32- Quote the exact clause you are referring to. 33- When something is acceptable, say so plainly instead of hedging. 34`},deal_desk:{name:`Deal desk`,description:`Fast triage focused on getting to signature.`,content:`# Deal desk 35 36You help a deal desk turn contracts around quickly without missing the terms that matter commercially. 37 38## Focus 39 40- Pricing, payment terms, renewal and auto-renewal, and any fee escalators. 41- Scope, service levels, and what counts as a breach. 42- Anything that changes revenue recognition or the close date. 43 44## Output 45 46- Give a short go / caution / stop read at the top. 47- List the two or three points worth negotiating, ranked. 48- Keep it tight; assume the reader is busy. 49`},plain_english:{name:`Plain English`,description:`Explains legal language simply, no jargon.`,content:`# Plain English 50 51Explain contracts in plain language for a non-lawyer. Never assume legal background. 52 53## How to answer 54 55- Translate each clause into what it means in practice. 56- Spell out who has to do what, by when, and what happens if they don't. 57- Define any unavoidable legal term the first time it appears. 58 59## Tone 60 61- Short sentences. One idea at a time. 62- Use everyday examples where they help. 63- Flag anything surprising or one-sided in bold. 64`},redline_reviewer:{name:`Redline reviewer`,description:`Suggests concrete edits, not just commentary.`,content:`# Redline reviewer 65 66You review contracts by proposing concrete edits, not just observations. 67 68## For each issue 69 70- Name the clause and the problem in one line. 71- Propose replacement wording that fixes it. 72- Note the fallback position if the other side pushes back. 73 74## Discipline 75 76- Edit only what needs editing; leave acceptable terms alone. 77- Keep the drafting style consistent with the rest of the document. 78- Never weaken a protection while trying to improve readability. 79`},formal_memo:{name:`Formal memo`,description:`Structured, citable analysis in a formal register.`,content:`# Formal memo 80 81Respond as a formal legal memorandum suitable for a file or a partner. 82 83## Structure 84 85- Open with a short issue statement and a bottom-line conclusion. 86- Then analysis, organized by issue, each with a heading. 87- Close with recommended next steps. 88 89## Standards 90 91- Cite the specific clause or section for every assertion. 92- Distinguish what the document says from what you infer. 93- Maintain a measured, professional register throughout. 94`}}},prompts:{title:`Prompts`,new_prompt:`New prompt`,no_prompts:`No saved prompts`,saved_prompts:`Saved prompts`,use:`Use`,lines_one:`{{count}} line`,lines_other:`{{count}} lines`,characters:`characters`,last_used:`Last used {{date}}`,never_used:`Never used`,edit_prompt:`Edit prompt`,delete_prompt:`Delete prompt`,prompt_name:`Name`,prompt_body:`Body`,tokens_one:`{{count}} token`,tokens_other:`{{count}} tokens`},knowledge_bases:{title:`Knowledge bases`,new_kb:`New knowledge base`,kb_name:`Name`,kb_description:`Description`,documents:`Documents`,documents_one:`{{count}} document`,documents_other:`{{count}} documents`,no_documents:`No documents`,no_kbs:`No knowledge bases`,create_first:`Create your first knowledge base`,select_kb:`Select knowledge base`,manage:`Manage`,edit_kb:`Edit knowledge base`,delete_kb:`Delete knowledge base`,add_documents:`Add documents`,remove_from_kb:`Remove from knowledge base`,unassigned:`Unassigned`,unassigned_one
94:`Unassigned ({{count}} item)`,unassigned_other:`Unassigned ({{count}} items)`,filter_placeholder:`Filter by nameâ¦`,no_filter_results:`No matches`,status_completed:`Completed`,status_processing:`Processing`,status_failed:`Failed`,status_reference:`Reference`,type_pdf:`PDF`,type_word:`Word`,type_spreadsheet:`Sheets`,type_presentation:`Slides`,type_image:`Images`,type_text:`Text`,bulk_delete:{title_one:`Delete {{count}} document?`,title_other:`Delete {{count}} documents?`,description:`This permanently removes the selected documents. This cannot be undone.`,confirm:`Delete`,deleting:`Deletingâ¦`}},vault:{title:`Vault`,description:`All your documents in one place.`,upload_document:`Upload document`,upload_documents:`Upload documents`,uploading:`Uploadingâ¦`,drag_drop:`Drag and drop documents here, or click to browse`,no_documents:`No documents yet`,upload_first:`Upload your first document`,document_count_one:`{{count}} document`,document_count_other:`{{count}} documents`,all_documents:`All documents`,recent:`Recent`,delete_selected:`Delete selected`,selected_one:`{{count}} selected`,selected_other:`{{count}} selected`,status_pending:`Pending`,status_processing:`Processing`,status_completed:`Completed`,status_failed:`Failed`,status_failed_twice:`Failed`,process_again:`Process again`,rename:`Rename`,preview:`Preview`,document_viewer:`Document viewer`,document_preview_description:`Preview of the selected document`},chat:{context_usage:`{{pct}}% context`,context_limit:{hard_title:`Context limit reached`,hard_body:`This conversation is too large for the model to hold in one turn. Start a fresh chat (your document and a recap carry over) or compact the history to keep going here.`,hard_message:`This conversation has reached the model's context limit. Start a fresh chat or compact this conversation to keep going.`,soft_title:`This chat is getting long`,soft_body:`The longer a conversation runs, the harder it is for the model to keep earlier details straight, so answers can start to drift. To keep them sharp, start a fresh chat (your document and a recap carry over) or compact the history â or continue anyway.`,fresh_title:`Start a fresh chat`,fresh_desc:`Opens a new conversation with your attached document carried over and a recap pre-filled in the composer, ready to edit or send.`,fresh_action:`Start fresh`,compact_title:`Compact this conversation`,compact_desc:`Summarizes the conversation so far into a checkpoint. The transcript stays visible and your document stays attached; follow-ups use the summary plus recent turns.`,compact_action:`Compact`,continue_anyway:`Continue anyway`,compacted:`Conversation compacted`,compact_failed:`Couldn't compact the conversation`,recap_failed:`Couldn't prepare the recap`},new_chat:`New chat`,history:`History`,ask_anything:`Ask me anything â use + for modes, knowledge, and filesâ¦`,send_message:`Send message`,stop_generating:`Stop generating`,regenerate:`Regenerate`,copy_message:`Copy message`,no_conversations:`No conversations yet`,start_chatting:`Start a conversation`,today:`Today`,yesterday:`Yesterday`,previous_7_days:`Previous 7 days`,previous_30_days:`Previous 30 days`,older:`Older`,attached_documents:`Attached documents`,no_documents_attached:`No documents attached`,attach_documents:`Attach documents`,attach_redline:`Attach redline`,select_persona:`Select persona`,model_picker:{requires_plan:`Requires {{plan}}`},thinking:{label:`Thinking depth`,low:`Light`,medium:`Balanced`,high:`Deep`,xhigh:`Deeper`,max:`Maximum`,default_suffix:`(default)`},benchmark:{menu_item:`Benchmarks`,dialog_title:`Benchmark two models`,dialog_description:`Pick two models. Every message runs against both side by side, and each model keeps its own thread. Keep comparing turn by turn, then continue with the model you prefer.`,model_a_label:`Model A`,model_b_label:`Model B`,pick_model:`Pick a model`,same_model_error:`Pick two different models to compare.`,start:`Start benchmark`,armed_chip:`Benchmark: {{a}} vs {{b}}`,dual_badge:`{{a}} vs {{b}}`,vs:`vs`,continue_with_model:`Continue with this model`,prefer_response:`Prefer this response`,preferred_badge:`Preferred`,continued_badge:`Continued`,winner_badge:`Winner`,discard_turn:`Discard this turn`,side_failed:`This model failed to respond.`,no_response:`No response.`,both_failed:`Both models failed to respond. The turn was discarded.`,prefer_failed:`Couldn't record your preference.`,continue_failed:`Couldn't continue with that model.`,discard_failed:`Couldn't discard the turn.`,stream_failed:`The benchmark couldn't be started.`,pair_locked:`This conversation is comparing a fixed pair of models. Continue with one of them before changing the pair.`,single_send_blocked:`Continue with one of the two models before sending a normal message.`,context_limit:`This conversation has reached the model's context limit. Start a fresh chat or compact this conversation to keep going.`},select_prompt:`Select prompt`,viewer_read_only:`You're in viewer mode â chat is read-only here.`,stream_interrupted:`The connection was interrupted before the response finished. The partial answer was kept â send your message again to continue.`,response_interrupted:`Response interrupted`,usage_limit_hint:`You've used all of this month's included credits. Upgrade your plan to keep chatting.`,tokens_estimate:`~{{value}} / {{total}} tokens`,message_too_long:`Message too long ({{value}} / {{total}} tokens)`,upload_as_file:`Upload as file`,tokens_count:`~{{value}} tokens`,tokens_cap:`(cap: {{total}})`,save_as_document:`Save as document instead`,delete_conversation:`Delete conversation`,delete_conversation_confirm:`Delete this conversation? This cannot be undone.`,rename_conversation:`Rename conversation`,knowledge_base:`Knowledge base`,knowledge_base_all:`All documents`,inbox_scope:`Inbox`,inbox_scope_hint:`Answer from your connected mailbox instead of your documents`,knowledge_base_select:`
94Select knowledge base`,long_paste_title:`That content is long`,long_paste_description:`The pasted content is around {{value}} tokens (cap: {{total}}). Save the content as a document instead, and it'll be added to the conversation context.`,long_paste_save:`Save as document`,long_paste_dismiss:`Cancel`,long_paste_filename:`Filename`,feedback_thumbs_up:`Helpful`,feedback_thumbs_down:`Not helpful`,citations:`Citations`,context:`Context`,discussing:`Discussing`,unpin_document:`Remove from conversation`,open_document:`Open document`,detach_document:`Remove attachment`,email_picker:{pick_prompt:`Which mailbox should I use?`,use:`Use`,reconnect:`Reconnect`,active:`Email: {{provider}}`,switch:`Switch mailbox`,clear:`Turn off email tools`,checking:`Checking your mailboxesâ¦`},mode:`Mode`,mode_draft:`Draft contract`,mode_library:`Library`,attach_file:`Attach file`,upload_new_file:`Upload new file`,your_documents:`Your documents`,shared_with_me:`Shared with me`,persona_chip_none:`Persona`,persona_chip_aria:`Choose a persona for this conversation`,welcome:{heading:`What can I help with?`,subheading:`Ask a question, or start from a persona below.`,pick_persona:`Start with a persona`}},email:{tabs:{response:`Response`,analysis:`Analysis`,redlines:`Redlines`,generated:`Generated Doc`},analysis:{heading:`Risk Analysis`,email_heading:`Email Analysis`,email_subtitle:`Based on the message and the conversation so far, not on a contract review.`,not_analyzed_title:`No analysis available`,analyze_anyway:`Analyze anyway`,analyzing:`Analyzingâ¦`,analyze:`Analyze`,analyze_and_suggest:`Analyze and suggest redlines`,suggest_from_analysis:`Use this analysis to suggest redlines`,redlining:`Suggesting redlinesâ¦`,redlines_not_generated:`Redlines were not generated automatically for this document.`,reasons:{outbound:`This is a message you sent. Analysis runs on emails you receive â check the received copy in this conversation.`,no_reply:`This email was treated as a closing message that needed no action, so its attachments were not analyzed.`,irrelevant:`This email was classified as irrelevant, so no document analysis was run.`,nonlegal:`This email wasn't classified as legal, so its attachments were stored without a risk analysis.`,draft_intent:`This email asked for a document to be drafted, so the attachments were treated as source material and not risk-analyzed.`,not_contract:`This document didn't look like a contract, so the risk analysis skipped it.`,detection_failed:`We couldn't check whether this document is a contract. You can analyze it anyway.`,not_analyzed:`This document was added outside the normal pipeline, so it hasn't been risk-analyzed yet.`,no_attachments:`This email has no attachments, so there is nothing to analyze.`,attachment_not_processed:`This email's attachments haven't been processed yet. Use the Process button on an attachment to ingest it first.`,no_processable_attachments:`None of this email's attachments are a supported document type, so there is nothing to analyze.`,attachments_restricted:`The attachments on this email are rights-protected and couldn't be downloaded for analysis.`,doc_failed:`Processing failed for this document, so no analysis is available.`,processing:`This email is still being processed â the analysis will appear here when it's ready.`,skipped_by_gate:`This document was stored and read, but redlines were not generated automatically.`}},redlines:{failed_title:`Suggestion generation failed`,failed_body:`The redline suggestions for this document could not be generated.`,retry:`Retry generation`,retrying:`Retryingâ¦`,retry_needs_side:`Confirm your side above to retry the analysis.`,no_changes_title:`No changes proposed`,partial_title:`Review stopped early`,partial_body:`Some sections of this document were not reviewed. The suggestions shown cover the sections that were.`,not_word:`This attachment isn't a Word document â the redline editor needs a .docx.`,skipped_title:`Redlines were not generated automatically`,skipped_body:`modInsight decided this document did not need automatic redlines. You can still generate them.`,analyze_and_suggest:`Analyze and suggest redlines`,suggest_from_analysis:`Use this analysis to suggest redlines`},thread:{title:`Conversation`,completed:`Completed`,completed_hint:`This thread is completed. Reopen it to reply or make changes.`,mark_completed:`Mark completed`,reopen:`Reopen`,n
94o_reply_title:`No reply needed`,no_reply_hint:`This looks like a closing message that ends the thread, so no draft was generated. Mark the thread completed when you're done.`,no_draft_title:`No draft yet`,no_draft_hint:`No reply has been drafted for this email yet.`,already_responded_title:`Already responded`,already_responded_hint:`You already replied to this thread outside the app, so this draft is no longer needed. Mark the thread completed when you're done.`,view_draft_anyway:`View draft anyway`,empty_no_task:`Select an email to see its thread`,loading:`Loading threadâ¦`,error:`Couldn't load the thread`,not_processed:`Not processed`,revision_superseded_title:`Superseded version`,revision_superseded_hint:`A newer version of this contract arrived later in this thread. You're viewing round {{index}} of {{count}} â the analysis and redlines below are for this older draft.`,revision_go_to_latest:`Go to latest version`,no_subject:`(no subject)`,business_days_since_last_one:`{{count}} business day since last reply`,business_days_since_last_other:`{{count}} business days since last reply`,promote_title:`Promote to task`,promote_description:`Pull this message into the pipeline. We'll create a task on this thread and process it.`,promote_intent_label:`What should we do with it?`,promote_intent_draft:`Draft a reply`,promote_intent_redline:`Redline the attachment`,promote_redline_needs_attachment:`Redlining needs a document attachment â this message has none, so we'll draft a reply instead.`,promote_playbook:`Playbook (optional)`,promote_playbook_none:`No playbook`,promote_submit:`Promote`,promote_success:`Promoting message to a taskâ¦`,step_latency:{moments:`moments later`,minutes_one:`{{count}}m later`,minutes_other:`{{count}}m later`,hours_one:`{{count}}h later`,hours_other:`{{count}}h later`,hours_minutes:`{{hours}}h {{minutes}}m later`,business_days_one:`{{count}} business day later`,business_days_other:`{{count}} business days later`,days_one:`{{count}}d later`,days_other:`{{count}}d later`},knowledge_base:`Grounding knowledge base`,knowledge_base_inherit:`Inherit from matter`},attachments:{restricted_title:`Attachments rights-protected`,restricted_hint:`This email's attachments are rights-protected and couldn't be retrieved â open it in Outlook to view them.`},grounding:{grounded_on:`Grounded on: {{name}}`,not_grounded:`Not grounded on a knowledge base`,rerun:`Re-run analysis`,rerun_started:`Re-running the analysis with the new groundingâ¦`,unknown_kb:`a knowledge base`}},mail:{contacts:{reconnect_hint:`Reconnect to include your full directory`},title:`Mail`,compose:`Compose`,no_messages:`No messages`,no_messages_in_folder:`No messages in this folder`,no_thread_selected:`Select a message to read`,account_unusable:`This account isn't available for mail right now.`,loading_messages:`Loading messagesâ¦`,refresh:`Refresh`,refresh_stale_hint:`New activity â refresh to see it`,search_placeholder:`Search mailâ¦`,folders:{inbox:`Inbox`,drafts:`Drafts`,sent:`Sent`,archive:`Archive`,trash:`Trash`,spam:`Spam`,tasks:`Tasks`,all:`All`,important:`Important`,starred:`Starred`,snoozed:`Snoozed`},labels:`Labels`,custom_folders:`Folders`,providers:{gmail:`Gmail`,outlook:`Outlook`,slack:`Slack`,connect_gmail:`Connect Gmail`,connect_outlook:`Connect Outlook`,imap:`IMAP`,connect_imap:`Connect IMAP`,connect_title:`Connect an email account`,connect_description:`Connect a mailbox to read, search, and reply to your email in one place.`},message:{from:`From`,to:`To`,cc:`Cc`,bcc:`Bcc`,subject:`Subject`,reply:`Reply`,reply_all:`Reply all`,forward:`Forward`,archive:`Archive`,delete:`Delete`,mark_read:`Mark as read`,mark_unread:`Mark as unread`,attachments:`Attachments`,download:`Download`,open:`Open`,save_to_kb:`Save to knowledge base`,saved_to_kb:`Saved`,saving:`Savingâ¦`,attachment_unavailable:`Attachments couldn't be loaded for this message.`,attachment_blocked_hint:`This attachment is rights-protected or cloud-hosted and can't be downloaded here.`,no_subject:`(no subject)`,show_quoted:`Show quoted text`,hide_quoted:`Hide quoted text`},compose_view:{title:`New message`,to_placeholder:`Recipients`,subject_placeholder:`Subject`,body_placeholder:`Write your messageâ¦`,send:`Send`,sending:`Sendingâ¦`,save_draft:`Save draft`,discard:`Discard`,attach_file:`Attach file`,recipient_required:`Recipient is required`},shortcuts:{title:`Keyboard shortcuts`,reply:`Reply`,reply_all:`Reply all`,forward:`Forward`,archive:`Archive`,delete:`Delete`,mark_unread:`Mark unread`,next:`Next message`,previous:`Previous message`,compose:`Compose`},task:{title:`Email task`,status_classified:`Classified`,status_processing:`Processing`,status_ready_for_review:`Ready for review`,status_reviewing:`Reviewing`,status_draft_editing:`Editing draft`,status_sent:`Sent`,status_dismissed:`Dismissed`,status_failed:`Failed`,no_task:`No task associated with this email.`,start_task:`Start task`,dismiss:`Dismiss`,send_draft:`Send draft`,edit_draft:`Edit draft`,view_documents:`View documents`,risk_analysis:`Risk analysis`,suggestions:`Suggestions`,anal
94ysis:`Analysis`,redlines:`Redlines`,tabs:{summary:`Summary`,draft:`Draft`,documents:`Documents`,analysis:`Analysis`,redlines:`Redlines`}},draft:{title:`Draft response`,send:`Send response`,sending:`Sendingâ¦`,regenerate:`Regenerate`,discard:`Discard`}},matters:{title:`Matters`,personal:`Personal`,new_matter:`New matter`,no_matters:`No matters yet`,create_first:`Create your first matter`,search_placeholder:`Search mattersâ¦`,open_matters:`Open`,closed_matters:`Closed`,all_matters:`All`,new_dialog:{title:`New matter`,description:`Create a matter to group documents and conversations.`,matter_name:`Name`,matter_name_placeholder:`e.g. Acme acquisition`,matter_description:`Description`,matter_description_placeholder:`Optional notes about this matter`,create:`Create matter`,creating:`Creatingâ¦`},edit_dialog:{title:`Edit matter`,save:`Save changes`,delete:`Delete matter`,delete_confirm:`Delete this matter? Documents inside it stay in your vault.`},detail:{opened_on:`Opened {{date}}`,closed_on:`Closed {{date}}`,close_matter:`Close matter`,reopen_matter:`Reopen matter`,edit_matter:`Edit matter`,share_matter:`Share matter`,shared_with_you:`Shared with you`},chat:{in_matter:`In matter`,in_matter_named:`In matter: {{name}}`},parties:{title:`Parties`,set_cta:`Click here to set the parties`,empty:`No parties yet`,add:`Add party`,remove:`Remove party`,name_placeholder:`Name`,role_placeholder:`Role`,email_placeholder:`Email (optional)`},tabs:{overview:`Overview`,activity:`Activity`,documents:`Documents`,conversations:`Conversations`,calendar:`Calendar`,redlines:`Redlines`,evaluations:`Evaluations`,finance:`Finance`,legal:`Legal`,knowledge_bases:`Knowledge bases`,action_items:`Action items`,resources:`Resources`},link_document:`Link document`,link_conversation:`Link conversation`,link_evaluation:`Link evaluation`,link_knowledge_base:`Link knowledge base`,link_calendar_event:`Link event`,link_document_desc:`Pick a document from your library to attach to this matter.`,link_calendar_event_desc:`Pick from events in the next 30 days or the past 30 days.`,no_candidates_to_link:`Nothing to link.`,move_to_matter:`Move to matter`,move_thread:`Move thread to another matter`,thread_moved:`Thread moved to {{name}}`,activity_tab:{empty:`No activity yet.`,empty_hint:`Events from emails, evaluations, and redlines linked to this matter will appear here.`},overview:{no_overview:`No overview yet`,documents:`Documents`,conversations:`Conversations`,recent_activity:`Recent activity`},documents_tab:{no_documents:`No documents in this matter`,empty_hint:`Link documents from your library â they'll show up here for quick reference.`,add_documents:`Add documents`},evaluations_tab:{no_evaluations:`No evaluations for this matter`,new_evaluation:`New evaluation`},knowledge_bases_tab:{no_kbs:`No knowledge bases linked yet`,documents:`documents`,default_badge:`Default`,set_default:`Set default`,clear_default:`Clear default`},conversations_tab:{no_conversations:`No conversations in this matter`,new_conversation:`New conversation`},calendar_tab:{no_events:`No calendar events for this matter`,upcoming:`Upcoming`,past:`Past`},redlines_tab:{no_redlines:`No redlines for this matter`},finance_tab:{no_documents:`No finance documents for this matter`,new_document:`New finance document`},emails_tab:{no_emails:`No emails for this matter`},kbs_tab:{no_kbs:`No knowledge bases linked`,link_kb:`Link knowledge base`},threads:{messages_one:`{{count}} message`,messages_other:`{{count}} messages`,no_messages:`No messages`,whose_turn:`Your turn`,their_turn:`Their turn`,sla_overdue:`Overdue`,sla_today:`Due today`,sla_upcoming:`Due {{date}}`,business_days_later_one:`{{count}} business day later`,business_days_later_other:`{{count}} business days later`,delete:`Remove thread from matters`,delete_confirm:`This removes the thread and all its emails and AI drafts from this matter. It does not delete anything from your connected mailbox (Gmail or Outlook), and any processed documents stay in your vault. This can't be undone.`}},booking:{title:`Booking links`,description:`Public scheduling pages people can use to book time with you.`,new_link:`New booking link`,no_links:`No booking links yet`,create_first:`Create your first booking link`,edit:`Edit`,delete:`Delete`,copy_url:`Copy URL`,url_copied:`URL copied`,preview:`Preview`,describe:{button:`Describe with AI`,title:`Describe a booking link`,subtitle:`Describe it naturally`,hint:`Try: "30-min intros, weekdays 9â5, 15m buffer, ask their company"`,placeholder:`Describe your availabilityâ¦`,confirm:`Create`,creating:`Creatingâ¦`,edit:`Edit`,changed_prompt:`No problem. What would you like to change?`,minutes_short:`min`,buffer:`+{{minutes}}m buffer`,notice:`{{duration}} notice`,per_day:`max {{count}}/day`,question_one:`{{count}} question`,question_other:`{{count}} questions`},fields:{name:`Name`,name_placeholder:`e.g. Intro call`,slug:`URL slug`,slug_placeholder:`intro-call`,duration_minutes:`Duration (minutes)`,buffer_minutes:`Buffer (minutes)`,timezone:`Timezone`,availability:`Availability`,account:`Account`,description:`Description`,description_placeholder:`What this meeting is for`},non_primary_calendar_hint:`Uses this account's default calendar.`,weekdays:{monday:`Monday`,tuesday:`Tuesday`,wednesday:`Wednesday`,thursday:`Thursday`,friday:`Frid
94ay`,saturday:`Saturday`,sunday:`Sunday`,short:{mon:`Mon`,tue:`Tue`,wed:`Wed`,thu:`Thu`,fri:`Fri`,sat:`Sat`,sun:`Sun`}},public:{book_with:`Book with {{name}}`,pick_date:`Pick a date`,no_slots:`No available times on this day`,select_time:`Select a time`,confirm_booking:`Confirm booking`,booking_confirmed:`Booking confirmed`,name_label:`Your name`,email_label:`Your email`,notes_label:`Notes (optional)`,book:`Book`,booking:`Bookingâ¦`,confirmed_title:`Booking confirmed`,confirmed_description:`We've sent you a confirmation by email. The meeting is on {{date}}.`,powered_by:`Powered by Contract RAG`},bookings:{title:`Bookings`,no_bookings:`No bookings yet`,status_pending:`Pending`,status_confirmed:`Confirmed`,status_cancelled:`Cancelled`,details:`Booking details`,start:`Start`,end:`End`,guest_name:`Guest name`,guest_email:`Guest email`,notes:`Notes`,cancel_booking:`Cancel booking`}},dashboard:{title:`Dashboard`,welcome:`Welcome back`,recent_documents:`Recent documents`,recent_chats:`Recent chats`,upcoming_events:`Upcoming events`,open_matters:`Open matters`,inbox:`Inbox`,calendar:`Calendar`,tasks:`Tasks`,create_event:`Create event`,no_events:`No events`,no_tasks:`No tasks`,no_inbox:`Nothing new`,view_all:`View all`,month:`Month`,week:`Week`,day:`Day`,today:`Today`,time_on_site:{title:`Time on site`,total:`{{duration}} total`,empty:`No activity tracked for this day`,empty_all_time:`No activity tracked yet`,all_time:`All time`,other:`Other`},todays_schedule:`Today's Schedule`,search_results:`Search Results`,searching_description:`Searching all synced events and tasks`,select_date:`Select a date`,no_due_date:`No due date`,no_incomplete_tasks:`No incomplete tasks`,no_matching_events:`No matching events`,no_matching_tasks:`No matching tasks`,search_placeholder:`Search events and tasksâ¦`,all_day:`All day`,no_title:`(No title)`,location_label:`Location:`,items_one:`{{count}} item`,items_other:`{{count}} items`,show_completed:`Show completed`,hide_completed:`Hide completed`,daily_digest:`Daily digest`,daily_digest_desc:`Your tasks and meetings for today`,briefing_title:`The Morning Briefing`,in_your_court:`In your court`,in_your_court_caption:`Matters awaiting your response.`,todays_calendar:`Today's calendar`,stat_in_court_one:`{{count}} in your court`,stat_in_court_other:`{{count}} in your court`,stat_tasks_one:`{{count}} task`,stat_tasks_other:`{{count}} tasks`,stat_coming_due_one:`{{count}} coming due`,stat_coming_due_other:`{{count}} coming due`,stat_meetings_one:`{{count}} meeting`,stat_meetings_other:`{{count}} meetings`,stat_next:`Next {{time}}`,next_up:`next`,now:`now`,empty_court:`Nothing in your court today.`,empty_meetings:`No meetings on the calendar.`,tasks_today:`Today's tasks`,meetings_today:`Today's meetings`,matters_your_turn:`Awaiting your response`,no_tasks_today:`No tasks for today`,no_meetings_today:`No meetings for today`,no_subject:`(No subject)`,business_days_waited_one:`{{count}} work day`,business_days_waited_other:`{{count}} work days`,event_dialog:{title:`New event`,event_title:`Title`,event_title_placeholder:`What's the event?`,start:`Start`,end:`End`,location:`Location`,description:`Description`,create:`Create event`,creating:`Creatingâ¦`},unified_inbox:{title:`Unified inbox`,all:`All`,email:`Email`,slack:`Slack`,no_items:`Inbox is empty`,reply:`Reply`,reply_placeholder:`Write a replyâ¦`,send:`Send`,sending:`Sendingâ¦`},provider_google:`Google`,provider_outlook:`Outlook`,provider_caldav:`CalDAV`,account_unknown:`Other account`},redline:{title:`Redline`,version_graph:`Version graph`,version:`Version`,no_versions:`No versions yet`,no_changes:`No tracked changes`,changes:`Changes`,comments:`Comments`,suggestions:`Suggestions`,accept_all:`Accept all`,reject_all:`Reject all`,accept:`Accept`,reject:`Reject`,attributed_to:`Changes attributed to`,change_author_name:`Change`,insertion:`Insertion`,deletion:`Deletion`,change_meta:`{{type}} by {{author}}`,change_meta_with_date:`{{type}} by {{author}} on {{date}}`,unknown_author:`Unknown`,suggested_by_tool:`Suggested by modInsight`,your_change:`Your change (modInsight)`,modinsight_change:`modInsight`,reattribute_to:`Re-attribute to {{name}}`,reattribute_hint:`Rewrite these tracked changes to show your current author name`,reattribute_confirm:`Re-attribute every tracked change by "{{from}}" to "{{to}}"? This updates the author on the existing changes in this document.`,go_to_provision:`Go to the related provision`,comment_placeholder:`Add a commentâ¦`,post_comment:`Post comment`,no_comments:`No comments yet`,pick_document:`Pick a document`,
94no_redline_documents:`No DOCX documents available`,apply_suggestion:`Apply suggestion as tracked changes`,reject_suggestion:`Reject suggestion`,change_summary:`Change summary`,show_changes:`Show changes`,hide_changes:`Hide changes`,compared_to:`Compared to {{version}}`,saved_version:`Saved as {{name}}`,save_version:`Save version`,save_version_placeholder:`Version name`,suggest:`Suggest`,suggest_placeholder:`Optional instruction for AI suggestions...`,generating_suggestions:`Generating suggestionsâ¦`,generating_more:`Generating more suggestionsâ¦`,insert_paragraph_after:`Insert new paragraph after`,delete_paragraph:`Delete paragraph`,target_missing:`Target missing`,target_missing_hint:`The paragraph this suggestion changes is no longer in the document (later edits or a version switch), so it can't be applied. You can still reject it.`,no_suggestions_generated:`No suggestions generated`,try_again:`Try again`,no_suggestions_yet_chat:`No suggestions yet. Ask the AI in the Chat tab â e.g., "suggest 3 redlines to reduce buyer risk".`,no_suggestions_yet_embedded:`No suggestions yet. Click "Suggest" to ask the AI for redline recommendations.`,progress_reviewed:`{{reviewed}} of {{total}} reviewed`,apply_all:`Apply all ({{count}})`,applying:`Applyingâ¦`,undoing:`Undoingâ¦`,apply_failed:`Couldn't apply`,apply_failed_hint:`The suggestion's text couldn't be located in the document`,undo_applied_hint:`Remove this change from the document`,hide_reviewed:`Hide reviewed`,undo:`Undo`,insert_after:`Insert after:`,preview:`Preview`,show_doc_preview:`Show this change in the document`,hide_doc_preview:`Hide this change from the document`,edit_inline_label:`Edit the suggested text`,edit_inline_hint:`Type to edit. Click struck text to restore it. Ctrl+Enter saves, Esc cancels.`,start_from_original:`Start from original`,reset_to_suggestion:`Reset to suggestion`,edit_no_change_hint:`Matches the original, so there is nothing to apply. Reject the suggestion instead.`,revert_hunk_hint:`Click to restore the original wording here`,save_shortcut_hint:`Ctrl+Enter to save`,shortcuts:{title:`Keyboard shortcuts`,navigate:`Navigate`,prev:`Previous suggestion`,next:`Next suggestion`,triage:`Triage`,accept:`Accept selected (applies to the document)`,reject:`Reject selected`,edit:`Edit selected`,toggle_preview:`Show/hide the change in the document`,undo:`Undo`,undo_last:`Undo last triage`,help:`Help`,help_toggle:`Toggle this cheat sheet`},suggestion_status:{pending:`Pending`,accepted:`Accepted`,edited:`Edited`,rejected:`Rejected`,applied:`Applied`,superseded:`Superseded`},switch_confirm:`Snapshot current work and switch to {{version}}? Any unsaved changes are auto-snapshotted first.`,anchor_status:{not_found:`Text not found`,not_found_hint:`The quoted text couldn't be located in the document â this suggestion can't be applied automatically.`,ambiguous:`Ambiguous match`,ambiguous_hint:`The quoted text appears in several places â applying may land on the wrong one.`},large_rewrite:`Large rewrite`,large_rewrite_hint:`This suggestion replaces most of the paragraph instead of editing it in place. Check whether a smaller, targeted change would keep more of your original wording.`,whole_clause_delete:`Removes clause`,whole_clause_delete_hint:`This suggestion deletes an entire clause rather than editing it. Confirm the whole clause should be removed, not narrowed with a targeted edit.`,grounding:`Grounding`,grounding_title:`Ground suggestions on your standards`,grounding_active:`Grounding ({{count}})`,grounding_kb:`Knowledge base`,grounding_kb_none:`No knowledge base`,grounding_kb_hint:`Your standards library. The passages relevant to this contract are pulled in â or the whole knowledge base when it's small enough.`,grounding_exemplars:`Exemplar documents`,grounding_exemplars_hint:`A specific agreement to conform to, injected in full (max {{max}}).`},grounding:{no_kbs:`No knowledge bases found`,search_kb:`Search knowledge basesâ¦`,search_documents:`Search documentsâ¦`,upload_new:`Upload new document`,processing:`Processing {{name}}â¦`,selected_count:`{{count}} selected`,none_selected:`Select documents`,cap_reached:`Up to {{max}}`,no_documents:`No documents found`},document_categories:{title:`Document types`,hub_description:`Manage the contract types your documents are classified into.`,description:`Every document is auto-classified into one of these types when uploaded. Built-in types can't be edited; add your own for types we don't cover. Rules scoped to a type apply automatically to matching documents.`,builtin:`Built-in`,custom:`Custom`,new:`New type`,count_of_max:`{{count}} of {{max}}`,none:`Uncategorized`,change:`Change type`,change_failed:`Could not change the document type.`,name:`Name`,classifier_hint:`How the classifier recognizes this type.`,classifier_hint_placeholder:`e.g. Franchise agreements and franchise disclosure documents.`,empty:`No custom types yet`,empty_hint:`Add a type for contracts the built-ins don't cover.`,select_hint:`Select a type to edit it.`,builtin_readonly:`Built-in type (read-only)`,key_immutable:`The key is derived from the name and can't change.`,delete_confirm:`Delete this type? Documents keep their label until reclassified.`,created:`Type created`,updated:`Type updated`,deleted:`Type deleted`,rules:{section_title:`Standing instructions`,section_hint:`Applied automatically to every document classified as {{label}}.`,empty:`No standing instructions for this type yet.`,add:`Add instructions`,placeholder:`Don't flag limitation-of-liability clauses for NDAs. 95Require mutual confidentiality.`,default_name:`{{label}} house rules`,delete_confirm:`Remove these instructions?`,multiple_hint:`This type has multiple instruction docs. Manage them in Playbooks.`,account_note:`Account-wide rules also apply to every type.`,manage_in_playbooks:`Manage in Playbooks`},builtin_labels:{nda:`NDA`,msa:`MSA`,saas:`SaaS`,sow:`SOW`,employment:`Employment`,lease:`Lease`,license:`License`,dpa:`DPA`,purchase:`Purchase`,other:`Other`}},documents:{from_email:`From email`},document_tags:{labels:`Labels`,add:`Add a label`,bulk_label:`Label selected`,search_or_create:`Search or create a label`,none_yet:`No labels yet. Type to create one.`,create_named:`Create "{{name}}"`,clear_filter:`Clear label filter`,limitation_note:`Labels organize your files. They don't restrict who can open a document.`,apply_failed:`Could not update the label.`,remove_failed:`Could not remove the label.`}
95,guidance:{scope:{label:`Applies to`,kb:`Knowledge base`,kb_hint:`Only when this playbook's knowledge base is selected for a review.`,account:`Whole account`,account_hint:`Always applied as a house rule across every review.`,category:`One document type`,category_hint:`Applied automatically to documents of the chosen type.`,pick_category:`Pick a document type`,badge_account:`Account-wide`,badge_category:`Type: {{label}}`}},evaluation:{title:`Evaluations`,new_evaluation:`New evaluation`,no_evaluations:`No evaluations yet`,create_first:`Run your first evaluation`,role:`Role`,role_buyer:`Buyer`,role_seller:`Seller`,document:`Document`,playbook:`Playbook`,status:{pending:`Pending`,processing:`Processing`,completed:`Completed`,failed:`Failed`},create_dialog:{title:`New evaluation`,description:`Score a document against a playbook.`,select_document:`Select document`,select_playbook:`Select playbook`,start:`Start evaluation`,starting:`Startingâ¦`},detail:{created_on:`Created {{date}}`,score:`Score`,no_results:`No evaluation results yet`,matching_passages:`Matching passages`,selected_answer:`Selected answer`,export:`Export`,delete:`Delete evaluation`},guidance:{findings:`Findings`,no_findings:`No findings`,severity_low:`Low`,severity_medium:`Medium`,severity_high:`High`,view_suggestions:`View suggestions`},panel:{no_evaluation_selected:`Select an evaluation`},knowledge_base:`Grounding knowledge base`,knowledge_base_none:`None`,knowledge_base_hint:`Your standards library. The passages relevant to this contract are pulled in â or the whole knowledge base when it's small enough.`,exemplar_documents:`Exemplar documents`,exemplar_documents_hint:`Specific agreements to conform to, injected in full (max {{max}}).`},playbook:{title:`Playbooks`,description:`Score documents against rubrics and guidance.`,library:`Playbook library`,new_playbook:`New playbook`,upload_xlsx:`Upload XLSX`,upload_document:`Upload document`,upload_json:`Upload JSON`,no_playbooks:`No playbooks yet`,create_first:`Create your first playbook`,categories:`Categories`,subcategories:`Subcategories`,questions:`Questions`,answers:`Answers`,rubric:`Rubric`,guidance:`Guidance`,edit:`Edit`,delete:`Delete`,duplicate:`Duplicate`,is_benchmark:`Benchmark default`,seller_score:`Seller score`,buyer_score:`Buyer score`,answer_text:`Answer text`,question_text:`Question`,upload_issues:`Upload issues`,upload_issues_description:`Some rows could not be parsed. Fix or skip them and re-upload.`},org:{switcher:{personal:`Personal`,personal_account:`Personal account`,organizations:`Organizations`,create_org:`Create organization`,switch_to:`Switch to {{name}}`,current:`Current`},members:{title:`Members`,name:`Name`,email:`Email`,role:`Role`,joined:`Joined`,actions:`Actions`,remove:`Remove`,remove_confirm:`Remove {{name}} from this organization?`,no_members:`No members yet`,you:`You`},roles:{admin:`Admin`,member:`Member`,viewer:`Viewer`},invite_dialog:{title:`Invite member`,description:`They'll get an email invitation to join.`,email_label:`Email`,email_placeholder:`[email protected]`,role_label:`Role`,send_invite:`Send invite`,sending:`Sendingâ¦`},pending_invites:{title:`Pending invites`,no_invites:`No pending invites`,invited_on:`Invited {{date}}`,revoke:`Revoke`,revoke_confirm:`Revoke invitation to {{email}}?`},invite_accept:{title:`You've been invited`,description:`Join {{name}} as a {{role}}.`,accept:`Accept invitation`,accepting:`Acceptingâ¦`,decline:`Decline`,expired:`This invitation has expired or is invalid.`}},finance:{title:`Finance`,new_document:`New finance document`,no_documents:`No finance documents yet`,create_first:`Create your first finance document`,new_dialog:{title:`New finance document`,description:`Create an invoice, receipt, or other finance document.`,name:`Name`,name_placeholder:`Document name`,template:`Template`,create:`Create document`,creating:`Creatingâ¦`},detail:{edit:`Edit`,view:`View`,delete:`Delete`,save:`Save`,export:`Export`},editor:{spreadsheet:`Spreadsheet`,text:`Text`,no_email_context:`No email context`,email_context:`Email context`},templates:{blank:`Blank`,invoice:`Invoice`,receipt:`Receipt`},chat_panel:{title:`Ask about this document`,placeholder:`Ask anythingâ¦`}},notifications:{title:`Notifications`,no_notifications:`No notifications`,mark_all_read:`Mark all read`,clear_all:`Clear all`,unread:`Unread`,read:`Read`,summary_title_one:`{{count}} new notification`,summary_title_other:`{{count}} new notifications`,update_banner:{message:`A new version is available.`,refresh:`Refresh`}
95,support_reply_banner:{title:`Support replied to your ticket`,view:`View ticket`},release_note:{toast_label:`What's new`,dialog_title:`What's new`,dialog_subtitle:`Recent improvements to modInsight.`,see_all:`See all updates`,dismiss:`Dismiss`}},support:{status:{open:`Open`,in_progress:`In progress`,resolved:`Resolved`,closed:`Closed`},menu:{tooltip:`Support`,contact:`Contact support`,screenshot:`Screenshot & report`,record:`Record screen & report`,record_preparing:`Preparing recordingâ¦`,stop_recording:`Stop recording`,my_tickets:`My tickets`,whats_new:`What's new`},intro:{title:`Need help? It's built in.`,lead:`Report a bug or ask a question without leaving the app.`,cap_screenshot:`Snap a screenshot`,cap_record:`Record your screen`,cap_reply:`Get replies in-app and by email`,open_ticket:`Open a ticket`,dismiss:`Got it`,arrow:`Find it here anytime`},list:{title:`Your tickets`,search_placeholder:`Search ticketsâ¦`,new_ticket:`New ticket`,empty_title:`No support tickets yet`,empty_body:`Need a hand or found a bug? Open a ticket and our team will reply here and by email.`,no_search_results:`No tickets match your search.`,no_text:`(no text)`,message_count_one:`{{count}} message`,message_count_other:`{{count}} messages`,unread:`Unread reply`},thread:{select_prompt:`Select a ticket to view the conversation.`,staff_name:`modInsight Support`,created:`Created {{date}}`,resolved:`Resolved {{date}}`,reopen_banner:`This ticket is closed. Sending a reply will reopen it.`,reply_placeholder:`Reply to supportâ¦`,send:`Send message`,delete:`Delete ticket`,delete_confirm:`Delete this ticket and its conversation? This cannot be undone.`},toasts:{load_failed:`Failed to load your support tickets.`,open_failed:`Failed to open the support thread.`,send_failed:`Failed to send your message.`,delete_failed:`Failed to delete the ticket.`},capture:{screenshot_failed:`Screenshot failed â you can still attach files manually.`,screenshot_failed_short:`Screenshot failed.`,recording_unsupported:`Screen recording is not supported in this browser.`,recording_start_failed:`Could not start screen recording.`,recording_failed:`Screen recording failed.`,max_attachments:`At most {{count}} attachments per ticket.`,unsupported_type:`Unsupported attachment type: {{type}}`,too_large:`"{{filename}}" is too large (max {{max}}MB).`}},support_dialog:{title:`Contact support`,description:`Tell us what you need â bugs, questions, or feedback.`,message_label:`How can we help?`,placeholder:`Describe the problem or questionâ¦`,helper:`We'll notify you here and by email when our team replies.`,screenshot:`Screenshot`,attach_files:`Attach files`,preview_attachment:`Preview {{filename}}`,remove:`Remove`,cancel:`Cancel`,submit:`Send`,submitting:`Sendingâ¦`,success:`Ticket created â our team will get back to you soon.`,success_action:`View tickets`,submit_failed:`Failed to submit your ticket. Please try again.`,about:`About: {{label}}`,about_remove:`Remove item from ticket`,about_helper:`We'll keep a copy of this item so we can reproduce the problem.`,about_placeholder:`What went wrong with it?`},flag_popover:{title:`What went wrong?`,reason_placeholder:`Add details (optional)`,submit:`Submit`},delete_account:{title:`Delete account`,description:`Permanently delete your account and all data. This cannot be undone.`,confirm_label:`Type DELETE to confirm`,delete:`Delete account`,deleting:`Deletingâ¦`,cancel:`Cancel`},topbar:{sync:{button:`Sync now`,syncing:`Syncingâ¦`,complete:`Sync complete`,complete_with_email_one:`Sync complete â {{count}} new email`,complete_with_email_other:`Sync complete â {{count}} new emails`,taking_longer:`Sync is taking longer than expected`,start_failed:`Failed to start sync`}},everything_search:{placeholder:`Search everythingâ¦`,no_results:`No results`,documents:`Documents`,matters:`Matters`,conversations:`Conversations`,knowledge_bases:`Knowledge bases`,scopes:{everything_label:`Everything`,everything_description:`Search across every resource type`,inbox_description:`Emails matching this query`,calendar_description:`Events on this topic`,documents_description:`Files, contracts, knowledge bases`,vault_description:`Prompts, playbooks, evaluations, profiles`,matters_description:`Find a case, then filter within it`},facets:{all:`All`},all_categories:`All categories`,open_matter:`Open`,back_to_search:`Back to search`,chat:{mode_results:`Results`,mode_chat:`Chat`,placeholder:`Ask about your workspaceâ¦`,hint:`Ask a question about your workspace, then press Enter.`,searching:`Searching your workspace`,thinking:`Thinking`,open_in_chat:`Open in chat`,error:`Couldn't complete that search. Please try again.`,open_failed:`Couldn't open the conversation. Please try again.`,link_open_failed:`Couldn't open that item. Please try again.`}},item_detail:{when:`When`,location:`Location`,due:`Due`,status:`Status`,details:`Details`,from:`From`,channel:`Channel`,mark_complete:`Mark complete`,open_in_google:`Open in Google`,open_in_outlook:`Open in Outlook`},callbacks:{gmail_connecting:`Connecting Gmailâ¦`,gmail_connected:`Gmail connected. Redirectingâ¦`,gmail_error:`Failed to connect Gmail.`,outlook_connecting:`Connecting Outlookâ¦`,outlook_connected:`Outlook connected. Redirectingâ¦`,outlook_error:`Failed to connect Outlook.`,slack_connecting:`Connecting Slackâ¦`,slack_connected:`Slack connected. Redirectingâ¦`,slack_error:`Failed to connect Slack.`},tour:{skip:`Skip tour`,continue:`Continue to {{next}} â`,finish:`Finish`,progress:`Step {{current}} of {{total}}`,got_it:`Got it`,help_aria:`Show help for this page`,help_close_aria:`Hide help for this page`,dashboard:{sidebar:`Your navigation lives here â Dashboard, Chat, Vault, Matters, Mail.`,search:`Hit âK from anywhere to jump to anything.`,notifications:`Updates from your matters land here.`,digest:`Your morning briefing â drafts, deadlines, what's new.`},chat:{composer:`Ask anything â drafts, redlines, research.`,mode:`Choose how the model responds: draft, library lookup, or search.`,kb:`Scope answers to a
95specific knowledge base.`,persona:`Give the assistant standing instructions for this chat.`},vault:{cards:`Six shelves: prompts, knowledge bases, playbooks, personas, evaluations, redlines.`,visibility:`Switch between personal and team items.`},matters:{panel:`Track each case here â emails, docs, evaluations, and timeline.`,new:`Create a matter from scratch or from an existing email or document.`},mail:{folders:`Folders, accounts, and compose live here.`,list:`Threads from the current folder. Click to read.`,detail:`Read, reply, and draft responses in this pane.`},booking:{new:`Create a Cal.com-style link for clients to book time with you.`,list:`Active booking links. Share the URL or copy embed code.`},routines:{new:`Schedule recurring AI agent jobs â daily, weekly, on-demand.`,filters:`Search routines or filter by how often they run.`,cards:`Your active routines. Pause, edit, or check run history from here.`}},customer_success:JSON.parse(`{"toasts":{"load_failed":"Couldn't load customers","created":"Customer created","saved":"Changes saved","save_failed":"Couldn't save changes","archived":"Customer archived","restored":"Customer restored","deleted":"Customer deleted","delete_failed":"Couldn't delete customer","backfill_queued":"Importing past emailsâ¦","backfill_failed":"Couldn't start the import","import_failed":"Couldn't import customers"},"list":{"search_placeholder":"Search customers","empty_title":"No customers yet","add_first":"Add your first customer","show_archived":"Show archived","hide_archived":"Hide archived"},"detail":{"select_prompt":"Select a customer to see their timeline","arr_label":"ARR","archived":"Archived","edit":"Edit","backfill":"Import history","restore":"Restore","archive":"Archive","delete_confirm":"Delete this customer and its entire timeline? This can't be undone.","tab_timeline":"Timeline","tab_roadmap":"Roadmap","tab_risk":"Risk","tab_feedback":"Feedback","tab_icp":"ICP fit"},"timeline":{"empty_title":"No activity yet","empty_body":"Emails to and from this customer's domains and contacts will appear here. Use Import history to pull in past emails.","all_hidden_title":"No visible activity","all_hidden_body":"Every event is hidden or comes from a mailbox that isn't selected for this customer.","load_more":"Load more","show_full":"Show full message","collapse":"Show less","no_body":"Full message unavailable","view_transcript":"View transcript","download_transcript":"Download","hide":"Hide","restore":"Restore","show_hidden":"Show hidden ({{count}})","hide_hidden":"Hide hidden","hidden_section":"Hidden","mailboxes_all":"All mailboxes","mailboxes_count":"{{count}} of {{total}} mailboxes","mailboxes_label":"Ingest mail from","summary":{"title":"Where things stand","risk_calibrating":"Risk is still calibrating","risk_band":"{{band}} risk ({{score}}/100)","with_health":"{{status}}, health {{health}}/100","health_calibrating":"{{status}}, health calibrating","activity_one":"{{count}} touchpoint in the last 30 days","activity_other":"{{count}} touchpoints in the last 30 days","activity_none":"No touchpoints in the last 30 days","last_contact_today":"last contact today","last_contact_yesterday":"last contact yesterday","last_contact_days":"last contact {{count}} days ago","drivers":"Top risk drivers: {{list}}","nothing":"No activity to summarize yet.","ai_title":"Summary","generating":"Summarizing the timeline","refresh":"Refresh","generate":"Generate summary","updated_ago":"Updated {{ago}}","ai_error":"Couldn't generate a summary. Try again.","ai_empty":"No summary yet.","regen_queued":"Regenerating the summaryâ¦","regen_failed":"Couldn't regenerate the summary"}},"dialog":{"create_title":"New customer","edit_title":"Edit customer","subtitle":"Emails matching these domains or contacts land on this customer's timeline.","name":"Name","name_placeholder":"Acme Inc.","domains":"Domains","domains_hint":"Company email domains, e.g. acme.com. Press Enter or comma to add.","contacts":"Contact emails","contacts_hint":"Individual addresses, incl. contacts on shared mail hosts.","arr":"ARR (optional)","notes":"Notes (optional)","create":"Create","save":"Save","remove_chip":"Remove","freemail_warning":"This is a shared mail host. Add the full address under contact emails instead so only that person matches."},"import":{"title":"Import customers","subtitle":"Upload a CSV or Excel file. Eac
95h row becomes one customer, exactly as if you had typed it into the form.","dropzone":"Drop a .csv or .xlsx file here, or click to choose","dropzone_hint":"Columns like Company, Website, Email, ARR and Notes are recognized automatically; anything else is kept in the notes.","template":"Download template","template_csv":"CSV","template_xlsx":"Excel","uploading":"Reading file⦠{{percent}}%","preview_title":"Preview","mapping_caption":"How the columns were read","mapping_ai":"Mapped with AI â check the columns before importing.","field":{"name":"Name","domains":"Domains","contact_emails":"Contact emails","arr":"ARR","notes":"Notes","notes_context":"Kept in notes","ignore":"Ignored"},"status":{"ok":"Ready","warning":"Ready with warnings","conflict":"Already exists","duplicate":"Duplicate in file","error":"Skipped"},"conflict_with":"Matches {{name}}","truncated":"Only the first {{max}} rows were read. Split the file to import the rest.","polish_notes":"Polish notes with AI","polish_notes_hint":"Rewrites the column values folded into each customer's notes as short prose. Runs in the background after the import.","importable_count":"{{count}} of {{total}} rows will be imported","skipped_count":"{{count}} will be skipped","confirm":"Import {{count}} customers","confirm_one":"Import 1 customer","importing":"Importingâ¦","start_over":"Choose another file","result_title":"Import finished","result_created":"{{count}} customers created","result_created_one":"1 customer created","result_skipped":"{{count}} rows skipped (already existed, duplicated, or had no name)","result_failed":"{{count}} rows could not be saved. Confirm again to retry them.","result_polish":"Notes are being polished in the background and will refine shortly.","result_backfill":"Past emails matching the new customers are being imported.","columns":{"row":"#","status":"Status","name":"Name","domains":"Domains","contacts":"Contacts","arr":"ARR","notes":"Notes"},"preview_failed":"Couldn't read that file","invalid_file":"Upload a .csv or .xlsx file up to {{max}}MB"},"roadmap":{"projects":"Projects","new_project":"New project","no_projects":"No projects yet. Create one to start building a roadmap.","add_transcript":"Add transcript","regenerate":"Regenerate","retry":"Retry","add_task":"Add task","edit_project":"Edit project","delete_project":"Delete project","delete_project_confirm":"Delete this project and its roadmap? This can't be undone.","overdue":"Overdue","generating":"Generating roadmapâ¦","needs_context":"This roadmap needs context. Add a meeting transcript to generate it.","error":"Roadmap generation failed. Try again.","empty":"No roadmap yet. Add a transcript or a task to get started.","other_tasks":"Other tasks","priority":{"low":"Low","medium":"Medium","high":"High"},"status":{"todo":"To do","in_progress":"In progress","done":"Done"},"project_dialog":{"create_title":"New project","edit_title":"Edit project","subtitle":"A project groups a customer's roadmap and tasks.","name":"Name","name_placeholder":"Onboarding","description":"Description","target_date":"Target date","create":"Create","save":"Save"},"task_dialog":{"create_title":"New task","edit_title":"Edit task","subtitle":"Tasks track the work behind a roadmap.","title":"Title","description":"Description","status":"Status","due_date":"Due date","assignee":"Assignee","assignee_placeholder":"Name","milestone":"Milestone","milestone_none":"No milestone","priority":"Priority","priority_none":"None","create":"Create","save":"Save"},"decision_log":{"title":"Decision log","empty":"No decisions recorded yet.","churn":"Churn signal"},"toasts":{"load_failed":"Couldn't load the roadmap.","save_failed":"Couldn't save your changes.","delete_failed":"Couldn't delete that.","project_created":"Project created.","project_deleted":"Project deleted.","task_created":"Task added.","saved":"Saved.","regen_queued":"Regenerating the roadmapâ¦","regen_failed":"Couldn't start roadmap regeneration.","transcript_queued":"Transcript uploaded. Processingâ¦","transcript_failed":"Couldn't upload the transcript."}},"risk":{"recompute":"Recompute","recomputing":"Recomputingâ¦","score_label":"Risk score","health_label":"Health","calibrating":"Calibrating","calibrating_hint":"Needs at least 3 signal types before a risk score is shown.","health_calibrating_hint":"A health score appears once this customer has activity or tasks.","no_data":"No risk data yet â run a recompute to analyze this customer.","days_quiet":"{{count}} days since last contact","bands":{"healthy":"Healthy","watch":"Watch","at_risk":"At risk","high_risk":"High risk","critical":"Critical"},"pillars_title":"Risk pillars","health_pillars_title":"Health pillars","pillars":{"single_thread":"Single-thread","engagement_decay":"Engagement decay","concerns":"Concerns","pilot_stall":"Pilot stall"},"health_pillar_labels":{"engagement":"Engagement","sentiment":"Sentiment","outcomes":"Outcomes","relationship":"Relationship"},"trend_title":"Risk trend","trend_empty":"Not enough history yet","signals_title":"Open signals","signals_empty":"No open signals","signal_types":{"response_lag":"Response lag","value_gap":"Concerns raised","stakeholder_drop":"Single-threaded","implementation_drift":"Implementation drift"},"risks_title":"Risks","risks_empty":"No open risks","add_risk":"Add risk","resolve":"Resolve","dismiss":"Dismiss","delete":"Delete","delete_confirm":"Delete this risk? This can't be und
95one.","confidence":"{{value}}% confidence","signal_seen":"Seen {{count}} times since {{since}}","settings":{"open":"Risk settings","title":"Risk settings","subtitle":"Tune which pillars count toward the risk score and how heavily.","pillar":"Pillar","enabled":"On","weight":"Weight","coverage":"Pillars required","coverage_hint":"How many distinct pillars must fire before a risk score is shown.","min_one_pillar":"Enable at least one pillar, and require no more than are enabled.","save":"Save","saving":"Savingâ¦","toasts":{"saved":"Risk settings saved.","load_failed":"Couldn't load risk settings.","save_failed":"Couldn't save risk settings."}},"severities":{"critical":"Critical","high":"High","medium":"Medium","low":"Low"},"statuses":{"open":"Open","resolved":"Resolved","dismissed":"Dismissed"},"kinds":{"single_threaded":"Single-threaded relationship","engagement_decay":"Engagement decaying","concerns_raised":"Concerns raised","pilot_stall":"Pilot stalling","going_dark":"Gone quiet","milestone_overdue":"Milestones overdue","manual":"Manual"},"manual_badge":"manual","dialog":{"title":"Add risk","title_label":"Title","title_placeholder":"What's the risk?","description_label":"Details","description_placeholder":"Optional context","severity_label":"Severity","submit":"Add risk","cancel":"Cancel"},"toasts":{"load_failed":"Couldn't load risk data","save_failed":"Couldn't save","delete_failed":"Couldn't delete","recompute_queued":"Recompute queued","recompute_failed":"Couldn't queue recompute","resolved":"Risk resolved","dismissed":"Risk dismissed","risk_created":"Risk added","risk_deleted":"Risk deleted"}},"view_toggle":{"customers":"Customers","themes":"Themes","icp":"ICP"},"icp":{"title":"Ideal Customer Profile","subtitle":"Describe the customers you want. Each email chain gets a verdict on how well it reflects this profile.","placeholder":"e.g. Mid-market fintech companies (50â500 employees) adopting embedded payments, evaluating within a quarter, with a named technical championâ¦","save":"Save","saving":"Savingâ¦","clear":"Clear","chars":"{{count}}/{{max}}","last_updated":"Updated {{ago}}","read_only_hint":"Only workspace admins can edit the ideal customer profile.","reeval_hint":"Saving re-evaluates the 20 most recent email chains per active customer.","stats_title":"Fit across all customers","stats_threads":"{{count}} chains evaluated","stats_customers":"{{count}} customers","stats_empty":"No chains evaluated yet.","fit_title":"ICP fit","fit_score":"{{pct}}% fit","rollup_no_score":"No score yet","rollup_rationale":"Weighted by confidence across {{scored}} decisive chains: {{fits}} fit, {{partial}} partial, {{does_not_fit}} don't fit. Unclear chains ({{unclear}}) don't count toward the score.","stale_count":"{{count}} chains were evaluated against an older ICP. Re-evaluate for an up-to-date score.","chains_title":"Email chains","chain_messages":"{{count}} messages","chain_untitled":"Untitled chain","empty_body":"Once this customer's email chains are evaluated against the ideal customer profile, their fit appears here.","not_configured_title":"No ideal customer profile yet","not_configured_body":"Define an ideal customer profile in the Ideal Customer Profile tab to see how well this customer fits.","evaluating":"Evaluating email chains","reevaluate":"Re-evaluate","confidence":"{{pct}}% confidence","signals_title":"Key signals","evaluated_ago":"Evaluated {{ago}}","stale_hint":"The ICP changed since this was evaluated. Re-evaluate for an up-to-date verdict.","verdicts":{"fits":"Fits","partial":"Partial fit","does_not_fit":"Doesn't fit","unclear":"Unclear"},"toasts":{"load_failed":"Couldn't load the ideal customer profile","save_failed":"Couldn't save the profile","saved":"Profile saved","cleared":"Profile cleared","reeval_queued":"Re-evaluating email chainsâ¦","reeval_failed":"Couldn't queue the re-evaluation"}},"feedback":{"title":"Feedback","extract":"Analyze","proposed":"Suggested","empty_title":"No feedback yet","empty_body":"Once this customer's messages are analyzed, the needs they raise appear here.","sentiment":{"positive":"Positive","neutral":"Neutral","negative":"Negative","frustrated":"Frustrated"},"toasts":{"load_failed":"Couldn't load feedback","extract_queued":"Feedback analysis queued","extract_failed":"Couldn't start analysis"}},"themes":{"untitled":"Untitled theme","select_prompt":"Select a theme to see its details.","recommendations":"Recommendations","view_customer":"View customer","items":"{{count}} feedback items","empty_title":"No themes yet","empty_body":"Themes group related feedback across your customers. They appear once feedback has been analyzed.","toasts":{"load_failed":"Couldn't load themes"}},"discovery":{"title":"Suggested customers","count":"{{events}} emails · {{contacts}} contacts","confirm":"Add","dismiss":"Dismiss","toasts":{"load_failed":"Couldn't load suggestions","dismissed":"Domain dismissed","dismiss_failed":"Couldn't dismiss domain"}}}`),report_issue:{tooltip:`Report a problem with this`,menu_item:`Report a problem`,chat_reply:`Chat reply`,chat_reply_in:`Chat reply in "{{title}}"`,dual_response:`Dual response`,dual_response_in:`Dual response in "{{title}}"`,suggestion:`Suggestion in {{filename}}`,suggestion_on:`Suggestion on {{clause}} in {{filename}}`,suggestion_on_clause:`Suggestion on {{clause}}`,suggestion_generic:`Redline suggestion`,document:`Document "{{filename}}"`,evaluation:`Evaluation of "{{filename}}"`,evaluation_answer:`Evaluation answer: {{question}}`,email_attachment:`Email attachment "{{filename}}"`,email_draft:`Email draft reply to "{{subject}}"`}},Iae={_meta:{interpolation_note:`{{count}} está reservado para la detección de plurales de i18next (_one/_other). {{name}}, {{email}}, {{title}}, {{date}}, {{provider}}, {{value}}, {{total}} son cadenas ya formateadas. Nunca pases Date o number directamente â formatea con src/lib/format.ts primero.`},ai:{activity:{thinking:`Pensandoâ¦`,analyzing:`Analizandoâ¦`,drafting_reply:`Redactando respuestaâ¦`,reviewing_redlines:`Revisando cambiosâ¦`,generating_suggestions:`Generando sugerenciasâ¦`,scoring:`Puntuandoâ¦`,processing:`Procesandoâ¦`,detecting_parties:`Detectando partesâ¦`,generating_guidance:`Generando orientaciónâ¦`,generating_reply:`Generando respuestaâ¦`,working:`Trabajandoâ¦`}},common:{save:`Guardar`,save_changes:`Guardar cambios`,saving:`Guardandoâ¦`,saved:`â Guardado`,cancel:`Cancelar`,delete:`Eliminar`,deleting:`Eliminandoâ¦`,edit:`Editar`,remove:`Quitar`,unlink:`Desvincular`,close:`Cerrar`,dismiss:`Descartar`,open:`Abrir`,create:`Crear`,creating:`Creandoâ¦`,update:`Actualizar`,updating:`Actualizandoâ¦`,retry:`Reintentar`,back:`Atrás`,next:`Siguiente`,continue:`Continuar`,confirm:`Confirmar`,yes:`SÃ`,no:`No`,search:`Buscar`,search_placeholder:`Buscarâ¦`,filter:`Filtrar`,loading:`Cargandoâ¦`,no_results:`Sin resultados`,no_data:`Sin datos`,view:`Ver`,send:`Enviar`,sending:`Enviandoâ¦`,sent:`Enviado`,upload:`Subir`,uploading:`Subiendoâ¦`,download:`Descargar`,download_original:`Descargar original`,download_version:`Descargar versión`,download_as_pdf:`Descargar como PDF`,n
95o_versions:`No hay versiones guardadas`,copy:`Copiar`,copied:`Copiado`,select:`Seleccionar`,select_all:`Seleccionar todo`,deselect_all:`Deseleccionar todo`,clear:`Borrar`,clear_all:`Borrar todo`,apply:`Aplicar`,reset:`Restablecer`,submit:`Enviar`,submitting:`Enviandoâ¦`,done:`Listo`,untitled:`Sin tÃtulo`,back_to_login:`Volver al inicio de sesión`,sign_in:`Iniciar sesión`,sign_up:`Registrarse`,sign_out:`Cerrar sesión`,settings:`Configuración`,all:`Todos`,none:`Ninguno`,more:`Más`,less:`Menos`,show:`Mostrar`,hide:`Ocultar`,expand:`Expandir`,collapse:`Contraer`,refresh:`Actualizar`,name:`Nombre`,description:`Descripción`,status:`Estado`,type:`Tipo`,date:`Fecha`,created:`Creado`,updated:`Actualizado`,actions:`Acciones`,options:`Opciones`,details:`Detalles`,optional:`opcional`,required:`obligatorio`,unknown:`Desconocido`,untitled_document:`Documento sin tÃtulo`,no_subject:`(sin asunto)`,no_sender:`(sin remitente)`,no_preview:`(sin vista previa)`,or:`o`,and:`y`,you:`Tú`},errors:{generic:`Algo salió mal`,try_again:`Inténtalo de nuevo.`,could_not_load:`No se pudo cargar`,could_not_save:`No se pudo guardar`,could_not_delete:`No se pudo eliminar`,network:`Error de red`,unauthorized:`No tienes autorización para esta acción`,not_found:`No encontrado`,invalid_input:`Entrada no válida`,rate_limited:`Estás haciendo eso demasiado rápido. Más despacio, por favor.`,unknown:`Error desconocido`,server_processing_failed:`Esto no se completó por un problema de nuestro lado. Inténtalo de nuevo y contacta con soporte si persiste.`,upload_failed:`No se pudo subir el archivo. Inténtalo de nuevo.`,download_failed:`No se pudo descargar el archivo. Inténtalo de nuevo.`,preview_failed:`No se pudo cargar la vista previa. Es posible que el enlace haya expirado.`,document_load_failed:`No se pudo cargar el documento`,document_delete_failed:`No se pudo eliminar el documento`,uploaded_but_not_in_kb:`Los archivos se subieron pero no se pudieron añadir a la base de conocimiento; encuéntralos en Sin asignar.`,send_message_failed:`No se pudo enviar el mensaje. Inténtalo de nuevo.`,stream_interrupted:`La respuesta se interrumpió. Inténtalo de nuevo.`,save_failed:`No se pudieron guardar los cambios. Inténtalo de nuevo.`,create_failed:`No se pudo crear. Inténtalo de nuevo.`,fetch_failed:`No se pudieron cargar los datos. Inténtalo de nuevo.`,gmail_not_available_title:`Gmail no está disponible en esta cuenta de Google`,gmail_not_available_body:`La cuenta de Google que conectaste no tiene Gmail habilitado. Para usar las funciones de correo, conecta una cuenta de Google diferente.`,gmail_not_available_cta:`Administrar integraciones`},toasts:{common:{saved:`Guardado`,save_failed:`Error al guardar`,deleted:`Eliminado`,delete_failed:`Error al eliminar`,copied:`Copiado al portapapeles`,copy_failed:`Error al copiar`,loaded:`Cargado`,load_failed:`Error al cargar`,created:`Creado`,create_failed:`Error al crear`,updated:`Actualizado`,update_failed:`Error al actualizar`,sent:`Enviado`,send_failed:`Error al enviar`},auth:{login_failed:`Error al iniciar sesión`,logged_out:`Sesión cerrada`,session_expired:`Tu sesión ha expirado. Inicia sesión de nuevo.`},settings:{profile_saved:`Cambios enviados.`,profile_save_failed:`Error al enviar los cambios. Inténtalo de nuevo.`,password_required:`Se requiere la contraseña actual para establecer una nueva.`,language_changed:`Idioma actualizado`},chat:{message_copied:`Mensaje copiado`,copy_failed:`Error al copiar el mensaje`,feedback_sent:`Gracias por tus comentarios`,feedback_failed:`No se pudieron enviar los comentarios`,conversation_deleted:`Conversación eliminada`,conversation_delete_failed:`Error al eliminar la conversación`,stream_failed:`Error al generar la respuesta`,stream_cancelled:`Respuesta cancelada`,no_documents_selected:`Selecciona al menos un documento`,context_too_long:`El contenido pegado es demasiado largo. Se guardó como documento.`,context_save_failed:`Error al guardar el contenido como documento`,unpin_failed:`Error al quitar el documento de la conversación`},documents:{uploaded:`Documento subido`,upload_failed:`Error al subir el documento`,deleted:`Documento eliminado`,delete_failed:`Error al eliminar el documento`,renamed:`Documento renombrado`,rename_failed:`Error al renombrar el documento`},kb:{created:`Base de conocimiento creada`,create_failed:`Error al crear la base de conocimiento`,deleted:`Base de conocimiento eliminada`,delete_failed:`Error al eliminar la base de conocimiento`,updated:`Base de conocimiento actualizada`,update_failed:`Error al actualizar la base de conocimiento`,documents_added:`Documentos añadidos`,documents_add_failed:`Error al añadir documentos`,documents_removed:`Documentos eliminados`,documents_remove_failed:`Error al eliminar documentos`},matter:{created:`Asunto creado`,create_failed:`Error al crear el asunto`,updated:`Asunto actualizado`,update_failed:`Error al actualizar el asunto`,deleted:`Asunto eliminado`,delete_failed:`Error al eliminar el asunto`},redline:{saved:`Marcado guardado`,version_saved:`Versión guardada`,save_failed:`Error al guardar el marcado`,accepted:`Cambio aceptado`,rejected:`Cambio rechazado`,suggestion_applied:`Sugerencia aplicada`,suggestion_apply_failed:`Error al aplicar la sugerencia`,suggestion_unapply_failed:`Error al deshacer la sugerencia aplicada`,suggestion_save_failed:`No se pudieron guardar los cambios sugeridos. Vuelve a pedirlos para reintentar.`,partial_apply:`No se pudieron localizar {{failed}} de {{total}} sugerencias; siguen pendientes`,finalize_unapplied_warning:`{{count}} sugerencia(s) sin revisar; no se incluirán en la descarga`,suggestion_rejected:`Sugerencia rechazada`,reattribute_failed:`No se pudieron reatribuir los cambios registrados`},evaluation:{started:`Evaluación iniciada`,start_failed:`Error al iniciar la evaluación`,deleted:`Evaluación eliminada`,delete_failed:`Error al eliminar la evaluación`},playbook:{created:`Manual creado`,create_failed:`Error al crear el manual`,deleted:`Manual eliminado`,delete_failed:`Error al eliminar el manual`,uploaded:`Manual subido`,upload_failed:`Error al subir el manual`,processing:`Estamos procesando tu manual, aparecerá en breve.`,unsupported_file:`Tipo de archivo no admitido. Aceptados: {{types}}`},mail:{archived:`Correo archivado`,archive_failed:`Error al archivar el correo`,deleted:`Correo eliminado`,delete_failed:`Error al eliminar el correo`,marked_read:`Marcado como leÃdo`,marked_unread:`Marcado como no leÃdo`,mark_failed:`Error al actualizar el correo`,draft_saved:`Borrador guardado`,draft_save_failed:`Error al guardar el borrador`,draft_sent:`Borrador enviado`,draft_send_failed:`Error al enviar el borrador`,task_dismissed:`Tarea descartada`,task_dismiss_failed:`Error al descartar la tarea`,task_started:`Tarea iniciada`,task_start_failed:`Error al iniciar la tarea`,undo_archive:`Deshacer archivado`,undo_delete:`Deshacer eliminación`,undo:`Deshacer`,undone:`Deshecho`,undo_failed:`No se pudo deshacer`,attachment_saved_to_kb:`Guardado en la base de conocimiento â procesandoâ¦`,attachment_save_failed:`Error al guardar el archivo adjunto en la base de conocimiento`,attachment_download_failed:`Error al descargar el archivo adjunto`,attachment_open_failed:`Error al abrir el archivo adjunto`},booking:{link_created:`Enlace de reserva creado`,link_create_failed:`Error al crear el enlace de reserva`,link_deleted:`Enlace de reserva eliminado`,link_delete_failed:`Error al eliminar el enlace de reserva`,link_saved:`Enlace de reserva guardado`,link_save_failed:`Error al guardar el enlace de reserva`,link_url_copied:`URL del enlace copiada`,booking_c
95ancelled:`Reserva cancelada`,booking_cancel_failed:`Error al cancelar la reserva`,booked:`Reserva confirmada`,book_failed:`Error al reservar`},calendar:{event_created:`Evento creado`,event_create_failed:`Error al crear el evento`},org:{switched:`Espacio de trabajo cambiado`,invited:`Invitación enviada`,invite_failed:`Error al enviar la invitación`,invite_revoked:`Invitación revocada`,invite_revoke_failed:`Error al revocar la invitación`,member_removed:`Miembro eliminado`,member_remove_failed:`Error al eliminar al miembro`,role_updated:`Rol actualizado`,role_update_failed:`Error al actualizar el rol`,invite_accepted:`Invitación aceptada`,invite_accept_failed:`Error al aceptar la invitación`},billing:{subscribed:`Suscripción activa`,subscribe_failed:`Error al iniciar la suscripción`,cancelled:`Suscripción cancelada`,cancel_failed:`Error al cancelar la suscripción`,credits_purchased:`Créditos comprados`,credits_purchase_failed:`Error al comprar créditos`},api_keys:{created:`Clave API creada`,create_failed:`Error al crear la clave API`,deleted:`Clave API eliminada`,delete_failed:`Error al eliminar la clave API`,copied:`Clave API copiada`,postman_failed:`Error al descargar la colección de Postman`,postman_downloaded:`Colección de Postman descargada â pega tu clave API en la variable api_key para ejecutarla`,postman_downloaded_partial:`Descargada â {{filled}} de {{total}} ids de ejemplo rellenados. Las peticiones a recursos que aún no tienes devolverán 404; vuelve a descargarla cuando los hayas añadido.`},integrations:{gmail_connected:`Gmail conectado`,gmail_disconnected:`Gmail desconectado`,outlook_connected:`Outlook conectado`,outlook_disconnected:`Outlook desconectado`,slack_connected:`Slack conectado`,slack_disconnected:`Slack desconectado`,connect_failed:`Error al conectar la integración`,disconnect_failed:`Error al desconectar la integración`,gmail_not_provisioned:`Gmail no está habilitado en la cuenta de Google que conectaste.`,gmail_not_provisioned_action:`Administrar`,imap_connected:`Buzón IMAP conectado`,imap_disconnected:`Buzón IMAP desconectado`},notifications:{all_marked_read:`Todas las notificaciones marcadas como leÃdas`,mark_read_failed:`Error al marcar como leÃdo`,cleared:`Notificaciones eliminadas`,clear_failed:`Error al eliminar las notificaciones`},finance:{saved:`Documento guardado`,save_failed:`Error al guardar el documento`,created:`Documento creado`,create_failed:`Error al crear el documento`,deleted:`Documento eliminado`,delete_failed:`Error al eliminar el documento`},password_reset:{link_sent:`Enlace de restablecimiento enviado`,link_failed:`No se pudo enviar el enlace`,password_updated:`Contraseña actualizada`,password_update_failed:`No se pudo actualizar la contraseña`,invalid_token:`Este enlace de restablecimiento no es válido o ha caducado.`},feedback:{sent:`Comentarios enviados`,send_failed:`Error al enviar los comentarios`},post_payment:{success:`Pago exitoso, ¡gracias!`,cancelled:`Pago cancelado`}},auth:{login:{title:`Inicia sesión en tu cuenta`,description:`Introduce tu correo electrónico para iniciar sesión`,email_label:`Correo electrónico`,password_label:`Contraseña`,forgot_password:`¿Olvidaste tu contraseña?`,submit:`Iniciar sesión`,submitting:`Iniciando sesión...`,no_account:`¿No tienes una cuenta?`,error_unauthorized:`Usuario o contraseña incorrectos.`,error_generic:`Error al iniciar sesión`,account_deleted_toast:`Cuenta eliminada.`},signup:{title:`Crear una cuenta`,description:`Introduce tu información para crear tu cuenta`,account_type_label:`Tipo de cuenta`,account_type_personal:`Personal`,account_type_organization:`Organización`,organization_name_label:`Nombre de la organización`,organization_name_placeholder:`Acme Inc.`,organization_name_description:`Serás el propietario administrador. Invita a tu equipo desde la configuración.`,first_name_label:`Nombre`,first_name_placeholder:`Juan`,last_name_label:`Apellido`,last_name_placeholder:`Pérez`,email_label:`Correo electrónico`,email_description:`Lo usaremos para contactarte. No compartiremos tu correo con nadie más.`,phone_label:`Número de teléfono (opcional)`,phone_description:`Para notificaciones por SMS sobre tus contratos. Incluye el código de paÃs si estás fuera de EE. UU.`,phone_invalid:`Introduce un número de teléfono válido, p. ej. +1 (555) 123-4567.`,password_label:`Contraseña`,password_description:`Debe tener al menos 8 caracteres.`,confirm_password_label:`Confirmar contraseña`,confirm_password_description:`Confirma tu contraseña.`,submit:`Crear cuenta`,submitting:`Creando cuenta...`,have_account:`¿Ya tienes una cuenta?`,error_password_short:`La contraseña debe tener al menos 8 caracteres`,error_passwords_mismatch:`Las contraseñas no coinciden`,error_generic:`Error en el registro`},forgot_password:{title:`¿Olvidaste tu contraseña?`,description:`Introduce tu correo electrónico y te enviaremos un enlace para restablecerla.`,email_label:`Correo electrónico`,submit:`Enviar enlace`,submitting:`Enviando...`,remember_password:`¿Recuerdas tu contraseña?`,error_generic:`Algo salió mal. Inténtalo de nuevo.`,confirmation_title:`Revisa tu bandeja de entrada`,confirmation_description:`Si existe una cuenta para {{email}}, te hemos enviado un enlace para restablecer tu contraseña. El enlace caduca en 30 minutos.`},reset_password:{title:`Restablece tu contraseña`,description:`Elige una nueva contraseña para tu cuenta.`,new_password_label:`Nueva contraseña`,confirm_password_label:`Confirmar contraseña`,submit:`Actualizar contraseña`,submitting:`Actualizando...`,success_title:`Contraseña actualizada`,success_description:`Tu contraseña se ha actualizado. Ya puedes iniciar sesión.`,error_token_missing:`Falta el token en este enlace de restablecimiento.`,error_token_invalid:`Este enlace de restablecimiento no es válido o ha caducado.`,error_password_short:`La contraseña debe tener al menos 8 caracteres`,error_passwords_mismatch:`Las contraseñas no coinciden`,error_generic:`No se pudo actualizar la contraseña.`},signup_complete:{title:`Revisa tu bandeja de entrada`,description:`Te hemos enviado un enlace de verificación a {{email}}. Haz clic para activar tu cuenta.`,resend:`Reenviar verificación`,back:`Volver al inicio de sesión`}},settings:{title:`Configuración`,description:`Administra tu cuenta y preferencias de documentos.`,back_to_app:`Volver a la app`,groups:{account:`Cuenta`,billing:`Facturación`,notifications:`Notificaciones`,developer:`Desarrollador`,supp
95ort:`Soporte`},tabs:{profile:`Perfil`,organization:`Organización`,billing:`Facturación`,usage:`Uso`,extra_usage:`Uso adicional`,integrations:`Integraciones`,notifications:`Notificaciones`,api_keys:`Claves API`,support:`Soporte`},profile:{description:`Tu nombre, datos de contacto, idiomas y contraseña.`,change_photo:`Cambiar foto`,remove_photo:`Quitar foto`,photo_uploading:`Subiendoâ¦`,photo_updated:`Foto de perfil actualizada`,photo_removed:`Foto de perfil eliminada`,photo_error:`No se pudo actualizar tu foto de perfil. Inténtalo de nuevo.`,first_name:`Nombre`,last_name:`Apellido`,email:`Correo electrónico`,email_verification_note:`Se enviará un correo de verificación cuando esté habilitado.`,phone_number:`Número de teléfono`,phone_verified:`Verificado`,phone_unverified:`Sin verificar`,phone_placeholder:`+1 (555) 123-4567`,phone_help:`Usado para notificaciones por SMS. Incluye el código de paÃs si estás fuera de EE. UU.`,phone_invalid:`Introduce un número de teléfono válido, p. ej. +1 (555) 123-4567.`,response_language:`Idioma de respuesta`,response_language_help:`La IA responderá en este idioma. Las citas directas del contrato se mantienen en el idioma original.`,ui_language:`Idioma de la interfaz`,ui_language_help:`El idioma utilizado en la interfaz de la aplicación.`,timezone:`Zona horaria`,timezone_help:`Las rutinas, el resumen diario y el resumen por SMS se ejecutan en esta zona horaria.`,redline_author_name:`Nombre del autor en los cambios`,redline_author_name_help:`Se muestra como autor de los cambios con seguimiento que apliques. Déjalo en blanco para usar tu nombre.`,current_password:`Contraseña actual`,new_password:`Nueva contraseña`,new_password_placeholder:`MÃn. 8 caracteres`,delete_account:`Eliminar cuenta`,save_error_no_current_password:`Se requiere la contraseña actual para establecer una nueva.`,save_error_blank_name:`El nombre y el apellido son obligatorios.`,save_error_generic:`Error al guardar los cambios.`,save_success_toast:`Cambios enviados.`,save_error_toast:`Error al enviar los cambios. Inténtalo de nuevo.`,replay_tour:`Tour del producto`,replay_tour_help:`Reproduce el tour de bienvenida desde el panel.`,replay_tour_action:`Reproducir tour`},billing:{title:`Facturación`,description:`Administra tu suscripción y métodos de pago.`,current_plan:`Plan actual`,plan_free:`Gratis`,plan_pro:`Pro`,plan_unlimited:`Ilimitado`,manage_subscription:`Administrar suscripción`,upgrade:`Mejorar`,upgrade_to_pro:`Pasar a Pro`,downgrade:`Cambiar a un plan inferior`,cancel_subscription:`Cancelar suscripción`,subscription_active:`Tu suscripción está activa.`,subscription_cancels_on:`La suscripción se cancelará el {{date}}.`,billing_period:`Periodo de facturación actual`,renews_on:`Se renueva el {{date}}`,no_subscription:`No tienes una suscripción activa.`,starting_checkout:`Abriendo el pagoâ¦`,opening_portal:`Abriendo el portal de facturaciónâ¦`},usage:{title:`Uso`,description:`Consulta tu uso en el periodo de facturación actual.`,credits_used:`Créditos usados`,messages_sent:`Mensajes enviados`,documents_processed:`Documentos procesados`,remaining_credits:`Créditos restantes`,remaining_messages:`Mensajes restantes`,billing_period_start:`Inicio del periodo`,billing_period_end:`Fin del periodo`,no_usage:`Sin uso en este periodo.`,loading:`Cargando usoâ¦`,used:`usado`,left:`restante`,remaining_label:`{{remaining}} / {{total}} restantes`},extra_usage:{title:`Uso adicional`,description:`Compra créditos adicionales y limita el gasto que excede tu plan.`,buy_credits:`Comprar créditos`,credits_available:`Créditos disponibles`,enable_overage:`Habilitar excedente`,overage_enabled:`Excedente habilitado`,overage_disabled:`Excedente deshabilitado`,spend_cap:`LÃmite de gasto`,spend_cap_help:`Gasto máximo adicional por periodo de facturación.`,save_cap:`Guardar lÃmite`},integrations:{title:`Integraciones`,description:`Conecta un buzón o espacio de Slack para que modInsight trabaje con ellos.`,gmail:`Gmail`,gmail_description:`Sincroniza la bandeja de entrada y procesa correos de contratos.`,outlook:`Outlook`,outlook_description:`Sincroniza la bandeja de entrada y procesa correos de contratos.`,slack:`Slack`,slack_description:`EnvÃa notificaciones y chatea desde Slack.`,connect:`Conectar`,connecting:`Conectandoâ¦`,disconnect:`Desconectar`,disconnecting:`Desconectandoâ¦`,connected:`Conectado`,connected_as:`Conectado como {{email}}`,connection_error:`Error de conexión`,reauthorize:`Reautorizar`,scope_missing:`Faltan algunos permisos. Reautoriza para concederlos.`,imap:`IMAP / SMTP`,imap_description:`Conecta cualquier buzón por IMAP/SMTP, para proveedores que no son Google ni Microsoft.`,imap_dialog:{title:`Conectar buzón IMAP`,title_reconnect:`Reconectar buzón IMAP`,title_add:`Agregar buzón IMAP`,description:`Conecta cualquier buzón por IMAP/SMTP. Verificaremos la conexión antes de guardar.`,email_label:`Dirección de correo`,username_label:`Usuario`,username_help:`Normalmente tu dirección de correo completa. Cámbialo solo si tu proveedor usa un nombre de inicio de sesión distinto.`,password_label:`Contraseña`,password_help:`Usa una contraseña de aplicación si tu proveedor lo requiere.`,incoming_section:`Correo entrante (IMAP)`,outgoing_section:`Correo saliente (SMTP)`,host_label:`Servidor`,host_placeholder:`imap.ejemplo.com`,smtp_host_placeholder:`smtp.ejemplo.com`,port_label:`Puerto`,ssl_label:`Usar SSL/TLS`,submit:`Conectar y verificar`,verifying:`Verificandoâ¦`,connect_failed:`No se pudo conectar. Revisa la configuración e inténtalo de nuevo.`,caldav_section:`Calendario y tareas (CalDAV)`,caldav_url_label:`U
95RL de CalDAV (opcional)`,caldav_url_placeholder:`dav.ejemplo.com`,caldav_url_help:`Servidor CalDAV de tu proveedor â un dominio o URL completa (p. ej. dav.privateemail.com). Déjalo vacÃo para conectar solo el correo.`,caldav_advanced:`Avanzado: credenciales CalDAV separadas`,caldav_username_label:`Usuario de CalDAV`,caldav_password_label:`Contraseña de CalDAV`,caldav_advanced_help:`Solo es necesario cuando el servidor CalDAV usa credenciales distintas a las del buzón.`,caldav_connect_failed:`El correo se conectó, pero no se pudo acceder a CalDAV. Revisa la URL y las credenciales.`},imap_config:{title:`Detalles de la cuenta IMAP`,description:`Detalles de conexión de este buzón. Las contraseñas nunca se muestran â vuelve a conectar para cambiarlas.`,mail_section:`Servidores de correo`,email:`Correo`,imap_server:`Servidor IMAP`,smtp_server:`Servidor SMTP`,username:`Usuario`,password:`Contraseña`,last_sync:`Ãltima sincronización`,last_failure:`Ãltimo error`,caldav_section:`Calendario y tareas (CalDAV)`,caldav_active:`Activo`,caldav_disabled:`Desactivado`,caldav_not_connected:`No hay servidor CalDAV conectado. Vuelve a conectar el buzón y agrega una URL de CalDAV para sincronizar calendario y tareas.`,caldav_url:`URL de CalDAV`,caldav_override:`personalizado`,caldav_collections:`Colecciones descubiertas`,component_events:`Eventos`,component_tasks:`Tareas`,caldav_disconnect:`Desconectar CalDAV`,caldav_disconnect_failed:`No se pudo desconectar CalDAV.`}},notifications_view:{title:`Notificaciones`,description:`Elige si recibes las actualizaciones por correo, SMS o ambos.`,email_notifications:`Notificaciones por correo`,email_notifications_help:`Recibe actualizaciones de tareas y contratos por correo electrónico.`,sms_notifications:`Notificaciones por SMS`,sms_notifications_help:`Recibe avisos de finalización por SMS.`,phone_required:`Añade un número de teléfono verificado para habilitar SMS.`,verify_phone:`Verificar teléfono`},api_keys:{description:`Concede acceso programático a la búsqueda de documentos, bases de conocimiento y chat.`,view_docs:`Ver documentación de la API`,download_postman:`Descargar colección de Postman`,example_request:`Solicitud de ejemplo`,key_name:`Nombre de la clave`,key_name_placeholder:`p. ej. Producción`,create:`Crear`,creating:`Creandoâ¦`,save_key_warning:`Copia tu clave ahora. No podrás volver a verla.`,created_at:`Creada`,last_used:`Ãltimo uso`,revoked:`Revocada`,no_keys:`TodavÃa no hay claves API.`},organization:{title:`Organización`,description:`Administra tu organización, miembros y roles.`,no_org_active:`No estás en un espacio de organización. Cambia de espacio para gestionar una.`,members:`Miembros`,pending_invites:`Invitaciones pendientes`,invite_member:`Invitar miembro`,leave_org:`Salir de la organización`,rename_org:`Renombrar organización`,org_name_label:`Nombre de la organización`,save_name:`Guardar nombre`},support:{description:`Tus tickets de soporte y las respuestas de nuestro equipo.`},footer_privacy:`Tus datos están cifrados, seguros y son privados`},nav:{dashboard:`Panel`,shared:`Compartido`,chat:`Chat`,vault:`Bóveda`,matters:`Asuntos`,mail:`Bandeja de entrada`,booking_links:`Calendario`,routines:`Rutinas`,console:`Consola`,evaluations:`Evaluaciones`,playbooks:`Playbooks`,settings:`Configuración`,user_menu:{usage_metrics:`Métricas de uso`,organizations:`Organizaciones`,settings:`Configuración`,terms_of_service:`Términos del servicio`,privacy_policy:`PolÃtica de privacidad`,contact_support:`Contactar con soporte`,sign_out:`Cerrar sesión`,guest:`Invitado`},customers:`Clientes`},personas:{default:`Predeterminado`,new_persona:`Nuevo perfil`,manage_personas:`Administrar perfiles`,personas:`Perfiles`,no_personas:`Sin perfiles`,create_first:`Crea tu primer perfil`,subtitle:`Instrucciones permanentes que sigue el asistente`,search_placeholder:`Buscar perfilesâ¦`,no_match:`Ningún perfil coincide con «{{query}}»`,empty_hint:`Guarda instrucciones reutilizables para más adelante`,set_default:`Establecer como predeterminado`,unset_default:`Quitar predeterminado`,default_hint:`Se aplica automáticamente a los chats nuevos`,description_label:`Descripción`,description_placeholder:`Un resumen breve que se muestra en el selector`,name_placeholder:`Nombre del perfil`,content_label:`Instrucciones`,content_placeholder:`# TÃtulo 96 97Escribe instrucciones permanentes en markdownâ¦`,markdown_hint:`Compatible con markdown`,chars_of_max:`{{count}} / 20 000`,tokens_estimate:`~{{tokens}} tokens`,source:`Fuente`,rendered:`Vista`,download_md:`Descargar .md`,import_md:`Importar .md`,import_hint:`Suelta un archivo .md, .markdown o .txt, o haz clic para elegir`,import_failed:`No se pudo leer ese archivo`,start_from_template:`Empezar desde una plantilla`,blank:`En blanco`,detail_sr:`Detalles del perfil`,dialog_title:`Nuevo perfil`,dialog_description:`Una hoja reutilizable de instrucciones para el asistente.`,load_failed:`No se pudo cargar este perfil`,templates:{inhouse_counsel:{name:`AsesorÃa interna`,description:`Revisión práctica y consciente del riesgo, del lado de la empresa.`,content:`# Asesor
97Ãa interna 98 99Actúas como asesorÃa jurÃdica interna y pragmática. Protege a la empresa sin frenar los acuerdos. 100 101## Prioridades 102 103- Señala primero el riesgo material: lÃmites de responsabilidad, indemnizaciones, terminación, propiedad intelectual, protección de datos. 104- Distingue los bloqueos reales de lo deseable. Indica cuál es cuál. 105- Prefiere posiciones de mercado estándar antes que redacción a medida. 106 107## Estilo 108 109- Empieza por la recomendación y luego el razonamiento. 110- Cita la cláusula exacta a la que te refieres. 111- Si algo es aceptable, dilo con claridad en lugar de matizar. 112`},deal_desk:{name:`Mesa de acuerdos`,description:`Triaje rápido centrado en llegar a la firma.`,content:`# Mesa de acuerdos 113 114Ayudas a una mesa de acuerdos a agilizar contratos sin pasar por alto los términos que importan comercialmente. 115 116## Enfoque 117 118- Precio, condiciones de pago, renovación y renovación automática, y cualquier aumento de tarifas. 119- Alcance, niveles de servicio y qué se considera incumplimiento. 120- Todo lo que cambie el reconocimiento de ingresos o la fecha de cierre. 121 122## Resultado 123 124- Da una lectura breve de adelante / precaución / alto al inicio. 125- Enumera los dos o tres puntos a negociar, en orden. 126- Sé conciso; supón que quien lee tiene prisa. 127`},plain_english:{name:`Lenguaje claro`,description:`Explica el lenguaje legal de forma sencilla, sin tecnicismos.`,content:`# Lenguaje claro 128 129Explica los contratos en lenguaje sencillo para alguien sin formación jurÃdica. Nunca des por hecho conocimientos legales. 130 131## Cómo responder 132 133- Traduce cada cláusula a lo que significa en la práctica. 134- Detalla quién debe hacer qué, para cuándo y qué pasa si no lo hace. 135- Define cualquier término legal inevitable la primera vez que aparezca. 136 137## Tono 138 139- Frases cortas. Una idea a la vez. 140- Usa ejemplos cotidianos cuando ayuden. 141- Resalta en negrita todo lo que sea sorprendente o desequilibrado. 142`},redline_reviewer:{name:`Revisor de cambios`,description:`Propone ediciones concretas, no solo comentarios.`,content:`# Revisor de cambios 143 144Revisas contratos proponiendo ediciones concretas, no solo observaciones. 145 146## Para cada punto 147 148- Nombra la cláusula y el problema en una lÃnea. 149- Propón una redacción sustitutiva que lo resuelva. 150- Indica la posición alternativa si la otra parte se resiste. 151 152## Disciplina 153 154- Edita solo lo necesario; deja intactos los términos aceptables. 155- Mantén un estilo de redacción coherente con el resto del documento. 156- Nunca debilites una protección al mejorar la legibilidad. 157`},formal_memo:{name:`Memorando formal`,description:`Análisis estructurado y citable en registro formal.`,content:`# Memorando formal 158 159Responde como un memorando jurÃdico formal, apto para un expediente o un socio. 160 161## Estructura 162 163- Abre con un breve planteamiento del tema y una conclusión principal. 164- Luego el análisis, organizado por tema, cada uno con su encabezado. 165- Cierra con los próximos pasos recomendados. 166 167## Criterios 168 169- Cita la cláusula o sección concreta para cada afirmación. 170- Distingue lo que dice el documento de lo que infieres. 171- Mantén un registro mesurado y profesional en todo momento. 172`}}},prompts:{title:`Indicaciones`,new_prompt:`Nueva indicación`,no_prompts:`Sin indicaciones guardadas`,saved_prompts:`Indicaciones guardadas`,use:`Usar`,lines_one:`{{count}} lÃnea`,lines_other:`{{count}} lÃneas`,characters:`caracteres`,last_used:`Ãltimo uso {{date}}`,never_used:`Nunca usado`,edit_prompt:`Editar indicación`,delete_prompt:`Eliminar indicación`,prompt_name:`Nombre`,prompt_body:`Cuerpo`,tokens_one:`{{count}} token`,tokens_other:`{{count}} tokens`},knowledge_bases:{title:`Bases de conocimiento`,new_kb:`Nueva base de conocimiento`,kb_name:`Nombre`,kb_description:`Descripción`,documents:`Documentos`,documents_one:`{{count}} documento`,documents_other:`{{count}} documentos`,no_documents:`Sin documentos`,no_kbs:`Sin bases de conocimiento`,create_first:`Crea tu primera base de conocimiento`,select_kb:`Seleccionar base de conocimiento`,manage:`Administrar`,edit_kb:`Editar base de conocimiento`,delete_kb:`Eliminar base de conocimiento`,add_documents:`Añadir documentos`,remove_from_kb:`Quitar de la base de conocimiento`,unassigned:`Sin asignar`,unassigned_one
172:`Sin asignar ({{count}} elemento)`,unassigned_other:`Sin asignar ({{count}} elementos)`,filter_placeholder:`Filtrar por nombreâ¦`,no_filter_results:`Sin coincidencias`,status_completed:`Completado`,status_processing:`Procesando`,status_failed:`Fallido`,status_reference:`Referencia`,type_pdf:`PDF`,type_word:`Word`,type_spreadsheet:`Hojas`,type_presentation:`Diapos`,type_image:`Imágenes`,type_text:`Texto`,bulk_delete:{title_one:`¿Eliminar {{count}} documento?`,title_other:`¿Eliminar {{count}} documentos?`,description:`Esto elimina permanentemente los documentos seleccionados. No se puede deshacer.`,confirm:`Eliminar`,deleting:`Eliminandoâ¦`}},vault:{title:`Bóveda`,description:`Todos tus documentos en un solo lugar.`,upload_document:`Subir documento`,upload_documents:`Subir documentos`,uploading:`Subiendoâ¦`,drag_drop:`Arrastra documentos aquà o haz clic para explorar`,no_documents:`Aún no hay documentos`,upload_first:`Sube tu primer documento`,document_count_one:`{{count}} documento`,document_count_other:`{{count}} documentos`,all_documents:`Todos los documentos`,recent:`Recientes`,delete_selected:`Eliminar seleccionados`,selected_one:`{{count}} seleccionado`,selected_other:`{{count}} seleccionados`,status_pending:`Pendiente`,status_processing:`Procesando`,status_completed:`Completado`,status_failed:`Fallido`,status_failed_twice:`Fallido`,process_again:`Procesar de nuevo`,rename:`Renombrar`,preview:`Vista previa`,document_viewer:`Visor de documentos`,document_preview_description:`Vista previa del documento seleccionado`},chat:{context_usage:`{{pct}}% de contexto`,context_limit:{hard_title:`LÃmite de contexto alcanzado`,hard_body:`Esta conversación es demasiado grande para que el modelo la procese en un solo turno. Inicia un chat nuevo (tu documento y un resumen se conservan) o compacta el historial para continuar aquÃ.`,hard_message:`Esta conversación alcanzó el lÃmite de contexto del modelo. Inicia un chat nuevo o compacta esta conversación para continuar.`,soft_title:`Este chat se está alargando`,soft_body:`Cuanto más larga es una conversación, más le cuesta al modelo recordar los detalles anteriores, por lo que las respuestas pueden desviarse. Para mantenerlas precisas, inicia un chat nuevo (tu documento y un resumen se conservan) o compacta el historial, o continúa de todos modos.`,fresh_title:`Iniciar un chat nuevo`,fresh_desc:`Abre una conversación nueva con tu documento adjunto y un resumen ya escrito en el redactor, listo para editar o enviar.`,fresh_action:`Empezar de nuevo`,compact_title:`Compactar esta conversación`,compact_desc:`Resume la conversación hasta ahora en un punto de control. La transcripción sigue visible y tu documento sigue adjunto; los mensajes siguientes usan el resumen más los turnos recientes.`,compact_action:`Compactar`,continue_anyway:`Continuar de todos modos`,compacted:`Conversación compactada`,compact_failed:`No se pudo compactar la conversación`,recap_failed:`No se pudo preparar el resumen`},new_chat:`Nuevo chat`,history:`Historial`,ask_anything:`Pregúntame lo que quieras â usa + para modos, conocimiento y archivosâ¦`,send_message:`Enviar mensaje`,stop_generating:`Detener generación`,regenerate:`Regenerar`,copy_message:`Copiar mensaje`,no_conversations:`Aún no hay conversaciones`,start_chatting:`Inicia una conversación`,today:`Hoy`,yesterday:`Ayer`,previous_7_days:`Ãltimos 7 dÃas`,previous_30_days:`Ãltimos 30 dÃas`,older:`Antiguas`,attached_documents:`Documentos adjuntos`,no_documents_attached:`Sin documentos adjuntos`,attach_documents:`Adjuntar documentos`,attach_redline:`Adjuntar marcado`,select_persona:`Seleccionar perfil`,model_picker:{requires_plan:`Requiere {{plan}}`},thinking:{label:`Profundidad de razonamiento`,low:`Ligero`,medium:`Equilibrado`,high:`Profundo`,xhigh:`Más profundo`,max:`Máximo`,default_suffix:`(predeterminado)`},benchmark:{menu_item:`Comparativas`,dialog_title:`Comparar dos modelos`,dialog_description:`Elige dos modelos. Cada mensaje se ejecuta en ambos, lado a lado, y cada modelo mantiene su propio hilo. Sigue comparando turno a turno y luego continúa con el modelo que prefieras.`,model_a_label:`Modelo A`,model_b_label:`Modelo B`,pick_model:`Elige un modelo`,same_model_error:`Elige dos modelos distintos para comparar.`,start:`Iniciar comparativa`,armed_chip:`Comparativa: {{a}} vs {{b}}`,dual_badge:`{{a}} vs {{b}}`,vs:`vs`,continue_with_model:`Continuar con este modelo`,prefer_response:`Preferir esta respuesta`,preferred_badge:`Preferida`,continued_badge:`Continuado`,winner_badge:`Ganadora`,discard_turn:`Descartar este turno`,side_failed:`Este modelo no pudo responder.`,no_response:`Sin respuesta.`,both_failed:`Ningún modelo pudo responder. El turno se descartó.`,prefer_failed:`No se pudo registrar tu preferencia.`,continue_failed:`No se pudo continuar con ese modelo.`,discard_failed:`No se pudo descartar el turno.`,stream_failed:`No se pudo iniciar la comparativa.`,pair_locked:`Esta conversación compara un par fijo de modelos. Continúa con uno de ellos antes de cambiar el par.`,single_send_blocked:`Continúa con uno de los dos modelos antes de enviar un mensaje normal.`,context_limit:`Esta conversación alcanzó el lÃmite de contexto del modelo. Inicia un chat nuevo o compacta esta conversación para continuar.`},select_prompt:`Seleccionar indicación`,viewer_read_only:`Estás en modo lector â el chat es de solo lectura aquÃ.`,stream_interrupted:`La conexión se interrumpió antes de terminar la respuesta. Se conservó la respuesta parcial â envÃa tu mensaje de nuevo para continuar.`,response_interrupted:`Respuesta interrumpida`,usage_limit_hint:`Has usado todos los créditos incluidos de este mes. Mejora tu plan para seguir chateando.`,tokens_estimate:`~{{value}} / {{total}} tokens`,message_too_long:`Mensaje demasiado largo ({{value}} / {{total}} tokens)`,upload_as_file:`Subir como archivo`,tokens_count:`~{{value}} tokens`,tokens_cap:`(lÃmite: {{total}})`,save_as_document:`Guardar como documento`,delete_conversation:`Eliminar conversación`,delete_conversation_confirm:`¿Eliminar esta conversación? No se puede deshacer.`,rename_conversation:`Renombrar conversación`,knowledge_base:`Base de conocimiento`,knowledge_base_all:`Todos los documentos`,inbox_scope:`Bandeja de entrada`,inbox_scope_hint:`Responde desde tu buzón conectado en lugar de tus documentos`,knowledge_base_select:`
172Seleccionar base de conocimiento`,long_paste_title:`Ese contenido es largo`,long_paste_description:`El contenido pegado tiene aproximadamente {{value}} tokens (lÃmite: {{total}}). Guárdalo como documento y se añadirá al contexto de la conversación.`,long_paste_save:`Guardar como documento`,long_paste_dismiss:`Cancelar`,long_paste_filename:`Nombre del archivo`,feedback_thumbs_up:`Ãtil`,feedback_thumbs_down:`No útil`,citations:`Citas`,context:`Contexto`,discussing:`Analizando`,unpin_document:`Quitar de la conversación`,open_document:`Abrir documento`,detach_document:`Quitar adjunto`,email_picker:{pick_prompt:`¿Qué buzón debo usar?`,use:`Usar`,reconnect:`Reconectar`,active:`Correo: {{provider}}`,switch:`Cambiar buzón`,clear:`Desactivar herramientas de correo`,checking:`Comprobando tus buzonesâ¦`},mode:`Modo`,mode_draft:`Redactar contrato`,mode_library:`Biblioteca`,attach_file:`Adjuntar archivo`,upload_new_file:`Subir archivo nuevo`,your_documents:`Tus documentos`,shared_with_me:`Compartido conmigo`,persona_chip_none:`Perfil`,persona_chip_aria:`Elige un perfil para esta conversación`,welcome:{heading:`¿En qué puedo ayudarte?`,subheading:`Haz una pregunta o empieza desde un perfil de abajo.`,pick_persona:`Empieza con un perfil`}},email:{tabs:{response:`Respuesta`,analysis:`Análisis`,redlines:`Marcados`,generated:`Doc generado`},analysis:{heading:`Análisis de riesgo`,email_heading:`Análisis del correo`,email_subtitle:`Basado en el mensaje y en la conversación hasta ahora, no en una revisión del contrato.`,not_analyzed_title:`No hay análisis disponible`,analyze_anyway:`Analizar de todas formas`,analyzing:`Analizandoâ¦`,analyze:`Analizar`,analyze_and_suggest:`Analizar y sugerir revisiones`,suggest_from_analysis:`Usar este análisis para sugerir revisiones`,redlining:`Sugiriendo revisionesâ¦`,redlines_not_generated:`Las revisiones de este documento no se generaron automáticamente.`,reasons:{no_reply:`Este correo se trató como un mensaje de cierre que no requerÃa acción, por lo que sus adjuntos no se analizaron.`,irrelevant:`Este correo se clasificó como irrelevante, por lo que no se ejecutó ningún análisis de documentos.`,nonlegal:`Este correo no se clasificó como legal, por lo que sus adjuntos se guardaron sin análisis de riesgo.`,draft_intent:`Este correo pedÃa redactar un documento, por lo que los adjuntos se trataron como material de referencia y no se analizaron.`,not_contract:`Este documento no parecÃa un contrato, por lo que el análisis de riesgo lo omitió.`,detection_failed:`No pudimos comprobar si este documento es un contrato. Puedes analizarlo de todos modos.`,not_analyzed:`Este documento se añadió fuera del flujo normal, por lo que aún no tiene análisis de riesgo.`,no_attachments:`Este correo no tiene adjuntos, asà que no hay nada que analizar.`,attachment_not_processed:`Los adjuntos de este correo aún no se han procesado. Usa el botón Procesar en un adjunto para ingerirlo primero.`,no_processable_attachments:`Ninguno de los adjuntos de este correo es de un tipo compatible, asà que no hay nada que analizar.`,attachments_restricted:`Los adjuntos de este correo están protegidos por derechos y no se pudieron descargar para su análisis.`,doc_failed:`El procesamiento de este documento falló, por lo que no hay análisis disponible.`,processing:`Este correo todavÃa se está procesando; el análisis aparecerá aquà cuando esté listo.`,outbound:`Este es un mensaje que enviaste. El análisis se ejecuta sobre los correos que recibes; revisa la copia recibida en esta conversación.`,skipped_by_gate:`Este documento se guardó y se leyó, pero las revisiones no se generaron automáticamente.`}},redlines:{failed_title:`No se pudieron generar las sugerencias`,failed_body:`No se pudieron generar las sugerencias de revisión para este documento.`,retry:`Reintentar generación`,retrying:`Reintentandoâ¦`,retry_needs_side:`Confirma tu parte arriba para reintentar el análisis.`,no_changes_title:`No se proponen cambios`,partial_title:`La revisión se detuvo antes de tiempo`,partial_body:`Algunas secciones de este documento no se revisaron. Las sugerencias mostradas cubren las secciones que sà se revisaron.`,not_word:`Este adjunto no es un documento de Word â el editor de revisiones necesita un .docx.`,skipped_title:`Las revisiones no se generaron automáticamente`,skipped_body:`modInsight decidió que este documento no necesitaba revisiones automáticas. Aún puedes generarlas.`,analyze_and_suggest:`Analizar y sugerir revisiones`,suggest_from_analysis:`Usar este análisis para sugerir revisiones`},thread:{title:`Conversación`,completed:`Completado`,completed_hint:`Este hilo está completado. Reábrelo para responder o hacer cambios.`,mark_completed:`Marcar como completado`,reopen:`Reabrir`,no_reply_title:`No requiere respuesta`,no_reply_hint:`Esto parece un mensaje de cierre que finaliza el hilo, por lo que no se generó ningún borrador. Marca el hilo como completado cuando termines.`,no_draft_title:`Sin borrador todavÃa`,no_draft_hint:`Aún no se ha redactado ninguna respuesta para este correo.`,already_responded_title:`Ya respondiste`,already_responded_hint:`Ya respondiste a este hilo fuera de la aplicación, por lo que este borrador ya no es necesario. Marca el hilo como completado cuando termines.`,view_draft_anyway:`Ver borrador de todas formas`,empty_no_task:`Selecciona un correo para ver su hilo`,loading:`Cargando hiloâ¦`,error:`No se pudo cargar el hilo`,not_processed:`Sin procesar`,revision_superseded_title:`Versión reemplazada`,revision_superseded_hint:`Llegó una versión más reciente de este contrato más adelante en este hilo. Estás viendo la ronda {{index}} de {{count}}: el análisis y las correcciones siguientes corresponden a este borrador anterior.`,revision_go_to_latest:`Ir a la última versión`,no_subject:`(sin asunto)`,business_days_since_last_one:`{{count}} dÃa hábil desde la última respuesta`,business_days_since_last_other:`{{count}} dÃas hábiles desde la última respuesta`,promote_title:`Promover a tarea`,promote_description:`Incorpora este mensaje al flujo. Crearemos una tarea en este hilo y la procesaremos.`,promote_intent_label:`¿Qué quieres hacer con él?`,promote_intent_draft:`Redactar una respuesta`,promote_intent_redline:`Marcar el adjunto`,promote_redline_needs_attachment:`Marcar requiere un documento adjunto; este mensaje no tiene ninguno, asà que redactaremos una respuesta.`,promote_playbook:`Manual (opcional)`,promote_playbook_none:`Sin manual`,promote_submit:`Promover`,promote_success:`Promoviendo el mensaje a una tareaâ¦`,step_latency:{moments:`momentos después`,minutes_one:`{{count}} min después`,minutes_other:`{{count}} min después`,hours_one:`{{count}} h después`,hours_other:`{{count}} h después`,hours_minutes:`{{hours}} h {{minutes}} min después`,business_days_one:`{{count}} dÃa hábil después`,business_days_other:`{{count}} dÃas hábiles después`,days_one:`{{count}} d después`,days_other:`{{count}} d después`},knowledge_base:`Base de conocimiento de referencia`,knowledge_base_inherit:`Heredar del asunto`},attachments:{restricted_title:`Archivos adjuntos con protección de derechos`,restricted_hint:`Los archivos adjuntos de este correo tienen protección de derechos y no se pudieron recuperar; ábrelo en Outlook para verlos.`},grounding:{grounded_on:`Basado en: {{name}}`,not_grounded:`Sin base de conocimiento de referencia`,rerun:`Repetir análisis`,rerun_started:`Repitiendo el análisis con la nueva referenciaâ¦`,unknown_kb:`una base de conocimiento`}},mail:{contacts:{reconnect_hint:`Vuelve a conectar para incluir todo tu directorio`},title:`Correo`,compose:`Redactar`,no_messages:`Sin mensajes`,no_messages_in_folder:`Sin mensajes en esta carpeta`,no_thread_selected:`Selecciona un mensaje para leer`,account_unusable:`Esta cuenta no está disponible para el correo en este momento.`,loading_messages:`Cargando mensajesâ¦`,refresh:`Actualizar`,refresh_stale_hint:`Hay actividad nueva: actualiza para verla`,search_placeholder:`Buscar correoâ¦`,folders:{inbox:`Bandeja de entrada`,drafts:`Borradores`,sent:`Enviados`,archive:`Archivo`,trash:`Papelera`,spam:`Spam`,tasks:`Tareas`,all:`Todos`,important:`Importantes`,starred:`Destacados`,snoozed:`Pospuestos`},labels:`Etiquetas`,custom_folders:`Carpetas`,providers:{gmail:`Gmail`,outlook:`Outlook`,slack:`Slack`,connect_gmail:`Conectar Gmail`,connect_outlook:`Conectar Outlook`,imap:`IMAP`,connect_imap:`Conectar IMAP`,connect_title:`Conecta una cuenta de correo`,connect_description:`Conecta un buzón para leer, buscar y responder tu correo en un solo lugar.`},message:{from:`De`,to:`Para`,cc:`Cc`,bcc:`Cco`,subject:`Asunto`,reply:`Responder`,reply_all:`Responder a todos`,forward:`Reenviar`,archive:`Archivar`,delete:`Eliminar`,mark_read:`Marcar como leÃdo`,mark_unread:`Marcar como no leÃdo`,attachments:`Archivos adjuntos`,download:`Descargar`,open:`Abrir`,save_to_kb:`Guardar en la base de conocimiento`,saved_to_kb:`Guardado`,saving:`Guardandoâ¦`,attachment_unavailable:`No se pudieron cargar los archivos adjuntos de este mensaje.`,attachment_blocked_hint:`Este archivo adjunto tiene protección de derechos o está alojado en la nube y no se puede descargar aquÃ.`,no_subject:`(sin asunto)`,show_quoted:`Mostrar texto citado`,hide_quoted:`Ocultar texto citado`},compose_view:{title:`Nuevo mensaje`,to_placeholder:`Destinatarios`,subject_placeholder:`Asunto`,body_placeholder:`Escribe tu mensajeâ¦`,send:`Enviar`,sending:`Enviandoâ¦`,save_draft:`Guardar borrador`,discard:`Descartar`,attach_file:`Adjuntar archivo`,recipient_required:`El destinatario es obligatorio`},shortcuts:{title:`Atajos de teclado`,reply:`Responder`,reply_all:`Responder a todos`,forward:`Reenviar`,archive:`Archivar`,delete:`Eliminar`,mark_unread:`Marcar como no leÃdo`,next:`Siguiente mensaje`,previous:`Mensaje anterior`,compose:`Redactar`},task:{title:`Tarea de correo`,status_classified:`Clasificado`,status_processing:`Procesando`,status_ready_for_review:`Listo para revisar`,status_reviewing:`En revisión`,status_draft_editing:`Editando borrador`,status_sent:`Enviado`,status_dismissed:`Descartado`,status_failed:`Fallido`,no_task:`No hay tarea asociada a este correo.`,start_task:`Iniciar tarea`,dismiss:`Descartar`,send_draft:`Enviar borrador`,edit_draft:`Editar borrador`,view_documents:`Ver documentos`,risk_analysis:`Análisis de riesgo`,suggestions:`Sugerencias`,analysis:`Análisis`,redlines:`Marcados`,tabs:{summary:`Resumen`,draft:`Borrador`,documents:`Documentos`,anal
172ysis:`Análisis`,redlines:`Marcados`}},draft:{title:`Borrador de respuesta`,send:`Enviar respuesta`,sending:`Enviandoâ¦`,regenerate:`Regenerar`,discard:`Descartar`}},matters:{title:`Asuntos`,personal:`Personal`,new_matter:`Nuevo asunto`,no_matters:`Aún no hay asuntos`,create_first:`Crea tu primer asunto`,search_placeholder:`Buscar asuntosâ¦`,open_matters:`Abiertos`,closed_matters:`Cerrados`,all_matters:`Todos`,new_dialog:{title:`Nuevo asunto`,description:`Crea un asunto para agrupar documentos y conversaciones.`,matter_name:`Nombre`,matter_name_placeholder:`p. ej. Adquisición Acme`,matter_description:`Descripción`,matter_description_placeholder:`Notas opcionales sobre este asunto`,create:`Crear asunto`,creating:`Creandoâ¦`},edit_dialog:{title:`Editar asunto`,save:`Guardar cambios`,delete:`Eliminar asunto`,delete_confirm:`¿Eliminar este asunto? Los documentos seguirán en tu bóveda.`},detail:{opened_on:`Abierto {{date}}`,closed_on:`Cerrado {{date}}`,close_matter:`Cerrar asunto`,reopen_matter:`Reabrir asunto`,edit_matter:`Editar asunto`,share_matter:`Compartir asunto`,shared_with_you:`Compartido contigo`},chat:{in_matter:`En el asunto`,in_matter_named:`En el asunto: {{name}}`},parties:{title:`Partes`,set_cta:`Haz clic aquà para definir las partes`,empty:`Aún no hay partes`,add:`Agregar parte`,remove:`Eliminar parte`,name_placeholder:`Nombre`,role_placeholder:`Rol`,email_placeholder:`Correo (opcional)`},evaluations_tab:{no_evaluations:`No hay evaluaciones para este asunto`,new_evaluation:`Nueva evaluación`},knowledge_bases_tab:{no_kbs:`Aún no hay bases de conocimiento vinculadas`,documents:`documentos`,default_badge:`Predeterminada`,set_default:`Predeterminar`,clear_default:`Quitar predeterminada`},tabs:{overview:`Resumen`,activity:`Actividad`,documents:`Documentos`,conversations:`Conversaciones`,calendar:`Calendario`,redlines:`Marcados`,evaluations:`Evaluaciones`,finance:`Finanzas`,legal:`Legal`,knowledge_bases:`Bases de conocimiento`,action_items:`Elementos de acción`,resources:`Recursos`},link_document:`Vincular documento`,link_conversation:`Vincular conversación`,link_evaluation:`Vincular evaluación`,link_knowledge_base:`Vincular base de conocimiento`,link_calendar_event:`Vincular evento`,link_document_desc:`Elige un documento de tu biblioteca para adjuntarlo a este asunto.`,link_calendar_event_desc:`Elige entre los eventos de los próximos 30 dÃas o los últimos 30 dÃas.`,no_candidates_to_link:`Nada que vincular.`,move_to_matter:`Mover a asunto`,move_thread:`Mover hilo a otro asunto`,thread_moved:`Hilo movido a {{name}}`,activity_tab:{empty:`Aún no hay actividad.`,empty_hint:`Aquà aparecerán los eventos de correos, evaluaciones y marcados vinculados a este asunto.`},overview:{no_overview:`Aún no hay resumen`,documents:`Documentos`,conversations:`Conversaciones`,recent_activity:`Actividad reciente`},documents_tab:{no_documents:`No hay documentos en este asunto`,add_documents:`Añadir documentos`},conversations_tab:{no_conversations:`No hay conversaciones en este asunto`,new_conversation:`Nueva conversación`},calendar_tab:{no_events:`No hay eventos para este asunto`,upcoming:`Próximos`,past:`Pasados`},redlines_tab:{no_redlines:`No hay marcados para este asunto`},finance_tab:{no_documents:`No hay documentos financieros para este asunto`,new_document:`Nuevo documento financiero`},emails_tab:{no_emails:`No hay correos para este asunto`},kbs_tab:{no_kbs:`No hay bases de conocimiento vinculadas`,link_kb:`Vincular base de conocimiento`},threads:{messages_one:`{{count}} mensaje`,messages_other:`{{count}} mensajes`,no_messages:`Sin mensajes`,whose_turn:`Tu turno`,their_turn:`Su turno`,sla_overdue:`Atrasado`,sla_today:`Vence hoy`,sla_upcoming:`Vence el {{date}}`,business_days_later_one:`{{count}} dÃa hábil después`,business_days_later_other:`{{count}} dÃas hábiles después`,delete:`Quitar hilo de los asuntos`,delete_confirm:`Esto elimina el hilo y todos sus correos y borradores de IA de este asunto. No elimina nada de tu buzón conectado (Gmail u Outlook), y los documentos procesados permanecen en tu bóveda. No se puede deshacer.`}},booking:{title:`Enlaces de reserva`,description:`Páginas públicas para que otros reserven horarios contigo.`,new_link:`Nuevo enlace de reserva`,no_links:`Aún no hay enlaces de reserva`,create_first:`Crea tu primer enlace de reserva`,edit:`Editar`,delete:`Eliminar`,copy_url:`Copiar URL`,url_copied:`URL copiada`,preview:`Vista previa`,describe:{button:`Describir con IA`,title:`Describe un enlace de reserva`,subtitle:`DescrÃbelo con naturalidad`,hint:`Prueba: «Intros de 30 min, de lunes a viernes de 9 a 5, 15 min de margen, pregunta su empresa»`,placeholder:`Describe tu disponibilidadâ¦`,confirm:`Crear`,creating:`Creandoâ¦`,edit:`Editar`,changed_prompt:`Sin problema. ¿Qué te gustarÃa cambiar?`,minutes_short:`min`,buffer:`+{{minutes}} min de margen`,notice:`{{duration}} de aviso`,per_day:`máx. {{count}}/dÃa`,question_one:`{{count}} pregunta`,question_other:`{{count}} preguntas`},fields:{name:`Nombre`,name_placeholder:`p. ej. Llamada introductoria`,slug:`Slug de la URL`,slug_placeholder:`llamada-introductoria`,duration_minutes:`Duración (minutos)`,buffer_minutes:`Margen (minutos)`,timezone:`Zona horaria`,availability:`Disponibilidad`,account:`Cuenta`,description:`Descripción`,description_placeholder:`Para qué es esta reunión`},non_primary_calendar_hint:`Usa el calendario predeterminado de esta cuenta.`,weekdays:{monday:`Lunes`,tuesday:`Martes`,wednesday:`Miércoles`,thursday:`Jueves`,friday:`Viernes`,saturday:`Sábado`,sunday:`Domingo`,short:{mon:`Lun`,tue:`Mar`,wed:`Mié`,thu:`Jue`,fri:`Vie`,sat:`Sáb`,sun:`Dom`}},public:{book_with:`Reserva con {{name}}`,pick_date:`Elige una fecha`,no_slots:`No hay horarios disponibles ese dÃa`,select_time:`Selecciona una hora`,confirm_booking:`Confirmar reserva`,booking_confirmed:`Reserva confirmada`,name_label:`Tu nombre`,email_label:`Tu correo electrónico`,notes_label:`Notas (opcional)`,book:`Reservar`,booking:`Reservandoâ¦`,confirmed_title:`Reserva confirmada`,confirmed_description:`Te hemos enviado una confirmación por correo. La reunión es el {{date}}
172.`,powered_by:`Potenciado por Contract RAG`},bookings:{title:`Reservas`,no_bookings:`Aún no hay reservas`,status_pending:`Pendiente`,status_confirmed:`Confirmada`,status_cancelled:`Cancelada`,details:`Detalles de la reserva`,start:`Inicio`,end:`Fin`,guest_name:`Nombre del invitado`,guest_email:`Correo del invitado`,notes:`Notas`,cancel_booking:`Cancelar reserva`}},dashboard:{title:`Panel`,welcome:`Bienvenido`,recent_documents:`Documentos recientes`,recent_chats:`Chats recientes`,upcoming_events:`Próximos eventos`,open_matters:`Asuntos abiertos`,inbox:`Bandeja de entrada`,calendar:`Calendario`,tasks:`Tareas`,create_event:`Crear evento`,no_events:`Sin eventos`,no_tasks:`Sin tareas`,no_inbox:`Nada nuevo`,view_all:`Ver todo`,month:`Mes`,week:`Semana`,day:`DÃa`,today:`Hoy`,time_on_site:{title:`Tiempo en el sitio`,total:`{{duration}} en total`,empty:`No se registró actividad este dÃa`,empty_all_time:`Aún no hay actividad registrada`,all_time:`Todo el tiempo`,other:`Otros`},todays_schedule:`Agenda de hoy`,search_results:`Resultados de búsqueda`,searching_description:`Buscando en todos los eventos y tareas sincronizados`,select_date:`Selecciona una fecha`,no_due_date:`Sin fecha de vencimiento`,no_incomplete_tasks:`Sin tareas pendientes`,no_matching_events:`Sin eventos coincidentes`,no_matching_tasks:`Sin tareas coincidentes`,search_placeholder:`Buscar eventos y tareasâ¦`,all_day:`Todo el dÃa`,no_title:`(Sin tÃtulo)`,location_label:`Ubicación:`,items_one:`{{count}} elemento`,items_other:`{{count}} elementos`,show_completed:`Mostrar completadas`,hide_completed:`Ocultar completadas`,daily_digest:`Resumen diario`,daily_digest_desc:`Tus tareas y reuniones de hoy`,tasks_today:`Tareas de hoy`,meetings_today:`Reuniones de hoy`,matters_your_turn:`Esperan tu respuesta`,no_tasks_today:`Sin tareas para hoy`,no_meetings_today:`Sin reuniones para hoy`,no_subject:`(Sin asunto)`,business_days_waited_one:`{{count}} dÃa laborable`,business_days_waited_other:`{{count}} dÃas laborables`,event_dialog:{title:`Nuevo evento`,event_title:`TÃtulo`,event_title_placeholder:`¿Cuál es el evento?`,start:`Inicio`,end:`Fin`,location:`Ubicación`,description:`Descripción`,create:`Crear evento`,creating:`Creandoâ¦`},unified_inbox:{title:`Bandeja unificada`,all:`Todos`,email:`Correo`,slack:`Slack`,no_items:`La bandeja está vacÃa`,reply:`Responder`,reply_placeholder:`Escribe una respuestaâ¦`,send:`Enviar`,sending:`Enviandoâ¦`},provider_google:`Google`,provider_outlook:`Outlook`,provider_caldav:`CalDAV`,account_unknown:`Otra cuenta`},redline:{title:`Marcado`,version_graph:`Gráfico de versiones`,version:`Versión`,no_versions:`Aún no hay versiones`,no_changes:`Sin cambios rastreados`,changes:`Cambios`,comments:`Comentarios`,suggestions:`Sugerencias`,accept_all:`Aceptar todo`,reject_all:`Rechazar todas`,accept:`Aceptar`,reject:`Rechazar`,attributed_to:`Los cambios se atribuyen a`,change_author_name:`Cambiar`,insertion:`Inserción`,deletion:`Eliminación`,change_meta:`{{type}} por {{author}}`,change_meta_with_date:`{{type}} por {{author}} el {{date}}`,unknown_author:`Desconocido`,suggested_by_tool:`Sugerido por modInsight`,your_change:`Tu cambio (modInsight)`,modinsight_change:`modInsight`,reattribute_to:`Reatribuir a {{name}}`,reattribute_hint:`Reescribe estos cambios registrados para mostrar tu nombre de autor actual`,reattribute_confirm:`¿Reatribuir todos los cambios registrados de "{{from}}" a "{{to}}"? Esto actualiza el autor de los cambios existentes en este documento.`,go_to_provision:`Ir a la cláusula relacionada`,comment_placeholder:`Añade un comentarioâ¦`,post_comment:`Publicar comentario`,no_comments:`Aún no hay comentarios`,pick_document:`Elige un documento`,no_redline_documents:`No hay documentos DOCX disponibles`,apply_suggestion:`Aplicar sugerencia como cambios rastreados`,reject_suggestion:`Rechazar sugerencia`,change_summary:`Resumen de cambios`,show_changes:`Mostrar cambios`,hide_changes:`Ocultar cambios`,compared_to:`Comparado con {{version}}`,saved_version:`Guardado como {{name}}`,save_version:`Guardar versión`,save_version_placeholder:`Nombre de la ver
172sión`,suggest:`Sugerir`,suggest_placeholder:`Instrucción opcional para las sugerencias de IA...`,generating_suggestions:`Generando sugerenciasâ¦`,generating_more:`Generando más sugerenciasâ¦`,insert_paragraph_after:`Insertar nuevo párrafo después`,delete_paragraph:`Eliminar párrafo`,target_missing:`Destino ausente`,target_missing_hint:`El párrafo que modifica esta sugerencia ya no está en el documento (ediciones posteriores o un cambio de versión), por lo que no se puede aplicar. Aún puedes rechazarla.`,no_suggestions_generated:`No se generaron sugerencias`,try_again:`Reintentar`,no_suggestions_yet_chat:`Aún no hay sugerencias. PÃdeselas a la IA en la pestaña Chat, p. ej., «sugiere 3 marcados para reducir el riesgo del comprador».`,no_suggestions_yet_embedded:`Aún no hay sugerencias. Haz clic en «Sugerir» para pedirle a la IA recomendaciones de marcado.`,progress_reviewed:`{{reviewed}} de {{total}} revisadas`,apply_all:`Aplicar todas ({{count}})`,applying:`Aplicandoâ¦`,undoing:`Deshaciendoâ¦`,apply_failed:`No se pudo aplicar`,apply_failed_hint:`No se encontró el texto de la sugerencia en el documento`,undo_applied_hint:`Quitar este cambio del documento`,hide_reviewed:`Ocultar revisadas`,undo:`Deshacer`,insert_after:`Insertar después de:`,preview:`Vista previa`,show_doc_preview:`Mostrar este cambio en el documento`,hide_doc_preview:`Ocultar este cambio del documento`,edit_inline_label:`Editar el texto sugerido`,edit_inline_hint:`Escribe para editar. Haz clic en el texto tachado para restaurarlo. Ctrl+Enter guarda, Esc cancela.`,start_from_original:`Partir del original`,reset_to_suggestion:`Restablecer la sugerencia`,edit_no_change_hint:`Coincide con el original, asà que no hay nada que aplicar. Rechaza la sugerencia en su lugar.`,revert_hunk_hint:`Haz clic para restaurar el texto original aquÃ`,save_shortcut_hint:`Ctrl+Enter para guardar`,shortcuts:{title:`Atajos de teclado`,navigate:`Navegar`,prev:`Sugerencia anterior`,next:`Sugerencia siguiente`,triage:`Revisión`,accept:`Aceptar seleccionada (se aplica al documento)`,reject:`Rechazar seleccionada`,edit:`Editar seleccionada`,toggle_preview:`Mostrar/ocultar el cambio en el documento`,undo:`Deshacer`,undo_last:`Deshacer última revisión`,help:`Ayuda`,help_toggle:`Mostrar/ocultar esta guÃa`},suggestion_status:{pending:`Pendiente`,accepted:`Aceptada`,edited:`Editada`,rejected:`Rechazada`,applied:`Aplicada`,superseded:`Reemplazada`},switch_confirm:`¿Guardar el trabajo actual y cambiar a {{version}}? Los cambios sin guardar se capturan automáticamente antes.`,anchor_status:{not_found:`Texto no encontrado`,not_found_hint:`El texto citado no se encontró en el documento â esta sugerencia no puede aplicarse automáticamente.`,ambiguous:`Coincidencia ambigua`,ambiguous_hint:`El texto citado aparece en varios lugares â aplicarlo podrÃa afectar al lugar equivocado.`},large_rewrite:`Reescritura amplia`,large_rewrite_hint:`Esta sugerencia reemplaza la mayor parte del párrafo en lugar de editarlo en su lugar. Comprueba si un cambio más pequeño y puntual conservarÃa más de tu redacción original.`,whole_clause_delete:`Elimina la cláusula`,whole_clause_delete_hint:`Esta sugerencia elimina una cláusula entera en lugar de editarla. Confirma que debe eliminarse toda la cláusula y no acotarla con una edición puntual.`,grounding:`Contexto`,grounding_title:`Fundamentar las sugerencias en tus estándares`,grounding_active:`Contexto ({{count}})`,grounding_kb:`Base de conocimiento`,grounding_kb_none:`Sin base de conocimiento`,grounding_kb_hint:`Tu biblioteca de estándares. Se incluyen los pasajes relevantes para este contrato, o toda la base de conocimiento cuando es lo bastante pequeña.`,grounding_exemplars:`Documentos de ejemplo`,grounding_exemplars_hint:`Un acuerdo concreto al que ajustarse, incluido Ãntegramente (máx. {{max}}).`},grounding:{no_kbs:`No se encontraron bases de conocimiento`,search_kb:`Buscar bases de conocimientoâ¦`,search_documents:`Buscar documentosâ¦`,upload_new:`Subir documento nuevo`,processing:`Procesando {{name}}â¦`,selected_count:`{{count}} seleccionados`,none_selected:`Seleccionar documentos`,cap_reached:`Hasta {{max}}`,no_documents:`No se encontraron documentos`},document_categories:{title:`Tipos de documento`,hub_description:`Gestiona los tipos de contrato en los que se clasifican tus documentos.`,description:`Cada documento se clasifica automáticamente en uno de estos tipos al subirlo. Los tipos integrados no se pueden editar; añade los tuyos para los tipos que no cubrimos. Las reglas asignadas a un tipo se aplican automáticamente a los documentos que coincidan.`,builtin:`Integrados`,custom:`Personalizados`,new:`Nuevo tipo`,count_of_max:`{{count}} de {{max}}`,none:`Sin clasificar`,change:`Cambiar tipo`,change_failed:`No se pudo cambiar el tipo de documento.`,name:`Nombre`,classifier_hint:`Cómo reconoce el clasificador este tipo.`,classifier_hint_placeholder:`p. ej. Contratos de franquicia y documentos de divulgación de franquicias.`,empty:`Aún no hay tipos personalizados`,empty_hint:`Añade un tipo para los contratos que los integrados no cubren.`,select_hint:`Selecciona un tipo para editarlo.`,builtin_readonly:`Tipo integrado (solo lectura)`,key_immutable:`La clave se deriva del nombre y no se puede cambiar.`,delete_confirm:`¿Eliminar este tipo? Los documentos conservan su etiqueta hasta que se reclasifiquen.`,created:`Tipo creado`,updated:`Tipo actualizado`,deleted:`Tipo eliminado`,rules:{section_title:`Instrucciones permanentes`,section_hint:`Se aplican automáticamente a todos los documentos clasificados como {{label}}.`,empty:`Aún no hay instrucciones permanentes para este tipo.`,add:`Añadir instrucciones`,placeholder:`No marques las cláusulas de limitación de responsabilidad en los NDA. 173Exige confidencialidad mutua.`,default_name:`Reglas internas de {{label}}`,delete_confirm:`¿Eliminar estas instrucciones?`,multiple_hint:`Este tipo tiene varios documentos de instrucciones. Gestiónalos en Playbooks.`,account_note:`Las reglas de toda la cuenta también se aplican a cada tipo.`,manage_in_playbooks:`Gestionar en Playbooks`},builtin_labels:{nda:`NDA`,msa:`MSA`,saas:`SaaS`,sow:`SOW`,employment:`Empleo`,lease:`Arrendamiento`,license:`Licencia`,dpa:`DPA`,purchase:`Compra`,other:`Otro`}},documents:{from_email:`Desde el correo`},document_tags:{labels:`Etiquetas`,add:`Añadir una etiqueta`,bulk_label:`Etiquetar selección`,search_or_create:`Buscar o crear una etiqueta`,none_yet:`Aún no hay etiquetas. Escribe para crear una.`,create_named:`Crear "{{name}}"`,clear_filter:`Quitar filtro de etiquetas`,limitation_note:`Las etiquetas organizan tus archivos. No restringen quién puede abrir un documento.`,apply_failed:`No se pudo actualizar la etiqueta.`,remove_failed:`No se pudo quitar la etiqueta.`}
173,guidance:{scope:{label:`Se aplica a`,kb:`Base de conocimiento`,kb_hint:`Solo cuando se selecciona la base de conocimiento de este manual para una revisión.`,account:`Toda la cuenta`,account_hint:`Se aplica siempre como regla interna en todas las revisiones.`,category:`Un tipo de documento`,category_hint:`Se aplica automáticamente a los documentos del tipo elegido.`,pick_category:`Elige un tipo de documento`,badge_account:`Toda la cuenta`,badge_category:`Tipo: {{label}}`}},evaluation:{title:`Evaluaciones`,new_evaluation:`Nueva evaluación`,no_evaluations:`Aún no hay evaluaciones`,create_first:`Ejecuta tu primera evaluación`,role:`Rol`,role_buyer:`Comprador`,role_seller:`Vendedor`,document:`Documento`,playbook:`Manual`,status:{pending:`Pendiente`,processing:`Procesando`,completed:`Completada`,failed:`Fallida`},create_dialog:{title:`Nueva evaluación`,description:`Puntúa un documento contra un manual.`,select_document:`Seleccionar documento`,select_playbook:`Seleccionar manual`,start:`Iniciar evaluación`,starting:`Iniciandoâ¦`},detail:{created_on:`Creada {{date}}`,score:`Puntuación`,no_results:`Aún no hay resultados de evaluación`,matching_passages:`Pasajes coincidentes`,selected_answer:`Respuesta seleccionada`,export:`Exportar`,delete:`Eliminar evaluación`},guidance:{findings:`Hallazgos`,no_findings:`Sin hallazgos`,severity_low:`Baja`,severity_medium:`Media`,severity_high:`Alta`,view_suggestions:`Ver sugerencias`},panel:{no_evaluation_selected:`Selecciona una evaluación`},knowledge_base:`Base de conocimiento de referencia`,knowledge_base_none:`Ninguna`,knowledge_base_hint:`Tu biblioteca de estándares. Se incluyen los pasajes relevantes para este contrato, o toda la base de conocimiento cuando es lo bastante pequeña.`,exemplar_documents:`Documentos de ejemplo`,exemplar_documents_hint:`Acuerdos concretos a los que ajustarse, incluidos Ãntegramente (máx. {{max}}).`},playbook:{title:`Manuales`,description:`Evalúa documentos según rúbricas y directrices.`,library:`Biblioteca de manuales`,new_playbook:`Nuevo manual`,upload_xlsx:`Subir XLSX`,upload_document:`Subir documento`,upload_json:`Subir JSON`,no_playbooks:`Aún no hay manuales`,create_first:`Crea tu primer manual`,categories:`CategorÃas`,subcategories:`SubcategorÃas`,questions:`Preguntas`,answers:`Respuestas`,rubric:`Rúbrica`,guidance:`GuÃa`,edit:`Editar`,delete:`Eliminar`,duplicate:`Duplicar`,is_benchmark:`Referencia predeterminada`,seller_score:`Puntuación vendedor`,buyer_score:`Puntuación comprador`,answer_text:`Texto de la respuesta`,question_text:`Pregunta`,upload_issues:`Problemas al subir`,upload_issues_description:`Algunas filas no pudieron analizarse. CorrÃgelas u omÃtelas y vuelve a subir.`},org:{switcher:{personal:`Personal`,personal_account:`Cuenta personal`,organizations:`Organizaciones`,create_org:`Crear organización`,switch_to:`Cambiar a {{name}}`,current:`Actual`},members:{title:`Miembros`,name:`Nombre`,email:`Correo electrónico`,role:`Rol`,joined:`Se unió`,actions:`Acciones`,remove:`Quitar`,remove_confirm:`¿Quitar a {{name}} de esta organización?`,no_members:`Aún no hay miembros`,you:`Tú`},roles:{admin:`Administrador`,member:`Miembro`,viewer:`Lector`},invite_dialog:{title:`Invitar miembro`,description:`Recibirán una invitación por correo electrónico.`,email_label:`Correo electrónico`,email_placeholder:`compañ[email protected]`,role_label:`Rol`,send_invite:`Enviar invitación`,sending:`Enviandoâ¦`},pending_invites:{title:`Invitaciones pendientes`,no_invites:`No hay invitaciones pendientes`,invited_on:`Invitado el {{date}}`,revoke:`Revocar`,revoke_confirm:`¿Revocar la invitación a {{email}}?`},invite_accept:{title:`Has sido invitado`,description:`Ãnete a {{name}} como {{role}}.`,accept:`Aceptar invitación`,accepting:`Aceptandoâ¦`,decline:`Rechazar`,expired:`Esta invitación ha caducado o no es válida.`}},finance:{title:`Finanzas`,new_document:`Nuevo documento financiero`,no_documents:`Aún no hay documentos financieros`,create_first:`Crea tu primer documento financiero`,new_dialog:{title:`Nuevo documento financiero`,description:`Crea una factura, recibo u otro documento financiero.`,name:`Nombre`,name_placeholder:`Nombre del documento`,template:`Plantilla`,create:`Crear documento`,creating:`Creandoâ¦`},detail:{edit:`Editar`,view:`Ver`,delete:`Eliminar`,save:`Guardar`,export:`Exportar`},editor:{spreadsheet:`Hoja de cálculo`,text:`Texto`,no_email_context:`Sin contexto de correo`,email_context:`Contexto de correo`},templates:{blank:`En blanco`,invoice:`Factura`,receipt:`Recibo`},chat_panel:{title:`Pregunta sobre este documento`,placeholder:`Pregunta cualquier cosaâ¦`}},notifications:{title:`Notificaciones`,no_notifications:`Sin notificaciones`,mark_all_read:`Marcar todo como leÃdo`,clear_all:`Borrar todo`,unread:`Sin leer`,read:`LeÃdo`,summary_title_one:`{{count}} notificación nueva`,summary_title_other:`{{count}} notificaciones nuevas`,update_banner:{message:`Hay una nueva ver
173sión disponible.`,refresh:`Actualizar`},support_reply_banner:{title:`Soporte respondió a tu ticket`,view:`Ver ticket`},release_note:{toast_label:`Novedades`,dialog_title:`Novedades`,dialog_subtitle:`Mejoras recientes de modInsight.`,see_all:`Ver todas las novedades`,dismiss:`Descartar`}},support:{status:{open:`Abierto`,in_progress:`En curso`,resolved:`Resuelto`,closed:`Cerrado`},menu:{tooltip:`Soporte`,contact:`Contactar con soporte`,screenshot:`Captura y reporte`,record:`Grabar pantalla y reportar`,record_preparing:`Preparando la grabaciónâ¦`,stop_recording:`Detener la grabación`,my_tickets:`Mis tickets`,whats_new:`Novedades`},intro:{title:`¿Necesitas ayuda? Está integrada.`,lead:`Reporta un error o haz una pregunta sin salir de la app.`,cap_screenshot:`Toma una captura de pantalla`,cap_record:`Graba tu pantalla`,cap_reply:`Recibe respuestas en la app y por correo`,open_ticket:`Abrir un ticket`,dismiss:`Entendido`,arrow:`Encuéntralo aquà cuando quieras`},list:{title:`Tus tickets`,search_placeholder:`Buscar ticketsâ¦`,new_ticket:`Nuevo ticket`,empty_title:`Aún no tienes tickets de soporte`,empty_body:`¿Necesitas ayuda o encontraste un error? Abre un ticket y nuestro equipo te responderá aquà y por correo.`,no_search_results:`Ningún ticket coincide con tu búsqueda.`,no_text:`(sin texto)`,message_count_one:`{{count}} mensaje`,message_count_other:`{{count}} mensajes`,unread:`Respuesta sin leer`},thread:{select_prompt:`Selecciona un ticket para ver la conversación.`,staff_name:`modInsight Support`,created:`Creado {{date}}`,resolved:`Resuelto {{date}}`,reopen_banner:`Este ticket está cerrado. Al enviar una respuesta se reabrirá.`,reply_placeholder:`Responder a soporteâ¦`,send:`Enviar mensaje`,delete:`Eliminar ticket`,delete_confirm:`¿Eliminar este ticket y su conversación? Esto no se puede deshacer.`},toasts:{load_failed:`No se pudieron cargar tus tickets de soporte.`,open_failed:`No se pudo abrir el hilo de soporte.`,send_failed:`No se pudo enviar tu mensaje.`,delete_failed:`No se pudo eliminar el ticket.`},capture:{screenshot_failed:`La captura falló â aún puedes adjuntar archivos manualmente.`,screenshot_failed_short:`La captura falló.`,recording_unsupported:`La grabación de pantalla no es compatible con este navegador.`,recording_start_failed:`No se pudo iniciar la grabación de pantalla.`,recording_failed:`La grabación de pantalla falló.`,max_attachments:`Máximo {{count}} adjuntos por ticket.`,unsupported_type:`Tipo de adjunto no compatible: {{type}}`,too_large:`"{{filename}}" es demasiado grande (máx. {{max}}MB).`}},support_dialog:{title:`Contactar con soporte`,description:`Cuéntanos qué necesitas â errores, preguntas o comentarios.`,message_label:`¿En qué podemos ayudarte?`,placeholder:`Describe el problema o la preguntaâ¦`,helper:`Te avisaremos aquà y por correo cuando nuestro equipo responda.`,screenshot:`Captura de pantalla`,attach_files:`Adjuntar archivos`,preview_attachment:`Vista previa de {{filename}}`,remove:`Quitar`,cancel:`Cancelar`,submit:`Enviar`,submitting:`Enviandoâ¦`,success:`Ticket creado â nuestro equipo te responderá pronto.`,success_action:`Ver tickets`,submit_failed:`No se pudo enviar tu ticket. Inténtalo de nuevo.`,about:`Sobre: {{label}}`,about_remove:`Quitar elemento del ticket`,about_helper:`Guardaremos una copia de este elemento para poder reproducir el problema.`,about_placeholder:`¿Qué salió mal?`},flag_popover:{title:`¿Qué salió mal?`,reason_placeholder:`Añade detalles (opcional)`,submit:`Enviar`},delete_account:{title:`Eliminar cuenta`,description:`Elimina permanentemente tu cuenta y todos los datos. No se puede deshacer.`,confirm_label:`Escribe ELIMINAR para confirmar`,delete:`Eliminar cuenta`,deleting:`Eliminandoâ¦`,cancel:`Cancelar`},topbar:{sync:{button:`Sincronizar ahora`,syncing:`Sincronizandoâ¦`,complete:`Sincronización completa`,complete_with_email_one:`Sincronización completa â {{count}} correo nuevo`,complete_with_email_other:`Sincronización completa â {{count}} correos nuevos`,taking_longer:`La sincronización está tardando más de lo esperado`,start_failed:`No se pudo iniciar la sincronización`}},everything_search:{placeholder:`Buscar en todoâ¦`,no_results:`Sin resultados`,documents:`Documentos`,matters:`Asuntos`,conversations:`Conversaciones`,knowledge_bases:`Bases de conocimiento`,scopes:{everything_label:`Todo`,everything_description:`Buscar en todos los tipos de recursos`,inbox_description:`Correos que coinciden con esta búsqueda`,calendar_description:`Eventos sobre este tema`,documents_description:`Archivos, contratos, bases de conocimiento`,vault_description:`Indicaciones, manuales, evaluaciones, perfiles`,matters_description:`Encuentra un asunto y filtra dentro de él`},facets:{all:`Todo`},all_categories:`Todas las categorÃas`,open_matter:`Abrir`,back_to_search:`Volver a la búsqueda`,chat:{mode_results:`Resultados`,mode_chat:`Chat`,placeholder:`Pregunta sobre tu espacio de trabajoâ¦`,hint:`Haz una pregunta sobre tu espacio de trabajo y pulsa Enter.`,searching:`Buscando en tu espacio de trabajo`,thinking:`Pensando`,open_in_chat:`Abrir en el chat`,error:`No se pudo completar la búsqueda. Inténtalo de nuevo.`,open_failed:`No se pudo abrir la conversación. Inténtalo de nuevo.`,link_open_failed:`No se pudo abrir ese elemento. Inténtalo de nuevo.`}},item_detail:{when:`Cuándo`,location:`Ubicación`,due:`Vence`,status:`Estado`,details:`Detalles`,from:`De`,channel:`Canal`,mark_complete:`Marcar como completada`,open_in_google:`Abrir en Google`,open_in_outlook:`Abrir en Outlook`},callbacks:{gmail_connecting:`Conectando Gmailâ¦`,gmail_connected:`Gmail conectado. Redirigiendoâ¦`,gmail_error:`Error al conectar Gmail.`,outlook_connecting:`Conectando Outlookâ¦`,outlook_connected:`Outlook conectado. Redirigiendoâ¦`,outlook_error:`Error al conectar Outlook.`,slack_connecting:`Conectando Slackâ¦`,slack_connected:`Slack conectado. Redirigiendoâ¦`,slack_error:`Error al conectar Slack.`},tour:{skip:`Omitir tour`,continue:`Continuar a {{next}} â`,finish:`Finalizar`,progress:`Paso {{current}} de {{total}}`,got_it:`Entendido`,help_aria:`Mostrar ayuda de esta página`,help_close_aria:`Ocultar ayuda de esta página`,dashboard:{sidebar:`Tu navegación está aquà â Panel, Chat, Bóveda, Asuntos, Correo.`,search:`Pulsa âK desde cualquier lugar para saltar a lo que sea.`,notifications:`Las novedades de tus asuntos aparecen aquÃ.`,digest:`Tu resumen matutino â borradores, fechas, novedades.`},chat:{composer:`Pregunta lo que sea â borradores, lÃneas rojas, investigación.`,mode:`Elige cómo responde el modelo: borrador, biblioteca o búsqueda.`,kb:`Limita las respuestas a una base de conocimiento concreta.`,persona:`Da al asistente instrucciones permanentes para este chat.`},vault:{cards:`Seis estanterÃas: indicaciones, bases, manuales, perfiles, evaluaciones, lÃneas rojas.`,visibility:`Alterna entre elementos personales y de equipo.`},matters:{panel:`Sigue cada caso aquà â correos, documentos, evaluaciones y cronologÃa.`,new:`Crea un asunto desde cero o a partir de un correo o documento existente.`},mail:{folders:`Carpetas, cuentas y la opción de redactar están aquÃ.`,list:`Hilos de la carpeta actual. Haz clic para leer.`,detail
173:`Lee, responde y redacta respuestas en este panel.`},booking:{new:`Crea un enlace tipo Cal.com para que tus clientes reserven contigo.`,list:`Enlaces de reserva activos. Comparte la URL o copia el código embebido.`},routines:{new:`Programa agentes de IA recurrentes â diarios, semanales, a demanda.`,filters:`Busca rutinas o filtra por su frecuencia.`,cards:`Tus rutinas activas. Pausa, edita o revisa el historial desde aquÃ.`}},customer_success:JSON.parse(`{"toasts":{"load_failed":"No se pudieron cargar los clientes","created":"Cliente creado","saved":"Cambios guardados","save_failed":"No se pudieron guardar los cambios","archived":"Cliente archivado","restored":"Cliente restaurado","deleted":"Cliente eliminado","delete_failed":"No se pudo eliminar el cliente","backfill_queued":"Importando correos anterioresâ¦","backfill_failed":"No se pudo iniciar la importación","import_failed":"No se pudieron importar los clientes"},"list":{"search_placeholder":"Buscar clientes","empty_title":"Aún no hay clientes","add_first":"Añade tu primer cliente","show_archived":"Mostrar archivados","hide_archived":"Ocultar archivados"},"detail":{"select_prompt":"Selecciona un cliente para ver su cronologÃa","arr_label":"ARR","archived":"Archivado","edit":"Editar","backfill":"Importar historial","restore":"Restaurar","archive":"Archivar","delete_confirm":"¿Eliminar este cliente y toda su cronologÃa? No se puede deshacer.","tab_timeline":"CronologÃa","tab_roadmap":"Hoja de ruta","tab_risk":"Riesgo","tab_feedback":"Comentarios","tab_icp":"Ajuste al ICP"},"timeline":{"empty_title":"Aún no hay actividad","empty_body":"Los correos hacia y desde los dominios y contactos de este cliente aparecerán aquÃ. Usa Importar historial para traer correos anteriores.","all_hidden_title":"Sin actividad visible","all_hidden_body":"Todos los eventos están ocultos o provienen de un buzón que no está seleccionado para este cliente.","load_more":"Cargar más","show_full":"Ver mensaje completo","collapse":"Ver menos","no_body":"Mensaje completo no disponible","view_transcript":"Ver transcripción","download_transcript":"Descargar","hide":"Ocultar","restore":"Restaurar","show_hidden":"Ver ocultos ({{count}})","hide_hidden":"Ocultar ocultos","hidden_section":"Ocultos","summary":{"title":"Situación actual","risk_calibrating":"El riesgo aún se está calibrando","risk_band":"Riesgo {{band}} ({{score}}/100)","with_health":"{{status}}, salud {{health}}/100","health_calibrating":"{{status}}, salud en calibración","activity_one":"{{count}} interacción en los últimos 30 dÃas","activity_other":"{{count}} interacciones en los últimos 30 dÃas","activity_none":"Sin interacciones en los últimos 30 dÃas","last_contact_today":"último contacto hoy","last_contact_yesterday":"último contacto ayer","last_contact_days":"último contacto hace {{count}} dÃas","drivers":"Principales factores de riesgo: {{list}}","nothing":"Aún no hay actividad para resumir.","ai_title":"Resumen","generating":"Resumiendo la cronologÃa","refresh":"Actualizar","generate":"Generar resumen","updated_ago":"Actualizado {{ago}}","ai_error":"No se pudo generar el resumen. Inténtalo de nuevo.","ai_empty":"Aún no hay resumen.","regen_queued":"Regenerando el resumenâ¦","regen_failed":"No se pudo regenerar el resumen"}},"dialog":{"create_title":"Nuevo cliente","edit_title":"Editar cliente","subtitle":"Los correos que coincidan con estos dominios o contactos aparecerán en la cronologÃa de este cliente.","name":"Nombre","name_placeholder":"Acme Inc.","domains":"Dominios","domains_hint":"Dominios de correo de la empresa, p. ej. acme.com. Pulsa Enter o coma para añadir.","contacts":"Correos de contacto","contacts_hint":"Direcciones individuales, incl. contactos en servidores de correo compartidos.","arr":"ARR (opcional)","notes":"Notas (opcional)","create":"Crear","save":"Guardar","remove_chip":"Quitar","freemail_warning":"Es un servidor de correo compartido. Añade la dirección completa en correos de contacto para que solo coincida esa persona."},"import":{"title":"Importar clientes","subtitle":"Sube un archivo CSV o Excel. Cada fila se convierte en un cliente, igual que si lo hubieras escrito en el formulario.","dropzone":"Arrastra aquà un archivo .csv o .xlsx, o haz clic para elegirlo","dropzone_hint":"C
173olumnas como Empresa, Web, Email, ARR y Notas se reconocen automáticamente; el resto se conserva en las notas.","template":"Descargar plantilla","template_csv":"CSV","template_xlsx":"Excel","uploading":"Leyendo archivo⦠{{percent}}%","preview_title":"Vista previa","mapping_caption":"Cómo se leyeron las columnas","mapping_ai":"Asignadas con IA: revisa las columnas antes de importar.","field":{"name":"Nombre","domains":"Dominios","contact_emails":"Correos de contacto","arr":"ARR","notes":"Notas","notes_context":"Guardado en notas","ignore":"Ignorada"},"status":{"ok":"Listo","warning":"Listo con avisos","conflict":"Ya existe","duplicate":"Duplicado en el archivo","error":"Omitido"},"conflict_with":"Coincide con {{name}}","truncated":"Solo se leyeron las primeras {{max}} filas. Divide el archivo para importar el resto.","polish_notes":"Pulir notas con IA","polish_notes_hint":"Reescribe como prosa breve los valores de columna guardados en las notas de cada cliente. Se ejecuta en segundo plano tras la importación.","importable_count":"Se importarán {{count}} de {{total}} filas","skipped_count":"{{count}} se omitirán","confirm":"Importar {{count}} clientes","confirm_one":"Importar 1 cliente","importing":"Importandoâ¦","start_over":"Elegir otro archivo","result_title":"Importación terminada","result_created":"{{count}} clientes creados","result_created_one":"1 cliente creado","result_skipped":"{{count}} filas omitidas (ya existÃan, estaban duplicadas o no tenÃan nombre)","result_failed":"{{count}} filas no se pudieron guardar. Confirma de nuevo para reintentarlas.","result_polish":"Las notas se están puliendo en segundo plano y se refinarán en breve.","result_backfill":"Se están importando los correos anteriores que coinciden con los nuevos clientes.","columns":{"row":"#","status":"Estado","name":"Nombre","domains":"Dominios","contacts":"Contactos","arr":"ARR","notes":"Notas"},"preview_failed":"No se pudo leer ese archivo","invalid_file":"Sube un archivo .csv o .xlsx de hasta {{max}}MB"},"roadmap":{"projects":"Proyectos","new_project":"Nuevo proyecto","no_projects":"TodavÃa no hay proyectos. Crea uno para empezar una hoja de ruta.","add_transcript":"Añadir transcripción","regenerate":"Regenerar","retry":"Reintentar","add_task":"Añadir tarea","edit_project":"Editar proyecto","delete_project":"Eliminar proyecto","delete_project_confirm":"¿Eliminar este proyecto y su hoja de ruta? No se puede deshacer.","overdue":"Vencida","generating":"Generando la hoja de rutaâ¦","needs_context":"Esta hoja de ruta necesita contexto. Añade una transcripción de reunión para generarla.","error":"Falló la generación de la hoja de ruta. Inténtalo de nuevo.","empty":"TodavÃa no hay hoja de ruta. Añade una transcripción o una tarea para empezar.","other_tasks":"Otras tareas","priority":{"low":"Baja","medium":"Media","high":"Alta"},"status":{"todo":"Pendiente","in_progress":"En curso","done":"Hecha"},"project_dialog":{"create_title":"Nuevo proyecto","edit_title":"Editar proyecto","subtitle":"Un proyecto agrupa la hoja de ruta y las tareas de un cliente.","name":"Nombre","name_placeholder":"Incorporación","description":"Descripción","target_date":"Fecha objetivo","create":"Crear","save":"Guardar"},"task_dialog":{"create_title":"Nueva tarea","edit_title":"Editar tarea","subtitle":"Las tareas registran el trabajo detrás de una hoja de ruta.","title":"TÃtulo","description":"Descripción","status":"Estado","due_date":"Fecha lÃmite","assignee":"Responsable","assignee_placeholder":"Nombre","milestone":"Hito","milestone_none":"Sin hito","priority":"Prioridad","priority_none":"Ninguna","create":"Crear","save":"Guardar"},"decision_log":{"title":"Registro de decisiones","empty":"Aún no hay decisiones registradas.","churn":"Señal de abandono"},"toasts":{"load_failed":"No se pudo cargar la hoja de ruta.","save_failed":"No se pudieron guardar los cambios.","delete_failed":"No se pudo eliminar.","project_created":"Proyecto creado.","project_deleted":"Proyecto eliminado.","task_created":"Tarea añadida.","saved":"Guardado.","regen_queued":"Regenerando la hoja de rutaâ¦","regen_failed":"No se pudo iniciar la regeneración de la hoja de ruta.","transcript_queued":"Transcripción subida. Procesandoâ¦","transcript_failed":"No se pudo subir la transcripción."}},"view_toggle":{"customers":"Clientes","themes":"Temas","icp":"ICP"},"icp":{"title":"Perfil de cliente ideal","subtitle":"Describe los clientes que buscas. Cada hilo de correo recibe un veredicto sobre qué tan bien refleja este perfil.","placeholder":"p. ej. Empresas fintech de mercado medio (50â500 empleados) que adoptan pagos integrados, evaluando en un trimestre, con un responsable técnico designadoâ¦","save":"Guardar","saving":"Guardandoâ¦","clear":"Borrar","chars":"{{count}}/{{max}}","last_updated":"Actualizado {{ago}}","read_only_hint":"Solo los administradores del espacio pueden editar el perfil de cliente ideal.","reeval_hint":"Guardar vuelve a evaluar los 20 hilos de correo más recientes por cliente activo.","stats_title":"Ajuste en todos los clientes","stats_threads":"{{count}} hilos evaluados","stats_customers":"{{count}} clientes","stats_empty":"Aún no se han evaluado hilos.","fit_title":"Ajuste al ICP","fit_score":"{{pct}}
173 % de ajuste","rollup_no_score":"Aún sin puntuación","rollup_rationale":"Ponderado por confianza en {{scored}} hilos concluyentes: {{fits}} encajan, {{partial}} parciales, {{does_not_fit}} no encajan. Los hilos sin claridad ({{unclear}}) no cuentan para la puntuación.","stale_count":"{{count}} hilos se evaluaron con un ICP anterior. Vuelve a evaluar para obtener una puntuación actualizada.","chains_title":"Hilos de correo","chain_messages":"{{count}} mensajes","chain_untitled":"Hilo sin tÃtulo","empty_body":"Cuando los hilos de correo de este cliente se evalúen frente al perfil de cliente ideal, su ajuste aparecerá aquÃ.","not_configured_title":"Aún no hay un perfil de cliente ideal","not_configured_body":"Define un perfil de cliente ideal en la pestaña Perfil de cliente ideal para ver qué tan bien encaja este cliente.","evaluating":"Evaluando hilos de correo","reevaluate":"Volver a evaluar","confidence":"{{pct}} % de confianza","signals_title":"Señales clave","evaluated_ago":"Evaluado {{ago}}","stale_hint":"El ICP cambió desde esta evaluación. Vuelve a evaluar para obtener un veredicto actualizado.","verdicts":{"fits":"Encaja","partial":"Encaje parcial","does_not_fit":"No encaja","unclear":"Sin claridad"},"toasts":{"load_failed":"No se pudo cargar el perfil de cliente ideal","save_failed":"No se pudo guardar el perfil","saved":"Perfil guardado","cleared":"Perfil borrado","reeval_queued":"Volviendo a evaluar los hilos de correoâ¦","reeval_failed":"No se pudo poner en cola la reevaluación"}},"feedback":{"title":"Comentarios","extract":"Analizar","proposed":"Sugerencia","empty_title":"Aún no hay comentarios","empty_body":"Cuando se analicen los mensajes de este cliente, las necesidades que planteen aparecerán aquÃ.","sentiment":{"positive":"Positivo","neutral":"Neutral","negative":"Negativo","frustrated":"Frustrado"},"toasts":{"load_failed":"No se pudieron cargar los comentarios","extract_queued":"Análisis de comentarios en cola","extract_failed":"No se pudo iniciar el análisis"}},"themes":{"untitled":"Tema sin tÃtulo","select_prompt":"Selecciona un tema para ver sus detalles.","recommendations":"Recomendaciones","view_customer":"Ver cliente","items":"{{count}} comentarios","empty_title":"Aún no hay temas","empty_body":"Los temas agrupan comentarios relacionados de tus clientes. Aparecen una vez que se han analizado los comentarios.","toasts":{"load_failed":"No se pudieron cargar los temas"}},"discovery":{"title":"Clientes sugeridos","count":"{{events}} correos · {{contacts}} contactos","confirm":"Añadir","dismiss":"Descartar","toasts":{"load_failed":"No se pudieron cargar las sugerencias","dismissed":"Dominio descartado","dismiss_failed":"No se pudo descartar el dominio"}}}`),report_issue:{tooltip:`Informar de un problema con esto`,menu_item:`Informar de un problema`,chat_reply:`Respuesta del chat`,chat_reply_in:`Respuesta del chat en "{{title}}"`,dual_response:`Respuesta doble`,dual_response_in:`Respuesta doble en "{{title}}"`,suggestion:`Sugerencia en {{filename}}`,suggestion_on:`Sugerencia sobre {{clause}} en {{filename}}`,suggestion_on_clause:`Sugerencia sobre {{clause}}`,suggestion_generic:`Sugerencia de revisión`,document:`Documento "{{filename}}"`,evaluation:`Evaluación de "{{filename}}"`,evaluation_answer:`Respuesta de evaluación: {{question}}`,email_attachment:`Adjunto de correo "{{filename}}"`,email_draft:`Borrador de respuesta a "{{subject}}"`}};const Lae=[`en`,`es`];dg.use(Pae).use(oae).init({resources:{en:{translation:Fae},es:{translation:Iae}},fallbackLng:`en`,supportedLngs:Lae,interpolation:{escapeValue:!1},detection:{order:[`localStorage`,`navigator`],lookupLocalStorage:`i18nextLng`,caches:[`localStorage`]},returnNull:!1});var H=dg,Rae=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),zae=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Bae=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Vae=e=>{let t=Bae(e);return t.charAt(0).toUpperCase()+t.slice(1)},Hae={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Uae=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Wae=(0,B.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,B.createElement)(`svg`,{ref:c,...Hae,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Rae(`lucide`,i),...!a&&!Uae(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,B.createElement)(e,t)),...Array.isArray(a)?a:[a]])),U=(e,t)=>{let n=(0,B.forwardRef)(({className:n,...r},i)=>(0,B.createElement)(Wae,{ref:i,iconNode:t,className:Rae(`lucide-${zae(Vae(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Vae(e),n},Sg=U(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l
173-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Gae=U(`alarm-clock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),Kae=U(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),Cg=U(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),qae=U(`arrow-down-left`,[[`path`,{d:`M17 7 7 17`,key:`15tmo1`}],[`path`,{d:`M17 17H7V7`,key:`1org7z`}]]),wg=U(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Tg=U(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Eg=U(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Dg=U(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),Jae=U(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),Og=U(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Yae=U(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),Xae=U(`ban`,[[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Zae=U(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Qae=U(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),kg=U(`book-marked`,[[`path`,{d:`M10 2v8l3-3 3 3V2`,key:`sqw3rj`}],[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),Ag=U(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),$ae=U(`book-search`,[[`path`,{d:`M11 22H5.5a1 1 0 0 1 0-5h4.501`,key:`mcbepb`}],[`path`,{d:`m21 22-1.879-1.878`,key:`12q7x1`}],[`path`,{d:`M3 19.5v-15A2.5 2.5 0 0 1 5.5 2H18a1 1 0 0 1 1 1v8`,key:`olfd5n`}],[`circle`,{cx:`17`,cy:`18`,r:`3`,key:`82mm0e`}]]),eoe=U(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),toe=U(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),jg=U(`briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),Mg=U(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),noe=U(`building`,[[`path`,{d:`M12 10h.01`,key:`1nrarc`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M12 6h.01`,key:`1vi96p`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M16 6h.01`,key:`1x0f13`}],[`path`,{d:`M8 10h.01`,key:`19clt8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M8 6h.01`,key:`1dz90k`}],[`path`,{d:`M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3`,key:`cabbwy`}],[`rect`,{x:`4`,y:`2`,width:`16`,height:`20`,rx:`2`,key:`1uxh74`}]]),roe=U(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),Ng=U(`calendar-check`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`m9 16 2 2 4-4`,key:`19s6y9`}]]),Pg=U(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),Fg=U(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Ig=U(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}
173]]),ioe=U(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Lg=U(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Rg=U(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),zg=U(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Bg=U(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),aoe=U(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Vg=U(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Hg=U(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),ooe=U(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ug=U(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),soe=U(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Wg=U(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),coe=U(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),Gg=U(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Kg=U(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),qg=U(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),loe=U(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Jg=U(`clock`,[[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),uoe=U(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),doe=U(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),foe=U(`coffee`,[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]),Yg=U(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),poe=U(`credit-card`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]),moe=U(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),hoe=U(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),Xg=U(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Zg=U(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Qg=U(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),$g=U(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),e_=U(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),t_=U(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),n_=U(`file-check`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]),goe=U(`file-down`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]),_oe=U(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),voe=U(`file-headphone`,[[`path`,{d:`M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343`,key:`1vfytu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0`,key:`1etmh7`}]]),yoe=U(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),boe=U(`file-pen-line`,[[`path`,{d:`m18.226 5.226-2.52-2.52A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-.351`,key:`1k2beg`}],[`path`,{d:`M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`2t3380`}],[`path`,{d:`M8 18h1`,key:`13wk12`}]]),xoe=U(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),Soe=U(`file-play`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z`,key:`1tzo1f`}]]),Coe=U(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),woe=U(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Toe=U(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),r_=U(`file-spreadsheet`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),i_=U(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Eoe=U(`file-type-corner`,[[`path`,{d:`M12 22h6a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6`,ke
173y:`15usau`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M3 16v-1.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5V16`,key:`s1gz5`}],[`path`,{d:`M6 22h2`,key:`194x9m`}],[`path`,{d:`M7 14v8`,key:`11ixej`}]]),Doe=U(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),Ooe=U(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),koe=U(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),a_=U(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Aoe=U(`folder-kanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),joe=U(`folder-minus`,[[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),o_=U(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Moe=U(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Noe=U(`forward`,[[`path`,{d:`m15 17 5-5-5-5`,key:`nf172w`}],[`path`,{d:`M4 18v-2a4 4 0 0 1 4-4h12`,key:`jmiej9`}]]),Poe=U(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),s_=U(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),Foe=U(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Ioe=U(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Loe=U(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Roe=U(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),zoe=U(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Boe=U(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),c_=U(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),l_=U(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}
173]]),u_=U(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Voe=U(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),d_=U(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Hoe=U(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),Uoe=U(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Woe=U(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Goe=U(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),Koe=U(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),f_=U(`life-buoy`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),p_=U(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),m_=U(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),qoe=U(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),Joe=U(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),h_=U(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),Yoe=U(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Xoe=U(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),W=U(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),g_=U(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Zoe=U(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Qoe=U(`mail-check`,[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]]),__=U(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}
173],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),$oe=U(`message-square-more`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 11h.01`,key:`z322tv`}],[`path`,{d:`M16 11h.01`,key:`xkw8gn`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}]]),v_=U(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),y_=U(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),b_=U(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),x_=U(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),ese=U(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),tse=U(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),nse=U(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),rse=U(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),ise=U(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),S_=U(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),ase=U(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),ose=U(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),C_=U(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),w_=U(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),sse=U(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),cse=U(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),T_=U(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),lse=U(`presentation`,[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]),use=U(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),dse=U(`receipt`,[[`path`,{d:`M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z`,key:`q3az6g`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 17.5v-11`,key:`1jc1ny`}]]),fse=U(`redo`,[[`path`,{d:`M21 7v6h-6`,key:`3ptur4`}],[`path`,{d:`M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7`,key:`1kgawr`}]]),E_=U(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),pse=U(`reply-all`,[[`path`,{d:`m12 17-5-5 5-5`,key:`1s3y5u`}],[`path`,{d:`M22 18v-2a4 4 0 0 0-4-4H7`,key:`1fcyog`}],[`path`,{d:`m7 17-5-5 5-5`,key:`1ed8i2`}]]),D_=U(`reply`,[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]),mse=U(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),O_=U(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}
173]]),k_=U(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),A_=U(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),hse=U(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),j_=U(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),M_=U(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),N_=U(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),gse=U(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),P_=U(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),F_=U(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),I_=U(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),_se=U(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),vse=U(`shopping-cart`,[[`circle`,{cx:`8`,cy:`21`,r:`1`,key:`jimo8o`}],[`circle`,{cx:`19`,cy:`21`,r:`1`,key:`13723u`}],[`path`,{d:`M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12`,key:`9zh506`}]]),L_=U(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),yse=U(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),bse=U(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),xse=U(`square-plus`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),Sse=U(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Cse=U(`star-off`,[[`path`,{d:`m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152`,key:`19ctli`}],[`path`,{d:`m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099`,key:`ptqqvy`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),R_=U(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}
173]]),z_=U(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),wse=U(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),B_=U(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Tse=U(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),Ese=U(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),Dse=U(`ticket`,[[`path`,{d:`M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z`,key:`qn84l0`}],[`path`,{d:`M13 5v2`,key:`dyzc3o`}],[`path`,{d:`M13 17v2`,key:`1ont0d`}],[`path`,{d:`M13 11v2`,key:`1wjjxi`}]]),V_=U(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),H_=U(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Ose=U(`trophy`,[[`path`,{d:`M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978`,key:`1n3hpd`}],[`path`,{d:`M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978`,key:`rfe1zi`}],[`path`,{d:`M18 9h1.5a1 1 0 0 0 0-5H18`,key:`7xy6bh`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6 9H4.5a1 1 0 0 1 0-5H6`,key:`tex48p`}]]),kse=U(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),Ase=U(`undo`,[[`path`,{d:`M3 7v6h6`,key:`1v2h90`}],[`path`,{d:`M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13`,key:`1r6uu6`}]]),U_=U(`unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),W_=U(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),jse=U(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),G_=U(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),K_=U(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Mse=U(`users-round`,[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]]),q_=U(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Nse=U(`vault`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}],[`path`,{d:`m7.9 7.9 2.7 2.7`,key:`hpeyl3`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}],[`path`,{d:`m13.4 10.6 2.7-2.7`,key:`264c1n`}],[`circle`,{cx:`7.5`,cy:`16.5`,r:`.5`,fill:`currentColor`,key:`nkw3mc`}],[`path`,{d:`m7.9 16.1 2.7-2.7`,key:`p81g5e`}],[`circle`,{cx:`16.5`,cy:`16.5`,r:`.5`,fill:`currentColor`,key:`fubopw`}],[`path`,{d:`m13.4 13.4 2.7 2.7`,key:`abhel3`}
173],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Pse=U(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),Fse=U(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),J_=U(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Y_=U(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Ise=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},Lse=B.createContext(void 0),Rse={setTheme:e=>{},themes:[]},zse=()=>B.useContext(Lse)??Rse;B.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return B.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${Ise.toString()})(${u})`}})});var Bse=u(v(),1);function Vse(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Hse=e=>{switch(e){case`success`:return Gse;case`info`:return qse;case`warning`:return Kse;case`error`:return Jse;default:return null}},Use=Array(12).fill(0),Wse=({visible:e,className:t})=>B.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},B.createElement(`div`,{className:`sonner-spinner`},Use.map((e,t)=>B.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Gse=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},B.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Kse=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},B.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),qse=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},B.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Jse=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},B.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Yse=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},B.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),B.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Xse=()=>
173{let[e,t]=B.useState(document.hidden);return B.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},X_=1,Z_=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:X_++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>
173this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],B.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Qse(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||X_++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Zse=(e,t)=>{let n=t?.id||X_++;return Z_.addToast({title:e,...t,id:n}),n},Qse=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,$se=Zse,G=Object.assign($se,{success:Z_.success,info:Z_.info,warning:Z_.warning,error:Z_.error,custom:Z_.custom,message:Z_.message,promise:Z_.promise,dismiss:Z_.dismiss,loading:Z_.loading},{getHistory:()=>Z_.toasts,getToasts:()=>Z_.getActiveToasts()});Vse(`
vendor: 14,859 bytes, line 173
173[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
173`);function Q_(e){return e.label!==void 0}var ece=3,tce=`24px`,nce=`16px`,rce=4e3,ice=356,ace=14,oce=45,sce=200;function $_(...e){return e.filter(Boolean).join(` `)}function cce(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var lce=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=B.useState(null),[O,k]=B.useState(null),[A,j]=B.useState(!1),[M,N]=B.useState(!1),[P,F]=B.useState(!1),[I,L]=B.useState(!1),[ee,R]=B.useState(!1),[te,ne]=B.use
173State(0),[re,ie]=B.useState(0),z=B.useRef(n.duration||y||rce),ae=B.useRef(null),oe=B.useRef(null),se=c===0,ce=c+1<=o,le=n.type,ue=n.dismissible!==!1,de=n.className||``,fe=n.descriptionClassName||``,pe=B.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),me=B.useMemo(()=>n.closeButton??p,[n.closeButton,p]),he=B.useMemo(()=>n.duration||y||rce,[n.duration,y]),ge=B.useRef(0),_e=B.useRef(0),ve=B.useRef(0),ye=B.useRef(null),[be,xe]=b.split(`-`),Se=B.useMemo(()=>s.reduce((e,t,n)=>n>=pe?e:e+t.height,0),[s,pe]),Ce=Xse(),we=n.invert||t,Te=le===`loading`;_e.current=B.useMemo(()=>pe*x+Se,[pe,Se]),B.useEffect(()=>{z.current=he},[he]),B.useEffect(()=>{j(!0)},[]),B.useEffect(()=>{let e=oe.current;if(e){let t=e.getBoundingClientRect().height;return ie(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),B.useLayoutEffect(()=>{if(!A)return;let e=oe.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ie(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ee=B.useCallback(()=>{N(!0),ne(_e.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},sce)},[n,d,a,_e]);B.useEffect(()=>{if(n.promise&&le===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ce?(()=>{if(ve.current<ge.current){let e=new Date().getTime()-ge.current;z.current-=e}ve.current=new Date().getTime()})():z.current!==1/0&&(ge.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ee()},z.current)),()=>clearTimeout(e)},[u,i,n,le,Ce,Ee]),B.useEffect(()=>{n.delete&&(Ee(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ee,n.delete]);function De(){return w?.loading?B.createElement(`div`,{className:$_(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":le===`loading`},w.loading):B.createElement(Wse,{className:$_(C?.loader,n?.classNames?.loader),visible:le===`loading`})}let Oe=n.icon||w?.[le]||Hse(le);return B.createElement(`li`,{tabIndex:0,ref:oe,className:$_(_,de,C?.toast,n?.classNames?.toast,C?.default,C?.[le],n?.classNames?.[le]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":ee,"data-removed":M,"data-visible":ce,"data-y-position":be,"data-x-position":xe,"data-index":c,"data-front":se,"data-swiping":P,"data-dismissible":ue,"data-type":le,"data-invert":we,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?te:_e.current}px`,"--initial-height":S?`auto`:`${re}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),ye.current=null},onPointerDown:e=>{e.button!==2&&(Te||!ue||(ae.current=new Date,ne(_e.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),ye.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(I||!ue)return;ye.current=null;let e=Number(oe.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(oe.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ae.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=oce||a>.11){ne(_e.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ee(),L(!0);return}else{var o,s;(o=oe.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=oe.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}R(!1),F(!1),D(null)},onPointerMove:t=>{var n,r;if(!ye.current||!ue||window.getSelection()?.toString().length>0)return;let i=t.clientY-ye.current.y,a=t.clientX-ye.current.x,o=e.swipeDirections??cce(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&R(!0),(n=oe.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=oe.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},me&&!n.jsx&&le!==`loading`?B.createElement(`button`,{"aria-label":T,"data-disabled":Te,"data-close-button":!0,onClick:Te||!ue?(
173)=>{}:()=>{Ee(),n.onDismiss==null||n.onDismiss.call(n,n)},className:$_(C?.closeButton,n?.classNames?.closeButton)},w?.close??Yse):null,(le||n.icon||n.promise)&&n.icon!==null&&(w?.[le]!==null||n.icon)?B.createElement(`div`,{"data-icon":``,className:$_(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||De():null,n.type===`loading`?null:Oe):null,B.createElement(`div`,{"data-content":``,className:$_(C?.content,n?.classNames?.content)},B.createElement(`div`,{"data-title":``,className:$_(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?B.createElement(`div`,{"data-description":``,className:$_(v,fe,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),B.isValidElement(n.cancel)?n.cancel:n.cancel&&Q_(n.cancel)?B.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Q_(n.cancel)&&ue&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ee())},className:$_(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,B.isValidElement(n.action)?n.action:n.action&&Q_(n.action)?B.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Q_(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ee())},className:$_(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function uce(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function dce(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?nce:tce;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var fce=B.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=ece,toastOptions:g,dir:_=uce(),gap:v=ace,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=B.useState([]),C=B.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=B.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=B.useState([]),[D,O]=B.useState(!1),[k,A]=B.useState(!1),[j,M]=B.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),N=B.useRef(null),P=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),F=B.useRef(null),I=B.useRef(!1),L=B.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||Z_.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return B.useEffect(()=>Z_.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Bse.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),B.useEffect(()=>{if(d!==`system`){M(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?M(`dark`):M(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{M(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{M(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),B.useEffect(()=>{x.length<=1&&O(!1)},[x]),B.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=N.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===N.current||N.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),B.useEffect(()=>{if(N.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,I.current=!1)}},[N.current]),B.createElement(`section`,{ref:t,"aria-label":`${b} ${P}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?B.createElement(`ol`,{key:t,dir:_===`auto`?uce():_,tabIndex:-1,ref:N,className:c,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${ice}px`,"--gap":`${v}px`,...m,...dce(l,u)},onBlur:e=>{I.current&&!e.currentTarget.contains(e.relatedTarget)&&(I.current=!1,F.current&&=(F.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`fal
173se`||I.current||(I.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||A(!0)},onPointerUp:()=>A(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>B.createElement(lce,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:L,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))}),pce=s((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})),mce=s(((e,t)=>{t.exports=pce()})),K=mce(),hce=({...e})=>{let{theme:t=`system`}=zse();return(0,K.jsx)(fce,{theme:t,className:`toaster group`,icons:{success:(0,K.jsx)(Ug,{className:`size-4`}),info:(0,K.jsx)(u_,{className:`size-4`}),warning:(0,K.jsx)(H_,{className:`size-4`}),error:(0,K.jsx)(ise,{className:`size-4`}),loading:(0,K.jsx)(W,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},...e})},gce=`modulepreload`,_ce=function(e){return`/`+e},vce={};const ev=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),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}))))}r=o(t.map(t=>{if(t=_ce(t,n),t in vce)return;vce[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:gce,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}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)})};var tv=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,yce=/^[\\/]{2}/;function bce(e,t){return t+e.replace(/\\/g,`/`)}var xce=`popstate`;function Sce(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Cce(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return iv(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:av(t)}return Ece(t,n,null,e)}function nv(e,t){if(e===!1||e==null)throw Error(t)}function rv(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function wce(){return Math.random().toString(36).substring(2,10)}function Tce(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function iv(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?ov(t):t,state:n,key:t&&t.key||r||wce(),mask:i}}function av({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function ov(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Ece(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Sce(e)?e:iv(h.location,e,t);n&&n(r,e),l=u()+1;let d=Tce(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Sce(e)?e:iv(h.location,e,t);n&&n(r,e),l=u();let i=Tce(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Dce(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(xce,d),c=e,()=>{i.removeEventListener(xce,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Dce(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),nv(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:av(t);return i=i.replace(/ $/,`%20`),!n&&yce.test(i)&&(i=r+i),new URL(i,r)}function Oce(e,t,n=`/`){return kce(e,t,n,!1)}function kce(e,t,n,r,i){let a=cv((typeof t==`string`?ov(t):t).pathname||`/`,n);if(a==null)return null;let o=i??jce(e),s=null,c=qce(a);for(let e=0;s==null&&e<o.length;++e)s=Wce(o[e],c,r);return s}function Ace(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function jce(e){let t=Mce(e);return Pce(t),t}function Mce(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;nv(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}
173" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=fv([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(nv(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Mce(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Hce(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Kce(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Nce(e.path))a(e,t,!0,n)}),t}function Nce(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Nce(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Pce(e){e.sort((e,t)=>e.score===t.score?Uce(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Fce=/^:[\w-]+$/,Ice=3,Lce=2,Rce=1,zce=10,Bce=-2,Vce=e=>e===`*`;function Hce(e,t){let n=e.split(`/`),r=n.length;return n.some(Vce)&&(r+=Bce),t&&(r+=Lce),n.filter(e=>!Vce(e)).reduce((e,t)=>e+(Fce.test(t)?Ice:t===``?Rce:zce),r)}function Uce(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Wce(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Gce(u,l,s.matcher,s.compiledParams):sv(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=sv({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;
173Object.assign(i,d.params),o.push({params:i,pathname:fv([a,d.pathname]),pathnameBase:Qce(fv([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=fv([a,d.pathnameBase]))}return o}function sv(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Kce(e.path,e.caseSensitive,e.end);return Gce(e,t,n,r)}function Gce(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Kce(e,t=!1,n=!0){rv(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function qce(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return rv(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function cv(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Jce(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ov(e):e,a;return n?(n=Zce(n),a=n.startsWith(`/`)?Yce(n.substring(1),`/`):Yce(n,t)):a=t,{pathname:a,search:$ce(r),hash:ele(i)}}function Yce(e,t){let n=pv(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function lv(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Xce(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function uv(e){let t=Xce(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function dv(e,t,n,r=!1){let i;typeof e==`string`?i=ov(e):(i={...e},nv(!i.pathname||!i.pathname.includes(`?`),lv(`?`,`pathname`,`search`,i)),nv(!i.pathname||!i.pathname.includes(`#`),lv(`#`,`pathname`,`hash`,i)),nv(!i.search||!i.search.includes(`#`),lv(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Jce(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Zce=e=>e.replace(/[\\/]{2,}/g,`/`),fv=e=>Zce(e.join(`/`)),pv=e=>e.replace(/\/+$/,``),Qce=e=>pv(e).replace(/^\/*/,`/`),$ce=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ele=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,tle=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function nle(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function rle(e){return fv(e.map(e=>e.route.path).filter(Boolean))||`/`}var ile=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ale(e,t){let n=e;if(typeof n!=`string`||!tv.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ile)try{let e=new URL(window.location.href),r=yce.test(n)?new URL(bce(n,e.protocol)):new URL(n),a=cv(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{rv(!1,`<Link to="${n}">
173 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ole=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function sle(e){try{return ole.includes(new URL(e).protocol)}catch{return!1}}var mv=B.createContext(null);mv.displayName=`DataRouter`;var hv=B.createContext(null);hv.displayName=`DataRouterState`;var cle=B.createContext(!1);function lle(){return B.useContext(cle)}var ule=B.createContext({isTransitioning:!1});ule.displayName=`ViewTransition`;var dle=B.createContext(new Map);dle.displayName=`Fetchers`;var fle=B.createContext(null);fle.displayName=`Await`;var gv=B.createContext(null);gv.displayName=`Navigation`;var _v=B.createContext(null);_v.displayName=`Location`;var vv=B.createContext({outlet:null,matches:[],isDataRoute:!1});vv.displayName=`Route`;var yv=B.createContext(null);yv.displayName=`RouteError`;var ple=`REACT_ROUTER_ERROR`,mle=`REDIRECT`,hle=`ROUTE_ERROR_RESPONSE`;function gle(e){if(e.startsWith(`${ple}:${mle}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function _le(e){if(e.startsWith(`${ple}:${hle}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new tle(t.status,t.statusText,t.data)}catch{}}function vle(e,{relative:t}={}){nv(bv(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=B.useContext(gv),{hash:i,pathname:a,search:o}=wv(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:fv([n,a])),r.createHref({pathname:s,search:o,hash:i})}function bv(){return B.useContext(_v)!=null}function xv(){return nv(bv(),`useLocation() may be used only in the context of a <Router> component.`),B.useContext(_v).location}var yle=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function ble(e){B.useContext(gv).static||B.useLayoutEffect(e)}function Sv(){let{isDataRoute:e}=B.useContext(vv);return e?Rle():xle()}function xle(){nv(bv(),`useNavigate() may be used only in the context of a <Router> component.`);let e=B.useContext(mv),{basename:t,navigator:n}=B.useContext(gv),{matches:r}=B.useContext(vv),{pathname:i}=xv(),a=JSON.stringify(uv(r)),o=B.useRef(!1);return ble(()=>{o.current=!0}),B.useCallback((r,s={})=>{if(rv(o.current,yle),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=dv(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:fv([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Sle=B.createContext(null);function Cle(e){let t=B.useContext(vv).outlet;return B.useMemo(()=>t&&B.createElement(Sle.Provider,{value:e},t),[t,e])}function Cv(){let{matches:e}=B.useContext(vv);return e[e.length-1]?.params??{}}function wv(e,{relative:t}={}){let{matches:n}=B.useContext(vv),{pathname:r}=xv(),i=JSON.stringify(uv(n));return B.useMemo(()=>dv(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function wle(e,t){return Tle(e,t)}function Tle(e,t,n){nv(bv(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=B.useContext(gv),{matches:i}=B.useContext(vv),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Ble(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 174 175Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=xv(),d;if(t){let e=typeof t==`string`?ov(t):t;nv(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Oce(e,{pathname:p});rv(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),rv(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=jle(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:fv([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:fv([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?B.createElement(_v.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Ele(){let e=Lle(),t=nle(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=B.createElement(B.Fragment,null,B.createElement(`p`,null,`ð¿ Hey developer ð`),B.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,B.createElement(`code`,{style:a}
175,`ErrorBoundary`),` or`,` `,B.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),B.createElement(B.Fragment,null,B.createElement(`h2`,null,`Unexpected Application Error!`),B.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?B.createElement(`pre`,{style:i},n):null,o)}var Dle=B.createElement(Ele,null),Ole=class extends B.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=_le(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:B.createElement(vv.Provider,{value:this.props.routeContext},B.createElement(yv.Provider,{value:e,children:this.props.component}));return this.context?B.createElement(kle,{error:e},t):t}};Ole.contextType=cle;var Tv=new WeakMap;function kle({children:e,error:t}){let{basename:n}=B.useContext(gv);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=gle(t.digest);if(e){let r=Tv.get(t);if(r)throw r;let i=ale(e.location,n),a=i.absoluteURL||i.to;if(sle(a))throw Error(`Invalid redirect location`);if(ile&&!Tv.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Tv.set(t,n),n}return B.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Ale({routeContext:e,match:t,children:n}){let r=B.useContext(mv);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),B.createElement(vv.Provider,{value:e},n)}function jle(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);nv(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:rle(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Dle,o&&(s<0&&c===0?(Ble(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?B.createElement(n.route.Component,null):n.route.element?n.route.element:e,B.createElement(Ale,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?B.createElement(Ole,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Ev(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mle(e){let t=B.useContext(mv);return nv(t,Ev(e)),t}function Dv(e){let t=B.useContext(hv);return nv(t,Ev(e)),t}function Nle(e){let t=B.useContext(vv);return nv(t,Ev(e)),t}function Ov(e){let t=Nle(e),n=t.matches[t.matches.length-1];return nv(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ple(){return Ov(`useRouteId`)}function Fle(){let e=Dv(`useNavigation`);return B.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Ile(){let{matches:e,loaderData:t}=Dv(`useMatches`);return B.useMemo(()=>e.map(e=>Ace(e,t)),[e,t])}function Lle(){let e=B.useContext(yv),t=Dv(`useRouteError`),n=Ov(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Rle(){let{router:e}=Mle(`useNavigate`),t=Ov(`useNavigate`),n=B.useRef(!1);return ble(()=>{n.current=!0}),B.useCallback(async(r,i={})=>{rv(n.current,yle),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var zle={};function Ble(e,t,n){!t&&!zle[e]&&(zle[e]=!0,rv(!1,n))}B.useOptimistic,B.memo(Vle);function Vle({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Tle(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function kv({to:e,replace:t,state:n,relative:r}){nv(bv(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=B.useContext(gv);rv(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=B.useContext(vv),{pathname:o}=xv(),s=Sv(),c=dv(e,uv(a),o,r===`path`),l=JSON.stringify(c);return B.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Av(e){return Cle(e.context)}function jv(e){nv(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Hle({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){nv(!bv(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=B.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=ov(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=B.useMemo(()=>{let e=cv(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);
175return rv(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:B.createElement(gv.Provider,{value:c},B.createElement(_v.Provider,{children:t,value:h}))}function Ule({children:e,location:t}){return wle(Mv(e),t)}function Mv(e,t=[]){let n=[];return B.Children.forEach(e,(e,r)=>{if(!B.isValidElement(e))return;let i=[...t,r];if(e.type===B.Fragment){n.push.apply(n,Mv(e.props.children,i));return}nv(e.type===jv,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),nv(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Mv(e.props.children,i)),n.push(a)}),n}var Nv=`get`,Pv=`application/x-www-form-urlencoded`;function Fv(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Wle(e){return Fv(e)&&e.tagName.toLowerCase()===`button`}function Gle(e){return Fv(e)&&e.tagName.toLowerCase()===`form`}function Kle(e){return Fv(e)&&e.tagName.toLowerCase()===`input`}function qle(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Jle(e,t){return e.button===0&&(!t||t===`_self`)&&!qle(e)}function Iv(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Yle(e,t){let n=Iv(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Lv=null;function Xle(){if(Lv===null)try{new FormData(document.createElement(`form`),0),Lv=!1}catch{Lv=!0}return Lv}var Zle=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Rv(e){return e!=null&&!Zle.has(e)?(rv(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pv}"`),null):e}function Qle(e,t){let n,r,i,a,o;if(Gle(e)){let o=e.getAttribute(`action`);r=o?cv(o,t):null,n=e.getAttribute(`method`)||Nv,i=Rv(e.getAttribute(`enctype`))||Pv,a=new FormData(e)}else if(Wle(e)||Kle(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?cv(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Nv,i=Rv(e.getAttribute(`formenctype`))||Rv(o.getAttribute(`enctype`))||Pv,a=new FormData(o,e),!Xle()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Fv(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Nv,r=null,i=Pv,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var $le={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},eue=/[&><\u2028\u2029]/g;function zv(e){return e.replace(eue,e=>$le[e])}function Bv(e,t){if(e===!1||e==null)throw Error(t)}function tue(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&cv(i.pathname,t)===`/`?i.pathname=`${pv(t)}/_root.${r}`:i.pathname=`${pv(i.pathname)}.${r}`,i}async function nue(e,t){if(e.id in t)return t[e.id];try{let n=await ev(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.
175isSpaMode,window.location.reload(),new Promise(()=>{})}}function rue(e){return e!=null&&typeof e.page==`string`}function iue(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function aue(e,t,n){return uue((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await nue(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(iue).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function oue(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function sue(e,t,{includeHydrateFallback:n}={}){return cue(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function cue(e){return[...new Set(e)]}function lue(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function uue(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!rue(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(lue(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Vv(){let e=B.useContext(mv);return Bv(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function due(){let e=B.useContext(hv);return Bv(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Hv=B.createContext(void 0);Hv.displayName=`FrameworkContext`;function Uv(){let e=B.useContext(Hv);return Bv(e,`You must render this element inside a <HydratedRouter> element`),e}function fue(e,t){let n=B.useContext(Hv),[r,i]=B.useState(!1),[a,o]=B.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=B.useRef(null);B.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),B.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Wv(s,p),onBlur:Wv(c,m),onMouseEnter:Wv(l,p),onMouseLeave:Wv(u,m),onTouchStart:Wv(d,p)}]:[a,f,{}]:[!1,f,{}]}function Wv(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function pue({page:e,...t}){let n=lle(),{nonce:r}=Uv(),{router:i}=Vv(),a=B.useMemo(()=>Oce(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?B.createElement(hue,{page:e,matches:a,...t}):B.createElement(gue,{page:e,matches:a,...t})):null}function mue(e){let{manifest:t,routeModules:n}=Uv(),[r,i]=B.useState([]);return B.useEffect(()=>{let r=!1;return aue(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function hue({page:e,matches:t,...n}){let r=xv(),{future:i}=Uv(),{basename:a}=Vv(),o=B.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=tue(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return B.createElement(B.Fragment,null,o.map(e=>B.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function gue({page:e,matches:t,...n}){let r=xv(),{future:i,manifest:a,routeModules:o}=Uv(),{basename:s}=Vv(),{loaderData:c,matches:l}=due(),u=B.useMemo(()=>oue(e,t,l,a,r,`data`),[e,t,l,a,r]),d=B.useMemo(()=>oue(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=B.useMemo(()=>
175{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=tue(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=B.useMemo(()=>sue(d,a),[d,a]),m=mue(d);return B.createElement(B.Fragment,null,f.map(e=>B.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>B.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>B.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function _ue(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var vue=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{vue&&(window.__reactRouterVersion=`7.18.1`)}catch{}function yue({basename:e,children:t,useTransitions:n,window:r}){let i=B.useRef();i.current??=Cce({window:r,v5Compat:!0});let a=i.current,[o,s]=B.useState({action:a.action,location:a.location}),c=B.useCallback(e=>{n===!1?s(e):B.startTransition(()=>s(e))},[n]);return B.useLayoutEffect(()=>a.listen(c),[a,c]),B.createElement(Hle,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function bue({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=B.useState({action:n.action,location:n.location}),o=B.useCallback(e=>{r===!1?a(e):B.startTransition(()=>a(e))},[r]);return B.useLayoutEffect(()=>n.listen(o),[n,o]),B.createElement(Hle,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}bue.displayName=`unstable_HistoryRouter`;var Gv=B.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=B.useContext(gv),v=typeof l==`string`&&tv.test(l),y=ale(l,h);l=y.to;let b=vle(l,{relative:r}),x=xv(),S=null;if(o){let e=dv(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:fv([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=fue(n,p),E=Tue(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=B.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:_ue(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?B.createElement(B.Fragment,null,k,B.createElement(pue,{page:b})):k});Gv.displayName=`Link`;var Kv=B.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=wv(a,{relative:c.relative}),d=xv(),f=B.useContext(hv),{navigator:p,basename:m}=B.useContext(gv),h=f!=null&&Mue(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=cv(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return B.createElement(Gv,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Kv.displayName=`NavLink`;var xue=B.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Nv,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=B.useContext(gv),g=Oue(),_=kue(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&tv.test(s);return B.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?B.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});xue.displayName=`Form`;function Sue({getKey:e,storageKey:t,...n}){let r=B.useContext(Hv),{basename:i}=B.useContext(gv),a=xv(),o=Ile();Aue({getKey:e,storageKey:t});let s=B.useMemo(()=>
175{if(!r||!e)return null;let t=Zv(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),B.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${zv(JSON.stringify(t||Yv))}, ${zv(JSON.stringify(s))})`}})}Sue.displayName=`ScrollRestoration`;function Cue(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qv(e){let t=B.useContext(mv);return nv(t,Cue(e)),t}function wue(e){let t=B.useContext(hv);return nv(t,Cue(e)),t}function Tue(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Sv(),d=xv(),f=wv(e,{relative:o});return B.useCallback(p=>{if(Jle(p,t)){p.preventDefault();let t=n===void 0?av(d)===av(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?B.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Jv(e){rv(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=B.useRef(Iv(e)),n=B.useRef(!1),r=xv(),i=B.useMemo(()=>Yle(r.search,n.current?null:t.current),[r.search]),a=Sv();return[i,B.useCallback((e,t)=>{let r=Iv(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Eue=0,Due=()=>`__${String(++Eue)}__`;function Oue(){let{router:e}=qv(`useSubmit`),{basename:t}=B.useContext(gv),n=Ple(),r=e.fetch,i=e.navigate;return B.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Qle(e,t);a.navigate===!1?await r(a.fetcherKey||Due(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function kue(e,{relative:t}={}){let{basename:n}=B.useContext(gv),r=B.useContext(vv);nv(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...wv(e||`.`,{relative:t})},o=xv();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:fv([n,a.pathname])),av(a)}var Yv=`react-router-scroll-positions`,Xv={};function Zv(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:cv(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Aue({getKey:e,storageKey:t}={}){let{router:n}=qv(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=wue(`useScrollRestoration`),{basename:a}=B.useContext(gv),o=xv(),s=Ile(),c=Fle();B.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),jue(B.useCallback(()=>{if(c.state===`idle`){let t=Zv(o,s,a,e);Xv[t]=window.scrollY}try{sessionStorage.setItem(t||Yv,JSON.stringify(Xv))}catch(e){rv(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(B.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Yv);e&&(Xv=JSON.parse(e))}catch{}},[t]),B.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Xv,()=>window.scrollY,e?(t,n)=>Zv(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),B.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{rv(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function jue(e,t){let{capture:n}=t||{};B.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Mue(e,{relative:t}={}){let n=B.useContext(ule);nv(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=qv(`useViewTransitionState`),i=wv(e,{relative:t});if(!n.isTransitioning)return!1;let a=cv(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=cv(n.nextLocation.pathname,r)||n.nextLocation.pathname;return sv(i.pathname,o)!=null||sv(i.pathname,a)!=null}function Qv(e,t){if(typeof e==`function`)return e(t);
vendor: 4,300 bytes, line 175
175e!=null&&(e.current=t)}function $v(...e){return t=>{let n=!1,r=e.map(e=>{let r=Qv(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():Qv(e[t],null)}}}}function ey(...e){return B.useCallback($v(...e),e)}var Nue=Symbol.for(`react.lazy`),ty=B.use;function Pue(e){return typeof e==`object`&&!!e&&`then`in e}function Fue(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Nue&&`_payload`in e&&Pue(e._payload)}function ny(e){let t=Iue(e),n=B.forwardRef((e,n)=>{let{children:r,...i}=e;Fue(r)&&typeof ty==`function`&&(r=ty(r._payload));let a=B.Children.toArray(r),o=a.find(Rue);if(o){let e=o.props.children,r=a.map(t=>t===o?B.Children.count(e)>1?B.Children.only(null):B.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:B.isValidElement(e)?B.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var ry=ny(`Slot`);function Iue(e){let t=B.forwardRef((e,t)=>{let{children:n,...r}=e;if(Fue(n)&&typeof ty==`function`&&(n=ty(n._payload)),B.isValidElement(n)){let e=Bue(n),i=zue(r,n.props);return n.type!==B.Fragment&&(i.ref=t?$v(t,e):e),B.cloneElement(n,i)}return B.Children.count(n)>1?B.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Lue=Symbol(`radix.slottable`);function Rue(e){return B.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Lue}function zue(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(` `))}return{...e,...n}}function Bue(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)}function Vue(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=Vue(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function iy(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Vue(e))&&(r&&(r+=` `),r+=t);return r}var Hue=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e;const Uue=iy,ay=(e,t)=>n=>{if(t?.variants==null)return Uue(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=Hue(t)||Hue(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 Uue(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)};var Wue=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Gue=(e,t)=>({classGroupId:e,validator:t}),Kue=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),oy=`-`,sy=[],que=`arbitrary..`,Jue=e=>{let t=Xue(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Yue(e);let n=e.split(oy);return cy(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Wue(i,t):t:i||sy}return n[e]||sy}}},cy=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=cy(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(oy):e.slice(t).join(oy),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Yue=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?que+r:void 0})(),Xue=e=>{let{theme:t,classGroups:n}=e;return Zue(n,t)},Zue=(e,t)=>{let n=Kue();for(let r in e){let i=e[r];ly(i,n,r,t)}return n},ly=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Que(i,t,n,r)}},Que=(e,t,n,r)=>{if(typeof e==`string`){$ue(e,t,n);return}if(typeof e==`function`){ede(e,t,n,r);return}tde(e,t,n,r)}
vendor: 4,770 bytes, line 175
175,$ue=(e,t,n)=>{let r=e===``?t:uy(t,e);r.classGroupId=n},ede=(e,t,n,r)=>{if(nde(e)){ly(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Gue(n,e))},tde=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ly(o,uy(t,a),n,r)}},uy=(e,t)=>{let n=e,r=t.split(oy),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Kue(),n.nextPart.set(t,i)),n=i}return n},nde=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,rde=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},dy=`!`,fy=`:`,ide=[],py=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ade=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===fy){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(dy)?(c=s.slice(0,-1),l=!0):s.startsWith(dy)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return py(t,l,c,u)};if(t){let e=t+fy,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):py(ide,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ode=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},sde=e=>({cache:rde(e.cacheSize),parseClassName:ade(e),sortModifiers:ode(e),...Jue(e)}),cde=/\s+/,lde=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(cde),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+dy:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},ude=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=my(n))&&(i&&(i+=` `),i+=r);return i},my=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=my(e[r]))&&(n&&(n+=` `),n+=t);return n},dde=(e,...t)=>{let n,r,i,a,o=o=>(n=sde(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=lde(e,n);return i(e,a),a};return a=o,(...e)=>a(ude(...e))},fde=[],hy=e=>{let t=t=>t[e]||fde;return t.isThemeGetter=!0,t},pde=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,mde=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hde=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,gde=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_de=/\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$/,vde=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,yde=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bde=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gy=e=>hde.test(e),_y=e=>!!e&&!Number.isNaN(Number(e)),vy=e=>!!e&&Number.isInteger(Number(e)),yy=e=>e.endsWith(`%`)&&_y(e.slice(0,-1)),by=e=>gde.test(e),xde=()=>!0,Sde=e=>_de.test(e)&&!vde.test(e),xy=()=>!1,Cde=e=>yde.test(e),wde=e=>bde.test(e),Tde=e=>!Sy(e)&&!Ty(e),Ede=e=>ky(e,Rde,xy),Sy=e=>pde.test(e),Cy=e=>ky(e,zde,Sde),Dde=e=>ky(e,Bde,_y),Ode=e=>ky(e,Hde,xde),kde=e=>ky(e,Vde,xy),Ade=e=>ky(e,Ide,xy),jde=e=>ky(e,Lde,wde),wy=e=>ky(e,jy,Cde),Ty=e=>mde.test(e),Ey=e=>Ay(e,zde),Mde=e=>Ay(e,Vde),Dy=e=>Ay(e,Ide),Nde=e=>Ay(e,Rde),Pde=e=>Ay(e,Lde),Oy=e=>Ay(e,jy,!0),Fde=e=>Ay(e,Hde,!0),ky=(e,t,n)=>{let r=pde.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ay=(e,t,n=!1)=>{let r=mde.exec(e);return r?r[1]?t(r[1]):n:!1},Ide=e=>e===`position`||e===`percentage`,Lde=e=>e===`image`||e===`url`,Rde=e=>e===`length`||e===`size`||e===`bg-size`,zde=e=>e===`length`,Bde=e=>e===`number`,Vde=e=>e===`family-name`,Hde=e=>e===`number`||e===`weight`,jy=e=>e===`shadow`,Ude=dde(()=>{let e=hy(`color`),t=hy(`font`),n=hy(`text`),r=hy(`font-weight`),i=hy(`tracking`),a=hy(`leading`),o=hy(`breakpoint`),s=hy(`container`),c=hy(`spacing`),l=hy(`radius`),u=hy(`shadow`),d=hy(`inset-shadow`),f=hy(`text-shadow`),p=hy(`drop-shadow`),m=hy(`blur`),h=hy(`perspective`),g=hy(`aspect`),_=hy(`ease`),v=hy(`animate`),y=()=>
vendor: 4,087 bytes, line 175
175[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Ty,Sy],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Ty,Sy,c],T=()=>[gy,`full`,`auto`,...w()],E=()=>[vy,`none`,`subgrid`,Ty,Sy],D=()=>[`auto`,{span:[`full`,vy,Ty,Sy]},vy,Ty,Sy],O=()=>[vy,`auto`,Ty,Sy],k=()=>[`auto`,`min`,`max`,`fr`,Ty,Sy],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[gy,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[gy,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[gy,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Ty,Sy],L=()=>[...b(),Dy,Ade,{position:[Ty,Sy]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],R=()=>[`auto`,`cover`,`contain`,Nde,Ede,{size:[Ty,Sy]}],te=()=>[yy,Ey,Cy],ne=()=>[``,`none`,`full`,l,Ty,Sy],re=()=>[``,_y,Ey,Cy],ie=()=>[`solid`,`dashed`,`dotted`,`double`],z=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ae=()=>[_y,yy,Dy,Ade],oe=()=>[``,`none`,m,Ty,Sy],se=()=>[`none`,_y,Ty,Sy],ce=()=>[`none`,_y,Ty,Sy],le=()=>[_y,Ty,Sy],ue=()=>[gy,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[by],breakpoint:[by],color:[xde],container:[by],"drop-shadow":[by],ease:[`in`,`out`,`in-out`],font:[Tde],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[by],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[by],shadow:[by],spacing:[`px`,_y],text:[by],"text-shadow":[by],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,gy,Sy,Ty,g]}],container:[`container`],columns:[{columns:[_y,Sy,Ty,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[vy,`auto`,Ty,Sy]}],basis:[{basis:[gy,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[_y,gy,`auto`,`initial`,`none`,Sy]}],grow:[{grow:[``,_y,Ty,Sy]}],shrink:[{shrink:[``,_y,Ty,Sy]}],order:[{order:[vy,`first`,`last`,`none`,Ty,Sy]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}
vendor: 4,203 bytes, line 175
175],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Ey,Cy]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Fde,Ode]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,yy,Sy]}],"font-family":[{font:[Mde,kde,t]}],"font-features":[{"font-features":[Sy]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Ty,Sy]}],"line-clamp":[{"line-clamp":[_y,`none`,Ty,Dde]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Ty,Sy]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Ty,Sy]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ie(),`wavy`]}],"text-decoration-thickness":[{decoration:[_y,`from-font`,`auto`,Ty,Cy]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[_y,`auto`,Ty,Sy]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Ty,Sy]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Ty,Sy]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:R()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},vy,Ty,Sy],radial:[``,Ty,Sy],conic:[vy,Ty,Sy]},Pde,jde]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:te()}
175],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":re()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ie(),`hidden`,`none`]}],"divide-style":[{divide:[...ie(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}
vendor: 6,231 bytes, line 175
175],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ie(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[_y,Ty,Sy]}],"outline-w":[{outline:[``,_y,Ey,Cy]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Oy,wy]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Oy,wy]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:re()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[_y,Cy]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Oy,wy]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[_y,Ty,Sy]}],"mix-blend":[{"mix-blend":[...z(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":z()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[_y]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Ty,Sy]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[_y]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Ty,Sy]}],filter:[{filter:[``,`none`,Ty,Sy]}],blur:[{blur:oe()}],brightness:[{brightness:[_y,Ty,Sy]}],contrast:[{contrast:[_y,Ty,Sy]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Oy,wy]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,_y,Ty,Sy]}],"hue-rotate":[{"hue-rotate":[_y,Ty,Sy]}],invert:[{invert:[``,_y,Ty,Sy]}],saturate:[{saturate:[_y,Ty,Sy]}],sepia:[{sepia:[``,_y,Ty,Sy]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Ty,Sy]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[_y,Ty,Sy]}],"backdrop-contrast":[{"backdrop-contrast":[_y,Ty,Sy]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,_y,Ty,Sy]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_y,Ty,Sy]}],"backdrop-invert":[{"backdrop-invert":[``,_y,Ty,Sy]}],"backdrop-opacity":[{"backdrop-opacity":[_y,Ty,Sy]}],"backdrop-saturate":[{"backdrop-saturate":[_y,Ty,Sy]}],"backdrop-sepia":[{"backdrop-sepia":[``,_y,Ty,Sy]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Ty,Sy]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[_y,`initial`,Ty,Sy]}],ease:[{ease:[`linear`,`initial`,_,Ty,Sy]}],delay:[{delay:[_y,Ty,Sy]}],animate:[{animate:[`none`,v,Ty,Sy]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Ty,Sy]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[Ty,Sy,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":[`translate-none`],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom
175-in`,`zoom-out`,Ty,Sy]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}
175],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Ty,Sy]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[_y,Ey,Cy,Dde]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function q(...e){return Ude(iy(e))}function My(e,t=`/`){return e&&e.startsWith(`/`)&&!e.startsWith(`//`)?e:t}var Ny=ay(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function J({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,K.jsx)(r?ry:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:q(Ny({variant:t,size:n,className:e})),...i})}const Py=6048e5,Fy=6e4,Iy=36e5,Ly=43200,Ry=3600*24;Ry*7,Ry*365.2425;const zy=Symbol.for(`constructDateFrom`);function By(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&zy in e?e[zy](t):e instanceof Date?new e.constructor(t):new Date(t)}function Vy(e,t){return By(t||e,e)}function Hy(e,t,n){let r=Vy(e,n?.in);return isNaN(t)?By(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Uy(e,t,n){let r=Vy(e,n?.in);if(isNaN(t))return By(n?.in||e,NaN);if(!t)return r;let i=r.getDate(),a=By(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),i>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}var Wde={};function Wy(){return Wde}function Gy(e,t){let n=Wy(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Vy(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Ky(e,t){return Gy(e,{...t,weekStartsOn:1}
175)}function Gde(e,t){let n=Vy(e,t?.in),r=n.getFullYear(),i=By(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=Ky(i),o=By(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=Ky(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function qy(e){let t=Vy(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function Jy(e,...t){let n=By.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function Yy(e,t){let n=Vy(e,t?.in);return n.setHours(0,0,0,0),n}function Xy(e,t,n){let[r,i]=Jy(n?.in,e,t),a=Yy(r),o=Yy(i),s=+a-qy(a),c=+o-qy(o);return Math.round((s-c)/864e5)}function Kde(e,t){let n=Gde(e,t),r=By(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Ky(r)}function qde(e,t,n){return Hy(e,t*7,n)}function Jde(e,t,n){return Uy(e,t*12,n)}function Yde(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=By.bind(null,e));let t=Vy(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),By(r,n||NaN)}function Xde(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=By.bind(null,e));let t=Vy(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),By(r,n||NaN)}function Zy(e,t){let n=Vy(e)-+Vy(t);return n<0?-1:n>0?1:n}function Qy(e){return By(e,Date.now())}function $y(e,t,n){let[r,i]=Jy(n?.in,e,t);return+Yy(r)==+Yy(i)}function Zde(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Qde(e){return!(!Zde(e)&&typeof e!=`number`||isNaN(+Vy(e)))}function eb(e,t,n){let[r,i]=Jy(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function $de(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function efe(e,t){return Vy(e)-+Vy(t)}function tfe(e,t){let n=Vy(e,t?.in);return n.setHours(23,59,59,999),n}function nfe(e,t){let n=Vy(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function rfe(e,t){let n=Vy(e,t?.in);return+tfe(n,t)==+nfe(n,t)}function ife(e,t,n){let[r,i,a]=Jy(n?.in,e,e,t),o=Zy(i,a),s=Math.abs(eb(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let c=Zy(i,a)===-o;rfe(r)&&s===1&&Zy(r,a)===1&&(c=!1);let l=o*(s-+c);return l===0?0:l}function afe(e,t,n){let r=efe(e,t)/1e3;return $de(n?.roundingMethod)(r)}function ofe(e,t){let[n,r]=Jy(e,t.start,t.end);return{start:n,end:r}}function sfe(e,t){let{start:n,end:r}=ofe(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setDate(1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(By(n,o)),o.setMonth(o.getMonth()+s);return i?c.reverse():c}function cfe(e,t){let n=Vy(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function lfe(e,t){let n=Vy(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function ufe(e,t){let n=Vy(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function dfe(e,t){let{start:n,end:r}=ofe(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(By(n,o)),o.setFullYear(o.getFullYear()+s);return i?c.reverse():c}function ffe(e,t){let n=Wy(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Vy(e,t?.in),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function pfe(e,t){return ffe(e,{...t,weekStartsOn:1})}var mfe={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}};
vendor: 6,856 bytes, line 175
175const hfe=(e,t,n)=>{let r,i=mfe[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function tb(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const gfe={date:tb({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:tb({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:tb({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})};var _fe={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`};const vfe=(e,t,n,r)=>_fe[e];function nb(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const yfe={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:nb({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:nb({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:nb({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:nb({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:nb({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function rb(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?xfe(s,e=>e.test(o)):bfe(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function bfe(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function xfe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Sfe(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const ib={code:`en-US`,formatDistance:hfe,formatLong:gfe,formatRelative:vfe,localize:yfe,match:{ordinalNumber:Sfe({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:rb({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:rb({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:rb({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:rb({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:rb({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Cfe(e,t){let n=Vy(e,t?.in);return Xy(n,ufe(n))+1}function ab(e,t){let n=Vy(e,t?.in),r=Ky(n)-+Kde(n);return Math.round(r/Py)+1}function wfe(e,t){let n=Vy(e,t?.in),r=n.getFullYear(),i=Wy(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=By(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=Gy(o,t),c=By(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=Gy(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function Tfe(e,t){let n=Wy(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=wfe(e,t),a=By(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),Gy(a,t)}function ob(e,t){let n=Vy(e,t?.in),r=Gy(n,t)-+Tfe(n,t);return Math.round(r/Py)+1}
vendor: 6,657 bytes, line 175
175function sb(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}const cb={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return sb(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):sb(n+1,2)},d(e,t){return sb(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];case`aaaa`:default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return sb(e.getHours()%12||12,t.length)},H(e,t){return sb(e.getHours(),t.length)},m(e,t){return sb(e.getMinutes(),t.length)},s(e,t){return sb(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return sb(Math.trunc(r*10**(n-3)),t.length)}};var lb={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`};const Efe={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});case`GGGG`:default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return cb.y(e,t)},Y:function(e,t,n,r){let i=wfe(e,r),a=i>0?i:1-i;return t===`YY`?sb(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):sb(a,t.length)},R:function(e,t){return sb(Gde(e),t.length)},u:function(e,t){return sb(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return sb(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});case`QQQQ`:default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return sb(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});case`qqqq`:default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return cb.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});case`MMMM`:default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return sb(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});case`LLLL`:default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=ob(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):sb(i,t.length)},I:function(e,t,n){let r=ab(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):sb(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):cb.d(e,t)},D:function(e,t,n){let r=Cfe(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):sb(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});case`EEEE`:default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return sb(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});case`eeee`:default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return sb(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});case`cccc`:default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return sb(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});case`iiii`:default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});case`aaaa`:default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?lb.noon:r===0?lb.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`bbbb`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?lb.evening:r>=12?lb.afternoon:r>=4?lb.morning:lb.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`BBBB`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return cb.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):cb.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):sb(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):sb(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):cb.m(e,t)}
175,s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):cb.s(e,t)},S:function(e,t){return cb.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Ofe(r);case`XXXX`:case`XX`:return ub(r);case`XXXXX`:case`XXX`:default:return ub(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Ofe(r);case`xxxx`:case`xx`:return ub(r);case`xxxxx`:case`xxx`:default:return ub(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Dfe(r,`:`);case`OOOO`:default:return`GMT`+ub(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Dfe(r,`:`);case`zzzz`:default:return`GMT`+ub(r,`:`)}},t:function(e,t,n){return sb(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return sb(+e,t.length)}};function Dfe(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+sb(a,2)}function Ofe(e,t){return e%60==0?(e>0?`-`:`+`)+sb(Math.abs(e)/60,2):ub(e,t)}function ub(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=sb(Math.trunc(r/60),2),a=sb(r%60,2);return n+i+t+a}var kfe=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});case`PPPP`:default:return t.date({width:`full`})}},db=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});case`pppp`:default:return t.time({width:`full`})}};const Afe={p:db,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return kfe(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;case`PPPP`:default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,kfe(r,t)).replace(`{{time}}`,db(i,t))}};var jfe=/^D+$/,Mfe=/^Y+$/,Nfe=[`D`,`DD`,`YY`,`YYYY`];function Pfe(e){return jfe.test(e)}function Ffe(e){return Mfe.test(e)}function Ife(e,t,n){let r=Lfe(e,t,n);if(console.warn(r),Nfe.includes(e))throw RangeError(r)}function Lfe(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Rfe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zfe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bfe=/^'([^]*?)'?$/,Vfe=/''/g,Hfe=/[a-zA-Z]/;function fb(e,t,n){let r=Wy(),i=n?.locale??r.locale??ib,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Vy(e,n?.in);if(!Qde(s))throw RangeError(`Invalid time value`);let c=t.match(zfe).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Afe[t];return n(e,i.formatLong)}return e}).join(``).match(Rfe).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Ufe(e)};if(Efe[t])return{isToken:!0,value:e};if(t.match(Hfe))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&Ffe(a)||!n?.useAdditionalDayOfYearTokens&&Pfe(a))&&Ife(a,t,String(e));let o=Efe[a[0]];return o(s,a,i.localize,l)}).join(``)}function Ufe(e){let t=e.match(Bfe);return t?t[1].replace(Vfe,`'`):e}function Wfe(e,t,n){let r=Wy(),i=n?.locale??r.locale??ib,a=Zy(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=Jy(n?.in,...a>0?[t,e]:[e,t]),l=afe(c,s),u=(qy(c)-qy(s))/1e3,d=Math.round((l-u)/60),f;if(d<2)return n?.includeSeconds?l<5?i.formatDistance(`lessThanXSeconds`,5,o):l<10?i.formatDistance(`lessThanXSeconds`,10,o):l<20?i.formatDistance(`lessThanXSeconds`,20,o):l<40?i.formatDistance(`halfAMinute`,0,o):l<60?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,1,o):d===0?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,d,o);if(d<45)return i.formatDistance(`xMinutes`,d,o);if(d<90)return i.formatDistance(`aboutXHours`,1,o);if(d<1440){let e=Math.round(d/60);return i.formatDistance(`aboutXHours`,e,o)}else if(d<2520)return i.formatDistance(`xDays`,1,o);else if(d<43200){let e=Math.round(d/1440);return i.formatDistance(`xDays`,e,o)}else if(d<43200*2)return f=Math.round(d/Ly),i.formatDistance(`aboutXMonths`,f,o);if(f=ife(c,s),f<12){let e=Math.round(d/Ly);return i.formatDistance(`xMonths`,e,o)}else{let e=f%12,t=Math.trunc(f/12);return e<3?i.formatDistance(`aboutXYears`,t,o):e<9?i.formatDistance(`overXYears`,t,o):i.formatDistance(`almostXYears`,t+1,o)}}function pb(e,t){return Wfe(e,Qy(e),t)}function Gfe(e,t){let n=Vy(e,t?.in),r=n.getFullYear(),i=n.getMonth(),a=By(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function Kfe(e,t){return Vy(e,t?.in).getMonth()}function qfe(e,t){return Vy(e,t?.in).getFullYear()}function Jfe(e,t){return+Vy(e)>
vendor: 5,561 bytes, line 175
175+Vy(t)}function Yfe(e,t){return+Vy(e)<+Vy(t)}function Xfe(e,t,n){let[r,i]=Jy(n?.in,e,t);return+Gy(r,n)==+Gy(i,n)}function mb(e,t,n){let[r,i]=Jy(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function Zfe(e,t,n){let[r,i]=Jy(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function hb(e,t){return $y(By(t?.in||e,e),Qy(t?.in||e))}function gb(e,t,n){return Hy(e,-t,n)}function Qfe(e,t){return $y(By(t?.in||e,e),gb(Qy(t?.in||e),1))}function _b(e,t){let n=()=>By(t?.in,NaN),r=t?.additionalDigits??2,i=npe(e),a;if(i.date){let e=rpe(i.date,r);a=ipe(e.restDateString,e.year)}if(!a||isNaN(+a))return n();let o=+a,s=0,c;if(i.time&&(s=ape(i.time),isNaN(s)))return n();if(i.timezone){if(c=ope(i.timezone),isNaN(c))return n()}else{let e=new Date(o+s),n=Vy(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return Vy(o+s+c,t?.in)}var vb={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},$fe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,epe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,tpe=/^([+-])(\d{2})(?::?(\d{2}))?$/;function npe(e){let t={},n=e.split(vb.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],vb.timeZoneDelimiter.test(t.date)&&(t.date=e.split(vb.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){let e=vb.timezone.exec(r);e?(t.time=r.replace(e[1],``),t.timezone=e[1]):t.time=r}return t}function rpe(e,t){let n=RegExp(`^(?:(\\d{4}|[+-]\\d{`+(4+t)+`})|(\\d{2}|[+-]\\d{`+(2+t)+`})$)`),r=e.match(n);if(!r)return{year:NaN,restDateString:``};let i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function ipe(e,t){if(t===null)return new Date(NaN);let n=e.match($fe);if(!n)return new Date(NaN);let r=!!n[4],i=yb(n[1]),a=yb(n[2])-1,o=yb(n[3]),s=yb(n[4]),c=yb(n[5])-1;if(r)return dpe(t,s,c)?spe(t,s,c):new Date(NaN);{let e=new Date(0);return!lpe(t,a,o)||!upe(t,i)?new Date(NaN):(e.setUTCFullYear(t,a,Math.max(i,o)),e)}}function yb(e){return e?parseInt(e):1}function ape(e){let t=e.match(epe);if(!t)return NaN;let n=bb(t[1]),r=bb(t[2]),i=bb(t[3]);return fpe(n,r,i)?n*Iy+r*Fy+i*1e3:NaN}function bb(e){return e&&parseFloat(e.replace(`,`,`.`))||0}function ope(e){if(e===`Z`)return 0;let t=e.match(tpe);if(!t)return 0;let n=t[1]===`+`?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return ppe(r,i)?n*(r*Iy+i*Fy):NaN}function spe(e,t,n){let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var cpe=[31,null,31,30,31,30,31,31,30,31,30,31];function xb(e){return e%400==0||e%4==0&&e%100!=0}function lpe(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(cpe[t]||(xb(e)?29:28))}function upe(e,t){return t>=1&&t<=(xb(e)?366:365)}function dpe(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function fpe(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function ppe(e,t){return t>=0&&t<=59}function mpe(e,t,n){let r=Vy(e,n?.in),i=r.getFullYear(),a=r.getDate(),o=By(n?.in||e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);let s=Gfe(o);return r.setMonth(t,Math.min(a,s)),r}function hpe(e,t,n){let r=Vy(e,n?.in);return isNaN(+r)?By(n?.in||e,NaN):(r.setFullYear(t),r)}function gpe(e,t,n){return qde(e,-t,n)}var _pe={lessThanXSeconds:{one:`menos de un segundo`,other:`menos de {{count}} segundos`},xSeconds:{one:`1 segundo`,other:`{{count}} segundos`},halfAMinute:`medio minuto`,lessThanXMinutes:{one:`menos de un minuto`,other:`menos de {{count}} minutos`},xMinutes:{one:`1 minuto`,other:`{{count}} minutos`},aboutXHours:{one:`alrededor de 1 hora`,other:`alrededor de {{count}} horas`},xHours:{one:`1 hora`,other:`{{count}} horas`},xDays:{one:`1 dÃa`,other:`{{count}} dÃas`},aboutXWeeks:{one:`alrededor de 1 semana`,other:`alrededor de {{count}} semanas`},xWeeks:{one:`1 semana`,other:`{{count}} semanas`},aboutXMonths:{one:`alrededor de 1 mes`,other:`alrededor de {{count}} meses`},xMonths:{one:`1 mes`,other:`{{count}} meses`},aboutXYears:{one:`alrededor de 1 año`,other:`alrededor de {{count}} años`},xYears:{one:`1 año`,other:`{{count}} años`},overXYears:{one:`más de 1 año`,other:`más de {{count}} años`},almostXYears:{one:`casi 1 año`,other:`casi {{count}} años`}};const vpe=(e,t,n)=>{let r,i=_pe[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`en `+r:`hace `+r:r},ype={date:tb({formats:{full:`EEEE, d 'de' MMMM 'de' y`,long:`d 'de' MMMM 'de' y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:tb({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:tb({formats:{full:`{{date}} 'a las' {{time}}`,long:`{{date}} 'a las' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})};var bpe={lastWeek:`'el' eeee 'pasado a la' p`,yesterday:`'ayer a la' p`,today:`'hoy a la' p`,tomorrow:`'mañana a la' p`,nextWeek:`eeee 'a la' p`,other:`P`},xpe={lastWeek:`'el' eeee 'pasado a las' p`,yesterday:`'ayer a las' p`,today:`'hoy a las' p`,tomorrow:`'mañana a las' p`,nextWeek:`eeee 'a las' p`,other:`P`};const Spe={code:`es`,formatDistance:vpe,formatLong:ype,formatRelative:(e,t,n,r)=>t.getHours()===1?bpe[e]:xpe[e],localize:{ordinalNumber:(e,t)=>Number(e)+`º`,era:nb({values:{narrow:[`AC`,`DC`],abbreviated:[`AC`,`DC`],wide:[`antes de cristo`,`después de cristo`]}
175,defaultWidth:`wide`}),quarter:nb({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`T1`,`T2`,`T3`,`T4`],wide:[`1º trimestre`,`2º trimestre`,`3º trimestre`,`4º trimestre`]},defaultWidth:`wide`,argumentCallback:e=>Number(e)-1}),month:nb({values:{narrow:[`e`,`f`,`m`,`a`,`m`,`j`,`j`,`a`,`s`,`o`,`n`,`d`],abbreviated:[`ene`,`feb`,`mar`,`abr`,`may`,`jun`,`jul`,`ago`,`sep`,`oct`,`nov`,`dic`],wide:[`enero`,`febrero`,`marzo`,`abril`,`mayo`,`junio`,`julio`,`agosto`,`septiembre`,`octubre`,`noviembre`,`diciembre`]},defaultWidth:`wide`}),day:nb({values:{narrow:[`d`,`l`,`m`,`m`,`j`,`v`,`s`],short:[`do`,`lu`,`ma`,`mi`,`ju`,`vi`,`sá`],abbreviated:[`dom`,`lun`,`mar`,`mié`,`jue`,`vie`,`sáb`],wide:[`domingo`,`lunes`,`martes`,`miércoles`,`jueves`,`viernes`,`sábado`]},defaultWidth:`wide`}),dayPeriod:nb({values:{narrow:{am:`a`,pm:`p`,midnight:`mn`,noon:`md`,morning:`mañana`,afternoon:`tarde`,evening:`tarde`,night:`noche`},abbreviated:{am:`AM`,pm:`PM`,midnight:`medianoche`,noon:`mediodia`,morning:`mañana`,afternoon:`tarde`,evening:`tarde`,night:`noche`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`medianoche`,noon:`mediodia`,morning:`mañana`,afternoon:`tarde`,evening:`tarde`,night:`noche`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mn`,noon:`md`,morning:`de la mañana`,afternoon:`de la tarde`,evening:`de la tarde`,night:`de la noche`},abbreviated:{am:`AM`,pm:`PM`,midnight:`medianoche`,noon:`mediodia`,morning:`de la mañana`,afternoon:`de la tarde`,evening:`de la tarde`,night:`de la noche`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`medianoche`,noon:`mediodia`,morning:`de la mañana`,afternoon:`de la tarde`,evening:`de la tarde`,night:`de la noche`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:Sfe({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:rb({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:`any`}),quarter:rb({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:rb({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:`any`}),day:rb({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:rb({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:1}};function Sb(e){return e instanceof Date?e:new Date(e)}function Cb(){return H.language?.startsWith(`es`)?Spe:ib}function wb(){return H.language?.startsWith(`es`)?`es-ES`:`en-US`}function Tb(e,t=`MMM d, yyyy`){return fb(Sb(e),t,{locale:Cb()})}function Cpe(e){return fb(Sb(e),`MMM d, yyyy h:mm a`,{locale:Cb()})}function Eb(e){return fb(Sb(e),`h:mm a`,{locale:Cb()})}function Db(e){return pb(Sb(e),{addSuffix:!0,locale:Cb()})}function wpe(e){return fb(Sb(e),`MMM yyyy`,{locale:Cb()})}function Tpe(e,t){return new Intl.NumberFormat(wb(),t).format(e)}function Ob(e,t=`USD`){return new Intl.NumberFormat(wb(),{style:`currency`,currency:t}).format(e)}function kb(e){if(e==null||!Number.isFinite(e)||e<=0)return``;let t=1024,n=t*1024;return e<t?`${e} B`:e<n?`${Math.round(e/t)} KB`:`${(e/n).toFixed(1)} MB`}function Ab(e,t=60){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t-1).trimEnd()}â¦`}function jb(){return V(),{formatDate:Tb,formatDateTime:Cpe,formatTime:Eb,formatRelative:Db,formatMonthYear:wpe,formatNumber:Tpe,formatCurrency:Ob}}function Epe(e,t,n){let r=Sb(t).getTime()-Sb(e).getTime();if(!Number.isFinite(r)||r<0)return null;let i=r/6e4;return i<1?{kind:`moments`}:i<60?{kind:`minutes`,count:Math.round(i)}:i<1440?{kind:`hours`,hours:Math.floor(i/60),minutes:Math.round(i%60)}:n!=null&&n>0?{kind:`business_days`,count:n}:{kind:`days`,count:Math.floor(i/1440)}}var Mb=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({}
175,t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Dpe=(e=>e?Mb(e):Mb),Ope=e=>e;function kpe(e,t=Ope){let n=B.useSyncExternalStore(e.subscribe,B.useCallback(()=>t(e.getState()),[e,t]),B.useCallback(()=>t(e.getInitialState()),[e,t]));return B.useDebugValue(n),n}var Nb=e=>{let t=Dpe(e),n=e=>kpe(t,e);return Object.assign(n,t),n},Pb=(e=>e?Nb(e):Nb),Fb=class extends Error{constructor(e,t,n){super(e),this.name=`ApiError`,this.status=t,this.detail=n}};function Ib(e){if(!Array.isArray(e)||e.length===0)return null;let t=[];for(let n of e){if(!n||typeof n!=`object`)return null;let e=n;if(typeof e.msg!=`string`)return null;let r=Array.isArray(e.loc)?e.loc:[],i=r.length?String(r[r.length-1]):``;t.push(i?`${i}: ${e.msg}`:e.msg)}return t.length?t.join(`; `):null}function Lb(e){if(e instanceof Fb){if(e.status===401)return H.t(`errors.unauthorized`);if(e.status===429)return H.t(`errors.rate_limited`);if(e.status>=400&&e.status<500){if(e.detail&&typeof e.detail==`object`){let t=e.detail.message;if(typeof t==`string`&&t.trim())return t.trim()}return e.message?.trim()||null}return null}return null}function Rb(e,t,n){if(e===401)return H.t(`errors.unauthorized`);if(e===429)return H.t(`errors.rate_limited`);if(e>=400&&e<500){if(typeof t==`string`){let e=t.trim();if(e)return e}else if(t&&typeof t==`object`){let e=Ib(t);if(e)return e;let n=t;return typeof n.message==`string`&&n.message?n.message:typeof n.action==`string`&&n.action?`Action required: ${n.action}`:JSON.stringify(t)}}return n}function zb(e){return e instanceof TypeError&&/failed to fetch|networkerror|load failed/i.test(e.message)}
175function Bb(e){return e instanceof Fb&&e.status===412&&e.detail?.reason===`provider_unavailable`}function Ape(e){return e instanceof Fb&&e.detail?.reason===`rate_limited`}function jpe(e){return e instanceof Fb&&e.status===402&&e.detail?.error===`usage_limit_reached`}function Mpe(e){return e instanceof Fb&&e.status===404}function Vb(e,t){if(e instanceof Fb&&e.status===401||Bb(e)||jpe(e)||t.expectedNotFound&&Mpe(e))return;let{operation:n,metadata:r}=t;console.error(`[${n}]`,e,r??``);let i;zb(e)?i={level:`warning`,fingerprint:[`transport-fetch-failure`]}:Ape(e)?i={level:`warning`,fingerprint:[`provider-rate-limited`]}:t.fingerprint&&(i={level:`warning`,fingerprint:t.fingerprint}),da(e,{tags:{operation:n},extra:r,...i})}var Npe=/\b\w*(?:Error|Exception)\b\s*[:(]|Traceback|Error code:|\{'|<[^>\n]{0,60} at 0x|\b(?:asyncpg|psycopg|sqlalchemy|lxml|botocore|httpx)\b|^\s*(?:at |File ")/,Hb=new Set;function Ppe(e){return Npe.test(e)}function Ub(e,t){let n=e?.trim();return n?Ppe(n)?(Hb.has(n)||(Hb.add(n),console.error(`[${t.operation}] leaked technical error`,n),fa(n,{level:`error`,tags:{operation:t.operation},extra:t.metadata,fingerprint:[`leaked-technical-error`,t.operation]})),H.t(`errors.server_processing_failed`)):n:null}var Wb=()=>{};function Fpe(e){Wb=e}function Y(e,t,n){let r=Lb(e)??t;zb(e)?G.error(r):G.error(r,{duration:1e4,action:{label:H.t(`support.menu.contact`),onClick:()=>Wb()}}),Vb(e,n)}function X(e,t){Vb(e,t)}function Gb(e,t,n){return Vb(e,n),Lb(e)??t}function Kb(e,t){return Lb(e)??t}var qb=()=>null,Jb=()=>{};function Ipe(e,t){qb=e,Jb=t}function Yb(){return qb()}function Xb(){Jb()}var Lpe=``;function Rpe(e){Lpe=e}function Zb(){return Lpe}var Qb=0;function zpe(e=6e3){Qb=Math.max(Qb,Date.now()+e)}async function Z(e,t={}){let n=qb(),r=new Headers(t.headers);n&&r.set(`Authorization`,`Bearer ${n}`),t.body&&!(t.body instanceof FormData)&&!r.has(`Content-Type`)&&r.set(`Content-Type`,`application/json`);let i=await fetch(`${Zb()}${e}`,{...t,headers:r});if(i.status===401)throw Date.now()>=Qb&&Jb(),new Fb(`Unauthorized`,401);if(i.status===402){let e=(await i.json().catch(()=>({}))).detail;throw new Fb(typeof e==`object`&&e?e.message||`Usage limit reached`:typeof e==`string`?e:`Usage limit reached`,402,e)}if(!i.ok){let e=(await i.json().catch(()=>({}))).detail,t=Ib(e),n;if(typeof e==`string`)n=e;else if(t)n=t;else if(e&&typeof e==`object`){let t=e;n=typeof t.message==`string`&&t.message||typeof t.action==`string`&&`Action required: ${t.action}`||JSON.stringify(e)}else n=`Request failed: ${i.status}`;throw new Fb(n,i.status,e)}return{data:i.status===204?void 0:await i.json().catch(()=>void 0),status:i.status,headers:i.headers}}const Bpe=()=>`/api/v1/chat`,Vpe=async(e,t)=>Z(Bpe(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),Hpe=()=>`/api/v1/chat/limits`,Upe=async e=>Z(Hpe(),{...e,method:`GET`}),Wpe=()=>`/api/v1/chat/models`,Gpe=async e=>Z(Wpe(),{...e,method:`GET`}),Kpe=()=>`/api/v1/chat/oversized-paste`,qpe=async(e,t)=>Z(Kpe(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),Jpe=()=>`/api/v1/chat/oversized-paste/suggest-title`,Ype=async(e,t)=>Z(Jpe(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),Xpe=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/chat/conversations?${n}`:`/api/v1/chat/conversations`},$b=async(e,t)=>Z(Xpe(e),{...t,method:`GET`}),Zpe=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/chat/conversations/${e}?${r}`:`/api/v1/chat/conversations/${e}`},Qpe=async(e,t,n)=>Z(Zpe(e,t),{...n,method:`GET`}),$pe=e=>`/api/v1/chat/conversations/${e}`,eme=async(e,t)=>Z($pe(e),{...t,method:`DELETE`}),tme=e=>`/api/v1/chat/conversations/${e}`,nme=async(e,t,n)=>Z(tme(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),rme=(e,t)=>
175{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/chat/conversations/${e}/messages?${r}`:`/api/v1/chat/conversations/${e}/messages`},ime=async(e,t,n)=>Z(rme(e,t),{...n,method:`GET`}),ame=(e,t)=>`/api/v1/chat/conversations/${e}/documents/${t}`,ome=async(e,t,n)=>Z(ame(e,t),{...n,method:`DELETE`}),sme=e=>`/api/v1/chat/conversations/${e}/compact`,cme=async(e,t,n)=>Z(sme(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),lme=e=>`/api/v1/chat/conversations/${e}/recap`,ume=async(e,t)=>Z(lme(e),{...t,method:`POST`}),dme=()=>`/api/v1/prompts`,fme=async(e,t)=>Z(dme(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),pme=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/prompts?${n}`:`/api/v1/prompts`},mme=async(e,t)=>Z(pme(e),{...t,method:`GET`}),hme=e=>`/api/v1/prompts/${e}`,gme=async(e,t)=>Z(hme(e),{...t,method:`GET`}),_me=e=>`/api/v1/prompts/${e}`,vme=async(e,t,n)=>Z(_me(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),yme=e=>`/api/v1/prompts/${e}`,bme=async(e,t)=>Z(yme(e),{...t,method:`DELETE`}),xme=()=>`/api/v1/knowledge-bases`,Sme=async(e,t)=>Z(xme(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),Cme=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/knowledge-bases?${n}`:`/api/v1/knowledge-bases`},wme=async(e,t)=>Z(Cme(e),{...t,method:`GET`}),Tme=e=>`/api/v1/knowledge-bases/${e}`,Eme=async(e,t,n)=>Z(Tme(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),Dme=e=>`/api/v1/knowledge-bases/${e}`,Ome=async(e,t)=>Z(Dme(e),{...t,method:`DELETE`}),kme=e=>`/api/v1/knowledge-bases/${e}/documents`,Ame=async(e,t,n)=>Z(kme(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),jme=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/knowledge-bases/${e}/documents?${r}`:`/api/v1/knowledge-bases/${e}/documents`},Mme=async(e,t,n)=>Z(jme(e,t),{...n,method:`GET`}),Nme=(e,t)=>`/api/v1/knowledge-bases/${e}/documents/${t}`,Pme=async(e,t,n)=>Z(Nme(e,t),{...n,method:`DELETE`}),Fme=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/knowledge-bases/${e}/playbooks?${r}`:`/api/v1/knowledge-bases/${e}/playbooks`},Ime=async(e,t,n)=>Z(Fme(e,t),{...n,method:`GET`}),Lme=e=>`/api/v1/knowledge-bases/${e}/playbooks`,Rme=async(e,t,n)=>Z(Lme(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),zme=(e,t)=>`/api/v1/knowledge-bases/${e}/playbooks/${t}`,Bme=async(e,t,n)=>Z(zme(e,t),{...n,method:`DELETE`}),Vme=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/documents?${n}`:`/api/v1/documents`},Hme=async(e,t)=>Z(Vme(e),{...t,method:`GET`}),Ume=e=>`/api/v1/documents/${e}`,Wme=async(e,t,n)=>Z(Ume(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),Gme=e=>`/api/v1/documents/${e}`,Kme=async(e,t)=>Z(Gme(e),{...t,method:`DELETE`}),qme=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/documents/${e}/download?${r}`:`/api/v1/documents/${e}/download`},ex=async(e,t,n)=>Z(qme(e,t),{...n,method:`GET`}),Jme=()=>`/api/v1/org-profiles`,Yme=async(e,t)=>Z(Jme(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),Xme=e=>{let t=new URLSearchParams;Object.entries(e||{}
175).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/org-profiles?${n}`:`/api/v1/org-profiles`},Zme=async(e,t)=>Z(Xme(e),{...t,method:`GET`}),Qme=e=>`/api/v1/org-profiles/${e}`,$me=async(e,t)=>Z(Qme(e),{...t,method:`GET`}),ehe=e=>`/api/v1/org-profiles/${e}`,the=async(e,t,n)=>Z(ehe(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),nhe=e=>`/api/v1/org-profiles/${e}`,rhe=async(e,t)=>Z(nhe(e),{...t,method:`DELETE`});async function ihe(e,t=100){let n=[],r=1;for(;;){let i=await e(r,t);if(n.push(...i),i.length<t)break;if(r+=1,r>200){X(Error(`fetchAllPages hit 200-page cap`),{operation:`paginate_cap_hit`});break}}return n}var ahe=`nav-rail.collapsed`;function ohe(){try{return localStorage.getItem(ahe)===`true`}catch{return!1}}function she(e){try{localStorage.setItem(ahe,String(e))}catch{}}var che={free:0,pro:1,unlimited:2},lhe=`chat.thinking-level.`;function uhe(e){try{return localStorage.getItem(lhe+e)}catch{return null}}function dhe(e,t){try{localStorage.setItem(lhe+e,t)}catch{}}function fhe(e,t){let n=e?.thinking_levels;return!n||n.length===0?``:t&&n.includes(t)?t:e?.default_thinking_level??``}function phe(e){let t=e.filter(e=>e.allowed);if(t.length===0)return e[0]?.slug??``;let n=t[0];for(let e of t)(che[e.min_plan]??0)>(che[n.min_plan]??0)&&(n=e);return n.slug}const Q=Pb((e,t)=>({prompts:[],isLoadingPrompts:!1,fetchPrompts:async()=>{e({isLoadingPrompts:!0});try{let t=(await mme()).data;e({prompts:t.items,isLoadingPrompts:!1})}catch(t){X(t,{operation:`fetch_prompts`}),e({isLoadingPrompts:!1})}},createPrompt:async t=>{let n=(await fme(t)).data;return e(e=>({prompts:[...e.prompts,{id:n.id,name:n.name,description:n.description,is_system:n.is_system}]})),n},getPromptContent:async e=>(await gme(e)).data.content,deletePrompt:async t=>{await bme(t),e(e=>({prompts:e.prompts.filter(e=>e.id!==t)}))},updatePrompt:async(t,n)=>{let r=(await vme(t,n)).data;e(e=>({prompts:e.prompts.map(e=>e.id===t?{...e,name:r.name,description:r.description}:e)}))},knowledgeBases:[],isLoadingKnowledgeBases:!1,selectedKnowledgeBase:null,fetchKnowledgeBases:async()=>{e({isLoadingKnowledgeBases:!0});try{let t=(await wme()).data;e({knowledgeBases:t.items,isLoadingKnowledgeBases:!1})}catch(t){X(t,{operation:`fetch_knowledge_bases`}),e({isLoadingKnowledgeBases:!1})}},createKnowledgeBase:async t=>{let n=(await Sme(t)).data;e(e=>({knowledgeBases:[...e.knowledgeBases,{id:n.id,name:n.name,description:n.description,document_count:n.document_count,playbook_count:n.playbook_count}]}))},updateKnowledgeBase:async(t,n)=>{let r=(await Eme(t,n)).data;e(e=>({knowledgeBases:e.knowledgeBases.map(e=>e.id===t?{...e,name:r.name,description:r.description}:e),selectedKnowledgeBase:e.selectedKnowledgeBase?.id===t?{...e.selectedKnowledgeBase,name:r.name,description:r.description}:e.selectedKnowledgeBase}))},deleteKnowledgeBase:async t=>{await Ome(t),e(e=>{let n=new Set(e.expandedKBs);n.delete(t);let{[t]:r,...i}=e.kbDocuments,{[t]:a,...o}=e.kbDocumentsLoading,{[t]:s,...c}=e.kbPlaybooks,{[t]:l,...u}=e.kbPlaybooksLoading;return{knowledgeBases:e.knowledgeBases.filter(e=>e.id!==t),selectedKnowledgeBase:e.selectedKnowledgeBase?.id===t?null:e.selectedKnowledgeBase,expandedKBs:n,kbDocuments:i,kbDocumentsLoading:o,kbPlaybooks:c,kbPlaybooksLoading:u}})},setSelectedKnowledgeBase:t=>e({selectedKnowledgeBase:t}),personas:[],isLoadingPersonas:!1,personasLoaded:!1,fetchPersonas:async()=>{e({isLoadingPersonas:!0});try{let t=(await Zme()).data;e({personas:t.items,isLoadingPersonas:!1,personasLoaded:!0})}catch(t){X(t,{operation:`fetch_personas`}),e({isLoadingPersonas:!1})}},createPersona:async t=>{let n=(await Yme(t)).data,r={id:n.id,name:n.name,description:n.description,is_default:n.is_default,user_id:n.user_id,org_id:n.org_id,updated_at:n.updated_at};return e(e=>({personas:[...e.personas.map(e=>n.is_default?{...e,is_default:!1}:e),r]})),n},updatePersona:async(t,n)=>{let r=(await the(t,n)).data;e(e=>({personas:e.personas.map(e=>e.id===t?{...e,name:r.name,description:r.description,is_default:r.is_default,updated_at:r.updated_at}:r.is_default?{...e,is_default:!1}:e)}))},deletePersona:async t=>{await rhe(t),e(e=>({personas:e.personas.filter(e=>e.id!==t)}))},setDefaultPersona:async(e,n)=>{await t().updatePersona(e,{is_default:n})},chatSessions:[],activeChatId:null,setActiveChat:t=>e({activeChatId:t}),setChatMode:t=>e(e=>({chatMode:e.chatMode===t?`chat`:t})),everythingSearchOpen:!1,setEverythingSearchOpen:t=>e({everythingSearchOpen:t}),toggleEverythingSearch:()=>e(e=>({everythingSearchOpen:!e.everythingSearchOpen})),masterQueueOpen:!1,setMasterQueueOpen:t=>e({masterQueueOpen:t}),toggleMasterQueue:()=>e(e=>({masterQueueOpen:!e.masterQueueOpen})),navRailCollapsed:ohe(),setNavRailCollapsed:t=>{she(t),e({navRailCollapsed:t})},toggleNavRail:()=>e(e=>{let t=!e.navRailCollapsed;return she(t),{navRailCollapsed:t}}),modelTier:`mid`,toggleModelTier:()=>e(e=>({modelTier:e.modelTier===`mid`?`quality`:`mid`})),setModelTier:t=>e({modelTier:t}),chatModels:[],selectedChatModel:``,fetchChatModels:async()=>{try{let t=(await Gpe()).data.models;e(e=>{let n=t.some(t=>t.slug===e.selectedChatModel&&t.allowed)?e.selectedChatModel:phe(t);return{chatModels:t,selectedChatModel:n,selectedThinkingLevel:fhe(t.find(e=>e.slug===n),e.selectedThinkingLevel||uhe(n))}})}catch(e){X(e,{operation:`fetch_chat_models`})}},setSelectedChatModel:t=>e(e=>({selectedChatModel:t,selectedThinkingLevel:fhe(e.chatModels.find(e=>e.slug===t),uhe(t))})),selectedThinkingLevel:``,setSelectedThinkingLevel:n=>{let r=t().selectedChatModel;r&&dhe(r,n),e({selectedThinkingLevel:n})},showDocViewer:!1,setShowDocViewer:t=>e({showDocViewer:t}),docViewerFromSearch:!1,setDocViewerFromSearch:t=>e({docViewerFromSearch:t}),itemDetail:null,openItemDetail:t=>e({itemDetail:t}),closeItemDetail:()=>e({itemDetail:null}),documentLink:null,setDocumentLink:t=>e({documentLink:t}),docViewerId:null,docViewerLabel:null,setDocViewerTarget:(t,n)=>e({docViewerId:t,docViewerLabel:n??null}),expandedKBs:new Set,kbDocuments:{},kbDocumentsLoading:{},kbPlaybooks:{},kbPlaybooksLoading:{},dragSource:null,dragOverKbId:null,toggleExpandKB:n=>{let{expandedKBs:r,fetchKBDocuments:i,fetchKBPlaybooks:a}=t(),o=new Set(r);o.has(n)?o.delete(n):(o.add(n),i(n),a(n)),e({expandedKBs:o})},fetchKBDocuments:async t=>{e(e=>({kbDocumentsLoading:{...e.kbDocumentsLoading,[t]:!0}}));try{let n=await ihe((e,n)=>Mme(t,{page:e,per_page:n}).then(e=>e.data.items));e(e=>({kbDocuments:{...e.kbDocuments,[t]:n},kbDocumentsLoading:{...e.kbDocumentsLoading,[t]:!1}}))}catch(n){X(n,{operation:`kb_fetch_documents`,metadata:{kbId:t}}),e(e=>({kbDocumentsLoading:{...e.kbDocumentsLoading,[t]:!1}}))}},addDocumentToKB:async(e,n)=>{try{await Ame(e,{document_id:n}),t().fetchKBDocuments(e),t().fetchKnowledgeBases()}catch(t){throw Y(t,H.t(`toasts.kb.documents_add_failed`),{operation:`kb_add_document`,metadata:{kbId:e,documentId:n}}),t}},addDocumentsToKBBatch:async(e,n)=>{try{await Z(`/api/v1/knowledge-bases/${e}/documents/batch`,{method:`POST`,body:JSON.stringify({document_ids:n})}),t().fetchKBDocuments(e),t().fetchKnowledgeBases()}catch(t){throw Y(t,H.t(`toasts.kb.documents_add_failed`),{operation:`kb_add_documents_batch`,metadata:{kbId:e,count:n.length}}),t}},removeDocumentFromKB:async(n,r)=>{e(e=>({kbDocuments:{...e.kbDocuments,[n]:(e.kbDocuments[n]||[]).filter(e=>e.id!==r)}}));try{await Pme(n,r),t().fetchKnowledgeBases()}catch(e){Y(e,H.t(`toasts.kb.documents_remove_failed`),{operation:`kb_remove_document`,metadata:{kbId:n,documentId:r}}),t().fetchKBDocuments(n),t().fetchKnowledgeBases()}},moveDocumentBetweenKBs:async(e,n,r)=>{try{await Ame(n,{document_id:r}),await Pme(e,r),t().fetchKBDocuments(e),t().fetchKBDocuments(n),t().fetchKnowledgeBases()}catch(i){Y(i,H.t(`errors.save_failed`),{operation:`kb_move_document`,metadata:{sourceKbId:e,targetKbId:n,documentId:r}}),t().fetchKBDocuments(e),t().fetchKBDocuments(n)}},viewDocumentInKB:(t,n)=>{e({documentLink:null,showDocViewer:!0,docViewerId:t,docViewerLabel:n??null}),ex(t).then(t=>{let r=t.data;e({documentLink:r.download_url.replace(`http://minio:9000`,`/minio-proxy`)}),!n&&r.filename&&e({docViewerLabel:r.filename})}).catch(n=>{Y(n,H.t(`errors.preview_failed`),{operation:`view_document`,metadata:{documentId:t}}),e({showDocViewer:!1,docViewerId:null,docViewerFromSearch:!1})})},setDragSource:n=>{t().dragSource!==n&&e({dragSource:n})},setDragOverKbId:n=>{t().dragOverKbId!==n&&e({dragOverKbId:n})},removeDocumentFromAllKBs:t=>{e(e=>{let n={},r=new Set;for(let[i,a]of Object.entries(e.kbDocuments)){let e=a.filter(e=>e.id!==t);e.length!==a.length&&r.add(i),n[i]=e}return{kbDocuments:n,knowledgeBases:e.knowledgeBases.map(e=>r.has(e.id)?{...e,document_count:Math.max(0,(e.document_count??1)-1)}:e)}})},fetchKBPlaybooks:async t=>{e(e=>({kbPlaybooksLoading:{...e.kbPlaybooksLoading,[t]:!0}}));try{let n=(await Ime(t)).data;e(e=>({kbPlaybooks:{...e.kbPlaybooks,[t]:n},kbPlaybooksLoading:{...e.kbPlaybooksLoading,[t]:!1}}))}catch(n){X(n,{operation:`kb_fetch_playbooks`,metadata:{kbId:t}}),e(e=>({kbPlaybooksLoading:{...e.kbPlaybooksLoading,[t]:!1}}))}},addPlaybookToKB:async(n,r)=>
175{try{await Rme(n,{playbook_id:r}),t().fetchKBPlaybooks(n),e(e=>({knowledgeBases:e.knowledgeBases.map(e=>e.id===n?{...e,playbook_count:(e.playbook_count??0)+1}:e)}))}catch(e){throw Y(e,H.t(`errors.save_failed`),{operation:`kb_add_playbook`,metadata:{kbId:n,playbookId:r}}),e}},removePlaybookFromKB:async(n,r)=>{e(e=>({kbPlaybooks:{...e.kbPlaybooks,[n]:(e.kbPlaybooks[n]||[]).filter(e=>e.id!==r)},knowledgeBases:e.knowledgeBases.map(e=>e.id===n?{...e,playbook_count:Math.max(0,(e.playbook_count??1)-1)}:e)}));try{await Bme(n,r)}catch(e){Y(e,H.t(`errors.could_not_delete`),{operation:`kb_remove_playbook`,metadata:{kbId:n,playbookId:r}}),t().fetchKBPlaybooks(n),t().fetchKnowledgeBases()}},movePlaybookBetweenKBs:async(e,n,r)=>{try{await Rme(n,{playbook_id:r}),await Bme(e,r),t().fetchKBPlaybooks(e),t().fetchKBPlaybooks(n),t().fetchKnowledgeBases()}catch(i){Y(i,H.t(`errors.save_failed`),{operation:`kb_move_playbook`,metadata:{sourceKbId:e,targetKbId:n,playbookId:r}}),t().fetchKBPlaybooks(e),t().fetchKBPlaybooks(n)}},removePlaybookFromAllKBs:t=>{e(e=>{let n={};for(let[r,i]of Object.entries(e.kbPlaybooks))n[r]=i.filter(e=>e.id!==t);return{kbPlaybooks:n}})},refreshPlaybookInKBs:(e,n)=>{let r=Object.entries(t().kbPlaybooks).filter(([,t])=>t.some(t=>t.id===e)).map(([e])=>e);if(r.length===0&&e!==n){for(let e of t().expandedKBs)t().fetchKBPlaybooks(e);return}for(let e of r)t().fetchKBPlaybooks(e)},selectedDocumentIds:new Set,lastSelectedDocumentId:null,toggleDocumentSelection:(t,n)=>{e(e=>{let r=new Set(e.selectedDocumentIds),i=n?.orderedSiblingIds,a=e.lastSelectedDocumentId;if(n?.shiftKey&&a!=null&&i!=null&&i.includes(t)&&i.includes(a)){let e=i.indexOf(a),n=i.indexOf(t),[o,s]=e<n?[e,n]:[n,e];for(let e=o;e<=s;e++)r.add(i[e]);return{selectedDocumentIds:r,lastSelectedDocumentId:t}}return r.has(t)?r.delete(t):r.add(t),{selectedDocumentIds:r,lastSelectedDocumentId:t}})},selectAllInGroup:t=>{e(e=>{let n=new Set(e.selectedDocumentIds);if(t.length>0&&t.every(e=>n.has(e)))for(let e of t)n.delete(e);else for(let e of t)n.add(e);return{selectedDocumentIds:n}})},clearDocumentSelection:()=>e({selectedDocumentIds:new Set,lastSelectedDocumentId:null}),chatMode:`chat`,vaultVisibility:`all`,setVaultVisibility:t=>e({vaultVisibility:t})})),tx=[`gmail`,`outlook`,`imap`,`slack`];async function mhe(e,t={}){let n=new URLSearchParams({provider:e});return t.maxResults&&n.set(`max_results`,String(t.maxResults)),t.pageToken&&n.set(`page_token`,t.pageToken),t.query&&n.set(`query`,t.query),(await Z(`/api/v1/inbox/messages?${n.toString()}`,{method:`GET`})).data}async function hhe(e,t){return(await Z(`/api/v1/inbox/messages/${encodeURIComponent(e)}?provider=${t}`,{method:`GET`})).data}async function ghe(e,t,n,r=15){let i=new URLSearchParams({channel_id:e,around_ts:t,limit:String(r)});return n&&i.set(`thread_ts`,n),(await Z(`/api/v1/inbox/slack/conversation?${i.toString()}`,{method:`GET`})).data}async function _he(e,t){return(await Z(`/api/v1/inbox/reply?provider=${t}`,{method:`POST`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}})).data}async function nx(){return(await Z(`/api/v1/inbox/unread-counts`,{method:`GET`})).data}async function vhe(e,t){return(await Z(`/api/v1/inbox/messages/${encodeURIComponent(e)}/archive?provider=${t}`,{method:`POST`})).data}async function rx(e,t){return(await Z(`/api/v1/inbox/messages/${encodeURIComponent(e)}/unarchive?provider=${t}`,{method:`POST`})).data}async function yhe(e,t){return(await Z(`/api/v1/inbox/messages/${encodeURIComponent(e)}/trash?provider=${t}`,{method:`POST`})).data}async function bhe(e,t){return(await Z(`/api/v1/inbox/messages/${encodeURIComponent(e)}/untrash?provider=${t}`,{method:`POST`})).data}async function xhe(e,t){return(await Z(`/api/v1/inbox/save-draft?provider=${t}`,{method:`POST`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}})).data}async function She(e,t,n=10){let r=e.trim();return r.length<2?[]:(await Z(`/api/v1/inbox/contacts/suggest?${new URLSearchParams({provider:t,q:r,limit:String(n)}).toString()}`,{method:`GET`})).data.suggestions}async function Che(e,t,n,r){let i=new URLSearchParams({provider:n,filename:r});return(await Z(`/api/v1/inbox/messages/${encodeURIComponent(e)}/attachments/${encodeURIComponent(t)}/save-to-kb?${i.toString()}`,{method:`POST`})).data}async function whe(e,t,n={}){let r=new URLSearchParams({provider:e,folder:t});return n.maxResults&&r.set(`max_results`,String(n.maxResults)),n.pageToken&&r.set(`page_token`,n.pageToken),n.page&&r.set(`page`,String(n.page)),n.query&&r.set(`query`,n.query
175),n.labelId&&r.set(`label_id`,n.labelId),n.folderId&&r.set(`folder_id`,n.folderId),(await Z(`/api/v1/inbox/messages?${r.toString()}`,{method:`GET`})).data}async function The(e,t){return(await Z(`/api/v1/inbox/threads/${encodeURIComponent(e)}?provider=${t}`,{method:`GET`})).data}async function Ehe(e,t){return(await Z(`/api/v1/inbox/threads/${encodeURIComponent(e)}/snapshot-document?provider=${t}`,{method:`POST`})).data}async function Dhe(e=`gmail`,t={}){let n=new URLSearchParams({provider:e});return t.userOnly&&n.set(`user_only`,`true`),t.accountId&&n.set(`account_id`,t.accountId),(await Z(`/api/v1/inbox/labels?${n.toString()}`,{method:`GET`})).data}async function Ohe(e,t={}){let n=new URLSearchParams;return t.accountId&&n.set(`account_id`,t.accountId),(await Z(`/api/v1/${e}/folder-suggestions${n.toString()?`?${n.toString()}`:``}`,{method:`GET`})).data}async function ix(e,t,n){return(await Z(`${e}?account_id=${encodeURIComponent(n)}`,{method:`PATCH`,body:JSON.stringify(t),headers:{"Content-Type":`application/json`}})).data}const khe=(e,t)=>ix(`/api/v1/outlook/synced-folders`,{folder_ids:t},e),Ahe=(e,t)=>ix(`/api/v1/gmail/synced-labels`,{label_ids:t},e),jhe=(e,t)=>ix(`/api/v1/imap/synced-folders`,{folders:t},e);async function Mhe(e=`gmail`){return(await Z(`/api/v1/inbox/folder-counts?provider=${e}`,{method:`GET`})).data}async function Nhe(e=`outlook`,t={}){let n=new URLSearchParams({provider:e});return t.accountId&&n.set(`account_id`,t.accountId),(await Z(`/api/v1/inbox/folders?${n.toString()}`,{method:`GET`})).data}async function ax(e,t){return(await Z(`/api/v1/inbox/${e}?provider=${t}`,{method:`POST`})).data}const Phe=(e,t)=>ax(`messages/${encodeURIComponent(e)}/read`,t),Fhe=(e,t)=>ax(`messages/${encodeURIComponent(e)}/unread`,t),Ihe=(e,t)=>ax(`messages/${encodeURIComponent(e)}/star`,t),Lhe=(e,t)=>ax(`messages/${encodeURIComponent(e)}/unstar`,t);async function Rhe(e,t,n){return(await Z(`/api/v1/inbox/messages/${encodeURIComponent(e)}/labels?provider=${t}`,{method:`POST`,body:JSON.stringify(n),headers:{"Content-Type":`application/json`}})).data}async function zhe(e,t){return(await Z(`/api/v1/inbox/compose?provider=${t}`,{method:`POST`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}})).data}function Bhe(e,t,n,r){let i=new URLSearchParams({provider:n});return r&&i.set(`filename`,r),`/api/v1/inbox/messages/${encodeURIComponent(e)}/attachments/${encodeURIComponent(t)}?${i.toString()}`}var Vhe=class extends Error{constructor(e){super(e.message),this.name=`PlaybookUploadErrorException`,this.uploadError=e}},ox=18e4;async function Hhe(e,t,n){let r=Yb(),i={"Content-Type":`application/json`};r&&(i.Authorization=`Bearer ${r}`);let a=await fetch(`${Zb()}/api/v1/chat/stream`,{method:`POST`,headers:i,body:JSON.stringify(e),signal:n});if(a.status===401){Xb(),t.onError(`Unauthorized`);return}if(a.status===402){let e=(await a.json().catch(()=>({}))).detail,n=typeof e==`object`&&e?e.message||`Usage limit reached`:typeof e==`string`?e:`Usage limit reached`;G.error(n),t.onError(`usage_limit:${n}`);return}if(!a.ok){let e=(await a.json().catch(()=>({}))).detail;X(new Fb(typeof e==`string`?e:`Request failed: ${a.status}`,a.status,e),{operation:`send_message_stream`}),t.onError(Rb(a.status,e,H.t(`errors.send_message_failed`)));return}if(!a.body){t.onError(`No response body`);return}let o=a.body.getReader(),s=new TextDecoder,c=``,l=``,u=``,d=!1,f=!1,p,m=()=>{clearTimeout(p),p=setTimeout(()=>{f=!0,o.cancel().catch(()=>{})},ox)};try{for(m();;){let{done:e,value:n}=await o.read();if(m(),e)break;c+=s.decode(n,{stream:!0});let r=c.split(` 176`);c=r.pop()||``;for(let e of r)if(e.startsWith(`event: `))l=e.slice(7).trim();else if(e.startsWith(`data: `))u=e.slice(6);else if(e===``&&l&&u){try{let e=JSON.parse(u);switch(l){case`start`:t.onStart(e);break;case`delta`:t.onDelta(e.text);break;case`stream_restart`:t.onStreamRestart?.();break;case`done`:d=!0,t.onDone(e);break;case`web_citations`:t.onWebCitations?.(e);break;case`tool_use`:t.onToolUse?.(e);break;case`tool_call`:t.onToolCall?.(e);break;case`tool_result`:t.onToolResult?.(e);break;case`title`:t.onTitle?.(e);break;case`error`:d=!0,t.onError(e.error||`Unknown error`);break}}catch(e){console.error(`Failed to parse SSE event:`,e,u)}l=``,u=``}}if(!d){let e=f?`idle-timeout`:`connection-closed`;t.onInterrupted?t.onInterrupted(e):t.onError(H.t(`errors.stream_interrupted`))}}catch(e){if(e.name===`AbortError`)return;t.onError(e.message||`Stream error`)}finally{clearTimeout(p)}}async function Uhe(e,t,n){let r=Yb(),i={"Content-Type":`application/json`};r&&(i.Authorization=`Bearer ${r}`);let a=await fetch(`${Zb()}/api/v1/search/chat/stream`,{method:`POST`,headers:i,body:JSON.stringify(e),signal:n});if(a.status===401){Xb(),t.onError(`Unauthorized`);return}if(a.status===402){let e=(await a.json().catch(()=>({}))).detail,n=typeof e==`object`&&e?e.message||`Usage limit reached`:typeof e==`string`?e:`Usage limit reached`;G.error(n),t.onError(`usage_limit:${n}`);return}if(!a.ok){let e=(await a.json().catch(()=>({}))).detail;X(new Fb(typeof e==`string`?e:`Request failed: ${a.status}`,a.status,e),{operation:`search_chat_stream`}),t.onError(Rb(a.status,e,H.t(`errors.send_message_failed`)));return}if(!a.body){t.onError(`No response body`);return}let o=a.body.getReader(),s=new TextDecoder,c=``,l=``,u=``,d=!1,f=!1,p,m=()=>{clearTimeout(p),p=setTimeout(()=>{f=!0,o.cancel().catch(()=>{})},ox)};try{for(m();;){let{done:e,value:n}=await o.read();if(m(),e)break;c+=s.decode(n,{stream:!0});let r=c.split(` 177`);c=r.pop()||``;for(let e of r)if(e.startsWith(`event: `))l=e.slice(7).trim();else if(e.startsWith(`data: `))u=e.slice(6);else if(e===``&&l&&u){try{let e=JSON.parse(u);switch(l){case`start`:t.onStart(e);break;case`delta`:t.onDelta(e.text);break;case`stream_restart`:t.onStreamRestart?.();break;case`done`:d=!0,t.onDone(e);break;case`tool_call`:t.onToolCall?.(e);break;case`tool_result`:t.onToolResult?.(e);break;case`title`:t.onTitle?.(e);break;case`error`:d=!0,t.onError(e.error||`Unknown error`);break}}catch(e){console.error(`Failed to parse SSE event:`,e,u)}l=``,u=``}}if(!d){let e=f?`idle-timeout`:`connection-closed`;t.onInterrupted?t.onInterrupted(e):t.onError(H.t(`errors.stream_interrupted`))}}catch(e){if(e.name===`AbortError`)return;t.onError(e.message||`Stream error`)}finally{clearTimeout(p)}}async function Whe(e){let t=Yb(),n={"Content-Type":`application/json`};t&&(n.Authorization=`Bearer ${t}`);let r=await fetch(`${Zb()}/api/v1/chat/conversations/${e}/reveal`,{method:`POST`,headers:n});if(r.status===401)throw Xb(),new Fb(`Unauthorized`,401);if(!r.ok){let e=(await r.json().catch(()=>({}))).detail;throw new Fb(typeof e==`string`?e:`Request failed: ${r.status}`,r.status,e)}}async function Ghe(e,t,n){let r=Yb(),i={"Content-Type":`application/json`};r&&(i.Authorization=`Bearer ${r}`);let a=await fetch(`${Zb()}/api/v1/chat/benchmarks/stream`,{method:`POST`,headers:i,body:JSON.stringify(e),signal:n});if(a.status===401){Xb(),t.onError(`Unauthorized`);return}if(a.status===402){let e=(await a.json().catch(()=>({}))).detail,n=typeof e==`object`&&e?e.message||`Usage limit reached`:typeof e==`string`?e:`Usage limit reached`;G.error(n),t.onError(`usage_limit:${n}`);return}if(!a.ok){let e=(await a.json().catch(()=>({}))).detail;X(new Fb(typeof e==`string`?e:`Request failed: ${a.status}`,a.status,e),{operation:`send_benchmark_stream`}),t.onError(Rb(a.status,e,H.t(`errors.send_message_failed`)));return}if(!a.body){t.onError(`No response body`);return}let o=a.body.getReader(),s=new TextDecoder,c=``,l=``,u=``,d=!1,f=!1,p,m=()=>{clearTimeout(p),p=setTimeout(()=>{f=!0,o.cancel().catch(()=>{})},ox)};try{for(m();;){let{done:e,value:n}=await o.read();if(m(),e)break;c+=s.decode(n,{stream:!0});let r=c.split(` 178`);c=r.pop()||``;for(let e of r)if(e.startsWith(`event: `))l=e.slice(7).trim();else if(e.startsWith(`data: `))u=e.slice(6);else if(e===``&&l&&u){try{let e=JSON.parse(u);switch(l){case`start`:t.onStart(e);break;case`side_start`:t.onSideStart(e);break;case`delta`:t.onDelta(e);break;case`stream_restart`:t.onStreamRestart?.(e);break;case`tool_call`:t.onToolCall?.(e);break;case`tool_result`:t.onToolResult?.(e);break;case`side_done`:t.onSideDone(e);break;case`side_error`:t.onSideError(e);break;case`done`:d=!0,t.onDone(e);break;case`error`:d=!0,t.onError(e.error||`Unknown error`);break}}catch(e){console.error(`Failed to parse benchmark SSE event:`,e,u)}l=``,u=``}}if(!d){let e=f?`idle-timeout`:`connection-closed`;t.onInterrupted?t.onInterrupted(e):t.onError(H.t(`errors.stream_interrupted`))}}catch(e){if(e.name===`AbortError`)return;t.onError(e.message||`Stream error`)}finally{clearTimeout(p)}}async function Khe(e,t,n,r,i=`google`){let a=Yb(),o={"Content-Type":`application/json`};a&&(o.Authorization=`Bearer ${a}`);let s=await fetch(`${Zb()}/api/v1/calendar/chat`,{method:`POST`,headers:o,body:JSON.stringify({messages:e,timezone:t,provider:i}),signal:r});if(s.status===401){Xb(),n.onError(`Unauthorized`);return}if(!s.ok){let e=(await s.json().catch(()=>({}))).detail;X(new Fb(typeof e==`string`?e:`Request failed: ${s.status}`,s.status,e),{operation:`send_calendar_chat_stream`}),n.onError(Rb(s.status,e,H.t(`errors.send_message_failed`)));return}if(!s.body){n.onError(`No response body`);return}let c=s.body.getReader(),l=new TextDecoder,u=``,d=``,f=``;try{for(;;){let{done:e,value:t}=await c.read();if(e)break;u+=l.decode(t,{stream:!0});let r=u.split(` 179`);u=r.pop()||``;for(let e of r)if(e.startsWith(`event: `))d=e.slice(7).trim();else if(e.startsWith(`data: `))f=e.slice(6);else if(e===``&&d&&f){try{let e=JSON.parse(f);switch(d){case`delta`:n.onDelta(e.text);break;case`tool_use`:{let t=e;
179n.onToolUse(t.name,t.input);break}case`done`:n.onDone();break;case`error`:n.onError(e.error||`Unknown error`);break}}catch(e){console.error(`Failed to parse calendar SSE event:`,e,f)}d=``,f=``}}}catch(e){if(e.name===`AbortError`)return;n.onError(e.message||`Stream error`)}}async function qhe(e,t,n,r){let i=Yb(),a={"Content-Type":`application/json`};i&&(a.Authorization=`Bearer ${i}`);let o=await fetch(`${Zb()}/api/v1/booking-links/chat`,{method:`POST`,headers:a,body:JSON.stringify({messages:e,timezone:t}),signal:r});if(o.status===401){Xb(),n.onError(`Unauthorized`);return}if(!o.ok){let e=(await o.json().catch(()=>({}))).detail;X(new Fb(typeof e==`string`?e:`Request failed: ${o.status}`,o.status,e),{operation:`send_booking_link_chat_stream`}),n.onError(Rb(o.status,e,H.t(`errors.send_message_failed`)));return}if(!o.body){n.onError(`No response body`);return}let s=o.body.getReader(),c=new TextDecoder,l=``,u=``,d=``;try{for(;;){let{done:e,value:t}=await s.read();if(e)break;l+=c.decode(t,{stream:!0});let r=l.split(` 180`);l=r.pop()||``;for(let e of r)if(e.startsWith(`event: `))u=e.slice(7).trim();else if(e.startsWith(`data: `))d=e.slice(6);else if(e===``&&u&&d){try{let e=JSON.parse(d);switch(u){case`delta`:n.onDelta(e.text);break;case`tool_use`:{let t=e;n.onToolUse(t.name,t.input);break}case`done`:n.onDone();break;case`error`:n.onError(e.error||`Unknown error`);break}}catch(e){console.error(`Failed to parse booking-link SSE event:`,e,d)}u=``,d=``}}}catch(e){if(e.name===`AbortError`)return;n.onError(e.message||`Stream error`)}}async function Jhe(e,t,n,r,i){let a=Yb(),o={"Content-Type":`application/json`};a&&(o.Authorization=`Bearer ${a}`);let s=await fetch(e,{method:`POST`,headers:o,body:JSON.stringify(t),signal:i});if(s.status===401){Xb(),n.onError(`Unauthorized`);return}if(!s.ok){let e=(await s.json().catch(()=>({}))).detail;X(new Fb(typeof e==`string`?e:`Request failed: ${s.status}`,s.status,e),{operation:r}),n.onError(Rb(s.status,e,H.t(`errors.fetch_failed`)));return}if(!s.body){n.onError(`No response body`);return}let c=s.body.getReader(),l=new TextDecoder,u=``,d=``,f=``;try{for(;;){let{done:e,value:t}=await c.read();if(e)break;u+=l.decode(t,{stream:!0});let r=u.split(` 181`);u=r.pop()||``;for(let e of r)if(e.startsWith(`event: `))d=e.slice(7).trim();else if(e.startsWith(`data: `))f=e.slice(6);else if(e===``&&d&&f){try{let e=JSON.parse(f);switch(d){case`start`:n.onStart(e);break;case`result`:n.onResult(e);break;case`done`:n.onDone(e);break;case`error`:n.onError(e.error||`Unknown error`);break}}catch(e){console.error(`Failed to parse everything-search SSE event:`,e,f)}d=``,f=``}}}catch(e){if(e.name===`AbortError`)return;n.onError(e.message||`Stream error`)}}async function Yhe(e,t,n){return Jhe(`${Zb()}/api/v1/search/everything/stream`,e,t,`everything_search_stream`,n)}async function Xhe(e,t,n,r){return Jhe(`${Zb()}/api/v1/matters/${e}/search/stream`,t,n,`matter_search_stream`,r)}function Zhe(e,t,n=3,r){let i=e.map(e=>({file:e,status:`pending`,progress:0})),a=!1,o=new Set;return{promise:new Promise(e=>{let s=0,c=0,l=()=>{if(a||s>=i.length)return;let n=s++;i[n].status=`uploading`,t(n,{...i[n]});let u=new XMLHttpRequest;o.add(u);let d=new FormData;d.append(`file`,i[n].file),r&&d.append(`ingest_mode`,r),u.upload.addEventListener(`progress`,e=>{e.lengthComputable&&(i[n].progress=Math.round(e.loaded/e.total*100),t(n,{...i[n]}))}),u.addEventListener(`load`,()=>{if(o.delete(u),u.status>=200&&u.status<300)try{i[n].result=JSON.parse(u.responseText),i[n].status=`completed`,i[n].progress=100}catch{i[n].status=`failed`,i[n].error=`Invalid response`}else if(u.status===401)Xb(),i[n].status=`failed`,i[n].error=`Unauthorized`;else{i[n].status=`failed`;let e;try{let t=JSON.parse(u.responseText);typeof t?.detail==`string`&&(e=t.detail)}catch{}i[n].error=e||`Upload failed: ${u.status}`}t(n,{...i[n]}),c++,c===i.length?e(i):l()}),u.addEventListener(`error`,()=>{o.delete(u),i[n].status=`failed`,i[n].error=`Network error`,t(n,{...i[n]}),c++,c===i.length?e(i):l()}),u.addEventListener(`abort`,()=>{o.delete(u),i[n].status=`failed`,i[n].error=`Upload cancelled`,t(n,{...i[n]}),c++,c===i.length&&e(i)}),u.open(`POST`,`${Zb()}/api/v1/documents/upload`);let f=Yb();f&&u.setRequestHeader(`Authorization`,`Bearer ${f}`),u.send(d)};if(i.length===0){e(i);return}for(let e=0;e<Math.min(n,i.length);e++)l()}),cancel:()=>{a=!0;for(let e of o)e.abort();o.clear()}}}async function Qhe(e,t,n){let r=new FormData;r.append(`file`,e),r.append(`name`,t),n&&r.append(`contract_type`,n);let i=Yb(),a={};i&&(a.Authorization=`Bearer ${i}`);let o=await fetch(`${Zb()}/api/v1/playbooks/upload`,{method:`POST`,headers:a,body:r});if(o.status===401)throw Xb(),new Fb(`Unauthorized`,401);if(!o.ok){let e=(await o.json().catch(()=>({}))).detail;if(e&&typeof e==`object`&&!Array.isArray(e)&&Array.isArray(e.issues)){let t=e;throw new Vhe({message:t.message||`Upload failed: ${o.status}`,issues:t.issues})}throw new Fb(typeof e==`string`?e:`Upload failed: ${o.status}`,o.status,e)}return o.json()}async function $he(e,t,n){let r=new FormData;r.append(`file`,e),t&&r.append(`name`,t),n&&r.append(`contract_type`,n);let i=Yb(),a={};i&&(a.Authorization=`Bearer ${i}`);let o=await fetch(`${Zb()}/api/v1/playbooks/upload-document`,{method:`POST`,headers:a,body:r});if(o.status===401)throw Xb(),new Fb(`Unauthorized`,401);if(!o.ok){let e=(await o.json().catch(()=>({}))).detail;throw new Fb(typeof e==`string`?e:`Upload failed: ${o.status}`,o.status,e)}return o.json()}async function ege(e=50){let t=Yb(),n={};t&&(n.Authorization=`Bearer ${t}`);let r;try{r=await fetch(`${Zb()}/api/v1/notifications/?limit=${e}`,{headers:n,signal:AbortSignal.timeout(15e3)})}catch{return[]}return r.status===401?(Xb(),[]):r.ok?r.json():[]}async function tge(e,t,n=`gmail`,r=null){let i=Yb(),a={"Content-Type":`application/json`};i&&(a.Authorization=`Bearer ${i}`);let o=await fetch(`${Zb()}/api/v1/chat/execute-tool`,{method:`POST`,headers:a,body:JSON.stringify({tool_name:e,tool_input:t,provider:n||`gmail`,account_id:r})});if(o.status===401)throw Xb(),new Fb(`Unauthorized`,401);if(!o.ok){let e=(await o.json().catch(()=>({}))).detail;throw new Fb(typeof e==`string`?e:`Request failed: ${o.status}`,o.status,e)}return o.json()}async function nge(e,t,n={}){let r=Yb(),i={"Content-Type":`application/json`};r&&(i.Authorization=`Bearer ${r}`);let a=await fetch(`${Zb()}/api/v1/flags`,{method:`POST`,headers:i,body:JSON.stringify({target_type:e,target_id:t,...n})});if(a.status===401)throw Xb(),new Fb(`Unauthorized`,401);if(!a.ok){let e=(await a.json().catch(()=>({}))).detail;throw new Fb(typeof e==`string`?e:`Request failed: ${a.status}`,a.status,e)}return a.json()}async function rge(e,t){let n=Yb(),r={};n&&(r.Authorization=`Bearer ${n}`);let i=await fetch(`${Zb()}/api/v1/flags/${e}/${t}`,{method:`DELETE`,headers:r});if(i.status===401)throw Xb(),new Fb(`Unauthorized`,401);if(!i.ok&&i.status!==204){let e=(await i.json().catch(()=>({}))).detail;throw new Fb(typeof e==`string`?e:`Request failed: ${i.status}`,i.status,e)}}async function ige(e){let t=Yb(),n={};t&&(n.Authorization=`Bearer ${t}`),await fetch(`${Zb()}/api/v1/notifications/${e}`,{method:`DELETE`,headers:n})}async function age(){let e=Yb(),t={};e&&(t.Authorization=`Bearer ${e}`),await fetch(`${Zb()}/api/v1/notifications/all`,{method:`DELETE`,headers:t})}async function oge(e,t,n){let r=Yb(),i={};r&&(i.Authorization=`Bearer ${r}`);let a=new URLSearchParams({attachment_id:t,filename:n}),o=await fetch(`${Zb()}/api/v1/email-tasks/${e}/attachments/download?${a.toString()}`,{headers:i});if(o.status===401)throw Xb(),new Fb(`Unauthorized`,401);if(!o.ok){let e=(await o.json().catch(()=>({}))).detail;throw new Fb(typeof e==`string`?e:`Download failed: ${o.status}`,o.status,e)}let s=await o.blob(),c=URL.createObjectURL(s);try{let e=document.createElement(`a`);e.href=c,e.download=n,document.body.appendChild(e),e.click(),e.remove()}finally{URL.revokeObjectURL(c)}}async function sge(e,t,n,r){let i=Yb(),a={};i&&(a.Authorization=`Bearer ${i}`);let o=Zb()+Bhe(e,t,n,r),s=await fetch(o,{headers:a});if(s.status===401)throw Xb(),new Fb(`Unauthorized`,401);if(!s.ok){let e=(await s.json().catch(()=>({}))).detail;throw new Fb(typeof e==`string`?e:`Download failed: ${s.status}`,s.status,e)}let c=await s.blob(),l=URL.createObjectURL(c);try{let e=document.createElement(`a`);e.href=l,e.download=r,document.body.appendChild(e),e.click(),e.remove()}finally{URL.revokeObjectURL(l)}}async function cge(e,t,n,r,i){let a=window.open(``,`_blank`),o=Yb(),s={};o&&(s.Authorization=`Bearer ${o}`);let c=Zb()+Bhe(e,t,n,r),l;try{l=await fetch(c,{headers:s})}catch(e){throw a&&a.close(),e}if(l.status===401)throw a&&a.close(),Xb(),new Fb(`Unauthorized`,401);if(!l.ok){a&&a.close();let e=(await l.json().catch(()=>({}))).detail;throw new Fb(typeof e==`string`?e:`Open failed: ${l.status}`,l.status,e)}let u=await l.arrayBuffer(),d=new Blob([u],{type:i||`application/octet-stream`}),f=URL.createObjectURL(d);a?a.location.href=f:window.open(f,`_blank`),setTimeout(()=>URL.revokeObjectURL(f),6e4)}function sx(e,t,n){return new Promise((r,i)=>{let a=new XMLHttpRequest,o=new FormData;o.append(`file`,e),n&&o.append(`ingest_mode`,n),a.upload.addEventListener(`progress`,e=>{e.lengthComputable&&t&&t(Math.round(e.loaded/e.total*100))}),a.addEventListener(`load`,()=>{if(a.status>=200&&a.status<300)try{r(JSON.parse(a.responseText))}catch{i(new Fb(`Invalid response`,a.status))}else if(a.status===401)Xb(),i(new Fb(`Unauthorized`,401));else{let e,t=``;try{e=JSON.parse(a.responseText)?.detail,typeof e==`string`&&(t=e)}catch{}i(new Fb(t||`Upload failed: ${a.status}`,a.status,e))}}),a.addEventListener(`error`,()=>{i(new Fb(`Network error`,0))}),a.addEventListener(`abort`,()=>{i(new Fb(`Upload aborted`,0))}),a.open(`POST`,`${Zb()}/api/v1/documents/upload`);let s=Yb();s&&a.setRequestHeader(`Authorization`,`Bearer ${s}`),a.send(o)})}function lge(e,t){return new Promise((n,r)=>{let i=new XMLHttpRequest,a=new FormData;a.append(`file`,e),i.upload.addEventListener(`progress`,e=>{e.lengthComputable&&t&&t(Math.round(e.loaded/e.total*100))}),i.addEventListener(`load`,()=>{if(i.status>=200&&i.status<300)try{n(JSON.parse(i.responseText))}catch{r(new Fb(`Invalid response`,i.status))}else if(i.status===401)Xb(),r(new Fb(`Unauthorized`,401));else{let e,t=``;try{e=JSON.parse(i.responseText)?.detail,typeof e==`string`&&(t=e)}catch{}r(new Fb(t||`Upload failed: ${i.status}`,i.status,e))}}),i.addEventListener(`error`,()=>{r(new Fb(`Network error`,0))}),i.addEventListener(`abort`,()=>{r(new Fb(`Upload aborted`,0))}),i.open(`POST`,`${Zb()}/api/v1/cs/customers/import/preview`);let o=Yb();o&&i.setRequestHeader(`Authorization`,`Bearer ${o}`),i.send(a)})}async function uge(e){let t={},n=Yb();n&&(t.Authorization=`Bearer ${n}`);let r=await fetch(`${Zb()}/api/v1/cs/customers/import/template?format=${e}`,{headers:t});if(r.status===401)throw Xb(),new Fb(`Unauthorized`,401);if(!r.ok){let e=(await r.json().catch(()=>({}))).detail;throw new Fb(typeof e==`string`?e:`Download failed: ${r.status}`,r.status,e)}let i=await r.blob(),a=URL.createObjectURL(i);try{let t=document.createElement(`a`);t.href=a,t.download=`customers-import-template.${e}`,document.body.appendChild(t),t.click(),t.remove()}finally{URL.revokeObjectURL(a)}}function dge(e,t,n,r={}){return new Promise((i,a)=>{let o=new XMLHttpRequest,s=new FormData;if(e&&s.append(`feedback_content`,e),r.subject&&(s.append(`subject_type`,r.subject.type),s.append(`subject_id`,r.subject.id)),r.clientContext&&s.append(`client_context`,JSON.stringify(r.clientContext)),t.length>0){s.append(`kinds`,JSON.stringify(t.map(e=>e.kind)));for(let e of t)s.append(`files`,e.blob,e.filename)}o.upload.addEventListener(`progress`,e=>{e.lengthComputable&&n&&n(Math.round(e.loaded/e.total*100))}),o.addEventListener(`load`,()=>{if(o.status>=200&&o.status<300)try{i(JSON.parse(o.responseText))}catch{a(new Fb(`Invalid response`,o.status))}else if(o.status===401)Xb(),a(new Fb(`Unauthorized`,401));else{let e,t=``;try{e=JSON.parse(o.responseText)?.detail,typeof e==`string`&&(t=e)}catch{}a(new Fb(t||`Feedback submit failed: ${o.status}`,o.status,e))}}),o.addEventListener(`error`,()=>{a(new Fb(`Network error`,0))}),o.addEventListener(`abort`,()=>{a(new Fb(`Upload aborted`,0))}),o.open(`POST`,`${Zb()}/api/v1/feedback`);let c=Yb();c&&o.setRequestHeader(`Authorization`,`Bearer ${c}`),o.send(s)})}
181async function fge(e,t,n,r){let i=Yb(),a={"Content-Type":`application/json`};i&&(a.Authorization=`Bearer ${i}`);let o=await fetch(`${Zb()}/api/v1/finance-documents/${e}/llm-edit`,{method:`POST`,headers:a,body:JSON.stringify(t),signal:r});if(o.status===401){Xb(),n.onError(`Unauthorized`);return}if(o.status===403){n.onError(`viewers cannot modify finance documents`);return}if(!o.ok){let e=(await o.json().catch(()=>({}))).detail;X(new Fb(typeof e==`string`?e:`Request failed: ${o.status}`,o.status,e),{operation:`send_finance_llm_edit`}),n.onError(Rb(o.status,e,H.t(`errors.generic`)));return}if(!o.body){n.onError(`No response body`);return}let s=o.body.getReader(),c=new TextDecoder,l=``,u=``,d=``;try{for(;;){let{done:e,value:t}=await s.read();if(e)break;l+=c.decode(t,{stream:!0});let r=l.split(` 182`);l=r.pop()||``;for(let e of r)if(e.startsWith(`event: `))u=e.slice(7).trim();else if(e.startsWith(`data: `))d=e.slice(6);else if(e===``&&u&&d){try{let e=JSON.parse(d);u===`delta`?n.onDelta(e.text):u===`patch`?n.onPatch(e):u===`done`?n.onDone(e):u===`error`&&n.onError(e.error||`Unknown error`)}catch(e){console.error(`Failed to parse finance SSE event:`,e,d)}u=``,d=``}}}catch(e){if(e.name===`AbortError`)return;n.onError(e.message||`Stream error`)}}async function pge(e,t,n,r){let i=Yb(),a={"Content-Type":`application/json`};i&&(a.Authorization=`Bearer ${i}`);let o=await fetch(`${Zb()}/api/v1/redlines/${e}/suggest/stream`,{method:`POST`,headers:a,body:JSON.stringify(t),signal:r});if(o.status===401){Xb(),n.onError(`Unauthorized`);return}if(!o.ok){let e=(await o.json().catch(()=>({}))).detail;X(new Fb(typeof e==`string`?e:`Request failed: ${o.status}`,o.status,e),{operation:`suggest_redlines_stream`}),n.onError(Rb(o.status,e,H.t(`errors.generic`)));return}if(!o.body){n.onError(`No response body`);return}let s=o.body.getReader(),c=new TextDecoder,l=``,u=``,d=``,f=!1,p=!1,m,h=()=>{clearTimeout(m),m=setTimeout(()=>{p=!0,s.cancel().catch(()=>{})},ox)};try{for(h();;){let{done:e,value:t}=await s.read();if(h(),e)break;l+=c.decode(t,{stream:!0});let r=l.split(` 183`);l=r.pop()||``;for(let e of r)if(e.startsWith(`event: `))u=e.slice(7).trim();else if(e.startsWith(`data: `))d=e.slice(6);else if(e===``&&u&&d){try{let e=JSON.parse(d);if(u===`suggestions_batch`){let t=e.rows??[];n.onBatch(t,typeof e.batch_index==`number`?e.batch_index:0,e.batch_id)}else u===`done`?(f=!0,n.onDone(e)):u===`error`&&(f=!0,n.onError(e.error||`Unknown error`))}catch(e){console.error(`Failed to parse redline SSE event:`,e,d)}u=``,d=``}}if(!f){let e=p?`idle-timeout`:`connection-closed`;n.onInterrupted?n.onInterrupted(e):n.onError(H.t(`errors.stream_interrupted`))}}catch(e){if(e.name===`AbortError`)return;n.onError(e.message||`Stream error`)}finally{clearTimeout(m)}}var mge=`chat.draft:`,cx=e=>`${mge}${e??`new`}`;function lx(e){try{return localStorage.getItem(cx(e))??``}catch{return``}}function ux(e,t){try{t.trim()?localStorage.setItem(cx(e),t):localStorage.removeItem(cx(e))}catch{}}function dx(e){try{localStorage.removeItem(cx(e))}catch{}}function hge(){try{for(let e of Object.keys(localStorage))e.startsWith(mge)&&localStorage.removeItem(e)}catch{}}const gge=e=>e??`new`;function _ge(e){let t=t=>e.personas.some(e=>e.id===t),n=gge(e.conversationId);if(n in e.overrides){let r=e.overrides[n];if(r===null)return null;if(t(r))return r}if(e.conversationId){let n=e.conversationPersonaId??null;return n&&t(n)?n:null}return e.personas.find(e=>e.is_default)?.id??null}const vge=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/tasks?${n}`:`/api/v1/tasks`},yge=async(e,t)=>Z(vge(e),{...t,method:`GET`}),bge=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/tasks/search?${n}`:`/api/v1/tasks/search`},xge=async(e,t)=>Z(bge(e),{...t,method:`GET`}),Sge=e=>`/api/v1/tasks/${e}/complete`,Cge=async(e,t)=>Z(Sge(e),{...t,method:`PATCH`}),wge=e=>`/api/v1/tasks/${e}/uncomplete`,Tge=async(e,t)=>Z(wge(e),{...t,method:`PATCH`});async function fx(e,t,n){if(e===`google`){n?await Cge(t):await Tge(t);return}let r=e===`caldav`?`caldav-tasks`:`outlook-tasks`;await Z(n?`/api/v1/${r}/${t}/complete`:`/api/v1/${r}/${t}/uncomplete`,{method:`PATCH`})}const Ege={google:`/api/v1/tasks`,outlook:`/api/v1/outlook-tasks`,caldav:`/api/v1/caldav-tasks`},Dge=new Set([`create_calendar_event`,`update_calendar_event`,`delete_calendar_event`,`create_task`,`update_task`,`delete_task`,`complete_task`,`uncomplete_task`]);var px={"Content-Type":`application/json`},Oge=[`summary`,`start_datetime`,`end_datetime`,`description`,`location`,`attendees`,`timezone`],kge=[`title`,`notes`,`due_date`];async function Age(e,t,n){let r={...e,provider:t,account_id:n};await Z(`/api/v1/calendar/events`,{method:`POST`,headers:px,body:JSON.stringify(r)})}async function jge(e){let t={provider:e.provider,account_id:e.account_id??null},n=e;for(let e of Oge){let r=n[e];r!==void 0&&(t[e]=r)}await Z(`/api/v1/calendar/events/${encodeURIComponent(e.provider_event_id)}`,{method:`PATCH`,headers:px,body:JSON.stringify(t)})}async function Mge(e){let t=new URLSearchParams({provider:e.provider});e.account_id&&t.set(`account_id`,e.account_id),await Z(`/api/v1/calendar/events/${encodeURIComponent(e.provider_event_id)}?${t}`,{method:`DELETE`})}function mx(e){return Ege[e]??Ege.google}async function hx(e,t){await Z(mx(t),{method:`POST`,headers:px,body:JSON.stringify(e)})}async function Nge(e){let t={},n=e;for(let e of kge){let r=n[e];r!==void 0&&(t[e]=r)}await Z(`${mx(e.provider)}/${encodeURIComponent(e.task_id)}`,{method:`PATCH`,headers:px,body:JSON.stringify(t)})}async function Pge(e){await Z(`${mx(e.provider)}/${encodeURIComponent(e.task_id)}`,{method:`DELETE`})}async function Fge(e,t,n){let r=n?.provider??`google`;switch(e){case`create_calendar_event`:return await Age(t,r,n?.accountId??null),`Event added to your calendar.`;case`create_task`:return await hx(t,r),`Task added.`;case`update_calendar_event`:return await jge(t),`Event updated.`;case`delete_calendar_event`:return await Mge(t),`Event cancelled.`;case`update_task`:return await Nge(t),`Task updated.`;case`delete_task`:return await Pge(t),`Task deleted.`;case`complete_task`:{let e=t;return await fx(e.provider,e.task_id,!0),`Task marked done.`}case`uncomplete_task`:{let e=t;return await fx(e.provider,e.task_id,!1),`Task reopened.`}default:throw Error(`Unknown calendar tool: ${e}`)}}function gx(e){let t=e.apply_summary,n=t?.failed_count??0;n>0&&G.warning(H.t(`toasts.redline.partial_apply`,{failed:n,total:t?.results?.length??0}))}function _x(e){let t={};for(let n of e.apply_summary?.results??[])n.status===`not_found`&&n.suggestion_id&&(t[n.suggestion_id]=n.reason||H.t(`redline.apply_failed_hint`));return t}var Ige=new Map,Lge=1500;function Rge(e){let t=Ige.get(e);return t||(t={buffer:[],draining:!1},Ige.set(e,t)),t}function vx(e,t){return zge(e,`apply`,t)}function yx(e,t){return zge(e,`unapply`,t)}
183function zge(e,t,n){let r=Rge(e),i=r.buffer.findIndex(e=>e.id===n&&e.kind!==t);if(i>=0){let[e]=r.buffer.splice(i,1);return e.resolve(null),Promise.resolve(null)}return new Promise((i,a)=>{r.buffer.push({kind:t,id:n,resolve:i,reject:a}),Bge(e,r)})}async function Bge(e,t){if(!t.draining){t.draining=!0;try{for(;t.buffer.length>0;)if(t.buffer[0].kind===`apply`){let n=[];for(;t.buffer.length>0&&t.buffer[0].kind===`apply`;)n.push(t.buffer.shift());await Vge(n,()=>n_e(e,n.map(e=>e.id)))}else{let n=t.buffer.shift();await Vge([n],()=>i_e(e,n.id))}}finally{t.draining=!1}}}async function Vge(e,t){try{let n=await Hge(t);for(let t of e)t.resolve(n)}catch(t){for(let n of e)n.reject(t)}}async function Hge(e){try{return await e()}catch(t){if(t instanceof Fb&&t.status===423)return await new Promise(e=>setTimeout(e,Lge)),await e();throw t}}async function Uge(e){return(await Z(`/api/v1/redlines/${e}`)).data}async function Wge(e,t){return(await Z(`/api/v1/redlines/${e}/actions`,{method:`POST`,body:JSON.stringify(t)})).data}async function Gge(e,t){return(await Z(`/api/v1/redlines/${e}/actions/batch`,{method:`POST`,body:JSON.stringify(t)})).data}async function Kge(e,t){return(await Z(`/api/v1/redlines/${e}/reattribute`,{method:`POST`,body:JSON.stringify({from_author:t})})).data}async function qge(e,t){return(await Z(`/api/v1/redlines/${e}/party`,{method:`POST`,body:JSON.stringify({party:t})})).data}async function Jge(e){return(await Z(`/api/v1/redlines/${e}/parties/detect`,{method:`POST`})).data.detected_parties}async function Yge(e){return(await Z(`/api/v1/redlines/${e}/finalize`,{method:`POST`})).data}async function Xge(e,t){return(await Z(`/api/v1/redlines/${e}/versions/${t}/download`)).data}async function Zge(e,t){return(await Z(`/api/v1/redlines/${e}/edits`,{method:`POST`,body:JSON.stringify({suggestion:t})})).data}async function bx(e){return(await Z(`/api/v1/redlines/${e}/versions`)).data}async function Qge(e,t){return(await Z(`/api/v1/redlines/${e}/versions`,{method:`POST`,body:JSON.stringify({label:t})})).data}async function $ge(e,t){return(await Z(`/api/v1/redlines/${e}/versions/${t}/switch`,{method:`POST`})).data}async function e_e(e){return(await Z(`/api/v1/redlines/${e}/suggestions`,{method:`GET`})).data}async function xx(e,t){return(await Z(`/api/v1/redlines/${e}/suggestions/${t}`,{method:`GET`})).data}async function t_e(e,t,n){return(await Z(`/api/v1/redlines/${e}/suggestions/${t}`,{method:`PATCH`,body:JSON.stringify(n),headers:{"Content-Type":`application/json`}})).data}async function n_e(e,t){return(await Z(`/api/v1/redlines/${e}/suggestions/apply`,{method:`POST`,body:JSON.stringify({suggestion_ids:t}),headers:{"Content-Type":`application/json`}})).data}async function r_e(e,t,n){return(await Z(`/api/v1/redlines/${e}/suggestions/triage`,{method:`POST`,body:JSON.stringify({suggestion_ids:t,status:n}),headers:{"Content-Type":`application/json`}})).data}async function i_e(e,t){return(await Z(`/api/v1/redlines/${e}/suggestions/${t}/unapply`,{method:`POST`})).data}function a_e(e,t){let[n,r]=(0,B.useState)([]),[i,a]=(0,B.useState)(!!(e&&t)),[o,s]=(0,B.useState)({}),[c,l]=(0,B.useState)({}),[u,d]=(0,B.useState)(null),f=(0,B.useCallback)(async()=>{if(!e||!t){r([]),a(!1);return}a(!0);try{r(await xx(e,t)),d(null)}catch(e){d(Gb(e,H.t(`errors.fetch_failed`),{operation:`redline_fetch_suggestion_batch`}))}finally{a(!1)}},[e,t]);(0,B.useEffect)(()=>{f()},[f]);let p=(0,B.useCallback)(async(t,n)=>{try{let i=await t_e(e,t,n);r(e=>e.map(e=>e.id===t?i:e))}catch(e){d(Gb(e,H.t(`errors.save_failed`),{operation:`redline_patch_suggestion`}))}},[e]),m=(0,B.useCallback)(e=>{let t=e.suggestions;if(!t?.length)return;let n=new Map(t.map(e=>[e.id,e]));r(e=>e.map(e=>n.get(e.id)??e))},[]),h=(0,B.useCallback)(async(t,n,r,i)=>{s(e=>({...e,[t]:n})),l(({[t]:e,...n})=>n);try{let e=await r();if(e){m(e);let t=_x(e);Object.keys(t).length>0&&l(e=>({...e,...t})),gx(e)}}catch(r){Y(r,i,{operation:`redline_${n}_suggestion`,metadata:{documentId:e,suggestionId:t}})}finally{s(({[t]:e,...n})=>n)}},[e,m]);return{suggestions:n,isLoading:i,error:u,inFlightById:o,failureById:c,refresh:f,updateOne:p,applyOne:(0,B.useCallback)(t=>h(t,`apply`,()=>vx(e,t),H.t(`toasts.redline.suggestion_apply_failed`)),[e,h]),unapplyOne:(0,B.useCallback)(t=>h(t,`unapply`,()=>yx(e,t),H.t(`toasts.redline.suggestion_unapply_failed`)),[e,h])}}const o_e=()=>`/api/v1/activity/heartbeat`,s_e=async(e,t)=>Z(o_e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),c_e=e=>{let t=new URLSearchParams;Object.entries(e||{}
183).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/activity?${n}`:`/api/v1/activity`},l_e=async(e,t)=>Z(c_e(e),{...t,method:`GET`}),u_e=()=>`/api/v1/activity/all-time`,d_e=async e=>Z(u_e(),{...e,method:`GET`}),f_e=()=>`/api/v1/activity/recent-focus`,p_e=async e=>Z(f_e(),{...e,method:`GET`}),m_e=()=>`/api/v1/activity/recent-focus`,h_e=async(e,t)=>Z(m_e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),g_e=()=>`/api/v1/activity/events`,__e=async(e,t)=>Z(g_e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)});var v_e=new Set;function y_e(e){return[e.event_type,e.email_task_id??``,e.document_id??``,e.suggestion_id??``].join(`|`)}async function Sx(e){let t=y_e(e);if(!v_e.has(t)){v_e.add(t);try{await __e(e)}catch(e){X(e,{operation:`engagement`})}}}function Cx(e,t){Ex.setState(n=>{if(n.documentId!==e)return{};let r={paragraphs:t.paragraphs,comments:t.comments,hasWorkingCopy:t.has_working_copy};if(t.suggestions?.length){let e=new Map(t.suggestions.map(e=>[e.id,e]));r.persistedSuggestions=n.persistedSuggestions.map(t=>e.get(t.id)??t)}let i=_x(t);return Object.keys(i).length>0&&(r.applyFailureById={...n.applyFailureById,...i}),r}),gx(t)}function wx(e,t){let n={...e};for(let e of t)delete n[e];return n}function b_e(e,t){if(!t.length)return e;let n=e.slice(),r=new Map(n.map((e,t)=>[e.id,t]));for(let e of t){let t=r.get(e.id);t===void 0?(r.set(e.id,n.length),n.push(e)):n[t]=e}return n}var Tx=0;const Ex=Pb((e,t)=>({isRedlineMode:!1,isEmbedded:!1,documentId:null,originalFilename:null,paragraphs:[],comments:[],party:null,categoryKey:null,hasWorkingCopy:!1,detectedParties:null,isDetectingParties:!1,isLoading:!1,isApplying:!1,error:null,persistedSuggestions:[],isLoadingSuggestions:!1,suggestionStreamStatus:`idle`,applyInFlightById:{},applyFailureById:{},versions:[],activeVersionId:null,isCreatingVersion:!1,enterRedlineMode:async(n,r)=>{let i=r?.embedded??!1;e({isLoading:!0,error:null,documentId:n,isEmbedded:i,isRedlineMode:!i}),Sx({event_type:`redline_editor_opened`,surface:i?`email`:`vault`,document_id:n});try{let r=await Uge(n);if(t().documentId!==n)return;e({paragraphs:r.paragraphs,comments:r.comments,party:r.party||null,categoryKey:r.category_key||null,detectedParties:r.detected_parties||null,hasWorkingCopy:r.has_working_copy,originalFilename:r.original_filename,activeVersionId:r.version_id||null,isLoading:!1}),t().loadVersions(),i||t().loadPersistedSuggestions(n),r.detected_parties??t().detectParties()}catch(r){if(t().documentId!==n)return;X(r,{operation:`redline_enter_mode`,metadata:{docId:n},expectedNotFound:!0}),e({error:Kb(r,H.t(`errors.document_load_failed`)),isLoading:!1,isRedlineMode:!1,isEmbedded:!1,documentId:null})}},exitRedlineMode:n=>{n&&t().documentId!==n||e({isRedlineMode:!1,isEmbedded:!1,documentId:null,originalFilename:null,paragraphs:[],comments:[],party:null,categoryKey:null,detectedParties:null,isDetectingParties:!1,hasWorkingCopy:!1,isLoading:!1,isApplying:!1,error:null,persistedSuggestions:[],isLoadingSuggestions:!1,suggestionStreamStatus:`idle`,applyInFlightById:{},applyFailureById:{},versions:[],activeVersionId:null})},reloadDocument:async()=>{let{documentId:e,isEmbedded:n}=t();e&&await t().enterRedlineMode(e,{embedded:n})},setParty:async n=>{let{documentId:r}=t();if(r)try{await qge(r,n),e({party:n})}catch(t){X(t,{operation:`redline_set_party`,metadata:{documentId:r}}),e({error:Kb(t,H.t(`errors.save_failed`))})}},detectParties:async()=>{let{documentId:n,isDetectingParties:r}=t();if(!(!n||r)){e({isDetectingParties:!0});try{let r=await Jge(n);if(t().documentId!==n)return;e({detectedParties:r,isDetectingParties:!1})}catch(r){if(t().documentId!==n)return;X(r,{operation:`redline_detect_parties`,metadata:{documentId:n}}),e({isDetectingParties:!1})}}},applyAction:async(n,r)=>{let{documentId:i,isApplying:a}=t();if(!(!i||a)){e({isApplying:!0,error:null});try{let t=await Wge(i,{change_id:n,action:r});e({paragraphs:t.paragraphs,comments:t.comments,hasWorkingCopy:t.has_
183working_copy,isApplying:!1})}catch(t){X(t,{operation:`redline_apply_action`,metadata:{documentId:i,changeId:n,action:r}}),e({error:Kb(t,H.t(`toasts.redline.suggestion_apply_failed`)),isApplying:!1})}}},applyBatchActions:async n=>{let{documentId:r}=t();if(r){e({isApplying:!0,error:null});try{let t=await Gge(r,{actions:n});e({paragraphs:t.paragraphs,comments:t.comments,hasWorkingCopy:t.has_working_copy,isApplying:!1})}catch(t){X(t,{operation:`redline_apply_batch`,metadata:{documentId:r}}),e({error:Kb(t,H.t(`toasts.redline.suggestion_apply_failed`)),isApplying:!1})}}},finalizeDocument:async()=>{let{documentId:n}=t();if(!n)return null;try{return(await Yge(n)).download_url}catch(t){return X(t,{operation:`redline_finalize`,metadata:{documentId:n}}),e({error:Kb(t,H.t(`errors.save_failed`))}),null}},applyManualEdit:async(n,r)=>{let{documentId:i,paragraphs:a}=t();if(!i)return;let o=a.find(e=>e.paragraph_index===n);if(!o)return;let s=o.runs.filter(e=>e.type!==`del`).map(e=>e.text).join(``);if(s!==r){e({isApplying:!0,error:null});try{let t=await Zge(i,{paragraph_index:n,original_text:s,suggested_text:r,rationale:`Manual edit`,change_type:`replace`,generation_mode:`rewrite`,paragraph_ref:o.editor_ref});e({paragraphs:t.paragraphs,comments:t.comments,hasWorkingCopy:t.has_working_copy,isApplying:!1})}catch(t){X(t,{operation:`redline_apply_manual_edit`,metadata:{documentId:i,paragraphIndex:n}}),e({error:Kb(t,H.t(`errors.save_failed`)),isApplying:!1})}}},createVersion:async n=>{let{documentId:r,isCreatingVersion:i}=t();if(!(!r||i)){e({isCreatingVersion:!0});try{let t=await Qge(r,n);e(e=>({versions:e.versions.some(e=>e.id===t.id)?e.versions:[...e.versions,t],activeVersionId:t.id})),G.success(H.t(`toasts.redline.version_saved`))}catch(t){X(t,{operation:`redline_create_version`,metadata:{documentId:r}}),e({error:Kb(t,H.t(`errors.create_failed`))})}finally{e({isCreatingVersion:!1})}}},switchVersion:async n=>{let{documentId:r}=t();if(r){e({isLoading:!0,error:null});try{let t=await $ge(r,n);e({paragraphs:t.paragraphs,comments:t.comments,hasWorkingCopy:t.has_working_copy,activeVersionId:n,isLoading:!1})}catch(t){X(t,{operation:`redline_switch_version`,metadata:{documentId:r,versionId:n}}),e({error:Kb(t,H.t(`errors.fetch_failed`)),isLoading:!1})}}},loadVersions:async()=>{let{documentId:n}=t();if(n)try{e({versions:(await bx(n)).versions})}catch{}},loadPersistedSuggestions:async n=>{let r=++Tx;e({isLoadingSuggestions:!0});try{let i=await e_e(n);if(t().documentId!==n||r!==Tx)return;t().suggestionStreamStatus===`streaming`?e(e=>({persistedSuggestions:b_e(e.persistedSuggestions,i),isLoadingSuggestions:!1})):e({persistedSuggestions:i,isLoadingSuggestions:!1})}catch(i){if(X(i,{operation:`redline_load_persisted_suggestions`,metadata:{docId:n}}),t().documentId!==n||r!==Tx)return;e({persistedSuggestions:[],isLoadingSuggestions:!1})}},appendSuggestions:(t,n)=>{n.length&&e(e=>e.documentId===t?{persistedSuggestions:b_e(e.persistedSuggestions,n)}:{})},appendSuggestionBatch:async(e,n)=>
183{try{let r=await xx(e,n);if(t().documentId!==e)return;t().appendSuggestions(e,r)}catch(t){X(t,{operation:`redline_append_suggestion_batch`,metadata:{docId:e,batchId:n}})}},setSuggestionStreamStatus:t=>e({suggestionStreamStatus:t}),updatePersistedSuggestion:async(n,r,i)=>{try{let a=await t_e(n,r,i);e(e=>({persistedSuggestions:e.persistedSuggestions.map(e=>e.id===r?a:e)})),t().documentId===n&&await t().loadPersistedSuggestions(n)}catch(t){X(t,{operation:`redline_update_persisted_suggestion`,metadata:{docId:n,suggestionId:r}}),e({error:Kb(t,H.t(`errors.save_failed`))})}},applySuggestionsNow:async(t,n)=>{e(e=>({applyInFlightById:{...e.applyInFlightById,...Object.fromEntries(n.map(e=>[e,`apply`]))},applyFailureById:wx(e.applyFailureById,n)}));try{let e=await Promise.allSettled(n.map(e=>vx(t,e))),r=new Set,i=null;for(let n of e){if(n.status===`rejected`){i??=n.reason;continue}let e=n.value;!e||r.has(e)||(r.add(e),Cx(t,e))}i&&Y(i,H.t(`toasts.redline.suggestion_apply_failed`),{operation:`redline_apply_suggestion`,metadata:{docId:t}})}finally{e(e=>({applyInFlightById:wx(e.applyInFlightById,n)}))}},batchTriageSuggestions:async(n,r,i)=>{let a=new Set(r);e(e=>e.documentId===n?{persistedSuggestions:e.persistedSuggestions.map(e=>a.has(e.id)?{...e,status:i}:e)}:{});try{let a=await r_e(n,r,i);t().documentId===n&&e({persistedSuggestions:a})}catch(r){X(r,{operation:`redline_batch_triage_suggestions`,metadata:{docId:n,status:i}}),e({error:Kb(r,H.t(`errors.save_failed`))}),t().documentId===n&&await t().loadPersistedSuggestions(n)}},unapplySuggestion:async(t,n)=>{e(e=>({applyInFlightById:{...e.applyInFlightById,[n]:`unapply`},applyFailureById:wx(e.applyFailureById,[n])}));try{let e=await yx(t,n);e&&Cx(t,e)}catch(e){Y(e,H.t(`toasts.redline.suggestion_unapply_failed`),{operation:`redline_unapply_suggestion`,metadata:{docId:t,suggestionId:n}})}finally{e(e=>({applyInFlightById:wx(e.applyInFlightById,[n])}))}},reattributeAuthorAction:async n=>{let{documentId:r,isApplying:i}=t();if(!(!r||i)){e({isApplying:!0,error:null});try{Cx(r,await Kge(r,n))}catch(e){Y(e,H.t(`toasts.redline.reattribute_failed`),{operation:`redline_reattribute_author`,metadata:{documentId:r,fromAuthor:n}})}finally{e({isApplying:!1})}}},clearError:()=>e({error:null})})),x_e=()=>`/api/v1/integrations/sync`,S_e=async e=>Z(x_e(),{...e,method:`POST`});async function C_e(e,t,n,r){let i=new URLSearchParams;return e&&i.set(`status`,e),t&&i.set(`provider`,t),n!==void 0&&i.set(`is_legal`,String(n)),r&&i.set(`category`,r),(await Z(`/api/v1/email-tasks${i.toString()?`?${i.toString()}`:``}`,{method:`GET`})).data}async function Dx(e){return(await Z(`/api/v1/email-tasks/${e}`,{method:`GET`})).data}async function w_e(e){return(await Z(`/api/v1/email-tasks/${e}/thread`,{method:`GET`})).data}async function T_e(e){return(await Z(`/api/v1/email-tasks/${e}/dismiss`,{method:`POST`})).data}async function E_e(e,t,n){let r={category:t};return n&&(r.intent=n),(await Z(`/api/v1/email-tasks/${e}/category`,{method:`PATCH`,body:JSON.stringify(r),headers:{"Content-Type":`application/json`}})).data}async function D_e(e){await Z(`/api/v1/email-tasks/${e}`,{method:`DELETE`})}async function O_e(e,t,n){return(await Z(`/api/v1/email-tasks/${e}/attachments/process`,{method:`POST`,body:JSON.stringify({attachment_id:t,filename:n}),headers:{"Content-Type":`application/json`}})).data}async function k_e(e,t){return(await Z(`/api/v1/email-tasks/${e}/thread/promote`,{method:`POST`,body:JSON.stringify(t),headers:{"Content-Type":`application/json`}})).data}async function A_e(e,t,n){return(await Z(`/api/v1/email-tasks/${e}/documents/${t}/side`,{method:`POST`,body:JSON.stringify({side:n}),headers:{"Content-Type":`application/json`}})).data}async function j_e(e,t,n){return(await Z(`/api/v1/email-tasks/${e}/documents/${t}/grounding`,{method:`POST`,body:JSON.stringify(n),headers:{"Content-Type":`application/json`}})).data}async function M_e(e,t){return(await Z(`/api/v1/email-tasks/${e}/documents/${t}/analyze`,{method:`POST`})).data}async function N_e(e,t){return(await Z(`/api/v1/email-tasks/${e}/documents/${t}/redline`,{method:`POST`})).data}async function P_e(e){return(await Z(`/api/v1/email-drafts/by-task/${e}`,{method:`GET`})).data}async function Ox(e,t,n=!1){return(await Z(`/api/v1/email-drafts/${e}${n?`?sync_gmail=true`:``}`,{method:`PATCH`,body:JSON.stringify(t),headers:{"Content-Type":`application/json`}})).data}async function F_e(e){return(await Z(`/api/v1/email-drafts/${e}/save-to-drafts`,{method:`POST`})).data}async function I_e(e){return(await Z(`/api/v1/email-drafts/${e}/send`,{method:`POST`})).data}async function L_e(e){return(await Z(`/api/v1/redlines/${e}/suggestions`,{method:`GET`})).data}
183async function R_e(e,t,n){return(await Z(`/api/v1/redlines/${e}/suggestions/${t}`,{method:`PATCH`,body:JSON.stringify(n),headers:{"Content-Type":`application/json`}})).data}function z_e(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var kx=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return kx(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return kx(t)(e)}}}},B_e=(e,t)=>(n,r,i)=>{let a={storage:z_e(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return kx(u.getItem.bind(u))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(m,void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p};const V_e=()=>`/api/v1/auth/register`,H_e=async(e,t)=>Z(V_e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),U_e=()=>`/api/v1/auth/login`,W_e=async(e,t)=>Z(U_e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),G_e=()=>`/api/v1/auth/refresh`,K_e=async e=>Z(G_e(),{...e,method:`POST`}),q_e=()=>`/api/v1/auth/logout`,J_e=async e=>Z(q_e(),{...e,method:`POST`}),Y_e=()=>`/api/v1/auth/me`,Ax=async e=>Z(Y_e(),{...e,method:`GET`}),X_e=()=>`/api/v1/auth/me`,Z_e=async e=>Z(X_e(),{...e,method:`DELETE`}),Q_e=()=>`/api/v1/auth/me`,jx=async(e,t)=>Z(Q_e(),{...t,method:`PATCH`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),$_e=()=>`/api/v1/auth/me/avatar`,eve=async(e,t)=>{let n=new FormData;return n.append(`file`,e.file),Z($_e(),{...t,method:`PUT`,body:n})},tve=()=>`/api/v1/auth/me/avatar`,nve=async e=>Z(tve(),{...e,method:`DELETE`}),rve=()=>`/api/v1/auth/forgot-password`,ive=async(e,t)=>Z(rve(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),ave=()=>`/api/v1/auth/reset-password`,ove=async(e,t)=>Z(ave(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)});var Mx=e=>e?Date.now()>=e:!0;const Nx=Pb()(B_e((e,t)=>({user:null,token:null,tokenExpiresAt:null,isLoading:!0,error:null,setAuth:t=>{let n=Date.now()+t.expires_in*1e3;e({user:t.user,token:t.access_token,tokenExpiresAt:n,error:null})},setToken:async(t,n=900)=>{e({token:t,tokenExpiresAt:Date.now()+n*1e3});try{let t=(await Ax()).data;e({user:t})}catch{}},clearAuth:()=>{e({user:null,token:null,tokenExpiresAt:null,error:null}),ev(async()=>{let{resetAllStores:e}=await import(`./reset-DnmHHqjL.js`);return{resetAllStores:e}},[]).then(({resetAllStores:e})=>e()),hge()},setError:t=>{e({error:t})},setLoading:t=>{e({isLoading:t})},updateUser:t=>{e({user:t})},initialize:async()=>{let{token:n,tokenExpiresAt:r}=t();if(!n){e({isLoading:!1});return}if(Mx(r))try{let e=await K_e();t().setAuth(e.data)}catch{t().clearAuth()}else try{e({user:(await Ax()).data})}catch{}e({isLoading:!1})}}),{name:`auth-storage`,partialize:e=>({user:e.user,token:e.token,tokenExpiresAt:e.tokenExpiresAt})})),Px=e=>e.token!==null&&!Mx(e.tokenExpiresAt);Ipe(()=>Nx.getState().token,()=>Nx.getState().clearAuth()),Rpe(`https://contract-rag-api.onrender.com`);const sve=()=>`/api/v1/matters`,cve=async(e,t)=>Z(sve(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),lve=e=>{let t=new URLSearchParams;Object.entries(e||{}
183).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/matters?${n}`:`/api/v1/matters`},uve=async(e,t)=>Z(lve(e),{...t,method:`GET`}),dve=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/matters/search?${n}`:`/api/v1/matters/search`},fve=async(e,t)=>Z(dve(e),{...t,method:`GET`}),pve=e=>`/api/v1/matters/${e}`,mve=async(e,t)=>Z(pve(e),{...t,method:`GET`}),hve=e=>`/api/v1/matters/${e}`,gve=async(e,t,n)=>Z(hve(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),_ve=e=>`/api/v1/matters/${e}`,vve=async(e,t)=>Z(_ve(e),{...t,method:`DELETE`}),yve=e=>`/api/v1/matters/${e}/threads`,bve=async(e,t)=>Z(yve(e),{...t,method:`GET`}),xve=(e,t)=>`/api/v1/matters/${e}/threads/${t}/resolve`,Sve=async(e,t,n)=>Z(xve(e,t),{...n,method:`POST`}),Cve=(e,t)=>`/api/v1/matters/${e}/threads/${t}/resolve`,wve=async(e,t,n)=>Z(Cve(e,t),{...n,method:`DELETE`}),Tve=(e,t)=>`/api/v1/matters/${e}/threads/${t}/knowledge-base`,Eve=async(e,t,n,r)=>Z(Tve(e,t),{...r,method:`PUT`,headers:{"Content-Type":`application/json`,...r?.headers},body:JSON.stringify(n)}),Dve=(e,t)=>`/api/v1/matters/${e}/threads/${t}/move`,Ove=async(e,t,n,r)=>Z(Dve(e,t),{...r,method:`POST`,headers:{"Content-Type":`application/json`,...r?.headers},body:JSON.stringify(n)}),kve=(e,t)=>`/api/v1/matters/${e}/threads/${t}`,Ave=async(e,t,n)=>Z(kve(e,t),{...n,method:`DELETE`}),jve=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/matters/${e}/email-tasks?${r}`:`/api/v1/matters/${e}/email-tasks`},Mve=async(e,t,n)=>Z(jve(e,t),{...n,method:`GET`}),Nve=(e,t)=>`/api/v1/matters/${e}/email-tasks/${t}`,Pve=async(e,t,n)=>Z(Nve(e,t),{...n,method:`PATCH`}),Fve=e=>`/api/v1/matters/${e}/documents`,Ive=async(e,t,n)=>Z(Fve(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),Lve=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/matters/${e}/documents?${r}`:`/api/v1/matters/${e}/documents`},Rve=async(e,t,n)=>Z(Lve(e,t),{...n,method:`GET`}),zve=(e,t)=>`/api/v1/matters/${e}/documents/${t}`,Bve=async(e,t,n)=>Z(zve(e,t),{...n,method:`DELETE`}),Vve=e=>`/api/v1/matters/${e}/conversations`,Hve=async(e,t,n)=>Z(Vve(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),Uve=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/matters/${e}/conversations?${r}`:`/api/v1/matters/${e}/conversations`},Wve=async(e,t,n)=>Z(Uve(e,t),{...n,method:`GET`}),Gve=(e,t)=>`/api/v1/matters/${e}/conversations/${t}`,Kve=async(e,t,n)=>Z(Gve(e,t),{...n,method:`DELETE`}),qve=e=>`/api/v1/matters/${e}/evaluations`,Jve=async(e,t,n)=>Z(qve(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),Yve=(e,t)=>
183{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/matters/${e}/evaluations?${r}`:`/api/v1/matters/${e}/evaluations`},Xve=async(e,t,n)=>Z(Yve(e,t),{...n,method:`GET`}),Zve=(e,t)=>`/api/v1/matters/${e}/evaluations/${t}`,Qve=async(e,t,n)=>Z(Zve(e,t),{...n,method:`DELETE`}),$ve=e=>`/api/v1/matters/${e}/redline-suggestions`,eye=async(e,t,n)=>Z($ve(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),tye=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/matters/${e}/redline-suggestions?${r}`:`/api/v1/matters/${e}/redline-suggestions`},nye=async(e,t,n)=>Z(tye(e,t),{...n,method:`GET`}),rye=(e,t)=>`/api/v1/matters/${e}/redline-suggestions/${t}`,iye=async(e,t,n)=>Z(rye(e,t),{...n,method:`DELETE`}),aye=e=>`/api/v1/matters/${e}/knowledge-bases`,oye=async(e,t,n)=>Z(aye(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),sye=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/matters/${e}/knowledge-bases?${r}`:`/api/v1/matters/${e}/knowledge-bases`},cye=async(e,t,n)=>Z(sye(e,t),{...n,method:`GET`}),lye=e=>`/api/v1/matters/${e}/default-knowledge-base`,uye=async(e,t,n)=>Z(lye(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),dye=(e,t)=>`/api/v1/matters/${e}/knowledge-bases/${t}`,fye=async(e,t,n)=>Z(dye(e,t),{...n,method:`DELETE`}),pye=e=>`/api/v1/matters/${e}/calendar-events`,mye=async(e,t,n)=>Z(pye(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),hye=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/matters/${e}/calendar-events?${r}`:`/api/v1/matters/${e}/calendar-events`},gye=async(e,t,n)=>Z(hye(e,t),{...n,method:`GET`}),_ye=(e,t)=>`/api/v1/matters/${e}/calendar-events/${t}`,vye=async(e,t,n)=>Z(_ye(e,t),{...n,method:`DELETE`}),yye=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/matters/${e}/finance-documents?${r}`:`/api/v1/matters/${e}/finance-documents`},bye=async(e,t,n)=>Z(yye(e,t),{...n,method:`GET`}),xye=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/matters/${e}/activity?${r}`:`/api/v1/matters/${e}/activity`},Sye=async(e,t,n)=>Z(xye(e,t),{...n,method:`GET`}),Cye=e=>`/api/v1/matters/${e}/action-items`,wye=async(e,t,n)=>Z(Cye(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),Tye=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/matters/${e}/action-items?${r}`:`/api/v1/matters/${e}/action-items`},Eye=async(e,t,n)=>Z(Tye(e,t),{...n,method:`GET`}),Dye=(e,t)=>`/api/v1/matters/${e}/action-items/${t}`,Oye=async(e,t,n,r)=>Z(Dye(e,t),{...r,method:`PATCH`,headers:{"Content-Type":`application/json`,...r?.headers},body:JSON.stringify(n)}),kye=(e,t)=>`/api/v1/matters/${e}/action-items/${t}`,Aye=async(e,t,n)=>Z(kye(e,t),{...n,method:`DELETE`});var Fx=new Set;function Ix(e){return Fx.add(e),()=>{Fx.delete(e)}}function Lx(e){Fx.forEach(t=>t(e))}async function Rx(e,t){Lx({threadId:t,is_resolved:!0});try{await Sve(e,t)}catch(n){Lx({threadId:t,is_resolved:!1}),Y(n,`Failed to mark thread done`,{operation:`resolveThread`,metadata:{matterId:e,threadId:t}})}}async function zx(e,t){Lx({threadId:t,is_resolved:!1});try{await wve(e,t)}catch(n){Lx({threadId:t,is_resolved:!0}),Y(n,`Failed to reopen thread`,{operation:`unresolveThread`,metadata:{matterId:e,threadId:t}})}}function jye(e,t){return t===`irrelevant`?e!==`irrelevant`:e===`all`?!1:e!==t}function Bx(e){let t=e.filter(e=>e.status===`completed`&&e.document_id);if(t.length===0)return null;let n=t.filter(e=>e.is_latest_revision!==!1),r=n.length>0?n:t;return r[r.length-1].document_id??null}function Mye(e,t){if(t){let n=e.find(e=>e.document_id===t&&e.status===`completed`);if(n?.document_id)return n.document_id}return Bx(e)}function Vx(e,t){Ux.setState(e=>{let n={};if(t.suggestions?.length){let r=new Map(t.suggestions.map(e=>[e.id,e]));n.suggestions=e.suggestions.map(e=>r.get(e.id)??e)}let r=_x(t);return Object.keys(r).length>0&&(n.applyFailureById={...e.applyFailureById,...r}),n}),Ex.getState().documentId===e&&Ex.setState({paragraphs:t.paragraphs,comments:t.comments,hasWorkingCopy:t.has_
183working_copy}),gx(t)}function Hx(e,t){let n={...e};for(let e of t)delete n[e];return n}const Ux=Pb((e,t)=>({tasks:[],selectedTask:null,documents:[],selectedDocumentId:null,draft:null,suggestions:[],applyInFlightById:{},applyFailureById:{},thread:null,isLoadingThread:!1,isLoading:!1,error:null,providerFilter:`all`,classificationFilter:`all`,analyzingDocumentIds:[],redliningDocumentIds:[],setProviderFilter:n=>{e({providerFilter:n}),t().loadTasks()},setClassificationFilter:n=>{e({classificationFilter:n}),t().loadTasks()},loadTasks:async n=>{e({isLoading:!0,error:null});try{let{providerFilter:r,classificationFilter:i}=t();e({tasks:(await C_e(n,r===`all`?void 0:r,void 0,i===`all`?void 0:i)).tasks,isLoading:!1})}catch(t){X(t,{operation:`email_load_tasks`}),e({isLoading:!1,error:Kb(t,H.t(`errors.fetch_failed`))})}},clearProviderData:n=>{e(e=>({tasks:e.tasks.filter(e=>e.provider!==n),...e.selectedTask?.provider===n?{selectedTask:null,documents:[],selectedDocumentId:null,draft:null,suggestions:[],thread:null}:{}})),t().loadTasks()},selectTask:async(n,r)=>{let i=t().thread?.messages?.some(e=>e.email_task_id===n)??!1;e({isLoading:!0,error:null,draft:null,suggestions:[],documents:[],selectedDocumentId:null,analyzingDocumentIds:[],redliningDocumentIds:[],...i?{}:{thread:null}});try{let a=await Dx(n),o=a.documents??[],s=Mye(o,r);e({selectedTask:a,documents:o,selectedDocumentId:s,isLoading:!1}),s&&t().loadSuggestions(s),t().loadDraft(n),i||t().loadThread(n)}catch(t){X(t,{operation:`email_select_task`,metadata:{taskId:n},expectedNotFound:!0}),e({isLoading:!1,error:Kb(t,H.t(`errors.fetch_failed`))})}},selectDocument:n=>{e({selectedDocumentId:n}),t().loadSuggestions(n)},processAttachment:async(n,r,i)=>{try{await O_e(n,r,i),await t().selectTask(n)}catch(t){X(t,{operation:`email_process_attachment`,metadata:{taskId:n,attachmentId:r}}),e({error:Kb(t,H.t(`errors.generic`))})}},promoteMessage:async(n,r,i,a)=>{try{let e=await k_e(n,{provider_message_id:r,intent:i,...a?{playbook_id:a}:{}});await t().loadTasks(),await t().selectTask(e.id)}catch(t){throw X(t,{operation:`email_promote_message`,metadata:{taskId:n,providerMessageId:r}}),e({error:Kb(t,H.t(`errors.generic`))}),t}},downloadAttachment:async(t,n,r)=>{try{await oge(t,n,r)}catch(r){X(r,{operation:`email_download_attachment`,metadata:{taskId:t,attachmentId:n}}),e({error:Kb(r,H.t(`errors.generic`))})}},handleDocProcessed:n=>{let r=n.metadata?.document_id;r&&e(e=>({analyzingDocumentIds:e.analyzingDocumentIds.filter(e=>e!==r),redliningDocumentIds:e.redliningDocumentIds.filter(e=>e!==r)}));let{selectedTask:i,selectedDocumentId:a}=t();!i||n.reference_id!==i.id||Dx(i.id).then(r=>{let i=r.documents??[],o=a??Bx(i);e({selectedTask:r,documents:i,selectedDocumentId:o}),o&&!a&&t().loadSuggestions(o);let s=n.metadata?.document_id;s&&t().loadSuggestions(s)}).catch(()=>{})},handleEmailAnalysisReady:async t=>{let n=t.reference_id;if(n)try{let t=await Dx(n);e(e=>({selectedTask:e.selectedTask?.id===n?{...e.selectedTask,email_analysis:t.email_analysis}:e.selectedTask,tasks:e.tasks.map(e=>e.id===n?{...e,email_analysis:t.email_analysis}:e)}))}catch(e){X(e,{operation:`email_analysis_ready_refresh`,metadata:{taskId:n}})}},handleDraftReady:async e=>{let{selectedTask:n,draft:r}=t();!n||e.reference_id!==n.id||r||await t().loadDraft(n.id)},loadDraft:async t=>{try{e({draft:await P_e(t)})}catch{e({draft:null})}},loadThread:async n=>{e({isLoadingThread:!0});try{let r=await w_e(n);if(t().selectedTask?.id!==n)return;e({thread:r,isLoadingThread:!1})}catch(r){console.warn(`Failed to load task thread`,r),t().selectedTask?.id===n&&e({thread:null,isLoadingThread:!1})}},markThreadCompleted:async(e,t)=>{await Rx(e,t)},reopenThread:async(e,t)=>{await zx(e,t)},loadSuggestions:async t=>{try{e({suggestions:await L_e(t)})}catch{e({suggestions:[]})}},appendSuggestions:(t,n)=>{n.length&&e(e=>{if(e.selectedDocumentId!==t)return{};let r=e.suggestions.slice(),i=new Map(r.map((e,t)=>[e.id,t]));for(let e of n){let t=i.get(e.id);t===void 0?(i.set(e.id,r.length),r.push(e)):r[t]=e}return{suggestions:r}})},updateDraft:async(t,n)=>{try{e({draft:await Ox(t,n)})}catch(n){X(n,{operation:`email_update_draft`,metadata:{draftId:t}}),e({error:Kb(n,H.t(`errors.save_failed`))})}},autoSaveDraft:async(n,r)=>{let{draft:i,selectedTask:a}=t();if(a?.provider===`slack`){try{e({draft:await Ox(n,r,!1)})}catch{}return}let o=Nx.getState().user?.preferences?.auto_sync_drafts_to_gmail!==!1;try{o?i?.gmail_draft_id?e({draft:await Ox(n,r,!0)}):(await Ox(n,r,!1),e({draft:await F_e(n)})):e({draft:await Ox(n,r,!1)})}catch{}},applySuggestionsNow:async(t,n)=>{e(e=>({applyInFlightById:{...e.applyInFlightById,...Object.fromEntries(n.map(e=>[e,`apply`]))},applyFailureById:Hx(e.applyFailureById,n)}));try{let e=await Promise.allSettled(n.map(e=>
183vx(t,e))),r=new Set,i=null;for(let n of e){if(n.status===`rejected`){i??=n.reason;continue}!n.value||r.has(n.value)||(r.add(n.value),Vx(t,n.value))}i&&Y(i,H.t(`toasts.redline.suggestion_apply_failed`),{operation:`email_apply_suggestion`,metadata:{documentId:t}})}finally{e(e=>({applyInFlightById:Hx(e.applyInFlightById,n)}))}},batchTriageSuggestions:async(n,r,i)=>{let a=new Set(r);e(e=>({suggestions:e.suggestions.map(e=>a.has(e.id)?{...e,status:i}:e)}));try{let a=await r_e(n,r,i);t().selectedDocumentId===n&&e({suggestions:a})}catch(r){X(r,{operation:`email_batch_triage_suggestions`,metadata:{documentId:n,status:i}}),e({error:Kb(r,H.t(`errors.save_failed`))}),t().selectedDocumentId===n&&await t().loadSuggestions(n)}},unapplySuggestion:async(t,n)=>{e(e=>({applyInFlightById:{...e.applyInFlightById,[n]:`unapply`},applyFailureById:Hx(e.applyFailureById,[n])}));try{let e=await yx(t,n);e&&Vx(t,e)}catch(e){Y(e,H.t(`toasts.redline.suggestion_unapply_failed`),{operation:`email_unapply_suggestion`,metadata:{documentId:t,suggestionId:n}})}finally{e(e=>({applyInFlightById:Hx(e.applyInFlightById,[n])}))}},saveToDrafts:async t=>{try{e({draft:await F_e(t)})}catch(n){X(n,{operation:`email_save_to_drafts`,metadata:{draftId:t}}),e({error:Kb(n,H.t(`toasts.mail.draft_save_failed`))})}},send:async n=>{try{e({draft:await I_e(n)}),t().loadTasks();let r=t().selectedTask?.id;r&&t().loadThread(r)}catch(t){X(t,{operation:`email_send`,metadata:{draftId:n}}),e({error:Kb(t,H.t(`toasts.mail.draft_send_failed`))})}},dismiss:async t=>{await T_e(t),e(e=>({tasks:e.tasks.filter(e=>e.id!==t),selectedTask:null,documents:[],selectedDocumentId:null,draft:null,suggestions:[],thread:null}))},deleteTask:async t=>{await D_e(t),e(e=>({tasks:e.tasks.filter(e=>e.id!==t),selectedTask:e.selectedTask?.id===t?null:e.selectedTask,documents:e.selectedTask?.id===t?[]:e.documents,selectedDocumentId:e.selectedTask?.id===t?null:e.selectedDocumentId,draft:e.selectedTask?.id===t?null:e.draft,suggestions:e.selectedTask?.id===t?[]:e.suggestions,thread:e.selectedTask?.id===t?null:e.thread}))},reclassify:async(n,r)=>{let{classificationFilter:i}=t();try{let t=await E_e(n,r);e(e=>{let a=jye(i,r);return{tasks:a?e.tasks.filter(e=>e.id!==n):e.tasks.map(e=>e.id===n?t:e),selectedTask:e.selectedTask?.id===n?a?null:t:e.selectedTask}})}catch(t){X(t,{operation:`email_reclassify`,metadata:{taskId:n,category:r}}),e({error:Kb(t,H.t(`errors.save_failed`))})}},setDocumentSide:async(n,r)=>{let{selectedTask:i}=t();if(i)try{let t=await A_e(i.id,n,r);e(e=>({selectedTask:e.selectedTask?.id===t.id?t:e.selectedTask,documents:e.selectedTask?.id===t.id?t.documents??[]:e.documents,tasks:e.tasks.map(e=>e.id===t.id?t:e)}))}catch(t){X(t,{operation:`email_set_document_side`,metadata:{documentId:n,side:r}}),e({error:Kb(t,H.t(`errors.save_failed`))})}},setDocumentGrounding:async(n,r)=>{let{selectedTask:i}=t();if(i)try{let t=await j_e(i.id,n,{...r,rerun:!0});e(e=>({selectedTask:e.selectedTask?.id===t.id?t:e.selectedTask,documents:e.selectedTask?.id===t.id?t.documents??[]:e.documents,tasks:e.tasks.map(e=>e.id===t.id?t:e)}))}catch(e){Y(e,H.t(`errors.save_failed`),{operation:`email_set_document_grounding`,metadata:{documentId:n}})}},analyzeDocument:async n=>{let{selectedTask:r,analyzingDocumentIds:i}=t();if(r&&!i.includes(n)){e({analyzingDocumentIds:[...i,n]});try{let t=await M_e(r.id,n);e(e=>({selectedTask:e.selectedTask?.id===t.id?t:e.selectedTask,documents:e.selectedTask?.id===t.id?t.documents??[]:e.documents,tasks:e.tasks.map(e=>e.id===t.id?t:e)}))}catch(t){e(e=>({analyzingDocumentIds:e.analyzingDocumentIds.filter(e=>e!==n)})),X(t,{operation:`email_analyze_document`,metadata:{documentId:n}}),e({error:Kb(t,H.t(`errors.generic`))})}}},redlineDocument:async n=>{let{selectedTask:r,redliningDocumentIds:i}=t();if(r&&!i.includes(n)){e({redliningDocumentIds:[...i,n]});try{let t=await N_e(r.id,n);e(e=>({selectedTask:e.selectedTask?.id===t.id?t:e.selectedTask,documents:e.selectedTask?.id===t.id?t.documents??[]:e.documents,tasks:e.tasks.map(e=>e.id===t.id?t:e)}))}catch(t){e(e=>({redliningDocumentIds:e.redliningDocumentIds.filter(e=>e!==n)})),X(t,{operation:`email_redline_document`,metadata:{documentId:n}}),e({error:Kb(t,H.t(`errors.generic`))})}}},updateSuggestion:async(t,n,r)=>{let i=await R_e(t,n,r);e(e=>({suggestions:e.suggestions.map(e=>e.id===n?i:e)}))},clearSelection:()=>e({selectedTask:null,documents:[],selectedDocumentId:null,draft:null,suggestions:[],thread:null,analyzingDocumentIds:[],redliningDocumentIds:[]})}));Ix(({threadId:e,is_resolved:t})=>{Ux.setState(n=>n.thread&&n.thread.thread_id===e?{thread:{...n.thread,is_resolved:t}}:{})});function Wx(e,t,n=5e3){return G.custom(r=>(0,K.jsxs)(`div`,{className:`relative flex w-[20rem] items-center gap-3 overflow-hidden rounded-md border bg-popover px-4 py-3 text-sm text-popover-foreground shadow-md`,children:[(0,K.jsx)(Ug,{className:`size-4 shrink-0`}),(0,K.jsx)(`span`,{className:`flex-1`,children:e}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{t(),G.dismiss(r)},className:`rounded px-2 py-1 text-xs font-medium hover:bg-muted`,children:H.t(`toasts.mail.undo`)}
183),(0,K.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute bottom-0 left-0 h-[2px] w-full origin-left bg-primary/60`,style:{animation:`undo-shrink ${n}ms linear forwards`}})]}),{duration:n})}function Gx(e,t,n){return X(e,{operation:`matter_action`,metadata:{fallback:t},...n}),Kb(e,t)}function Kx(e){return[...e].sort((e,t)=>{let n=e.due_date??null,r=t.due_date??null;return n===r?(e.created_at??``)<(t.created_at??``)?-1:1:n?r?n<r?-1:1:-1:1})}function qx(e,t){let n=Yx.getState().matterDetail;n&&n.id===e&&Yx.setState({matterDetail:{...n,action_item_count:t.filter(e=>e.status===`open`).length}})}var Jx=0;function Nye(e,t){try{return localStorage.getItem(e)||t}catch{return t}}function Pye(e,t){try{localStorage.setItem(e,t)}catch{}}const Yx=Pb((e,t)=>({matters:[],isLoadingMatters:!1,selectedMatterId:null,matterDetail:null,isLoadingDetail:!1,statusFilter:null,error:null,searchResults:[],searchQuery:``,isSearching:!1,matterEmailTasks:[],matterThreads:[],isLoadingThreads:!1,matterDocuments:[],matterConversations:[],matterEvaluations:[],matterRedlines:[],matterKnowledgeBases:[],matterCalendarEvents:[],matterFinanceDocuments:[],matterActionItems:[],isLoadingResources:!1,threadSortKey:Nye(`matter.threadSort`,`recency`),financeDocSortKey:Nye(`matter.financeDocSort`,`updated`),clearError:()=>e({error:null}),setThreadSortKey:t=>{Pye(`matter.threadSort`,t),e({threadSortKey:t})},setFinanceDocSortKey:t=>{Pye(`matter.financeDocSort`,t),e({financeDocSortKey:t})},setStatusFilter:n=>{e({statusFilter:n}),t().fetchMatters()},fetchMatters:async()=>{e({isLoadingMatters:!0,error:null});try{let{statusFilter:n}=t(),r=(await uve(n?{status:n}:void 0)).data;e({matters:r.items,isLoadingMatters:!1})}catch(t){e({isLoadingMatters:!1,error:Gx(t,H.t(`errors.fetch_failed`))})}},searchMatters:async t=>{let n=t.trim();if(!n){e({searchResults:[],searchQuery:``,isSearching:!1});return}let r=++Jx;e({searchQuery:n,isSearching:!0});try{let t=(await fve({query:n,limit:10})).data;r===Jx&&e({searchResults:t,isSearching:!1})}catch(t){r===Jx&&e({isSearching:!1,error:Gx(t,H.t(`errors.fetch_failed`))})}},clearSearch:()=>e({searchResults:[],searchQuery:``,isSearching:!1}),createMatter:async e=>{let n=(await cve(e)).data;return await t().fetchMatters(),n},updateMatter:async(e,n)=>{await gve(e,n),await t().fetchMatters(),t().selectedMatterId===e&&await t().loadMatterDetail(e)},deleteMatter:async t=>{await vve(t),e(e=>({matters:e.matters.filter(e=>e.id!==t),selectedMatterId:e.selectedMatterId===t?null:e.selectedMatterId,matterDetail:e.selectedMatterId===t?null:e.matterDetail}))},selectMatter:n=>{e({selectedMatterId:n}),n?t().loadMatterDetail(n):e({matterDetail:null})},loadMatterDetail:async t=>{e({isLoadingDetail:!0,error:null});try{let n=(await mve(t)).data;e({matterDetail:n,isLoadingDetail:!1})}catch(t){e({isLoadingDetail:!1,error:Gx(t,H.t(`errors.fetch_failed`),{expectedNotFound:!0})})}},loadEmailTasks:async t=>{e({isLoadingResources:!0});try{let n=(await Mve(t)).data;e({matterEmailTasks:n.items,isLoadingResources:!1})}catch(t){e({isLoadingResources:!1,error:Gx(t,H.t(`errors.fetch_failed`),{expectedNotFound:!0})})}},loadMatterThreads:async t=>{e({isLoadingThreads:!0});try{let n=(await bve(t)).data;e({matterThreads:n,isLoadingThreads:!1})}catch(t){e({isLoadingThreads:!1,error:Gx(t,H.t(`errors.fetch_failed`),{expectedNotFound:!0})})}},loadDocuments:async t=>{e({isLoadingResources:!0});try{let n=(await Rve(t)).data;e({matterDocuments:n.items,isLoadingResources:!1})}catch(t){e({isLoadingResources:!1,error:Gx(t,H.t(`errors.fetch_failed`),{expectedNotFound:!0})})}},loadConversations:async t=>{e({isLoadingResources:!0});try{let n=(await Wve(t)).data;e({matterConversations:n.items,isLoadingResources:!1})}catch(t){e({isLoadingResources:!1,error:Gx(t,H.t(`errors.fetch_failed`),{expectedNotFound:!0})})}},loadEvaluations:async t=>{e({isLoadingResources:!0});try{let n=(await Xve(t)).data;e({matterEvaluations:n.items,isLoadingResources:!1})}catch(t){e({isLoadingResources:!1,error:Gx(t,H.t(`errors.fetch_failed`),{expectedNotFound:!0})})}},loadRedlines:async t=>{e({isLoadingResources:!0});try{let n=(await nye(t)).data;e({matterRedlines:n.items,isLoadingResources:!1})}catch(t){e({isLoadingResources:!1,error:Gx(t,H.t(`errors.fetch_failed`),{expectedNotFound:!0})})}},loadActionItems:async t=>{e({isLoadingResources:!0});try{let n=(await Eye(t)).data;e({matterActionItems:n,isLoadingResources:!1}),qx(t,n)}catch(t){e({isLoadingResources:!1,error:Gx(t,H.t(`errors.fetch_failed`),{expectedNotFound:!0})})}},loadKnowledgeBases:async t=>{e({isLoadingResources:!0});try{let n=(await cye(t)).data;e({matterKnowledgeBases:n.items,isLoadingResources:!1})}catch(t){e({isLoadingResources:!1,error:Gx(t,H.t(`errors.fetch_failed`),{expectedNotFound:!0})})}},loadCalendarEvents:async t=>{e({isLoadingResources:!0});try{let n=(await gye(t)).data;e({matterCalendarEvents:n.items,isLoadingResources:!1})}catch(t){e({isLoadingResources:!1,error:Gx(t,H.t(`errors.fetch_failed`),{expectedNotFound:!0})})}},loadMatterFinanceDocuments:async t=>{e({isLoadingResources:!0});try{let n=(await bye(t)).data;e({matterFinanceDocuments:n.items,isLoadingResources:!1})}catch(t){e({isLoadingResources:!1,error:Gx(t,H.t(`errors.fetch_failed`),{expectedNotFound:!0})})}},assignEmailTask:async(n,r)=>{try{await Pve(n,r),await t().loadEmailTasks(n),await t().fetchMatters()}catch(t){throw e({error:Gx(t,H.t(`errors.save_failed`))}),t}},addDocument:async(n,r)=>{try{await Ive(n,{resource_id:r}),await t().loadDocuments(n)}catch(t){throw e({error:Gx(t,H.t(`errors.save_failed`))}),t}},removeDocument:async(e,n)=>{await Bve(e,n),await t().loadDocuments(e)},addConversation:async(n,r)=>{try{await Hve(n,{resource_id:r}),await t().loadConversations(n)}catch(t){throw e({error:Gx(t,H.t(`errors.save_failed`))}),t}},removeConversation:async(e,n)=>{await Kve(e,n),await t().loadConversations(e)},addEvaluation:async(n,r)=>{try{await Jve(n,{resource_id:r}),await t().loadEvaluations(n)}catch(t){throw e({error:Gx(t,H.t(`errors.save_failed`))}),t}},removeEvaluation:async(e,n)=>{await Qve(e,n),await t().loadEvaluations(e)},addRedline:async(n,r)=>{try{await eye(n,{resource_id:r}),await t().loadRedlines(n)}catch(t){throw e({error:Gx(t,H.t(`errors.save_failed`))}),t}},removeRedline:async(e,n)=>{await iye(e,n),await t().loadRedlines(e)},addKnowledgeBase:async(n,r)=>{try{await oye(n,{resource_id:r}),await t().loadKnowledgeBases(n)}catch(t){throw e({error:Gx(t,H.t(`errors.save_failed`))}),t}},removeKnowledgeBase:async(e,n)=>{await fye(e,n),await t().loadKnowledgeBases(e)},addCalendarEvent:async(n,r)=>{try{await mye(n,{resource_id:r}),await t().loadCalendarEvents(n)}catch(t){throw e({error:Gx(t,H.t(`errors.save_failed`))}),t}},removeCalendarEvent:async(e,n)=>{await vye(e,n),await t().loadCalendarEvents(e)},createActionItem:async(n,r)=>{try{let i=(await wye(n,r)).data,a=Kx([...t().matterActionItems,i]);e({matterActionItems:a}),qx(n,a)}catch(t){throw e({error:Gx(t,H.t(`errors.save_failed`))}),t}},updateActionItem:async(n,r,i)=>{let a=t().matterActionItems,o=Kx(a.map(e=>e.id===r?{...e,...i,title:i.title??e.title,status:i.status??e.status}:e));e({matterActionItems:o}),qx(n,o);try{let a=(await Oye(n,r,i)).data,o=Kx(t().matterActionItems.map(e=>e.id===r?a:e));e({matterActionItems:o}),qx(n,o)}catch(t){throw e({matterActionItems:a,error:Gx(t,H.t(`errors.save_failed`))}),qx(n,a),t}},deleteActionItem:async(n,r)=>{let i=t().matterActionItems,a=i.filter(e=>e.id!==r);e({matterActionItems:a}),qx(n,a);try{await Aye(n,r)}catch(t){throw e({matterActionItems:i,error:Gx(t,H.t(`errors.save_failed`))}),qx(n,i),t}},resolveThread:async(e,t)=>{await Rx(e,t)},unresolveThread:async(e,t)=>{await zx(e,t)},setThreadKnowledgeBase:async(n,r,i)=>{let a=t().matterThreads;e({matterThreads:a.map(e=>e.thread_id===r?{...e,knowledge_base_id:i}:e)});try{await Eve(n,r,{knowledge_base_id:i})}catch(t){throw e({matterThreads:a}),Y(t,H.t(`errors.save_failed`),{operation:`setThreadKnowledgeBase`,metadata:{matterId:n,threadId:r}}),t}},setDefaultKnowledgeBase:async(n,r)=>{let i=t().matterDetail,a=t().matters;e(e=>
183({matterDetail:e.matterDetail?.id===n?{...e.matterDetail,default_knowledge_base_id:r}:e.matterDetail,matters:e.matters.map(e=>e.id===n?{...e,default_knowledge_base_id:r}:e)}));try{await uye(n,{knowledge_base_id:r})}catch(t){throw e({matterDetail:i,matters:a}),Y(t,H.t(`errors.save_failed`),{operation:`setDefaultKnowledgeBase`,metadata:{matterId:n}}),t}},moveThreadToMatter:async(n,r,i)=>{let a=t().matterThreads;e({matterThreads:a.filter(e=>e.thread_id!==r)});try{await Ove(n,r,{target_matter_id:i}),await t().fetchMatters();let e=t().matters.find(e=>e.id===i);Wx(H.t(`matters.thread_moved`,{name:e?.name??``}),()=>{t().moveThreadToMatter(i,r,n).then(()=>t().loadMatterThreads(n))})}catch(t){throw e({matterThreads:a,error:Gx(t,H.t(`errors.save_failed`))}),t}},deleteThread:async(n,r)=>{let i=t().matterThreads;e({matterThreads:i.filter(e=>e.thread_id!==r)});try{await Ave(n,r),await t().fetchMatters()}catch(t){throw e({matterThreads:i,error:Gx(t,H.t(`errors.save_failed`))}),t}}}));Ix(({threadId:e,is_resolved:t})=>{Yx.setState(n=>({matterThreads:n.matterThreads.map(n=>n.thread_id===e?{...n,is_resolved:t}:n)}))});function Fye(e){if(e&&typeof e==`object`){let t=e.email_signature;if(typeof t==`string`)return t}return``}function Iye(){return Nx(e=>Fye(e.user?.preferences))}function Lye(){return Fye(Nx.getState().user?.preferences)}function Rye(e,t){let n=t.trim();if(!n||e.includes(n))return e;let r=`\n\n${t}`;return e?`${r}\n\n${e}`:r}function zye(e,t){let n=t.trim();if(!n)return e||``;let r=e||``;return r.includes(n)?r:r.trim()?`${r.trimEnd()}\n\n${t}`:t}function Bye(e){let t=e.accounts?.length?e.accounts:e.account?[e.account]:[],n=e.primary_account_id??null,r=t.find(e=>e.id===n)??e.account??null;return{initialized:!0,accounts:t,primaryAccountId:n,account:r,connected:e.connected,needsReauth:r?!r.is_active:!1,notAvailable:r?.mail_service_enabled===!1,maxAccounts:e.max_accounts??5,calendarScopeOk:e.calendar_scope_ok??!1,signatureScopeOk:e.signature_scope_ok??!1,contactsScopeOk:e.contacts_scope_ok??!1,loading:!1,error:null}}const Xx=Pb((e,t)=>({initialized:!1,connected:!1,account:null,accounts:[],primaryAccountId:null,maxAccounts:5,needsReauth:!1,notAvailable:!1,calendarScopeOk:!1,signatureScopeOk:!1,contactsScopeOk:!1,loading:!1,error:null,fetchStatus:async()=>{e({loading:!0,error:null});try{e(Bye((await Z(`/api/v1/gmail/status`,{method:`GET`})).data))}catch(t){X(t,{operation:`gmail_fetch_status`}),e({initialized:!0,loading:!1,error:Kb(t,H.t(`errors.fetch_failed`))})}},connect:async t=>{e({loading:!0,error:null});try{let e=await Z(`/api/v1/gmail/connect${typeof t==`string`&&t?`?login_hint=${encodeURIComponent(t)}`:``}`,{method:`GET`});window.location.href=e.data.authorization_url}catch(t){X(t,{operation:`gmail_connect`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.connect_failed`))})}},handleCallback:async(n,r)=>{e({loading:!0,error:null});try{let e=await Z(`/api/v1/gmail/callback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:n,state:r})});return await t().fetchStatus(),e.data.gmail_email}catch(t){throw X(t,{operation:`gmail_callback`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.connect_failed`))}),t}},disconnect:async n=>{e({loading:!0,error:null});try{await Z(`/api/v1/gmail/disconnect?account_id=${encodeURIComponent(n)}`,{method:`DELETE`}),await t().fetchStatus()}catch(t){throw X(t,{operation:`gmail_disconnect`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.disconnect_failed`))}),t}},deleteSyncedData:async n=>{e({loading:!0,error:null});try{await Z(`/api/v1/gmail/synced-data?account_id=${encodeURIComponent(n)}`,{method:`DELETE`}),await t().fetchStatus()}catch(t){throw X(t,{operation:`gmail_delete_synced`}),e({loading:!1,error:Kb(t,H.t(`errors.generic`))}),t}},setPrimary:async t=>{e({loading:!0,error:null});try{e(Bye((await Z(`/api/v1/gmail/accounts/${encodeURIComponent(t)}/primary`,{method:`PATCH`})).data))}catch(t){throw X(t,{operation:`gmail_set_primary`}),e({loading:!1}),t}},markNotAvailable:t=>{e(e=>{let n=t??e.primaryAccountId??e.account?.id;if(!n)return{};let r=e.accounts.map(e=>e.id===n?{...e,mail_service_enabled:!1}:e),i=r.find(t=>
183t.id===e.primaryAccountId)??r[0]??null;return{accounts:r,account:i,notAvailable:i?.mail_service_enabled===!1,needsReauth:i?!i.is_active:!1}})},saveSyncedFolders:async(e,n)=>{await Ahe(e,n),await t().fetchStatus()}}));var Vye=e=>Symbol.iterator in e,Hye=e=>`entries`in e,Uye=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},Wye=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function Gye(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Vye(e)&&Vye(t)?Hye(e)&&Hye(t)?Uye(e,t):Wye(e,t):Uye({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Zx(e){let t=B.useRef(void 0);return n=>{let r=e(n);return Gye(t.current,r)?t.current:t.current=r}}function Kye(e){let t=e.accounts?.length?e.accounts:e.account?[e.account]:[],n=e.primary_account_id??null,r=t.find(e=>e.id===n)??e.account??null;return{initialized:!0,accounts:t,primaryAccountId:n,account:r,connected:e.connected,needsReauth:r?!r.is_active:!1,caldavConnected:t.some(e=>e.caldav?.is_active),maxAccounts:e.max_accounts??5,loading:!1,error:null}}const Qx=Pb((e,t)=>({initialized:!1,connected:!1,account:null,accounts:[],primaryAccountId:null,maxAccounts:5,needsReauth:!1,caldavConnected:!1,loading:!1,error:null,dialogOpen:!1,dialogMode:`connect`,editingAccountId:null,configAccountId:null,fetchStatus:async()=>{e({loading:!0,error:null});try{e(Kye((await Z(`/api/v1/imap/status`,{method:`GET`})).data))}catch(t){X(t,{operation:`imap_fetch_status`}),e({initialized:!0,loading:!1,error:Kb(t,H.t(`errors.fetch_failed`))})}},connect:async n=>{e({loading:!0,error:null});try{let e=await Z(`/api/v1/imap/connect`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)});return await t().fetchStatus(),e.data}catch(t){throw X(t,{operation:`imap_connect`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.connect_failed`))}),t}},connectCaldav:async(n,r)=>{e({loading:!0,error:null});try{await Z(`/api/v1/imap/caldav/connect`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...r,imap_account_id:n})}),await t().fetchStatus()}catch(t){throw X(t,{operation:`caldav_connect`}),e({loading:!1}),t}},disconnectCaldav:async n=>{e({loading:!0,error:null});try{await Z(`/api/v1/imap/caldav?imap_account_id=${encodeURIComponent(n)}`,{method:`DELETE`}),await t().fetchStatus()}catch(t){throw X(t,{operation:`caldav_disconnect`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.disconnect_failed`))}),t}},disconnect:async n=>{e({loading:!0,error:null});try{await Z(`/api/v1/imap/disconnect?account_id=${encodeURIComponent(n)}`,{method:`DELETE`}),await t().fetchStatus()}catch(t){throw X(t,{operation:`imap_disconnect`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.disconnect_failed`))}),t}},deleteSyncedData:async n=>{e({loading:!0,error:null});try{await Z(`/api/v1/imap/synced-data?account_id=${encodeURIComponent(n)}`,{method:`DELETE`}),await t().fetchStatus()}catch(t){throw X(t,{operation:`imap_delete_synced`}),e({loading:!1,error:Kb(t,H.t(`errors.generic`))}),t}},setPrimary:async t=>{e({loading:!0,error:null});try{e(Kye((await Z(`/api/v1/imap/accounts/${encodeURIComponent(t)}/primary`,{method:`PATCH`})).data))}catch(t){throw X(t,{operation:`imap_set_primary`}),e({loading:!1}),t}},openConnectDialog:(n,r)=>{if(n){e({dialogOpen:!0,dialogMode:n,editingAccountId:r??null,error:null});return}let{accounts:i}=t();if(i.length===0){e({dialogOpen:!0,dialogMode:`connect`,editingAccountId:null,error:null});return}let a=i.find(e=>!e.is_active);if(a){e({dialogOpen:!0,dialogMode:`reconnect`,editingAccountId:a.id,error:null});return}e({dialogOpen:!0,dialogMode:`add`,editingAccountId:null,error:null})},closeConnectDialog:()=>e({dialogOpen:!1}),openConfigDialog:t=>e({configAccountId:t}),closeConfigDialog:()=>e({configAccountId:null}),saveSyncedFolders:async(e,n)=>{await jhe(e,n),await t().fetchStatus()}}));function qye(e){let t=e.accounts?.length?e.accounts:e.account?[e.account]:[],n=e.primary_account_id??null,r=t.find(e=>e.id===n)??e.account??null;return{initialized:!0,accounts:t,primaryAccountId:n,account:r,connected:e.connected,needsReauth:r?!r.is_active:!1,maxAccounts:e.max_accounts??5,contactsScopeOk:e.contacts_scope_ok??!1,loading:!1,error:null}}const $x=Pb((e,t)=>
183({initialized:!1,connected:!1,account:null,accounts:[],primaryAccountId:null,maxAccounts:5,needsReauth:!1,contactsScopeOk:!1,loading:!1,error:null,fetchStatus:async()=>{e({loading:!0,error:null});try{e(qye((await Z(`/api/v1/outlook/status`,{method:`GET`})).data))}catch(t){X(t,{operation:`outlook_fetch_status`}),e({initialized:!0,loading:!1,error:Kb(t,H.t(`errors.fetch_failed`))})}},connect:async t=>{e({loading:!0,error:null});try{let e=await Z(`/api/v1/outlook/connect${typeof t==`string`&&t?`?login_hint=${encodeURIComponent(t)}`:``}`,{method:`GET`});window.location.href=e.data.authorization_url}catch(t){X(t,{operation:`outlook_connect`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.connect_failed`))})}},handleCallback:async(n,r)=>{e({loading:!0,error:null});try{let e=await Z(`/api/v1/outlook/callback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:n,state:r})});return await t().fetchStatus(),e.data.outlook_email}catch(t){throw X(t,{operation:`outlook_callback`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.connect_failed`))}),t}},disconnect:async n=>{e({loading:!0,error:null});try{await Z(`/api/v1/outlook/disconnect?account_id=${encodeURIComponent(n)}`,{method:`DELETE`}),await t().fetchStatus()}catch(t){throw X(t,{operation:`outlook_disconnect`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.disconnect_failed`))}),t}},deleteSyncedData:async n=>{e({loading:!0,error:null});try{await Z(`/api/v1/outlook/synced-data?account_id=${encodeURIComponent(n)}`,{method:`DELETE`}),await t().fetchStatus()}catch(t){throw X(t,{operation:`outlook_delete_synced`}),e({loading:!1,error:Kb(t,H.t(`errors.generic`))}),t}},setPrimary:async t=>{e({loading:!0,error:null});try{e(qye((await Z(`/api/v1/outlook/accounts/${encodeURIComponent(t)}/primary`,{method:`PATCH`})).data))}catch(t){throw X(t,{operation:`outlook_set_primary`}),e({loading:!1}),t}},saveSyncedFolders:async(e,n)=>{await khe(e,n),await t().fetchStatus()}})),eS=[`gmail`,`outlook`,`imap`];function tS(e){return e===`gmail`||e===`outlook`||e===`imap`}var Jye={inbox:`INBOX`,starred:`STARRED`,important:`INBOX`,sent:`SENT`,drafts:`DRAFT`,spam:`SPAM`,trash:`TRASH`},nS={inbox:`inbox`,starred:`starred`,sent:`sent`,drafts:`drafts`,spam:`spam`,trash:`trash`},rS=null,iS=null,aS=null;function oS(e){if(rS&&rS.raw===e.accounts&&rS.primaryId===e.primaryAccountId)return rS.mapped;let t=e.accounts.map(t=>({id:t.id,email:t.gmail_email,isPrimary:t.id===e.primaryAccountId,needsReauth:!t.is_active,notAvailable:t.mail_service_enabled===!1}));return rS={raw:e.accounts,primaryId:e.primaryAccountId,mapped:t},t}function sS(e){if(iS&&iS.raw===e.accounts&&iS.primaryId===e.primaryAccountId)return iS.mapped;let t=e.accounts.map(t=>({id:t.id,email:t.outlook_email,isPrimary:t.id===e.primaryAccountId,needsReauth:!t.is_active,notAvailable:!1}));return iS={raw:e.accounts,primaryId:e.primaryAccountId,mapped:t},t}function cS(e){if(aS&&aS.raw===e.accounts&&aS.primaryId===e.primaryAccountId)return aS.mapped;let t=e.accounts.map(t=>({id:t.id,email:t.email,isPrimary:t.id===e.primaryAccountId,needsReauth:!t.is_active,notAvailable:!1}));return aS={raw:e.accounts,primaryId:e.primaryAccountId,mapped:t},t}const lS={gmail:{id:`gmail`,labelKey:`mail.providers.gmail`,connectLabelKey:`mail.providers.connect_gmail`,icon:__,color:`#EA4335`,supportsLabels:!0,supportsImportantFolder:!0,supportsDraftSave:!0,supportsCustomFolders:!1,folderCountKeys:Jye,getStatus:()=>{let e=Xx.getState();return{initialized:e.initialized,connected:e.connected,needsReauth:e.needsReauth,notAvailable:e.notAvailable,accountEmail:e.account?.gmail_email??null,loading:e.loading,accounts:oS(e),primaryAccountId:e.primaryAccountId}},fetchStatus:()=>Xx.getState().fetchStatus(),startConnect:()=>Xx.getState().connect()},outlook:{id:`outlook`,labelKey:`mail.providers.outlook`,connectLabelKey:`mail.providers.connect_outlook`,icon:__,color:`#0078D4`,supportsLabels:!0,supportsImportantFolder:!1,supportsDraftSave:!0,supportsCustomFolders:!0,folderCountKeys:nS,getStatus:()=>{let e=$x.getState();return{initialized:e.initialized,connected:e.connected,needsReauth:e.needsReauth,notAvailable:!1,accountEmail:e.account?.outlook_email??null,loading:e.loading,accounts:sS(e),primaryAccountId:e.primaryAccountId}},fetchStatus:()=>$x.getState().fetchStatus(),startConnect:()=>$x.getState().connect()},imap:{id:`imap`,labelKey:`mail.providers.imap`,connectLabelKey:`mail.providers.connect_imap`,icon:M_,color:`#64748B`,supportsLabels:!1,supportsImportantFolder:!1,supportsDraftSave:!0,supportsCustomFolders:!1,folderCountKeys:nS,getStatus:()=>{let e=Qx.getState();return{initialized:e.initialized,connected:e.connected,needsReauth:e.needsReauth,notAvailable:!1,accountEmail:e.account?.email??null,loading:e.loading,accounts:cS(e),primaryAccountId:e.primaryAccountId}},fetchStatus:()=>Qx.getState().fetchStatus(),startConnect:()=>Qx.getState().openConnectDialog()}};function uS(e){return e.connected&&!e.needsReauth&&!e.notAvailable}function Yye(e){return uS(lS[e].getStatus())}function Xye(e){return!e.needsReauth&&!e.notAvailable}function dS(e,t){let n=lS[e].getStatus();return t==null?n.accountEmail:n.accounts.find(e=>e.id===t)?.email??null}function fS(){return{gmail:Xx(Zx(e=>({initialized:e.initialized,connected:e.connected,needsReauth:e.needsReauth,notAvailable:e.notAvailable,accountEmail:e.account?.gmail_email??null,loading:e.loading,accounts:oS(e),primaryAccountId:e.primaryAccountId}))),outlook:$x(Zx(e=>({initialized:e.initialized,connected:e.connected,needsReauth:e.needsReauth,notAvailable:!1,accountEmail:e.account?.outlook_email??null,loading:e.loading,accounts:sS(e),primaryAccountId:e.primaryAccountId}))),imap:Qx(Zx(e=>({initialized:e.initialized,connected:e.connected,needsReauth:e.needsReauth,notAvailable:!1,accountEmail:e.account?.email??null,loading:e.loading,accounts:cS(e),primaryAccountId:e.primaryAccountId})))}}var Zye={to:``,cc:``,bcc:``,subject:``,body:``,thread_id:null,in_reply_to_id:null,draft_id:null},pS={ids:[],page:1,totalPages:null,pageTokens:{1:null},loaded:!1,loading:!1,refreshing:!1};function mS(e){return{id:e.message_id,thread_id:e.thread_id,from_email:e.from_email,from_name:e.from_name,to_email:e.to_email??null,cc_email:e.cc_email??null,bcc_email:e.bcc_email??null,to_recipients:e.to_recipients??[],cc_recipients:e.cc_recipients??[],subject:e.subject,body_preview:e.body_preview,body_full:e.body_full??void 0,received_at:e.received_at,has_attachments:e.has_attachments,attachments:e.attachments,provider:e.provider===`slack`?`gmail`:e.provider,is_unread:e.is_unread??!1,is_starred:e.is_starred??!1,label_ids:e.label_ids??[]}}function hS(e,t,n,r,i){if(r)return null;let a=CS(e);if(a){let e=i.find(e=>e.id===a)?.total;return e?Math.ceil(e/25):null}let o=lS[t].folderCountKeys[e];if(!o)return null;let s=n[o];return s?.total?Math.ceil(s.total/25):null}function Qye(e,t,n){let r=lS[t].folderCountKeys[e];return r?n[r]?.total??null:null}var gS=0,_S=new Map,$ye=1e4;function vS(e){_S.set(e,Date.now())}function yS(e){_S.delete(e)}function ebe(e){let t=_S.get(e);return t===void 0?!1:Date.now()-t>$ye?(_S.delete(e),!1):!0}var bS=null,xS=0,tbe=1e3,nbe=1e4;function SS(){bS!==null&&(clearTimeout(bS),bS=null),xS=0,_S.clear(),gS+=1}var rbe=[`inbox`,`sent`,`drafts`,`trash`,`spam`,`starred`,`important`,`all`];function ibe(e){return rbe.includes(e)}function abe(e){return ibe(e)?e:`all`}function obe(e){return e.startsWith(`label:`)?e.slice(6):void 0}function CS(e){return e.startsWith(`folder:`)?e.slice(7):void 0}var wS=`mail.provider`;function sbe(){try{let e=localStorage.getItem(wS);if(tS(e))return e}catch{}return`gmail`}function cbe(e){try{localStorage.setItem(wS,e)}catch{}}var TS=`mail.group-by-date`;function lbe(){try{return localStorage.getItem(TS)===`true`}catch{return!1}}function ube(e){try{localStorage.setItem(TS,String(e))}catch{}}async function ES(e,t,n={}){let r=DS.getState,i=DS.setState,{provider:a,byFolder:o,searchQuery:s}=r(),c=o[e]??pS,l=++gS;i({byFolder:{...o,[e]:n.silent?{...c,refreshing:!0}:{...c,loading:!0}}});try{let n=await whe(a,abe(e),{maxResults:25,page:t,pageToken:t>1?c.pageTokens[t]??void 0:void 0,query:s||void 0,labelId:obe(e),folderId:CS(e)});if(l!==gS)return;
183let o=r(),u=new Set(o.byFolder[e]?.ids??[]),d={...o.messageMap},f=[];for(let e of n.messages){let t=mS(e),n=o.messageMap[t.id];if(n&&ebe(t.id)){if(d[t.id]={...t,is_unread:n.is_unread,is_starred:n.is_starred,label_ids:n.label_ids},!u.has(t.id))continue}else d[t.id]=t;f.push(t.id)}i({messageMap:d,byFolder:{...r().byFolder,[e]:{ids:f,page:t,totalPages:hS(e,o.provider,o.folderCounts,o.searchQuery,o.customFolders),pageTokens:t===1?{1:null,2:n.next_page_token??null}:{...r().byFolder[e]?.pageTokens??{1:null},[t+1]:n.next_page_token??null},loaded:!0,loading:!1,refreshing:!1}}})}catch(a){if(l!==gS)return;X(a,{operation:n.silent?`mail_refresh_folder`:`mail_load_folder`,metadata:{folder:e,page:t}}),i({byFolder:{...r().byFolder,[e]:{...c,loading:!1,refreshing:!1,loaded:!0}}}),n.silent||i({error:Kb(a,H.t(`errors.fetch_failed`))})}}const DS=Pb((e,t)=>({byFolder:{},messageMap:{},threadMap:{},labels:[],labelsLoaded:!1,customFolders:[],customFoldersLoaded:!1,folderCounts:{},folderCountsLoaded:!1,currentFolder:`inbox`,selectedMessageId:null,searchQuery:``,chatPanelOpen:!1,compose:null,loadingDetail:!1,sending:!1,savingDraft:!1,error:null,provider:sbe(),groupByDate:lbe(),staleWhileHidden:!1,setProvider:n=>{t().provider!==n&&(SS(),cbe(n),e({provider:n,byFolder:{},messageMap:{},threadMap:{},labels:[],labelsLoaded:!1,customFolders:[],customFoldersLoaded:!1,folderCounts:{},folderCountsLoaded:!1,selectedMessageId:null,searchQuery:``,error:null,staleWhileHidden:!1}))},setGroupByDate:t=>{ube(t),e({groupByDate:t})},setCurrentFolder:t=>e({currentFolder:t}),setSelectedMessageId:t=>e({selectedMessageId:t}),setSearch:t=>e({searchQuery:t}),setChatPanelOpen:t=>e({chatPanelOpen:t}),loadFolder:async(e,n={})=>{let{byFolder:r,searchQuery:i}=t(),a=r[e]??pS;a.loading||a.refreshing||a.loaded&&!n.force&&!i||await ES(e,1)},goToPage:async(e,n)=>{let r=t().byFolder[e]??pS;r.loading||r.refreshing||await ES(e,n)},refreshActive:()=>{let{currentFolder:n,byFolder:r}=t(),i=r[n];e({staleWhileHidden:!1}),i?.loaded&&(i.loading||i.refreshing||(xS=Date.now(),ES(n,i.page,{silent:!0}),t().loadFolderCounts()))},handleMailboxChanged:n=>{if(n.metadata?.provider===t().provider){if(document.visibilityState!==`visible`){e({staleWhileHidden:!0});return}bS!==null&&clearTimeout(bS),bS=setTimeout(()=>{if(bS=null,Date.now()-xS<nbe)return;let{currentFolder:e,byFolder:n}=t(),r=n[e];if(r&&r.page>1){t().loadFolderCounts();return}t().refreshActive()},tbe)}},selectMessage:async n=>{if(e({selectedMessageId:n}),!n)return;let{messageMap:r,provider:i}=t();r[n],e({loadingDetail:!0});try{let r=mS(await hhe(n,i));e({messageMap:{...t().messageMap,[n]:r},loadingDetail:!1}),r.is_unread&&t().markRead(n),r.thread_id&&!t().threadMap[r.thread_id]&&t().loadThread(r.thread_id)}catch(t){X(t,{operation:`mail_select_message`,metadata:{id:n}}),e({loadingDetail:!1,error:Kb(t,H.t(`errors.fetch_failed`))})}},loadThread:async n=>{let{provider:r,threadMap:i}=t();if(!i[n])try{let i=(await The(n,r)).messages.map(mS);e({threadMap:{...t().threadMap,[n]:i},messageMap:i.reduce((e,t)=>({...e,[t.id]:t}),{...t().messageMap})})}catch{}},markRead:async n=>{let{messageMap:r,provider:i}=t(),a=r[n];if(!(!a||!a.is_unread)){vS(n),e({messageMap:{...r,[n]:{...a,is_unread:!1,label_ids:a.label_ids.filter(e=>e!==`UNREAD`)}}});try{await Phe(n,i)}catch{yS(n),e({messageMap:{...t().messageMap,[n]:a}})}}},markUnread:async n=>{let{messageMap:r,provider:i}=t(),a=r[n];if(a){vS(n),e({messageMap:{...r,[n]:{...a,is_unread:!0,label_ids:a.label_ids.includes(`UNREAD`)?a.label_ids:[...a.label_ids,`UNREAD`]}}});try{await Fhe(n,i)}catch{yS(n),e({messageMap:{...t().messageMap,[n]:a}})}}},star:async n=>{let{messageMap:r,provider:i}=t(),a=r[n];if(a){vS(n),e({messageMap:{...r,[n]:{...a,is_starred:!0,label_ids:a.label_ids.includes(`STARRED`)?a.label_ids:[...a.label_ids,`STARRED`]}}});try{await Ihe(n,i)}catch{yS(n),e({messageMap:{...t().messageMap,[n]:a}}),G.error(H.t(`toasts.mail.mark_failed`))}}},unstar:async n=>{let{messageMap:r,provider:i}=t(),a=r[n];if(a){vS(n),e({messageMap:{...r,[n]:{...a,is_starred:!1,label_ids:a.label_ids.filter(e=>e!==`STARRED`)}}});try{await Lhe(n,i)}catch{yS(n),e({messageMap:{...t().messageMap,[n]:a}}),G.error(H.t(`toasts.mail.mark_failed`))}}},archive:async n=>{let{byFolder:r,messageMap:i,provider:a,currentFolder:o}=t();if(!i[n])return;let s=r[o],c=s?.ids??[];vS(n),e({byFolder:s?{...r,[o]:{...s,ids:c.filter(e=>e!==n)}}:r,selectedMessageId:t().selectedMessageId===n?null:t().selectedMessageId});try{await vhe(n,a)}catch{yS(n),e({byFolder:s?{...t().byFolder,[o]:{...s,ids:c}}:t().byFolder}),G.error(H.t(`toasts.mail.archive_failed`))}},trash:async n=>{let{byFolder:r,messageMap:i,provider:a,currentFolder:o}=t();if(!i[n])return;let s=r[o],c=s?.ids??[];vS(n),e({byFolder:s?{...r,[o]:{...s,ids:c.filter(e=>e!==n)}}:r,selectedMessageId:t().selectedMessageId===n?null:t().selectedMessageId});try{await yhe(n,a)}catch{yS(n),e({byFolder:s?{...t().byFolder,[o]:{...s,ids:c}}:t().byFolder}),G.error(H.t(`toasts.mail.delete_failed`))}},unarchive:async(n,r,i)=>{let{byFolder:a,messageMap:o,provider:s,currentFolder:c}=t(),l=r??c,u=a[l],d=o[n];if(u&&d&&!u.ids.includes(n)){let t=[...u.ids],r=i!==void 0&&i>=0?Math.min(i,t.length):0;t.splice(r,0,n),vS(n),e({byFolder:{...a,[l]:{...u,ids:t}}})}try{await rx(n,s)}catch{yS(n);let r=t().byFolder[l];
183r&&e({byFolder:{...t().byFolder,[l]:{...r,ids:r.ids.filter(e=>e!==n)}}}),G.error(H.t(`toasts.mail.undo_failed`))}},untrash:async(n,r,i)=>{let{byFolder:a,messageMap:o,provider:s,currentFolder:c}=t(),l=r??c,u=a[l],d=o[n];if(u&&d&&!u.ids.includes(n)){let t=[...u.ids],r=i!==void 0&&i>=0?Math.min(i,t.length):0;t.splice(r,0,n),vS(n),e({byFolder:{...a,[l]:{...u,ids:t}}})}try{await bhe(n,s)}catch{yS(n);let r=t().byFolder[l];r&&e({byFolder:{...t().byFolder,[l]:{...r,ids:r.ids.filter(e=>e!==n)}}}),G.error(H.t(`toasts.mail.undo_failed`))}},applyLabels:async(n,r)=>{let{messageMap:i,provider:a}=t(),o=i[n];if(!o)return;let s=new Set(o.label_ids);(r.add??[]).forEach(e=>s.add(e)),(r.remove??[]).forEach(e=>s.delete(e)),vS(n),e({messageMap:{...i,[n]:{...o,label_ids:Array.from(s),is_unread:s.has(`UNREAD`),is_starred:s.has(`STARRED`)}}});try{await Rhe(n,a,{add_label_ids:r.add,remove_label_ids:r.remove})}catch{yS(n),e({messageMap:{...t().messageMap,[n]:o}}),G.error(H.t(`toasts.mail.mark_failed`))}},downloadAttachment:async(e,n,r)=>{let{provider:i}=t();try{await sge(e,n,i,r)}catch(t){Y(t,H.t(`toasts.mail.attachment_download_failed`),{operation:`mail_download_attachment`,metadata:{messageId:e,attachmentId:n}})}},openAttachment:async(e,n,r,i)=>{let{provider:a}=t();try{await cge(e,n,a,r,i)}catch(t){Y(t,H.t(`toasts.mail.attachment_open_failed`),{operation:`mail_open_attachment`,metadata:{messageId:e,attachmentId:n}})}},saveAttachmentToKb:async(e,n,r)=>{let{provider:i}=t();try{return await Che(e,n,i,r),G.success(H.t(`toasts.mail.attachment_saved_to_kb`)),!0}catch(t){return Y(t,H.t(`toasts.mail.attachment_save_failed`),{operation:`mail_save_attachment_to_kb`,metadata:{messageId:e,attachmentId:n}}),!1}},loadLabels:async()=>{if(!t().labelsLoaded){if(!lS[t().provider].supportsLabels){e({labels:[],labelsLoaded:!0});return}try{e({labels:(await Dhe(t().provider)).labels,labelsLoaded:!0})}catch{e({labelsLoaded:!0})}}},loadCustomFolders:async()=>{if(!t().customFoldersLoaded){if(!lS[t().provider].supportsCustomFolders){e({customFolders:[],customFoldersLoaded:!0});return}try{e({customFolders:(await Nhe(t().provider)).folders,customFoldersLoaded:!0})}catch{e({customFoldersLoaded:!0})}}},loadFolderCounts:async()=>{try{let n=await Mhe(t().provider),{byFolder:r,provider:i,searchQuery:a,customFolders:o}=t(),s={...r};for(let e of Object.keys(s)){let t=s[e];t.loaded&&(s[e]={...t,totalPages:hS(e,i,n.counts,a,o)})}e({folderCounts:n.counts,folderCountsLoaded:!0,byFolder:s})}catch{e({folderCountsLoaded:!0})}},openCompose:(t,n)=>{let r={...Zye,...n};r.body=Rye(r.body??``,Lye()),e({compose:{open:!0,mode:t,payload:r}})},closeCompose:()=>e({compose:null}),updateComposePayload:t=>e(e=>e.compose?{compose:{...e.compose,payload:{...e.compose.payload,...t}}}:{}),saveDraft:async()=>{let{compose:n,provider:r}=t();if(!n||!Yye(r))return;let{payload:i,mode:a}=n;if(!(!i.to&&!i.subject&&!i.body)){e({savingDraft:!0});try{let t=await xhe({message_id:i.in_reply_to_id??``,thread_id:i.thread_id??null,to:i.to,cc:i.cc||void 0,bcc:i.bcc||void 0,subject:i.subject,body:i.body},r);e({savingDraft:!1,compose:{...n,mode:a,payload:{...i,draft_id:t.draft_id??null}}}),G.success(H.t(`toasts.mail.draft_saved`))}catch(t){if(e({savingDraft:!1}),Bb(t)){Xx.getState().markNotAvailable();return}Y(t,H.t(`toasts.mail.draft_save_failed`),{operation:`mail_save_draft`})}}},sendMessage:async()=>{let{compose:n,provider:r}=t();if(!n)return;let{payload:i,mode:a}=n;if(!i.to.trim()){G.error(H.t(`mail.compose_view.recipient_required`));return}e({sending:!0});try{(a===`reply`||a===`reply_all`)&&i.in_reply_to_id?await _he({message_id:i.in_reply_to_id,thread_id:i.thread_id??null,to:i.to,cc:i.cc||void 0,bcc:i.bcc||void 0,subject:i.subject,body:i.body},r):await zhe({to:i.to,cc:i.cc||void 0,bcc:i.bcc||void 0,subject:i.subject,body:i.body},r),e({sending:!1,compose:null}),G.success(H.t(`toasts.common.sent`)),t().loadFolder(`sent`,{force:!0}),t().loadFolderCounts()}catch(t){e({sending:!1}),Bb(t)&&Xx.getState().markNotAvailable(),Y(t,H.t(`toasts.common.send_failed`),{operation:`mail_send_message`})}},reset:()=>{SS(),e({byFolder:{},messageMap:{},threadMap:{},labels:[],labelsLoaded:!1,customFolders:[],customFoldersLoaded:!1,folderCounts:{},folderCountsLoaded:!1,selectedMessageId:null,searchQuery:``,chatPanelOpen:!1,compose:null,error:null,staleWhileHidden:!1})}}));var dbe=12e4,OS,kS=null;function AS(){kS&&=(clearTimeout(kS),null)}var fbe=400,pbe=5e3,jS=null,MS=0;function mbe(){AS(),jS&&=(clearTimeout(jS),null),MS=0,OS!==void 0&&(G.dismiss(OS),OS=void 0)}function hbe(){Ux.getState().loadTasks();let e=Yx.getState();e.fetchMatters();let t=e.selectedMatterId;
183t&&(e.loadEmailTasks(t),e.loadMatterThreads(t)),DS.getState().refreshActive()}const NS=Pb((e,t)=>({syncing:!1,refreshNonce:0,startSync:async()=>{if(!t().syncing){e({syncing:!0}),OS=G.loading(H.t(`topbar.sync.syncing`)),AS(),kS=setTimeout(()=>{kS=null,t().syncing&&(e({syncing:!1}),OS!==void 0&&(G.message(H.t(`topbar.sync.taking_longer`),{id:OS}),OS=void 0))},dbe);try{await S_e()}catch(t){AS(),e({syncing:!1}),OS!==void 0&&(G.dismiss(OS),OS=void 0),Y(t,H.t(`topbar.sync.start_failed`),{operation:`manual_sync`})}}},finishSync:t=>{AS(),e(e=>({syncing:!1,refreshNonce:e.refreshNonce+1}));let n=typeof t?.total_new_emails==`number`?t.total_new_emails:0;if(OS!==void 0){let e=n>0?H.t(`topbar.sync.complete_with_email`,{count:n}):H.t(`topbar.sync.complete`);G.success(e,{id:OS}),OS=void 0}hbe()},handleDashboardChanged:()=>{document.visibilityState===`visible`&&(jS!==null&&clearTimeout(jS),jS=setTimeout(()=>{jS=null,!(Date.now()-MS<pbe)&&(MS=Date.now(),e(e=>({refreshNonce:e.refreshNonce+1})))},fbe))}})),PS=Pb(e=>({active:!1,threadKey:null,emailProvider:null,pendingAutoStart:null,freshStartThreadKey:null,activate:({threadKey:t,emailProvider:n,freshStart:r})=>e(e=>({active:!0,threadKey:t,emailProvider:n,pendingAutoStart:null,freshStartThreadKey:r?t:e.freshStartThreadKey})),deactivate:()=>e({active:!1,threadKey:null,emailProvider:null,pendingAutoStart:null,freshStartThreadKey:null}),requestAutoStart:t=>e({pendingAutoStart:t}),clearFreshStart:()=>e({freshStartThreadKey:null})}));var gbe=new Set([`draft_reply`,`send_email`]),_be=2e5,vbe=7e3;function ybe(e){if(e.length===0)return null;let t=0;for(let n of e)t+=(n.content?.length??0)/4;let n=(vbe+t)/_be*100;return{history_messages_included:e.length,history_messages_dropped:0,budget_used_pct:Math.round(Math.min(n,100)*10)/10}}var bbe=8;function FS(e,t,n,r){let i={isLoading:!1,isStreaming:!1,streamingMessageId:null,abortController:null,streamingToolActivities:[],error:n,...r?.usageLimitReached===void 0?{}:{usageLimitReached:r.usageLimitReached}};if(t.realMessageId===t.tempAssistantId){ux(t.conversationId,t.content),e({...i,messages:t.snapshotMessages});return}if(t.accumulatedContent){e(e=>({...i,messages:e.messages.map(e=>e.id===t.realMessageId?{...e,interrupted:!0}:e)}));return}e(e=>({...i,messages:e.messages.filter(e=>e.id!==t.realMessageId)}))}var IS=0;const LS=Pb((e,t)=>({conversationId:null,messages:[],conversations:[],personaOverrides:{},current_conversation:null,isLoading:!1,isLoadingConversations:!1,hasMoreMessages:!1,totalMessages:0,isLoadingOlderMessages:!1,conversationsPage:1,hasMoreConversations:!1,isLoadingMoreConversations:!1,conversationsTotal:0,conversationSearchResults:[],isSearchingConversations:!1,isStreaming:!1,streamingMessageId:null,abortController:null,error:null,attachedDocuments:[],pinnedDocuments:[],pastedImages:[],contextBudget:null,contextLimit:null,softLimitDismissedAtPct:null,usageLimitReached:!1,streamingToolActivities:[],pendingToolUse:null,pendingCalendarToolUse:null,emailToolsProvider:null,emailToolsAccountId:null,emailScopeExplicit:!1,pendingProviderPick:null,matterScope:null,sendMessage:async(n,r)=>{let{conversationId:i,messages:a}=t(),o={id:`temp-${Date.now()}`,conversation_id:i||``,role:`user`,content:n,created_at:new Date().toISOString()};e({messages:[...a,o],isLoading:!0,error:null});try{let a=r?.org_profile_id??t().resolvePersonaIdForSend(),s=(await Vpe({content:n,conversation_id:i||void 0,document_ids:r?.document_ids,knowledge_base_id:r?.knowledge_base_id,matter_id:r?.matter_id??t().matterScope?.id,model_tier:r?.model_tier,model_choice:r?.model_choice,org_profile_id:a??void 0})).data,c={id:s.message_id,conversation_id:s.conversation_id,role:`assistant`,content:s.content,citations:s.citations,tokens_input:s.tokens_input,tokens_output:s.tokens_output,created_at:s.created_at},l={...o,conversation_id:s.conversation_id};e(e=>{let{new:t,...n}=e.personaOverrides,r=e.current_conversation?{...e.current_conversation,org_profile_id:a}:i?e.current_conversation:{id:s.conversation_id,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),org_profile_id:a};return{conversationId:s.conversation_id,personaOverrides:n,current_conversation:r,messages:[...e.messages.slice(0,-1).map(e=>e.id===o.id?l:e),l,c],isLoading:!1}}),i||t().loadConversations()}catch(t){X(t,{operation:`send_message`,metadata:{conversationId:i}}),e({isLoading:!1,error:Kb(t,H.t(`errors.send_message_failed`)),messages:a})}},sendMessageStreamAction:async(n,r)=>{let{conversationId:i,messages:a}=t(),o=r?.org_profile_id??t().resolvePersonaIdForSend(),s;try{let e=Ex.getState();s=e.isRedlineMode?e.documentId??void 0:void 0}catch(e){X(e,{operation:`redline_inject_check`,metadata:{conversationId:i}})}let c=!1,l=null;try{let e=PS.getState();c=e.active,l=e.emailProvider}catch(e){X(e,{operation:`mail_chat_inject_check`,metadata:{conversationId:i}})}let u={...r,org_profile_id:o??void 0,...s?{redline_document_id:s}:{}},d=u.images??[],f=u.pinCandidates??[],p=u.continueLastUserTurn??!1,m={id:`temp-user-${Date.now()}`,conversation_id:i||``,role:`user`,content:n,created_at:new Date().toISOString(),...d.length>0?{attachments:d.map(e=>({type:`image`,media_type:e.media_type,url:e.dataUrl}))}:{}},h={id:`temp-assistant-${Date.now()}`,conversation_id:i||``,role:`assistant`,content:``,citations:[],created_at:new Date().toISOString()},g=new AbortController;e({messages:p?[...a,h]:[...a,m,h],isLoading:!0,isStreaming:!0,streamingMessageId:h.id,abortController:g,error:null,streamingToolActivities:[],pendingToolUse:null,pendingCalendarToolUse:null});let _=h.id,v=``,y=!1,b=!1,x=()=>({snapshotMessages:a,tempAssistantId:h.id,realMessageId:_,accumulatedContent:v,conversationId:i,content:n});try{let{emailToolsProvider:r,emailToolsAccountId:a,emailScopeExplicit:s,matterScope:S}=t();await Hhe({content:p?``:n,conversation_id:i||void 0,document_ids:u.document_ids,inject_document_ids:u.inject_document_ids,knowledge_base_id:u.knowledge_base_id,matter_id:u.matter_id??S?.id,model_tier:u.model_tier,model_choice:u.model_choice,thinking_level:u.thinking_level,org_profile_id:u.org_profile_id,redline_document_id:u.redline_document_id,chat_mode:u.chat_mode||`chat`,email_tools_provider:c?l:u.email_tools_provider??r,email_tools_account_id:c?null:a,offer_email_picker:!c,inbox_scope:!c&&s,...p?{continue_last_user_turn:!0}:{},...d.length>0?{images:d.map(e=>({media_type:e.media_type,data:e.data}))}:{}},{onStart:t=>{if(_=t.message_id,e(e=>({conversationId:t.conversation_id,...f.length>0?{pinnedDocuments:[...e.pinnedDocuments,...f.filter(t=>!e.pinnedDocuments.some(e=>e.id===t.id))]}:{},messages:e.messages.map(e=>e.id===m.id?{...e,conversation_id:t.conversation_id}:e.id===h.id?{...e,id:t.message_id,conversation_id:t.conversation_id,citations:t.citations}:e),streamingMessageId:t.message_id,personaOverrides:(()=>{let{new:t,...n}=e.personaOverrides;return n})(),current_conversation:i?e.current_conversation?{...e.current_conversation,org_profile_id:o}:e.current_conversation:{id:t.conversation_id,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),org_profile_id:o}})),!i&&S){let e=S.id,n=t.conversation_id;(async()=>{try{let{useMatterStore:t}=await ev(async()=>{let{useMatterStore:e}=await import(`./matterStore-BWWNAie2.js`);return{useMatterStore:e}},[]);await t.getState().addConversation(e,n)}catch(t){X(t,{operation:`matter_link_new_conversation`,metadata:{matterId:e,conversationId:n}})}})()}},onDelta:t=>{v+=t,e(e=>({messages:e.messages.map(e=>e.id===_||e.id===h.id?{...e,content:v}:e)}))},onStreamRestart:()=>{v=``,e(e=>({messages:e.messages.map(e=>e.id===_||e.id===h.id?{...e,content:``}:e)}))},onDone:n=>{b&&Ex.getState().setSuggestionStreamStatus(`done`);let r=t().streamingToolActivities,a=n.context_budget??null,o=t().softLimitDismissedAtPct,s=!!a&&a.over_threshold&&(o===null||a.budget_used_pct>=o+10),c=a&&s?{hard:!1,usedPct:a.budget_used_pct,thresholdPct:a.threshold_pct??a.budget_used_pct}:null;e(e=>({messages:y?e.messages.filter(e=>e.id!==_):e.messages.map(e=>e.id===_?{...e,tokens_input:n.tokens_input,tokens_output:n.tokens_output,toolActivities:r.length>0?r:void 0}:e),isLoading:!1,isStreaming:!1,streamingMessageId:null,abortController:null,contextBudget:a,contextLimit:c,streamingToolActivities:[]})),i||t().loadConversations()},onWebCitations:t=>{e(e=>({messages:e.messages.map(e=>e.id===_||e.id===h.id?{...e,web_citations:t.citations}:e)}))},onToolCall:t=>{let n={id:t.id,name:t.name,input:t.input,status:`pending`};e(e=>({streamingToolActivities:[...e.streamingToolActivities,n]}))},onToolResult:t=>{e(e=>({streamingToolActivities:e.streamingToolActivities.map(e=>e.id===t.id?{...e,result:t.result,status:`done`}:e)}))},onToolUse:t=>{if(t.name===`suggest_redline_changes`&&Array.isArray(t.input.suggestions)){let e=Ex.getState();if(t.suggestion_persist_error){let e=Ub(t.suggestion_persist_error,{operation:`chat_redline_persist`})??H.t(`toasts.redline.suggestion_save_failed`);G.error(e);return}
183e.documentId&&t.batch_id&&(b=!0,e.setSuggestionStreamStatus(`streaming`),e.appendSuggestionBatch(e.documentId,t.batch_id))}else t.name===`select_email_provider`?(y=!0,e({pendingProviderPick:{reason:typeof t.input.reason==`string`?t.input.reason:void 0,source:`tool`}})):Dge.has(t.name)?e({pendingCalendarToolUse:t}):gbe.has(t.name)?e({pendingToolUse:t}):X(Error(`unexpected tool_use frame: ${t.name}`),{operation:`chat_unexpected_tool_use`,metadata:{toolName:t.name}})},onTitle:t=>{e(e=>({conversations:e.conversations.map(e=>e.id===t.conversation_id?{...e,title:t.title}:e),current_conversation:e.current_conversation?.id===t.conversation_id?{...e.current_conversation,title:t.title}:e.current_conversation}))},onError:t=>{if(b&&Ex.getState().setSuggestionStreamStatus(`done`),t.startsWith(`context_limit:`)){let n=100,r=100,i=H.t(`chat.context_limit.hard_message`);try{let e=JSON.parse(t.slice(14));typeof e.used_pct==`number`&&(n=e.used_pct),typeof e.threshold_pct==`number`&&(r=e.threshold_pct),typeof e.message==`string`&&e.message&&(i=e.message)}catch{}e({contextLimit:{hard:!0,usedPct:n,thresholdPct:r}}),FS(e,x(),i);return}let n=t.startsWith(`usage_limit:`),r=n?t.replace(`usage_limit:`,``):t;n||X(Error(r),{operation:`send_message_stream`,metadata:{conversationId:i},fingerprint:[`chat-stream-error`]}),FS(e,x(),r,{usageLimitReached:n})},onInterrupted:t=>{b&&Ex.getState().setSuggestionStreamStatus(`done`),X(Error(`chat stream interrupted: ${t}`),{operation:`send_message_stream`,metadata:{conversationId:i,reason:t,hadPartialContent:v.length>0},fingerprint:[`chat-stream-interrupted`]}),FS(e,x(),H.t(`chat.stream_interrupted`))}},g.signal)}catch(t){X(t,{operation:`send_message_stream`,metadata:{conversationId:i}}),FS(e,x(),Kb(t,H.t(`errors.send_message_failed`)))}},cancelStream:()=>{let{abortController:n,streamingMessageId:r}=t();n&&(n.abort(),e(e=>({isLoading:!1,isStreaming:!1,streamingMessageId:null,abortController:null,messages:e.messages.map(e=>e.id===r&&e.content?{...e,interrupted:!0}:e)})))},setPersonaForConversation:n=>{let r=gge(t().conversationId);e(e=>({personaOverrides:{...e.personaOverrides,[r]:n},current_conversation:e.conversationId&&e.current_conversation?{...e.current_conversation,org_profile_id:n}:e.current_conversation}))},resolvePersonaIdForSend:()=>_ge({conversationId:t().conversationId,overrides:t().personaOverrides,conversationPersonaId:t().current_conversation?.org_profile_id,personas:Q.getState().personas}),loadConversation:async n=>{e({isLoading:!0,error:null});try{let r=(await Qpe(n)).data,i=r.messages||[],a=t().matterScope;e({conversationId:r.id,current_conversation:r,matterScope:r.matter_id?{id:r.matter_id,name:a?.id===r.matter_id?a.name:``}:null,messages:i,hasMoreMessages:r.has_more_messages??!1,totalMessages:r.total_messages??i.length,isLoadingOlderMessages:!1,pinnedDocuments:(r.attached_documents??[]).map(e=>({id:e.id,filename:e.filename})),isLoading:!1,contextBudget:ybe(i),contextLimit:null,softLimitDismissedAtPct:null})}catch(t){X(t,{operation:`load_conversation`,metadata:{id:n},expectedNotFound:!0}),e({isLoading:!1,error:Kb(t,H.t(`errors.fetch_failed`))})}},loadOlderMessages:async()=>{let{conversationId:n,messages:r,hasMoreMessages:i,isLoadingOlderMessages:a,isStreaming:o,isLoading:s}=t();if(!n||!i||a||o||s)return;let c=r.find(e=>!e.id.startsWith(`temp-`));if(c){e({isLoadingOlderMessages:!0});try{let r=(await ime(n,{before:c.id})).data,i=t();if(i.conversationId!==n||i.isStreaming||i.isLoading)return;let a=r.items??[];e(e=>{let t=new Set(e.messages.map(e=>e.id));return{messages:[...a.filter(e=>!t.has(e.id)),...e.messages],hasMoreMessages:r.has_more??!1}})}catch(e){X(e,{operation:`load_older_messages`,metadata:{conversationId:n}})}finally{e({isLoadingOlderMessages:!1})}}},loadConversations:async()=>{e({isLoadingConversations:!0});try{let t=(await $b({page:1,per_page:50})).data;e({conversations:t.items,conversationsPage:1,hasMoreConversations:t.page<t.total_pages,conversationsTotal:t.total,isLoadingConversations:!1})}catch(t){X(t,{operation:`load_conversations`}),e({isLoadingConversations:!1,error:Kb(t,H.t(`errors.fetch_failed`))})}}
183,loadMoreConversations:async()=>{let{hasMoreConversations:n,isLoadingMoreConversations:r,isLoadingConversations:i,conversationsPage:a}=t();if(!(!n||r||i)){e({isLoadingMoreConversations:!0});try{let t=a+1,n=(await $b({page:t,per_page:50})).data;e(e=>{let r=new Set(e.conversations.map(e=>e.id));return{conversations:[...e.conversations,...n.items.filter(e=>!r.has(e.id))],conversationsPage:t,hasMoreConversations:n.page<n.total_pages,conversationsTotal:n.total}})}catch(e){X(e,{operation:`load_more_conversations`})}finally{e({isLoadingMoreConversations:!1})}}},searchConversations:async n=>{let r=n.trim();if(!r){t().clearConversationSearch();return}let i=++IS;e({isSearchingConversations:!0});try{let t=(await $b({q:r,page:1,per_page:50})).data;i===IS&&e({conversationSearchResults:t.items,isSearchingConversations:!1})}catch(t){i===IS&&(X(t,{operation:`search_conversations`}),e({isSearchingConversations:!1}))}},clearConversationSearch:()=>{IS++,e({conversationSearchResults:[],isSearchingConversations:!1})},startNewConversation:()=>{e(e=>{let{new:t,...n}=e.personaOverrides;return{conversationId:null,messages:[],personaOverrides:n,current_conversation:null,hasMoreMessages:!1,totalMessages:0,isLoadingOlderMessages:!1,error:null,attachedDocuments:[],pinnedDocuments:[],pastedImages:[],contextBudget:null,contextLimit:null,softLimitDismissedAtPct:null}})},setConversationId:t=>{e({conversationId:t})},setMatterScope:t=>{e({matterScope:t})},deleteConversation:async n=>{try{await eme(n);
183let{conversationId:r,conversations:i}=t();e({conversations:i.filter(e=>e.id!==n)}),r===n&&t().startNewConversation()}catch(t){X(t,{operation:`delete_conversation`,metadata:{id:n}}),e({error:Kb(t,H.t(`toasts.chat.conversation_delete_failed`))})}},renameConversation:async(t,n)=>{try{let r=(await nme(t,{title:n})).data;e(e=>({conversations:e.conversations.map(e=>e.id===t?{...e,title:r.title}:e),current_conversation:e.current_conversation?.id===t?{...e.current_conversation,title:r.title}:e.current_conversation}))}catch(n){X(n,{operation:`rename_conversation`,metadata:{id:t}}),e({error:Kb(n,H.t(`errors.save_failed`))})}},clearError:()=>{e({error:null,usageLimitReached:!1})},attachDocument:t=>{e(e=>e.attachedDocuments.some(e=>e.id===t.id)?e:{attachedDocuments:[...e.attachedDocuments,t]})},detachDocument:t=>{e(e=>({attachedDocuments:e.attachedDocuments.filter(e=>e.id!==t)}))},clearAttachments:()=>e({attachedDocuments:[]}),setPinnedDocuments:t=>e({pinnedDocuments:t}),unpinDocument:async n=>{let{conversationId:r,pinnedDocuments:i}=t(),a=i;if(e({pinnedDocuments:a.filter(e=>e.id!==n)}),r)try{await ome(r,n)}catch(t){e({pinnedDocuments:a}),Y(t,H.t(`toasts.chat.unpin_failed`),{operation:`unpin_conversation_document`,metadata:{conversationId:r,documentId:n}})}},dismissContextLimit:()=>e(e=>({contextLimit:null,softLimitDismissedAtPct:e.contextLimit&&!e.contextLimit.hard?e.contextLimit.usedPct:e.softLimitDismissedAtPct})),compactConversation:async()=>{let{conversationId:n}=t();if(!n)return;let r=Q.getState().modelTier;try{let t=(await cme(n,{model_tier:r})).data;e({contextLimit:null,contextBudget:t,softLimitDismissedAtPct:null,error:null}),G.success(H.t(`chat.context_limit.compacted`))}catch(e){Y(e,H.t(`chat.context_limit.compact_failed`),{operation:`compact_conversation`,metadata:{conversationId:n}})}},startFreshWithRecap:async()=>{let{conversationId:n,pinnedDocuments:r}=t();if(!n){e({contextLimit:null});return}let i=[...r],a=``;try{a=(await ume(n)).data.recap??``}catch(e){Y(e,H.t(`chat.context_limit.recap_failed`),{operation:`recap_conversation`,metadata:{conversationId:n}});return}t().startNewConversation();for(let e of i)t().attachDocument(e);ux(null,a),e({error:null})},attachImage:t=>{e(e=>e.pastedImages.length>=bbe||e.pastedImages.some(e=>e.id===t.id)?e:{pastedImages:[...e.pastedImages,t]})},removeImage:t=>{e(e=>({pastedImages:e.pastedImages.filter(e=>e.id!==t)}))},clearImages:()=>e({pastedImages:[]}),chooseEmailProvider:(n,r,i)=>{if(e(e=>{let t=e.messages.slice(),a=t[t.length-1];return a&&a.role===`assistant`&&!a.content&&!a.toolActivities?.length&&t.pop(),{emailToolsProvider:n,emailToolsAccountId:r,emailScopeExplicit:i===`manual`,pendingProviderPick:null,messages:t}}),i===`manual`){Q.getState().setSelectedKnowledgeBase(null),G.success(H.t(`chat.email_picker.active`,{provider:dS(n,r)??H.t(lS[n].labelKey)}));return}let a=Q.getState();t().sendMessageStreamAction(``,{continueLastUserTurn:!0,model_tier:a.modelTier,model_choice:a.selectedChatModel||void 0,thinking_level:a.selectedThinkingLevel||void 0,knowledge_base_id:a.selectedKnowledgeBase?.id,chat_mode:a.chatMode})},clearEmailScope:()=>e({emailToolsProvider:null,emailToolsAccountId:null,emailScopeExplicit:!1}),clearPendingToolUse:()=>e({pendingToolUse:null}),setMessageFlagRating:(t,n)=>{e(e=>({messages:e.messages.map(e=>e.id===t?{...e,flag_rating:n}:e)}))},executeConfirmedTool:async()=>{let{pendingToolUse:n,emailToolsProvider:r,emailToolsAccountId:i}=t();if(n){e({pendingToolUse:null});try{let t=await tge(n.name,n.input,r,i);t.is_error?G.error(`${n.name} failed: ${t.content.slice(0,120)}`):G.success(t.content.split(` 184`)[0]||`${n.name} succeeded`),e(e=>{let r=e.messages.slice();for(let e=r.length-1;e>=0;e--)if(r[e].role===`assistant`){let i=r[e].toolActivities??[];r[e]={...r[e],toolActivities:[...i,{id:n.id,name:n.name,input:n.input,status:`done`,result:{content:t.content,is_error:t.is_error}}]};break}return{messages:r}})}catch(e){Y(e,H.t(`errors.generic`),{operation:`execute_confirmed_tool`,metadata:{toolName:n.name}})}}},clearPendingCalendarToolUse:()=>e({pendingCalendarToolUse:null}),executeConfirmedCalendarTool:async n=>{let{pendingCalendarToolUse:r}=t();if(!r)return;e({pendingCalendarToolUse:null});let{name:i,id:a,input:o}=r;try{let t=await Fge(i,o,n);G.success(t),e(e=>{let n=e.messages.slice();for(let e=n.length-1;e>=0;e--)if(n[e].role===`assistant`){let r=n[e].toolActivities??[];n[e]={...n[e],toolActivities:[...r,{id:a,name:i,input:o,status:`done`,result:{content:t,is_error:!1}}]};break}return{messages:n}}),NS.getState().handleDashboardChanged()}catch(e){Y(e,H.t(`errors.generic`),{operation:`execute_calendar_tool`,metadata:{toolName:i}})}}})),xbe=()=>{let{t:e}=V(),{attachedDocuments:t,detachDocument:n}=LS();return t.length===0?null:(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5 px-3 pt-2`,children:t.map(t=>(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 bg-muted rounded-full px-2.5 py-0.5 text-xs`,children:[(0,K.jsx)(i_,{className:`h-3 w-3 shrink-0`}),(0,K.jsx)(`button`,{type:`button`,className:`truncate max-w-[120px] hover:underline`,title:e(`chat.open_document`),onClick:()=>Q.getState().viewDocumentInKB(t.id,t.filename),children:t.filename}),(0,K.jsx)(`button`,{type:`button`,className:`shrink-0 hover:text-destructive`,"aria-label":e(`chat.detach_document`),title:e(`chat.detach_document`),onClick:()=>n(t.id),children:(0,K.jsx)(J_,{className:`h-3 w-3`})})]},t.id))})},Sbe=()=>{let{t:e}=V(),t=LS(e=>e.pinnedDocuments),n=LS(e=>e.unpinDocument),r=LS(e=>e.emailToolsProvider),i=LS(e=>e.emailToolsAccountId),a=r&&tS(r)?r:null;return t.length===0&&!a?null:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-3 pt-2`,children:[(0,K.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[e(`chat.discu
184ssing`),`:`]}),t.map(t=>(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-primary/10 px-2.5 py-0.5 text-xs text-primary`,children:[(0,K.jsx)(i_,{className:`h-3 w-3 shrink-0`}),(0,K.jsx)(`button`,{type:`button`,className:`max-w-[140px] truncate hover:underline`,title:e(`chat.open_document`),onClick:()=>Q.getState().viewDocumentInKB(t.id,t.filename),children:t.filename}),(0,K.jsx)(`button`,{type:`button`,className:`shrink-0 hover:text-destructive`,"aria-label":e(`chat.unpin_document`),title:e(`chat.unpin_document`),onClick:()=>void n(t.id),children:(0,K.jsx)(J_,{className:`h-3 w-3`})})]},t.id)),a&&(0,K.jsx)(Cbe,{provider:a,accountId:i})]})};function Cbe({provider:e,accountId:t}){let{t:n}=V(),r=lS[e],i=r.icon,a=dS(e,t);return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-primary/10 px-2.5 py-0.5 text-xs text-primary`,children:[(0,K.jsx)(i,{className:`h-3 w-3 shrink-0`}),(0,K.jsx)(`button`,{type:`button`,className:`max-w-[180px] truncate hover:underline`,title:n(`chat.email_picker.switch`),onClick:()=>LS.setState({pendingProviderPick:{source:`manual`}}),children:a??n(r.labelKey)}),(0,K.jsx)(`button`,{type:`button`,className:`shrink-0 hover:text-destructive`,"aria-label":n(`chat.email_picker.clear`),title:n(`chat.email_picker.clear`),onClick:()=>LS.getState().clearEmailScope(),children:(0,K.jsx)(J_,{className:`h-3 w-3`})})]})}const wbe=()=>{let{pastedImages:e,removeImage:t}=LS();return e.length===0?null:(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2 px-3 pt-2`,children:e.map(e=>(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(`img`,{src:e.dataUrl,alt:``,className:`h-16 w-16 rounded-md border border-border object-cover`}),(0,K.jsx)(`button`,{type:`button`,className:`absolute -right-1.5 -top-1.5 rounded-full border border-border bg-background p-0.5 text-muted-foreground shadow hover:text-destructive`,onClick:()=>t(e.id),"aria-label":`Remove image`,children:(0,K.jsx)(J_,{className:`h-3 w-3`})})]},e.id))})};var Tbe=1568,Ebe=15e5;async function Dbe(e){let t=await createImageBitmap(e);try{let e=t.width,n=t.height,r=Math.max(e,n);if(r>Tbe){let t=Tbe/r;e=Math.max(1,Math.round(e*t)),n=Math.max(1,Math.round(n*t))}let i=document.createElement(`canvas`);i.width=e,i.height=n;let a=i.getContext(`2d`);if(!a)throw Error(`Canvas 2D context unavailable`);a.drawImage(t,0,0,e,n);let o=`image/png`,s=i.toDataURL(`image/png`);s.length>Ebe&&(o=`image/jpeg`,s=i.toDataURL(`image/jpeg`,.85));let c=s.split(`,`,2)[1]??``,l=Math.floor(c.length*3/4);return{dataUrl:s,media_type:o,data:c,size:l}}finally{t.close()}}function RS(){let e=Nx(e=>e.user?.current_org_role);return e===`admin`||e===`member`||e===`viewer`?e:null}var Obe={viewer:0,member:1,admin:2};function zS(e,t){return e?Obe[e]>=Obe[t]:!1}function BS(){let e=RS();return!Nx(e=>e.user?.current_org_id??null)||zS(e,`member`)}function VS(){let e=RS();return!Nx(e=>e.user?.current_org_id??null)||e===`admin`}typeof window<`u`&&window.document&&window.document.createElement;function HS(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function kbe(e,t){let n=B.createContext(t),r=e=>{let{children:t,...r}=e,i=B.useMemo(()=>r,Object.values(r));return(0,K.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=B.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function US(e,t=[]){let n=[];function r(t,r){let i=B.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=B.useMemo(()=>o,Object.values(o));return(0,K.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=B.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>B.createContext(e));return function(n){let r=n?.[e]||t;return B.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Abe(i,...t)]}function Abe(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return B.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var WS=globalThis?.document?B.useLayoutEffect:()=>{},jbe=B.useId||(()=>void 0),Mbe=0;function GS(e){let[t,n]=B.useState(jbe());return WS(()=>{e||n(e=>e??String(Mbe++))},[e]),e||(t?`radix-${t}`:``)}var Nbe=B.useInsertionEffect||WS;function KS({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Pbe({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=B.useRef(e!==void 0);B.useEffect(()=>{let e=t.current;
vendor: 4,704 bytes, line 184
184if(e!==s){let t=e?`controlled`:`uncontrolled`,n=s?`controlled`:`uncontrolled`;console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,r])}return[c,B.useCallback(t=>{if(s){let n=Fbe(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Pbe({defaultProp:e,onChange:t}){let[n,r]=B.useState(e),i=B.useRef(n),a=B.useRef(t);return Nbe(()=>{a.current=t},[t]),B.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Fbe(e){return typeof e==`function`}function Ibe(e){let t=Lbe(e),n=B.forwardRef((e,n)=>{let{children:r,...i}=e,a=B.Children.toArray(r),o=a.find(zbe);if(o){let e=o.props.children,r=a.map(t=>t===o?B.Children.count(e)>1?B.Children.only(null):B.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:B.isValidElement(e)?B.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Lbe(e){let t=B.forwardRef((e,t)=>{let{children:n,...r}=e;if(B.isValidElement(n)){let e=Vbe(n),i=Bbe(r,n.props);return n.type!==B.Fragment&&(i.ref=t?$v(t,e):e),B.cloneElement(n,i)}return B.Children.count(n)>1?B.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Rbe=Symbol(`radix.slottable`);function zbe(e){return B.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Rbe}function Bbe(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(` `))}return{...e,...n}}function Vbe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Hbe=u(v(),1),qS=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ibe(`Primitive.${t}`),r=B.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,K.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ube(e,t){e&&Hbe.flushSync(()=>e.dispatchEvent(t))}function JS(e){let t=B.useRef(e);return B.useEffect(()=>{t.current=e}),B.useMemo(()=>(...e)=>t.current?.(...e),[])}function Wbe(e,t=globalThis?.document){let n=JS(e);B.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Gbe=`DismissableLayer`,YS=`dismissableLayer.update`,Kbe=`dismissableLayer.pointerDownOutside`,qbe=`dismissableLayer.focusOutside`,Jbe,Ybe=B.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),XS=B.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=B.useContext(Ybe),[u,d]=B.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=B.useState({}),m=ey(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Qbe(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=$be(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Wbe(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),B.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Jbe=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),exe(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Jbe)}},[u,f,n,l]),B.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),exe())},[u,l]),B.useEffect(()=>{let e=()=>p({});return document.addEventListener(YS,e),()=>document.removeEventListener(YS,e)},[]),(0,K.jsx)(qS.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:HS(e.onFocusCapture,S.onFocusCapture),onBlurCapture:HS(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:HS(e.onPointerDownCapture,x.onPointerDownCapture)})});XS.displayName=Gbe;var Xbe=`DismissableLayerBranch`,Zbe=B.forwardRef((e,t)=>
vendor: 4,616 bytes, line 184
184{let n=B.useContext(Ybe),r=B.useRef(null),i=ey(t,r);return B.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,K.jsx)(qS.div,{...e,ref:i})});Zbe.displayName=Xbe;function Qbe(e,t=globalThis?.document){let n=JS(e),r=B.useRef(!1),i=B.useRef(()=>{});return B.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){txe(Kbe,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function $be(e,t=globalThis?.document){let n=JS(e),r=B.useRef(!1);return B.useEffect(()=>{let e=e=>{e.target&&!r.current&&txe(qbe,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function exe(){let e=new CustomEvent(YS);document.dispatchEvent(e)}function txe(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?Ube(i,a):i.dispatchEvent(a)}var ZS=`focusScope.autoFocusOnMount`,QS=`focusScope.autoFocusOnUnmount`,nxe={bubbles:!1,cancelable:!0},rxe=`FocusScope`,$S=B.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=B.useState(null),l=JS(i),u=JS(a),d=B.useRef(null),f=ey(t,e=>c(e)),p=B.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;B.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:eC(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||eC(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&eC(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),B.useEffect(()=>{if(s){uxe.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ZS,nxe);s.addEventListener(ZS,l),s.dispatchEvent(t),t.defaultPrevented||(ixe(pxe(oxe(s)),{select:!0}),document.activeElement===e&&eC(s))}return()=>{s.removeEventListener(ZS,l),setTimeout(()=>{let t=new CustomEvent(QS,nxe);s.addEventListener(QS,u),s.dispatchEvent(t),t.defaultPrevented||eC(e??document.body,{select:!0}),s.removeEventListener(QS,u),uxe.remove(p)},0)}}},[s,l,u,p]);let m=B.useCallback(e=>{if(!n&&!r||p.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]=axe(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&eC(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&eC(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,K.jsx)(qS.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});$S.displayName=rxe;function ixe(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(eC(r,{select:t}),document.activeElement!==n)return}function axe(e){let t=oxe(e);return[sxe(t,e),sxe(t.reverse(),e)]}function oxe(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)t.push(n.currentNode);return t}function sxe(e,t){for(let n of e)if(!cxe(n,{upTo:t}))return n}function cxe(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}function lxe(e){return e instanceof HTMLInputElement&&`select`in e}function eC(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&lxe(e)&&t&&e.select()}}var uxe=dxe();function dxe(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=fxe(e,t),e.unshift(t)},remove(t){e=fxe(e,t),e[0]?.resume()}}}function fxe(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pxe(e){return e.filter(e=>e.tagName!==`A`)}var mxe=u(v(),1),hxe=`Portal`,tC=B.forwardRef((e,t)=>
184{let{container:n,...r}=e,[i,a]=B.useState(!1);WS(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?mxe.createPortal((0,K.jsx)(qS.div,{...r,ref:t}),o):null});tC.displayName=hxe;function gxe(e,t){return B.useReducer((e,n)=>t[e][n]??e,e)}var nC=e=>{let{present:t,children:n}=e,r=_xe(t),i=typeof n==`function`?n({present:r.isPresent}):B.Children.only(n),a=ey(r.ref,vxe(i));return typeof n==`function`||r.isPresent?B.cloneElement(i,{ref:a}):null};nC.displayName=`Presence`;function _xe(e){let[t,n]=B.useState(),r=B.useRef(null),i=B.useRef(e),a=B.useRef(`none`),[o,s]=gxe(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return B.useEffect(()=>{let e=rC(r.current);a.current=o===`mounted`?e:`none`},[o]),WS(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=rC(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),WS(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=rC(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=rC(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:B.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function rC(e){return e?.animationName||`none`}function vxe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var iC=0;function aC(){B.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??yxe()),document.body.insertAdjacentElement(`beforeend`,e[1]??yxe()),iC++,()=>{iC===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),iC--}},[])}function yxe(){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}var oC=function(e,t){return oC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},oC(e,t)};function bxe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);oC(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var sC=function(){return sC=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},sC.apply(this,arguments)};function xxe(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 Sxe(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Cxe(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(
184o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function cC(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function wxe(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Txe(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))}function lC(e){return this instanceof lC?(this.v=e,this):new lC(e)}function Exe(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof lC?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Dxe(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof cC==`function`?cC(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}var uC=`right-scroll-bar-position`,dC=`width-before-scroll-bar`,Oxe=`with-scroll-bars-hidden`,kxe=`--removed-body-scroll-bar-size`;function fC(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Axe(e,t){var n=(0,B.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 jxe=typeof window<`u`?B.useLayoutEffect:B.useEffect,Mxe=new WeakMap;function Nxe(e,t){var n=Axe(t||null,function(t){return e.forEach(function(e){return fC(e,t)})});return jxe(function(){var t=Mxe.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||fC(e,null)}),i.forEach(function(e){r.has(e)||fC(e,a)})}Mxe.set(n,e)},[e]),n}function Pxe(e){return e}function Fxe(e,t){t===void 0&&(t=Pxe);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;
vendor: 7,570 bytes, lines 184-224
184n=[],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 Ixe(e){e===void 0&&(e={});var t=Fxe(null);return t.options=sC({async:!0,ssr:!1},e),t}var Lxe=function(e){var t=e.sideCar,n=xxe(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 B.createElement(r,sC({},n))};Lxe.isSideCarExport=!0;function Rxe(e,t){return e.useMedium(t),Lxe}var zxe=Ixe(),pC=function(){},mC=B.forwardRef(function(e,t){var n=B.useRef(null),r=B.useState({onScrollCapture:pC,onWheelCapture:pC,onTouchMoveCapture:pC}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=xxe(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Nxe([n,t]),C=sC(sC({},b),i);return B.createElement(B.Fragment,null,u&&B.createElement(x,{sideCar:zxe,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?B.cloneElement(B.Children.only(s),sC(sC({},C),{ref:S})):B.createElement(v,sC({},C,{className:c,ref:S}),s))});mC.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mC.classNames={fullWidth:dC,zeroRight:uC};var Bxe,Vxe=function(){if(Bxe)return Bxe;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Hxe(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Vxe();return t&&e.setAttribute(`nonce`,t),e}function Uxe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wxe(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Gxe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Hxe())&&(Uxe(t,n),Wxe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kxe=function(){var e=Gxe();return function(t,n){B.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},qxe=function(){var e=Kxe();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Jxe={left:0,top:0,right:0,gap:0},hC=function(e){return parseInt(e||``,10)||0},Yxe=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[hC(n),hC(r),hC(i)]},Xxe=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Jxe;var t=Yxe(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])}},Zxe=qxe(),gC=`data-scroll-locked`,Qxe=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),` 185 .${Oxe} { 186 overflow: hidden ${r}; 187 padding-right: ${s}px ${r}; 188 } 189 body[${gC}] { 190 overflow: hidden ${r}; 191 overscroll-behavior: contain; 192 ${[t&&`position: relative ${r};`,n===`margin`&&` 193 padding-left: ${i}px; 194 padding-top: ${a}px; 195 padding-right: ${o}px; 196 margin-left:0; 197 margin-top:0; 198 margin-right: ${s}px ${r}; 199 `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)} 200 } 201 202 .${uC} { 203 right: ${s}px ${r}; 204 } 205 206 .${dC} { 207 margin-right: ${s}px ${r}; 208 } 209 210 .${uC} .${uC} { 211 right: 0 ${r}; 212 } 213 214 .${dC} .${dC} { 215 margin-right: 0 ${r}; 216 } 217 218 body[${gC}] { 219 ${kxe}: ${s}px; 220 } 221`},$xe=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},eSe=function(){B.useEffect(function(){return document.body.setAttribute(gC,($xe()+1).toString()),function(){var e=$xe()-1;e<=0?document.body.removeAttribute(gC):document.body.setAttribute(gC,e.toString())}},[])},tSe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;eSe();var a=B.useMemo(function(){return Xxe(i)},[i]);return B.createElement(Zxe,{styles:Qxe(a,!t,i,n?``:`!important`)})},_C=!1;if(typeof window<`u`)try{var vC=Object.defineProperty({},`passive`,{get:function(){return _C=!0,!0}});window.addEventListener(`test`,vC,vC),window.removeEventListener(`test`,vC,vC)}catch{_C=!1}var yC=_C?{passive:!1}:!1,nSe=function(e){return e.tagName===`TEXTAREA`},rSe=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!nSe(e)&&n[t]===`visible`)},iSe=function(e){return rSe(e,`overflowY`)},aSe=function(e){return rSe(e,`overflowX`)},oSe=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),lSe(e,r)){var i=uSe(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sSe=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},cSe=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},lSe=function(e,t){return e===`v`?iSe(t):aSe(t)},uSe=function(e,t){return e===`v`?sSe(t):cSe(t)},dSe=function(e,t){return e===`h`&&t===`rtl`?-1:1},fSe=function(e,t,n,r,i){var a=dSe(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=uSe(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&lSe(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},bC=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pSe=function(e){return[e.deltaX,e.deltaY]},mSe=function(e){return e&&`current`in e?e.current:e},hSe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gSe=function(e){return` 222 .block-interactivity-${e} {pointer-events: none;} 223 .allow-interactivity-${e} {pointer-events: all;} 224`},_Se=0,xC=[];function vSe(e){var t=B.useRef([]),n=B.useRef([0,0]),r=B.useRef(),i=B.useState(_Se++)[0],a=B.useState(qxe)[0],o=B.useRef(e);B.useEffect(function(){o.current=e},[e]),B.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Txe([e.lockRef.current],(e.shards||[]).map(mSe),!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 s=B.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=bC(e),a=n.current,s=`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(s)>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=oSe(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=oSe(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return fSe(h,t,e,h===`h`?s:c,!0)},[]),c=B.useCallback(function(e){var n=e;if(!(!xC.length||xC[xC.length-1]!==a)){var r=`deltaY`in n?pSe(n):bC(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&hSe(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}
vendor: 10,506 bytes, lines 224-228
224if(!i){var c=(o.current.shards||[]).map(mSe).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=B.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ySe(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=B.useCallback(function(e){n.current=bC(e),r.current=void 0},[]),d=B.useCallback(function(t){l(t.type,pSe(t),t.target,s(t,e.lockRef.current))},[]),f=B.useCallback(function(t){l(t.type,bC(t),t.target,s(t,e.lockRef.current))},[]);B.useEffect(function(){return xC.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,yC),document.addEventListener(`touchmove`,c,yC),document.addEventListener(`touchstart`,u,yC),function(){xC=xC.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,yC),document.removeEventListener(`touchmove`,c,yC),document.removeEventListener(`touchstart`,u,yC)}},[]);var p=e.removeScrollBar,m=e.inert;return B.createElement(B.Fragment,null,m?B.createElement(a,{styles:gSe(i)}):null,p?B.createElement(tSe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ySe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var bSe=Rxe(zxe,vSe),xSe=B.forwardRef(function(e,t){return B.createElement(mC,sC({},e,{ref:t,sideCar:bSe}))});xSe.classNames=mC.classNames;var SC=xSe,SSe=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},CC=new WeakMap,wC=new WeakMap,TC={},EC=0,CSe=function(e){return e&&(e.host||CSe(e.parentNode))},wSe=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=CSe(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})},TSe=function(e,t,n,r){var i=wSe(t,Array.isArray(e)?e:[e]);TC[n]||(TC[n]=new WeakMap);var a=TC[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=(CC.get(e)||0)+1,l=(a.get(e)||0)+1;CC.set(e,c),a.set(e,l),o.push(e),c===1&&i&&wC.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(),EC++,function(){o.forEach(function(e){var t=CC.get(e)-1,i=a.get(e)-1;CC.set(e,t),a.set(e,i),t||(wC.has(e)||e.removeAttribute(r),wC.delete(e)),i||e.removeAttribute(n)}),EC--,EC||(CC=new WeakMap,CC=new WeakMap,wC=new WeakMap,TC={})}},DC=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||SSe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),TSe(r,i,n,`aria-hidden`)):function(){return null}};function ESe(e){let t=DSe(e),n=B.forwardRef((e,n)=>{let{children:r,...i}=e,a=B.Children.toArray(r),o=a.find(kSe);if(o){let e=o.props.children,r=a.map(t=>t===o?B.Children.count(e)>1?B.Children.only(null):B.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:B.isValidElement(e)?B.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function DSe(e){let t=B.forwardRef((e,t)=>{let{children:n,...r}=e;if(B.isValidElement(n)){let e=jSe(n),i=ASe(r,n.props);return n.type!==B.Fragment&&(i.ref=t?$v(t,e):e),B.cloneElement(n,i)}return B.Children.count(n)>1?B.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OSe=Symbol(`radix.slottable`);function kSe(e){return B.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===OSe}function ASe(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(` `))}return{...e,...n}}function jSe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var OC=`Dialog`,[MSe,NSe]=US(OC),[PSe,kC]=MSe(OC),FSe=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=B.useRef(null),c=B.useRef(null),[l,u]=KS({prop:r,defaultProp:i??!1,onChange:a,caller:OC});return(0,K.jsx)(PSe,{scope:t,triggerRef:s,contentRef:c,contentId:GS(),titleId:GS(),descriptionId:GS(),open:l,onOpenChange:u,onOpenToggle:B.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};FSe.displayName=OC;var ISe=`DialogTrigger`,LSe=B.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=kC(ISe,n),a=ey(t,i.triggerRef);return(0,K.jsx)(qS.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":PC(i.open),...r,ref:a,onClick:HS(e.onClick,i.onOpenToggle)})});LSe.displayName=ISe;var AC=`DialogPortal`,[RSe,zSe]=MSe(AC,{forceMount:void 0}),BSe=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=kC(AC,t);return(0,K.jsx)(RSe,{scope:t,forceMount:n,children:B.Children.map(r,e=>(0,K.jsx)(nC,{present:n||a.open,children:(0,K.jsx)(tC,{asChild:!0,container:i,children:e})}))})};BSe.displayName=AC;var jC=`DialogOverlay`,VSe=B.forwardRef((e,t)=>{let n=zSe(jC,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=kC(jC,e.__scopeDialog);return a.modal?(0,K.jsx)(nC,{present:r||a.open,children:(0,K.jsx)(USe,{...i,ref:t})}):null});VSe.displayName=jC;var HSe=ESe(`DialogOverlay.RemoveScroll`),USe=B.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=kC(jC,n);return(0,K.jsx)(SC,{as:HSe,allowPinchZoom:!0,shards:[i.contentRef],children:(0,K.jsx)(qS.div,{"data-state":PC(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),MC=`DialogContent`,WSe=B.forwardRef((e,t)=>{let n=zSe(MC,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=kC(MC,e.__scopeDialog);return(0,K.jsx)(nC,{present:r||a.open,children:a.modal?(0,K.jsx)(GSe,{...i,ref:t}):(0,K.jsx)(KSe,{...i,ref:t})})});WSe.displayName=MC;var GSe=B.forwardRef((e,t)=>{let n=kC(MC,e.__scopeDialog),r=B.useRef(null),i=ey(t,n.contentRef,r);return B.useEffect(()=>{let e=r.current;if(e)return DC(e)},[]),(0,K.jsx)(qSe,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:HS(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:HS(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:HS(e.onFocusOutside,e=>e.preventDefault())})}),KSe=B.forwardRef((e,t)=>{let n=kC(MC,e.__scopeDialog),r=B.useRef(!1),i=B.useRef(!1);return(0,K.jsx)(qSe,{...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()}})}),qSe=B.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=kC(MC,n),c=B.useRef(null),l=ey(t,c);return aC(),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)($S,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,K.jsx)(XS,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":PC(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(nCe,{titleId:s.titleId}),(0,K.jsx)(iCe,{contentRef:c,descriptionId:s.descriptionId})]})]})}),NC=`DialogTitle`,JSe=B.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=kC(NC,n);return(0,K.jsx)(qS.h2,{id:i.titleId,...r,ref:t})});JSe.displayName=NC;var YSe=`DialogDescription`,XSe=B.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=kC(YSe,n);return(0,K.jsx)(qS.p,{id:i.descriptionId,...r,ref:t})});XSe.displayName=YSe;var ZSe=`DialogClose`,QSe=B.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=kC(ZSe,n);return(0,K.jsx)(qS.button,{type:`button`,...r,ref:t,onClick:HS(e.onClick,()=>i.onOpenChange(!1))})});QSe.displayName=ZSe;function PC(e){return e?`open`:`closed`}var $Se=`DialogTitleWarning`,[eCe,tCe]=kbe($Se,{contentName:MC,titleName:NC,docsSlug:`dialog`}),nCe=({titleId:e})=>{let t=tCe($Se),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 225 226If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 227 228For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return B.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},rCe=`DialogDescriptionWarning`,iCe=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tCe(rCe).contentName}}.`;return B.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},FC=FSe,aCe=LSe,IC=BSe,LC=VSe,RC=WSe,zC=JSe,BC=XSe,VC=QSe;function HC({...e}){return(0,K.jsx)(FC,{"data-slot":`dialog`,...e})}function UC({...e}){return(0,K.jsx)(aCe,{"data-slot":`dialog-trigger`,...e})}function oCe({...e}){return(0,K.jsx)(IC,{"data-slot":`dialog-portal`,...e})}function sCe({...e}){return(0,K.jsx)(VC,{"data-slot":`dialog-close`,...e})}function cCe({className:e,...t}){return(0,K.jsx)(LC,{"data-slot":`dialog-overlay`,className:q(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,e),...t})}function WC({className:e,children:t,showCloseButton:n=!0,...r}){return(0,K.jsxs)(oCe,{"data-slot":`dialog-portal`,children:[(0,K.jsx)(cCe,{}),(0,K.jsxs)(RC,{"data-slot":`dialog-content`,className:q(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 roun
228ded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg`,e),...r,children:[t,n&&(0,K.jsxs)(VC,{"data-slot":`dialog-close`,className:`ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,K.jsx)(J_,{}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function GC({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`dialog-header`,className:q(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function KC({className:e,showCloseButton:t=!1,children:n,...r}){return(0,K.jsxs)(`div`,{"data-slot":`dialog-footer`,className:q(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,K.jsx)(VC,{asChild:!0,children:(0,K.jsx)(J,{variant:`outline`,children:`Close`})})]})}function qC({className:e,...t}){return(0,K.jsx)(zC,{"data-slot":`dialog-title`,className:q(`text-lg leading-none font-semibold`,e),...t})}function JC({className:e,...t}){return(0,K.jsx)(BC,{"data-slot":`dialog-description`,className:q(`text-muted-foreground text-sm`,e),...t})}const lCe=({open:e,content:t,estimatedTokens:n,cap:r,onClose:i,onSaved:a})=>{let{t:o}=V(),{formatNumber:s}=jb(),{knowledgeBases:c,selectedKnowledgeBase:l}=Q(),{attachDocument:u,sendMessageStreamAction:d}=LS(),{modelTier:f,chatMode:p}=Q(),[m,h]=(0,B.useState)(``),[g,_]=(0,B.useState)(!1),[v,y]=(0,B.useState)(``),[b,x]=(0,B.useState)(l?.id??``),[S,C]=(0,B.useState)(null),[w,T]=(0,B.useState)(!1);(0,B.useEffect)(()=>{if(!e){h(``),y(``),C(null),T(!1),_(!1),x(l?.id??``);return}x(l?.id??``),_(!0);let n=!1;return Ype({content:t}).then(e=>{if(n)return;let t=e.data;h(t.title)}).catch(()=>{if(n)return;let e=new Date;h(`Pasted-${e.toISOString().slice(0,10).replace(/-/g,``)+`-`+String(e.getHours()).padStart(2,`0`)+String(e.getMinutes()).padStart(2,`0`)}`)}).finally(()=>{n||_(!1)}),()=>{n=!0}},[e,t,l]);let E=async()=>{if(!m.trim())return C(o(`common.name`)+` â `+o(`common.required`)),null;T(!0),C(null);try{return(await qpe({content:t,title:m.trim(),kb_id:b||null})).data}catch(e){return C(Kb(e,o(`toasts.chat.context_save_failed`))),null}finally{T(!1)}};return(0,K.jsx)(HC,{open:e,onOpenChange:e=>!e&&i(),children:(0,K.jsxs)(WC,{className:`sm:max-w-2xl`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{className:`tracking-tight`,children:o(`chat.long_paste_title`)}),(0,K.jsx)(JC,{children:o(`chat.long_paste_description`,{value:s(n),total:s(r)})})]}),S&&(0,K.jsx)(`div`,{className:`text-xs text-destructive bg-destructive/10 px-3 py-2 rounded-md`,children:S}),(0,K.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!v.trim()){C(o(`chat.ask_anything`));return}let t=await E();t&&(G.success(o(`toasts.documents.uploaded`)+`: `+t.filename),u({id:t.document_id,filename:t.filename}),a?.(),i(),d(v.trim(),{model_tier:f,knowledge_base_id:b||void 0,chat_mode:p,inject_document_ids:[t.document_id]}))},className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground block`,children:o(`common.name`)}),(0,K.jsx)(`input`,{type:`text`,value:m,onChange:e=>h(e.target.value),className:`w-full px-3 py-2 text-sm border border-input rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50`,placeholder:o(g?`common.loading`:`chat.long_paste_filename`),disabled:w||g,required:!0,autoFocus:!0})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-medium text-muted-foreground block`,children:[o(`chat.ask_anything`),` `,(0,K.jsxs)(`span`,{className:`text-muted-foreground/70`,children:[`(`,o(`common.optional`),`)`]})]}),(0,K.jsx)(`textarea`,{value:v,onChange:e=>y(e.target.value),className:`w-full px-3 py-2 text-sm border border-input rounded-md bg-background min-h-[100px] resize-none focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50`,placeholder:o(`chat.ask_anything`),disabled:w})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground block`,children:o(`chat.knowledge_base`)}),(0,K.jsxs)(`select`,{value:b,onChange:e=>x(e.target.value),className:`w-full px-3 py-2 text-sm border border-input rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50`,disabled:w,children:[(0,K.jsx)(`option`,{value:``,children:o(`chat.knowledge_base_all`)}),c.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:i,disabled:w,children:o(`common.cancel`)}),(0,K.jsx)(J,{type:`button`,variant:`outline`,onClick:async()=>{let e=await E();e&&(G.success(o(`toasts.documents.uploaded`)+`: `+e.filename),a?.(),i())},disabled:w||g||!m.trim(),children:o(w?`common.saving`:`chat.long_paste_save`)}),(0,K.jsx)(J,{type:`submit`,disabled:w||g||!m.trim()||!v.trim(),children:o(w?`common.saving`:`common.send`)})]})]})]})})},uCe=()=>{let{t:e}=V(),t=LS(e=>e.contextLimit),n=LS(e=>e.compactConversation),r=LS(e=>e.startFreshWithRecap),i=LS(e=>e.dismissContextLimit),[a,o]=(0,B.useState)(null);if(!t)return null;let s=t.hard;return(0,K.jsx)(HC,{open:!0,onOpenChange:e=>{!e&&!s&&a===null&&i()},children:(0,K.jsxs)(WC,{className:`sm:max-w-lg`,onEscapeKeyDown:e=>{s&&e.preventDefault()},onInteractOutside:e=>{s&&e.preventDefault()},children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{className:`tracking-tight`,children:e(s?`chat.context_limit.hard_title`:`chat.context_limit.soft_title`)}),(0,K.jsx)(JC,{children:s?e(`chat.context_limit.hard_body`):e(`chat.context_limit.soft_body`,{used:Math.round(t.usedPct)})})]}),(0,K.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,K.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,K.jsx)(`p`,{className:`font-medium`,children:e(`chat.context_limit.fresh_title`)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:e(`chat.context_limit.fresh_desc`)}),(0,K.jsxs)(J,{type:`button`,size:`sm`,className:`mt-2`,disabled:a!==null,onClick:async()=>{o(`fresh`);try{await r()}finally{o(null)}},children:[a===`fresh`&&(0,K.jsx)(W,{className:`size-3.5 animate-spin`}),e(`chat.context_limit.fresh_action`)]})]}),(0,K.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,K.jsx)(`p`,{className:`font-medium`,children:e(`chat.context_limit.compact_title`)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:e(`chat.context_limit.compact_desc`)}),(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`outline`,className:`mt-2`,disabled:a!==null,onClick:async()=>{o(`compact`);try{await n()}finally{o(null)}},children:[a===`compact`&&(0,K.jsx)(W,{className:`size-3.5 animate-spin`}),e(`chat.context_limit.compact_action`)]})]})]}),!s&&(0,K.jsx)(KC,{children:(0,K.jsx)(J,{type:`button`,variant:`ghost`,disabled:a!==null,onClick:i,children:e(`chat.context_limit.continue_anyway`)})})]})})};var dCe=[`top`,`right`,`bottom`,`left`],YC=Math.min,XC=Math.max,ZC=Math.round,QC=Math.floor,$C=e=>({x:e,y:e}),fCe={left:`right`,right:`left`,bottom:`top`,top:`bottom`},pCe={start:`end`,end:`start`};
vendor: 1,333 bytes, line 228
228function ew(e,t,n){return XC(e,YC(t,n))}function tw(e,t){return typeof e==`function`?e(t):e}function nw(e){return e.split(`-`)[0]}function rw(e){return e.split(`-`)[1]}function iw(e){return e===`x`?`y`:`x`}function aw(e){return e===`y`?`height`:`width`}var mCe=new Set([`top`,`bottom`]);function ow(e){return mCe.has(nw(e))?`y`:`x`}function sw(e){return iw(ow(e))}function hCe(e,t,n){n===void 0&&(n=!1);let r=rw(e),i=sw(e),a=aw(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=dw(o)),[o,dw(o)]}function gCe(e){let t=dw(e);return[cw(e),t,cw(t)]}function cw(e){return e.replace(/start|end/g,e=>pCe[e])}var lw=[`left`,`right`],uw=[`right`,`left`],_Ce=[`top`,`bottom`],vCe=[`bottom`,`top`];function yCe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?uw:lw:t?lw:uw;case`left`:case`right`:return t?_Ce:vCe;default:return[]}}function bCe(e,t,n,r){let i=rw(e),a=yCe(nw(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(cw)))),a}function dw(e){return e.replace(/left|right|bottom|top/g,e=>fCe[e])}function xCe(e){return{top:0,right:0,bottom:0,left:0,...e}}function fw(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:xCe(e)}function pw(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}}
vendor: 4,135 bytes, line 228
228function mw(e,t,n){let{reference:r,floating:i}=e,a=ow(t),o=sw(t),s=aw(o),c=nw(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}}switch(rw(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var SCe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=mw(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=mw(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function hw(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}=tw(t,e),p=fw(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=pw(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=pw(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 CCe=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}=tw(e,t)||{};if(l==null)return{};let d=fw(u),f={x:n,y:r},p=sw(i),m=aw(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=YC(d[_],T),D=YC(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=ew(O,A,k),M=!c.arrow&&rw(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),wCe=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}=tw(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=nw(r),_=ow(o),v=nw(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[dw(o)]:gCe(o)),x=p!==`none`;!d&&x&&b.push(...bCe(o,m,p,y));let S=[o,...b],C=await hw(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=hCe(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`&&_!==ow(t))||T.every(e=>ow(e.placement)===_?e.overflows[0]>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=>
vendor: 12,575 bytes, line 228
228{if(x){let t=ow(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function gw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _w(e){return dCe.some(t=>e[t]>=0)}var TCe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=tw(e,t);switch(r){case`referenceHidden`:{let e=gw(await hw(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:_w(e)}}}case`escaped`:{let e=gw(await hw(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:_w(e)}}}default:return{}}}}},vw=new Set([`left`,`top`]);async function ECe(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=nw(n),s=rw(n),c=ow(n)===`y`,l=vw.has(o)?-1:1,u=a&&c?-1:1,d=tw(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 DCe=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 ECe(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}}}}},OCe=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=tw(e,t),l={x:n,y:r},u=await hw(t,c),d=ow(nw(i)),f=iw(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=ew(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=ew(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},kCe=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}=tw(e,t),u={x:n,y:r},d=ow(i),f=iw(d),p=u[f],m=u[d],h=tw(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=vw.has(nw(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}}}},ACe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=tw(e,t),u=await hw(t,l),d=nw(i),f=rw(i),p=ow(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=YC(h-u[g],v),x=YC(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=XC(u.left,0),t=XC(u.right,0),n=XC(u.top,0),r=XC(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:XC(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:XC(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function yw(){return typeof window<`u`}function bw(e){return Cw(e)?(e.nodeName||``).toLowerCase():`#document`}function xw(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Sw(e){return((Cw(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Cw(e){return yw()?e instanceof Node||e instanceof xw(e).Node:!1}function ww(e){return yw()?e instanceof Element||e instanceof xw(e).Element:!1}function Tw(e){return yw()?e instanceof HTMLElement||e instanceof xw(e).HTMLElement:!1}function Ew(e){return!yw()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof xw(e).ShadowRoot}var jCe=new Set([`inline`,`contents`]);function Dw(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Mw(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!jCe.has(i)}var MCe=new Set([`table`,`td`,`th`]);function NCe(e){return MCe.has(bw(e))}var PCe=[`:popover-open`,`:modal`];function Ow(e){return PCe.some(t=>{try{return e.matches(t)}catch{return!1}})}var FCe=[`transform`,`translate`,`scale`,`rotate`,`perspective`],ICe=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],LCe=[`paint`,`layout`,`strict`,`content`];function kw(e){let t=Aw(),n=ww(e)?Mw(e):e;return FCe.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||ICe.some(e=>(n.willChange||``).includes(e))||LCe.some(e=>(n.contain||``).includes(e))}function RCe(e){let t=Pw(e);for(;Tw(t)&&!jw(t);){if(kw(t))return t;if(Ow(t))return null;t=Pw(t)}return null}function Aw(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var zCe=new Set([`html`,`body`,`#document`]);function jw(e){return zCe.has(bw(e))}function Mw(e){return xw(e).getComputedStyle(e)}function Nw(e){return ww(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pw(e){if(bw(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ew(e)&&e.host||Sw(e);return Ew(t)?t.host:t}function Fw(e){let t=Pw(e);return jw(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tw(t)&&Dw(t)?t:Fw(t)}function Iw(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Fw(e),i=r===e.ownerDocument?.body,a=xw(r);if(i){let e=Lw(a);return t.concat(a,a.visualViewport||[],Dw(r)?r:[],e&&n?Iw(e):[])}return t.concat(r,Iw(r,[],n))}function Lw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rw(e){let t=Mw(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Tw(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ZC(n)!==a||ZC(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function zw(e){return ww(e)?e:e.contextElement}function Bw(e){let t=zw(e);if(!Tw(t))return $C(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Rw(t),o=(a?ZC(n.width):n.width)/r,s=(a?ZC(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var BCe=$C(0);function Vw(e){let t=xw(e);return!Aw()||!t.visualViewport?BCe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function VCe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==xw(e)?!1:t}function Hw(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=zw(e),o=$C(1);t&&(r?ww(r)&&(o=Bw(r)):o=Bw(e));let s=VCe(a,n,r)?Vw(a):$C(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){let e=xw(a),t=r&&ww(r)?xw(r):r,n=e,i=Lw(n);for(;i&&r&&t!==n;){let e=Bw(i),t=i.getBoundingClientRect(),r=Mw(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=xw(i),i=Lw(n)}}return pw({width:u,height:d,x:c,y:l})}function Uw(e,t){let n=Nw(e).scrollLeft;return t?t.left+n:Hw(Sw(e)).left+n}function Ww(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Uw(e,n),y:n.top+t.scrollTop}}function HCe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Sw(r),s=t?Ow(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=$C(1),u=$C(0),d=Tw(r);if((d||!d&&!a)&&((bw(r)!==`body`||Dw(o))&&(c=Nw(r)),Tw(r))){let e=Hw(r);l=Bw(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ww(o,c):$C(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 UCe(e){return Array.from(e.getClientRects())}function WCe(e){let t=Sw(e),n=Nw(e),r=e.ownerDocument.body,i=XC(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=XC(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Uw(e),s=-n.scrollTop;return Mw(r).direction===`rtl`&&(o+=XC(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Gw=25;function GCe(e,t){let n=xw(e),r=Sw(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Aw();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Uw(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Gw&&(a-=o)}else l<=Gw&&(a+=l);return{width:a,height:o,x:s,y:c}}var KCe=new Set([`absolute`,`fixed`]);function qCe(e,t){let n=Hw(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Tw(e)?Bw(e):$C(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Kw(e,t,n){let r;if(t===`viewport`)r=GCe(e,n);else if(t===`document`)r=WCe(Sw(e));else if(ww(t))r=qCe(t,n);else{let n=Vw(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return pw(r)}function qw(e,t){let n=Pw(e);return n===t||!ww(n)||jw(n)?!1:Mw(n).position===`fixed`||qw(n,t)}function JCe(e,t){let n=t.get(e);if(n)return n;let r=Iw(e,[],!1).filter(e=>ww(e)&&bw(e)!==`body`),i=null,a=Mw(e).position===`fixed`,o=a?Pw(e):e;for(;ww(o)&&!jw(o);){let t=Mw(o),n=kw(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&KCe.has(i.position)||Dw(o)&&!n&&qw(e,o))?r=r.filter(e=>e!==o):i=t,o=Pw(o)}return t.set(e,r),r}function YCe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ow(t)?[]:JCe(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Kw(t,n,i);return e.top=XC(r.top,e.top),e.right=YC(r.right,e.right),e.bottom=YC(r.bottom,e.bottom),e.left=XC(r.left,e.left),e},Kw(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function XCe(e){let{width:t,height:n}=Rw(e);return{width:t,height:n}}function ZCe(e,t,n){let r=Tw(t),i=Sw(t),a=n===`fixed`,o=Hw(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=$C(0);function l(){c.x=Uw(i)}if(r||!r&&!a)if((bw(t)!==`body`||Dw(i))&&(s=Nw(t)),r){let e=Hw(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Ww(i,s):$C(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Jw(e){return Mw(e).position===`static`}function Yw(e,t){if(!Tw(e)||Mw(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Sw(e)===n&&(n=n.ownerDocument.body),n}function Xw(e,t){let n=xw(e);if(Ow(e))return n;if(!Tw(e)){let t=Pw(e);for(;t&&!jw(t);){if(ww(t)&&!Jw(t))return t;t=Pw(t)}return n}let r=Yw(e,t);for(;r&&NCe(r)&&Jw(r);)r=Yw(r,t);return r&&jw(r)&&Jw(r)&&!kw(r)?n:r||RCe(e)||n}var QCe=async function(e){let t=this.getOffsetParent||Xw,n=this.getDimensions,r=await n(e.floating);return{reference:ZCe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $Ce(e){return Mw(e).direction===`rtl`}var ewe={convertOffsetParentRelativeRectToViewportRelativeRect:HCe,getDocumentElement:Sw,getClippingRect:YCe,getOffsetParent:Xw,getElementRects:QCe,getClientRects:UCe,getDimensions:XCe,getScale:Bw,isElement:ww,isRTL:$Ce};function Zw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function twe(e,t){let n=null,r,i=Sw(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=QC(d),h=QC(i.clientWidth-(u+f)),g=QC(i.clientHeight-(d+p)),_=QC(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:XC(0,YC(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Zw(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function nwe(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=zw(e),u=i||a?[...l?Iw(l):[],...Iw(t)]:[];
vendor: 4,114 bytes, line 228
228u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?twe(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?Hw(e):null;c&&g();function g(){let t=Hw(e);h&&!Zw(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 rwe=DCe,iwe=OCe,awe=wCe,owe=ACe,swe=TCe,Qw=CCe,cwe=kCe,lwe=(e,t,n)=>{let r=new Map,i={platform:ewe,...n},a={...i.platform,_c:r};return SCe(e,t,{...i,platform:a})},uwe=u(v(),1),$w=typeof document<`u`?B.useLayoutEffect:function(){};function eT(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(!eT(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)&&!eT(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function tT(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nT(e,t){let n=tT(e);return Math.round(t*n)/n}function rT(e){let t=B.useRef(e);return $w(()=>{t.current=e}),t}function dwe(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=B.useState(r);eT(f,r)||p(r);let[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=B.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=B.useRef(null),C=B.useRef(null),w=B.useRef(u),T=c!=null,E=rT(c),D=rT(i),O=rT(l),k=B.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),lwe(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!eT(w.current,t)&&(w.current=t,uwe.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);$w(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=B.useRef(!1);$w(()=>(A.current=!0,()=>{A.current=!1}),[]),$w(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=B.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=B.useMemo(()=>({reference:b,floating:x}),[b,x]),N=B.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=nT(M.floating,u.x),r=nT(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...tT(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return B.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var fwe=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?{}:Qw({element:r.current,padding:i}).fn(n):r?Qw({element:r,padding:i}).fn(n):{}}}},pwe=(e,t)=>({...rwe(e),options:[e,t]}),mwe=(e,t)=>({...iwe(e),options:[e,t]}),hwe=(e,t)=>({...cwe(e),options:[e,t]}),gwe=(e,t)=>({...awe(e),options:[e,t]}),_we=(e,t)=>({...owe(e),options:[e,t]}),vwe=(e,t)=>({...swe(e),options:[e,t]}),ywe=(e,t)=>({...fwe(e),options:[e,t]}),bwe=`Arrow`,iT=B.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,K.jsx)(qS.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,K.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});iT.displayName=bwe;var xwe=iT;function aT(e){let[t,n]=B.useState(void 0);return WS(()=>
vendor: 4,739 bytes, line 228
228{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var oT=`Popper`,[sT,cT]=US(oT),[Swe,lT]=sT(oT),uT=e=>{let{__scopePopper:t,children:n}=e,[r,i]=B.useState(null);return(0,K.jsx)(Swe,{scope:t,anchor:r,onAnchorChange:i,children:n})};uT.displayName=oT;var dT=`PopperAnchor`,fT=B.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=lT(dT,n),o=B.useRef(null),s=ey(t,o),c=B.useRef(null);return B.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,K.jsx)(qS.div,{...i,ref:s})});fT.displayName=dT;var pT=`PopperContent`,[Cwe,wwe]=sT(pT),mT=B.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=lT(pT,n),[_,v]=B.useState(null),y=ey(t,e=>v(e)),[b,x]=B.useState(null),S=aT(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Ewe),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=dwe({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>nwe(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[pwe({mainAxis:i+w,alignmentAxis:o}),c&&mwe({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?hwe():void 0,...k}),c&&gwe({...k}),_we({...k,apply:({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`)}}),b&&ywe({element:b,padding:s}),Dwe({arrowWidth:C,arrowHeight:w}),f&&vwe({strategy:`referenceHidden`,...k})]}),[F,I]=_T(M),L=JS(m);WS(()=>{N&&L?.()},[N,L]);let ee=P.arrow?.x,R=P.arrow?.y,te=P.arrow?.centerOffset!==0,[ne,re]=B.useState();return WS(()=>{_&&re(window.getComputedStyle(_).zIndex)},[_]),(0,K.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ne,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,K.jsx)(Cwe,{scope:n,placedSide:F,onArrowChange:x,arrowX:ee,arrowY:R,shouldHideArrow:te,children:(0,K.jsx)(qS.div,{"data-side":F,"data-align":I,...h,ref:y,style:{...h.style,animation:N?void 0:`none`}})})})});mT.displayName=pT;var hT=`PopperArrow`,Twe={top:`bottom`,right:`left`,bottom:`top`,left:`right`},gT=B.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=wwe(hT,n),a=Twe[i.placedSide];return(0,K.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,K.jsx)(xwe,{...r,ref:t,style:{...r.style,display:`block`}})})});gT.displayName=hT;function Ewe(e){return e!==null}var Dwe=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]=_T(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}}}});function _T(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var vT=uT,yT=fT,bT=mT,xT=gT,Owe=Symbol(`radix.slottable`);function kwe(e){let t=({children:e})=>(0,K.jsx)(K.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Owe,t}var ST=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`}),Awe=`VisuallyHidden`,CT=B.forwardRef((e,t)=>
vendor: 4,648 bytes, line 228
228(0,K.jsx)(qS.span,{...e,ref:t,style:{...ST,...e.style}}));CT.displayName=Awe;var jwe=CT,[wT,Mwe]=US(`Tooltip`,[cT]),TT=cT(),ET=`TooltipProvider`,Nwe=700,DT=`tooltip.open`,[Pwe,OT]=wT(ET),kT=e=>{let{__scopeTooltip:t,delayDuration:n=Nwe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=B.useRef(!0),s=B.useRef(!1),c=B.useRef(0);return B.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,K.jsx)(Pwe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:B.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:B.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:B.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};kT.displayName=ET;var AT=`Tooltip`,[Fwe,jT]=wT(AT),MT=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=OT(AT,e.__scopeTooltip),l=TT(t),[u,d]=B.useState(null),f=GS(),p=B.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=B.useRef(!1),[_,v]=KS({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(DT))):c.onClose(),a?.(e)},caller:AT}),y=B.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=B.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=B.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=B.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return B.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,K.jsx)(vT,{...l,children:(0,K.jsx)(Fwe,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:B.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:B.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};MT.displayName=AT;var NT=`TooltipTrigger`,PT=B.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=jT(NT,n),a=OT(NT,n),o=TT(n),s=ey(t,B.useRef(null),i.onTriggerChange),c=B.useRef(!1),l=B.useRef(!1),u=B.useCallback(()=>c.current=!1,[]);return B.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,K.jsx)(yT,{asChild:!0,...o,children:(0,K.jsx)(qS.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:HS(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:HS(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:HS(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:HS(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:HS(e.onBlur,i.onClose),onClick:HS(e.onClick,i.onClose)})})});PT.displayName=NT;var FT=`TooltipPortal`,[Iwe,Lwe]=wT(FT,{forceMount:void 0}),IT=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=jT(FT,t);return(0,K.jsx)(Iwe,{scope:t,forceMount:n,children:(0,K.jsx)(nC,{present:n||a.open,children:(0,K.jsx)(tC,{asChild:!0,container:i,children:r})})})};IT.displayName=FT;var LT=`TooltipContent`,RT=B.forwardRef((e,t)=>{let n=Lwe(LT,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=jT(LT,e.__scopeTooltip);return(0,K.jsx)(nC,{present:r||o.open,children:o.disableHoverableContent?(0,K.jsx)(zT,{side:i,...a,ref:t}):(0,K.jsx)(Rwe,{side:i,...a,ref:t})})}),Rwe=B.forwardRef((e,t)=>{let n=jT(LT,e.__scopeTooltip),r=OT(LT,e.__scopeTooltip),i=B.useRef(null),a=ey(t,i),[o,s]=B.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=B.useCallback(()=>{s(null),d(!1)},[d]),p=B.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Uwe(r,Hwe(r,n.getBoundingClientRect())),a=Wwe(t.getBoundingClientRect());s(Kwe([...i,...a])),d(!0)},[d]);return B.useEffect(()=>()=>f(),[f]),B.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),B.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Gwe(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,K.jsx)(zT,{...e,ref:a})}),[zwe,Bwe]=wT(AT,{isInside:!1}),Vwe=kwe(`TooltipContent`),zT=B.forwardRef((e,t)=>
228{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=jT(LT,n),l=TT(n),{onClose:u}=c;return B.useEffect(()=>(document.addEventListener(DT,u),()=>document.removeEventListener(DT,u)),[u]),B.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,K.jsx)(XS,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,K.jsxs)(bT,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.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,K.jsx)(Vwe,{children:r}),(0,K.jsx)(zwe,{scope:n,isInside:!0,children:(0,K.jsx)(jwe,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});RT.displayName=LT;var BT=`TooltipArrow`,VT=B.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=TT(n);return Bwe(BT,n).isInside?null:(0,K.jsx)(xT,{...i,...r,ref:t})});VT.displayName=BT;function Hwe(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`)}}function Uwe(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});break}return r}function Wwe(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}]}function Gwe(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}function Kwe(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?1:0),qwe(t)}function qwe(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)}var Jwe=kT,Ywe=MT,Xwe=PT,Zwe=IT,Qwe=RT,$we=VT;function HT({delayDuration:e=0,...t}){return(0,K.jsx)(Jwe,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function UT({...e}){return(0,K.jsx)(HT,{children:(0,K.jsx)(Ywe,{"data-slot":`tooltip`,...e})})}function WT({...e}){return(0,K.jsx)(Xwe,{"data-slot":`tooltip-trigger`,...e})}function GT({className:e,sideOffset:t=0,children:n,...r}){return(0,K.jsx)(Zwe,{children:(0,K.jsxs)(Qwe,{"data-slot":`tooltip-content`,sideOffset:t,className:q(`bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance`,e),...r,children:[n,(0,K.jsx)($we,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]`})]})})}const KT=[{id:`dashboard`,route:`/dashboard`},{id:`chat`,route:`/chat`},{id:`vault`,route:`/vault`},{id:`matters`,route:`/matters`},{id:`mail`,route:`/inbox/inbox`},{id:`booking`,route:`/booking`}
228,{id:`routines`,route:`/routines`}];function eTe(e){let t=KT.find(t=>t.id===e);if(!t)throw Error(`Unknown tour scene: ${e}`);return t}function qT(e){let t=KT.findIndex(t=>t.id===e);return t===-1||t===KT.length-1?null:KT[t+1].id}function tTe(e){return KT.findIndex(t=>t.id===e)}function JT(e){return KT.find(t=>e===t.route||e.startsWith(`${t.route}/`))??null}var nTe={status:`idle`,sceneId:null,mode:`full`,entrypoint:null};async function YT(){let e=new Date().toISOString(),{user:t,updateUser:n}=Nx.getState();if(t){let r=t.preferences??{};n({...t,preferences:{...r,onboarding_completed_at:e}})}try{await jx({preferences:{onboarding_completed_at:e}})}catch{}}const XT=Pb((e,t)=>({...nTe,start:t=>{e({status:`active`,sceneId:KT[0].id,mode:`full`,entrypoint:t})},goToScene:n=>{t().status===`active`&&e({sceneId:n})},next:()=>{let{sceneId:n,status:r}=t();if(r!==`active`||!n)return;let i=qT(n);i?e({sceneId:i}):t().finish()},skip:async()=>{e({status:`dismissed`,sceneId:null}),await YT()},finish:async()=>{e({status:`completed`,sceneId:null}),await YT()},resetForReplay:()=>{e({status:`active`,sceneId:KT[0].id,mode:`full`,entrypoint:`replay`})},showSceneHelp:t=>{e({status:`active`,sceneId:t,mode:`single`,entrypoint:null})},closeHelp:()=>{t().mode===`single`&&e({status:`completed`,sceneId:null,mode:`full`,entrypoint:null})}}));function rTe(){let e=XT(e=>e.status),t=XT(e=>e.sceneId),n=xv().pathname;return e===`active`&&t===JT(n)?.id}function iTe(){return!!document.querySelector(`[role="dialog"][data-state="open"]`)}var ZT=new Set,QT=null;function aTe(){QT||(QT=new MutationObserver(()=>{ZT.forEach(e=>e())}),QT.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-state`,`role`]}))}function oTe(e){return aTe(),ZT.add(e),()=>ZT.delete(e)}function sTe(){return iTe()}function cTe(){return(0,B.useSyncExternalStore)(oTe,sTe)}function $T({i18nKey:e,side:t,align:n,children:r}){let{t:i}=V(),a=rTe();return(0,K.jsxs)(UT,{open:!cTe()&&a,children:[(0,K.jsx)(WT,{asChild:!0,children:r}),(0,K.jsx)(GT,{side:t,align:n,sideOffset:6,className:`max-w-[260px] text-sm leading-snug py-2`,children:i(e)})]})}function lTe(e){let t=uTe(e),n=B.forwardRef((e,n)=>{let{children:r,...i}=e,a=B.Children.toArray(r),o=a.find(fTe);if(o){let e=o.props.children,r=a.map(t=>t===o?B.Children.count(e)>1?B.Children.only(null):B.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:B.isValidElement(e)?B.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function uTe(e){let t=B.forwardRef((e,t)=>{let{children:n,...r}=e;if(B.isValidElement(n)){let e=mTe(n),i=pTe(r,n.props);return n.type!==B.Fragment&&(i.ref=t?$v(t,e):e),B.cloneElement(n,i)}return B.Children.count(n)>1?B.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dTe=Symbol(`radix.slottable`);function fTe(e){return B.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===dTe}function pTe(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(` `))}return{...e,...n}}function mTe(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)}function eE(e){let t=e+`CollectionProvider`,[n,r]=US(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=B.useRef(null),a=B.useRef(new Map).current;return(0,K.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=lTe(s),l=B.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,K.jsx)(c,{ref:ey(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=lTe(u),p=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),s=ey(t,o),c=a(u,n);return B.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,K.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return B.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var tE=`Collapsible`,[hTe,gTe]=US(tE),[_Te,nE]=hTe(tE),vTe=B.forwardRef((e,t)=>
228{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=KS({prop:r,defaultProp:i??!1,onChange:o,caller:tE});return(0,K.jsx)(_Te,{scope:n,disabled:a,contentId:GS(),open:c,onOpenToggle:B.useCallback(()=>l(e=>!e),[l]),children:(0,K.jsx)(qS.div,{"data-state":iE(c),"data-disabled":a?``:void 0,...s,ref:t})})});vTe.displayName=tE;var yTe=`CollapsibleTrigger`,bTe=B.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=nE(yTe,n);return(0,K.jsx)(qS.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":iE(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:HS(e.onClick,i.onOpenToggle)})});bTe.displayName=yTe;var rE=`CollapsibleContent`,xTe=B.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=nE(rE,e.__scopeCollapsible);return(0,K.jsx)(nC,{present:n||i.open,children:({present:e})=>(0,K.jsx)(STe,{...r,ref:t,present:e})})});xTe.displayName=rE;var STe=B.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=nE(rE,n),[s,c]=B.useState(r),l=B.useRef(null),u=ey(t,l),d=B.useRef(0),f=d.current,p=B.useRef(0),m=p.current,h=o.open||s,g=B.useRef(h),_=B.useRef(void 0);return B.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),WS(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,K.jsx)(qS.div,{"data-state":iE(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function iE(e){return e?`open`:`closed`}var CTe=vTe,wTe=B.createContext(void 0),TTe=e=>{let{dir:t,children:n}=e;return(0,K.jsx)(wTe.Provider,{value:t,children:n})};function aE(e){let t=B.useContext(wTe);return e||t||`ltr`}var ETe=yg();function DTe(){return(0,ETe.useSyncExternalStore)(OTe,()=>!0,()=>!1)}function OTe(){return()=>{}}var oE=`Avatar`,[kTe,ATe]=US(oE),[jTe,MTe]=kTe(oE),NTe=B.forwardRef((e,t)=>{let{__scopeAvatar:n,...r}=e,[i,a]=B.useState(`idle`);return(0,K.jsx)(jTe,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:(0,K.jsx)(qS.span,{...r,ref:t})})});NTe.displayName=oE;var PTe=`AvatarImage`,FTe=B.forwardRef((e,t)=>{let{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=e,o=MTe(PTe,n),s=zTe(r,a),c=JS(e=>{i(e),o.onImageLoadingStatusChange(e)});return WS(()=>{s!==`idle`&&c(s)},[s,c]),s===`loaded`?(0,K.jsx)(qS.img,{...a,ref:t,src:r}):null});FTe.displayName=PTe;var ITe=`AvatarFallback`,LTe=B.forwardRef((e,t)=>{let{__scopeAvatar:n,delayMs:r,...i}=e,a=MTe(ITe,n),[o,s]=B.useState(r===void 0);return B.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,K.jsx)(qS.span,{...i,ref:t}):null});LTe.displayName=ITe;function RTe(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?`loaded`:`loading`):`error`:`idle`}function zTe(e,{referrerPolicy:t,crossOrigin:n}){let r=DTe(),i=B.useRef(null),a=(()=>r?(i.current||=new window.Image,i.current):null)(),[o,s]=B.useState(()=>RTe(a,e));return WS(()=>{s(RTe(a,e))},[a,e]),WS(()=>{let e=e=>()=>{s(e)};if(!a)return;let r=e(`loaded`),i=e(`error`);return a.addEventListener(`load`,r),a.addEventListener(`error`,i),t&&(a.referrerPolicy=t),typeof n==`string`&&(a.crossOrigin=n),()=>{a.removeEventListener(`load`,r),a.removeEventListener(`error`,i)}},[a,n,t]),o}var BTe=NTe,VTe=FTe,HTe=LTe;function sE(e){let t=B.useRef({value:e,previous:e});return B.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cE=`Checkbox`,[UTe,WTe]=US(cE),[GTe,lE]=UTe(cE);function KTe(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=KS({prop:n,defaultProp:i??!1,onChange:c,caller:cE}),[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useRef(!1),y=m?!!o||!!m.closest(`form`):!0,b={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,required:l,defaultChecked:uE(i)?!1:i,isFormControl:y,bubbleInput:g,setBubbleInput:_};return(0,K.jsx)(GTe,{scope:t,...b,children:eEe(d)?d(b):r})}var qTe=`CheckboxTrigger`,JTe=B.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=lE(qTe,e),h=ey(i,u),g=B.useRef(c);return B.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,K.jsx)(qS.button,{type:`button`,role:`checkbox`,"aria-checked":uE(c)?`mixed`:c,"aria-required":l,"data-state":tEe(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:HS(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:HS(n,e=>{d(e=>uE(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});JTe.displayName=qTe;var YTe=B.forwardRef((e,t)=>
vendor: 4,230 bytes, line 228
228{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,K.jsx)(KTe,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(JTe,{...d,ref:t,__scopeCheckbox:n}),e&&(0,K.jsx)($Te,{__scopeCheckbox:n})]})})});YTe.displayName=cE;var XTe=`CheckboxIndicator`,ZTe=B.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=lE(XTe,n);return(0,K.jsx)(nC,{present:r||uE(a.checked)||a.checked===!0,children:(0,K.jsx)(qS.span,{"data-state":tEe(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});ZTe.displayName=XTe;var QTe=`CheckboxBubbleInput`,$Te=B.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=lE(QTe,e),m=ey(n,p),h=sE(a),g=aT(r);B.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=uE(a),n.call(e,uE(a)?!1:a),e.dispatchEvent(t)}},[f,h,a,i]);let _=B.useRef(uE(a)?!1:a);return(0,K.jsx)(qS.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});$Te.displayName=QTe;function eEe(e){return typeof e==`function`}function uE(e){return e===`indeterminate`}function tEe(e){return uE(e)?`indeterminate`:e?`checked`:`unchecked`}var dE=`rovingFocusGroup.onEntryFocus`,nEe={bubbles:!1,cancelable:!0},fE=`RovingFocusGroup`,[pE,rEe,iEe]=eE(fE),[aEe,mE]=US(fE,[iEe]),[oEe,sEe]=aEe(fE),cEe=B.forwardRef((e,t)=>(0,K.jsx)(pE.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,K.jsx)(pE.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,K.jsx)(lEe,{...e,ref:t})})}));cEe.displayName=fE;var lEe=B.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=B.useRef(null),p=ey(t,f),m=aE(a),[h,g]=KS({prop:o,defaultProp:s??null,onChange:c,caller:fE}),[_,v]=B.useState(!1),y=JS(l),b=rEe(n),x=B.useRef(!1),[S,C]=B.useState(0);return B.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(dE,y),()=>e.removeEventListener(dE,y)},[y]),(0,K.jsx)(oEe,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:B.useCallback(e=>g(e),[g]),onItemShiftTab:B.useCallback(()=>v(!0),[]),onFocusableItemAdd:B.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:B.useCallback(()=>C(e=>e-1),[]),children:(0,K.jsx)(qS.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:HS(e.onMouseDown,()=>{x.current=!0}),onFocus:HS(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(dE,nEe);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);hEe([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:HS(e.onBlur,()=>v(!1))})})}),uEe=`RovingFocusGroupItem`,dEe=B.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=GS(),l=a||c,u=sEe(uEe,n),d=u.currentTabStopId===l,f=rEe(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return B.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,K.jsx)(pE.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,K.jsx)(qS.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:HS(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:HS(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:HS(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=mEe(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();
228let n=f().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=u.loop?gEe(n,r+1):n.slice(r+1)}setTimeout(()=>hEe(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});dEe.displayName=uEe;var fEe={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function pEe(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function mEe(e,t,n){let r=pEe(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return fEe[r]}function hEe(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function gEe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var hE=cEe,gE=dEe;function _Ee(e){let t=vEe(e),n=B.forwardRef((e,n)=>{let{children:r,...i}=e,a=B.Children.toArray(r),o=a.find(bEe);if(o){let e=o.props.children,r=a.map(t=>t===o?B.Children.count(e)>1?B.Children.only(null):B.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:B.isValidElement(e)?B.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function vEe(e){let t=B.forwardRef((e,t)=>{let{children:n,...r}=e;if(B.isValidElement(n)){let e=SEe(n),i=xEe(r,n.props);return n.type!==B.Fragment&&(i.ref=t?$v(t,e):e),B.cloneElement(n,i)}return B.Children.count(n)>1?B.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yEe=Symbol(`radix.slottable`);function bEe(e){return B.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===yEe}function xEe(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(` `))}return{...e,...n}}function SEe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _E=[`Enter`,` `],CEe=[`ArrowDown`,`PageUp`,`Home`],wEe=[`ArrowUp`,`PageDown`,`End`],TEe=[...CEe,...wEe],EEe={ltr:[..._E,`ArrowRight`],rtl:[..._E,`ArrowLeft`]},DEe={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},vE=`Menu`,[yE,OEe,kEe]=eE(vE),[bE,AEe]=US(vE,[kEe,cT,mE]),xE=cT(),jEe=mE(),[MEe,SE]=bE(vE),[NEe,CE]=bE(vE),PEe=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=xE(t),[c,l]=B.useState(null),u=B.useRef(!1),d=JS(a),f=aE(i);return B.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,K.jsx)(vT,{...s,children:(0,K.jsx)(MEe,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,K.jsx)(NEe,{scope:t,onClose:B.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};PEe.displayName=vE;var FEe=`MenuAnchor`,wE=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=xE(n);return(0,K.jsx)(yT,{...i,...r,ref:t})});wE.displayName=FEe;var TE=`MenuPortal`,[IEe,LEe]=bE(TE,{forceMount:void 0}),REe=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=SE(TE,t);return(0,K.jsx)(IEe,{scope:t,forceMount:n,children:(0,K.jsx)(nC,{present:n||a.open,children:(0,K.jsx)(tC,{asChild:!0,container:i,children:r})})})};REe.displayName=TE;var EE=`MenuContent`,[zEe,DE]=bE(EE),BEe=B.forwardRef((e,t)=>{let n=LEe(EE,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=SE(EE,e.__scopeMenu),o=CE(EE,e.__scopeMenu);return(0,K.jsx)(yE.Provider,{scope:e.__scopeMenu,children:(0,K.jsx)(nC,{present:r||a.open,children:(0,K.jsx)(yE.Slot,{scope:e.__scopeMenu,children:o.modal?(0,K.jsx)(VEe,{...i,ref:t}):(0,K.jsx)(HEe,{...i,ref:t})})})})}),VEe=B.forwardRef((e,t)=>
vendor: 11,055 bytes, line 228
228{let n=SE(EE,e.__scopeMenu),r=B.useRef(null),i=ey(t,r);return B.useEffect(()=>{let e=r.current;if(e)return DC(e)},[]),(0,K.jsx)(OE,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:HS(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),HEe=B.forwardRef((e,t)=>{let n=SE(EE,e.__scopeMenu);return(0,K.jsx)(OE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),UEe=_Ee(`MenuContent.ScrollLock`),OE=B.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=SE(EE,n),_=CE(EE,n),v=xE(n),y=jEe(n),b=OEe(n),[x,S]=B.useState(null),C=B.useRef(null),w=ey(t,C,g.onContentChange),T=B.useRef(0),E=B.useRef(``),D=B.useRef(0),O=B.useRef(null),k=B.useRef(`right`),A=B.useRef(0),j=m?SC:B.Fragment,M=m?{as:UEe,allowPinchZoom:!0}:void 0,N=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=vDe(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};B.useEffect(()=>()=>window.clearTimeout(T.current),[]),aC();let P=B.useCallback(e=>k.current===O.current?.side&&bDe(e,O.current?.area),[]);return(0,K.jsx)(zEe,{scope:n,searchRef:E,onItemEnter:B.useCallback(e=>{P(e)&&e.preventDefault()},[P]),onItemLeave:B.useCallback(e=>{P(e)||(C.current?.focus(),S(null))},[P]),onTriggerLeave:B.useCallback(e=>{P(e)&&e.preventDefault()},[P]),pointerGraceTimerRef:D,onPointerGraceIntentChange:B.useCallback(e=>{O.current=e},[]),children:(0,K.jsx)(j,{...M,children:(0,K.jsx)($S,{asChild:!0,trapped:i,onMountAutoFocus:HS(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,K.jsx)(XS,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,K.jsx)(hE,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:HS(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,K.jsx)(bT,{role:`menu`,"aria-orientation":`vertical`,"data-state":hDe(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:HS(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&N(e.key));let i=C.current;if(e.target!==i||!TEe.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);wEe.includes(e.key)&&a.reverse(),gDe(a)}),onBlur:HS(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:HS(e.onPointerMove,RE(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});BEe.displayName=EE;var WEe=`MenuGroup`,kE=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,K.jsx)(qS.div,{role:`group`,...r,ref:t})});kE.displayName=WEe;var GEe=`MenuLabel`,KEe=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,K.jsx)(qS.div,{...r,ref:t})});KEe.displayName=GEe;var AE=`MenuItem`,jE=`menu.itemSelect`,ME=B.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=B.useRef(null),o=CE(AE,e.__scopeMenu),s=DE(AE,e.__scopeMenu),c=ey(t,a),l=B.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(jE,{bubbles:!0,cancelable:!0});e.addEventListener(jE,e=>r?.(e),{once:!0}),Ube(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,K.jsx)(qEe,{...i,ref:c,disabled:n,onClick:HS(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:HS(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:HS(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||_E.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});ME.displayName=AE;var qEe=B.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=DE(AE,n),s=jEe(n),c=B.useRef(null),l=ey(t,c),[u,d]=B.useState(!1),[f,p]=B.useState(``);return B.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,K.jsx)(yE.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,K.jsx)(gE,{asChild:!0,...s,focusable:!r,children:(0,K.jsx)(qS.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:HS(e.onPointerMove,RE(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:HS(e.onPointerLeave,RE(e=>o.onItemLeave(e))),onFocus:HS(e.onFocus,()=>d(!0)),onBlur:HS(e.onBlur,()=>d(!1))})})})}),JEe=`MenuCheckboxItem`,YEe=B.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,K.jsx)(nDe,{scope:e.__scopeMenu,checked:n,children:(0,K.jsx)(ME,{role:`menuitemcheckbox`,"aria-checked":IE(n)?`mixed`:n,...i,ref:t,"data-state":LE(n),onSelect:HS(i.onSelect,()=>r?.(IE(n)?!0:!n),{checkForDefaultPrevented:!1})})})});YEe.displayName=JEe;var XEe=`MenuRadioGroup`,[ZEe,QEe]=bE(XEe,{value:void 0,onValueChange:()=>{}}),$Ee=B.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=JS(r);return(0,K.jsx)(ZEe,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,K.jsx)(kE,{...i,ref:t})})});$Ee.displayName=XEe;var eDe=`MenuRadioItem`,tDe=B.forwardRef((e,t)=>{let{value:n,...r}=e,i=QEe(eDe,e.__scopeMenu),a=n===i.value;return(0,K.jsx)(nDe,{scope:e.__scopeMenu,checked:a,children:(0,K.jsx)(ME,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":LE(a),onSelect:HS(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});tDe.displayName=eDe;var NE=`MenuItemIndicator`,[nDe,rDe]=bE(NE,{checked:!1}),iDe=B.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=rDe(NE,n);return(0,K.jsx)(nC,{present:r||IE(a.checked)||a.checked===!0,children:(0,K.jsx)(qS.span,{...i,ref:t,"data-state":LE(a.checked)})})});iDe.displayName=NE;var aDe=`MenuSeparator`,oDe=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,K.jsx)(qS.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});oDe.displayName=aDe;var sDe=`MenuArrow`,cDe=B.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=xE(n);return(0,K.jsx)(xT,{...i,...r,ref:t})});cDe.displayName=sDe;var PE=`MenuSub`,[lDe,uDe]=bE(PE),dDe=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=SE(PE,t),o=xE(t),[s,c]=B.useState(null),[l,u]=B.useState(null),d=JS(i);return B.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,K.jsx)(vT,{...o,children:(0,K.jsx)(MEe,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,K.jsx)(lDe,{scope:t,contentId:GS(),triggerId:GS(),trigger:s,onTriggerChange:c,children:n})})})};dDe.displayName=PE;var FE=`MenuSubTrigger`,fDe=B.forwardRef((e,t)=>{let n=SE(FE,e.__scopeMenu),r=CE(FE,e.__scopeMenu),i=uDe(FE,e.__scopeMenu),a=DE(FE,e.__scopeMenu),o=B.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=B.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return B.useEffect(()=>u,[u]),B.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,K.jsx)(wE,{asChild:!0,...l,children:(0,K.jsx)(qEe,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":hDe(n.open),...e,ref:$v(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:HS(e.onPointerMove,RE(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:HS(e.onPointerLeave,RE(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:HS(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||EEe[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});fDe.displayName=FE;var pDe=`MenuSubContent`,mDe=B.forwardRef((e,t)=>{let n=LEe(EE,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=SE(EE,e.__scopeMenu),o=CE(EE,e.__scopeMenu),s=uDe(pDe,e.__scopeMenu),c=B.useRef(null),l=ey(t,c);return(0,K.jsx)(yE.Provider,{scope:e.__scopeMenu,children:(0,K.jsx)(nC,{present:r||a.open,children:(0,K.jsx)(yE.Slot,{scope:e.__scopeMenu,children:(0,K.jsx)(OE,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:HS(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:HS(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:HS(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=DEe[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});mDe.displayName=pDe;function hDe(e){return e?`open`:`closed`}function IE(e){return e===`indeterminate`}function LE(e){return IE(e)?`indeterminate`:e?`checked`:`unchecked`}function gDe(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function _De(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vDe(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=_De(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function yDe(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}function bDe(e,t){return t?yDe({x:e.clientX,y:e.clientY},t):!1}function RE(e){return t=>t.pointerType===`mouse`?e(t):void 0}var xDe=PEe,SDe=wE,CDe=REe,wDe=BEe,TDe=kE,EDe=KEe,DDe=ME,ODe=YEe,kDe=$Ee,ADe=tDe,jDe=iDe,MDe=oDe,NDe=cDe,PDe=dDe,FDe=fDe,IDe=mDe,zE=`DropdownMenu`,[LDe,RDe]=US(zE,[AEe]),BE=AEe(),[zDe,BDe]=LDe(zE),VDe=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}
228=e,c=BE(t),l=B.useRef(null),[u,d]=KS({prop:i,defaultProp:a??!1,onChange:o,caller:zE});return(0,K.jsx)(zDe,{scope:t,triggerId:GS(),triggerRef:l,contentId:GS(),open:u,onOpenChange:d,onOpenToggle:B.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,K.jsx)(xDe,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};VDe.displayName=zE;var HDe=`DropdownMenuTrigger`,UDe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=BDe(HDe,n),o=BE(n);return(0,K.jsx)(SDe,{asChild:!0,...o,children:(0,K.jsx)(qS.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:$v(t,a.triggerRef),onPointerDown:HS(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:HS(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});UDe.displayName=HDe;var WDe=`DropdownMenuPortal`,GDe=e=>{let{__scopeDropdownMenu:t,...n}=e,r=BE(t);return(0,K.jsx)(CDe,{...r,...n})};GDe.displayName=WDe;var KDe=`DropdownMenuContent`,qDe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BDe(KDe,n),a=BE(n),o=B.useRef(!1);return(0,K.jsx)(wDe,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:HS(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:HS(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});qDe.displayName=KDe;var JDe=`DropdownMenuGroup`,YDe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BE(n);return(0,K.jsx)(TDe,{...i,...r,ref:t})});YDe.displayName=JDe;var XDe=`DropdownMenuLabel`,ZDe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BE(n);return(0,K.jsx)(EDe,{...i,...r,ref:t})});ZDe.displayName=XDe;var QDe=`DropdownMenuItem`,$De=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BE(n);return(0,K.jsx)(DDe,{...i,...r,ref:t})});$De.displayName=QDe;var eOe=`DropdownMenuCheckboxItem`,tOe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BE(n);return(0,K.jsx)(ODe,{...i,...r,ref:t})});tOe.displayName=eOe;var nOe=`DropdownMenuRadioGroup`,rOe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BE(n);return(0,K.jsx)(kDe,{...i,...r,ref:t})});rOe.displayName=nOe;var iOe=`DropdownMenuRadioItem`,aOe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BE(n);return(0,K.jsx)(ADe,{...i,...r,ref:t})});aOe.displayName=iOe;var oOe=`DropdownMenuItemIndicator`,sOe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BE(n);return(0,K.jsx)(jDe,{...i,...r,ref:t})});sOe.displayName=oOe;var cOe=`DropdownMenuSeparator`,lOe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BE(n);return(0,K.jsx)(MDe,{...i,...r,ref:t})});lOe.displayName=cOe;var uOe=`DropdownMenuArrow`,dOe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BE(n);return(0,K.jsx)(NDe,{...i,...r,ref:t})});dOe.displayName=uOe;var fOe=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=BE(t),[s,c]=KS({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,K.jsx)(PDe,{...o,open:s,onOpenChange:c,children:n})},pOe=`DropdownMenuSubTrigger`,mOe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BE(n);return(0,K.jsx)(FDe,{...i,...r,ref:t})});mOe.displayName=pOe;var hOe=`DropdownMenuSubContent`,gOe=B.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=BE(n);return(0,K.jsx)(IDe,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});gOe.displayName=hOe;var _Oe=VDe,vOe=UDe,yOe=GDe,bOe=qDe,xOe=YDe,SOe=ZDe,COe=$De,wOe=tOe,TOe=rOe,EOe=aOe,VE=sOe,DOe=lOe,OOe=fOe,kOe=mOe,AOe=gOe,HE,UE=`HoverCard`,[jOe,MOe]=US(UE,[cT]),WE=cT(),[NOe,GE]=jOe(UE),POe=e=>{let{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:a,openDelay:o=700,closeDelay:s=300}=e,c=WE(t),l=B.useRef(0),u=B.useRef(0),d=B.useRef(!1),f=B.useRef(!1),[p,m]=KS({prop:r,defaultProp:i??!1,onChange:a,caller:UE}),h=B.useCallback(()=>{clearTimeout(u.current),l.current=window.setTimeout(()=>m(!0),o)},[o,m]),g=B.useCallback(()=>{clearTimeout(l.current),!d.current&&!f.current&&(u.current=window.setTimeout(()=>m(!1),s))},[s,m]),_=B.useCallback(()=>m(!1),[m]);return B.useEffect(()=>()=>{clearTimeout(l.current),clearTimeout(u.current)},[]),(0,K.jsx)(NOe,{scope:t,open:p,onOpenChange:m,onOpen:h,onClose:g,onDismiss:_,hasSelectionRef:d,isPointerDownOnContentRef:f,children:(0,K.jsx)(vT,{...c,children:n})})};POe.displayName=UE;var FOe=`HoverCardTrigger`,IOe=B.forwardRef((e,t)=>
228{let{__scopeHoverCard:n,...r}=e,i=GE(FOe,n),a=WE(n);return(0,K.jsx)(yT,{asChild:!0,...a,children:(0,K.jsx)(qS.a,{"data-state":i.open?`open`:`closed`,...r,ref:t,onPointerEnter:HS(e.onPointerEnter,JE(i.onOpen)),onPointerLeave:HS(e.onPointerLeave,JE(i.onClose)),onFocus:HS(e.onFocus,i.onOpen),onBlur:HS(e.onBlur,i.onClose),onTouchStart:HS(e.onTouchStart,e=>e.preventDefault())})})});IOe.displayName=FOe;var KE=`HoverCardPortal`,[LOe,ROe]=jOe(KE,{forceMount:void 0}),zOe=e=>{let{__scopeHoverCard:t,forceMount:n,children:r,container:i}=e,a=GE(KE,t);return(0,K.jsx)(LOe,{scope:t,forceMount:n,children:(0,K.jsx)(nC,{present:n||a.open,children:(0,K.jsx)(tC,{asChild:!0,container:i,children:r})})})};zOe.displayName=KE;var qE=`HoverCardContent`,BOe=B.forwardRef((e,t)=>{let n=ROe(qE,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,a=GE(qE,e.__scopeHoverCard);return(0,K.jsx)(nC,{present:r||a.open,children:(0,K.jsx)(VOe,{"data-state":a.open?`open`:`closed`,...i,onPointerEnter:HS(e.onPointerEnter,JE(a.onOpen)),onPointerLeave:HS(e.onPointerLeave,JE(a.onClose)),ref:t})})});BOe.displayName=qE;var VOe=B.forwardRef((e,t)=>{let{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,...s}=e,c=GE(qE,n),l=WE(n),u=B.useRef(null),d=ey(t,u),[f,p]=B.useState(!1);return B.useEffect(()=>{if(f){let e=document.body;return HE=e.style.userSelect||e.style.webkitUserSelect,e.style.userSelect=`none`,e.style.webkitUserSelect=`none`,()=>{e.style.userSelect=HE,e.style.webkitUserSelect=HE}}},[f]),B.useEffect(()=>{if(u.current){let e=()=>{p(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==``&&(c.hasSelectionRef.current=!0)})};return document.addEventListener(`pointerup`,e),()=>{document.removeEventListener(`pointerup`,e),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),B.useEffect(()=>{u.current&&WOe(u.current).forEach(e=>e.setAttribute(`tabindex`,`-1`))}),(0,K.jsx)(XS,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:HS(a,e=>{e.preventDefault()}),onDismiss:c.onDismiss,children:(0,K.jsx)(bT,{...l,...s,onPointerDown:HS(s.onPointerDown,e=>{e.currentTarget.contains(e.target)&&p(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:f?`text`:void 0,WebkitUserSelect:f?`text`:void 0,"--radix-hover-card-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-hover-card-content-available-width":`var(--radix-popper-available-width)`,"--radix-hover-card-content-available-height":`var(--radix-popper-available-height)`,"--radix-hover-card-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-hover-card-trigger-height":`var(--radix-popper-anchor-height)`}})})}),HOe=`HoverCardArrow`,UOe=B.forwardRef((e,t)=>{let{__scopeHoverCard:n,...r}=e,i=WE(n);return(0,K.jsx)(xT,{...i,...r,ref:t})});UOe.displayName=HOe;function JE(e){return t=>t.pointerType===`touch`?void 0:e()}function WOe(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var GOe=POe,KOe=IOe,qOe=zOe,JOe=BOe;function YE(e,[t,n]){return Math.min(n,Math.max(t,e))}function YOe(e){let t=XOe(e),n=B.forwardRef((e,n)=>{let{children:r,...i}=e,a=B.Children.toArray(r),o=a.find(QOe);if(o){let e=o.props.children,r=a.map(t=>t===o?B.Children.count(e)>1?B.Children.only(null):B.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:B.isValidElement(e)?B.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function XOe(e){let t=B.forwardRef((e,t)=>{let{children:n,...r}=e;if(B.isValidElement(n)){let e=eke(n),i=$Oe(r,n.props);return n.type!==B.Fragment&&(i.ref=t?$v(t,e):e),B.cloneElement(n,i)}return B.Children.count(n)>1?B.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZOe=Symbol(`radix.slottable`);function QOe(e){return B.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ZOe}function $Oe(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}
vendor: 4,418 bytes, line 228
228:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function eke(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var XE=`Popover`,[tke,nke]=US(XE,[cT]),ZE=cT(),[rke,QE]=tke(XE),ike=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=ZE(t),c=B.useRef(null),[l,u]=B.useState(!1),[d,f]=KS({prop:r,defaultProp:i??!1,onChange:a,caller:XE});return(0,K.jsx)(vT,{...s,children:(0,K.jsx)(rke,{scope:t,contentId:GS(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:B.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:B.useCallback(()=>u(!0),[]),onCustomAnchorRemove:B.useCallback(()=>u(!1),[]),modal:o,children:n})})};ike.displayName=XE;var ake=`PopoverAnchor`,oke=B.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=QE(ake,n),a=ZE(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return B.useEffect(()=>(o(),()=>s()),[o,s]),(0,K.jsx)(yT,{...a,...r,ref:t})});oke.displayName=ake;var ske=`PopoverTrigger`,cke=B.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=QE(ske,n),a=ZE(n),o=ey(t,i.triggerRef),s=(0,K.jsx)(qS.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":xke(i.open),...r,ref:o,onClick:HS(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,K.jsx)(yT,{asChild:!0,...a,children:s})});cke.displayName=ske;var $E=`PopoverPortal`,[lke,uke]=tke($E,{forceMount:void 0}),dke=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=QE($E,t);return(0,K.jsx)(lke,{scope:t,forceMount:n,children:(0,K.jsx)(nC,{present:n||a.open,children:(0,K.jsx)(tC,{asChild:!0,container:i,children:r})})})};dke.displayName=$E;var eD=`PopoverContent`,fke=B.forwardRef((e,t)=>{let n=uke(eD,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=QE(eD,e.__scopePopover);return(0,K.jsx)(nC,{present:r||a.open,children:a.modal?(0,K.jsx)(mke,{...i,ref:t}):(0,K.jsx)(hke,{...i,ref:t})})});fke.displayName=eD;var pke=YOe(`PopoverContent.RemoveScroll`),mke=B.forwardRef((e,t)=>{let n=QE(eD,e.__scopePopover),r=B.useRef(null),i=ey(t,r),a=B.useRef(!1);return B.useEffect(()=>{let e=r.current;if(e)return DC(e)},[]),(0,K.jsx)(SC,{as:pke,allowPinchZoom:!0,children:(0,K.jsx)(gke,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:HS(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:HS(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:HS(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),hke=B.forwardRef((e,t)=>{let n=QE(eD,e.__scopePopover),r=B.useRef(!1),i=B.useRef(!1);return(0,K.jsx)(gke,{...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()}})}),gke=B.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=QE(eD,n),p=ZE(n);return aC(),(0,K.jsx)($S,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,K.jsx)(XS,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,K.jsx)(bT,{"data-state":xke(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}
vendor: 4,482 bytes, line 228
228),_ke=`PopoverClose`,vke=B.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=QE(_ke,n);return(0,K.jsx)(qS.button,{type:`button`,...r,ref:t,onClick:HS(e.onClick,()=>i.onOpenChange(!1))})});vke.displayName=_ke;var yke=`PopoverArrow`,bke=B.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=ZE(n);return(0,K.jsx)(xT,{...i,...r,ref:t})});bke.displayName=yke;function xke(e){return e?`open`:`closed`}var Ske=ike,Cke=cke,wke=dke,Tke=fke,tD=`Radio`,[Eke,Dke]=US(tD),[Oke,kke]=Eke(tD),Ake=B.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:o,value:s=`on`,onCheck:c,form:l,...u}=e,[d,f]=B.useState(null),p=ey(t,e=>f(e)),m=B.useRef(!1),h=d?l||!!d.closest(`form`):!0;return(0,K.jsxs)(Oke,{scope:n,checked:i,disabled:o,children:[(0,K.jsx)(qS.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":Fke(i),"data-disabled":o?``:void 0,disabled:o,value:s,...u,ref:p,onClick:HS(e.onClick,e=>{i||c?.(),h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})}),h&&(0,K.jsx)(Pke,{control:d,bubbles:!m.current,name:r,value:s,checked:i,required:a,disabled:o,form:l,style:{transform:`translateX(-100%)`}})]})});Ake.displayName=tD;var jke=`RadioIndicator`,Mke=B.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=kke(jke,n);return(0,K.jsx)(nC,{present:r||a.checked,children:(0,K.jsx)(qS.span,{"data-state":Fke(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});Mke.displayName=jke;var Nke=`RadioBubbleInput`,Pke=B.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=B.useRef(null),s=ey(o,a),c=sE(n),l=aT(t);return B.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,K.jsx)(qS.input,{type:`radio`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});Pke.displayName=Nke;function Fke(e){return e?`checked`:`unchecked`}var Ike=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],nD=`RadioGroup`,[Lke,Rke]=US(nD,[mE,Dke]),zke=mE(),Bke=Dke(),[Vke,Hke]=Lke(nD),Uke=B.forwardRef((e,t)=>{let{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:o=!1,disabled:s=!1,orientation:c,dir:l,loop:u=!0,onValueChange:d,...f}=e,p=zke(n),m=aE(l),[h,g]=KS({prop:a,defaultProp:i??null,onChange:d,caller:nD});return(0,K.jsx)(Vke,{scope:n,name:r,required:o,disabled:s,value:h,onValueChange:g,children:(0,K.jsx)(hE,{asChild:!0,...p,orientation:c,dir:m,loop:u,children:(0,K.jsx)(qS.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:m,...f,ref:t})})})});Uke.displayName=nD;var Wke=`RadioGroupItem`,Gke=B.forwardRef((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,a=Hke(Wke,n),o=a.disabled||r,s=zke(n),c=Bke(n),l=B.useRef(null),u=ey(t,l),d=a.value===i.value,f=B.useRef(!1);return B.useEffect(()=>{let e=e=>{Ike.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,K.jsx)(gE,{asChild:!0,...s,focusable:!o,active:d,children:(0,K.jsx)(Ake,{disabled:o,required:a.required,checked:d,...c,...i,name:a.name,ref:u,onCheck:()=>a.onValueChange(i.value),onKeyDown:HS(e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:HS(i.onFocus,()=>{f.current&&l.current?.click()})})})});Gke.displayName=Wke;var Kke=`RadioGroupIndicator`,qke=B.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,K.jsx)(Mke,{...Bke(n),...r,ref:t})});qke.displayName=Kke;var Jke=Uke,Yke=Gke,Xke=qke;function Zke(e,t){return B.useReducer((e,n)=>t[e][n]??e,e)}var rD=`ScrollArea`,[Qke,$ke]=US(rD),[eAe,iD]=Qke(rD),tAe=B.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=B.useState(null),[l,u]=B.useState(null),[d,f]=B.useState(null),[p,m]=B.useState(null),[h,g]=B.useState(null),[_,v]=B.useState(0),[y,b]=B.useState(0),[x,S]=B.useState(!1),[C,w]=B.useState(!1),T=ey(t,e=>c(e)),E=aE(i);return(0,K.jsx)(eAe,{scope:n,type:r,dir:E,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeight
vendor: 6,197 bytes, line 228
228Change:b,children:(0,K.jsx)(qS.div,{dir:E,...o,ref:T,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});tAe.displayName=rD;var nAe=`ScrollAreaViewport`,rAe=B.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=iD(nAe,n),s=ey(t,B.useRef(null),o.onViewportChange);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,K.jsx)(qS.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,K.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});rAe.displayName=nAe;var aD=`ScrollAreaScrollbar`,iAe=B.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=iD(aD,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return B.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,K.jsx)(aAe,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,K.jsx)(oAe,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,K.jsx)(sAe,{...r,ref:t,forceMount:n}):i.type===`always`?(0,K.jsx)(oD,{...r,ref:t}):null});iAe.displayName=aD;var aAe=B.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=iD(aD,e.__scopeScrollArea),[a,o]=B.useState(!1);return B.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,K.jsx)(nC,{present:n||a,children:(0,K.jsx)(sAe,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),oAe=B.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=iD(aD,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=dD(()=>c(`SCROLL_END`),100),[s,c]=Zke(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return B.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),B.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,K.jsx)(nC,{present:n||s!==`hidden`,children:(0,K.jsx)(oD,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:HS(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:HS(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),sAe=B.forwardRef((e,t)=>{let n=iD(aD,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=B.useState(!1),s=e.orientation===`horizontal`,c=dD(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return fD(n.viewport,c),fD(n.content,c),(0,K.jsx)(nC,{present:r||a,children:(0,K.jsx)(oD,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),oD=B.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=iD(aD,e.__scopeScrollArea),a=B.useRef(null),o=B.useRef(0),[s,c]=B.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=_Ae(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return vAe(e,o.current,s,t)}return n===`horizontal`?(0,K.jsx)(cAe,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=yAe(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,K.jsx)(lAe,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=yAe(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),cAe=B.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=iD(aD,e.__scopeScrollArea),[o,s]=B.useState(),c=B.useRef(null),l=ey(t,c,a.onScrollbarXChange);return B.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,K.jsx)(fAe,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":uD(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),xAe(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:lD(o.paddingLeft),paddingEnd:lD(o.paddingRight)}})}})}),lAe=B.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=iD(aD,e.__scopeScrollArea),[o,s]=B.useState(),c=B.useRef(null),l=ey(t,c,a.onScrollbarYChange);return B.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,K.jsx)(fAe,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":uD(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),xAe(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:
228a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:lD(o.paddingTop),paddingEnd:lD(o.paddingBottom)}})}})}),[uAe,dAe]=Qke(aD),fAe=B.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=iD(aD,n),[m,h]=B.useState(null),g=ey(t,e=>h(e)),_=B.useRef(null),v=B.useRef(``),y=p.viewport,b=r.content-r.viewport,x=JS(u),S=JS(c),C=dD(d,10);function w(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return B.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),B.useEffect(S,[r,S]),fD(m,C),fD(p.content,C),(0,K.jsx)(uAe,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:JS(a),onThumbPointerUp:JS(o),onThumbPositionChange:S,onThumbPointerDown:JS(s),children:(0,K.jsx)(qS.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:HS(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),w(e))}),onPointerMove:HS(e.onPointerMove,w),onPointerUp:HS(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),sD=`ScrollAreaThumb`,pAe=B.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=dAe(sD,e.__scopeScrollArea);return(0,K.jsx)(nC,{present:n||i.hasThumb,children:(0,K.jsx)(mAe,{ref:t,...r})})}),mAe=B.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=iD(sD,n),o=dAe(sD,n),{onThumbPositionChange:s}=o,c=ey(t,e=>o.onThumbChange(e)),l=B.useRef(void 0),u=dD(()=>{l.current&&=(l.current(),void 0)},100);return B.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=SAe(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,K.jsx)(qS.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,he
228ight:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:HS(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:HS(e.onPointerUp,o.onThumbPointerUp)})});pAe.displayName=sD;var cD=`ScrollAreaCorner`,hAe=B.forwardRef((e,t)=>{let n=iD(cD,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,K.jsx)(gAe,{...e,ref:t}):null});hAe.displayName=cD;var gAe=B.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=iD(cD,n),[a,o]=B.useState(0),[s,c]=B.useState(0),l=!!(a&&s);return fD(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),fD(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,K.jsx)(qS.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function lD(e){return e?parseInt(e,10):0}function _Ae(e,t){let n=e/t;return isNaN(n)?0:n}function uD(e){let t=_Ae(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function vAe(e,t,n,r=`ltr`){let i=uD(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return bAe([c,l],d)(e)}function yAe(e,t,n=`ltr`){let r=uD(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=YE(e,n===`ltr`?[0,o]:[o*-1,0]);return bAe([0,o],[0,s])(c)}function bAe(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function xAe(e,t){return e>0&&e<t}var SAe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function dD(e,t){let n=JS(e),r=B.useRef(0);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),B.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function fD(e,t){let n=JS(t);WS(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var CAe=tAe,wAe=rAe,TAe=hAe;function EAe(e){let t=DAe(e),n=B.forwardRef((e,n)=>{let{children:r,...i}=e,a=B.Children.toArray(r),o=a.find(kAe);if(o){let e=o.props.children,r=a.map(t=>t===o?B.Children.count(e)>1?B.Children.only(null):B.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:B.isValidElement(e)?B.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function DAe(e){let t=B.forwardRef((e,t)=>{let{children:n,...r}=e;if(B.isValidElement(n)){let e=jAe(n),i=AAe(r,n.props);return n.type!==B.Fragment&&(i.ref=t?$v(t,e):e),B.cloneElement(n,i)}return B.Children.count(n)>1?B.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OAe=Symbol(`radix.slottable`);function kAe(e){return B.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===OAe}function AAe(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(` `))}return{...e,...n}}function jAe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var MAe=u(v(),1),NAe=[` `,`Enter`,`ArrowUp`,`ArrowDown`],PAe=[` `,`Enter`],pD=`Select`,[mD,hD,FAe]=eE(pD),[gD,IAe]=US(pD,[FAe,cT]),_D=cT(),[LAe,vD]=gD(pD),[RAe,zAe]=gD(pD),BAe=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=_D(t),[g,_]=B.useState(null),[v,y]=B.useState(null),[b,x]=B.useState(!1),S=aE(l),[C,w]=KS({prop:r,defaultProp:i??!1,onChange:a,caller:pD}),[T,E]=KS({prop:o,defaultProp:s,onChange:c,caller:pD}),D=B.useRef(null),O=g?m||!!g.closest(`form`):!0,[k,A]=B.useState(new Set),j=Array.from(k).map(e=>e.props.value).join(`;`);return(0,K.jsx)(vT,{...h,children:(0,K.jsxs)(LAe,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:GS(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:D,disabled:f,children:[(0,K.jsx)(mD.Provider,{scope:t,children:(0,K.jsx)(RAe,{scope:e.__scopeSelect,onNativeOptionAdd:B.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:B.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),O?(0,K.jsxs)(wje,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,K.jsx)(`option`,{value:``}):null,Array.from(k)]},j):null]})})};BAe.displayName=pD;
vendor: 14,646 bytes, line 228
228var VAe=`SelectTrigger`,HAe=B.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=_D(n),o=vD(VAe,n),s=o.disabled||r,c=ey(t,o.onTriggerChange),l=hD(n),u=B.useRef(`touch`),[d,f,p]=Eje(e=>{let t=l().filter(e=>!e.disabled),n=Dje(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,K.jsx)(yT,{asChild:!0,...a,children:(0,K.jsx)(qS.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Tje(o.value)?``:void 0,...i,ref:c,onClick:HS(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:HS(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:HS(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&NAe.includes(e.key)&&(m(),e.preventDefault())})})})});HAe.displayName=VAe;var UAe=`SelectValue`,WAe=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=vD(UAe,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=ey(t,c.onValueNodeChange);return WS(()=>{l(u)},[l,u]),(0,K.jsx)(qS.span,{...s,ref:d,style:{pointerEvents:`none`},children:Tje(c.value)?(0,K.jsx)(K.Fragment,{children:o}):a})});WAe.displayName=UAe;var GAe=`SelectIcon`,KAe=B.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,K.jsx)(qS.span,{"aria-hidden":!0,...i,ref:t,children:r||`â¼`})});KAe.displayName=GAe;var qAe=`SelectPortal`,JAe=e=>(0,K.jsx)(tC,{asChild:!0,...e});JAe.displayName=qAe;var yD=`SelectContent`,YAe=B.forwardRef((e,t)=>{let n=vD(yD,e.__scopeSelect),[r,i]=B.useState();if(WS(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?MAe.createPortal((0,K.jsx)(XAe,{scope:e.__scopeSelect,children:(0,K.jsx)(mD.Slot,{scope:e.__scopeSelect,children:(0,K.jsx)(`div`,{children:e.children})})}),t):null}return(0,K.jsx)($Ae,{...e,ref:t})});YAe.displayName=yD;var bD=10,[XAe,xD]=gD(yD),ZAe=`SelectContentImpl`,QAe=EAe(`SelectContent.RemoveScroll`),$Ae=B.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=vD(yD,n),[y,b]=B.useState(null),[x,S]=B.useState(null),C=ey(t,e=>b(e)),[w,T]=B.useState(null),[E,D]=B.useState(null),O=hD(n),[k,A]=B.useState(!1),j=B.useRef(!1);B.useEffect(()=>{if(y)return DC(y)},[y]),aC();let M=B.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),N=B.useCallback(()=>M([w,y]),[M,w,y]);B.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:P,triggerPointerDownPosRef:F}=v;B.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||P(!1),document.removeEventListener(`pointermove`,t),F.current=null};return F.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,P,F]),B.useEffect(()=>{let e=()=>P(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[I,L]=Eje(e=>{let t=O().filter(e=>!e.disabled),n=Dje(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ee=B.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(j.current=!0))},[v.value]),R=B.useCallback(()=>y?.focus(),[y]),te=B.useCallback((e,t,n)=>{let r=!j.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),ne=r===`popper`?SD:tje,re=ne===SD?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,K.jsx)(XAe,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ee,selectedItem:w,onItemLeave:R,itemTextRefCallback:te,focusSelectedItem:N,selectedItemText:E,position:r,isPositioned:k,searchRef:I,children:(0,K.jsx)(SC,{as:QAe,allowPinchZoom:!0,children:(0,K.jsx)($S,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:HS(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,K.jsx)(XS,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,K.jsx)(ne,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...re,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:HS(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&L(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});$Ae.displayName=ZAe;var eje=`SelectItemAlignedPosition`,tje=B.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=vD(yD,n),o=xD(yD,n),[s,c]=B.useState(null),[l,u]=B.useState(null),d=ey(t,e=>u(e)),f=hD(n),p=B.useRef(!1),m=B.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=B.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-bD,d=YE(a,[bD,Math.max(bD,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-bD,d=YE(a,[bD,Math.max(bD,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-bD*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-bD,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${bD}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);WS(()=>y(),[y]);let[b,x]=B.useState();return WS(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,K.jsx)(rje,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:B.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,K.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,K.jsx)(qS.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});tje.displayName=eje;var nje=`SelectPopperPosition`,SD=B.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=bD,...a}=e,o=_D(n);return(0,K.jsx)(bT,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});SD.displayName=nje;var[rje,CD]=gD(yD,{}),wD=`SelectViewport`,ije=B.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=xD(wD,n),o=CD(wD,n),s=ey(t,a.onViewportChange),c=B.useRef(0);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,K.jsx)(mD.Slot,{scope:n,children:(0,K.jsx)(qS.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:HS(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-bD*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});ije.displayName=wD;var aje=`SelectGroup`,[oje,sje]=gD(aje),cje=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=GS();return(0,K.jsx)(oje,{scope:n,id:i,children:(0,K.jsx)(qS.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});cje.displayName=aje;var lje=`SelectLabel`,uje=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=sje(lje,n);return(0,K.jsx)(qS.div,{id:i.id,...r,ref:t})});uje.displayName=lje;var TD=`SelectItem`,[dje,fje]=gD(TD),pje=B.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=vD(TD,n),c=xD(TD,n),l=s.value===r,[u,d]=B.useState(a??``),[f,p]=B.useState(!1),m=ey(t,e=>c.itemRefCallback?.(e,r,i)),h=GS(),g=B.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,K.jsx)(dje,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:B.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,K.jsx)(mD.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,K.jsx)(qS.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:HS(o.onFocus,()=>p(!0)),onBlur:HS(o.onBlur,()=>p(!1)),onClick:HS(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:HS(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:HS(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:HS(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:HS(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:HS(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(PAe.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});pje.displayName=TD;var ED=`SelectItemText`,mje=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=vD(ED,n),s=xD(ED,n),c=fje(ED,n),l=zAe(ED,n),[u,d]=B.useState(null),f=ey(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=B.useMemo(()=>(0,K.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return WS(()=>(h(m),()=>g(m)),[h,g,m]),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(qS.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?MAe.createPortal(a.children,o.valueNode):null]})});mje.displayName=ED;var hje=`SelectItemIndicator`,gje=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return fje(hje,n).isSelected?(0,K.jsx)(qS.span,{"aria-hidden":!0,...r,ref:t}):null});gje.displayName=hje;var DD=`SelectScrollUpButton`,_je=B.forwardRef((e,t)=>{let n=xD(DD,e.__scopeSelect),r=CD(DD,e.__scopeSelect),[i,a]=B.useState(!1),o=ey(t,r.onScrollButtonChange);return WS(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,K.jsx)(yje,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});_je.displayName=DD;var OD=`SelectScrollDownButton`,vje=B.forwardRef((e,t)=>{let n=xD(OD,e.__scopeSelect),r=CD(OD,e.__scopeSelect),[i,a]=B.useState(!1),o=ey(t,r.onScrollButtonChange);return WS(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,K.jsx)(yje,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});vje.displayName=OD;var yje=B.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=xD(`SelectScrollButton`,n),o=B.useRef(null),s=hD(n),c=B.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return B.useEffect(()=>()=>c(),[c]),WS(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,K.jsx)(qS.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:HS(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:HS(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:HS(i.onPointerLeave,()=>{c()})})}),bje=`SelectSeparator`,xje=B.forwardRef((e,t)=>
vendor: 4,575 bytes, line 228
228{let{__scopeSelect:n,...r}=e;return(0,K.jsx)(qS.div,{"aria-hidden":!0,...r,ref:t})});xje.displayName=bje;var kD=`SelectArrow`,Sje=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=_D(n),a=vD(kD,n),o=xD(kD,n);return a.open&&o.position===`popper`?(0,K.jsx)(xT,{...i,...r,ref:t}):null});Sje.displayName=kD;var Cje=`SelectBubbleInput`,wje=B.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=B.useRef(null),a=ey(r,i),o=sE(t);return B.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,K.jsx)(qS.select,{...n,style:{...ST,...n.style},ref:a,defaultValue:t})});wje.displayName=Cje;function Tje(e){return e===``||e===void 0}function Eje(e){let t=JS(e),n=B.useRef(``),r=B.useRef(0),i=B.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=B.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Dje(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Oje(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Oje(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kje=BAe,Aje=HAe,jje=WAe,Mje=KAe,Nje=JAe,Pje=YAe,Fje=ije,Ije=pje,Lje=mje,Rje=gje,zje=_je,Bje=vje;function Vje(e){let t=Uje(e),n=B.forwardRef((e,n)=>{let{children:r,...i}=e,a=B.Children.toArray(r),o=a.find(Gje);if(o){let e=o.props.children,r=a.map(t=>t===o?B.Children.count(e)>1?B.Children.only(null):B.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:B.isValidElement(e)?B.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var Hje=Vje(`Slot`);function Uje(e){let t=B.forwardRef((e,t)=>{let{children:n,...r}=e;if(B.isValidElement(n)){let e=qje(n),i=Kje(r,n.props);return n.type!==B.Fragment&&(i.ref=t?$v(t,e):e),B.cloneElement(n,i)}return B.Children.count(n)>1?B.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wje=Symbol(`radix.slottable`);function Gje(e){return B.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Wje}function Kje(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(` `))}return{...e,...n}}function qje(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var AD=`Switch`,[Jje,Yje]=US(AD),[Xje,Zje]=Jje(AD),Qje=B.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=B.useState(null),m=ey(t,e=>p(e)),h=B.useRef(!1),g=f?u||!!f.closest(`form`):!0,[_,v]=KS({prop:i,defaultProp:a??!1,onChange:l,caller:AD});return(0,K.jsxs)(Xje,{scope:n,checked:_,disabled:s,children:[(0,K.jsx)(qS.button,{type:`button`,role:`switch`,"aria-checked":_,"aria-required":o,"data-state":rMe(_),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:HS(e.onClick,e=>{v(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,K.jsx)(nMe,{control:f,bubbles:!h.current,name:r,value:c,checked:_,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});Qje.displayName=AD;var $je=`SwitchThumb`,eMe=B.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=Zje($je,n);return(0,K.jsx)(qS.span,{"data-state":rMe(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});eMe.displayName=$je;var tMe=`SwitchBubbleInput`,nMe=B.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=B.useRef(null),s=ey(o,a),c=sE(n),l=aT(t);return B.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,K.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});
228nMe.displayName=tMe;function rMe(e){return e?`checked`:`unchecked`}var iMe=Qje,aMe=eMe,jD=`Tabs`,[oMe,sMe]=US(jD,[mE]),cMe=mE(),[lMe,MD]=oMe(jD),uMe=B.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=aE(s),[d,f]=KS({prop:r,onChange:i,defaultProp:a??``,caller:jD});return(0,K.jsx)(lMe,{scope:n,baseId:GS(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,K.jsx)(qS.div,{dir:u,"data-orientation":o,...l,ref:t})})});uMe.displayName=jD;var dMe=`TabsList`,fMe=B.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=MD(dMe,n),o=cMe(n);return(0,K.jsx)(hE,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,K.jsx)(qS.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});fMe.displayName=dMe;var pMe=`TabsTrigger`,mMe=B.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=MD(pMe,n),s=cMe(n),c=_Me(o.baseId,r),l=vMe(o.baseId,r),u=r===o.value;return(0,K.jsx)(gE,{asChild:!0,...s,focusable:!i,active:u,children:(0,K.jsx)(qS.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:HS(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:HS(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:HS(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});mMe.displayName=pMe;var hMe=`TabsContent`,gMe=B.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=MD(hMe,n),c=_Me(s.baseId,r),l=vMe(s.baseId,r),u=r===s.value,d=B.useRef(u);return B.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,K.jsx)(nC,{present:i||u,children:({present:n})=>(0,K.jsx)(qS.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});gMe.displayName=hMe;function _Me(e,t){return`${e}-trigger-${t}`}function vMe(e,t){return`${e}-content-${t}`}var yMe=uMe,bMe=fMe,xMe=mMe,SMe=gMe,CMe=`Toggle`,ND=B.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=KS({prop:n,onChange:i,defaultProp:r??!1,caller:CMe});return(0,K.jsx)(qS.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:HS(e.onClick,()=>{e.disabled||s(!o)})})});ND.displayName=CMe;var wMe=ND,PD=`ToggleGroup`,[TMe,EMe]=US(PD,[mE]),DMe=mE(),FD=B.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,K.jsx)(AMe,{...r,ref:t});if(n===`multiple`)return(0,K.jsx)(jMe,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${PD}\``)});FD.displayName=PD;var[OMe,kMe]=TMe(PD),AMe=B.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=KS({prop:n,defaultProp:r??``,onChange:i,caller:PD});return(0,K.jsx)(OMe,{scope:e.__scopeToggleGroup,type:`single`,value:B.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:B.useCallback(()=>s(``),[s]),children:(0,K.jsx)(PMe,{...a,ref:t})})}),jMe=B.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=KS({prop:n,defaultProp:r??[],onChange:i,caller:PD}),c=B.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=B.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,K.jsx)(OMe,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,K.jsx)(PMe,{...a,ref:t})})});FD.displayName=PD;var[MMe,NMe]=TMe(PD),PMe=B.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=DMe(n),u=aE(o),d={role:`group`,dir:u,...c};return(0,K.jsx)(MMe,{scope:n,rovingFocus:i,disabled:r,children:i?(0,K.jsx)(hE,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,K.jsx)(qS.div,{...d,ref:t})}):(0,K.jsx)(qS.div,{...d,ref:t})})}),ID=`ToggleGroupItem`,FMe=B.forwardRef((e,t)=>
228{let n=kMe(ID,e.__scopeToggleGroup),r=NMe(ID,e.__scopeToggleGroup),i=DMe(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=B.useRef(null);return r.rovingFocus?(0,K.jsx)(gE,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,K.jsx)(IMe,{...s,ref:t})}):(0,K.jsx)(IMe,{...s,ref:t})});FMe.displayName=ID;var IMe=B.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=kMe(ID,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,K.jsx)(ND,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),LMe=FD,RMe=FMe;function LD({...e}){return(0,K.jsx)(_Oe,{"data-slot":`dropdown-menu`,...e})}function RD({...e}){return(0,K.jsx)(vOe,{"data-slot":`dropdown-menu-trigger`,...e})}function zD({className:e,sideOffset:t=4,...n}){return(0,K.jsx)(yOe,{children:(0,K.jsx)(bOe,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:q(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function BD({...e}){return(0,K.jsx)(xOe,{"data-slot":`dropdown-menu-group`,...e})}function VD({className:e,inset:t,variant:n=`default`,...r}){return(0,K.jsx)(COe,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:q(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function HD({className:e,children:t,checked:n,...r}){return(0,K.jsxs)(wOe,{"data-slot":`dropdown-menu-checkbox-item`,className:q(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...r,children:[(0,K.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,K.jsx)(VE,{children:(0,K.jsx)(Lg,{className:`size-4`})})}),t]})}function zMe({...e}){return(0,K.jsx)(TOe,{"data-slot":`dropdown-menu-radio-group`,...e})}function BMe({className:e,children:t,...n}){return(0,K.jsxs)(EOe,{"data-slot":`dropdown-menu-radio-item`,className:q(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,K.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,K.jsx)(VE,{children:(0,K.jsx)(Kg,{className:`size-2 fill-current`})})}),t]})}function UD({className:e,inset:t,...n}){return(0,K.jsx)(SOe,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:q(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function WD({className:e,...t}){return(0,K.jsx)(DOe,{"data-slot":`dropdown-menu-separator`,className:q(`-mx-1 my-1 h-px bg-border`,e),...t})}function GD({...e}){return(0,K.jsx)(OOe,{"data-slot":`dropdown-menu-sub`,...e})}function KD({className:e,inset:t,children:n,...r}){return(0,K.jsxs)(kOe,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:q(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,K.jsx)(Bg,{className:`ml-auto size-4`})]})}function qD({className:e,...t}){return(0,K.jsx)(AOe,{"data-slot":`dropdown-menu-sub-content`,className:q(`z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
228de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...t})}function VMe(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const HMe=(()=>{let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function JD(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}var YD=null;function UMe(e={}){return YD||(e.includeStyleProperties?(YD=e.includeStyleProperties,YD):(YD=JD(window.getComputedStyle(document.documentElement)),YD))}function XD(e,t){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace(`px`,``)):0}function WMe(e){let t=XD(e,`border-left-width`),n=XD(e,`border-right-width`);return e.clientWidth+t+n}function GMe(e){let t=XD(e,`border-top-width`),n=XD(e,`border-bottom-width`);return e.clientHeight+t+n}function KMe(e,t={}){return{width:t.width||WMe(e),height:t.height||GMe(e)}}function qMe(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var ZD=16384;function JMe(e){(e.width>ZD||e.height>ZD)&&(e.width>ZD&&e.height>ZD?e.width>e.height?(e.height*=ZD/e.width,e.width=ZD):(e.width*=ZD/e.height,e.height=ZD):e.width>ZD?(e.height*=ZD/e.width,e.width=ZD):(e.width*=ZD/e.height,e.height=ZD))}function YMe(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:`image/png`,t.quality?t.quality:1)}):new Promise(n=>{let r=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(`,`)[1]),i=r.length,a=new Uint8Array(i);for(let e=0;e<i;e+=1)a[e]=r.charCodeAt(e);n(new Blob([a],{type:t.type?t.type:`image/png`}))})}function QD(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin=`anonymous`,r.decoding=`async`,r.src=e})}async function XMe(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function ZMe(e,t,n){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`),a=document.createElementNS(r,`foreignObject`);return i.setAttribute(`width`,`${t}`),i.setAttribute(`height`,`${n}`),i.setAttribute(`viewBox`,`0 0 ${t} ${n}`),a.setAttribute(`width`,`100%`),a.setAttribute(`height`,`100%`),a.setAttribute(`x`,`0`),a.setAttribute(`y`,`0`),a.setAttribute(`externalResourcesRequired`,`true`),i.appendChild(a),a.appendChild(e),XMe(i)}const $D=(e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||$D(n,t)};function QMe(e){let t=e.getPropertyValue(`content`);return`${e.cssText} content: '${t.replace(/'|"/g,``)}';`}function $Me(e,t){return UMe(t).map(t=>`${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t)?` !important`:``};`).join(` `)}function eNe(e,t,n,r){let i=`.${e}:${t}`,a=n.cssText?QMe(n):$Me(n,r);return document.createTextNode(`${i}{${a}}`)}function tNe(e,t,n,r){let i=window.getComputedStyle(e,n),a=i.getPropertyValue(`content`);if(a===``||a===`none`)return;let o=HMe();try{t.className=`${t.className} ${o}`}catch{return}let s=document.createElement(`style`);s.appendChild(eNe(o,n,i,r)),t.appendChild(s)}function nNe(e,t,n){tNe(e,t,`:before`,n),tNe(e,t,`:after`,n)}var rNe=`application/font-woff`,iNe=`image/jpeg`,aNe={woff:rNe,woff2:rNe,ttf:`application/font-truetype`,eot:`application/vnd.ms-fontobject`,png:`image/png`,jpg:iNe,jpeg:iNe,gif:`image/gif`,tiff:`image/tiff`,svg:`image/svg+xml`,webp:`image/webp`};function oNe(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:``}function eO(e){return aNe[oNe(e).toLowerCase()]||``}function sNe(e){return e.split(/,/)[1]}function tO(e){return e.search(/^(data:)/)!==-1}function cNe(e,t){return`data:${t};base64,${e}`}async function lNe(e,t,n){let r=await fetch(e,t);if(r.status===404)throw Error(`Resource "${r.url}" not found`);let i=await r.blob();return new Promise((e,t)=>
228{let a=new FileReader;a.onerror=t,a.onloadend=()=>{try{e(n({res:r,result:a.result}))}catch(e){t(e)}},a.readAsDataURL(i)})}var nO={};function uNe(e,t,n){let r=e.replace(/\?.*/,``);return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,``)),t?`[${t}]${r}`:r}async function rO(e,t,n){let r=uNe(e,t,n.includeQueryParams);if(nO[r]!=null)return nO[r];n.cacheBust&&(e+=(/\?/.test(e)?`&`:`?`)+new Date().getTime());let i;try{i=cNe(await lNe(e,n.fetchRequestInit,({res:e,result:n})=>(t||=e.headers.get(`Content-Type`)||``,sNe(n))),t)}catch(t){i=n.imagePlaceholder||``;let r=`Failed to fetch resource: ${e}`;t&&(r=typeof t==`string`?t:t.message),r&&console.warn(r)}return nO[r]=i,i}async function dNe(e){let t=e.toDataURL();return t===`data:,`?e.cloneNode(!1):QD(t)}async function fNe(e,t){if(e.currentSrc){let t=document.createElement(`canvas`),n=t.getContext(`2d`);return t.width=e.clientWidth,t.height=e.clientHeight,n?.drawImage(e,0,0,t.width,t.height),QD(t.toDataURL())}let n=e.poster;return QD(await rO(n,eO(n),t))}async function pNe(e,t){try{if(e?.contentDocument?.body)return await aO(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function mNe(e,t){return $D(e,HTMLCanvasElement)?dNe(e):$D(e,HTMLVideoElement)?fNe(e,t):$D(e,HTMLIFrameElement)?pNe(e,t):e.cloneNode(iO(e))}var hNe=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SLOT`,iO=e=>e.tagName!=null&&e.tagName.toUpperCase()===`SVG`;async function gNe(e,t,n){if(iO(t))return t;let r=[];return r=hNe(e)&&e.assignedNodes?JD(e.assignedNodes()):$D(e,HTMLIFrameElement)&&e.contentDocument?.body?JD(e.contentDocument.body.childNodes):JD((e.shadowRoot??e).childNodes),r.length===0||$D(e,HTMLVideoElement)||await r.reduce((e,r)=>e.then(()=>aO(r,n)).then(e=>{e&&t.appendChild(e)}),Promise.resolve()),t}function _Ne(e,t,n){let r=t.style;if(!r)return;let i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):UMe(n).forEach(n=>{let a=i.getPropertyValue(n);n===`font-size`&&a.endsWith(`px`)&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),$D(e,HTMLIFrameElement)&&n===`display`&&a===`inline`&&(a=`block`),n===`d`&&t.getAttribute(`d`)&&(a=`path(${t.getAttribute(`d`)})`),r.setProperty(n,a,i.getPropertyPriority(n))})}function vNe(e,t){$D(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),$D(e,HTMLInputElement)&&t.setAttribute(`value`,e.value)}function yNe(e,t){if($D(e,HTMLSelectElement)){let n=t,r=Array.from(n.children).find(t=>e.value===t.getAttribute(`value`));r&&r.setAttribute(`selected`,``)}}function bNe(e,t,n){return $D(t,Element)&&(_Ne(e,t,n),nNe(e,t,n),vNe(e,t),yNe(e,t)),t}async function xNe(e,t){let n=e.querySelectorAll?e.querySelectorAll(`use`):[];if(n.length===0)return e;let r={};for(let i=0;i<n.length;i++){let a=n[i].getAttribute(`xlink:href`);if(a){let n=e.querySelector(a),i=document.querySelector(a);!n&&i&&!r[a]&&(r[a]=await aO(i,t,!0))}}let i=Object.values(r);if(i.length){let t=`http://www.w3.org/1999/xhtml`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.style.position=`absolute`,n.style.width=`0`,n.style.height=`0`,n.style.overflow=`hidden`,n.style.display=`none`;let r=document.createElementNS(t,`defs`);n.appendChild(r);for(let e=0;e<i.length;e++)r.appendChild(i[e]);e.appendChild(n)}return e}async function aO(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(e=>mNe(e,t)).then(n=>gNe(e,n,t)).then(n=>bNe(e,n,t)).then(e=>xNe(e,t))}var oO=/url\((['"]?)([^'"]+?)\1\)/g,SNe=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,CNe=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function wNe(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}function TNe(e){let t=[];return e.replace(oO,(e,n,r)=>(t.push(r),e)),t.filter(e=>!tO(e))}async function ENe(e,t,n,r,i){try{let a=n?VMe(t,n):t,o=eO(t),s;return s=i?cNe(await i(a),o):await rO(a,o,r),e.replace(wNe(t),`$1${s}$3`)}catch{}return e}function DNe(e,{preferredFontFormat:t}){return t?e.replace(CNe,e=>{for(;;){let[n,,r]=SNe.exec(e)||[];if(!r)return``;if(r===t)return`src: ${n};`}}):e}function sO(e){return e.search(oO)!==-1}
228async function cO(e,t,n){if(!sO(e))return e;let r=DNe(e,n);return TNe(r).reduce((e,r)=>e.then(e=>ENe(e,r,t,n)),Promise.resolve(r))}async function lO(e,t,n){let r=t.style?.getPropertyValue(e);if(r){let i=await cO(r,null,n);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function ONe(e,t){await lO(`background`,e,t)||await lO(`background-image`,e,t),await lO(`mask`,e,t)||await lO(`-webkit-mask`,e,t)||await lO(`mask-image`,e,t)||await lO(`-webkit-mask-image`,e,t)}async function kNe(e,t){let n=$D(e,HTMLImageElement);if(!(n&&!tO(e.src))&&!($D(e,SVGImageElement)&&!tO(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,i=await rO(r,eO(r),t);await new Promise((r,a)=>{e.onload=r,e.onerror=t.onImageErrorHandler?(...e)=>{try{r(t.onImageErrorHandler(...e))}catch(e){a(e)}}:a;let o=e;o.decode&&=r,o.loading===`lazy`&&(o.loading=`eager`),n?(e.srcset=``,e.src=i):e.href.baseVal=i})}async function ANe(e,t){let n=JD(e.childNodes).map(e=>jNe(e,t));await Promise.all(n).then(()=>e)}async function jNe(e,t){$D(e,Element)&&(await ONe(e,t),await kNe(e,t),await ANe(e,t))}function MNe(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(e=>{n[e]=r[e]}),e}var NNe={};async function PNe(e){let t=NNe[e];return t??(t={url:e,cssText:await(await fetch(e)).text()},NNe[e]=t,t)}async function FNe(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async i=>{let a=i.replace(r,`$1`);return a.startsWith(`https://`)||(a=new URL(a,e.url).href),lNe(a,t.fetchRequestInit,({result:e})=>(n=n.replace(i,`url(${e})`),[i,e]))});return Promise.all(i).then(()=>n)}function INe(e){if(e==null)return[];let t=[],n=e.replace(/(\/\*[\s\S]*?\*\/)/gi,``),r=RegExp(`((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)}
228)`,`gi`);for(;;){let e=r.exec(n);if(e===null)break;t.push(e[0])}n=n.replace(r,``);let i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=i.exec(n);if(e===null){if(e=a.exec(n),e===null)break;i.lastIndex=a.lastIndex}else a.lastIndex=i.lastIndex;t.push(e[0])}return t}async function LNe(e,t){let n=[],r=[];return e.forEach(n=>{if(`cssRules`in n)try{JD(n.cssRules||[]).forEach((e,i)=>{if(e.type===CSSRule.IMPORT_RULE){let a=i+1,o=e.href,s=PNe(o).then(e=>FNe(e,t)).then(e=>INe(e).forEach(e=>{try{n.insertRule(e,e.startsWith(`@import`)?a+=1:n.cssRules.length)}catch(t){console.error(`Error inserting rule from remote css`,{rule:e,error:t})}})).catch(e=>{console.error(`Error loading remote css`,e.toString())});r.push(s)}})}catch(i){let a=e.find(e=>e.href==null)||document.styleSheets[0];n.href!=null&&r.push(PNe(n.href).then(e=>FNe(e,t)).then(e=>INe(e).forEach(e=>{a.insertRule(e,a.cssRules.length)})).catch(e=>{console.error(`Error loading remote stylesheet`,e)})),console.error(`Error inlining remote css file`,i)}}),Promise.all(r).then(()=>(e.forEach(e=>{if(`cssRules`in e)try{JD(e.cssRules||[]).forEach(e=>{n.push(e)})}catch(t){console.error(`Error while reading CSS rules from ${e.href}`,t)}}),n))}function RNe(e){return e.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>sO(e.style.getPropertyValue(`src`)))}async function zNe(e,t){if(e.ownerDocument==null)throw Error(`Provided element is not within a Document`);return RNe(await LNe(JD(e.ownerDocument.styleSheets),t))}function BNe(e){return e.trim().replace(/["']/g,``)}function VNe(e){let t=new Set;function n(e){(e.style.fontFamily||getComputedStyle(e).fontFamily).split(`,`).forEach(e=>{t.add(BNe(e))}),Array.from(e.children).forEach(e=>{e instanceof HTMLElement&&n(e)})}return n(e),t}async function HNe(e,t){let n=await zNe(e,t),r=VNe(e);return(await Promise.all(n.filter(e=>r.has(BNe(e.style.fontFamily))).map(e=>{let n=e.parentStyleSheet?e.parentStyleSheet.href:null;return cO(e.cssText,n,t)}))).join(` 229`)}async function UNe(e,t){let n=t.fontEmbedCSS==null?t.skipFonts?null:await HNe(e,t):t.fontEmbedCSS;if(n){let t=document.createElement(`style`),r=document.createTextNode(n);t.appendChild(r),e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}}async function WNe(e,t={}){let{width:n,height:r}=KMe(e,t),i=await aO(e,t,!0);return await UNe(i,t),await jNe(i,t),MNe(i,t),await ZMe(i,n,r)}async function GNe(e,t={}){let{width:n,height:r}=KMe(e,t),i=await QD(await WNe(e,t)),a=document.createElement(`canvas`),o=a.getContext(`2d`),s=t.pixelRatio||qMe(),c=t.canvasWidth||n,l=t.canvasHeight||r;return a.width=c*s,a.height=l*s,t.skipAutoScale||JMe(a),a.style.width=`${c}`,a.style.height=`${l}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(i,0,0,a.width,a.height),a}async function KNe(e,t={}){return await YMe(await GNe(e,t))}var qNe=`[data-slot="dialog-overlay"],[data-slot="dialog-content"],[data-sonner-toaster],[data-capture-exclude]`,JNe=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==`;async function YNe(){let e=document.body,t=await KNe(e,{filter:e=>e instanceof Element?!e.matches(qNe):!0,pixelRatio:Math.min(window.devicePixelRatio||1,2),backgroundColor:getComputedStyle(e).backgroundColor||`#ffffff`,width:e.clientWidth,height:e.clientHeight,imagePlaceholder:JNe});if(!t)throw Error(`Screenshot serialization produced no image`);return t}var XNe=600*1e3,ZNe=90*1024*1024,QNe=[`video/webm;codecs="vp9,opus"`,`video/webm;codecs="vp8,opus"`,`video/webm`,`video/mp4`];function $Ne(){if(!(typeof MediaRecorder>`u`)){for(let e of QNe)if(MediaRecorder.isTypeSupported(e))return e}}function ePe(e){return e.includes(`mp4`)?`mp4`:`webm`}function tPe(){return typeof MediaRecorder<`u`&&!!navigator.mediaDevices?.getDisplayMedia}async function nPe(e){let t;try{t=await navigator.mediaDevices.getDisplayMedia({video:{frameRate:{ideal:15,max:30}},audio:!1,preferCurrentTab:!0,selfBrowserSurface:`include`})}catch(e){if(e instanceof DOMException&&e.name===`NotAllowedError`)return null;throw e}let n=null;try{n=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{n=null}let r=new MediaStream([...t.getVideoTracks(),...n?n.getAudioTracks():[]]),i=$Ne(),a=i?new MediaRecorder(r,{mimeType:i}):new MediaRecorder(r),o=[],s=0,c=!1,l=null,u=null,d=()=>{for(let e of r.getTracks())e.stop();for(let e of t.getTracks())e.stop();if(n)for(let e of n.getTracks())e.stop()},f=()=>{let t=(a.mimeType||i||`video/webm`).split(`;`)[0].trim(),n={blob:new Blob(o,{type:t}),mediaType:t,ext:ePe(t)};l?(l(n),l=null):(p=n,e.onAutoStop())},p=null;a.addEventListener(`dataavailable`,e=>{e.data.size>0&&(o.push(e.data),s+=e.data.size,s>=ZNe&&a.state===`recording`&&a.stop())}),a.addEventListener(`stop`,()=>{c||(c=!0,clearTimeout(h),d(),f())}),a.addEventListener(`error`,()=>{c||(c=!0,clearTimeout(h),d(),u&&u(Error(`Screen recording failed`)))});let m=t.getVideoTracks()[0];m&&m.addEventListener(`ended`,()=>{a.state===`recording`&&a.stop()});let h=setTimeout(()=>{a.state===`recording`&&a.stop()},XNe);return a.start(1e3),{stop:()=>new Promise((e,t)=>
229{if(p){e(p);return}if(c){t(Error(`Recording already ended`));return}l=e,u=t,a.state===`recording`&&a.stop()})}}var rPe=5,iPe=10*1024*1024,aPe=100*1024*1024,oPe=new Set([`image/png`,`image/jpeg`,`image/webp`,`image/gif`,`video/webm`,`video/mp4`,`audio/webm`,`audio/mp4`,`audio/mpeg`,`audio/ogg`]),uO=null,sPe=0;function cPe(e){return e.split(`;`)[0].trim().toLowerCase()}function dO(e){return e.startsWith(`image/`)?iPe:aPe}const fO=Pb((e,t)=>({dialogOpen:!1,subject:null,pendingAttachments:[],recording:`idle`,submitProgress:null,openDialog:t=>e(t?{dialogOpen:!0,subject:t}:{dialogOpen:!0}),closeDialog:()=>{for(let e of t().pendingAttachments)URL.revokeObjectURL(e.previewUrl);e({dialogOpen:!1,subject:null,pendingAttachments:[],submitProgress:null})},clearSubject:()=>e({subject:null}),setSubmitProgress:t=>e({submitProgress:t}),clearAttachments:()=>{for(let e of t().pendingAttachments)URL.revokeObjectURL(e.previewUrl);e({pendingAttachments:[]})},addBlob:(n,r,i)=>{let{pendingAttachments:a}=t();if(a.length>=rPe)return G.error(H.t(`support.capture.max_attachments`,{count:rPe})),!1;let o=cPe(n.type);if(!oPe.has(o))return G.error(H.t(`support.capture.unsupported_type`,{type:n.type||`unknown`})),!1;if(n.size>dO(o)){let e=Math.round(dO(o)/(1024*1024));return G.error(H.t(`support.capture.too_large`,{filename:i,max:e})),!1}let s={id:`att-${sPe++}`,blob:n,kind:r,mediaType:o,filename:i,previewUrl:URL.createObjectURL(n)};return e({pendingAttachments:[...a,s]}),!0},addFiles:e=>{for(let n of Array.from(e))if(!t().addBlob(n,`upload`,n.name))break},removeAttachment:n=>{let{pendingAttachments:r}=t(),i=r.find(e=>e.id===n);i&&URL.revokeObjectURL(i.previewUrl),e({pendingAttachments:r.filter(e=>e.id!==n)})},captureScreenshotAndOpen:async()=>{try{let e=await YNe();t().addBlob(e,`screenshot`,`screenshot-${Date.now()}.png`)}catch(e){X(e,{operation:`feedback.captureScreenshot`}),G.error(H.t(`support.capture.screenshot_failed`))}t().openDialog()},addScreenshotToDialog:async()=>{try{let e=await YNe();t().addBlob(e,`screenshot`,`screenshot-${Date.now()}.png`)}catch(e){X(e,{operation:`feedback.captureScreenshot`}),G.error(H.t(`support.capture.screenshot_failed_short`))}},startRecording:async()=>{if(t().recording===`idle`){if(!tPe()){G.error(H.t(`support.capture.recording_unsupported`));return}e({recording:`starting`});try{let n=await nPe({onAutoStop:()=>{t().stopRecording()}});if(n==null){e({recording:`idle`});return}uO=n,e({recording:`recording`})}catch(t){e({recording:`idle`}),X(t,{operation:`feedback.startRecording`}),G.error(H.t(`support.capture.recording_start_failed`))}}},stopRecording:async()=>{let n=uO;if(!(!n||t().recording!==`recording`)){e({recording:`processing`});try{let{blob:e,ext:r}=await n.stop();t().addBlob(e,`recording`,`recording-${Date.now()}.${r}`),t().openDialog()}catch(e){X(e,{operation:`feedback.stopRecording`}),G.error(H.t(`support.capture.recording_failed`))}finally{uO=null,e({recording:`idle`})}}}}));Fpe(()=>fO.getState().openDialog());function pO(e){fO.getState().openDialog(e)}function mO({subject:e,className:t,iconClassName:n}){let{t:r}=V(),i=r(`report_issue.tooltip`),a=(0,K.jsx)(f_,{className:q(`size-3.5`,n)});return t?(0,K.jsx)(`button`,{type:`button`,className:t,onClick:()=>pO(e),title:i,"aria-label":i,children:a}):(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 text-muted-foreground hover:text-foreground`,onClick:()=>pO(e),title:i,"aria-label":i,children:a})}function lPe({subject:e}){let{t}=V();return(0,K.jsxs)(VD,{onSelect:()=>pO(e),children:[(0,K.jsx)(f_,{className:`size-4`}),t(`report_issue.menu_item`)]})}var hO=null,gO=null;async function uPe(){return hO||gO||(gO=(async()=>{let[{Tiktoken:e},t]=await Promise.all([ev(()=>import(`./lite-pwQ7MXgZ.js`),[]),ev(()=>import(`./cl100k_base-Bg3oEZ27.js`),[])]);return hO=new e(t.default),hO})(),gO)}async function dPe(e){return e?(await uPe()).encode(e).length:0}function _O(e){return e?Math.ceil(e.length/3.5):0}function vO({...e}){return(0,K.jsx)(kje,{"data-slot":`select`,...e})}function yO({...e}){return(0,K.jsx)(jje,{"data-slot":`select-value`,...e})}function bO({className:e,size:t=`default`,children:n,...r}){return(0,K.jsxs)(Aje,{"data-slot":`select-trigger`,"data-size":t,className:q(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,K.jsx)(Mje,{asChild:!0,children:(0,K.jsx)(Rg,{className:`size-4 opacity-50`})})]})}function xO({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,K.jsx)(Nje,{children:(0,K.jsxs)(Pje,{"data-slot":`select-content`,className:q(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
229de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,K.jsx)(fPe,{}),(0,K.jsx)(Fje,{className:q(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,K.jsx)(pPe,{})]})})}function SO({className:e,children:t,...n}){return(0,K.jsxs)(Ije,{"data-slot":`select-item`,className:q(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,K.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,K.jsx)(Rje,{children:(0,K.jsx)(Lg,{className:`size-4`})})}),(0,K.jsx)(Lje,{children:t})]})}function fPe({className:e,...t}){return(0,K.jsx)(zje,{"data-slot":`select-scroll-up-button`,className:q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,K.jsx)(aoe,{className:`size-4`})})}function pPe({className:e,...t}){return(0,K.jsx)(Bje,{"data-slot":`select-scroll-down-button`,className:q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,K.jsx)(Rg,{className:`size-4`})})}const mPe=({size:e=void 0,color:t=`currentColor`,strokeWidth:n=2,background:r=`transparent`,opacity:i=1,rotation:a=0,shadow:o=0,flipHorizontal:s=!1,flipVertical:c=!1,padding:l=0,className:u=void 0})=>{let d=[];return a!==0&&d.push(`rotate(${a}deg)`),s&&d.push(`scaleX(-1)`),c&&d.push(`scaleY(-1)`),(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`${-l} ${-l} ${256+l*2} ${256+l*2}`,width:e,height:e,fill:t,strokeWidth:n,className:u,style:{opacity:i,transform:d.join(` `)||void 0,filter:o>0?`drop-shadow(0 ${o}px ${o*2}px rgba(0,0,0,0.3))`:void 0,backgroundColor:r===`transparent`?void 0:r},children:(0,K.jsx)(`path`,{d:`M239.184 106.203a64.72 64.72 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.72 64.72 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.67 64.67 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.77 64.77 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483m-97.56 136.338a48.4 48.4 0 0 1-31.105-11.255l1.535-.87l51.67-29.825a8.6 8.6 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601M37.158 197.93a48.35 48.35 0 0 1-5.781-32.589l1.534.921l51.722 29.826a8.34 8.34 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803M23.549 85.38a48.5 48.5 0 0 1 25.58-21.333v61.39a8.29 8.29 0 0 0 4.195 7.316l62.874 36.272l-21.845 12.636a.82.82 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405zm179.466 41.695l-63.08-36.63L161.73 77.86a.82.82 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.54 8.54 0 0 0-4.4-7.213m21.742-32.69l-1.535-.922l-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.72.72 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391zM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87l-51.67 29.825a8.6 8.6 0 0 0-4.246 7.367zm11.868-25.58L128.067 97.3l28.188 16.218v32.434l-28.086 16.218l-28.188-16.218z`})})},hPe=({size:e=void 0,color:t=`currentColor`,strokeWidth:n=2,background:r=`transparent`,opacity:i=1,rotation:a=0,shadow:o=0,flipHorizontal:s=!1,flipVertical:c=!1,padding:l=0,className:u=void 0})=>{let d=[];return a!==0&&d.push(`rotate(${a}
229deg)`),s&&d.push(`scaleX(-1)`),c&&d.push(`scaleY(-1)`),(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`${-l} ${-l} ${256+l*2} ${256+l*2}`,width:e,height:e,fill:`none`,stroke:t,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`,className:u,style:{opacity:i,transform:d.join(` `)||void 0,filter:o>0?`drop-shadow(0 ${o}px ${o*2}px rgba(0,0,0,0.3))`:void 0,backgroundColor:r===`transparent`?void 0:r},children:(0,K.jsx)(`path`,{fill:`#D97757`,d:`m50.228 170.321l50.357-28.257l.843-2.463l-.843-1.361h-2.462l-8.426-.518l-28.775-.778l-24.952-1.037l-24.175-1.296l-6.092-1.297L0 125.796l.583-3.759l5.12-3.434l7.324.648l16.202 1.101l24.304 1.685l17.629 1.037l26.118 2.722h4.148l.583-1.685l-1.426-1.037l-1.101-1.037l-25.147-17.045l-27.22-18.017l-14.258-10.37l-7.713-5.25l-3.888-4.925l-1.685-10.758l7-7.713l9.397.649l2.398.648l9.527 7.323l20.35 15.75L94.817 91.9l3.889 3.24l1.555-1.102l.195-.777l-1.75-2.917l-14.453-26.118l-15.425-26.572l-6.87-11.018l-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0l10.63 1.426l4.472 3.888l6.61 15.101l10.694 23.786l16.591 32.34l4.861 9.592l2.592 8.879l.973 2.722h1.685v-1.556l1.36-18.211l2.528-22.36l2.463-28.776l.843-8.1l4.018-9.722l7.971-5.25l6.222 2.981l5.12 7.324l-.713 4.73l-3.046 19.768l-5.962 30.98l-3.889 20.739h2.268l2.593-2.593l10.499-13.934l17.628-22.036l7.778-8.749l9.073-9.657l5.833-4.601h11.018l8.1 12.055l-3.628 12.443l-11.342 14.388l-9.398 12.184l-13.48 18.147l-8.426 14.518l.778 1.166l2.01-.194l30.46-6.481l16.462-2.982l19.637-3.37l8.88 4.148l.971 4.213l-3.5 8.62l-20.998 5.184l-24.628 4.926l-36.682 8.685l-.454.324l.519.648l16.526 1.555l7.065.389h17.304l32.21 2.398l8.426 5.574l5.055 6.805l-.843 5.184l-12.962 6.611l-17.498-4.148l-40.83-9.721l-14-3.5h-1.944v1.167l11.666 11.406l21.387 19.314l26.767 24.887l1.36 6.157l-3.434 4.86l-3.63-.518l-23.526-17.693l-9.073-7.972l-20.545-17.304h-1.36v1.814l4.73 6.935l25.017 37.59l1.296 11.536l-1.814 3.76l-6.481 2.268l-7.13-1.297l-14.647-20.544l-15.1-23.138l-12.185-20.739l-1.49.843l-7.194 77.448l-3.37 3.953l-7.778 2.981l-6.48-4.925l-3.436-7.972l3.435-15.749l4.148-20.544l3.37-16.333l3.046-20.285l1.815-6.74l-.13-.454l-1.49.194l-15.295 20.999l-23.267 31.433l-18.406 19.702l-4.407 1.75l-7.648-3.954l.713-7.064l4.277-6.286l25.47-32.405l15.36-20.092l9.917-11.6l-.065-1.686h-.583L44.07 198.125l-12.055 1.555l-5.185-4.86l.648-7.972l2.463-2.593l20.35-13.999z`})})},gPe=({size:e=void 0,color:t=`currentColor`,strokeWidth:n=2,background:r=`transparent`,opacity:i=1,rotation:a=0,shadow:o=0,flipHorizontal:s=!1,flipVertical:c=!1,padding:l=0,className:u=void 0})=>{let d=[];return a!==0&&d.push(`rotate(${a}deg)`),s&&d.push(`scaleX(-1)`),c&&d.push(`scaleY(-1)`),(0,K.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`${.36-l} ${.5-l} ${33.33+l*2} ${32+l*2}`,width:e,height:e,fill:t,strokeWidth:n,className:u,style:{opacity:i,transform:d.join(` `)||void 0,filter:o>0?`drop-shadow(0 ${o}px ${o*2}px rgba(0,0,0,0.3))`:void 0,backgroundColor:r===`transparent`?void 0:r},children:[(0,K.jsx)(`path`,{d:`M13.2371 21.0407L24.3186 12.8506C24.8619 12.4491 25.6384 12.6057 25.8973 13.2294C27.2597 16.5185 26.651 20.4712 23.9403 23.1851C21.2297 25.8989 17.4581 26.4941 14.0108 25.1386L10.2449 26.8843C15.6463 30.5806 22.2053 29.6665 26.304 25.5601C29.5551 22.3051 30.562 17.8683 29.6205 13.8673L29.629 13.8758C28.2637 7.99809 29.9647 5.64871 33.449 0.844576C33.5314 0.730667 33.6139 0.616757 33.6964 0.5L29.1113 5.09055V5.07631L13.2343 21.0436`}),(0,K.jsx)(`path`,{d:`M10.9503 23.0313C7.07343 19.3235 7.74185 13.5853 11.0498 10.2763C13.4959 7.82722 17.5036 6.82767 21.0021 8.2971L24.7595 6.55998C24.0826 6.07017 23.215 5.54334 22.2195 5.17313C17.7198 3.31926 12.3326 4.24192 8.67479 7.90126C5.15635 11.4239 4.0499 16.8403 5.94992 21.4622C7.36924 24.9165 5.04257 27.3598 2.69884 29.826C1.86829 30.7002 1.0349 31.5745 0.36364 32.5L10.9474 23.0341`})]})};function _Pe(e){let t=e.toLowerCase();return t.includes(`claude`)?hPe:t.includes(`gpt`)?mPe:t.includes(`grok`)?gPe:Y_}function vPe(){let e=Q(e=>e.chatModels),t=Q(e=>e.selectedChatModel),n=Q(e=>e.setSelectedChatModel),r=Q(e=>e.fetchChatModels),{t:i}=V();(0,B.useEffect)(()=>{e.length===0&&r()},[e.length,r]);let a=e=>i(`settings.billing.plan_${e}`,{defaultValue:e});return(0,K.jsxs)(vO,{value:t,onValueChange:t=>{e.find(e=>e.slug===t)?.allowed&&n(t)},children:[(0,K.jsx)(bO,{size:`sm`,className:`w-full max-w-48`,children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:e.map(e=>{let t=e.allowed?_Pe(e.display_name):g_;return(0,K.jsxs)(SO,{value:e.slug,disabled:!e.allowed,children:[(0,K.jsx)(t,{className:`size-4`}),e.display_name,e.allowed?null:(0,K.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground`,children:i(`chat.model_picker.requires_plan`,{plan:a(e.min_plan)})})]},e.slug)})})]})}function yPe(){let e=Q(e=>e.chatModels),t=Q(e=>e.selectedChatModel),n=Q(e=>e.selectedThinkingLevel),r=Q(e=>e.setSelectedThinkingLevel),{t:i}=V(),a=e.find(e=>e.slug===t),o=a?.thinking_levels;return!o||o.length===0?null:(0,K.jsxs)(vO,{value:n,onValueChange:r,children:[(0,K.jsxs)(bO,{size:`sm`,className:`w-auto max-w-40`,"aria-label":i(`chat.thinking.label`),title:i(`chat.thinking.label`),children:[(0,K.jsx)(toe,{className:`size-4`}),(0,K.jsx)(yO,{})]}),(0,K.jsx)(xO,{children:o.map(e=>(0,K.jsxs)(SO,{value:e,children:[i(`chat.thinking.${e}`,{defaultValue:e}),e===a?.default_thinking_level?(0,K.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground`,children:i(`chat.thinking.default_suffix`)}):null]},e))})]})}const bPe=e=>`/api/v1/chat/benchmarks/${e}/prefer`,xPe=async(e,t,n)=>Z(bPe(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),SPe=e=>`/api/v1/chat/benchmarks/${e}/continue`,CPe=async(e,t,n)=>Z(SPe(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),wPe=e=>`/api/v1/chat/benchmarks/${e}/discard`,TPe=async(e,t)=>Z(wPe(e),{...t,method:`POST`}),EPe=e=>{let t=new URLSearchParams;Object.entries(e||{}
229).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/chat/benchmarks?${n}`:`/api/v1/chat/benchmarks`},DPe=async(e,t)=>Z(EPe(e),{...t,method:`GET`});function OPe(e,t,n){return{side:e,slug:t,displayName:n,content:``,citations:[],toolActivities:[],error:null,status:`pending`}}function kPe(e){return{side:e.side,displayName:e.displayName,content:e.content,citations:e.citations,toolActivities:e.toolActivities,error:e.error,streaming:e.status===`pending`||e.status===`streaming`,hasContent:e.content.trim().length>0}}function APe(e){return{runId:e.runId,status:e.status,userMessageId:e.userMessageId,winnerMessageId:null,winner:null,preferredSide:null,canDiscard:!1,prompt:e.prompt,sides:[kPe(e.a),kPe(e.b)]}}function jPe(e){let t=new Date().toISOString(),n=e=>({side:e.side,slug:e.slug,display_name:e.displayName,response:e.content||null,citations:e.citations,error:e.error,interrupted:!1});return{id:e.runId??``,conversation_id:e.conversationId,user_message_id:e.userMessageId,prompt:e.prompt,status:`open`,winner:null,winner_message_id:null,preferred_side:null,created_at:t,updated_at:t,sides:[n(e.a),n(e.b)]}}function MPe(e,t){let n=e.sides.find(e=>e.side===t);return{side:t,displayName:n?.display_name??t.toUpperCase(),content:n?.response??``,citations:n?.citations??[],toolActivities:[],error:n?.error??null,streaming:!1,hasContent:!!n?.response&&n.response.trim().length>0}}function NPe(e){return{runId:e.id,status:e.status,userMessageId:e.user_message_id??null,winnerMessageId:e.winner_message_id??null,winner:e.winner??null,preferredSide:e.preferred_side??null,canDiscard:!1,prompt:e.prompt,sides:[MPe(e,`a`),MPe(e,`b`)]}}function CO(e,t){let n=e.findIndex(e=>e.id===t.id);if(n===-1)return[...e,t];let r=e.slice();return r[n]=t,r}function wO(e){return e===`open`||e===`streaming`}function PPe(e,t,n){if(e)return{a:{slug:e.a.slug,displayName:e.a.display_name},b:{slug:e.b.slug,displayName:e.b.display_name}};let r=(n?t[n]??[]:[]).filter(e=>wO(e.status)),i=r[r.length-1];if(!i)return null;let a=i.sides.find(e=>e.side===`a`),o=i.sides.find(e=>e.side===`b`);return!a||!o?null:{a:{slug:a.slug,displayName:a.display_name},b:{slug:o.slug,displayName:o.display_name}}}function FPe(e){return e.startsWith(`usage_limit:`)?e.slice(12):e.startsWith(`context_limit:`)?H.t(`chat.benchmark.context_limit`):e}var IPe={setupOpen:!1,armed:null,active:null,runsByConversation:{},abortController:null,mutating:!1};const TO=Pb((e,t)=>({...IPe,openSetup:()=>e({setupOpen:!0}),closeSetup:()=>e({setupOpen:!1}),arm:(t,n)=>e({armed:{a:t,b:n},setupOpen:!1}),disarm:()=>e({armed:null}),runBenchmark:async(n,r)=>{let i=t();if(i.active?.status===`streaming`)return;let a=LS.getState().conversationId,o=PPe(i.armed,i.runsByConversation,a);if(!o)return;i.armed&&t().disarm();let s=`temp-bench-user-${Date.now()}`,c={id:s,conversation_id:a||``,role:`user`,content:n,created_at:new Date().toISOString()};LS.setState(e=>({messages:[...e.messages,c]}));let l=new AbortController;e({active:{runId:null,conversationId:a,userMessageId:s,prompt:n,status:`streaming`,a:OPe(`a`,o.a.slug,o.a.displayName),b:OPe(`b`,o.b.slug,o.b.displayName)},abortController:l});let u=(t,n)=>e(e=>e.active?{active:{...e.active,[t]:{...e.active[t],...n}}}:{}),d=()=>{let e=t().active?.userMessageId;e&&LS.setState(t=>({messages:t.messages.filter(t=>t.id!==e)}))},f=()=>{let n=t().active,r=n?.conversationId??null;if(n&&r){let i=jPe(n);e(e=>({active:null,abortController:null,runsByConversation:{...e.runsByConversation,[r]:CO(e.runsByConversation[r]??[],i)}})),t().loadRunsForConversation(r)}else e({active:null,abortController:null})};try{await Ghe({content:n,conversation_id:a||void 0,model_a:o.a.slug,model_b:o.b.slug,document_ids:r?.document_ids,inject_document_ids:r?.inject_document_ids,knowledge_base_id:r?.knowledge_base_id,matter_id:r?.matter_id,org_profile_id:r?.org_profile_id,chat_mode:r?.chat_mode??`chat`},{onStart:t=>{LS.setState(e=>{let{new:n,...i}=e.personaOverrides;return{conversationId:t.conversation_id,personaOverrides:i,messages:e.messages.map(e=>e.id===s?{...e,id:t.user_message_id,conversation_id:t.conversation_id}:e),...a?{}:{current_conversation:{id:t.conversation_id,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),org_profile_id:r?.org_profile_id??null}}}}),e(e=>e.active?{active:{...e.active,runId:t.run_id,conversationId:t.conversation_id,userMessageId:t.user_message_id}}:{})},onSideStart:e=>u(e.side,{status:`streaming`,citations:e.citations??[]}),onDelta:t=>e(e=>e.active?{active:{...e.active,[t.side]:{...e.active[t.side],content:e.active[t.side].content+t.text,status:`streaming`}}}:{}),onToolCall:t=>e(e=>{if(!e.active)return{};let n={id:t.id,name:t.name,input:t.input,status:`pending`};return{active:{...e.active,[t.side]:{...e.active[t.side],toolActivities:[...e.active[t.side].toolActivities,n]}}}}),onToolResult:t=>e(e=>{if(!e.active)return{};let n=e.active[t.side];return{active:{...e.active,[t.side]:{...n,toolActivities:n.toolActivities.map(e=>e.id===t.id?{...e,status:`done`,result:t.result}:e)}}}}),onStreamRestart:e=>u(e.side,{content:``}),onSideDone:t=>e(e=>{if(!e.active)return{};let n=e.active[t.side];return{active:{...e.active,[t.side]:{...n,status:n.status===`error`?`error`:`done`}}}}),onSideError:e=>u(e.side,{status:`error`,error:e.error}),onDone:t=>{t.status===`failed`?(d(),e({active:null,abortController:null}),G.error(H.t(`chat.benchmark.both_failed`))):f(),a||LS.getState().loadConversations()},onError:n=>{t().active?.runId?f():(d(),e({active:null,abortController:null})),G.error(FPe(n)),X(Error(n),{operation:`benchmark_stream`})},onInterrupted:()=>{f()}},l.signal)}catch(n){t().active?.runId||(d(),e({active:null,abortController:null})),Y(n,H.t(`chat.benchmark.stream_failed`),{operation:`run_benchmark`})}},cancelActive:()=>{let{abortController:n}=t();n?.abort();let r=t().active,i=r?.conversationId??null;if(r&&i){let n=jPe(r);e(e=>({active:null,abortController:null,runsByConversation:{...e.runsByConversation,[i]:CO(e.runsByConversation[i]??[],n)}})),t().loadRunsForConversation(i)}else e({active:null,abortController:null})},prefer:async(n,r)=>{let i=t=>e(e=>{let r={},i=!1;for(let[a,o]of Object.entries(e.runsByConversation)){let e=o.findIndex(e=>e.id===n);if(e===-1){r[a]=o;continue}let s=o.slice();s[e]={...s[e],preferred_side:t},r[a]=s,i=!0}return i?{runsByConversation:r}:{}}),a=(()=>{for(let e of Object.values(t().runsByConversation)){let t=e.find(e=>e.id===n);if(t)return t.preferred_side??null}return null})();i(r);try{let t=(await xPe(n,{side:r})).data,i=t.conversation_id??null;i&&e(e=>({runsByConversation:{...e.runsByConversation,[i]:CO(e.runsByConversation[i]??[],t)}}))}catch(e){i(a),Y(e,H.t(`chat.benchmark.prefer_failed`),{operation:`benchmark_prefer`})}},continueWith:async(n,r)=>{if(!t().mutating){e({mutating:!0});try{let{conversation_id:i}=(await CPe(n,{side:r})).data;await LS.getState().loadConversation(i),await t().loadRunsForConversation(i),e({mutating:!1,active:null,abortController:null})}catch(t){e({mutating:!1}),Y(t,H.t(`chat.benchmark.continue_failed`),{operation:`benchmark_continue`})}}},discard:async n=>{if(t().mutating)return;e({mutating:!0});
229let r=t().active,i=r?.runId===n?r.userMessageId:null;if(!i)for(let e of Object.values(t().runsByConversation)){let t=e.find(e=>e.id===n);if(t?.user_message_id){i=t.user_message_id;break}}try{let t=(await TPe(n)).data,a=t.conversation_id??r?.conversationId??null;if(i){let e=i;LS.setState(t=>({messages:t.messages.filter(t=>t.id!==e)}))}e(e=>({mutating:!1,active:e.active?.runId===n?null:e.active,runsByConversation:a?{...e.runsByConversation,[a]:CO(e.runsByConversation[a]??[],t)}:e.runsByConversation}))}catch(t){e({mutating:!1}),Y(t,H.t(`chat.benchmark.discard_failed`),{operation:`benchmark_discard`})}},loadRunsForConversation:async t=>{try{let n=(await DPe({conversation_id:t})).data.runs;e(e=>({runsByConversation:{...e.runsByConversation,[t]:n}}))}catch(e){X(e,{operation:`load_benchmark_runs`})}}}));function LPe(e){return TO(t=>t.active&&t.active.conversationId===e&&t.active.status===`streaming`?!0:!!(e?t.runsByConversation[e]:null)?.some(e=>e.status===`streaming`))}function RPe(e){return TO(t=>t.armed||t.active&&t.active.conversationId===e&&wO(t.active.status)?!0:!!(e?t.runsByConversation[e]:null)?.some(e=>wO(e.status)))}function zPe(e){let t=TO(e=>e.armed),n=TO(e=>e.runsByConversation);return(0,B.useMemo)(()=>PPe(t,n,e),[t,n,e])}function BPe(e,t,n){let r=n?t[n]??[]:[],i={},a={};for(let e of r)(e.status===`collapsed`||e.status===`voted`)&&e.winner_message_id?i[e.winner_message_id]=NPe(e):wO(e.status)&&e.user_message_id&&(a[e.user_message_id]=NPe(e));if(e&&e.conversationId===n&&wO(e.status)&&e.userMessageId&&e.userMessageId&&(a[e.userMessageId]=APe(e)),!(e&&wO(e.status)&&e.status===`streaming`||r.some(e=>e.status===`streaming`))){let e=r.filter(e=>e.status===`open`),t=e[e.length-1];t?.user_message_id&&a[t.user_message_id]&&(a[t.user_message_id]={...a[t.user_message_id],canDiscard:!0})}return{collapsedByMessageId:i,openByUserMessageId:a}}function VPe(){let{t:e}=V(),t=zPe(LS(e=>e.conversationId));if(!t)return null;let n=[t.a,t.b];return(0,K.jsx)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-primary/40 bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary`,title:e(`chat.benchmark.dual_badge`,{a:t.a.displayName,b:t.b.displayName}),children:n.map((t,n)=>{let r=_Pe(t.displayName);return(0,K.jsxs)(B.Fragment,{children:[n>0&&(0,K.jsx)(`span`,{className:`text-primary/60`,children:e(`chat.benchmark.vs`)}),(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(r,{className:`size-3.5`}),(0,K.jsx)(`span`,{className:`max-w-24 truncate`,children:t.displayName})]})]},t.slug)})})}var HPe=1,UPe=.9,WPe=.8,GPe=.17,EO=.1,DO=.999,KPe=.9999,qPe=.99,JPe=/[\\\/_+.#"@\[\(\{&]/,YPe=/[\\\/_+.#"@\[\(\{&]/g,XPe=/[\s-]/,OO=/[\s-]/g;function kO(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?HPe:qPe;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=kO(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=HPe:JPe.test(e.charAt(l-1))?(d*=WPe,p=e.slice(i,l-1).match(YPe),p&&i>0&&(d*=DO**+p.length)):XPe.test(e.charAt(l-1))?(d*=UPe,m=e.slice(i,l-1).match(OO),m&&i>0&&(d*=DO**+m.length)):(d*=GPe,i>0&&(d*=DO**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=KPe)),(d<EO&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=kO(e,t,n,r,l+1,a+2,o),f*EO>d&&(d=f*EO)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function AO(e){return e.toLowerCase().replace(OO,` `)}function ZPe(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,kO(e,t,AO(e),AO(t),0,0,{})}var jO=`[cmdk-group=""]`,MO=`[cmdk-group-items=""]`,QPe=`[cmdk-group-heading=""]`,NO=`[cmdk-item=""]`,PO=`${NO}:not([aria-disabled="true"])`,FO=`cmdk-item-select`,IO=`data-value`,$Pe=(e,t,n
vendor: 9,597 bytes, line 229
229)=>ZPe(e,t,n),LO=B.createContext(void 0),RO=()=>B.useContext(LO),zO=B.createContext(void 0),BO=()=>B.useContext(zO),VO=B.createContext(void 0),HO=B.forwardRef((e,t)=>{let n=KO(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=KO(()=>new Set),i=KO(()=>new Map),a=KO(()=>new Map),o=KO(()=>new Set),s=WO(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=GS(),y=GS(),b=GS(),x=B.useRef(null),S=uFe();GO(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),GO(()=>{S(6,k)},[]);let C=B.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=B.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??$Pe;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(MO);t?t.appendChild(e.parentElement===t?e:e.closest(`${MO} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${MO} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${jO}[${IO}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(IO);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(jO)?.querySelector(QPe))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${NO}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(PO)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(IO))}function N(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(IO))}function P(e){let t=A()?.closest(jO),n;for(;t&&!n;)t=e>0?cFe(t,jO):lFe(t,jO),n=t?.querySelector(PO);n?C.setState(`value`,n.getAttribute(IO)):N(e)}let F=()=>M(j().length-1),I=e=>{e.preventDefault(),e.metaKey?F():e.altKey?P(1):N(1)},L=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?P(-1):N(-1)};return B.createElement(qS.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:g&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),F();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(FO);t.dispatchEvent(e)}}}}},B.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:fFe},c),YO(e,e=>B.createElement(zO.Provider,{value:C},B.createElement(LO.Provider,{value:w},e))))}),eFe=B.forwardRef((e,t)=>{let n=GS(),r=B.useRef(null),i=B.useContext(VO),a=RO(),o=WO(e),s=o.current?.forceMount??i?.forceMount;GO(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=JO(n,r,[e.value,e.children,r],e.keywords),l=BO(),u=qO(e=>e.value&&e.value===c.current),d=qO(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);B.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(FO,f),()=>t.removeEventListener(FO,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return B.createElement(qS.div,{ref:$v(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),tFe=B.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=GS(),s=B.useRef(null),c=B.useRef(null),l=GS(),u=RO(),d=qO(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);GO(()=>u.group(o),[]),JO(o,s,[e.value,e.heading,c]);let f=B.useMemo(()=>({id:o,forceMount:i}),[i]);return B.createElement(qS.div,{ref:$v(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&B.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),YO(e,e=>B.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},B.createElement(VO.Provider,{value:f},e))))}),nFe=B.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=B.useRef(null),a=qO(e=>!e.search);return!n&&!a?null:B.createElement(qS.div,{ref:$v(i,t),...r,"cmdk-separator":``,role:`separator`})}),rFe=B.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=BO(),o=qO(e=>e.search),s=qO(e=>e.selectedItemId),c=RO();return B.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),B.createElement(qS.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),iFe=B.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=B.useRef(null),o=B.useRef(null),s=qO(e=>e.selectedItemId),c=RO();return B.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),B.createElement(qS.div,{ref:$v(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},YO(e,e=>B.createElement(`div`,{ref:$v(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),aFe=B.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return B.createElement(FC,{open:n,onOpenChange:r},B.createElement(IC,{container:o},B.createElement(LC,{"cmdk-overlay":``,className:i}),B.createElement(RC,{"aria-label":e.label,"cmdk-dialog":``,className:a},B.createElement(HO,{ref:t,...s}))))}),oFe=B.forwardRef((e,t)=>qO(e=>e.filtered.count===0)?B.createElement(qS.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),sFe=B.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return B.createElement(qS.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},YO(e,e=>B.createElement(`div`,{"aria-hidden":!0},e)))}),UO=Object.assign(HO,{List:iFe,Item:eFe,Input:rFe,Group:tFe,Separator:nFe,Dialog:aFe,Empty:oFe,Loading:sFe});function cFe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function lFe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function WO(e){let t=B.useRef(e);return GO(()=>{t.current=e}),t}var GO=typeof window>`u`?B.useEffect:B.useLayoutEffect;function KO(e){let t=B.useRef();return t.current===void 0&&(t.current=e()),t}function qO(e){let t=BO(),n=()=>e(t.snapshot());return B.useSyncExternalStore(t.subscribe,n,n)}function JO(e,t,n,r=[]){let i=B.useRef(),a=RO();return GO(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(IO,s),i.current=s}),i}var uFe=()=>
229{let[e,t]=B.useState(),n=KO(()=>new Map);return GO(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function dFe(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function YO({asChild:e,children:t},n){return e&&B.isValidElement(t)?B.cloneElement(dFe(t),{ref:t.ref},n(t.props.children)):n(t)}var fFe={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function XO({className:e,...t}){return(0,K.jsx)(UO,{"data-slot":`command`,className:q(`bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md`,e),...t})}function ZO({className:e,...t}){return(0,K.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,K.jsx)(A_,{className:`size-4 shrink-0 opacity-50`}),(0,K.jsx)(UO.Input,{"data-slot":`command-input`,className:q(`placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function QO({className:e,...t}){return(0,K.jsx)(UO.List,{"data-slot":`command-list`,className:q(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...t})}function $O({...e}){return(0,K.jsx)(UO.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function ek({className:e,...t}){return(0,K.jsx)(UO.Group,{"data-slot":`command-group`,className:q(`text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium`,e),...t})}function tk({className:e,...t}){return(0,K.jsx)(UO.Separator,{"data-slot":`command-separator`,className:q(`bg-border -mx-1 h-px`,e),...t})}function nk({className:e,...t}){return(0,K.jsx)(UO.Item,{"data-slot":`command-item`,className:q(`data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...t})}const pFe=({closeMenu:e})=>{let{t}=V(),n=Sv(),{knowledgeBases:r,selectedKnowledgeBase:i,fetchKnowledgeBases:a,setSelectedKnowledgeBase:o}=Q();(0,B.useEffect)(()=>{r.length===0&&a()},[r.length,a]);let s=()=>{e(),n(`/vault/library`)},c=t=>{let n=r.find(e=>e.id===t);n&&(o(n),LS.getState().clearEmailScope()),e()};return(0,K.jsxs)(GD,{children:[(0,K.jsxs)(KD,{children:[(0,K.jsx)(moe,{}),(0,K.jsx)(`span`,{className:`truncate max-w-40`,children:i?.name||t(`chat.knowledge_base`)})]}),(0,K.jsx)(qD,{className:`p-0`,children:(0,K.jsxs)(XO,{className:`max-w-sm`,children:[(0,K.jsx)(ZO,{placeholder:t(`knowledge_bases.select_kb`),onKeyDown:e=>e.stopPropagation()}),(0,K.jsxs)(QO,{children:[(0,K.jsx)($O,{children:t(`common.no_results`)}),(0,K.jsx)(nk,{onSelect:s,children:(0,K.jsxs)(`div`,{className:`flex items-center w-full`,children:[(0,K.jsx)(T_,{size:16,className:`me-2`}),(0,K.jsx)(`span`,{className:`text-xs`,children:t(`knowledge_bases.new_kb`)})]})}),(0,K.jsx)(tk,{}),(0,K.jsxs)(ek,{heading:t(`knowledge_bases.title`),children:[i&&(0,K.jsx)(nk,{onSelect:()=>{o(null),LS.getState().clearEmailScope(),e()},children:(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:t(`chat.knowledge_base_all`)})}),r.map(e=>(0,K.jsx)(nk,{onSelect:()=>c(e.id),children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,K.jsx)(`span`,{children:e.name}),e.document_count!=null&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground ml-2`,children:t(`knowledge_bases.documents`,{count:e.document_count})})]})},e.id))]})]})]})})]})},mFe=({onSelect:e,closeMenu:t})=>{let{t:n}=V(),r=Sv(),{prompts:i,getPromptContent:a}=Q();function o(){t(),r(`/vault/prompts`)}return(0,K.jsxs)(GD,{children:[(0,K.jsxs)(KD,{children:[(0,K.jsx)(xse,{}),(0,K.jsx)(`span`,{children:n(`prompts.title`)})]}),(0,K.jsx)(qD,{className:`p-0`,children:(0,K.jsxs)(XO,{className:`max-w-sm`,children:[(0,K.jsx)(ZO,{placeholder:n(`common.search_placeholder`),onKeyDown:e=>e.stopPropagation()}),(0,K.jsxs)(QO,{children:[(0,K.jsx)($O,{children:n(`common.no_results`)}),(0,K.jsx)(nk,{onSelect:o,children:(0,K.jsxs)(`div`,{className:`flex items-center w-full`,children:[(0,K.jsx)(T_,{size:16,className:`me-2`}),(0,K.jsx)(`span`,{className:`text-xs`,children:n(`prompts.new_prompt`)})]})}),(0,K.jsx)(tk,{}),(0,K.jsx)(ek,{heading:n(`prompts.saved_prompts`),children:i.map(n=>(0,K.jsx)(nk,{onSelect:async()=>{try{e(await a(n.id))}catch{}t()},children:(0,K.jsx)(`span`,{children:n.name})},n.id))})]})]})})]})},hFe=[`pdf`,`docx`,`doc`,`rtf`,`txt`,`md`,`xlsx`,`xls`,`csv`,`pptx`,`ppt`,`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`tiff`,`tif`,`heic`,`heif`,`svg`],rk=hFe.map(e=>`.${e}`),gFe=new Set(hFe),_Fe=[`application/pdf`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,`application/msword`,`application/rtf`,`text/plain`,`text/markdown`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,`application/vnd.ms-excel`,`text/csv`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`,`application/vnd.ms-powerpoint`,`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/bmp`,`image/tiff`,`image/heic`,`image/heif`,`image/svg+xml`],vFe=new Set(_Fe),ik=[...rk,..._Fe].join(`,`);function yFe(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function ak(e){return gFe.has(yFe(e.name))||vFe.has(e.type)}const ok=rk.join(`, `);var bFe=20*1024*1024;const sk=Pb((e,t)=>
229({documents:[],isLoading:!1,error:null,uploadProgress:null,batchUploads:[],isBatchUploading:!1,fetchDocuments:async()=>{e({isLoading:!0,error:null});try{e({documents:await ihe((e,t)=>Hme({page:e,per_page:t}).then(e=>e.data.items)),isLoading:!1})}catch(t){X(t,{operation:`fetch_documents`}),e({error:Kb(t,H.t(`errors.fetch_failed`)),isLoading:!1})}},uploadDocument:async(n,r)=>{e({uploadProgress:0,error:null});try{let i=await sx(n,t=>{e({uploadProgress:t})},r);return e({uploadProgress:null}),await t().fetchDocuments(),i}catch(t){X(t,{operation:`upload_document`}),e({error:Kb(t,H.t(`errors.upload_failed`)),uploadProgress:null});return}},uploadDocumentToKB:async(t,n,r)=>{e({uploadProgress:0,error:null});let i;try{i=await sx(t,t=>{e({uploadProgress:t})},r),e({uploadProgress:null})}catch(t){X(t,{operation:`upload_document_to_kb`,metadata:{kbId:n}}),e({error:Kb(t,H.t(`errors.upload_failed`)),uploadProgress:null});return}try{await Q.getState().addDocumentToKB(n,i.id)}catch{e({error:H.t(`errors.uploaded_but_not_in_kb`)})}},uploadMultipleToKB:(n,r,i)=>{let a=Array.from(n).filter(e=>ak(e));if(a.length===0){e({error:`No valid files selected (${ok})`});return}let o=a.filter(e=>e.size>bFe);if(o.length>0){e({error:`${o.length} file(s) exceed 20MB limit: ${o.map(e=>e.name).join(`, `)}`});return}e({isBatchUploading:!0,error:null});let{promise:s,cancel:c}=Zhe(a,(t,n)=>{e(e=>{let r=[...e.batchUploads];return r[t]=n,{batchUploads:r}})},3,i);t()._cancelBatch=c,s.then(async n=>{let i=n.filter(e=>e.status===`completed`&&e.result).map(e=>e.result.id);if(i.length>0){if(r)try{await Q.getState().addDocumentsToKBBatch(r,i)}catch{e({error:H.t(`errors.uploaded_but_not_in_kb`)})}await t().fetchDocuments()}e({isBatchUploading:!1})})},cancelBatchUpload:()=>{let n=t()._cancelBatch;n&&n(),e({isBatchUploading:!1})},clearBatchUploads:()=>{e({batchUploads:[],isBatchUploading:!1,error:null})},deleteDocument:async t=>{e({error:null});try{return await Kme(t),e(e=>({documents:e.documents.filter(e=>e.id!==t)})),Q.getState().removeDocumentFromAllKBs(t),!0}catch(n){return X(n,{operation:`delete_document`,metadata:{id:t}}),e({error:Kb(n,H.t(`errors.document_delete_failed`))}),!1}},setDocumentCategory:async(t,n)=>{await Wme(t,{category_key:n});let r=e=>e.id===t?{...e,category_key:n,category_source:`manual`}:e;e(e=>({documents:e.documents.map(r)})),Q.setState(e=>{let t={};for(let[n,i]of Object.entries(e.kbDocuments))t[n]=i.map(r);return{kbDocuments:t}});let{useRedlineStore:i}=await ev(async()=>{let{useRedlineStore:e}=await import(`./redlineStore-dMY4CWoi.js`);return{useRedlineStore:e}},[]);i.getState().documentId===t&&i.setState({categoryKey:n})},setUploadProgress:t=>{e({uploadProgress:t})},clearError:()=>{e({error:null})}})),xFe=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/shares/preview?${n}`:`/api/v1/shares/preview`},SFe=async(e,t)=>Z(xFe(e),{...t,method:`GET`}),CFe=()=>`/api/v1/shares/accept`,wFe=async(e,t)=>Z(CFe(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),TFe=()=>`/api/v1/shares/mine`,EFe=async e=>Z(TFe(),{...e,method:`GET`}),DFe=()=>`/api/v1/shares/unviewed-count`,OFe=async e=>Z(DFe(),{...e,method:`GET`}),kFe=e=>`/api/v1/shares/${e}/viewed`,AFe=async(e,t)=>Z(kFe(e),{...t,method:`POST`}),jFe=()=>`/api/v1/shares`,MFe=async(e,t)=>Z(jFe(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),NFe=(e,t)=>`/api/v1/resources/${e}/${t}/shares`,PFe=async(e,t,n)=>Z(NFe(e,t),{...n,method:`GET`}),FFe=e=>`/api/v1/shares/${e}`,IFe=async(e,t)=>Z(FFe(e),{...t,method:`DELETE`});var ck=(e,t)=>`${e}:${t}`;const lk=Pb((e,t)=>({sharesByResource:{},sharedWithMe:[],unviewedCount:0,fetchShares:async(t,n)=>{try{let r=await PFe(t,n);e(e=>({sharesByResource:{...e.sharesByResource,[ck(t,n)]:r.data}}))}catch(e){X(e,{operation:`fetch_resource_shares`})}},createShare:async(t,n,r,i)=>{let a=(await MFe({resource_type:t,resource_id:n,grantee_email:r,role:i})).data;return e(e=>{let r=ck(t,n),i=(e.sharesByResource[r]??[]).filter(e=>e.id!==a.id);return{sharesByResource:{...e.sharesByResource,[r]:[a,...i]}}}),a},revokeShare:async(t,n,r)=>{await IFe(r),e(e=>{let i=ck(t,n);return{sharesByResource:{...e.sharesByResource,[i]:(e.sharesByResource[i]??[]).filter(e=>e.id!==r)}}})},previewShare:async e=>(await SFe({token:e})).data,acceptShare:async e=>{let n=(await wFe({token:e})).data;return t().fetchSharedWithMe(),t().fetchUnviewedCount(),n},fetchSharedWithMe:async()=>{try{e({sharedWithMe:(await EFe()).data})}catch(e){X(e,{operation:`fetch_shared_with_me`})}},fetchUnviewedCount:async()=>{try{e({unviewedCount:(await OFe()).data.count})}catch(e){X(e,{operation:`fetch_unviewed_shares_count`})}},markViewed:async n=>{let r=t().sharedWithMe.some(e=>e.share_id===n&&!e.viewed_at);try{await AFe(n),e(e=>({sharedWithMe:e.sharedWithMe.map(e=>e.share_id===n?{...e,viewed_at:new Date().toISOString()}:e),unviewedCount:r?Math.max(0,e.unviewedCount-1):e.unviewedCount}))}catch(e){X(e,{operation:`mark_share_viewed`})}}}));function LFe({closeMenu:e}){let{t}=V(),n=(0,B.useRef)(null),[r,i]=(0,B.useState)(!1),{attachDocument:a,attachImage:o}=LS(),{documents:s,fetchDocuments:c}=sk(),l=lk(e=>e.sharedWithMe),u=lk(e=>e.fetchSharedWithMe);(0,B.useEffect)(()=>
229{s.length===0&&c()},[s.length,c]),(0,B.useEffect)(()=>{u()},[u]);let d=s.filter(e=>e.status===`completed`),f=l.filter(e=>e.resource_type===`document`),p=async r=>{let s=r.target.files?.[0];if(s){i(!0);try{if(s.type.startsWith(`image/`)){let e=await Dbe(s);o({id:crypto.randomUUID(),...e})}else{let e=await sx(s);a({id:e.id,filename:e.original_filename}),await c()}}catch(e){Y(e,t(`errors.upload_failed`),{operation:`chat_attach_file_upload`,metadata:{fileName:s.name}})}finally{i(!1),n.current&&(n.current.value=``),e()}}},m=t=>{let n=d.find(e=>e.id===t);n&&a({id:n.id,filename:n.original_filename}),e()},h=t=>{let n=f.find(e=>e.resource_id===t);n&&a({id:n.resource_id,filename:n.resource_name}),e()};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`input`,{ref:n,type:`file`,accept:ik,className:`hidden`,onChange:p}),(0,K.jsxs)(GD,{children:[(0,K.jsxs)(KD,{children:[(0,K.jsx)(C_,{}),(0,K.jsx)(`span`,{children:t(`chat.attach_file`)})]}),(0,K.jsx)(qD,{className:`p-0`,children:(0,K.jsxs)(XO,{className:`max-w-sm`,children:[(0,K.jsx)(ZO,{placeholder:t(`chat.attach_documents`),onKeyDown:e=>e.stopPropagation()}),(0,K.jsxs)(QO,{children:[(0,K.jsx)($O,{children:t(`chat.no_documents_attached`)}),(0,K.jsx)(nk,{onSelect:()=>{n.current?.click()},children:(0,K.jsxs)(`div`,{className:`flex items-center w-full`,children:[r?(0,K.jsx)(W,{size:16,className:`me-2 animate-spin`}):(0,K.jsx)(T_,{size:16,className:`me-2`}),(0,K.jsx)(`span`,{className:`text-xs`,children:t(r?`common.uploading`:`chat.upload_new_file`)})]})}),(0,K.jsx)(tk,{}),(0,K.jsx)(ek,{heading:t(`chat.your_documents`),children:d.map(e=>(0,K.jsx)(nk,{onSelect:()=>m(e.id),children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,K.jsx)(`span`,{className:`truncate`,children:e.original_filename}),(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground ml-2 shrink-0`,children:e.file_type})]})},e.id))}),f.length>0&&(0,K.jsx)(ek,{heading:t(`chat.shared_with_me`),children:f.map(e=>(0,K.jsx)(nk,{onSelect:()=>h(e.resource_id),children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,K.jsx)(`span`,{className:`truncate`,children:e.resource_name}),(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground ml-2 shrink-0`,children:e.owner_email})]})},e.share_id))})]})]})})]})]})}function RFe({onSelectPrompt:e}){let{t}=V(),[n,r]=(0,B.useState)(!1),i=()=>r(!1),a=Q(e=>e.chatMode),o=Q(e=>e.setChatMode),s=LS(e=>e.emailToolsProvider),c=LS(e=>e.emailToolsAccountId),l=s&&tS(s)?s:null,u=l?dS(l,c)??t(lS[l].labelKey):t(`chat.inbox_scope`),d=()=>{Q.getState().setSelectedKnowledgeBase(null),LS.setState({pendingProviderPick:{source:`manual`}}),i()},f=TO(e=>e.openSetup);return(0,K.jsxs)(LD,{open:n,onOpenChange:r,children:[(0,K.jsx)($T,{i18nKey:`tour.chat.mode`,side:`top`,children:(0,K.jsx)(RD,{asChild:!0,children:(0,K.jsx)(J,{type:`button`,variant:`outline`,size:`xs`,"aria-label":t(`chat.mode`),children:(0,K.jsx)(T_,{className:`size-4`})})})}),(0,K.jsxs)(zD,{className:`w-56`,align:`start`,children:[(0,K.jsxs)(BD,{children:[(0,K.jsx)(UD,{children:t(`chat.mode`)}),(0,K.jsxs)(HD,{checked:a===`draft`,onCheckedChange:()=>o(`draft`),children:[(0,K.jsx)(Coe,{className:`size-3.5`}),t(`chat.mode_draft`)]}),(0,K.jsxs)(HD,{checked:a===`library`,onCheckedChange:()=>o(`library`),children:[(0,K.jsx)($ae,{className:`size-3.5`}),t(`chat.mode_library`)]}),(0,K.jsxs)(HD,{checked:a===`search`,onCheckedChange:()=>o(`search`),children:[(0,K.jsx)(Foe,{className:`size-3.5`}),t(`common.search`)]})]}),(0,K.jsx)(WD,{}),(0,K.jsxs)(BD,{children:[(0,K.jsx)(pFe,{closeMenu:i}),(0,K.jsxs)(VD,{onSelect:e=>{e.preventDefault(),d()},children:[(0,K.jsx)(__,{}),(0,K.jsx)(`span`,{className:`truncate max-w-40`,children:u})]}),(0,K.jsxs)(VD,{onSelect:e=>{e.preventDefault(),f(),i()},children:[(0,K.jsx)(a_,{}),(0,K.jsx)(`span`,{className:`truncate max-w-40`,children:t(`chat.benchmark.menu_item`)})]}),(0,K.jsx)(mFe,{onSelect:e,closeMenu:i}),(0,K.jsx)(LFe,{closeMenu:i})]})]})]})}var uk=(0,B.createContext)({});function dk(e){let t=(0,B.useRef)(null);return t.current===null&&(t.current=e()),t.current}var fk=typeof window<`u`?B.useLayoutEffect:B.useEffect,pk=(0,B.createContext)(null);function mk(e,t){e.indexOf(t)===-1&&e.push(t)}function hk(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var gk=(e,t,n)=>n>t?t:n<e?e:n,_k={},zFe=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function BFe(e){return typeof e==`object`&&!!e}var VFe=e=>/^0[^.\s]+$/u.test(e);function HFe(e){let t;return()=>(t===void 0&&(t=e()),t)}var vk=e=>e,UFe=(e,t)=>n=>t(e(n)),yk=(...e)=>e.reduce(UFe),bk=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},xk=class{constructor(){this.subscriptions=[]}add(e){return mk(this.subscriptions,e),()=>hk(this.subscriptions,e)}
229notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Sk=e=>e*1e3,Ck=e=>e/1e3;function WFe(e,t){return t?e*(1e3/t):0}var GFe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,KFe=1e-7,qFe=12;function JFe(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=GFe(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>KFe&&++s<qFe);return o}function wk(e,t,n,r){if(e===t&&n===r)return vk;let i=t=>JFe(t,0,1,e,n);return e=>e===0||e===1?e:GFe(i(e),t,r)}var YFe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,XFe=e=>t=>1-e(1-t),ZFe=wk(.33,1.53,.69,.99),Tk=XFe(ZFe),QFe=YFe(Tk),$Fe=e=>(e*=2)<1?.5*Tk(e):.5*(2-2**(-10*(e-1))),Ek=e=>1-Math.sin(Math.acos(e)),Dk=XFe(Ek),Ok=YFe(Ek),eIe=wk(.42,0,1,1),tIe=wk(0,0,.58,1),kk=wk(.42,0,.58,1),nIe=e=>Array.isArray(e)&&typeof e[0]!=`number`,Ak=e=>Array.isArray(e)&&typeof e[0]==`number`,jk={linear:vk,easeIn:eIe,easeInOut:kk,easeOut:tIe,circIn:Ek,circInOut:Ok,circOut:Dk,backIn:Tk,backInOut:QFe,backOut:ZFe,anticipate:$Fe},rIe=e=>typeof e==`string`,Mk=e=>{if(Ak(e)){e.length;let[t,n,r,i]=e;return wk(t,n,r,i)}else if(rIe(e))return jk[e],`${e}`,jk[e];return e},Nk=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],Pk={value:null,addProjectionMetrics:null};function iIe(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),t&&Pk.value&&Pk.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var aIe=40;function Fk(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Nk.reduce((e,n)=>(e[n]=iIe(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=_k.useManualTiming?i.timestamp:performance.now();n=!1,_k.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,aIe),1)),i.timestamp=a,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Nk.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Nk.length;t++)o[Nk[t]].cancel(e)},state:i,steps:o}}var{schedule:Ik,cancel:Lk,state:Rk,steps:zk}=Fk(typeof requestAnimationFrame<`u`?requestAnimationFrame:vk,!0),Bk;function oIe(){Bk=void 0}var Vk={now:()=>(Bk===void 0&&Vk.set(Rk.isProcessing||_k.useManualTiming?Rk.timestamp:performance.now()),Bk),set:e=>{Bk=e,queueMicrotask(oIe)}},Hk={layout:0,mainThread:0,waapi:0},Uk=e=>t=>typeof t==`string`&&t.startsWith(e),Wk=Uk(`--`),sIe=Uk(`var(--`),Gk=e=>sIe(e)?cIe.test(e.split(`/*`)[0].trim()):!1,cIe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Kk(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var qk={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Jk={...qk,transform:e=>gk(0,1,e)},Yk={...qk,default:1},Xk=e=>Math.round(e*1e5)/1e5,Zk=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lIe(e){return e==null}var uIe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qk=(e,t)=>n=>!!(typeof n==`string`&&uIe.test(n)&&n.startsWith(e)||t&&!lIe(n)&&Object.prototype.hasOwnProperty.call(n,t)),$k=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Zk);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},dIe=e=>gk(0,255,e),eA={...qk,transform:e=>Math.round(dIe(e))},tA={test:Qk(`rgb`,`red`),parse:$k(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+eA.transform(e)+`, `+eA.transform(t)+`, `+eA.transform(n)+`, `+Xk(Jk.transform(r))+`)`};function fIe(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alph
229a:i?parseInt(i,16)/255:1}}var nA={test:Qk(`#`),parse:fIe,transform:tA.transform},rA=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),iA=rA(`deg`),aA=rA(`%`),oA=rA(`px`),pIe=rA(`vh`),mIe=rA(`vw`),sA=(()=>({...aA,parse:e=>aA.parse(e)/100,transform:e=>aA.transform(e*100)}))(),cA={test:Qk(`hsl`,`hue`),parse:$k(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+aA.transform(Xk(t))+`, `+aA.transform(Xk(n))+`, `+Xk(Jk.transform(r))+`)`},lA={test:e=>tA.test(e)||nA.test(e)||cA.test(e),parse:e=>tA.test(e)?tA.parse(e):cA.test(e)?cA.parse(e):nA.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?tA.transform(e):cA.transform(e),getAnimatableNone:e=>{let t=lA.parse(e);return t.alpha=0,lA.transform(t)}},hIe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function gIe(e){return isNaN(e)&&typeof e==`string`&&(e.match(Zk)?.length||0)+(e.match(hIe)?.length||0)>0}var uA=`number`,dA=`color`,_Ie=`var`,vIe=`var(`,fA="${}",yIe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function pA(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(yIe,e=>(lA.test(e)?(r.color.push(a),i.push(dA),n.push(lA.parse(e))):e.startsWith(vIe)?(r.var.push(a),i.push(_Ie),n.push(e)):(r.number.push(a),i.push(uA),n.push(parseFloat(e))),++a,fA)).split(fA),indexes:r,types:i}}function mA(e){return pA(e).values}function hA(e){let{split:t,types:n}=pA(e),r=t.length;return e=>{let i=``;for(let a=0;a<r;a++)if(i+=t[a],e[a]!==void 0){let t=n[a];t===uA?i+=Xk(e[a]):t===dA?i+=lA.transform(e[a]):i+=e[a]}return i}}var bIe=e=>typeof e==`number`?0:lA.test(e)?lA.getAnimatableNone(e):e;function xIe(e){let t=mA(e);return hA(e)(t.map(bIe))}var gA={test:gIe,parse:mA,createTransformer:hA,getAnimatableNone:xIe};function _A(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function SIe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=_A(s,r,e+1/3),a=_A(s,r,e),o=_A(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function vA(e,t){return n=>n>0?t:e}var yA=(e,t,n)=>
229e+(t-e)*n,bA=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},CIe=[nA,tA,cA],wIe=e=>CIe.find(t=>t.test(e));function xA(e){let t=wIe(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===cA&&(n=SIe(n)),n}var SA=(e,t)=>{let n=xA(e),r=xA(t);if(!n||!r)return vA(e,t);let i={...n};return e=>(i.red=bA(n.red,r.red,e),i.green=bA(n.green,r.green,e),i.blue=bA(n.blue,r.blue,e),i.alpha=yA(n.alpha,r.alpha,e),tA.transform(i))},CA=new Set([`none`,`hidden`]);function TIe(e,t){return CA.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function EIe(e,t){return n=>yA(e,t,n)}function wA(e){return typeof e==`number`?EIe:typeof e==`string`?Gk(e)?vA:lA.test(e)?SA:kIe:Array.isArray(e)?TA:typeof e==`object`?lA.test(e)?SA:DIe:vA}function TA(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>wA(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function DIe(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=wA(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function OIe(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var kIe=(e,t)=>{let n=gA.createTransformer(t),r=pA(e),i=pA(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?CA.has(e)&&!i.values.length||CA.has(t)&&!r.values.length?TIe(e,t):yk(TA(OIe(r,i),i.values),n):(`${e}${t}`,vA(e,t))};function EA(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?yA(e,t,n):wA(e)(e,t)}var AIe=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Ik.update(t,e),stop:()=>Lk(t),now:()=>Rk.isProcessing?Rk.timestamp:Vk.now()}},DA=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},OA=2e4;function kA(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function jIe(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(kA(r),OA);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Ck(i)}}var MIe=5;function NIe(e,t,n){let r=Math.max(t-MIe,0);return WFe(n-e(r),t-r)}var AA={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},jA=.001;function PIe({duration:e=AA.duration,bounce:t=AA.bounce,velocity:n=AA.velocity,mass:r=AA.mass}){let i,a;AA.maxDuration;let o=1-t;o=gk(AA.minDamping,AA.maxDamping,o),e=gk(AA.minDuration,AA.maxDuration,Ck(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=MA(t,o),c=Math.exp(-i);return jA-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=MA(t**2,o);return(-i(t)+jA>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-jA+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=IIe(i,a,s);if(e=Sk(e),isNaN(c))return{stiffness:AA.stiffness,damping:AA.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var FIe=12;function IIe(e,t,n){let r=n;for(let n=1;n<FIe;n++)r-=e(r)/t(r);return r}function MA(e,t){return e*Math.sqrt(1-t*t)}var LIe=[`duration`,`bounce`],RIe=[`stiffness`,`damping`,`mass`];function zIe(e,t){return t.some(t=>e[t]!==void 0)}function BIe(e){let t={velocity:AA.velocity,stiffness:AA.stiffness,damping:AA.damping,mass:AA.mass,isResolvedFromDuration:!1,...e};if(!zIe(e,RIe)&&zIe(e,LIe))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*gk(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:AA.mass,stiffness:i,damping:a}}else{let n=PIe({...e,velocity:0});t={...t,...n,mass:AA.mass},t.isResolvedFromDuration=!0}return t}function NA(e=AA.visualDuration,t=AA.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=BIe({...n,velocity:-Ck(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Ck(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?AA.restSpeed.granular:AA.restSpeed.default,i||=v?AA.restDelta.granular:AA.restDelta.default;let y;if(h<1){let e=MA(_,h);y=t=>o-Math.exp(-h*_*t)*((m+h*_*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(h===1)y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}
229let b={calculatedDuration:p&&d||null,next:e=>{let t=y(e);if(p)s.done=e>=d;else{let n=e===0?m:0;h<1&&(n=e===0?Sk(m):NIe(y,e,t));let a=Math.abs(n)<=r,c=Math.abs(o-t)<=i;s.done=a&&c}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(kA(b),OA),t=DA(t=>b.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return b}NA.applyToOptions=e=>{let t=jIe(e,100,NA);return e.ease=t.ease,e.duration=Sk(t.duration),e.type=`keyframes`,e};function PA({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=NA({keyframes:[f.value,m(f.value)],velocity:NIe(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function VIe(e,t,n){let r=[],i=n||_k.mix||EA,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=yk(Array.isArray(t)?t[n]||vk:t,a)),r.push(a)}return r}function HIe(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=VIe(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=bk(e[r],e[r+1],n);return s[r](i)};return n?t=>l(gk(e[0],e[a-1],t)):l}function UIe(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=bk(0,t,r);e.push(yA(n,1,i))}}function WIe(e){let t=[0];return UIe(t,e.length-1),t}function GIe(e,t){return e.map(e=>e*t)}function KIe(e,t){return e.map(()=>t||kk).splice(0,e.length-1)}function FA({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=nIe(r)?r.map(Mk):Mk(r),a={done:!1,value:t[0]},o=HIe(GIe(n&&n.length===t.length?n:WIe(t),e),t,{ease:Array.isArray(i)?i:KIe(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var qIe=e=>e!==null;function IA(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(qIe),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var JIe={decay:PA,inertia:PA,tween:FA,keyframes:FA,spring:NA};function YIe(e){typeof e.type==`string`&&(e.type=JIe[e.type])}var LA=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},XIe=e=>e/100,RA=class extends LA{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Vk.now()&&this.tick(Vk.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},Hk.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;YIe(e);let{type:t=FA,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||FA;s!==FA&&typeof o[0]!=`number`&&(this.mixKeyframes=yk(XIe,EA(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=kA(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=gk(0,1,n)*o}let b=_?{done:!1,value:l[0]}:y.next(v);
229i&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==PA&&(b.value=IA(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Ck(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Ck(e)}get time(){return Ck(this.currentTime)}set time(e){e=Sk(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Vk.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Ck(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=AIe,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Vk.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,Hk.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function ZIe(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var zA=e=>e*180/Math.PI,BA=e=>VA(zA(Math.atan2(e[1],e[0]))),QIe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:BA,rotateZ:BA,skewX:e=>zA(Math.atan(e[1])),skewY:e=>zA(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},VA=e=>(e%=360,e<0&&(e+=360),e),$Ie=BA,eLe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tLe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),nLe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:eLe,scaleY:tLe,scale:e=>(eLe(e)+tLe(e))/2,rotateX:e=>VA(zA(Math.atan2(e[6],e[5]))),rotateY:e=>VA(zA(Math.atan2(-e[2],e[0]))),rotateZ:$Ie,rotate:$Ie,skewX:e=>zA(Math.atan(e[4])),skewY:e=>zA(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function HA(e){return e.includes(`scale`)?1:0}function UA(e,t){if(!e||e===`none`)return HA(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=nLe,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=QIe,i=t}if(!i)return HA(t);let a=r[t],o=i[1].split(`,`).map(iLe);return typeof a==`function`?a(o):o[a]}var rLe=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return UA(n,t)};function iLe(e){return parseFloat(e.trim())}var WA=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],GA=(()=>new Set(WA))(),aLe=e=>e===qk||e===oA,oLe=new Set([`x`,`y`,`z`]),sLe=WA.filter(e=>!oLe.has(e));function cLe(e){let t=[];return sLe.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var KA={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>UA(t,`x`),y:(e,{transform:t})=>UA(t,`y`)};KA.translateX=KA.x,KA.translateY=KA.y;var qA=new Set,JA=!1,YA=!1,XA=!1;
229function lLe(){if(YA){let e=Array.from(qA).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=cLe(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}YA=!1,JA=!1,qA.forEach(e=>e.complete(XA)),qA.clear()}function uLe(){qA.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(YA=!0)})}function dLe(){XA=!0,uLe(),lLe(),XA=!1}var ZA=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(qA.add(this),JA||(JA=!0,Ik.read(uLe),Ik.resolveKeyframes(lLe))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}ZIe(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),qA.delete(this)}cancel(){this.state===`scheduled`&&(qA.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},fLe=e=>e.startsWith(`--`);function pLe(e,t,n){fLe(t)?e.style.setProperty(t,n):e.style[t]=n}var mLe={};function hLe(e,t){let n=HFe(e);return()=>mLe[t]??n()}var gLe=hLe(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),_Le=hLe(()=>{try{document.createElement(`div`).animate({opacity:0}
229,{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),QA=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,vLe={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:QA([0,.65,.55,1]),circOut:QA([.55,0,1,.45]),backIn:QA([.31,.01,.66,-.59]),backOut:QA([.33,1.53,.69,.99])};function yLe(e,t){if(e)return typeof e==`function`?_Le()?DA(e,t):`ease-out`:Ak(e)?QA(e):Array.isArray(e)?e.map(e=>yLe(e,t)||vLe.easeOut):vLe[e]}function bLe(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=yLe(s,i);Array.isArray(d)&&(u.easing=d),Pk.value&&Hk.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return Pk.value&&p.finished.finally(()=>{Hk.waapi--}),p}function xLe(e){return typeof e==`function`&&`applyToOptions`in e}function SLe({type:e,...t}){return xLe(e)&&_Le()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var CLe=class extends LA{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=SLe(e);this.animation=bLe(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=IA(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),pLe(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Ck(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Ck(e)}get time(){return Ck(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Sk(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`f
229inished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&gLe()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),vk):r(this)}},wLe={anticipate:$Fe,backInOut:QFe,circInOut:Ok};function TLe(e){return e in wLe}function ELe(e){typeof e.ease==`string`&&TLe(e.ease)&&(e.ease=wLe[e.ease])}var $A=10,DLe=class extends CLe{constructor(e){ELe(e),YIe(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new RA({...a,autoplay:!1}),s=Math.max($A,Vk.now()-this.startTime),c=gk(0,$A,s-$A);t.setWithVelocity(o.sample(Math.max(0,s-c)).value,o.sample(s).value,c),o.stop()}},OLe=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(gA.test(e)||e===`0`)&&!e.startsWith(`url(`));function kLe(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function ALe(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=OLe(i,t),s=OLe(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:kLe(e)||(n===`spring`||xLe(n))&&r}function ej(e){e.duration=0,e.type=`keyframes`}var jLe=new Set([`opacity`,`clipPath`,`filter`,`transform`]),MLe=HFe(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function NLe(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return MLe()&&n&&jLe.has(n)&&(n!==`transform`||!c)&&!s&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var PLe=40,FLe=class extends LA{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Vk.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||ZA)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Vk.now(),ALe(e,i,a,o)||((_k.instantAnimations||!s)&&l?.(IA(e,n,t)),e[0]=e[e.length-1],ej(n),n.repeat=0);let u={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>PLe?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!c&&NLe(u),f=u.motionValue?.owner?.current,p=d?new DLe({...u,element:f}):new RA(u);p.finished.then(()=>{this.notifyFinished()}).catch(vk),this.pendingTimeline&&=(this.stopTimeline=p.attachTimeline(this.pendingTimeline),void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),dLe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function ILe(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>
229e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var LLe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function RLe(e){let t=LLe.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function zLe(e,t,n=1){`${e}`;let[r,i]=RLe(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return zFe(e)?parseFloat(e):e}return Gk(i)?zLe(i,t,n+1):i}var BLe={type:`spring`,stiffness:500,damping:25,restSpeed:10},VLe=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),HLe={type:`keyframes`,duration:.8},ULe={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},WLe=(e,{keyframes:t})=>t.length>2?HLe:GA.has(e)?e.startsWith(`scale`)?VLe(t[1]):BLe:ULe,GLe=e=>e!==null;function KLe(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(GLe),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}function qLe(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function tj(e,t){let n=e?.[t]??e?.default??e;return n===e?n:qLe(n,e)}function JLe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}var nj=(e,t,n,r={},i,a)=>o=>{let s=tj(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Sk(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};JLe(s)||Object.assign(u,WLe(e,u)),u.duration&&=Sk(u.duration),u.repeatDelay&&=Sk(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ej(u),u.delay===0&&(d=!0)),(_k.instantAnimations||_k.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,ej(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=KLe(u.keyframes,s);if(e!==void 0){Ik.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new RA(u):new FLe(u)};function YLe(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function rj(e,t,n,r){if(typeof t==`function`){let[i,a]=YLe(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=YLe(r);t=t(n===void 0?e.custom:n,i,a)}return t}function ij(e,t,n){let r=e.getProps();return rj(r,t,n===void 0?r.custom:n,e)}var XLe=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...WA]),ZLe=30,QLe=e=>!isNaN(parseFloat(e)),aj={current:void 0},$Le=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Vk.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Vk.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=QLe(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new xk);let n=this.events[e].add(t);return e===`change`?()=>{n(),Ik.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return aj.current&&aj.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Vk.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ZLe)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,ZLe);return WFe(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function oj(e,t){return new $Le(e,t)}var sj=e=>Array.isArray(e);function eRe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,oj(n))}function tRe(e){return sj(e)?e[e.length-1]||0:e}function nRe(e,t){let{transitionEnd:n={},transition:r={},...i}=ij(e,t)||{};for(let t in i={...i,...n},i)eRe(e,t,tRe(i[t]))}var cj=e=>!!(e&&e.getVelocity);function rRe(e){return!!(cj(e)&&e.add)}function lj(e,t){let n=e.getValue(`willChange`);if(rRe(n))return n.add(t);if(!n&&_k.WillChange){let n=new _k.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function uj(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var iRe=`data-`+uj(`framerAppearId`);function aRe(e){return e.props[iRe]}function oRe({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function sRe(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?qLe(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&oRe(d,t))continue;let o={delay:n,...tj(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating&&!Array.isArray(i)&&i===c&&!o.velocity)continue;let f=!1;if(window.MotionHandoffAnimation){let n=aRe(e);if(n){let e=window.MotionHandoffAnimation(n,t,Ik);e!==null&&(o.startTime=e,f=!0)}}lj(e,t);let p=l??e.shouldReduceMotion;r.start(nj(t,r,i,p&&XLe.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>Ik.update(()=>{o&&nRe(e,o)});u.length?Promise.all(u).then(t):t()}return u}function dj(e,t,n={}){let r=ij(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(sRe(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return cRe(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;
229if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function cRe(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(dj(c,t,{...o,delay:n+(typeof r==`function`?0:r)+ILe(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function lRe(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>dj(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=dj(e,t,n);else{let i=typeof t==`function`?ij(e,t,n.custom):t;r=Promise.all(sRe(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var uRe={test:e=>e===`auto`,parse:e=>e},dRe=e=>t=>t.test(e),fRe=[qk,oA,aA,iA,mIe,pIe,uRe],pRe=e=>fRe.find(dRe(e));function mRe(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||VFe(e)}var hRe=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function gRe(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Zk)||[];if(!r)return e;let i=n.replace(r,``),a=hRe.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var _Re=/\b([a-z-]*)\(.*?\)/gu,fj={...gA,getAnimatableNone:e=>{let t=e.match(_Re);return t?t.map(gRe).join(` `):e}},pj={...gA,getAnimatableNone:e=>{let t=gA.parse(e);return gA.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},vRe={...qk,transform:Math.round},mj={borderWidth:oA,borderTopWidth:oA,borderRightWidth:oA,borderBottomWidth:oA,borderLeftWidth:oA,borderRadius:oA,borderTopLeftRadius:oA,borderTopRightRadius:oA,borderBottomRightRadius:oA,borderBottomLeftRadius:oA,width:oA,maxWidth:oA,height:oA,maxHeight:oA,top:oA,right:oA,bottom:oA,left:oA,inset:oA,insetBlock:oA,insetBlockStart:oA,insetBlockEnd:oA,insetInline:oA,insetInlineStart:oA,insetInlineEnd:oA,padding:oA,paddingTop:oA,paddingRight:oA,paddingBottom:oA,paddingLeft:oA,paddingBlock:oA,paddingBlockStart:oA,paddingBlockEnd:oA,paddingInline:oA,paddingInlineStart:oA,paddingInlineEnd:oA,margin:oA,marginTop:oA,marginRight:oA,marginBottom:oA,marginLeft:oA,marginBlock:oA,marginBlockStart:oA,marginBlockEnd:oA,marginInline:oA,marginInlineStart:oA,marginInlineEnd:oA,fontSize:oA,backgroundPositionX:oA,backgroundPositionY:oA,rotate:iA,rotateX:iA,rotateY:iA,rotateZ:iA,scale:Yk,scaleX:Yk,scaleY:Yk,scaleZ:Yk,skew:iA,skewX:iA,skewY:iA,distance:oA,translateX:oA,translateY:oA,translateZ:oA,x:oA,y:oA,z:oA,perspective:oA,transformPerspective:oA,opacity:Jk,originX:sA,originY:sA,originZ:oA,zIndex:vRe,fillOpacity:Jk,strokeOpacity:Jk,numOctaves:vRe},yRe={...mj,color:lA,backgroundColor:lA,outlineColor:lA,fill:lA,stroke:lA,borderColor:lA,borderTopColor:lA,borderRightColor:lA,borderBottomColor:lA,borderLeftColor:lA,filter:fj,WebkitFilter:fj,mask:pj,WebkitMask:pj},bRe=e=>yRe[e],xRe=new Set([fj,pj]);function SRe(e,t){let n=bRe(e);return xRe.has(n)||(n=gA),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var CRe=new Set([`auto`,`none`,`0`]);function wRe(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!CRe.has(t)&&pA(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=SRe(n,i)}var TRe=class extends ZA{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Gk(r))){let i=zLe(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!XLe.has(n)||e.length!==2)return;let[r,i]=e,a=pRe(r),o=pRe(i);if(Kk(r)!==Kk(i)&&KA[n]){this.needsMeasurement=!0;return}if(a!==o)if(aLe(a)&&aLe(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else KA[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||mRe(e[t]))&&n.push(t);n.length&&wRe(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=KA[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=KA[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEac
229h(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},ERe=new Set([`opacity`,`clipPath`,`filter`,`transform`]);function DRe(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var ORe=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function hj(e){return BFe(e)&&`offsetHeight`in e}var{schedule:gj,cancel:kRe}=Fk(queueMicrotask,!1),_j={x:!1,y:!1};function ARe(){return _j.x||_j.y}function jRe(e){return e===`x`||e===`y`?_j[e]?null:(_j[e]=!0,()=>{_j[e]=!1}):_j.x||_j.y?null:(_j.x=_j.y=!0,()=>{_j.x=_j.y=!1})}function MRe(e,t){let n=DRe(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function NRe(e){return!(e.pointerType===`touch`||ARe())}function PRe(e,t,n={}){let[r,i,a]=MRe(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!NRe(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var FRe=(e,t)=>t?e===t?!0:FRe(e,t.parentElement):!1,vj=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,IRe=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function LRe(e){return IRe.has(e.tagName)||e.isContentEditable===!0}var RRe=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function zRe(e){return RRe.has(e.tagName)||e.isContentEditable===!0}var yj=new WeakSet;function BRe(e){return t=>{t.key===`Enter`&&e(t)}}function bj(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var VRe=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=BRe(()=>{if(yj.has(n))return;bj(n,`down`);let e=BRe(()=>{bj(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>bj(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function HRe(e){return vj(e)&&!ARe()}var URe=new WeakSet;function WRe(e,t,n={}){let[r,i,a]=MRe(e,n),o=e=>{let r=e.currentTarget;if(!HRe(e)||URe.has(e))return;yj.add(r),n.stopPropagation&&URe.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),yj.has(r)&&yj.delete(r),HRe(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||FRe(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),hj(e)&&(e.addEventListener(`focus`,e=>VRe(e,i)),!LRe(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function xj(e){return BFe(e)&&`ownerSVGElement`in e}var Sj=new WeakMap,Cj,GRe=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:xj(r)&&`getBBox`in r?r.getBBox()[t]:r[n],KRe=GRe(`inline`,`width`,`offsetWidth`),qRe=GRe(`block`,`height`,`offsetHeight`);function JRe({target:e,borderBoxSize:t}){Sj.get(e)?.forEach(n=>{n(e,{get width(){return KRe(e,t)},get height(){return qRe(e,t)}})})}function YRe(e){e.forEach(JRe)}function XRe(){typeof ResizeObserver>`u`||(Cj=new ResizeObserver(YRe))}function ZRe(e,t){Cj||XRe();let n=DRe(e);return n.forEach(e=>{let n=Sj.get(e);n||(n=new Set,Sj.set(e,n)),n.add(t),Cj?.observe(e)}),()=>{n.forEach(e=>{let n=Sj.get(e);n?.delete(t),n?.size||Cj?.unobserve(e)})}}var wj=new Set,Tj;function QRe(){Tj=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};wj.forEach(t=>t(e))},window.addEventListener(`resize`,Tj)}function $Re(e){return wj.add(e),Tj||QRe(),()=>{wj.delete(e),!wj.size&&typeof Tj==`function`&&(window.removeEventListener(`resize`,Tj),Tj=void 0)}}function eze(e,t){return typeof e==`function`?$Re(e):ZRe(e,t)}function tze(e){return xj(e)&&e.tagName===`svg`}function nze(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=HIe(i,a,o);return t?s(r):s}function rze(e,t,n={}){let r=e.get(),i=null,a=r,o,s=typeof r==`string`?r.replace(/[\d.-]/g,``):void 0,c=()=>{i&&=(i.stop(),null)},l=()=>{c();let t=aze(e.get()),r=aze(a);t!==r&&(i=new RA({keyframes:[t,r],velocity:e.getVelocity(),type:`spring`,restDelta:.001,restSpeed:.01,...n,onUp
229date:o}))};if(e.attach((t,n)=>{a=t,o=e=>n(ize(e,s)),Ik.postRender(()=>{l(),e.events.animationStart?.notify(),i?.then(()=>{e.events.animationComplete?.notify()})})},c),cj(t)){let n=t.on(`change`,t=>e.set(ize(t,s))),r=e.on(`destroy`,n);return()=>{n(),r()}}return c}function ize(e,t){return t?e+t:e}function aze(e){return typeof e==`number`?e:parseFloat(e)}var oze=[...fRe,lA,gA],sze=e=>oze.find(dRe(e)),cze=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ej=()=>({x:cze(),y:cze()}),lze=()=>({min:0,max:0}),Dj=()=>({x:lze(),y:lze()}),uze=new WeakMap;function Oj(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function kj(e){return typeof e==`string`||Array.isArray(e)}var Aj=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],jj=[`initial`,...Aj];function Mj(e){return Oj(e.animate)||jj.some(t=>kj(e[t]))}function dze(e){return!!(Mj(e)||e.variants)}function fze(e,t,n){for(let r in t){let i=t[r],a=n[r];if(cj(i))e.addValue(r,i);else if(cj(a))e.addValue(r,oj(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,oj(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Nj={current:null},Pj={current:!1},pze=typeof window<`u`;function mze(){if(Pj.current=!0,pze)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Nj.current=e.matches;e.addEventListener(`change`,t),t()}else Nj.current=!1}var hze=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Fj={};function gze(e){Fj=e}function _ze(){return Fj}var vze=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ZA,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Vk.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Ik.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Mj(t),this.isVariantNode=dze(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&cj(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,uze.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Pj.current||mze(),this.shouldReduceMotion=Nj.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){for(let e in this.projection&&this.projection.unmount(),Lk(this.notifyUpdate),Lk(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&ERe.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new CLe({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Sk(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=GA.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Ik.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Fj){let t=Fj[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];
229t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Dj()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<hze.length;t++){let n=hze[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=fze(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=oj(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(zFe(n)||VFe(n))?n=parseFloat(n):!sze(n)&&gA.test(t)&&(n=SRe(e,t)),this.setBaseTarget(e,cj(n)?n.get():n)),cj(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=rj(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!cj(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new xk),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){gj.render(this.render)}},yze=class extends vze{constructor(){super(...arguments),this.KeyframeResolver=TRe}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;cj(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Ij=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function bze({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function xze({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Sze(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Lj(e){return e===void 0||e===1}function Rj({scale:e,scaleX:t,scaleY:n}){return!Lj(e)||!Lj(t)||!Lj(n)}function zj(e){return Rj(e)||Cze(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Cze(e){return wze(e.x)||wze(e.y)}function wze(e){return e&&e!==`0%`}function Bj(e,t,n){return n+t*(e-n)}function Vj(e,t,n,r,i){return i!==void 0&&(e=Bj(e,i,r)),Bj(e,n,r)+t}function Hj(e,t=0,n=1,r,i){e.min=Vj(e.min,t,n,r,i),e.max=Vj(e.max,t,n,r,i)}function Uj(e,{x:t,y:n}){Hj(e.x,t.translate,t.scale,t.originPoint),Hj(e.y,n.translate,n.scale,n.originPoint)}var Wj=.999999999999,Gj=1.0000000000001;function Tze(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Yj(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Uj(e,o)),r&&zj(a.latestValues)&&Yj(e,a.latestValues))}t.x<Gj&&t.x>Wj&&(t.x=1),t.y<Gj&&t.y>Wj&&(t.y=1)}function Kj(e,t){e.min+=t,e.max+=t}function qj(e,t,n,r,i=.5){Hj(e,t,n,yA(e.min,e.max,i),r)}function Jj(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Yj(e,t){qj(e.x,Jj(t.x,e.x),t.scaleX,t.scale,t.originX),qj(e.y,Jj(t.y,e.y),t.scaleY,t.scale,t.originY)}function Xj(e,t){return bze(Sze(e.getBoundingClientRect(),t))}function Eze(e,t,n){let r=Xj(e,n),{scroll:i}=t;return i&&(Kj(r.x,i.offset.x),Kj(r.y,i.offset.y)),r}var Dze={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Oze=WA.length;function kze(e,t,n){let r=``,i=!0;for(let a=0;a<Oze;a++){let o=WA[a],s=e[o];if(s===void 0)continue;let c=!0;
229if(typeof s==`number`)c=s===(o.startsWith(`scale`)?1:0);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=ORe(s,mj[o]);if(!c){i=!1;let t=Dze[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Zj(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(GA.has(e)){o=!0;continue}else if(Wk(e)){i[e]=n;continue}else{let t=ORe(n,mj[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=kze(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Qj(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function $j(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var eM={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(oA.test(e))e=parseFloat(e);else return e;return`${$j(e,t.target.x)}% ${$j(e,t.target.y)}%`}},Aze={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=gA.parse(e);if(i.length>5)return r;let a=gA.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=yA(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},tM={borderRadius:{...eM,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:eM,borderTopRightRadius:eM,borderBottomLeftRadius:eM,borderBottomRightRadius:eM,boxShadow:Aze};function nM(e,{layout:t,layoutId:n}){return GA.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!tM[e]||e===`opacity`)}function rM(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(cj(r[t])||i&&cj(i[t])||nM(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function jze(e){return window.getComputedStyle(e)}var Mze=class extends yze{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Qj}readValueFromInstance(e,t){if(GA.has(t))return this.projection?.isProjecting?HA(t):rLe(e,t);{let n=jze(e),r=(Wk(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Xj(e,t)}build(e,t,n){Zj(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return rM(e,t,n)}},Nze={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Pze={offset:`strokeDashoffset`,array:`strokeDasharray`};function Fze(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Nze:Pze;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Ize=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function iM(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Zj(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Ize)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Fze(d,i,a,o,!1)}var aM=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),oM=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Lze(e,t,n,r){for(let n in Qj(e,t,void 0,r),t.attrs)e.setAttribute(aM.has(n)?n:uj(n),t.attrs[n])}function sM(e,t,n){let r=rM(e,t,n);for(let n in e)if(cj(e[n])||cj(t[n])){let t=WA.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Rze=class extends yze{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Dj}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(GA.has(t)){let e=bRe(t);return e&&e.default||0}return t=aM.has(t)?t:uj(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return sM(e,t,n)}
229build(e,t,n){iM(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Lze(e,t,n,r)}mount(e){this.isSVGTag=oM(e.tagName),super.mount(e)}},zze=jj.length;function cM(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&cM(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<zze;n++){let r=jj[n],i=e.props[r];(kj(i)||i===!1)&&(t[r]=i)}return t}function lM(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Bze=[...Aj].reverse(),Vze=Aj.length;function Hze(e){return t=>Promise.all(t.map(({animation:t,options:n})=>lRe(e,t,n)))}function Uze(e){let t=Hze(e),n=dM(),r=!0,i=!1,a=t=>(n,r)=>{let i=ij(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=cM(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Vze;t++){let p=Bze[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=kj(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Oj(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Wze(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=sj(t)&&sj(n)?!lM(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=ij(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=ILe(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=ij(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=dM(),i=!0}}}function Wze(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!lM(t,e):!1}function uM(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function dM(){return{animate:uM(!0),whileInView:uM(),whileHover:uM(),whileTap:uM(),whileDrag:uM(),whileFocus:uM(),exit:uM()}}function fM(e,t){e.min=t.min,e.max=t.max}function pM(e,t){fM(e.x,t.x),fM(e.y,t.y)}function mM(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var hM=1e-4,Gze=1-hM,Kze=1+hM,gM=.01,qze=0-gM,Jze=0+gM;function _M(e){return e.max-e.min}function Yze(e,t,n){return Math.abs(e-t)<=n}function vM(e,t,n,r=.5){e.origin=r,e.originPoint=yA(t.min,t.max,e.origin),e.scale=_M(n)/_M(t),e.translate=yA(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Gze&&e.scale<=Kze||isNaN(e.scale))&&(e.scale=1),(e.translate>=qze&&e.translate<=Jze||isNaN(e.translate))&&(e.translate=0)}function yM(e,t,n,r){vM(e.x,t.x,n.x,r?r.originX:void 0),vM(e.y,t.y,n.y,r?r.originY:void 0)}function bM(e,t,n){e.min=n.min+t.min,e.max=e.min+_M(t)}function Xze(e,t,n){bM(e.x,t.x,n.x),bM(e.y,t.y,n.y)}function xM(e,t,n){e.min=t.min-n.min,e.max=e.min+_M(t)}function SM(e,t,n){xM(e.x,t.x,n.x),xM(e.y,t.y,n.y)}function CM(e,t,n,r,i){return e-=t,e=Bj(e,1/n,r),i!==void 0&&(e=Bj(e,1/i,r)),e}function Zze(e,t=0,n=1,r=.5,i,a=e,o=e){if(aA.test(t)&&(t=parseFloat(t),t=yA(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=yA(a.min,a.max,r);e===a&&(s-=t),e.min=CM(e.min,t,n,s,i),e.max=CM(e.max,t,n,s,i)}function wM(e,t,[n,r,i],a,o){Zze(e,t[n],t[r],t[i],t.scale,a,o)}var Qze=[`x`,`scaleX`,`originX`],$ze=[`y`,`scaleY`,`originY`];function TM(e,t,n,r){wM(e.x,t,Qze,n?n.x:void 0,r?r.x:void 0),wM(e.y,t,$ze,n?n.y:void 0,r?r.y:void 0)}function EM(e){return e.translate===0&&e.scale===1}function DM(e){return EM(e.x)&&EM(e.y)}function OM(e,t){return e.min===t.min&&e.max===t.max}function eBe(e,t){return OM(e.x,t.x)&&OM(e.y,t.y)}function kM(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function AM(e,t){return kM(e.x,t.x)&&kM(e.y,t.y)}function jM(e){return _M(e.x)/_M(e.y)}function MM(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function NM(e){return[e(`x`),e(`y`)]}function tBe(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var PM=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],nBe=PM.length,FM=e=>typeof e==`string`?parseFloat(e):e,IM=e=>typeof e==`number`||oA.test(e);function rBe(e,t,n,r,i,a){i?(e.opacity=yA(0,n.opacity??1,iBe(r)),e.o
229pacityExit=yA(t.opacity??1,0,aBe(r))):a&&(e.opacity=yA(t.opacity??1,n.opacity??1,r));for(let i=0;i<nBe;i++){let a=`border${PM[i]}Radius`,o=LM(t,a),s=LM(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||IM(o)===IM(s)?(e[a]=Math.max(yA(FM(o),FM(s),r),0),(aA.test(s)||aA.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=yA(t.rotate||0,n.rotate||0,r))}function LM(e,t){return e[t]===void 0?e.borderRadius:e[t]}var iBe=RM(0,.5,Dk),aBe=RM(.5,.95,vk);function RM(e,t,n){return r=>r<e?0:r>t?1:n(bk(e,t,r))}function oBe(e,t,n){let r=cj(e)?e:oj(e);return r.start(nj(``,r,t,n)),r.animation}function zM(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var sBe=(e,t)=>e.depth-t.depth,cBe=class{constructor(){this.children=[],this.isDirty=!1}add(e){mk(this.children,e),this.isDirty=!0}remove(e){hk(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(sBe),this.isDirty=!1,this.children.forEach(e)}};function lBe(e,t){let n=Vk.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Lk(r),e(a-t))};return Ik.setup(r,!0),()=>Lk(r)}function BM(e){return cj(e)?e.get():e}var uBe=class{constructor(){this.members=[]}add(e){mk(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(hk(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(hk(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},VM={hasAnimatedSinceResize:!0,hasEverUpdated:!1},HM={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},UM=[``,`X`,`Y`,`Z`],dBe=1e3,fBe=0;function WM(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function GM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=aRe(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Ik,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&GM(r)}function KM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=fBe++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Pk.value&&(HM.nodes=HM.calculatedTargetDeltas=HM.calculatedProjections=0),this.nodes.forEach(hBe),this.nodes.forEach(yBe),this.nodes.forEach(bBe),this.nodes.forEach(gBe),Pk.addProjectionMetrics&&Pk.addProjectionMetrics(HM)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new cBe)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new xk),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=xj(t)&&!tze(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Ik.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=lBe(i,250),VM.hasAnimatedSinceResize&&(VM.hasAnimatedSinceResize=!1,this.nodes.forEac
229h(YM)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||TBe,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!AM(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...tj(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||YM(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Lk(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(xBe),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&GM(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(qM);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(JM);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(vBe),this.nodes.forEach(pBe),this.nodes.forEach(mBe)):this.nodes.forEach(JM),this.clearAllSnapshots();let e=Vk.now();Rk.delta=gk(0,1e3/60,e-Rk.timestamp),Rk.timestamp=e,Rk.isProcessing=!0,zk.update.process(Rk),zk.preRender.process(Rk),zk.render.process(Rk),Rk.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,gj.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(_Be),this.sharedNodes.forEach(SBe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ik.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ik.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!_M(this.snapshot.measuredBox.x)&&!_M(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Dj(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!DM(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||zj(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),EBe(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Dj();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(DBe))){let{scroll:e}=this.root;e&&(Kj(t.x,e.offset.x),Kj(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Dj();if(pM(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&pM(t,e),Kj(t.x,i.offset.x),Kj(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=Dj();pM(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Yj(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),zj(r.latestValues)&&Yj(n,r.latestValues)}return zj(this.latestValues)&&Yj(n,this.latestValues),n}removeTransform(e){let t=Dj();pM(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!zj(n.latestValues))continue;Rj(n.latestValues)&&n.updateSnapshot();let r=Dj();pM(r,n.measurePageBox()),TM(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return zj(this.latestValues)&&TM(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Rk.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;
229if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Rk.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Dj(),this.targetWithTransforms=Dj()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Xze(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):pM(this.target,this.layout.layoutBox),Uj(this.target,this.targetDelta)):pM(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Pk.value&&HM.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Rj(this.parent.latestValues)||Cze(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Dj(),this.relativeTargetOrigin=Dj(),SM(this.relativeTargetOrigin,t,n),pM(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Rk.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;pM(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Tze(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Dj());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(mM(this.prevProjectionDelta.x,this.projectionDelta.x),mM(this.prevProjectionDelta.y,this.projectionDelta.y)),yM(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!MM(this.projectionDelta.x,this.prevProjectionDelta.x)||!MM(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Pk.value&&HM.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ej(),this.projectionDelta=Ej(),this.projectionDeltaWithTransform=Ej()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=Ej();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=Dj(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(wBe));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;XM(a.x,e.x,n),XM(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(SM(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),CBe(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&eBe(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=Dj(),pM(d,this.relativeTarget)),s&&(this.animationValues=i,rBe(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Lk(this.pendingAnimation),void 0),this.pendingAnimation=Ik.update(()=>{VM.hasAnimatedSinceResize=!0,Hk.layout++,this.motionValue||=oj(0),this.motionValue.jump(0,!1),this.currentAnimation=oBe(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{Hk.layout--},onComplete:()=>{Hk.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(dBe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&tN(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Dj();let t=_M(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=_M(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}pM(t,n),Yj(t,i),yM(this.projectionDeltaWithTransform,this.layoutCorrected,t,i
229)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new uBe),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&WM(`z`,e,r,this.animationValues);for(let t=0;t<UM.length;t++)WM(`rotate${UM[t]}`,e,r,this.animationValues),WM(`skew${UM[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=BM(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=BM(t?.pointerEvents)||``),this.hasProjected&&!zj(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=tBe(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;for(let t in e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit,tM){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=tM[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?BM(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(qM),this.root.sharedNodes.clear()}}}function pBe(e){e.updateLayout()}function mBe(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?NM(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=_M(r);r.min=n[e].min,r.max=r.min+i}):tN(i,t.layoutBox,n)&&NM(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=_M(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Ej();yM(o,n,t.layoutBox);let s=Ej();a?yM(s,e.applyTransform(r,!0),t.measuredBox):yM(s,n,t.layoutBox);let c=!DM(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=Dj();SM(o,t.layoutBox,i.layoutBox);let s=Dj();SM(s,n,a.layoutBox),AM(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function hBe(e){Pk.value&&HM.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function gBe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function _Be(e){e.clearSnapshot()}function qM(e){e.clearMeasurements()}function JM(e){e.isLayoutDirty=!1}function vBe(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function YM(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function yBe(e){e.resolveTargetDelta()}function bBe(e){e.calcProjection()}
229function xBe(e){e.resetSkewAndRotation()}function SBe(e){e.removeLeadSnapshot()}function XM(e,t,n){e.translate=yA(t.translate,0,n),e.scale=yA(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ZM(e,t,n,r){e.min=yA(t.min,n.min,r),e.max=yA(t.max,n.max,r)}function CBe(e,t,n,r){ZM(e.x,t.x,n.x,r),ZM(e.y,t.y,n.y,r)}function wBe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var TBe={duration:.45,ease:[.4,0,.1,1]},QM=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),$M=QM(`applewebkit/`)&&!QM(`chrome/`)?Math.round:vk;function eN(e){e.min=$M(e.min),e.max=$M(e.max)}function EBe(e){eN(e.x),eN(e.y)}function tN(e,t,n){return e===`position`||e===`preserve-aspect`&&!Yze(jM(t),jM(n),.2)}function DBe(e){return e!==e.root&&e.scroll?.wasRoot}var OBe=KM({attachResizeListener:(e,t)=>zM(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),nN={current:void 0},rN=KM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!nN.current){let e=new OBe({});e.mount(window),e.setOptions({layoutScroll:!0}),nN.current=e}return nN.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),iN=(0,B.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function aN(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function kBe(...e){return t=>{let n=!1,r=e.map(e=>{let r=aN(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():aN(e[t],null)}}}}function ABe(...e){return B.useCallback(kBe(...e),e)}var jBe=class extends B.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=hj(e)&&e.offsetWidth||0,r=hj(e)&&e.offsetHeight||0,i=this.props.sizeRef.current;i.height=t.offsetHeight||0,i.width=t.offsetWidth||0,i.top=t.offsetTop,i.left=t.offsetLeft,i.right=n-i.width-i.left,i.bottom=r-i.height-i.top}return null}componentDidUpdate(){}render(){return this.props.children}};function MBe({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,B.useId)(),s=(0,B.useRef)(null),c=(0,B.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=(0,B.useContext)(iN),u=ABe(s,e.props?.ref??e?.ref);return(0,B.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m}=c.current;if(t||a===!1||!s.current||!e||!u)return;let h=n===`left`?`left: ${f}`:`right: ${p}`,g=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let _=document.createElement(`style`);l&&(_.nonce=l);let v=i??document.head;return v.appendChild(_),_.sheet&&_.sheet.insertRule(` 230 [data-motion-pop-id="${o}"] { 231 position: absolute !important; 232 width: ${e}px !important; 233 height: ${u}px !important; 234 ${h}px !important; 235 ${g}px !important; 236 } 237 `),()=>{v.contains(_)&&v.removeChild(_)}},[t]),(0,K.jsx)(jBe,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:B.cloneElement(e,{ref:u})})}var NBe=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=dk(PBe),d=(0,B.useId)(),f=!0,p=(0,B.useMemo)(()=>(f=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>u.delete(e))}),[n,u,r]);return a&&f&&(p={...p}),(0,B.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),B.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,K.jsx)(MBe,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,K.jsx)(pk.Provider,{value:p,children:e})};function PBe(){return new Map}function oN(e=!0){let t=(0,B.useContext)(pk);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,B.useId)();(0,B.useEffect)(()=>
237{if(e)return i(a)},[e]);let o=(0,B.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var sN=e=>e.key||``;function cN(e){let t=[];return B.Children.forEach(e,e=>{(0,B.isValidElement)(e)&&t.push(e)}),t}var lN=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=oN(o),f=(0,B.useMemo)(()=>cN(e),[e]),p=o&&!u?[]:f.map(sN),m=(0,B.useRef)(!0),h=(0,B.useRef)(f),g=dk(()=>new Map),_=(0,B.useRef)(new Set),[v,y]=(0,B.useState)(f),[b,x]=(0,B.useState)(f);fk(()=>{m.current=!1,h.current=f;for(let e=0;e<b.length;e++){let t=sN(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f];for(let t=0;t<b.length;t++){let n=b[t],r=sN(n);p.includes(r)||(e.splice(t,0,n),S.push(n))}return a===`wait`&&S.length&&(e=S),x(cN(e)),y(f),null}let{forceRender:C}=(0,B.useContext)(uk);return(0,K.jsx)(K.Fragment,{children:b.map(e=>{let v=sN(e),y=o&&!u?!1:f===b||p.includes(v);return(0,K.jsx)(NBe,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(_.current.add(v),g.has(v))g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},uN=(0,B.createContext)({strict:!1}),dN={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},fN=!1;function FBe(){if(fN)return;let e={};for(let t in dN)e[t]={isEnabled:e=>dN[t].some(t=>!!e[t])};gze(e),fN=!0}function pN(){return FBe(),_ze()}function IBe(e){let t=pN();for(let n in e)t[n]={...t[n],...e[n]};gze(t)}var LBe=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function mN(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||LBe.has(e)}var RBe=c({default:()=>hN}),hN,zBe=o((()=>{throw hN={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),gN=e=>!mN(e);function BBe(e){typeof e==`function`&&(gN=t=>t.startsWith(`on`)?!mN(t):e(t))}try{BBe((zBe(),d(RBe)).default)}catch{}function VBe(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(gN(i)||n===!0&&mN(i)||!t&&!mN(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var _N=(0,B.createContext)({});function HBe(e,t){if(Mj(e)){let{initial:t,animate:n}=e;return{initial:t===!1||kj(t)?t:void 0,animate:kj(n)?n:void 0}}return e.inherit===!1?{}:t}function UBe(e){let{initial:t,animate:n}=HBe(e,(0,B.useContext)(_N));return(0,B.useMemo)(()=>({initial:t,animate:n}),[vN(t),vN(n)])}function vN(e){return Array.isArray(e)?e.join(` `):e}var yN=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function bN(e,t,n){for(let r in t)!cj(t[r])&&!nM(r,n)&&(e[r]=t[r])}function WBe({transformTemplate:e},t){return(0,B.useMemo)(()=>{let n=yN();return Zj(n,t,e),Object.assign({},n.vars,n.style)},[t])}function GBe(e,t){let n=e.style||{},r={};return bN(r,n,e),Object.assign(r,WBe(e,t)),r}function KBe(e,t){let n={},r=GBe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var xN=()=>({...yN(),attrs:{}});function qBe(e,t,n,r){let i=(0,B.useMemo)(()=>{let n=xN();return iM(n,t,oM(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};bN(t,e.style,e),i.style={...t,...i.style}}return i}var JBe=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function SN(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(JBe.indexOf(e)>-1||/[A-Z]/u.test(e))}function YBe(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??SN(e)?qBe:KBe)(t,r,i,e),c=VBe(t,typeof e==`string`,a),l=e===B.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,B.useMemo)(()=>cj(u)?u.get():u,[u]);return(0,B.createElement)(e,{...l,children:d})}function XBe({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:ZBe(n,r,i,e),renderState:t()}}function ZBe(e,t,n,r){let i={}
237,a=r(e,{});for(let e in a)i[e]=BM(a[e]);let{initial:o,animate:s}=e,c=Mj(e),l=dze(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Oj(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=rj(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var CN=e=>(t,n)=>{let r=(0,B.useContext)(_N),i=(0,B.useContext)(pk),a=()=>XBe(e,t,r,i);return n?a():dk(a)},QBe=CN({scrapeMotionValuesFromProps:rM,createRenderState:yN}),$Be=CN({scrapeMotionValuesFromProps:sM,createRenderState:xN}),eVe=Symbol.for(`motionComponentSymbol`);function tVe(e,t,n){let r=(0,B.useRef)(n);(0,B.useInsertionEffect)(()=>{r.current=n});let i=(0,B.useRef)(null);return(0,B.useCallback)(n=>{n&&e.onMount?.(n);let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n);t&&(n?t.mount(n):t.unmount())},[t])}var wN=(0,B.createContext)({});function TN(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function nVe(e,t,n,r,i,a){let{visualElement:o}=(0,B.useContext)(_N),s=(0,B.useContext)(uN),c=(0,B.useContext)(pk),l=(0,B.useContext)(iN),u=l.reducedMotion,d=l.skipAnimations,f=(0,B.useRef)(null),p=(0,B.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,B.useContext)(wN);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&rVe(f.current,n,i,h);let g=(0,B.useRef)(!1);(0,B.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[iRe],v=(0,B.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return fk(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,B.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function rVe(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:EN(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&TN(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function EN(e){if(e)return e.options.allowProjection===!1?EN(e.parent):e.projection}function DN(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&IBe(r);let a=n?n===`svg`:SN(e),o=a?$Be:QBe;function s(n,s){let c,l={...(0,B.useContext)(iN),...n,layoutId:iVe(n)},{isStatic:u}=l,d=UBe(n),f=o(n,u);if(!u&&typeof window<`u`){aVe(l,r);let t=oVe(l);c=t.MeasureLayout,d.visualElement=nVe(e,f,l,i,t.ProjectionNode,a)}return(0,K.jsxs)(_N.Provider,{value:d,children:[c&&d.visualElement?(0,K.jsx)(c,{visualElement:d.visualElement,...l}):null,YBe(e,n,tVe(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,B.forwardRef)(s);return c[eVe]=e,c}function iVe({layoutId:e}){let t=(0,B.useContext)(uk).id;return t&&e!==void 0?t+`-`+e:e}function aVe(e,t){(0,B.useContext)(uN).strict}function oVe(e){let{drag:t,layout:n}=pN();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function sVe(e,t){if(typeof Proxy>`u`)return DN;let n=new Map,r=(n,r)=>DN(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,DN(a,void 0,e,t)),n.get(a))})}var cVe=(e,t)=>t.isSVG??SN(e)?new Rze(t):new Mze(t,{allowProjection:e!==B.Fragment}),lVe=class extends Ij{constructor(e){super(e),e.animationState||=Uze(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Oj(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},uVe=0,dVe={animation:{Feature:lVe},exit:{Feature:class extends Ij{constructor(){super(...arguments),this.id=uVe++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>
237{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function ON(e){return{point:{x:e.pageX,y:e.pageY}}}var fVe=e=>t=>vj(t)&&e(t,ON(t));function kN(e,t,n,r){return zM(e,t,fVe(n),r)}var AN=({current:e})=>e?e.ownerDocument.defaultView:null,jN=(e,t)=>Math.abs(e-t);function pVe(e,t){let n=jN(e.x,t.x),r=jN(e.y,t.y);return Math.sqrt(n**2+r**2)}var MN=new Set([`auto`,`scroll`]),NN=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=IN(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=pVe(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=Rk;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=PN(t,this.transformPagePoint),Ik.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=IN(e.type===`pointercancel`?this.lastMoveEventInfo:PN(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!vj(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=PN(ON(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Rk;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,IN(s,this.history)),this.removeListeners=yk(kN(this.contextWindow,`pointermove`,this.handlePointerMove),kN(this.contextWindow,`pointerup`,this.handlePointerUp),kN(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(MN.has(e.overflowX)||MN.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Ik.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Lk(this.updatePoint)}};function PN(e,t){return t?{point:t(e.point)}:e}function FN(e,t){return{x:e.x-t.x,y:e.y-t.y}}function IN({point:e},t){return{point:e,delta:FN(e,LN(t)),offset:FN(e,mVe(t)),velocity:hVe(t,.1)}}function mVe(e){return e[0]}function LN(e){return e[e.length-1]}function hVe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=LN(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Sk(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Sk(t)*2&&(r=e[1]);let a=Ck(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function gVe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?yA(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?yA(n,e,r.max):Math.min(e,n)),e}function RN(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function _Ve(e,{top:t,left:n,bottom:r,right:i}){return{x:RN(e.x,n,i),y:RN(e.y,t,r)}}function zN(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function vVe(e,t){return{x:zN(e.x,t.x),y:zN(e.y,t.y)}}function yVe(e,t){let n=.5,r=_M(e),i=_M(t);return i>r?n=bk(t.min,t.max-r,e.min):r>i&&(n=bk(e.min,e.max-i,t.min)),gk(0,1,n)}function bVe(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var BN=.35;function xVe(e=BN){return e===!1?e=0:e===!0&&(e=BN),{x:VN(e,`left`,`right`),y:VN(e,`top`,`bottom`)}}function VN(e,t,n){return{min:HN(e,t),max:HN(e,n)}}function HN(e,t){return typeof e==`number`?e:e[t]||0}var SVe=new WeakMap,CVe=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Dj(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(ON(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jRe(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),NM(e=>{let t=this.getAxisMotionValue(e).get()||0;if(aA.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=_M(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Ik.update(()=>i(e,t),!1,!0),lj(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=TVe(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Ik.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new NN(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:AN(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Ik.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!WN(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=gVe(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&TN(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=_Ve(n.layoutBox,e):this.constraints=!1,this.elastic=xVe(t),r!==this.constraints&&!TN(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&NM(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=bVe(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!TN(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Eze(n,r.root,this.visualElement.getTransformPagePoint()),a=vVe(r.layout.layoutBox,i);if(t){let e=t(xze(a));this.hasMutatedConstraints=!!e,e&&(a=bze(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=NM(o=>{if(!WN(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return lj(this.visualElement,e),n.start(nj(e,n,0,t,this.visualElement,!1))}stopAnimation(){NM(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){NM(t=>{let{drag:n}=this.getProps();if(!WN(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-yA(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!TN(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};NM(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=yVe({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),NM(t=>{if(!WN(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(yA(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;SVe.set(this.visualElement,this);let e=this.visualElement.current,t=kN(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&zRe(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();TN(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=wVe(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ik.read(r);let o=zM(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(NM(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=BN,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function UN(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function wVe(e,t,n){let r=eze(e,UN(n)),i=eze(t,UN(n));return()=>{r(),i()}}function WN(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function TVe(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var EVe=class extends Ij{constructor(e){super(e),this.removeGroupControls=vk,this.removeListeners=vk,this.controls=new CVe(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vk}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},GN=e=>(t,n)=>{e&&Ik.update(()=>e(t,n),!1,!0)},DVe=class extends Ij{constructor(){super(...arguments),this.removePointerDownListener=vk}onPointerDown(e){this.session=new NN(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:AN(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:GN(e),onStart:GN(t),onMove:GN(n),onEnd:(e,t)=>{delete this.session,r&&Ik.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=kN(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},KN=!1,OVe=class extends B.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),KN&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),VM.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),KN=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Ik.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),gj.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;KN=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function qN(e){let[t,n]=oN(),r=(0,B.useContext)(uk);return(0,K.jsx)(OVe,{...e,layoutGroup:r,switchLayoutGroup:(0,B.useContext)(wN),isPresent:t,safeToRemove:n})}var kVe={pan:{Feature:DVe},drag:{Feature:EVe,ProjectionNode:rN,MeasureLayout:qN}};
237function JN(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Ik.postRender(()=>i(t,ON(t)))}var AVe=class extends Ij{mount(){let{current:e}=this.node;e&&(this.unmount=PRe(e,(e,t)=>(JN(this.node,t,`Start`),e=>JN(this.node,e,`End`))))}unmount(){}},jVe=class extends Ij{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=yk(zM(this.node.current,`focus`,()=>this.onFocus()),zM(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function YN(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Ik.postRender(()=>i(t,ON(t)))}var MVe=class extends Ij{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=WRe(e,(e,t)=>(YN(this.node,t,`Start`),(e,{success:t})=>YN(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},XN=new WeakMap,ZN=new WeakMap,NVe=e=>{let t=XN.get(e.target);t&&t(e)},PVe=e=>{e.forEach(NVe)};function FVe({root:e,...t}){let n=e||document;ZN.has(n)||ZN.set(n,{});let r=ZN.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(PVe,{root:e,...t})),r[i]}function IVe(e,t,n){let r=FVe(t);return XN.set(e,n),r.observe(e),()=>{XN.delete(e),r.unobserve(e)}}var LVe={some:0,all:1},RVe=class extends Ij{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:LVe[r]};return IVe(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(zVe(e,t))&&this.startObserver()}unmount(){}};function zVe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var BVe={inView:{Feature:RVe},tap:{Feature:MVe},focus:{Feature:jVe},hover:{Feature:AVe}},VVe={layout:{ProjectionNode:rN,MeasureLayout:qN}},QN=sVe({...dVe,...BVe,...kVe,...VVe},cVe);function $N(e){let t=dk(()=>oj(e)),{isStatic:n}=(0,B.useContext)(iN);if(n){let[,n]=(0,B.useState)(e);(0,B.useEffect)(()=>t.on(`change`,n),[])}return t}function eP(e,t){let n=$N(t()),r=()=>n.set(t());return r(),fk(()=>{let t=()=>Ik.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),Lk(r)}}),n}function HVe(e){aj.current=[],e();let t=eP(aj.current,e);return aj.current=void 0,t}function tP(e,t,n,r){if(typeof e==`function`)return HVe(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return UVe(e,t,n,r);let i=typeof t==`function`?t:nze(t,n,r),a=Array.isArray(e)?nP(e,i):nP([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function nP(e,t){let n=dk(()=>[]);return eP(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function UVe(e,t,n,r){let i=dk(()=>Object.keys(n)),a=dk(()=>({}));for(let o of i)a[o]=tP(e,t,n[o],r);return a}function WVe(e,t={}){let{isStatic:n}=(0,B.useContext)(iN),r=()=>cj(e)?e.get():e;if(n)return tP(r);let i=$N(r());return(0,B.useInsertionEffect)(()=>rze(i,e,t),[i,JSON.stringify(t)]),i}function rP(e,t={}){return WVe(e,{type:`spring`,...t})}function iP(){!Pj.current&&mze();let[e]=(0,B.useState)(Nj.current);return e}function aP({...e}){return(0,K.jsx)(Ske,{"data-slot":`popover`,...e})}function oP({...e}){return(0,K.jsx)(Cke,{"data-slot":`popover-trigger`,...e})}function sP({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,K.jsx)(wke,{children:(0,K.jsx)(Tke,{"data-slot":`popover-content`,align:t,sideOffset:n,className:q(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
237de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...r})})}function GVe(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function KVe(e){let t=(e||``).split(/[\s\-_/]+/).filter(Boolean);return t.length===0?`?`:t.length===1?(t[0].slice(0,2)||`?`).toUpperCase():(t[0][0]+t[1][0]).toUpperCase()}function qVe(e){return(70+GVe(e||``)%320)%360}var JVe={sm:`size-5 text-[9px]`,md:`size-7 text-[11px]`,lg:`size-10 text-sm`};function cP({id:e,name:t,size:n=`md`,className:r}){return(0,K.jsx)(`span`,{"aria-hidden":!0,className:q(`persona-glyph inline-flex shrink-0 items-center justify-center rounded-full font-mono font-medium leading-none tracking-tight`,JVe[n],r),style:{"--glyph-hue":qVe(e)},children:KVe(t)})}function lP({label:e=`Team`,className:t}){return(0,K.jsxs)(`span`,{className:q(`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium`,`bg-muted text-muted-foreground`,t),children:[(0,K.jsx)(Mg,{className:`size-3`}),e]})}function uP({className:e}){let{t}=V();return(0,K.jsxs)(`span`,{className:q(`inline-flex items-center gap-0.5 font-mono text-[10px] text-persona`,e),children:[(0,K.jsx)(`span`,{"aria-hidden":!0,children:`â
`}),t(`personas.default`)]})}function YVe({activeId:e,canMutate:t,onSelect:n,onNew:r}){let{t:i}=V(),a=Sv(),o=Q(e=>e.personas),s=Q(e=>e.personasLoaded),c=Q(e=>e.fetchPersonas);return(0,B.useEffect)(()=>{s||c()},[s,c]),(0,K.jsxs)(XO,{children:[(0,K.jsx)(ZO,{placeholder:i(`chat.select_persona`)}),(0,K.jsxs)(QO,{children:[(0,K.jsx)($O,{children:i(`personas.no_match`,{query:``})}),(0,K.jsxs)(ek,{children:[(0,K.jsxs)(nk,{value:`__none__`,onSelect:()=>n(null),className:`gap-2`,children:[(0,K.jsx)(`span`,{className:`flex-1 text-muted-foreground`,children:i(`chat.persona_chip_none`)}),e===null?(0,K.jsx)(Lg,{className:`size-4`}):null]}),o.map(t=>(0,K.jsxs)(nk,{value:`${t.name} ${t.description??``} ${t.id}`,onSelect:()=>n(t.id),className:`gap-2`,children:[(0,K.jsx)(cP,{id:t.id,name:t.name,size:`sm`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`truncate text-sm`,children:t.name}),t.is_default?(0,K.jsx)(uP,{}):null,t.org_id?(0,K.jsx)(lP,{}):null]}),t.description?(0,K.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:t.description}):null]}),e===t.id?(0,K.jsx)(Lg,{className:`size-4 shrink-0`}):null]},t.id))]}),(0,K.jsx)(tk,{}),(0,K.jsxs)(ek,{children:[t?(0,K.jsxs)(nk,{value:`__new__`,onSelect:r,className:`gap-2`,children:[(0,K.jsx)(T_,{className:`size-4`}),(0,K.jsxs)(`span`,{className:`text-sm`,children:[i(`personas.new_persona`),`â¦`]})]}):null,(0,K.jsxs)(nk,{value:`__manage__`,onSelect:()=>a(`/vault/personas`),className:`gap-2`,children:[(0,K.jsx)(N_,{className:`size-4`}),(0,K.jsx)(`span`,{className:`text-sm`,children:i(`personas.manage_personas`)})]})]})]})]})}function dP({className:e,type:t,...n}){return(0,K.jsx)(`input`,{type:t,"data-slot":`input`,className:q(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,e),...n})}v();var XVe=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ny(`Primitive.${t}`),r=B.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,K.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),ZVe=`Label`,fP=B.forwardRef((e,t)=>
237(0,K.jsx)(XVe.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));fP.displayName=ZVe;var QVe=fP;function pP({className:e,...t}){return(0,K.jsx)(QVe,{"data-slot":`label`,className:q(`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})}function mP({className:e,size:t=`default`,...n}){return(0,K.jsx)(iMe,{"data-slot":`switch`,"data-size":t,className:q(`peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80`,e),...n,children:(0,K.jsx)(aMe,{"data-slot":`switch-thumb`,className:q(`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground`)})})}function hP({className:e,...t}){return(0,K.jsx)(`textarea`,{"data-slot":`textarea`,className:q(`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),...t})}function gP({title:e,description:t,leading:n,isDefault:r,isTeam:i,active:a,suffix:o,onClick:s,className:c}){return(0,K.jsxs)(`button`,{type:`button`,onClick:s,className:q(`sheet-corner group relative w-full rounded-lg border bg-card p-3 text-left transition-all duration-150`,a?`border-persona ring-1 ring-persona`:`border-border/60 hover:-translate-y-px hover:border-border`,c),children:[(0,K.jsx)(`span`,{className:`sheet-corner-fold`,"aria-hidden":!0}),(0,K.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[n?(0,K.jsx)(`div`,{className:`shrink-0`,children:n}):null,(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`truncate font-serif text-base leading-tight`,children:e}),o?(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/60`,children:o}):null]}),t?(0,K.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:t}):null,(r||i)&&(0,K.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2`,children:[r?(0,K.jsx)(uP,{}):null,i?(0,K.jsx)(lP,{}):null]})]})]})]})}const _P=2e4;function $Ve(e){if(!e)return null;let t=e.replace(/\r\n/g,` 238`).split(` 239`);for(let e of t){let t=e.trim();if(!t)continue;let n=/^#(?!#)\s+(.+?)\s*#*\s*$/.exec(t);return n&&n[1].trim()||null}return null}function eHe(e){return`${(e||``).toLowerCase().trim().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`persona`}.md`}function vP(e){return _O(e)}function tHe(e,t){let n=new Blob([t],{type:`text/markdown;charset=utf-8`}),r=URL.createObjectURL(n);try{let t=document.createElement(`a`);t.href=r,t.download=e,document.body.appendChild(t),t.click(),t.remove()}finally{URL.revokeObjectURL(r)}}function nHe(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result??``)),r.onerror=()=>n(r.error??Error(`read failed`)),r.readAsText(e)})}function yP({content:e,className:t}){let{t:n}=V(),r=e.length,i=vP(e);return(0,K.jsxs)(`div`,{className:q(`font-mono text-[10px] tabular-nums text-muted-foreground`,r>2e4*.95&&`text-destructive`,t),children:[n(`personas.chars_of_max`,{count:r}),` · `,n(`personas.tokens_estimate`,{tokens:i})]})}const bP=[`inhouse_counsel`,`deal_desk`,`plain_english`,`redline_reviewer`,`formal_memo`].map(e=>({id:e,nameKey:`personas.templates.${e}.name`,descriptionKey:`personas.templates.${e}.description`,contentKey:`personas.templates.${e}.content`})),rHe=e=>bP.find(t=>
239t.id===e);var iHe=`.md,.markdown,.txt`;const xP=({open:e,onOpenChange:t,onCreated:n,initialTemplateId:r})=>{let{t:i}=V(),a=Q(e=>e.createPersona),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(!1),[m,h]=(0,B.useState)(null),[g,_]=(0,B.useState)(null),[v,y]=(0,B.useState)(!1),b=(0,B.useRef)(null),x=e=>{let t=rHe(e);t&&(h(e),s(i(t.nameKey)),l(i(t.descriptionKey)),d(i(t.contentKey)))},S=()=>{h(null),s(``),l(``),d(``)};(0,B.useEffect)(()=>{if(!e){s(``),l(``),d(``),p(!1),h(null),_(null),y(!1);return}r&&x(r)},[e,r]);let C=async e=>{if(e)try{let t=await nHe(e);if(d(t.slice(0,_P)),h(null),!o.trim()){let e=$Ve(t);e&&s(e.slice(0,255))}}catch(e){_(Gb(e,i(`personas.import_failed`),{operation:`persona.import_md`}))}};return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsxs)(WC,{className:`sm:max-w-2xl`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{className:`font-serif text-xl tracking-tight`,children:i(`personas.dialog_title`)}),(0,K.jsx)(JC,{children:i(`personas.dialog_description`)})]}),g&&(0,K.jsx)(`div`,{className:`rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:g}),(0,K.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!(!o.trim()||!u.trim())){y(!0),_(null);try{let e=await a({name:o.trim(),description:c.trim(),content:u.trim(),is_default:f});n?.(e),t(!1)}catch(e){_(Gb(e,i(`errors.create_failed`),{operation:`persona.create`}))}finally{y(!1)}}},className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(pP,{className:`text-xs text-muted-foreground`,children:i(`personas.start_from_template`)}),(0,K.jsxs)(`div`,{className:`flex gap-2 overflow-x-auto pb-1`,children:[bP.map(e=>(0,K.jsx)(gP,{title:i(e.nameKey),suffix:`.md`,active:m===e.id,onClick:()=>x(e.id),className:`w-40 shrink-0`},e.id)),(0,K.jsx)(gP,{title:i(`personas.blank`),active:m===null&&!u,onClick:S,className:`w-28 shrink-0`})]})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`persona-name`,className:`text-xs text-muted-foreground`,children:i(`personas.name_placeholder`)}),(0,K.jsx)(dP,{id:`persona-name`,value:o,onChange:e=>s(e.target.value),placeholder:i(`personas.name_placeholder`),maxLength:255,disabled:v,required:!0,autoFocus:!0,className:`font-serif`})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`persona-description`,className:`text-xs text-muted-foreground`,children:i(`personas.description_label`)}),(0,K.jsx)(dP,{id:`persona-description`,value:c,onChange:e=>l(e.target.value),placeholder:i(`personas.description_placeholder`),maxLength:500,disabled:v})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(pP,{htmlFor:`persona-content`,className:`text-xs text-muted-foreground`,children:i(`personas.content_label`)}),(0,K.jsxs)(J,{type:`button`,variant:`ghost`,size:`xs`,onClick:()=>b.current?.click(),disabled:v,children:[(0,K.jsx)(W_,{className:`size-3`}),i(`personas.import_md`)]}),(0,K.jsx)(`input`,{ref:b,type:`file`,accept:iHe,hidden:!0,onChange:e=>{C(e.target.files?.[0]),e.target.value=``}})]}),(0,K.jsx)(`div`,{onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),C(e.dataTransfer.files?.[0])},className:q(`rounded-md border border-dashed border-input transition-colors`,`focus-within:border-ring`),children:(0,K.jsx)(hP,{id:`persona-content`,value:u,onChange:e=>d(e.target.value.slice(0,_P)),placeholder:i(`personas.content_placeholder`),maxLength:_P,disabled:v,required:!0,className:`min-h-[220px] resize-y border-0 font-mono text-xs leading-relaxed focus-visible:ring-0`})}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:i(`personas.import_hint`)}),(0,K.jsx)(yP,{content:u})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-border/60 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,K.jsx)(pP,{htmlFor:`persona-default`,className:`text-sm`,children:i(`personas.set_default`)}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`personas.default_hint`)})]}),(0,K.jsx)(mP,{id:`persona-default`,checked:f,onCheckedChange:p,disabled:v})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>t(!1),disabled:v,children:i(`common.cancel`)}),(0,K.jsx)(J,{type:`submit`,disabled:v||!o.trim()||!u.trim(),children:i(v?`common.saving`:`common.save`)})]})]})]})})};function SP(){let e=LS(e=>e.conversationId),t=LS(e=>e.personaOverrides),n=LS(e=>e.current_conversation?.org_profile_id),r=Q(e=>e.personas),i=(0,B.useMemo)(()=>_ge({conversationId:e,overrides:t,conversationPersonaId:n,personas:r}),[e,t,n,r]);return{personaId:i,persona:(0,B.useMemo)(()=>r.find(e=>e.id===i)??null,[r,i])}}function aHe(){let{t:e}=V(),{personaId:t,persona:n}=SP(),r=LS(e=>
239e.setPersonaForConversation),i=RS()!==`viewer`,a=iP(),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(!1),u=!!n,d=u?n.name:e(`chat.persona_chip_none`);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(aP,{open:o,onOpenChange:s,children:[(0,K.jsx)($T,{i18nKey:`tour.chat.persona`,side:`top`,children:(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsxs)(J,{type:`button`,size:`xs`,variant:`outline`,"aria-label":e(`chat.persona_chip_aria`),className:q(`gap-1.5`,u?`border-persona/40 bg-persona-soft text-foreground`:`text-muted-foreground`),children:[u?(0,K.jsx)(cP,{id:n.id,name:n.name,size:`sm`}):(0,K.jsx)(k_,{className:`size-4`}),(0,K.jsx)(lN,{mode:`wait`,initial:!1,children:(0,K.jsx)(QN.span,{initial:a?!1:{opacity:0,y:2},animate:{opacity:1,y:0},exit:a?{opacity:0}:{opacity:0,y:-2},transition:{duration:.12},className:q(`truncate`,u?`max-w-24 sm:max-w-36`:`hidden sm:inline`),children:d},t??`none`)})]})})}),(0,K.jsx)(sP,{align:`start`,className:`w-72 p-0`,children:(0,K.jsx)(YVe,{activeId:t,canMutate:i,onSelect:e=>{r(e),s(!1)},onNew:()=>{s(!1),l(!0)}})})]}),(0,K.jsx)(xP,{open:c,onOpenChange:l,onCreated:e=>r(e.id)})]})}function oHe(e){let t=[];for(let n of eS){let r=e[n];if(r.accounts.length===0){t.push({kind:`connect`,provider:n});continue}for(let e of r.accounts)e.notAvailable||t.push({kind:`account`,provider:n,account:e,action:Xye(e)?`use`:`reconnect`})}return t}function sHe(){let{t:e}=V(),t=LS(e=>e.pendingProviderPick),n=LS(e=>e.isStreaming),r=LS(e=>e.chooseEmailProvider),i=fS();(0,B.useEffect)(()=>{for(let e of eS){let t=lS[e].getStatus();!t.initialized&&!t.loading&&lS[e].fetchStatus()}},[]);let a=eS.every(e=>i[e].initialized&&!i[e].loading),o=oHe(i),s=o.filter(e=>e.kind===`account`&&e.action===`use`),c=s.length===1?s[0]:null,l=t?.source,u=(0,B.useRef)(!1);if((0,B.useEffect)(()=>{if(l!==`tool`||n||!a||!c||u.current)return;u.current=!0;let e=setTimeout(()=>r(c.provider,c.account.id,`tool`),0);return()=>clearTimeout(e)},[l,n,a,c,r]),!t||l===`tool`&&a&&s.length===1)return null;if(l===`tool`&&!a)return(0,K.jsxs)(`div`,{className:`mx-3 mt-2 flex items-center gap-2 rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground`,children:[(0,K.jsx)(W,{className:`size-3.5 animate-spin`}),e(`chat.email_picker.checking`)]});let d=s.length>0;return(0,K.jsxs)(`div`,{className:`mx-3 mt-2 rounded-md border border-primary/30 bg-primary/5 p-3 text-sm`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-start justify-between gap-2`,children:[(0,K.jsx)(`p`,{className:`font-medium text-foreground`,children:e(d?`chat.email_picker.pick_prompt`:`mail.providers.connect_title`)}),(0,K.jsx)(`button`,{type:`button`,className:`shrink-0 text-muted-foreground hover:text-foreground`,"aria-label":e(`common.cancel`),title:e(`common.cancel`),onClick:()=>LS.setState({pendingProviderPick:null}),children:(0,K.jsx)(J_,{className:`size-3.5`})})]}),!d&&(0,K.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:e(`mail.providers.connect_description`)}),(0,K.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:o.map(t=>{let n=lS[t.provider],i=n.icon,a=e(n.labelKey),o=t.kind===`account`?`${t.provider}:${t.account.id}`:`${t.provider}:connect`;return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5`,children:[(0,K.jsx)(i,{className:`size-4 shrink-0`,style:{color:n.color}}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-xs font-medium text-foreground`,children:a}),t.kind===`account`&&(0,K.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:t.account.email})]}),t.kind===`account`&&t.action===`use`?(0,K.jsx)(J,{type:`button`,size:`xs`,onClick:()=>r(t.provider,t.account.id,l??`manual`),children:e(`chat.email_picker.use`)}):(0,K.jsx)(J,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>n.startConnect(),children:t.kind===`account`&&t.action===`reconnect`?e(`chat.email_picker.reconnect`):e(n.connectLabelKey)})]},o)})})]})}const CP={google:`dashboard.provider_google`,outlook:`dashboard.provider_outlook`,caldav:`dashboard.provider_caldav`};function cHe(e){let t=[];for(let n of e.gmail)n.is_active&&t.push({provider:`google`,accountId:n.id,email:n.gmail_email,isPrimary:n.id===e.gmailPrimaryId,calendarScopeOk:n.calendar_scope_ok??!1});for(let n of e.outlook)n.is_active&&t.push({provider:`outlook`,accountId:n.id,email:n.outlook_email,isPrimary:n.id===e.outlookPrimaryId});for(let n of e.imap){if(!n.is_active)continue;let r=n.caldav;r?.is_active&&t.push({provider:`caldav`,accountId:r.id,email:n.email,isPrimary:n.id===e.imapPrimaryId})}return t}function wP(){let e=Xx(e=>e.accounts),t=Xx(e=>e.primaryAccountId),n=$x(e=>e.accounts),r=$x(e=>e.primaryAccountId),i=Qx(e=>e.accounts),a=Qx(e=>e.primaryAccountId);return(0,B.useMemo)(()=>cHe({gmail:e,gmailPrimaryId:t,outlook:n,outlookPrimaryId:r,imap:i,imapPrimaryId:a}),[e,t,n,r,i,a])}function TP(e,t){return t?e.find(e=>e.accountId===t)??null:null}function EP(e,t){return TP(e,t)?.email??null}function DP(e,t){if(t){let n=e.filter(e=>e.provider===t);return n.find(e=>e.isPrimary)??n[0]??e[0]??null}return e[0]??null}function lHe(e){let t=new Map;for(let n of e)t.set(n.provider,(t.get(n.provider)??0)+1);let n=new Set;for(let[e,r]of t)r>1&&n.add(e);return n}var uHe=new Set([`create_calendar_event`,`update_calendar_event`,`delete_calendar_event`]),dHe=new Set([`create_calendar_event`,`create_task`]),fHe=new Set([`delete_calendar_event`,`delete_task`]),pHe={create_calendar_event:`Add this event?`,update_calendar_event:`Upd
239ate this event?`,delete_calendar_event:`Cancel this event?`,create_task:`Add this task?`,update_task:`Update this task?`,delete_task:`Delete this task?`,complete_task:`Mark this task done?`,uncomplete_task:`Reopen this task?`};function OP(e){if(typeof e!=`string`||!e)return null;try{return fb(_b(e),`EEE, MMM d yyyy 'at' h:mm a`)}catch{return e}}function kP(e){if(typeof e!=`string`||!e)return null;try{return fb(_b(e),`EEE, MMM d yyyy`)}catch{return e}}function AP(e){return typeof e==`string`&&e?e:null}function mHe(){let{t:e}=V(),t=LS(e=>e.pendingCalendarToolUse),n=LS(e=>e.clearPendingCalendarToolUse),r=LS(e=>e.executeConfirmedCalendarTool),i=wP(),[a,o]=B.useState(null);if(!t)return null;let s=t.name,c=t.input,l=uHe.has(s),u=dHe.has(s),d=fHe.has(s),f=TP(i,a)??DP(i),p=u&&i.length>=2,m=pHe[s]??`Confirm this change?`,h=()=>{u?r({provider:f?.provider??`google`,accountId:f?.accountId??null}):r()},g=AP(c.summary)??AP(c.title)??(l?`this event`:`this task`);return(0,K.jsxs)(`div`,{className:`mx-3 mt-2 rounded-md border border-amber-500/40 bg-amber-50/10 p-3 text-sm`,children:[(0,K.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`p`,{className:`flex items-center gap-1.5 font-medium text-amber-700 dark:text-amber-400`,children:[(0,K.jsx)(d?V_:s.startsWith(`complete`)?Lg:l?Ng:h_,{className:`size-3.5`}),m]}),p&&(0,K.jsxs)(vO,{value:f?.accountId??``,onValueChange:o,children:[(0,K.jsx)(bO,{className:`h-7 w-44 text-xs`,children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:i.map(t=>(0,K.jsxs)(SO,{value:t.accountId,className:`text-xs`,children:[t.email,` · `,e(CP[t.provider])]},t.accountId))})]})]}),(0,K.jsxs)(`div`,{className:`rounded-md border border-border/50 bg-muted/30 p-2.5 space-y-1`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold`,children:g}),l?(0,K.jsxs)(K.Fragment,{children:[OP(c.start_datetime)&&(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[OP(c.start_datetime),OP(c.end_datetime)?` â ${OP(c.end_datetime)}`:``]}),AP(c.location)&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:AP(c.location)}),AP(c.description)&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:AP(c.description)}),Array.isArray(c.attendees)&&c.attendees.length>0&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c.attendees.join(`, `)})]}):(0,K.jsxs)(K.Fragment,{children:[kP(c.due_date)&&(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Due: `,kP(c.due_date)]}),AP(c.notes)&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:AP(c.notes)})]})]}),(0,K.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,K.jsx)(J,{type:`button`,size:`xs`,onClick:h,children:e(`common.confirm`)}),(0,K.jsx)(J,{type:`button`,size:`xs`,variant:`outline`,onClick:n,children:e(`common.cancel`)})]})]})}function hHe(){let{t:e}=V(),t=TO(e=>e.setupOpen),n=TO(e=>e.closeSetup),r=TO(e=>e.arm),i=Q(e=>e.chatModels),a=Q(e=>e.fetchChatModels),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``);(0,B.useEffect)(()=>{t&&i.length===0&&a()},[t,i.length,a]);let u=i.filter(e=>e.allowed);(0,B.useEffect)(()=>{t&&(s(e=>e||u[0]?.slug||``),l(e=>e||u[1]?.slug||u[0]?.slug||``))},[t,u.length]);let d=t=>e(`settings.billing.plan_${t}`,{defaultValue:t}),f=!!o&&o===c,p=!!o&&!!c&&!f,m=()=>{let e=i.find(e=>e.slug===o),t=i.find(e=>e.slug===c);!e?.allowed||!t?.allowed||e.slug===t.slug||r(e,t)},h=()=>i.map(t=>(0,K.jsxs)(SO,{value:t.slug,disabled:!t.allowed,children:[!t.allowed&&(0,K.jsx)(g_,{className:`size-3.5`}),t.display_name,!t.allowed&&(0,K.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground`,children:e(`chat.model_picker.requires_plan`,{plan:d(t.min_plan)})})]},t.slug));return(0,K.jsx)(HC,{open:t,onOpenChange:e=>!e&&n(),children:(0,K.jsxs)(WC,{children:[(0,K.jsxs)(GC,{children:[(0,K.jsxs)(qC,{className:`flex items-center gap-2`,children:[(0,K.jsx)(a_,{className:`size-4`}),e(`chat.benchmark.dialog_title`)]}),(0,K.jsx)(JC,{children:e(`chat.benchmark.dialog_description`)})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 py-2`,children:[(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(`label`,{className:`text-sm font-medium`,children:e(`chat.benchmark.model_a_label`)}),(0,K.jsxs)(vO,{value:o,onValueChange:s,children:[(0,K.jsx)(bO,{className:`w-full`,children:(0,K.jsx)(yO,{placeholder:e(`chat.benchmark.pick_model`)})}),(0,K.jsx)(xO,{children:h()})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(`label`,{className:`text-sm font-medium`,children:e(`chat.benchmark.model_b_label`)}),(0,K.jsxs)(vO,{value:c,onValueChange:l,children:[(0,K.jsx)(bO,{className:`w-full`,children:(0,K.jsx)(yO,{placeholder:e(`chat.benchmark.pick_model`)})}),(0,K.jsx)(xO,{children:h()})]})]}),f&&(0,K.jsx)(`p`,{className:`text-xs text-amber-600`,children:e(`chat.benchmark.same_model_error`)})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{type:`button`,variant:`outline`,onClick:n,children:e(`common.cancel`)}),(0,K.jsx)(J,{type:`button`,onClick:m,disabled:!p,children:e(`chat.benchmark.start`)})]})]})})}var gHe=32e3;function _He(){let{t:e}=V();return(0,K.jsx)(`div`,{className:`border rounded-md my-2 w-full px-4 py-3 text-sm text-muted-foreground`,children:e(`chat.viewer_read_only`)})}function vHe(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.role===`assistant`&&!n.id.startsWith(`temp-`))return n.id}return null}const jP=()=>{let{t:e}=V(),{formatNumber:t}=jb(),n=RS(),[r,i]=(0,B.useState)(()=>lx(LS.getState().conversationId)),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(!0),[l,u]=(0,B.useState)(gHe),[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(``),[h,g]=(0,B.useState)(0),_=(0,B.useRef)(null);(0,B.useEffect)(()=>{let e=_.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)},[r]),(0,B.useEffect)(()=>{let e=!1;return Upe().then(t=>{if(e)return;let n=t.data;n?.max_user_message_tokens>0&&u(n.max_user_message_tokens)}).catch(()=>{}),()=>{e=!0}},[]);let v=_O(r),{sendMessageStreamAction:y,isLoading:b,isStreaming:x,cancelStream:S,attachDocument:C,clearAttachments:w,attachImage:T,clearImages:E,pastedImages:D,pendingToolUse:O,clearPendingToolUse:k,executeConfirmedTool:A,conversationId:j,current_conversation:M,messages:N,error:P,usageLimitReached:F,contextLimit:I,matterScope:L,setMatterScope:ee}=LS(),R=v>l,te=vHe(N);(0,B.useEffect)(()=>{i(lx(j))},[j]),(0,B.useEffect)(()=>{P&&i(e=>e||lx(j))},[P,j]);let ne=(0,B.useRef)(void 0);O?.id!==ne.current&&(ne.current=O?.id,c(!0));let re=O?.input??{},ie=Sv(),{chatMode:z,modelTier:ae,selectedChatModel:oe,selectedThinkingLevel:se,selectedKnowledgeBase:ce}=Q(),le=TO(e=>e.armed),ue=TO(e=>e.disarm),de=TO(e=>e.runBenchmark),fe=RPe(j),pe=LPe(j),me=async e=>{e?.preventDefault();let t=r.trim(),n=LS.getState().pastedImages;if(!t&&n.length===0||b||x||F||I?.hard||pe)return;if((le||fe)&&t){i(``),dx(j);let e=LS.getState().attachedDocuments.map(e=>e.id);w(),E();let n=LS.getState().resolvePersonaIdForSend();await de(t,{knowledge_base_id:ce?.id,chat_mode:z,org_profile_id:n??void 0,...e.length>0?{inject_document_ids:e}:{}});return}if(fe)return;if(t&&_O(t)>l*.9){let e=await dPe(t);if(e>l){m(t),g(e),f(!0);return}}z===`library`&&ie(`/vault/library`);let a=LS.getState().attachedDocuments,o=a.map(e=>e.id);i(``),dx(j),w(),E(),await y(t,{model_tier:ae,model_choice:oe||void 0,thinking_level:se||void 0,knowledge_base_id:ce?.id,chat_mode:z,...o.length>0?{inject_document_ids:o,pinCandidates:a}:{},...n.length>0?{images:n}:{}})},he=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),me())},ge=async()=>{let e=r.trim();if(!e)return;let t=await dPe(e);m(e),g(t),f(!0)},_e=async(e,t)=>{try{let t=await Dbe(e);T({id:crypto.randomUUID(),...t})}catch(e){X(e,{operation:t})}},ve=async e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of Array.from(t))if(e.kind===`file`&&e.type.startsWith(`image/`)){let t=e.getAsFile();t&&n.push(t)}if(n.length!==0){e.preventDefault();for(let e of n)await _e(e,`chat_paste_image`)}};return n===`viewer`||M?.access===`shared`?(0,K.jsx)(_He,{}):(0,K.jsxs)(`div`,{className:`w-full rounded-[18px] border border-white/65 bg-white/60 shadow-[0_4px_10px_rgba(15,23,42,0.12),inset_0_1px_0_rgba(255,255,255,0.85),inset_0_-6px_14px_rgba(255,255,255,0.18)] backdrop-blur-2xl md:rounded-[22px]`,children:[(0,K.jsx)(uCe,{}),(0,K.jsx)(hHe,{}),(0,K.jsx)(lCe,{open:d,content:p,estimatedTokens:h,cap:l,onSaved:()=>{i(``),dx(j)},onClose:()=>{f(!1),m(``),g(0)}}),(0,K.jsx)(`form`,{onSubmit:me,className:`w-full`,children:(0,K.jsxs)(`div`,{className:`ChatArea rounded-md my-2 w-full transition-colors ${a?`border-primary border-dashed bg-primary/5`:`border-border`}`,onDragOver:e=>{e.preventDefault(),(e.dataTransfer.types.includes(`application/x-document`)||e.dataTransfer.types.includes(`Files`))&&o(!0)},onDragLeave:()=>{o(!1)},onDrop:async e=>{e.preventDefault(),o(!1);try{let t=e.dataTransfer.getData(`application/x-document`);if(t){let e=JSON.parse(t);C({id:e.documentId,filename:e.filename});return}}catch{}let t=e.dataTransfer.files;if(t.length>0)for(let e of Array.from(t)){if(e.type.startsWith(`image/`)){await _e(e,`chat_drop_image`);continue}try{let t=await sx(e);C({id:t.id,filename:t.original_filename})}catch(e){console.error(`File drop upload failed:`,e)}}},children:[O&&(0,K.jsxs)(`div`,{className:`mx-3 mt-2 rounded-md border border-amber-500/40 bg-amber-50/10 p-3 text-sm`,children:[(0,K.jsx)(`p`,{className:`font-medium text-amber-700 dark:text-amber-400 mb-1`,children:O.name===`send_email`?`Send email?`:`Create draft?`}),!!re.to&&(0,K.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`To: `,String(re.to)]}),!!re.subject&&(0,K.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Subject: `,String(re.subject)]}),!!re.body&&(0,K.jsxs)(`div`,{className:`mt-1.5`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,onClick:()=>c(e=>!e),children:[s?(0,K.jsx)(Rg,{className:`size-3`}):(0,K.jsx)(Bg,{className:`size-3`}),e(`mail.compose_view.body_placeholder`)]}),s&&(0,K.jsx)(`div`,{className:`mt-1 max-h-60 overflow-y-auto rounded border border-border/50 bg-muted/30 px-2.5 py-2 text-xs text-muted-foreground whitespace-pre-wrap`,children:String(re.body)})]}),(0,K.jsxs)(`div`,{className:`flex gap-2 mt-2`,children:[(0,K.jsx)(J,{type:`button`,size:`xs`,onClick:A,children:e(`common.confirm`)}),(0,K.jsx)(J,{type:`button`,size:`xs`,variant:`outline`,onClick:k,children:e(`common.cancel`)})]})]}),(0,K.jsx)(sHe,{}),(0,K.jsx)(mHe,{}),L&&(0,K.jsxs)(`div`,{className:`mx-3 mt-2 flex items-center gap-2 rounded-md border border-border bg-muted/40 px-2.5 py-1.5 text-xs`,children:[(0,K.jsx)(jg,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:L.name?e(`matters.chat.in_matter_named`,{name:L.name}):e(`matters.chat.in_matter`)}),(0,K.jsx)(`button`,{type:`button`,className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,"aria-label":e(`common.remove`),onClick:()=>ee(null),children:(0,K.jsx)(J_,{className:`size-3.5`})})]}),(0,K.jsx)(Sbe,{}),(0,K.jsx)(xbe,{}),(0,K.jsx)(wbe,{}),le&&(0,K.jsxs)(`div`,{className:`mx-3 mt-2 flex items-center gap-2 rounded-md border border-primary/40 bg-primary/5 px-2.5 py-1.5 text-xs`,children:[(0,K.jsx)(a_,{className:`size-3.5 shrink-0 text-primary`}),(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:e(`chat.benchmark.armed_chip`,{a:le.a.display_name,b:le.b.display_name})}),(0,K.jsx)(`button`,{type:`button`,className:`rounded p-0.5 text-muted-foreground hover:text-foreground`,"aria-label":e(`common.cancel`),onClick:ue,children:(0,K.jsx)(J_,{className:`size-3.5`})})]}),(0,K.jsx)($T,{i18nKey:`tour.chat.composer`,side:`right`,children:(0,K.jsx)(`textarea`,{ref:_,className:`w-full max-h-100 resize-none overflow-y-auto border-none bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,rows:1,value:r,onChange:e=>{let t=e.target.value;i(t),ux(j,t)},onKeyDown:he,onPaste:ve,placeholder:e(`chat.ask_anything`),disabled:b||F||!!I?.hard||pe})}),F&&(0,K.jsxs)(`div`,{className:`mx-3 mb-1 flex items-center gap-2 rounded-md border border-amber-500/40 bg-amber-50/10 px-2.5 py-1.5 text-xs text-amber-700 dark:text-amber-400`,children:[(0,K.jsx)(H_,{className:`size-3.5 shrink-0`}),(0,K.jsx)(`span`,{className:`flex-1`,children:e(`chat.usage_limit_hint`)}),(0,K.jsx)(J,{asChild:!0,size:`sm`,variant:`outline`,className:`h-6 px-2 text-xs`,children:(0,K.jsx)(Gv,{to:`/settings/billing`,children:e(`settings.billing.upgrade`)})})]}),R?(0,K.jsxs)(`div`,{className:`mx-3 mb-1 flex items-center gap-2 rounded-md border border-amber-500/40 bg-amber-50/10 px-2.5 py-1.5 text-xs text-amber-700 dark:text-amber-400`,children:[(0,K.jsx)(H_,{className:`size-3.5 shrink-0`}),(0,K.jsx)(`span`,{className:`flex-1 tabular-nums`,children:e(`chat.message_too_long`,{value:t(v),total:t(l)})}),(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 px-2 text-xs`,onClick:()=>void ge(),children:e(`chat.upload_as_file`)})]}):v>l*.5&&(0,K.jsx)(`div`,{className:`px-3 pb-1 text-[10px] tabular-nums ${v>l*.8?`text-amber-600`:`text-muted-foreground`}`,children:e(`chat.tokens_estimate`,{value:t(v),total:t(l)})}),(0,K.jsxs)(`div`,{className:`flex justify-between items-center px-2 pb-2 text-neutral-500`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1 `,children:[(0,K.jsx)(RFe,{onSelectPrompt:e=>{i(e),ux(j,e)}}),(0,K.jsx)(aHe,{}),te&&!x&&!pe&&(0,K.jsx)(mO,{subject:{type:`chat_message`,id:te,label:M?.title?e(`report_issue.chat_reply_in`,{title:Ab(
239M.title)}):e(`report_issue.chat_reply`)},className:Ny({variant:`outline`,size:`xs`})})]}),(0,K.jsxs)(`div`,{className:`flex gap-2 `,children:[fe?(0,K.jsx)(VPe,{}):(0,K.jsx)(vPe,{}),fe?null:(0,K.jsx)(yPe,{}),x?(0,K.jsx)(J,{type:`button`,size:`icon-sm`,variant:`destructive`,onClick:S,children:(0,K.jsx)(coe,{})}):(0,K.jsx)(J,{type:`submit`,size:`icon-sm`,disabled:!r.trim()&&D.length===0||b||pe,variant:`default`,children:b?(0,K.jsx)(W,{className:`animate-spin`}):(0,K.jsx)(Og,{})})]})]})]})})]})};function yHe(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var bHe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xHe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SHe={};function MP(e,t){return((t||SHe).jsx?xHe:bHe).test(e)}var CHe=/[ \t\n\f\r]/g;function wHe(e){return typeof e==`object`?e.type===`text`?NP(e.value):!1:NP(e)}function NP(e){return e.replace(CHe,``)===``}var PP=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};PP.prototype.normal={},PP.prototype.property={},PP.prototype.space=void 0;function FP(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new PP(n,r,t)}function IP(e){return e.toLowerCase()}var LP=class{constructor(e,t){this.attribute=t,this.property=e}};LP.prototype.attribute=``,LP.prototype.booleanish=!1,LP.prototype.boolean=!1,LP.prototype.commaOrSpaceSeparated=!1,LP.prototype.commaSeparated=!1,LP.prototype.defined=!1,LP.prototype.mustUseProperty=!1,LP.prototype.number=!1,LP.prototype.overloadedBoolean=!1,LP.prototype.property=``,LP.prototype.spaceSeparated=!1,LP.prototype.space=void 0;var RP=c({boolean:()=>zP,booleanish:()=>BP,commaOrSpaceSeparated:()=>GP,commaSeparated:()=>WP,number:()=>HP,overloadedBoolean:()=>VP,spaceSeparated:()=>UP}),THe=0;const zP=KP(),BP=KP(),VP=KP(),HP=KP(),UP=KP(),WP=KP(),GP=KP();function KP(){return 2**++THe}var qP=Object.keys(RP),JP=class extends LP{constructor(e,t,n,r){let i=-1;if(super(e,t),YP(this,`space`,r),typeof n==`number`)for(;++i<qP.length;){let e=qP[i];YP(this,qP[i],(n&RP[e])===RP[e])}}};JP.prototype.defined=!0;function YP(e,t,n){n&&(e[t]=n)}function XP(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new JP(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[IP(r)]=r,n[IP(a.attribute)]=r}return new PP(t,n,e.space)}const ZP=XP({properties:{ariaActiveDescendant:null,ariaAtomic:BP,ariaAutoComplete:null,ariaBusy:BP,ariaChecked:BP,ariaColCount:HP,ariaColIndex:HP,ariaColSpan:HP,ariaControls:UP,ariaCurrent:null,ariaDescribedBy:UP,ariaDetails:null,ariaDisabled:BP,ariaDropEffect:UP,ariaErrorMessage:null,ariaExpanded:BP,ariaFlowTo:UP,ariaGrabbed:BP,ariaHasPopup:null,ariaHidden:BP,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:UP,ariaLevel:HP,ariaLive:null,ariaModal:BP,ariaMultiLine:BP,ariaMultiSelectable:BP,ariaOrientation:null,ariaOwns:UP,ariaPlaceholder:null,ariaPosInSet:HP,ariaPressed:BP,ariaReadOnly:BP,ariaRelevant:null,ariaRequired:BP,ariaRoleDescription:UP,ariaRowCount:HP,ariaRowIndex:HP,ariaRowSpan:HP,ariaSelected:BP,ariaSetSize:HP,ariaSort:null,ariaValueMax:HP,ariaValueMin:HP,ariaValueNow:HP,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function QP(e,t){return t in e?e[t]:t}function $P(e,t){return QP(e,t.toLowerCase())}const EHe=XP({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:WP,acceptCharset:UP,accessKey:UP,action:null,allow:null,allowFullScreen:zP,allowPaymentRequest:zP,allowUserMedia:zP,alt:null,as:null,async:zP,autoCapitalize:null,autoComplete:UP,autoFocus:zP,autoPlay:zP,blocking:UP,capture:null,charSet:null,checked:zP,cite:null,className:UP,cols:HP,colSpan:null,content:null,contentEditable:BP,controls:zP,controlsList:UP,coords:HP|WP,crossOrigin:null,data:null,dateTime:null,decoding:null,default:zP,defer:zP,dir:null,dirName:null,disabled:zP,download:VP,draggable:BP,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:zP,formTarget:null,headers:UP,height:HP,hidden:VP,high:HP,href:null,hrefLang:null,htmlFor:UP,httpEquiv:UP,id:null,imageSizes:null,imageSrcSet:null,inert:zP,inputMode:null,integrity:null,is:null,isMap:zP,itemId:null,itemProp:UP,itemRef:UP,itemScope:zP,itemType:UP,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:zP,low:HP,manifest:null,max:null,maxLength:HP,media:null,method:null,min:null,minLength:HP,multiple:zP,muted:zP,name:null,nonce:null,noModule:zP,noValidate:zP,onAbort:null,onAfterPrint:null,onAuxCl
239ick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:zP,optimum:HP,pattern:null,ping:UP,placeholder:null,playsInline:zP,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:zP,referrerPolicy:null,rel:UP,required:zP,reversed:zP,rows:HP,rowSpan:HP,sandbox:UP,scope:null,scoped:zP,seamless:zP,selected:zP,shadowRootClonable:zP,shadowRootDelegatesFocus:zP,shadowRootMode:null,shape:null,size:HP,sizes:null,slot:null,span:HP,spellCheck:BP,src:null,srcDoc:null,srcLang:null,srcSet:null,start:HP,step:null,style:null,tabIndex:HP,target:null,title:null,translate:null,type:null,typeMustMatch:zP,useMap:null,value:BP,width:HP,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:UP,axis:null,background:null,bgColor:null,border:HP,borderColor:null,bottomMargin:HP,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:zP,declare:zP,event:null,face:null,frame:null,frameBorder:null,hSpace:HP,leftMargin:HP,link:null,longDesc:null,lowSrc:null,marginHeight:HP,marginWidth:HP,noResize:zP,noHref:zP,noShade:zP,noWrap:zP,object:null,profile:null,prompt:null,rev:null,rightMargin:HP,rules:null,scheme:null,scrolling:BP,standby:null,summary:null,text:null,topMargin:HP,valueType:null,version:null,vAlign:null,vLink:null,vSpace:HP,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:zP,disableRemotePlayback:zP,prefix:null,property:null,results:HP,security:null,unselectable:null},space:`html`,transform:$P}),DHe=XP({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,n
239avDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:GP,accentHeight:HP,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:HP,amplitude:HP,arabicForm:null,ascent:HP,attributeName:null,attributeType:null,azimuth:HP,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:HP,by:null,calcMode:null,capHeight:HP,className:UP,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:HP,diffuseConstant:HP,direction:null,display:null,dur:null,divisor:HP,dominantBaseline:null,download:zP,dx:null,dy:null,edgeMode:null,editable:null,elevation:HP,enableBackgroun
vendor: 21,399 bytes, lines 239-240
239d:null,end:null,event:null,exponent:HP,externalResourcesRequired:null,fill:null,fillOpacity:HP,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:WP,g2:WP,glyphName:WP,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:HP,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:HP,horizOriginX:HP,horizOriginY:HP,id:null,ideographic:HP,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:HP,k:HP,k1:HP,k2:HP,k3:HP,k4:HP,kernelMatrix:GP,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:HP,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:HP,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:HP,overlineThickness:HP,paintOrder:null,panose1:null,path:null,pathLength:HP,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:UP,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:HP,pointsAtY:HP,pointsAtZ:HP,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:GP,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:GP,rev:GP,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:GP,requiredFeatures:GP,requiredFonts:GP,requiredFormats:GP,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:HP,specularExponent:HP,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:HP,strikethroughThickness:HP,string:null,stroke:null,strokeDashArray:GP,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:HP,strokeOpacity:HP,strokeWidth:null,style:null,surfaceScale:HP,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:GP,tabIndex:HP,tableValues:null,target:null,targetX:HP,targetY:HP,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:GP,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:HP,underlineThickness:HP,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:HP,values:null,vAlphabetic:HP,vMathematical:HP,vectorEffect:null,vHanging:HP,vIdeographic:HP,version:null,vertAdvY:HP,vertOriginX:HP,vertOriginY:HP,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:HP,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:QP}),eF=XP({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),tF=XP({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:$P}),nF=XP({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),OHe={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`};var kHe=/[A-Z]/g,rF=/-[a-z]/g,AHe=/^data[-\w.:]+$/i;function jHe(e,t){let n=IP(t),r=t,i=LP;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&AHe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(rF,NHe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!rF.test(e)){let n=e.replace(kHe,MHe);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=JP}return new i(r,t)}function MHe(e){return`-`+e.toLowerCase()}function NHe(e){return e.charAt(1).toUpperCase()}const PHe=FP([ZP,EHe,eF,tF,nF],`html`),iF=FP([ZP,DHe,eF,tF,nF],`svg`);function FHe(e){return e.join(` `).trim()}var IHe=s(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=` 240`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),LHe=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(IHe());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),RHe=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),zHe=s(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(LHe()),r=RHe();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));const aF=sF(`end`),oF=sF(`start`);function sF(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function BHe(e){let t=oF(e),n=aF(e);if(t&&n)return{start:t,end:n}}function cF(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?uF(e.position):`start`in e||`end`in e?uF(e):`line`in e||`column`in e?lF(e):``}function lF(e){return dF(e&&e.line)+`:`+dF(e&&e.column)}function uF(e){return lF(e&&e.start)+`-`+lF(e&&e.end)}function dF(e){return e&&typeof e==`number`?e:1}var fF=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=cF(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};fF.prototype.file=``,fF.prototype.name=``,fF.prototype.reason=``,fF.prototype.message=``,fF.prototype.stack=``,fF.prototype.column=void 0,fF.prototype.line=void 0,fF.prototype.ancestors=void 0,fF.prototype.cause=void 0,fF.prototype.fatal=void 0,fF.prototype.place=void 0,fF.prototype.ruleId=void 0,fF.prototype.source=void 0;var VHe=u(zHe(),1),pF={}.hasOwnProperty,HHe=new Map,UHe=/[A-Z]/g,WHe=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),GHe=new Set([`td`,`th`]),mF=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function KHe(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=eUe(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=$He(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?iF:PHe,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=hF(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function hF(e,t,n){if(t.type===`element`)return qHe(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return JHe(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return XHe(e,t,n);if(t.type===`mdxjsEsm`)return YHe(e,t);if(t.type===`root`)return ZHe(e,t,n);if(t.type===`text`)return QHe(e,t)}function qHe(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=iF,e.schema=i),e.ancestors.push(t);let a=aUe(e,t.tagName,!1),o=tUe(e,t),s=vF(e,t);return WHe.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!wHe(e):!0})),gF(e,o,a,t),_F(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function JHe(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}yF(e,t.position)}function YHe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);yF(e,t.position)}function XHe(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=iF,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:aUe(e,t.name,!0),o=nUe(e,t),s=vF(e,t);return gF(e,o,a,t),_F(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ZHe(e,t,n){let r={};return _F(r,vF(e,t)),e.create(t,e.Fragment,r,n)}function QHe(e,t){return t.value}function gF(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function _F(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function $He(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function eUe(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=oF(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function tUe(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&pF.call(t.properties,i)){let a=rUe(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&GHe.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function nUe(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else yF(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else yF(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function vF(e,t){let n=[],r=-1,i=e.passKeys?new Map:HHe;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=hF(e,a,o);s!==void 0&&n.push(s)}return n}function rUe(e,t,n){let r=jHe(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?yHe(n):FHe(n)),r.property===`style`){let t=typeof n==`object`?n:iUe(e,String(n));return e.stylePropertyNameCase===`css`&&(t=oUe(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?OHe[r.property]||r.property:r.attribute,n]}}function iUe(e,t){try{return(0,VHe.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new fF("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=mF+`#cannot-parse-style-attribute`,r}}function aUe(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=MP(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=MP(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return pF.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);yF(e)}function yF(e,t){let n=new fF("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=mF+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function oUe(e){let t={},n;for(n in e)pF.call(e,n)&&(t[sUe(n)]=e[n]);return t}function sUe(e){let t=e.replace(UHe,cUe);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function cUe(e){return`-`+e.toLowerCase()}const bF={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]};var lUe={};function xF(e,t){let n=t||lUe;return uUe(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function uUe(e,t,n){if(fUe(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return dUe(e.children,t,n)}return Array.isArray(e)?dUe(e,t,n):``}function dUe(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=uUe(e[i],t,n);return r.join(``)}function fUe(e){return!!(e&&typeof e==`object`)}var pUe=document.createElement(`i`);function SF(e){let t=`&`+e+`;`;pUe.innerHTML=t;let n=pUe.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function CF(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function wF(e,t){return e.length>0?(CF(e,e.length,0,t),e):t}var mUe={}.hasOwnProperty;function hUe(e){let t={},n=-1;for(;++n<e.length;)gUe(t,e[n]);return t}function gUe(e,t){let n;for(n in t){let r=(mUe.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){mUe.call(r,a)||(r[a]=[]);let e=i[a];_Ue(r[a],Array.isArray(e)?e:e?[e]:[])}}}function _Ue(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);CF(e,0,0,r)}function vUe(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function TF(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const EF=FF(/[A-Za-z]/),DF=FF(/[\dA-Za-z]/),yUe=FF(/[#-'*+\--9=?A-Z^-~]/);function OF(e){return e!==null&&(e<32||e===127)}const kF=FF(/\d/),bUe=FF(/[\dA-Fa-f]/),xUe=FF(/[!-/:-@[-`{-~]/);function AF(e){return e!==null&&e<-2}function jF(e){return e!==null&&(e<0||e===32)}function MF(e){return e===-2||e===-1||e===32}const NF=FF(/\p{P}|\p{S}/u),PF=FF(/\s/);function FF(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function IF(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&DF(e.charCodeAt(n+1))&&DF(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function LF(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return MF(r)?(e.enter(n),s(r)):t(r)}function s(r){return MF(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const SUe={tokenize:CUe};function CUe(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),LF(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return AF(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const wUe={tokenize:EUe};var TUe={tokenize:DUe};function EUe(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return CF(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(TUe,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m
vendor: 37,547 bytes, line 240
240(e)}function f(n){return t.containerState={},e.attempt(TUe,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return AF(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;CF(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function DUe(e,t,n){return LF(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function RF(e){if(e===null||jF(e)||PF(e))return 1;if(NF(e))return 2}function zF(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const BF={name:`attention`,resolveAll:OUe,tokenize:kUe};function OUe(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};AUe(d,-c),AUe(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=wF(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=wF(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=wF(l,zF(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=wF(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=wF(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,CF(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function kUe(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=RF(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=RF(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function AUe(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const jUe={name:`autolink`,tokenize:MUe};function MUe(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return EF(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||DF(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||DF(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||OF(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):yUe(t)?(e.consume(t),l):n(t)}function u(e){return DF(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||DF(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const VF={partial:!0,tokenize:NUe};function NUe(e,t,n){return r;function r(t){return MF(t)?LF(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||AF(e)?t(e):n(e)}}const PUe={continuation:{tokenize:IUe},exit:LUe,name:`blockQuote`,tokenize:FUe};function FUe(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return MF(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function IUe(e,t,n){let r=this;return i;function i(t){return MF(t)?LF(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(PUe,t,n)(r)}}function LUe(e){e.exit(`blockQuote`)}const RUe={name:`characterEscape`,tokenize:zUe};function zUe(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return xUe(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const BUe={name:`characterReference`,tokenize:VUe};function VUe(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=DF,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=bUe,u):(e.enter(`characterReferenceValue`),a=7,o=kF,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===DF&&!SF(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var HUe={partial:!0,tokenize:GUe};const UUe={concrete:!0,name:`codeFenced`,tokenize:WUe};function WUe(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),MF(t)?LF(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||AF(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(HUe,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||AF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):MF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),LF(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||AF(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||AF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&MF(t)?LF(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||AF(t)?e.check(HUe,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||AF(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),MF(t)?LF(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),MF(t)?LF(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||AF(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function GUe(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const HF={name:`codeIndented`,tokenize:qUe};var KUe={partial:!0,tokenize:JUe};function qUe(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),LF(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):AF(t)?e.attempt(KUe,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||AF(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function JUe(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):AF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):LF(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):AF(e)?i(e):n(e)}}const YUe={name:`codeText`,previous:ZUe,resolve:XUe,tokenize:QUe};function XUe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ZUe(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function QUe(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):AF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||AF(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var $Ue=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&UF(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),UF(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),UF(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);UF(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);UF(this.left,t.reverse())}}};function UF(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function eWe(e){let t={},n=-1,r,i,a,o,s,c,l,u=new $Ue(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,tWe(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return CF(e,0,1/0,u.slice(0)),!l}function tWe(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const nWe={resolve:iWe,tokenize:aWe};var rWe={partial:!0,tokenize:oWe};function iWe(e){return eWe(e),e}function aWe(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):AF(t)?e.check(rWe,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function oWe(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),LF(e,a,`linePrefix`)}function a(i){if(i===null||AF(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function sWe(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||OF(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||AF(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||jF(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||OF(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function cWe(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):AF(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||AF(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!MF(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function lWe(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):AF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),LF(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||AF(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function WF(e,t){let n;return r;function r(i){return AF(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):MF(i)?LF(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const uWe={name:`definition`,tokenize:fWe};var dWe={partial:!0,tokenize:pWe};function fWe(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return cWe.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=TF(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return jF(t)?WF(e,l)(t):l(t)}function l(t){return sWe(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(dWe,d,d)(t)}function d(t){return MF(t)?LF(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||AF(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function pWe(e,t,n){return r;function r(t){return jF(t)?WF(e,i)(t):n(t)}function i(t){return lWe(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return MF(t)?LF(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||AF(e)?t(e):n(e)}}const mWe={name:`hardBreakEscape`,tokenize:hWe};function hWe(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return AF(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const gWe={name:`headingAtx`,resolve:_We,tokenize:vWe};function _We(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},CF(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function vWe(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||jF(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||AF(n)?(e.exit(`atxHeading`),t(n)):MF(n)?LF(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||jF(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const yWe=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),bWe=[`pre`,`script`,`style`,`textarea`],xWe={concrete:!0,name:`htmlFlow`,resolveTo:wWe,tokenize:TWe};var SWe={partial:!0,tokenize:DWe},CWe={partial:!0,tokenize:EWe};function wWe(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function TWe(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):EF(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):EF(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return EF(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||jF(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&bWe.includes(l)?(i=1,r.interrupt?t(s):O(s)):yWe.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||DF(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return MF(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||EF(t)?(e.consume(t),b):MF(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||DF(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):MF(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):MF(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||AF(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||jF(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||MF(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||AF(t)?O(t):MF(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):AF(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(SWe,ee,k)(t)):t===null||AF(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(CWe,A,ee)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||AF(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return bWe.includes(n)?(e.consume(t),L):O(t)}return EF(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||AF(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),L)}function ee(n){return e.exit(`htmlFlow`),t(n)}}function EWe(e,t,n){let r=this;return i;function i(t){return AF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function DWe(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(VF,t,n)}}const OWe={name:`htmlText`,tokenize:kWe};function kWe(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):EF(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):EF(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):AF(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):AF(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):AF(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):AF(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return EF(t)?(e.consume(t),S):n(t)}function S(t){return t===45||DF(t)?(e.consume(t),S):C(t)}function C(t){return AF(t)?(o=C,N(t)):MF(t)?(e.consume(t),C):M(t)}function w(t){return t===45||DF(t)?(e.consume(t),w):t===47||t===62||jF(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||EF(t)?(e.consume(t),E):AF(t)?(o=T,N(t)):MF(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||DF(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):AF(t)?(o=D,N(t)):MF(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):AF(t)?(o=O,N(t)):MF(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):AF(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||jF(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||jF(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return MF(t)?LF(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}const GF={name:`labelEnd`,resolveAll:NWe,resolveTo:PWe,tokenize:FWe};var AWe={tokenize:IWe},jWe={tokenize:LWe},MWe={tokenize:RWe};function NWe(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&CF(e,0,e.length,n),e}function PWe(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=wF(s,e.slice(a+1,a+r+3)),s=wF(s,[[`enter`,u,t]]),s=wF(s,zF(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=wF(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=wF(s,e.slice(o+1)),s=wF(s,[[`exit`,c,t]]),CF(e,a,e.length,s),e}function FWe(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(TF(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(AWe,u,o?u:d)(t):t===91?e.attempt(jWe,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(MWe,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function IWe(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return jF(t)?WF(e,a)(t):a(t)}function a(t){return t===41?u(t):sWe(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return jF(t)?WF(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?lWe(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return jF(t)?WF(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function LWe(e,t,n){let r=this;return i;function i(t){return cWe.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(TF(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function RWe(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const zWe={name:`labelStartImage`,resolveAll:GF.resolveAll,tokenize:BWe};function BWe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const VWe={name:`labelStartLink`,resolveAll:GF.resolveAll,tokenize:HWe};function HWe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const KF={name:`lineEnding`,tokenize:UWe};function UWe(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),LF(e,t,`linePrefix`)}}const qF={name:`thematicBreak`,tokenize:WWe};function WWe(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||AF(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),MF(t)?LF(e,s,`whitespace`)(t):s(t))}}const JF={continuation:{tokenize:JWe},exit:XWe,name:`list`,tokenize:qWe};var GWe={partial:!0,tokenize:ZWe},KWe={partial:!0,tokenize:YWe};function qWe(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:kF(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(qF,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return kF(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(VF,r.interrupt?n:u,e.attempt(GWe,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return MF(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function JWe(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(VF,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,LF(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!MF(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(KWe,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,LF(e,e.attempt(JF,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function YWe(e,t,n){let r=this;return LF(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function XWe(e){e.exit(this.containerState.type)}function ZWe(e,t,n){let r=this;return LF(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!MF(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const QWe={name:`setextUnderline`,resolveTo:$We,tokenize:eGe};function $We(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function eGe(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),MF(t)?LF(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||AF(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const tGe={tokenize:nGe};function nGe(e){let t=this,n=e.attempt(VF,r,e.attempt(this.parser.constructs.flowInitial,i,LF(e,e.attempt(this.parser.constructs.flow,i,e.attempt(nWe,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const rGe={resolveAll:sGe()},iGe=oGe(`string`),aGe=oGe(`text`);function oGe(e){return{resolveAll:sGe(e===`text`?cGe:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function sGe(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function cGe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var lGe=c({attentionMarkers:()=>_Ge,contentInitial:()=>dGe,disable:()=>vGe,document:()=>uGe,flow:()=>pGe,flowInitial:()=>fGe,insideSpan:()=>gGe,string:()=>mGe,text:()=>hGe});const uGe={42:JF,43:JF,45:JF,48:JF,49:JF,50:JF,51:JF,52:JF,53:JF,54:JF,55:JF,56:JF,57:JF,62:PUe},dGe={91:uWe}
vendor: 4,480 bytes, lines 240-242
240,fGe={[-2]:HF,[-1]:HF,32:HF},pGe={35:gWe,42:qF,45:[QWe,qF],60:xWe,61:QWe,95:qF,96:UUe,126:UUe},mGe={38:BUe,92:RUe},hGe={[-5]:KF,[-4]:KF,[-3]:KF,33:zWe,38:BUe,42:BF,60:[jUe,OWe],91:VWe,92:[mWe,RUe],93:GF,95:BF,96:YUe},gGe={null:[BF,rGe]},_Ge={null:[42,95]},vGe={null:[]};function yGe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=wF(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=zF(a,l.events,l),l.events):[]}function f(e,t){return xGe(p(e),t)}function p(e){return bGe(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){AF(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&CF(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function bGe(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function xGe(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=` 241`;break;case-3:o=`\r 242`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function SGe(e){let t={constructs:hUe([lGe,...(e||{}).extensions||[]]),content:n(SUe),defined:[],document:n(wUe),flow:n(tGe),lazy:{},string:n(iGe),text:n(aGe)};return t;function n(e){return n;function n(n){return yGe(t,e,n)}}}function CGe(e){for(;!eWe(e););return e}var wGe=/[\0\t\n\r]/g;function TGe(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(wGe.lastIndex=u,c=wGe.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var EGe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DGe(e){return e.replace(EGe,OGe)}function OGe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;
vendor: 11,244 bytes, lines 242-244
242return vUe(n.slice(t?2:1),t?16:10)}return SF(n)||e}var kGe={}.hasOwnProperty;function AGe(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),jGe(n)(CGe(SGe(n).document().write(TGe()(e,t,!0))))}function jGe(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(he),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(de),blockQuote:a(oe),characterEscape:T,characterReference:T,codeFenced:a(se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(se,o),codeText:a(ce,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(le),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ue),hardBreakEscape:a(fe),hardBreakTrailing:a(fe),htmlFlow:a(pe,o),htmlFlowData:T,htmlText:a(pe,o),htmlTextData:T,image:a(me),label:o,link:a(he),listItem:a(_e),listItemValue:f,listOrdered:a(ge,d),listUnordered:a(ge),paragraph:a(ve),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(de),strong:a(ye),thematicBreak:a(xe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ae,autolinkProtocol:z,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:re,characterReference:ie,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:te,resourceDestinationString:I,resourceTitleString:L,resource:ee,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};MGe(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];kGe.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||PGe).call(a,void 0,e[0])}for(r.position={start:YF(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:YF(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:YF(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||PGe).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+cF({start:e.start,end:e.end})+`): itâs not open`);n.position.end=YF(e.end)}function u(){return xF(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=TF(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=be(),n.position={start:YF(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=YF(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=YF(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=DGe(t),n.identifier=TF(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ee(){this.data.inReference=void 0}function R(){this.data.referenceType=`collapsed`}function te(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=TF(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ne(e){this.data.characterReferenceType=e.type}function re(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=vUe(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=SF(t);let i=this.stack[this.stack.length-1];i.value+=r}function ie(e){let t=this.stack.pop();t.position.end=YF(e.end)}function z(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ae(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function oe(){return{type:`blockquote`,children:[]}}function se(){return{type:`code`,lang:null,meta:null,value:``}}function ce(){return{type:`inlineCode`,value:``}}function le(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ue(){return{type:`emphasis`,children:[]}}function de(){return{type:`heading`,depth:0,children:[]}}function fe(){return{type:`break`}}function pe(){return{type:`html`,value:``}}function me(){return{type:`image`,title:null,url:``,alt:null}}function he(){return{type:`link`,title:null,url:``,children:[]}}function ge(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function _e(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ve(){return{type:`paragraph`,children:[]}}function ye(){return{type:`strong`,children:[]}}function be(){return{type:`text`,value:``}}function xe(){return{type:`thematicBreak`}}}function YF(e){return{line:e.line,column:e.column,offset:e.offset}}function MGe(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?MGe(e,r):NGe(e,r)}}function NGe(e,t){let n;for(n in t)if(kGe.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function PGe(e,t){throw e?Error("Cannot close `"+e.type+"` ("+cF({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+cF({start:t.start,end:t.end})+`) is open`):Error("Cannot close document, a token (`"+t.type+"`, "+cF({start:t.start,end:t.end})+`) is still open`)}function FGe(e){let t=this;t.parser=n;function n(n){return AGe(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function IGe(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function LGe(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:` 243`}]}function RGe(e,t){let n=t.value?t.value+` 244`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function zGe(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function BGe(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}
vendor: 9,213 bytes, lines 244-246
244function VGe(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=IF(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function HGe(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UGe(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function WGe(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function GGe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return WGe(e,t);let i={src:IF(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function KGe(e,t){let n={src:IF(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function qGe(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function JGe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return WGe(e,t);let i={href:IF(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function YGe(e,t){let n={href:IF(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function XGe(e,t,n){let r=e.all(t),i=n?ZGe(n):QGe(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:` 245`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:` 246`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function ZGe(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=QGe(n[r])}return t}function QGe(e){return e.spread??e.children.length>1}function $Ge(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function eKe(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tKe(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nKe(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rKe(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=oF(t.children[1]),o=aF(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function iKe(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function aKe(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var oKe=9,sKe=32;function cKe(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(lKe(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(lKe(t.slice(i),i>0,!1)),a.join(``)}function lKe(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===oKe||t===sKe;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===oKe||t===sKe;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function uKe(e,t){let n={type:`text`,value:cKe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function dKe(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const fKe={blockquote:IGe,break:LGe,code:RGe,delete:zGe,emphasis:BGe,footnoteReference:VGe,heading:HGe,html:UGe,imageReference:GGe,image:KGe,inlineCode:qGe,linkReference:JGe,link:YGe,listItem:XGe,list:$Ge,paragraph:eKe,root:tKe,strong:nKe,table:rKe,tableCell:aKe,tableRow:iKe,text:uKe,thematicBreak:dKe,toml:XF,yaml:XF,definition:XF,footnoteDefinition:XF};function XF(){}var pKe=typeof self==`object`?self:globalThis,mKe=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new pKe[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new pKe[a](o),i)};return r};const hKe=e=>mKe(new Map,e)(0);var ZF=``,{toString:gKe}={},{keys:_Ke}=Object,QF=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=gKe.call(e).slice(8,-1);switch(n){case`Array`:return[1,ZF];case`Object`:return[2,ZF];case`Date`:return[3,ZF];case`RegExp`:return[4,ZF];case`Map`:return[5,ZF];case`Set`:return[6,ZF];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},$F=([e,t])=>e===0&&(t===`function`||t===`symbol`),vKe=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=QF(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of _Ke(r))(e||!$F(QF(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!($F(QF(n))||$F(QF(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!$F(QF(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a};const yKe=(e,{json:t,lossy:n}={})=>{let r=[];return vKe(!(t||n),!!t,new Map,r)(e),r};var eI=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?hKe(yKe(e,t)):structuredClone(e):(e,t)=>hKe(yKe(e,t));function bKe(e,t){let n=[{type:`text`,value:`â©`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function xKe(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}
vendor: 2,148 bytes, lines 246-248
246function SKe(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||bKe,r=e.options.footnoteBackLabel||xKe,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=IF(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...eI(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:` 247`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:` 248`}]}}const tI=(function(e){if(e==null)return EKe;if(typeof e==`function`)return nI(e);if(typeof e==`object`)return Array.isArray(e)?CKe(e):wKe(e);if(typeof e==`string`)return TKe(e);throw Error(`Expected function, string, or object as test`)});function CKe(e){let t=[],n=-1;for(;++n<e.length;)t[n]=tI(e[n]);return nI(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function wKe(e){let t=e;return nI(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function TKe(e){return nI(t);function t(t){return t&&t.type===e}}function nI(e){return t;
vendor: 9,207 bytes, lines 248-252
248function t(t,n,r){return!!(DKe(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function EKe(){return!0}function DKe(e){return typeof e==`object`&&!!e&&`type`in e}function OKe(e){return e}var kKe=[];function AKe(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=tI(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+OKe(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=kKe,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=jKe(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function jKe(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?kKe:[e]}function rI(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),AKe(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var iI={}.hasOwnProperty,MKe={};function NKe(e,t){let n=t||MKe,r=new Map,i=new Map,a={all:s,applyData:FKe,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...fKe,...n.handlers},one:o,options:n,patch:PKe,wrap:LKe};return rI(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(iI.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=eI(n);return r.children=a.all(e),r}return eI(e)}return(a.options.unknownHandler||IKe)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=RKe(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=RKe(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function PKe(e,t){e.position&&(t.position=BHe(e))}function FKe(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,eI(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function IKe(e,t){let n=t.data||{},r=`value`in t&&!(iI.call(n,`hProperties`)||iI.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function LKe(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:` 249`});++r<e.length;)r&&n.push({type:`text`,value:` 250`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:` 251`}),n}function RKe(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function zKe(e,t){let n=NKe(e,t),r=n.one(e,void 0),i=SKe(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:` 252`},i)),a}function BKe(e,t){return e&&`run`in e?async function(n,r){let i=zKe(n,{file:r,...t});await e.run(i,r)}:function(n,r){return zKe(n,{file:r,...e||t})}}function VKe(e){if(e)throw e}var HKe=s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`)if(n.call(e,t)){if(a)return a(e,t).value}else return;return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function aI(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function UKe(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?WKe(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function WKe(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}const oI={basename:GKe,dirname:KKe,extname:qKe,join:JKe,sep:`/`};function GKe(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);sI(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function KKe(e){if(sI(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function qKe(e){sI(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function JKe(...e){let t=-1,n;for(;++t<e.length;)sI(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:YKe(n)}function YKe(e){sI(e);let t=e.codePointAt(0)===47,n=XKe(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function XKe(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function sI(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}const ZKe={cwd:QKe};function QKe(){return`/`}function cI(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function $Ke(e){if(typeof e==`string`)e=new URL(e);else if(!cI(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return eqe(e)}function eqe(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var lI=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],tqe=class{constructor(e){let t;t=e?cI(e)?{path:e}:typeof e==`string`||rqe(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:ZKe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<lI.length;){let e=lI[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)lI.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?oI.basename(this.path):void 0}
vendor: 5,319 bytes, line 252
252set basename(e){dI(e,`basename`),uI(e,`basename`),this.path=oI.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?oI.dirname(this.path):void 0}set dirname(e){nqe(this.basename,`dirname`),this.path=oI.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?oI.extname(this.path):void 0}set extname(e){if(uI(e,`extname`),nqe(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=oI.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){cI(e)&&(e=$Ke(e)),dI(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?oI.basename(this.path,this.extname):void 0}set stem(e){dI(e,`stem`),uI(e,`stem`),this.path=oI.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new fF(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function uI(e,t){if(e&&e.includes(oI.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+oI.sep+"`")}function dI(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function nqe(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function rqe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const iqe=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var fI=u(HKe(),1),aqe={}.hasOwnProperty;const oqe=new class e extends iqe{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=UKe()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,fI.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(hI(`data`,this.frozen),this.namespace[e]=t,this):aqe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(hI(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=gI(e),n=this.parser||this.Parser;return pI(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),pI(`process`,this.parser||this.Parser),mI(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=gI(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);uqe(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),pI(`processSync`,this.parser||this.Parser),mI(`processSync`,this.compiler||this.Compiler),this.process(e,r),cqe(`processSync`,`process`,t),n;function r(e,r){t=!0,VKe(e),n=r}}run(e,t,n){sqe(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=gI(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),cqe(`runSync`,`run`,n),r;function i(e,t){VKe(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=gI(t),r=this.compiler||this.Compiler;return mI(`stringify`,r),sqe(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(hI(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,fI.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];aI(o)&&aI(r)&&(r=(0,fI.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function pI(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function mI(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function hI(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}
vendor: 9,974 bytes, lines 252-253
252function sqe(e){if(!aI(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function cqe(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function gI(e){return lqe(e)?e:new tqe(e)}function lqe(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function uqe(e){return typeof e==`string`||dqe(e)}function dqe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var fqe=[],pqe={allowDangerousHtml:!0},mqe=/^(https?|ircs?|mailto|xmpp)$/i,hqe=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function _I(e){let t=gqe(e),n=_qe(e);return vqe(t.runSync(t.parse(n),n),e)}function gqe(e){let t=e.rehypePlugins||fqe,n=e.remarkPlugins||fqe,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...pqe}:pqe;return oqe().use(FGe).use(n).use(BKe,r).use(t)}function _qe(e){let t=e.children||``,n=new tqe;return typeof t==`string`?n.value=t:``+t,n}function vqe(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||yqe;for(let e of hqe)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return rI(e,l),KHe(e,{Fragment:K.Fragment,components:i,ignoreInvalidStyle:!0,jsx:K.jsx,jsxs:K.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in bF)if(Object.hasOwn(bF,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=bF[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function yqe(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||mqe.test(e.slice(0,t))?e:``}function bqe(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function xqe(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Sqe(e,t,n){let r=tI((n||{}).ignore||[]),i=Cqe(t),a=-1;for(;++a<i.length;)AKe(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Cqe(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([wqe(e[0]),Tqe(e[1])])}return t}function wqe(e){return typeof e==`string`?new RegExp(xqe(e),`g`):e}function Tqe(e){return typeof e==`function`?e:function(){return e}}var vI=`phrasing`,yI=[`autolink`,`link`,`image`,`label`];function Eqe(){return{transforms:[Nqe],enter:{literalAutolink:Oqe,literalAutolinkEmail:bI,literalAutolinkHttp:bI,literalAutolinkWww:bI},exit:{literalAutolink:Mqe,literalAutolinkEmail:jqe,literalAutolinkHttp:kqe,literalAutolinkWww:Aqe}}}function Dqe(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:vI,notInConstruct:yI},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:vI,notInConstruct:yI},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:vI,notInConstruct:yI}]}}function Oqe(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function bI(e){this.config.enter.autolinkProtocol.call(this,e)}function kqe(e){this.config.exit.autolinkProtocol.call(this,e)}function Aqe(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function jqe(e){this.config.exit.autolinkEmail.call(this,e)}function Mqe(e){this.exit(e)}function Nqe(e){Sqe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Pqe],[RegExp(`(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)`,`gu`),Fqe]],{ignore:[`link`,`linkReference`]})}function Pqe(e,t,n,r,i){let a=``;if(!Rqe(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Iqe(n)))return!1;let o=Lqe(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Fqe(e,t,n,r){return!Rqe(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Iqe(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Lqe(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=bqe(e,`(`),a=bqe(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Rqe(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||PF(n)||NF(n))&&(!t||n!==47)}Jqe.peek=qqe;function zqe(){this.buffer()}function Bqe(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Vqe(){this.buffer()}function Hqe(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Uqe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=TF(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Wqe(e){this.exit(e)}function Gqe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=TF(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Kqe(e){this.exit(e)}function qqe(){return`[`}function Jqe(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Yqe(){return{enter:{gfmFootnoteCallString:zqe,gfmFootnoteCall:Bqe,gfmFootnoteDefinitionLabelString:Vqe,gfmFootnoteDefinition:Hqe},exit:{gfmFootnoteCallString:Uqe,gfmFootnoteCall:Wqe,gfmFootnoteDefinitionLabelString:Gqe,gfmFootnoteDefinition:Kqe}}}function Xqe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Jqe},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?` 253`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Qqe:Zqe))),s(),o}}function Zqe(e,t,n){return t===0?e:Qqe(e,t,n)}function Qqe(e,t,n){return(n?``:` `)+e}var $qe=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];iJe.peek=aJe;function eJe(){return{canContainEols:[`delete`],enter:{strikethrough:nJe},exit:{strikethrough:rJe}}}function tJe(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:$qe}],handlers:{delete:iJe}}}function nJe(e){this.enter({type:`delete`,children:[]},e)}function rJe(e){this.exit(e)}function iJe(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function aJe(){return`~`}function oJe(e){return e.length}function sJe(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||oJe,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=cJe(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=lJe(r[d]);else{let e=lJe(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];
vendor: 7,712 bytes, lines 253-265
253n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(` 254`)}function cJe(e){return e==null?``:String(e)}function lJe(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function uJe(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),dJe);return i(),o}function dJe(e,t,n){return`>`+(n?``:` `)+e}function fJe(e,t){return pJe(e,t.inConstruct,!0)&&!pJe(e,t.notInConstruct,!1)}function pJe(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function mJe(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===` 255`&&fJe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\ 256`}function hJe(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function gJe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function _Je(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function vJe(e,t,n,r){let i=_Je(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(gJe(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,yJe);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(hJe(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:` 257`,encode:["`"],...s.current()})),t()}return u+=s.move(` 258`),a&&(u+=s.move(a+` 259`)),u+=s.move(c),l(),u}function yJe(e,t,n){return(n?``:` `)+e}function xI(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function bJe(e,t,n,r){let i=xI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:` 260`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function xJe(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function SI(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function CI(e,t,n){let r=RF(e),i=RF(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}SJe.peek=CJe;function SJe(e,t,n,r){let i=xJe(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=CI(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=SI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=CI(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+SI(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function CJe(e,t,n){return n.options.emphasis||`*`}function wJe(e,t){let n=!1;return rI(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&xF(e)&&(t.options.setext||n))}function TJe(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(wJe(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:` 261`,after:` 262`});return r(),t(),o+` 263`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(` 264`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:` 265`,...a.current()});return/^[\t ]/.test(l)&&(l=SI(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}EJe.peek=DJe;function EJe(e){return e.value||``}function DJe(){return`<`}OJe.peek=kJe;function OJe(e,t,n,r){let i=xI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function kJe(){return`!`}AJe.peek=jJe;function AJe(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function jJe(){return`!`}MJe.peek=NJe;function MJe(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function NJe(){return"`"}function PJe(e,t){let n=xF(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}FJe.peek=IJe;function FJe(e,t,n,r){let i=xI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(PJe(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}
vendor: 6,689 bytes, lines 265-267
265))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function IJe(e,t,n){return PJe(e,n)?`<`:`[`}LJe.peek=RJe;function LJe(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function RJe(){return`[`}function wI(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function zJe(e){let t=wI(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function BJe(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function VJe(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function HJe(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?BJe(n):wI(n),s=e.ordered?o===`.`?`)`:`.`:zJe(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),VJe(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function UJe(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function WJe(e,t,n,r){let i=UJe(n),a=n.bulletCurrent||wI(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function GJe(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const KJe=tI([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function qJe(e,t,n,r){return(e.children.some(function(e){return KJe(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function JJe(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}YJe.peek=XJe;function YJe(e,t,n,r){let i=JJe(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=CI(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=SI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=CI(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+SI(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function XJe(e,t,n){return n.options.strong||`*`}function ZJe(e,t,n,r){return n.safe(e.value,r)}function QJe(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function $Je(e,t,n){let r=(VJe(n)+(n.options.ruleSpaces?` `:``)).repeat(QJe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const eYe={blockquote:uJe,break:mJe,code:vJe,definition:bJe,emphasis:SJe,hardBreak:mJe,heading:TJe,html:EJe,image:OJe,imageReference:AJe,inlineCode:MJe,link:FJe,linkReference:LJe,list:HJe,listItem:WJe,paragraph:GJe,root:qJe,strong:YJe,text:ZJe,thematicBreak:$Je};function tYe(){return{enter:{table:nYe,tableData:aYe,tableHeader:aYe,tableRow:iYe},exit:{codeText:oYe,table:rYe,tableData:TI,tableHeader:TI,tableRow:TI}}}function nYe(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function rYe(e){this.exit(e),this.data.inTable=void 0}function iYe(e){this.enter({type:`tableRow`,children:[]},e)}function TI(e){this.exit(e)}function aYe(e){this.enter({type:`tableCell`,children:[]},e)}function oYe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,sYe));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function sYe(e,t){return t===`|`?t:e}function cYe(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:` 266`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(` 267`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return sJe(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=eYe.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}
vendor: 6,066 bytes, line 267
267function lYe(){return{exit:{taskListCheckValueChecked:dYe,taskListCheckValueUnchecked:dYe,paragraph:fYe}}}function uYe(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:pYe}}}function dYe(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function fYe(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function pYe(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=eYe.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function mYe(){return[Eqe(),Yqe(),eJe(),tYe(),lYe()]}function hYe(e){return{extensions:[Dqe(),Xqe(e),tJe(),cYe(e),uYe()]}}var gYe={tokenize:DYe,partial:!0},_Ye={tokenize:OYe,partial:!0},vYe={tokenize:kYe,partial:!0},yYe={tokenize:AYe,partial:!0},bYe={tokenize:jYe,partial:!0},xYe={name:`wwwAutolink`,tokenize:TYe,previous:MYe},SYe={name:`protocolAutolink`,tokenize:EYe,previous:NYe},EI={name:`emailAutolink`,tokenize:wYe,previous:PYe},DI={};function CYe(){return{text:DI}}for(var OI=48;OI<123;)DI[OI]=EI,OI++,OI===58?OI=65:OI===91&&(OI=97);DI[43]=EI,DI[45]=EI,DI[46]=EI,DI[95]=EI,DI[72]=[EI,SYe],DI[104]=[EI,SYe],DI[87]=[EI,xYe],DI[119]=[EI,xYe];function wYe(e,t,n){let r=this,i,a;return o;function o(t){return!kI(t)||!PYe.call(r,r.previous)||AI(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return kI(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(bYe,u,l)(t):t===45||t===95||DF(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&EF(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function TYe(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!MYe.call(r,r.previous)||AI(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(gYe,e.attempt(_Ye,e.attempt(vYe,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function EYe(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&NYe.call(r,r.previous)&&!AI(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(EF(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||OF(t)||jF(t)||PF(t)||NF(t)?n(t):e.attempt(_Ye,e.attempt(vYe,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function DYe(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function OYe(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(yYe,c,s)(t):t===null||jF(t)||PF(t)||t!==45&&NF(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function kYe(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(yYe,t,a)(o):o===null||jF(o)||PF(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function AYe(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||jF(o)||PF(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||jF(e)||PF(e)?t(e):r(e)}function a(e){return EF(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):EF(t)?(e.consume(t),o):n(t)}}function jYe(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return DF(e)?n(e):t(e)}}function MYe(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jF(e)}function NYe(e){return!EF(e)}function PYe(e){return!(e===47||kI(e))}function kI(e){return e===43||e===45||e===46||e===95||DF(e)}function AI(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var FYe={tokenize:UYe,partial:!0};function IYe(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:BYe,continuation:{tokenize:VYe},exit:HYe}},text:{91:{name:`gfmFootnoteCall`,tokenize:zYe},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:LYe,resolveTo:RYe}}}}function LYe(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=TF(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function RYe(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;
vendor: 7,445 bytes, line 267
267let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function zYe(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||jF(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(TF(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return jF(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function BYe(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||jF(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=TF(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return jF(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),LF(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function VYe(e,t,n){return e.check(VF,t,e.attempt(FYe,t,n))}function HYe(e){e.exit(`gfmFootnoteDefinition`)}function UYe(e,t,n){let r=this;return LF(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function WYe(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&CF(o,o.length,0,zF(s,e.slice(r+1,n),t)),CF(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),CF(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=RF(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=RF(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var GYe=class{constructor(){this.map=[]}add(e,t,n){KYe(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function KYe(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function qYe(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function JYe(){return{flow:{null:{name:`table`,tokenize:YYe,resolveAll:XYe}}}}function YYe(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):AF(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):MF(t)?LF(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||jF(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,MF(t)?LF(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return MF(t)?LF(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||AF(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return MF(t)?LF(e,b,`whitespace`)(t):b(t)}
vendor: 4,198 bytes, line 267
267function b(n){return n===124?m(n):n===null||AF(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||AF(n)?(e.exit(`tableRow`),t(n)):MF(n)?LF(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||jF(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function XYe(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new GYe;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(ZYe(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=jI(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=jI(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=jI(f,t,o,i,n,d)):(o[0]=o[1],d=jI(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&ZYe(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=qYe(t.events,n))}return e}function jI(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},MI(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=MI(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=MI(t.events,n[2]),a=MI(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},MI(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function ZYe(e,t,n,r,i){let a=[],o=MI(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function MI(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var QYe={name:`tasklistCheck`,tokenize:eXe};function $Ye(){return{text:{91:QYe}}}function eXe(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return jF(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return AF(r)?t(r):MF(r)?e.check({tokenize:tXe},t,n)(r):n(r)}}function tXe(e,t,n){return LF(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function nXe(e){return hUe([CYe(),IYe(),WYe(e),JYe(),$Ye()])}var rXe={};function NI(e){let t=this,n=e||rXe,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(nXe(n)),a.push(mYe()),o.push(hYe(n))}function PI({...e}){return(0,K.jsx)(CTe,{"data-slot":`collapsible`,...e})}function FI({...e}){return(0,K.jsx)(bTe,{"data-slot":`collapsible-trigger`,...e})}function II({...e}){return(0,K.jsx)(xTe,{"data-slot":`collapsible-content`,...e})}function iXe(e){return e>=40?`text-green-700 dark:text-green-500`:e>
267=25?`text-amber-600 dark:text-amber-500`:`text-red-700 dark:text-red-500`}function aXe({score:e}){if(e==null)return(0,K.jsx)(`span`,{className:`ml-auto text-[10px] text-muted-foreground`,children:`â`});let t=Math.round(e*100);return(0,K.jsxs)(`span`,{className:`ml-auto text-[10px] ${iXe(t)}`,children:[t,`% match`]})}function oXe({citations:e}){let{t}=V(),[n,r]=(0,B.useState)(!1);return e.length===0?null:(0,K.jsxs)(PI,{open:n,onOpenChange:r,className:``,children:[(0,K.jsxs)(FI,{className:`w-full flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground mt-2`,children:[n?(0,K.jsx)(Rg,{size:14}):(0,K.jsx)(Bg,{size:14}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsxs)(`span`,{children:[e.length,` source`,e.length>1?`s`:``]}),(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsx)(`span`,{className:`inline-flex`,onClick:e=>e.stopPropagation(),children:(0,K.jsx)(u_,{size:12,className:`text-muted-foreground`})})}),(0,K.jsx)(GT,{className:`max-w-xs`,children:`Percentages show each source's semantic similarity to your question; â means it matched by keywords.`})]})]})]}),(0,K.jsx)(II,{children:(0,K.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.map((e,n)=>(0,K.jsxs)(`div`,{className:`rounded border border-border bg-muted/50 p-2 text-xs`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground mb-1`,children:[(0,K.jsx)(i_,{size:12}),e.document_id?(0,K.jsx)(`button`,{type:`button`,className:`font-medium truncate hover:text-foreground hover:underline`,title:t(`chat.open_document`),onClick:()=>Q.getState().viewDocumentInKB(e.document_id,e.document_name),children:e.document_name}):(0,K.jsx)(`span`,{className:`font-medium truncate`,children:e.document_name}),e.page_number&&(0,K.jsxs)(`span`,{className:`text-[10px]`,children:[`p. `,e.page_number]}),(0,K.jsx)(aXe,{score:e.score})]}),(0,K.jsx)(`p`,{className:`text-muted-foreground line-clamp-3`,children:e.text_snippet})]},e.chunk_id||n))})})]})}async function sXe(e,t){try{await navigator.clipboard.writeText(e),G.success(t)}catch{G.error(H.t(`toasts.common.copy_failed`))}}function cXe({message:e,conversationId:t,visible:n=!0}){let{t:r}=V(),i=LS(e=>e.setMessageFlagRating),a=LS(e=>e.sendMessageStreamAction),o=LS(e=>e.messages),s=LS(e=>e.current_conversation?.id===t?e.current_conversation.title:null),c=e.flag_rating??null,l=c===5,u=c===1,[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(``),[h,g]=(0,B.useState)(!1);async function _(){if(h)return;let t=c;if(g(!0),l){i(e.id,null);try{await rge(`message`,e.id)}catch(n){i(e.id,t),Y(n,H.t(`toasts.feedback.send_failed`),{operation:`chat.message.flagToggle`})}}else{i(e.id,5);try{await nge(`message`,e.id,{flag_rating:5})}catch(n){i(e.id,t),Y(n,H.t(`toasts.feedback.send_failed`),{operation:`chat.message.flagToggle`})}}g(!1)}async function v(){if(!h){if(u){let t=c;g(!0),i(e.id,null);try{await rge(`message`,e.id)}catch(n){i(e.id,t),Y(n,H.t(`toasts.feedback.send_failed`),{operation:`chat.message.flagToggle`})}g(!1);return}f(!0)}}async function y(){let t=c;g(!0),i(e.id,1);try{await nge(`message`,e.id,{flag_rating:1,...p?{flag_comment:p}:{}}),f(!1),m(``)}catch(n){i(e.id,t),Y(n,H.t(`toasts.feedback.send_failed`),{operation:`chat.message.thumbsDown`})}g(!1)}async function b(){let t=o.findIndex(t=>t.id===e.id);if(!(t<=0)){for(let e=t-1;e>=0;e--)if(o[e].role===`user`){await a(o[e].content);return}}}function x(){sXe(`${window.location.origin}/chat/${t}`,r(`toasts.common.copied`))}function S(){sXe(e.content,r(`toasts.chat.message_copied`))}let C=e.role===`assistant`&&!e.id.startsWith(`temp-`),w=s?r(`report_issue.chat_reply_in`,{title:Ab(s)}):r(`report_issue.chat_reply`),T=`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors`;return(0,K.jsxs)(`div`,{className:q(`flex items-center gap-1.5 mt-1.5`,n?`opacity-100`:`opacity-0 group-hover:opacity-100`,`transition-opacity`),children:[(0,K.jsx)(`button`,{type:`button`,onClick:S,className:T,title:r(`common.copy`),children:(0,K.jsx)(Yg,{className:`size-3.5`})}),(0,K.jsx)(`button`,{type:`button`,onClick:_,disabled:h,className:q(T,l&&`text-green-600 bg-green-50 hover:bg-green-100`),title:r(`chat.feedback_thumbs_up`),children:(0,K.jsx)(Ese,{className:q(`size-3.5`,l&&`fill-current`)})}),(0,K.jsxs)(aP,{open:d,onOpenChange:f,children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,onClick:v,disabled:h,className:q(T,u&&`text-red-600 bg-red-50 hover:bg-red-100`),title:r(`chat.feedback_thumbs_down`),children:(0,K.jsx)(Tse,{className:q(`size-3.5`,u&&`fill-current`)})})}),(0,K.jsx)(sP,{className:`w-64 p-3`,align:`start`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:r(`flag_popover.title`)}),(0,K.jsx)(`textarea`,{className:`w-full rounded-md border border-input bg-background px-3 py-2 text-sm resize-none`,rows:3,placeholder:r(`flag_popover.reason_placeholder`),value:p,onChange:e=>m(e.target.value)}),(0,K.jsx)(J,{type:`button`,size:`xs`,className:`w-full`,disabled:h,onClick:y,children:r(`flag_popover.submit`)})]})})]}),C&&(0,K.jsx)(mO,{subject:{type:`chat_message`,id:e.id,label:w},className:T}),(0,K.jsx)(`button`,{type:`button`,onClick:b,className:T,title:r(`common.retry`),children:(0,K.jsx)(E_,{className:`size-3.5`})}),(0,K.jsx)(`button`,{type:`button`,onClick:x,className:T,title:r(`common.copy`),children:(0,K.jsx)(P_,{className:`size-3.5`})})]})}function LI({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`skeleton`,className:q(`animate-shimmer rounded-md`,e),...t})}var lXe={sm:{text:`text-xs`,icon:`size-3`,gap:`gap-1.5`},md:{text:`text-sm`,icon:`size-4`,gap:`gap-2`},lg:{text:`text-base`,icon:`size-5`,gap:`gap-2.5`}};function RI({label:e,size:t=`md`,icon:n=L_,className:r}){let i=lXe[t],a=/[.â¦]$/.test(e)?e:`${e}â¦`;return(0,K.jsxs)(`span`,{role:`status`,"aria-label":e,className:q(`inline-flex items-center`,i.gap,r),children:[(0,K.jsx)(n,{className:q(i.icon,`shrink-0 animate-pulse text-muted-foreground motion-reduce:animate-none`)}),(0,K.jsx)(`span`,{className:q(`animate-text-shimmer font-medium`,i.text),children:a})]})}function zI({label:e=`Thinking`,className:t}){return(0,K.jsxs)(`div`,{className:q(`space-y-2`,t),children:[(0,K.jsx)(RI,{size:`sm`,label:e}),(0,K.jsx)(LI,{className:`h-3.5 w-[70%]`}),(0,K.jsx)(LI,{className:`h-3.5 w-[45%]`})]})}const uXe={documents:`documents`,conversations:`conversations`,email_tasks:`email_tasks`,prompts:`prompts`,knowledge_bases:`knowledge_bases`,org_profiles:`org_profiles`,playbooks:`playbooks`,evaluations:`evaluations`,calendar_events:`calendar_events`,tasks:`tasks`,matters:`matters`,redline_suggestions:`redline_suggestions`,finance_documents:`finance_documents`};function BI(e){return typeof e==`string`&&e.length>0?e:void 0}function VI(e){let t=e.metadata??{},n=BI(t.provider),r=typeof e.preview==`string`?e.preview:void 0;if(e.type===`calendar_events`)return{kind:`calendar_event`,title:e.title,provider:n,status:BI(t.status),description:r,externalLink:BI(t.html_link),start:BI(t.start),isAllDay:t.is_all_day===!0,location:BI(t.location),fromSearch:!0};if(e.type===`tasks`){let i=BI(t.status);return{kind:`task`,title:e.title,provider:n,status:i,description:r,externalLink:BI(t.html_link)??BI(t.web_link),dueDate:BI(t.due_date),completed:i===`completed`,taskId:e.id,fromSearch:!0}}return{kind:`message`,title:e.title,provider:n,description:r,from:BI(t.from_name)??BI(t.from_email),receivedAt:BI(t.received_at),channelName:BI(t.slack_channel_name),fromSearch:!0}}function dXe(e){return{kind:`calendar_event`,title:e.title??``,provider:e.provider??void 0,status:e.status??void 0,description:e.description??void 0,externalLink:e.html_link??void 0,start:e.start_time??e.start_date??void 0,end:e.end_time??e.end_date??void 0,isAllDay:e.is_all_day,location:e.location??void 0,fromSearch:!1}}function fXe(e){let t,n,r;return e.provider===`google`?(t=e.notes,n=e.html_link,r=e.google_task_id):e.provider===`outlook`?(t=e.body_content,n=e.web_link,r=e.outlook_task_id):(t=e.notes,n=null,r=e.id),{kind:`task`,title:e.title??``,provider:e.provider,status:e.status,description:t??void 0,externalLink:n??void 0,dueDate:e.due_date??void 0,completed:e.status===`completed`,taskId:r,fromSearch:!1}}function HI(e){let t=e.trimStart();return t.startsWith(`<!DOCTYPE`)||t.startsWith(`<html`)||t.startsWith(`<HTML`)||/<\/(div|p|table|body|html|span|td|tr|a|br|img)\b/i.test(t)}function pXe(e){return new DOMParser().parseFromString(e,`text/html`).body.textContent?.trim()??``}const UI={gmail:`#EA4335`,outlook:`#0078D4`,imap:`#64748B`,slack:`#4A154B`};function WI(e){try{return pb(new Date(e),{addSuffix:!0})}catch{return``}}function GI(e,t){return e?e.split(` `).slice(0,2).map(e=>e[0]).join(``).toUpperCase():t[0].toUpperCase()}function mXe(e,t,n){let r=e||`T0`;return n?`https://app.slack.com/client/${r}/${t}/thread/${t}-${n}`:`https://app.slack.com/client/${r}/${t}`}function KI(e,t){tS(t.provider)&&(DS.getState().setProvider(t.provider),e(`/inbox/inbox/${encodeURIComponent(t.id)}`))}const hXe=()=>`/api/v1/evaluations`,gXe=async(e,t)=>Z(hXe(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),_Xe=e=>{let t=new URLSearchParams;Object.entries(e||{}
267).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/evaluations?${n}`:`/api/v1/evaluations`},vXe=async(e,t)=>Z(_Xe(e),{...t,method:`GET`}),yXe=e=>`/api/v1/evaluations/${e}`,bXe=async(e,t)=>Z(yXe(e),{...t,method:`GET`}),xXe=e=>`/api/v1/evaluations/${e}`,SXe=async(e,t)=>Z(xXe(e),{...t,method:`DELETE`});function CXe(e,t){let n=new Map;for(let t of e??[])n.set(t.id,t);for(let e of t??[])n.set(e.id,e);return Array.from(n.values()).sort((e,t)=>{let n=e.created_at??``,r=t.created_at??``;return n.localeCompare(r)})}const qI=Pb((e,t)=>({evaluations:[],isLoading:!1,selectedEvaluation:null,isLoadingDetail:!1,isCreating:!1,pollingId:null,error:null,fetchEvaluations:async()=>{e({isLoading:!0,error:null});try{e({evaluations:(await vXe()).data,isLoading:!1})}catch(t){X(t,{operation:`fetch_evaluations`}),e({error:Kb(t,H.t(`errors.fetch_failed`)),isLoading:!1})}},createEvaluation:async n=>{e({isCreating:!0,error:null});try{let r=(await gXe(n)).data;return e(e=>({evaluations:[r,...e.evaluations],isCreating:!1})),await t().selectEvaluation(r.id),r}catch(t){return Y(t,H.t(`toasts.evaluation.start_failed`),{operation:`create_evaluation`}),e({isCreating:!1}),null}},selectEvaluation:async n=>{e({isLoadingDetail:!0,error:null});try{let r=(await bXe(n)).data;e({selectedEvaluation:r,isLoadingDetail:!1}),(r.status===`pending`||r.status===`running`)&&t().pollEvaluation(n)}catch(t){X(t,{operation:`select_evaluation`,metadata:{id:n},expectedNotFound:!0}),e({error:Kb(t,H.t(`errors.fetch_failed`)),isLoadingDetail:!1})}},pollEvaluation:n=>{e({pollingId:n});let r=async()=>{if(t().pollingId===n)try{let i=(await bXe(n)).data;e(e=>{let t=e.selectedEvaluation?.id===n?e.selectedEvaluation:null;return{selectedEvaluation:{...i,answers:CXe(t?.answers,i.answers)}}}),e(e=>({evaluations:e.evaluations.map(e=>e.id===n?{...e,status:i.status,overall_score:i.overall_score,document_name:i.document_name,playbook_name:i.playbook_name}:e)})),(i.status===`pending`||i.status===`running`)&&t().pollingId===n?setTimeout(()=>{t().pollingId===n&&r()},3e3):t().pollingId===n&&e({pollingId:null})}catch{t().pollingId===n&&e({pollingId:null})}};setTimeout(r,1500)},stopPolling:()=>e({pollingId:null}),deleteEvaluation:async t=>{try{await SXe(t),e(e=>({evaluations:e.evaluations.filter(e=>e.id!==t),selectedEvaluation:e.selectedEvaluation?.id===t?null:e.selectedEvaluation,pollingId:e.pollingId===t?null:e.pollingId}))}catch(e){Y(e,H.t(`toasts.evaluation.delete_failed`),{operation:`delete_evaluation`,metadata:{id:t}})}},clearError:()=>e({error:null}),applyAnswerEvent:n=>{let r=t().selectedEvaluation;if(!r||n.reference_id!==r.id)return;let i=n.metadata?.answer;!i||!i.id||e({selectedEvaluation:{...r,answers:CXe(r.answers,[i])}})},applyEvaluationStatusEvent:n=>{let r=t(),i=n.reference_id;if(!i)return;let a=n.type===`evaluation_failed`?`failed`:`completed`,o=n.metadata?.overall_score;e(e=>({evaluations:e.evaluations.map(e=>e.id===i?{...e,status:a,overall_score:n.type===`evaluation_completed`?o??null:e.overall_score}:e)})),r.selectedEvaluation?.id===i&&t().selectEvaluation(i),r.pollingId===i&&e({pollingId:null})}})),wXe=()=>`/api/v1/playbooks`,TXe=async(e,t)=>Z(wXe(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),EXe=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/playbooks?${n}`:`/api/v1/playbooks`},DXe=async(e,t)=>Z(EXe(e),{...t,method:`GET`}),OXe=e=>`/api/v1/playbooks/${e}`,kXe=async(e,t)=>Z(OXe(e),{...t,method:`GET`}),AXe=e=>`/api/v1/playbooks/${e}`,jXe=async(e,t)=>Z(AXe(e),{...t,method:`DELETE`}),MXe=e=>`/api/v1/playbooks/${e}`,NXe=async(e,t,n)=>Z(MXe(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),PXe=e=>`/api/v1/playbooks/${e}/versions`,FXe=async(e,t,n)=>Z(PXe(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),IXe=e=>`/api/v1/playbooks/${e}/versions`,LXe=async(e,t)=>Z(IXe(e),{...t,method:`GET`});function RXe(e){let t=e.data,n=e.type??`rubric`;return{id:e.id,group_id:e.group_id,version:e.version,name:e.name,contract_type:e.contract_type,type:n,scope:e.scope??`kb`,category_key:e.category_key??null,is_current:e.is_current,created_at:e.created_at,categories:n===`rubric`?t?.categories??[]:[],content:n===`guidance`?t?.content??``:void 0}}const JI=Pb((e,t)=>
267({playbooks:[],isLoading:!1,selectedPlaybookId:null,selectedPlaybook:null,isLoadingDetail:!1,uploadError:null,error:null,fetchPlaybooks:async()=>{e({isLoading:!0,error:null});try{let t=(await DXe()).data,n=new Set(t.map(e=>e.group_id)),r=[];for(let e of n)try{let t=(await LXe(e)).data;r.push(...t)}catch{r.push(...t.filter(t=>t.group_id===e))}e({playbooks:r,isLoading:!1})}catch(t){X(t,{operation:`fetch_playbooks`}),e({error:Kb(t,H.t(`errors.fetch_failed`)),isLoading:!1})}},selectPlaybook:async t=>{e({selectedPlaybookId:t,isLoadingDetail:!0,error:null});try{e({selectedPlaybook:RXe((await kXe(t)).data),isLoadingDetail:!1})}catch(n){X(n,{operation:`select_playbook`,metadata:{id:t},expectedNotFound:!0}),e({error:Kb(n,H.t(`errors.fetch_failed`)),isLoadingDetail:!1})}},uploadPlaybook:async(n,r,i)=>{if(e({uploadError:null}),!n.name.endsWith(`.xlsx`)){e({uploadError:{message:`Only .xlsx files are supported.`,issues:[]}});return}try{let e=await Qhe(n,r,i);await t().fetchPlaybooks(),await t().selectPlaybook(e.id)}catch(t){t instanceof Vhe?e({uploadError:t.uploadError}):(X(t,{operation:`upload_playbook`,metadata:{name:r}}),e({uploadError:{message:Kb(t,H.t(`toasts.playbook.upload_failed`)),issues:[]}}))}},uploadGuidanceDocument:async(e,t)=>{if(!ak(e)){G.error(H.t(`toasts.playbook.unsupported_file`,{types:ok}));return}try{await $he(e,t),G.success(H.t(`toasts.playbook.processing`))}catch(e){Y(e,H.t(`toasts.playbook.upload_failed`),{operation:`upload_guidance_document`,metadata:{name:t}})}},deletePlaybook:async n=>{let r=t().playbooks,i=t().selectedPlaybookId===n;e(e=>({playbooks:e.playbooks.filter(e=>e.id!==n),selectedPlaybookId:i?null:e.selectedPlaybookId,selectedPlaybook:i?
267null:e.selectedPlaybook}));try{await jXe(n),await t().fetchPlaybooks()}catch(t){X(t,{operation:`delete_playbook`,metadata:{id:n}}),e({playbooks:r,error:Kb(t,H.t(`toasts.playbook.delete_failed`))})}},renamePlaybook:async(n,r)=>{let i=t().playbooks.find(e=>e.id===n)?.group_id,a=t().playbooks;e({playbooks:t().playbooks.map(e=>e.group_id===i?{...e,name:r}:e),selectedPlaybook:t().selectedPlaybook?.group_id===i&&t().selectedPlaybook?{...t().selectedPlaybook,name:r}:t().selectedPlaybook});try{await NXe(n,{name:r})}catch(t){X(t,{operation:`rename_playbook`,metadata:{id:n}}),e({playbooks:a,error:Kb(t,H.t(`errors.save_failed`))})}},clearUploadError:()=>e({uploadError:null}),clearError:()=>e({error:null}),createPlaybook:async n=>{try{let r=n.type??`rubric`,i=r===`guidance`?{content:n.content??``}:{categories:[]},a=(await TXe({name:n.name,contract_type:n.contract_type,type:r,scope:n.scope??`kb`,category_key:n.category_key??null,data:i})).data;e(e=>({playbooks:[...e.playbooks,a],selectedPlaybookId:a.id})),await t().selectPlaybook(a.id)}catch(t){X(t,{operation:`create_playbook`}),e({error:Kb(t,H.t(`toasts.playbook.create_failed`))})}},saveAsNewVersion:async n=>{try{let e=n.type===`guidance`?{content:n.content??``}:{categories:n.categories},r=(await FXe(n.group_id,{data:e,name:n.name,contract_type:n.contract_type,type:n.type})).data;await t().fetchPlaybooks(),await t().selectPlaybook(r.id),Q.getState().refreshPlaybookInKBs(n.id,r.id)}catch(t){X(t,{operation:`save_playbook_version`,metadata:{groupId:n.group_id}}),e({error:Kb(t,H.t(`errors.save_failed`))})}},updatePlaybookScope:async(n,r,i)=>{let a=t().selectedPlaybook,o=r===`category`?i:null;e(e=>({selectedPlaybook:e.selectedPlaybook&&e.selectedPlaybook.id===n?{...e.selectedPlaybook,scope:r,category_key:o}:e.selectedPlaybook}));try{await NXe(n,{scope:r,category_key:o})}catch(t){throw e({selectedPlaybook:a}),X(t,{operation:`update_playbook_scope`,metadata:{id:n}}),t}}}));var zXe=new Set(Object.values(uXe).filter(e=>e!==`redline_suggestions`&&e!==`finance_documents`)),BXe=/^\/r\/([a-z_]+)\/(.+)$/;function VXe(e){if(!e||!e.startsWith(`/r/`))return null;let t;try{t=new URL(e,window.location.origin)}catch{return null}let n=t.pathname.match(BXe);if(!n)return null;let[,r,i]=n;if(!zXe.has(r))return null;let a;try{a=decodeURIComponent(i)}catch{return null}return a?{type:r,id:a,provider:t.searchParams.get(`provider`)??void 0}:null}function HXe(e,t){return{...VI({id:e.id,type:e.type,title:e.label??``,metadata:e.provider?{provider:e.provider}:{}}),fromSearch:t}}async function UXe(e,t){let n=Q.getState(),r=n.everythingSearchOpen;try{switch(e.type){case`documents`:r&&n.setDocViewerFromSearch(!0),n.viewDocumentInKB(e.id);break;case`conversations`:await LS.getState().loadConversation(e.id),t(`/chat/${e.id}`);break;case`email_tasks`:if(tS(e.provider)){KI(t,{id:e.id,provider:e.provider});break}n.openItemDetail(HXe(e,r));break;case`calendar_events`:case`tasks`:n.openItemDetail(HXe(e,r));break;case`evaluations`:await qI.getState().selectEvaluation(e.id),t(`/vault/evaluations`);break;case`matters`:t(`/matters/${e.id}`);break;case`playbooks`:await JI.getState().selectPlaybook(e.id),t(`/vault/playbooks`);break;case`knowledge_bases`:n.expandedKBs.has(e.id)||n.toggleExpandKB(e.id),t(`/vault/library`);break;case`prompts`:t(`/vault/prompts?id=${encodeURIComponent(e.id)}`);break;case`org_profiles`:t(`/vault/personas?id=${encodeURIComponent(e.id)}`);break;default:{let t=e.type;throw Error(`Unhandled resource type: ${String(t)}`)}}}catch(t){Y(t,H.t(`everything_search.chat.link_open_failed`),{operation:`resource_link_open`,metadata:{type:e.type,id:e.id}})}finally{r&&n.setEverythingSearchOpen(!1)}}function WXe(e){if(typeof e==`string`)return e;if(Array.isArray(e)&&e.every(e=>typeof e==`string`))return e.join(``)}function GXe({href:e,children:t}){let n=Sv(),r=VXe(e);return r?(0,K.jsx)(`a`,{href:e,className:`underline`,onClick:e=>{e.preventDefault(),UXe({...r,label:WXe(t)},n)},onKeyDown:e=>{e.key===`Enter`&&e.stopPropagation()},children:t}):e?.startsWith(`/r/`)?(0,K.jsx)(`span`,{children:t}):(0,K.jsx)(`a`,{href:e,className:`underline`,target:`_blank`,rel:`noopener noreferrer`,children:t})}const YI={p:({children:e})=>(0,K.jsx)(`p`,{className:`mb-2 last:mb-0`,children:e}),ul:({children:e})=>(0,K.jsx)(`ul`,{className:`mb-2 ml-4 list-disc`,children:e}),ol:({children:e})=>(0,K.jsx)(`ol`,{className:`mb-2 ml-4 list-decimal`,children:e}),li:({children:e})=>(0,K.jsx)(`li`,{className:`mb-0.5`,children:e}),code:({children:e,className:t})=>t?.includes(`language-`)?(0,K.jsx)(`pre`,{className:`my-2 overflow-x-auto rounded bg-black/10 p-2 text-xs dar
267k:bg-white/10`,children:(0,K.jsx)(`code`,{children:e})}):(0,K.jsx)(`code`,{className:`rounded bg-black/10 px-1 py-0.5 text-xs dark:bg-white/10`,children:e}),pre:({children:e})=>(0,K.jsx)(K.Fragment,{children:e}),a:GXe};function XI(e){return e.replace(`http://minio:9000`,`/minio-proxy`).replace(`http://localhost:9000`,`/minio-proxy`)}var KXe={search_emails:(0,K.jsx)(A_,{className:`size-3`}),read_email:(0,K.jsx)(__,{className:`size-3`}),list_email_tasks:(0,K.jsx)(Xoe,{className:`size-3`}),get_email_task_detail:(0,K.jsx)(i_,{className:`size-3`}),draft_reply:(0,K.jsx)(__,{className:`size-3`}),send_email:(0,K.jsx)(__,{className:`size-3`}),search_calendar_events:(0,K.jsx)(Fg,{className:`size-3`}),search_my_resources:(0,K.jsx)(A_,{className:`size-3`})};function qXe(e){let t=e.input;switch(e.name){case`search_emails`:return`Searching emails: "${String(t.query??``)}"`;case`read_email`:return`Reading email ${String(t.message_id??``).slice(0,8)}...`;case`list_email_tasks`:return t.status?`Listing ${String(t.status)} email tasks`:`Listing email tasks`;case`get_email_task_detail`:return`Getting task details`;case`draft_reply`:return`Drafting reply to ${String(t.to??``)}`;case`send_email`:return`Sending email to ${String(t.to??``)}`;case`search_calendar_events`:{let e=String(t.query??``).trim();return e?`Checking calendar: "${e}"`:`Checking calendar`}case`search_my_resources`:{let e=String(t.query??``).trim();return e?`Searching your workspace: "${e}"`:`Searching your workspace`}default:return e.name}}function JXe(e){if(!e.result)return``;if(e.result.is_error)return`Error occurred`;let t=e.result.content.split(` 268`).find(e=>e.trim().length>0)??``;return t.length>80?t.slice(0,77)+`...`:t}function YXe({activity:e}){let[t,n]=(0,B.useState)(!1),r=e.status===`pending`;return(0,K.jsxs)(`div`,{className:`flex items-start gap-1.5 text-xs`,children:[(0,K.jsx)(`span`,{className:`mt-0.5 text-muted-foreground shrink-0`,children:KXe[e.name]??(0,K.jsx)(__,{className:`size-3`})}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[r?(0,K.jsx)(W,{className:`size-3 animate-spin text-muted-foreground shrink-0`}):e.result?.is_error?(0,K.jsx)(Gg,{className:`size-3 text-destructive shrink-0`}):(0,K.jsx)(ooe,{className:`size-3 text-green-500 shrink-0`}),(0,K.jsx)(`span`,{className:`text-muted-foreground font-medium truncate`,children:qXe(e)}),!r&&(0,K.jsx)(`button`,{onClick:()=>n(e=>!e),className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:t?(0,K.jsx)(Rg,{className:`size-3`}):(0,K.jsx)(Bg,{className:`size-3`})})]}),!r&&!t&&e.result&&(0,K.jsx)(`p`,{className:`text-muted-foreground truncate mt-0.5`,children:JXe(e)}),t&&e.result&&(0,K.jsx)(`pre`,{className:`mt-1 max-h-40 overflow-auto rounded bg-black/10 dark:bg-white/10 p-2 text-xs whitespace-pre-wrap break-all`,children:e.result.content})]})]})}function XXe({message:e,isStreaming:t=!1,streamingToolActivities:n,isLast:r=!1}){let{t:i}=V(),a=e.role===`user`,o=t?n??[]:e.toolActivities??[],s=!a&&!t&&e.conversation_id&&!e.id.startsWith(`temp-`);return(0,K.jsx)(`div`,{className:q(`group flex w-full`,a?`justify-end`:`justify-start`),children:(0,K.jsxs)(`div`,{className:q(`max-w-[80%] rounded-lg px-4 py-2`,a?`bg-primary text-primary-foreground`:`bg-muted text-foreground`),children:[a?(0,K.jsxs)(`div`,{className:`space-y-2`,children:[e.attachments&&e.attachments.length>0&&(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.attachments.map((e,t)=>(0,K.jsx)(`img`,{src:XI(e.url),alt:``,className:`max-h-48 max-w-full rounded-md object-contain`},t))}),e.content&&(0,K.jsx)(`p`,{className:`whitespace-pre-wrap text-sm`,children:e.content})]}):t&&!e.content?(0,K.jsx)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none text-foreground`,children:(0,K.jsx)(zI,{label:i(`ai.activity.thinking`)})}):(0,K.jsxs)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none text-foreground`,children:[(0,K.jsx)(_I,{remarkPlugins:[NI],components:YI,children:e.content}),t&&(0,K.jsx)(`span`,{className:`inline-block w-2 h-4 ml-0.5 bg-current animate-pulse`})]}),!a&&e.interrupted&&!t&&(0,K.jsx)(`div`,{className:`mt-1 text-xs italic text-muted-foreground`,children:i(`chat.response_interrupted`)}),!a&&o.length>0&&(0,K.jsx)(`div`,{className:`mt-2 space-y-1.5 border-t border-border/50 pt-2`,children:o.map(e=>(0,K.jsx)(YXe,{activity:e},e.id))}),!a&&e.citations&&e.citations.length>0&&(0,K.jsx)(oXe,{citations:e.citations}),s&&(0,K.jsx)(cXe,{message:e,conversationId:e.conversation_id,visible:r})]})})}const ZXe=(0,B.memo)(XXe);function QXe({activity:e}){let t=e.status===`done`,n=e.result?.is_error;return(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground`,children:[t?n?(0,K.jsx)(H_,{className:`size-3 text-amber-500`}):(0,K.jsx)(Lg,{className:`size-3 text-emerald-500`}):(0,K.jsx)(W,{className:`size-3 animate-spin`}),(0,K.jsx)(`span`,{className:`truncate`,children:e.name})]})}function $Xe({side:e,view:t}){let{t:n}=V(),r=TO(e=>e.prefer),i=TO(e=>e.continueWith),a=TO(e=>e.mutating),o=t.status===`collapsed`||t.status===`voted`,s=o&&t.winner===e.side,c=o&&t.winner!==e.side,l=t.status===`open`,u=t.preferredSide===e.side;return(0,K.jsxs)(`div`,{className:q(`flex min-w-0 flex-col p-3 transition-opacity`,c&&`opacity-60`),children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-xs font-semibold text-muted-foreground`,children:e.displayName}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[u&&(0,K.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full bg-amber-500/15 px-2 py-0.5 text-[11px] font-medium text-amber-600 dar
268k:text-amber-400`,children:[(0,K.jsx)(R_,{className:`size-3 fill-current`}),n(`chat.benchmark.preferred_badge`)]}),s&&(0,K.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full bg-emerald-500/15 px-2 py-0.5 text-[11px] font-medium text-emerald-600 dark:text-emerald-400`,children:[(0,K.jsx)(Ose,{className:`size-3`}),n(t.status===`voted`?`chat.benchmark.winner_badge`:`chat.benchmark.continued_badge`)]})]})]}),e.toolActivities.length>0&&(0,K.jsx)(`div`,{className:`mb-2 space-y-1`,children:e.toolActivities.map(e=>(0,K.jsx)(QXe,{activity:e},e.id))}),(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.error?(0,K.jsxs)(`div`,{className:`flex items-start gap-1.5 text-xs text-amber-600`,children:[(0,K.jsx)(H_,{className:`mt-0.5 size-3.5 shrink-0`}),(0,K.jsx)(`span`,{children:n(`chat.benchmark.side_failed`)})]}):e.content?(0,K.jsxs)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none break-words text-foreground`,children:[(0,K.jsx)(_I,{remarkPlugins:[NI],components:YI,children:e.content}),e.streaming&&(0,K.jsx)(`span`,{className:`ml-0.5 inline-block h-4 w-1.5 animate-pulse bg-current align-text-bottom`})]}):e.streaming?(0,K.jsx)(zI,{label:n(`ai.activity.thinking`)}):(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`chat.benchmark.no_response`)})}),l&&(0,K.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`outline`,className:`w-full border-primary/50 text-primary hover:bg-primary/5 hover:text-primary`,disabled:!e.hasContent||a||!t.runId,onClick:()=>t.runId&&void i(t.runId,e.side),children:n(`chat.benchmark.continue_with_model`)}),(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`ghost`,className:q(`w-full text-muted-foreground`,u&&`text-amber-600 dark:text-amber-400`),disabled:!e.hasContent||a||!t.runId,onClick:()=>t.runId&&void r(t.runId,e.side),children:[(0,K.jsx)(R_,{className:q(`size-3.5`,u&&`fill-current`)}),n(`chat.benchmark.prefer_response`)]})]})]})}function eZe({view:e}){let{t}=V(),n=TO(e=>e.discard),r=TO(e=>e.mutating),i=LS(e=>e.current_conversation?.title),a=e.status===`streaming`?null:e.runId,o=i?t(`report_issue.dual_response_in`,{title:Ab(i)}):t(`report_issue.dual_response`);return(0,K.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-card/40`,children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-border`,children:[(0,K.jsx)($Xe,{side:e.sides[0],view:e}),(0,K.jsx)($Xe,{side:e.sides[1],view:e})]}),(e.canDiscard||a)&&(0,K.jsxs)(`div`,{className:`relative flex min-h-9 items-center justify-center border-t border-border px-3 py-1`,children:[e.canDiscard&&(0,K.jsx)(`button`,{type:`button`,className:`text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline disabled:opacity-50`,disabled:r||!e.runId,onClick:()=>e.runId&&void n(e.runId),children:t(`chat.benchmark.discard_turn`)}),a&&(0,K.jsx)(`div`,{className:`absolute right-2 top-1/2 -translate-y-1/2`,children:(0,K.jsx)(mO,{subject:{type:`chat_benchmark_run`,id:a,label:o}})})]})]})}var tZe=300,nZe=120;function ZI({className:e,emptyState:t}){let{t:n}=V(),{messages:r,conversationId:i,isLoading:a,isStreaming:o,isLoadingOlderMessages:s,streamingMessageId:c,streamingToolActivities:l,loadOlderMessages:u}=LS(),d=TO(e=>e.active),f=TO(e=>e.runsByConversation),p=TO(e=>e.loadRunsForConversation),{collapsedByMessageId:m,openByUserMessageId:h}=(0,B.useMemo)(()=>BPe(d,f,i),[d,f,i]);(0,B.useEffect)(()=>{i&&p(i)},[i,p]);let g=(0,B.useRef)(null),_=(0,B.useRef)(null),v=(0,B.useRef)(!0),y=(0,B.useRef)(void 0),b=(0,B.useRef)(null),x=(0,B.useRef)(null),S=(0,B.useRef)(0);return(0,B.useLayoutEffect)(()=>{let e=g.current;if(!e)return;let t=r.length>0?r[0].id:null,n=r.length>0?r[r.length-1].id:null;i===y.current?t&&b.current&&t!==b.current&&r.some(e=>e.id===b.current)?e.scrollTop+=e.scrollHeight-S.current:n&&n!==x.current&&n.startsWith(`temp-`)?_.current?.scrollIntoView({behavior:`smooth`}):v.current&&(e.scrollTop=e.scrollHeight):(e.scrollTop=e.scrollHeight,v.current=!0),y.current=i,b.current=t,x.current=n,S.current=e.scrollHeight},[r,i,a,o,d]),r.length===0&&!a?(0,K.jsx)(`div`,{className:q(`flex h-full items-center justify-center`,e),children:t??(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:n(`chat.start_chatting`)})}):(0,K.jsx)(`div`,{ref:g,onScroll:e=>{let t=e.currentTarget;v.current=t.scrollHeight-t.scrollTop-t.clientHeight<nZe,t.scrollTop<tZe&&u()},className:q(`h-full overflow-y-auto [overflow-anchor:none]`,e),children:(0,K.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl space-y-4 px-4 py-4`,children:[s&&(0,K.jsx)(`div`,{className:`mx-auto flex w-full max-w-3xl justify-center py-1`,children:(0,K.jsx)(W,{className:`size-4 animate-spin text-muted-foreground`})}),r.map((e,t)=>{let n=e.role===`assistant`&&r.findIndex((e,n)=>n>t&&e.role===`assistant`)===-1,i=m[e.id];if(i)return(0,K.jsx)(eZe,{view:i}
268,e.id);let a=h[e.id];return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,K.jsx)(ZXe,{message:e,isStreaming:o&&e.id===c,streamingToolActivities:o&&e.id===c?l:void 0,isLast:n})}),a&&(0,K.jsx)(eZe,{view:a})]},e.id)}),a&&!o&&(0,K.jsx)(`div`,{className:`mx-auto flex w-full max-w-3xl justify-start`,children:(0,K.jsx)(`div`,{className:`max-w-[80%] rounded-lg bg-muted px-4 py-3`,children:(0,K.jsx)(zI,{label:n(`ai.activity.thinking`)})})}),(0,K.jsx)(`div`,{ref:_})]})})}const rZe=()=>{let{t:e}=V(),t=LS(e=>e.contextBudget);if(!t)return null;let n=t.budget_used_pct,r=t.threshold_pct??90,i=n>=r?`bg-red-500`:n>=r-15?`bg-yellow-500`:`bg-emerald-500`,a=n>=r?`text-red-600 dark:text-red-400`:n>=r-15?`text-yellow-600 dark:text-yellow-400`:`text-muted-foreground`;return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1 text-xs`,children:[(0,K.jsx)(`div`,{className:`h-1.5 w-20 rounded-full bg-muted overflow-hidden`,children:(0,K.jsx)(`div`,{className:`h-full rounded-full transition-all ${i}`,style:{width:`${Math.min(n,100)}%`}})}),(0,K.jsx)(`span`,{className:a,children:e(`chat.context_usage`,{pct:Math.round(n)})})]})};function QI({className:e=``}){let{t}=V(),{error:n,clearError:r}=LS();return n?(0,K.jsxs)(`div`,{className:`p-2 bg-destructive/10 text-destructive text-sm rounded flex items-center justify-between gap-2 ${e}`,children:[(0,K.jsx)(`span`,{className:`min-w-0 break-words`,children:n}),(0,K.jsx)(J,{variant:`ghost`,size:`xs`,onClick:r,children:t(`common.dismiss`)})]}):null}var iZe=6,aZe=3;function oZe(){let{t:e}=V(),t=LS(e=>e.conversationId),n=LS(e=>e.setPersonaForConversation),r=Q(e=>e.personas),i=Q(e=>e.personasLoaded),{personaId:a}=SP(),o=RS()!==`viewer`,s=iP(),[c,l]=(0,B.useState)(null),u=t===null&&i,d=r.length>0,f={hidden:{},visible:{transition:{staggerChildren:.03}}},p=s?{hidden:{opacity:1},visible:{opacity:1}}:{hidden:{opacity:0,y:6},visible:{opacity:1,y:0}};return(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center px-4 text-center`,children:[(0,K.jsx)(`h1`,{className:`font-serif text-xl tracking-tight`,children:e(`chat.welcome.heading`)}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`chat.welcome.subheading`)}),u&&(d||o)&&(0,K.jsxs)(`div`,{className:`mt-6 w-full`,children:[(0,K.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:e(d?`chat.welcome.pick_persona`:`personas.create_first`)}),d?(0,K.jsx)(QN.ul,{initial:`hidden`,animate:`visible`,variants:f,className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:r.slice(0,iZe).map(e=>(0,K.jsx)(QN.li,{variants:p,children:(0,K.jsx)(gP,{title:e.name,description:e.description,leading:(0,K.jsx)(cP,{id:e.id,name:e.name,size:`md`}),isDefault:e.is_default,isTeam:!!e.org_id,active:e.id===a,onClick:()=>n(e.id===a?null:e.id)})},e.id))}):(0,K.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:bP.slice(0,aZe).map(t=>(0,K.jsx)(gP,{title:e(t.nameKey),description:e(t.descriptionKey),suffix:`.md`,onClick:()=>l(t.id)},t.id))})]}),(0,K.jsx)(lN,{children:c!==null&&(0,K.jsx)(xP,{open:!0,initialTemplateId:c,onOpenChange:e=>{e||l(null)},onCreated:e=>n(e.id)})})]})}function sZe(){let e={morning:`Good morning`,day:`Hello`,evening:`Good evening`},t=new Date().getHours();return t>=6&&t<12?e.morning:t>=12&&t<18?e.day:e.evening}const cZe=()=>{let{user:e}=Nx(),t=e?.first_name??`there`,{messages:n}=LS();return(0,K.jsx)(`div`,{className:`relative bg-gray-50 MainContent flex h-full flex-col overflow-hidden items-center`,children:n.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`flex-1 w-full min-h-0`,children:(0,K.jsx)(ZI,{emptyState:(0,K.jsx)(oZe,{})})}),(0,K.jsx)(QI,{className:`w-full max-w-3xl mx-4 mb-2`}),(0,K.jsxs)(`div`,{className:`w-full max-w-3xl flex flex-col items-center pb-4 px-4`,children:[(0,K.jsx)(rZe,{}),(0,K.jsx)(jP,{})]})]}):(0,K.jsx)(`div`,{className:`flex-1 flex w-full flex-col items-center justify-center px-4`,children:(0,K.jsxs)(`div`,{className:`w-full max-w-3xl flex flex-col items-center gap-6`,children:[(0,K.jsxs)(`div`,{className:`text-4xl`,children:[sZe(),`, `,t]}
268),(0,K.jsx)(QI,{className:`w-full`}),(0,K.jsx)(jP,{}),(0,K.jsx)(J,{size:`xs`,className:`text-neutral-500`,variant:`ghost`,asChild:!0,children:(0,K.jsxs)(Gv,{to:`/privacy`,children:[(0,K.jsx)(g_,{}),`Your data is encrypted, secure, and private`]})})]})})})};var $I=768;function eL(){let[e,t]=B.useState(void 0);return B.useEffect(()=>{let e=window.matchMedia(`(max-width: ${$I-1}px)`),n=()=>{t(window.innerWidth<$I)};return e.addEventListener(`change`,n),t(window.innerWidth<$I),()=>e.removeEventListener(`change`,n)},[]),!!e}v();var lZe=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ny(`Primitive.${t}`),r=B.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,K.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),uZe=`Separator`,dZe=`horizontal`,fZe=[`horizontal`,`vertical`],pZe=B.forwardRef((e,t)=>{let{decorative:n,orientation:r=dZe,...i}=e,a=mZe(r)?r:dZe,o=a===`vertical`?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,K.jsx)(lZe.div,{"data-orientation":a,...s,...i,ref:t})});pZe.displayName=uZe;function mZe(e){return fZe.includes(e)}var hZe=pZe;function tL({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,K.jsx)(hZe,{"data-slot":`separator`,decorative:n,orientation:t,className:q(`bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function nL({...e}){return(0,K.jsx)(FC,{"data-slot":`sheet`,...e})}function gZe({...e}){return(0,K.jsx)(IC,{"data-slot":`sheet-portal`,...e})}function _Ze({className:e,...t}){return(0,K.jsx)(LC,{"data-slot":`sheet-overlay`,className:q(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,e),...t})}function rL({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,K.jsxs)(gZe,{children:[(0,K.jsx)(_Ze,{}),(0,K.jsxs)(RC,{"data-slot":`sheet-content`,className:q(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,n===`right`&&`data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm`,n===`left`&&`data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm`,n===`top`&&`data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b`,n===`bottom`&&`data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t`,e),...i,children:[t,r&&(0,K.jsxs)(VC,{className:`ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none`,children:[(0,K.jsx)(J_,{className:`size-4`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function iL({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sheet-header`,className:q(`flex flex-col gap-1.5 p-4`,e),...t})}function aL({className:e,...t}){return(0,K.jsx)(zC,{"data-slot":`sheet-title`,className:q(`text-foreground font-semibold`,e),...t})}function oL({className:e,...t}){return(0,K.jsx)(BC,{"data-slot":`sheet-description`,className:q(`text-muted-foreground text-sm`,e),...t})}var vZe=`sidebar_state`,yZe=3600*24*7,bZe=`24rem`,xZe=`18rem`,SZe=`3rem`,CZe=`b`,wZe=B.createContext(null);function sL(){let e=B.useContext(wZe);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function TZe({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=eL(),[c,l]=B.useState(!1),[u,d]=B.useState(()=>{if(typeof document>`u`)return e;let t=document.cookie.match(/(?:^|;\s*)sidebar_state=(true|false)/);return t?t[1]===`true`:e}),f=t??u,p=B.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${vZe}=${t}; path=/; max-age=${yZe}`},[n,f]),m=B.useCallback(()=>s?l(e=>!e):p(e=>!e),[s,p,l]);B.useEffect(()=>{let e=e=>
268{e.key===CZe&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let h=f?`expanded`:`collapsed`,g=B.useMemo(()=>({state:h,open:f,setOpen:p,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[h,f,p,s,c,l,m]);return(0,K.jsx)(wZe.Provider,{value:g,children:(0,K.jsx)(HT,{delayDuration:0,children:(0,K.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":bZe,"--sidebar-width-icon":SZe,...i},className:q(`group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full`,r),...o,children:a})})})}function cL({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:s,openMobile:c,setOpenMobile:l}=sL();return n===`none`?(0,K.jsx)(`div`,{"data-slot":`sidebar`,className:q(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col`,r),...a,children:i}):o?(0,K.jsx)(nL,{open:c,onOpenChange:l,...a,children:(0,K.jsxs)(rL,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden`,style:{"--sidebar-width":xZe},side:e,children:[(0,K.jsxs)(iL,{className:`sr-only`,children:[(0,K.jsx)(aL,{children:`Sidebar`}),(0,K.jsx)(oL,{children:`Displays the mobile sidebar.`})]}),(0,K.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,K.jsxs)(`div`,{className:`group peer text-sidebar-foreground hidden md:block`,"data-state":s,"data-collapsible":s===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,K.jsx)(`div`,{"data-slot":`sidebar-gap`,className:q(`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,K.jsx)(`div`,{"data-slot":`sidebar-container`,className:q(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,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),...a,children:(0,K.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm`,children:i})})]})}function EZe({className:e,onClick:t,...n}){let{toggleSidebar:r}=sL();return(0,K.jsxs)(J,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon`,className:q(`size-7`,e),onClick:e=>{t?.(e),r()},...n,children:[(0,K.jsx)(ose,{}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function DZe({className:e,...t}){return(0,K.jsx)(`main`,{"data-slot":`sidebar-inset`,className:q(`bg-background relative flex w-full min-w-0 flex-1 flex-col`,`md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function OZe({className:e,...t}){return(0,K.jsx)(dP,{"data-slot":`sidebar-input`,"data-sidebar":`input`,className:q(`bg-background h-8 w-full shadow-none`,e),...t})}function lL({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:q(`flex flex-col gap-2 p-2`,e),...t})}function kZe({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:q(`flex flex-col gap-2 p-2`,e),...t})}function uL({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:q(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function dL({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:q(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function AZe({className:e,asChild:t=!1,...n}){return(0,K.jsx)(t?ry:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:q(`text-sidebar-foreground
268/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...n})}function fL({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:q(`w-full text-sm`,e),...t})}function pL({className:e,...t}){return(0,K.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:q(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function mL({className:e,...t}){return(0,K.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:q(`group/menu-item relative`,e),...t})}var jZe=ay(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{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 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function hL({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let s=e?ry:`button`,{isMobile:c,state:l}=sL(),u=(0,K.jsx)(s,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:q(jZe({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:u}),(0,K.jsx)(GT,{side:`right`,align:`center`,hidden:l!==`collapsed`||c,...i})]})):u}var MZe=[`/matters`,`/inbox`,`/chat`,`/email-task`];function gL(e){return MZe.find(t=>e.startsWith(t))??null}function NZe(e){return gL(e)!==null}const PZe=[{id:`2026-09-15-whats-new`,date:`2026-09-15`,title:`Introducing âWhat's newâ`,summary:`See product updates the moment they ship.`,body:[`modInsight now tells you when something new ships. Whenever you land on a`,`fresh build with an update you haven't seen, a small **⨠What's new**`,`toast appears â click it to read the details.`,``,`- **Never miss one.** Open the **Support** menu (the life-ring in the top`,` bar) â **What's new** any time to re-read this and every past update.`,`- **Follows you across devices.** Once you've seen an update on one device,`,` it won't nag you on another.`,``,`That's it for now â thanks for using modInsight.`].join(` 269`)}];function FZe(){return[...PZe].sort((e,t)=>e.date<t.date?1:e.date>t.date?-1:0)}function IZe(){return FZe()[0]??null}function LZe(e,t,n=12e3){return G.custom(n=>(0,K.jsxs)(`div`,{className:`flex w-[20rem] items-start gap-2 rounded-md border bg-popover px-4 py-3 text-sm text-popover-foreground shadow-md`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{t(),G.dismiss(n)},className:`flex flex-1 items-start gap-3 text-left`,children:[(0,K.jsx)(L_,{className:`mt-0.5 size-4 shrink-0 text-primary`}),(0,K.jsxs)(`span`,{className:`flex-1 space-y-0.5`,children:[(0,K.jsx)(`span`,{className:`block text-xs font-medium text-primary`,children:H.t(`notifications.release_note.toast_label`)}),(0,K.jsx)(`span`,{className:`block font-medium`,children:e.title}),(0,K.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.summary})]})]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":H.t(`notifications.release_note.dismiss`),onClick:()=>G.dismiss(n),className:`-mr-1 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,K.jsx)(J_,{className:`size-4`})})]}),{duration:n})}function RZe(){let e=Nx.getState().user;if(!e)return null;let t=(e.preferences??{}).last_seen_release_id;return typeof t==`string`?t:null}const _L=Pb((e,t)=>
269({dialogOpen:!1,activeReleaseId:null,checked:!1,checkForNewReleases:()=>{if(t().checked)return;let n=Nx.getState().user,r=IZe();!n||!r||(e({checked:!0}),RZe()!==r.id&&(LZe(r,()=>t().openReleaseNotes(r.id)),t().markSeen(r.id)))},openReleaseNotes:n=>{e({dialogOpen:!0,activeReleaseId:n??null});let r=IZe();r&&t().markSeen(r.id)},markSeen:async e=>{let{user:t,updateUser:n}=Nx.getState();if(t){let r=t.preferences??{};if(r.last_seen_release_id===e)return;n({...t,preferences:{...r,last_seen_release_id:e}})}try{await jx({preferences:{last_seen_release_id:e}})}catch{}},closeDialog:()=>e({dialogOpen:!1})}));function zZe(){let{t:e}=V(),t=Sv(),n=fO(e=>e.recording),r=fO(e=>e.openDialog),i=fO(e=>e.captureScreenshotAndOpen),a=fO(e=>e.startRecording),o=fO(e=>e.stopRecording);return(0,K.jsxs)(K.Fragment,{children:[n!==`idle`&&(n===`recording`?(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8`,title:e(`support.menu.stop_recording`),onClick:()=>void o(),children:(0,K.jsx)(Sse,{className:`size-4 animate-pulse fill-current text-red-500`})}):(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8`,disabled:!0,title:e(`support.menu.record_preparing`),children:(0,K.jsx)(W,{className:`size-4 animate-spin`})})),(0,K.jsxs)(LD,{children:[(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsx)(RD,{asChild:!0,children:(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,"data-support-anchor":!0,className:`h-8`,"aria-label":e(`support.menu.tooltip`),children:[(0,K.jsx)(f_,{className:`size-4`}),(0,K.jsx)(`span`,{className:`hidden sm:inline`,children:e(`support.menu.tooltip`)})]})})}),(0,K.jsx)(GT,{children:e(`support.menu.tooltip`)})]}),(0,K.jsxs)(zD,{align:`end`,"data-capture-exclude":!0,children:[(0,K.jsxs)(VD,{onSelect:()=>r(),children:[(0,K.jsx)($oe,{}),e(`support.menu.contact`)]}),(0,K.jsxs)(VD,{onSelect:()=>void i(),children:[(0,K.jsx)(Ig,{}),e(`support.menu.screenshot`)]}),(0,K.jsxs)(VD,{disabled:n!==`idle`,onSelect:()=>void a(),children:[(0,K.jsx)(Pse,{}),e(`support.menu.record`)]}),(0,K.jsx)(WD,{}),(0,K.jsxs)(VD,{onSelect:()=>t(`/settings/support`),children:[(0,K.jsx)(Dse,{}),e(`support.menu.my_tickets`)]}),(0,K.jsxs)(VD,{onSelect:()=>_L.getState().openReleaseNotes(),children:[(0,K.jsx)(L_,{}),e(`support.menu.whats_new`)]})]})]})]})}async function BZe(){return(await Z(`/api/v1/notifications/sse-token`,{method:`POST`,signal:AbortSignal.timeout(15e3)})).data.token}async function VZe(e,t,n){let r=await BZe(),i=`${Zb()}/api/v1/notifications/stream?token=${r}`,a=new EventSource(i);a.onopen=()=>n?.(),a.addEventListener(`notification`,t=>{e(JSON.parse(t.data))});let o=!1;return a.onerror=e=>{o||(o=!0,a.close(),t?.(e))},()=>a.close()}const vL=Pb(e=>({connected:!1,account:null,channels:[],loading:!1,error:null,needsReauth:!1,lastFailureReason:null,lastFailureAt:null,fetchStatus:async()=>{e({loading:!0,error:null});try{let{connected:t,account:n,needs_reauth:r}=(await Z(`/api/v1/slack/status-with-reauth`,{method:`GET`})).data;e({connected:t,account:n,needsReauth:r??n?.is_active===!1,lastFailureReason:n?.last_failure_reason??null,lastFailureAt:n?.last_failure_at??null,loading:!1})}catch(t){X(t,{operation:`slack_fetch_status`}),e({loading:!1,error:Kb(t,H.t(`errors.fetch_failed`))})}},connect:async()=>{e({loading:!0,error:null});try{let e=await Z(`/api/v1/slack/connect`,{method:`GET`});window.location.href=e.data.authorization_url}catch(t){X(t,{operation:`slack_connect`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.connect_failed`))})}},handleCallback:async(t,n)=>{e({loading:!0,error:null});try{e({connected:!0,account:(await Z(`/api/v1/slack/callback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:t,state:n})})).data,loading:!1})}catch(t){throw X(t,{operation:`slack_callback`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.connect_failed`))}),t}},disconnect:async()=>{e({loading:!0,error:null});try{await Z(`/api/v1/slack/disconnect`,{method:`DELETE`}),e({connected:!1,account:null,channels:[],loading:!1})}catch(t){X(t,{operation:`slack_disconnect`}),e({loading:!1,error:Kb(t,H.t(`toasts.integrations.disconnect_failed`))})}},deleteSyncedData:async()=>{e({loading:!0,error:null});try{await Z(`/api/v1/slack/synced-data`,{method:`DELETE`}),e({connected:!1,account:null,channels:[],needsReauth:!1,lastFailureReason:null,lastFailureAt:null,loading:!1})}catch(t){throw X(t,{operation:`slack_delete_synced`}),e({loading:!1,error:Kb(t,H.t(`errors.generic`))}),t}},fetchChannels:async()=>{try{e({channels:(await Z(`/api/v1/slack/channels`,{method:`GET`})).data})}catch{}},updateSettings:async t=>{e({loading:!0,error:null});try{e({account:(await Z(`/api/v1/slack/settings`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({default_channel_id:t})})).data,loading:!1})}catch(t){X(t,{operation:`slack_update_settings`}),e({loading:!1,error:Kb(t,H.t(`errors.save_failed`))})}}})),HZe=()=>`/api/v1/feedback`,UZe=async e=>Z(HZe(),{...e,method:`GET`}),WZe=e=>`/api/v1/feedback/${e}`,GZe=async(e,t)=>Z(WZe(e),{...t,method:`GET`}),KZe=e=>`/api/v1/feedback/${e}`,qZe=async(e,t)=>Z(KZe(e),{...t,method:`DELETE`}),JZe=e=>`/api/v1/feedback/${e}/messages`,YZe=async(e,t)=>Z(JZe(e),{...t,method:`GET`}),XZe=e=>`/api/v1/feedback/${e}/messages`,ZZe=async(e,t,n)=>Z(XZe(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)});var QZe={untriaged:{labelKey:`support.status.open`,badgeClass:`border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-900 dark:bg-blue-950 dar
269k:text-blue-300`},triaged:{labelKey:`support.status.open`,badgeClass:`border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-900 dark:bg-blue-950 dark:text-blue-300`},in_progress:{labelKey:`support.status.in_progress`,badgeClass:`border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-300`},resolved:{labelKey:`support.status.resolved`,badgeClass:`border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950 dark:text-emerald-300`},wontfix:{labelKey:`support.status.closed`,badgeClass:`border-border bg-muted text-muted-foreground`},duplicate:{labelKey:`support.status.closed`,badgeClass:`border-border bg-muted text-muted-foreground`}};function $Ze(e){return QZe[e??`untriaged`]??QZe.untriaged}function eQe(e){return e===`resolved`||e===`wontfix`||e===`duplicate`}function tQe(e){return!e.last_message_is_staff||!e.last_message_at?!1:e.user_last_seen_at?Date.parse(e.last_message_at)>Date.parse(e.user_last_seen_at):!0}function nQe(e,t){let n=e[t.id];return n==null?!1:t.last_message_at?Date.parse(n)>=Date.parse(t.last_message_at):!0}const yL=Pb((e,t)=>({tickets:[],ticketsLoaded:!1,loadingTickets:!1,selectedId:null,detail:null,messages:[],loadingTicket:!1,sending:!1,dismissedReplyBanners:{},loadTickets:async()=>{if(!t().loadingTickets){e({loadingTickets:!0});try{e({tickets:(await UZe()).data,ticketsLoaded:!0})}catch(e){Y(e,H.t(`support.toasts.load_failed`),{operation:`support.loadTickets`})}finally{e({loadingTickets:!1})}}},openTicket:async n=>{e({selectedId:n,loadingTicket:!0,detail:null,messages:[]});try{let[r,i]=await Promise.all([GZe(n),YZe(n)]);if(t().selectedId!==n)return;e({detail:r.data,messages:i.data}),t().loadTickets()}catch(r){t().selectedId===n&&e({selectedId:null}),Y(r,H.t(`support.toasts.open_failed`),{operation:`support.openTicket`})}finally{(t().selectedId===n||t().selectedId===null)&&e({loadingTicket:!1})}},refreshTicket:async n=>{try{let[r,i]=await Promise.all([GZe(n),YZe(n)]);if(t().selectedId!==n)return;e({detail:r.data,messages:i.data}),t().loadTickets()}catch(e){X(e,{operation:`support.refreshTicket`})}},sendMessage:async n=>{let{selectedId:r,sending:i}=t();if(!r||i||!n.trim())return!1;e({sending:!0});try{let i=(await ZZe(r,{body:n.trim()})).data,{messages:a,detail:o}=t(),s=o&&o.id===r&&eQe(o.status)?{...o,status:`untriaged`,resolved_at:null}:o;return e({messages:[...a,i],detail:s}),t().loadTickets(),!0}catch(e){return Y(e,H.t(`support.toasts.send_failed`),{operation:`support.sendMessage`}),!1}finally{e({sending:!1})}},deleteTicket:async n=>{try{await qZe(n);let{tickets:r,selectedId:i}=t();return e({tickets:r.filter(e=>e.id!==n),...i===n?{selectedId:null,detail:null,messages:[]}:{}}),!0}catch(e){return Y(e,H.t(`support.toasts.delete_failed`),{operation:`support.deleteTicket`}),!1}},handleTicketEvent:e=>{let{selectedId:n,ticketsLoaded:r}=t();if(n&&e.reference_id===n){t().refreshTicket(n);return}(e.type===`feedback_reply`||r)&&t().loadTickets()},dismissReplyBanner:n=>{let r=t().tickets.find(e=>e.id===n);r?.last_message_at&&e(e=>({dismissedReplyBanners:{...e.dismissedReplyBanners,[n]:r.last_message_at}}))}})),rQe=()=>`/api/v1/cs/customers/import/commit`,iQe=async(e,t)=>Z(rQe(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),aQe=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/cs/customers?${n}`:`/api/v1/cs/customers`},oQe=async(e,t)=>Z(aQe(e),{...t,method:`GET`}),sQe=()=>`/api/v1/cs/customers`,cQe=async(e,t)=>Z(sQe(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),lQe=e=>`/api/v1/cs/customers/${e}`,uQe=async(e,t)=>Z(lQe(e),{...t,method:`GET`}),dQe=e=>`/api/v1/cs/customers/${e}`,fQe=async(e,t,n)=>Z(dQe(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),pQe=e=>`/api/v1/cs/customers/${e}`,mQe=async(e,t)=>Z(pQe(e),{...t,method:`DELETE`}),hQe=e=>`/api/v1/cs/customers/${e}/archive`,gQe=async(e,t)=>Z(hQe(e),{...t,method:`POST`}),_Qe=e=>`/api/v1/cs/customers/${e}/restore`,vQe=async(e,t)=>Z(_Qe(e),{...t,method:`POST`}),yQe=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}
269).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/cs/customers/${e}/timeline?${r}`:`/api/v1/cs/customers/${e}/timeline`},bQe=async(e,t,n)=>Z(yQe(e,t),{...n,method:`GET`}),xQe=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/cs/customers/${e}/timeline/hidden?${r}`:`/api/v1/cs/customers/${e}/timeline/hidden`},SQe=async(e,t,n)=>Z(xQe(e,t),{...n,method:`GET`}),CQe=(e,t)=>`/api/v1/cs/customers/${e}/events/${t}`,wQe=async(e,t,n)=>Z(CQe(e,t),{...n,method:`GET`}),TQe=(e,t)=>`/api/v1/cs/customers/${e}/events/${t}/hide`,EQe=async(e,t,n)=>Z(TQe(e,t),{...n,method:`POST`}),DQe=(e,t)=>`/api/v1/cs/customers/${e}/events/${t}/unhide`,OQe=async(e,t,n)=>Z(DQe(e,t),{...n,method:`POST`}),kQe=e=>`/api/v1/cs/customers/${e}/timeline-summary`,AQe=async(e,t)=>Z(kQe(e),{...t,method:`GET`}),jQe=e=>`/api/v1/cs/customers/${e}/timeline-summary/regenerate`,MQe=async(e,t)=>Z(jQe(e),{...t,method:`POST`}),NQe=e=>`/api/v1/cs/customers/${e}/backfill`,PQe=async(e,t)=>Z(NQe(e),{...t,method:`POST`});var FQe=50;const bL=Pb((e,t)=>({customers:[],loaded:!1,loading:!1,search:``,includeArchived:!1,selectedId:null,detail:null,loadingDetail:!1,timeline:[],timelineLoading:!1,timelineHasMore:!1,nextBeforeOccurredAt:null,nextBeforeId:null,hiddenEvents:[],hiddenLoaded:!1,showHidden:!1,summary:null,summaryGenerating:!1,backfilling:!1,fetchCustomers:async()=>{if(t().loading)return;e({loading:!0});let n=Nx.getState().user?.current_org_id??null;try{let{search:r,includeArchived:i}=t(),a=await oQe({include_archived:i,search:r||void 0});if((Nx.getState().user?.current_org_id??null)!==n)return;e({customers:a.data,loaded:!0})}catch(e){Y(e,H.t(`customer_success.toasts.load_failed`),{operation:`cs.fetchCustomers`})}finally{e({loading:!1})}},setSearch:n=>{e({search:n}),t().fetchCustomers()},setIncludeArchived:n=>{e({includeArchived:n}),t().fetchCustomers()},openCustomer:async n=>{e({selectedId:n,loadingDetail:!0,detail:null,timeline:[],timelineHasMore:!1,nextBeforeOccurredAt:null,nextBeforeId:null,hiddenEvents:[],hiddenLoaded:!1,showHidden:!1,summary:null,summaryGenerating:!1}),t().loadSummary(n),t().loadHiddenEvents(n);try{e({detail:(await uQe(n)).data}),await xL(n,!0,e,t)}catch(e){Y(e,H.t(`customer_success.toasts.load_failed`),{operation:`cs.openCustomer`})}finally{e({loadingDetail:!1})}},closeCustomer:()=>{e({selectedId:null,detail:null,timeline:[],timelineHasMore:!1,nextBeforeOccurredAt:null,nextBeforeId:null,hiddenEvents:[],hiddenLoaded:!1,showHidden:!1,summary:null,summaryGenerating:!1})},loadMoreTimeline:async()=>{let{selectedId:n,timelineLoading:r,timelineHasMore:i}=t();!n||r||!i||await xL(n,!1,e,t)},loadHiddenEvents:async n=>{try{let r=(await SQe(n)).data;if(t().selectedId!==n)return;e({hiddenEvents:r.events,hiddenLoaded:!0})}catch(e){X(e,{operation:`cs.loadHiddenEvents`})}},toggleShowHidden:()=>{e(e=>({showHidden:!e.showHidden}))},hideEvent:async n=>{let{selectedId:r}=t();if(!r)return;let i=t().timeline,a=i.find(e=>e.id===n);if(a){e(e=>({timeline:e.timeline.filter(e=>e.id!==n),hiddenEvents:[{...a,hidden_at:new Date().toISOString()},...e.hiddenEvents]}));try{await EQe(r,n)}catch(t){e(e=>({timeline:i,hiddenEvents:e.hiddenEvents.filter(e=>e.id!==n)})),Y(t,H.t(`customer_success.toasts.save_failed`),{operation:`cs.hideEvent`})}}},unhideEvent:async n=>{let{selectedId:r}=t();if(!r)return;let i=t().hiddenEvents;if(i.find(e=>e.id===n)){e(e=>({hiddenEvents:e.hiddenEvents.filter(e=>e.id!==n)}));try{await OQe(r,n),await xL(r,!0,e,t),t().hiddenEvents.length===0&&e({showHidden:!1})}catch(t){e({hiddenEvents:i}),Y(t,H.t(`customer_success.toasts.save_failed`),{operation:`cs.unhideEvent`})}}},createCustomer:async e=>{try{let n=(await cQe(e)).data;return G.success(H.t(`customer_success.toasts.created`)),await t().fetchCustomers(),n}catch(e){return Y(e,H.t(`customer_success.toasts.save_failed`),{operation:`cs.createCustomer`}),null}},updateCustomer:async(t,n)=>{try{let r=(await fQe(t,n)).data;return e(e=>({detail:e.selectedId===t?r:e.detail,customers:e.customers.map(e=>e.id===t?r:e)})),G.success(H.t(`customer_success.toasts.saved`)),!0}catch(e){return Y(e,H.t(`customer_success.toasts.save_failed`),{operation:`cs.updateCustomer`}),!1}},commitImport:async(e,{polishNotes:n})=>{try{let r=(await iQe({import_id:e,polish_notes:n})).data;return await t().fetchCustomers(),r}catch(e){return Y(e,H.t(`customer_success.toasts.import_failed`),{operation:`cs.commitImport`}),null}},setIngestMailboxes:async(e,n)=>{await t().updateCustomer(e,{ingest_account_ids:n})&&t().selectedId===e&&t().openCustomer(e)},archiveCustomer:async e=>{try{await gQe(e),G.success(H.t(`customer_success.toasts.archived`)),await t().fetchCustomers(),t().selectedId===e&&await t().openCustomer(e)}catch(e){Y(e,H.t(`customer_success.toasts.save_failed`),{operation:`cs.archiveCustomer`})}},restoreCustomer:async e=>{try{await vQe(e),G.success(H.t(`customer_success.toasts.restored`)),await t().fetchCustomers(),t().selectedId===e&&await t().openCustomer(e)}catch(e){Y(e,H.t(`customer_success.toasts.save_failed`),{operation:`cs.restoreCustomer`})}},deleteCustomer:async t=>{try{return await mQe(t),G.success(H.t(`customer_success.toasts.deleted`)),e(e=>({customers:e.customers.filter(e=>e.id!==t),selectedId:e.selectedId===t?null:e.selectedId,detail:e.selectedId===t?null:e.detail})),!0}catch(e){return Y(e,H.t(`customer_success.toasts.delete_failed`),{operation:`cs.deleteCustomer`}),!1}},triggerBackfill:async n=>{if(!t().backfilling){e({backfilling:!0});try{await PQe(n),G.success(H.t(`customer_success.toasts.backfill_queued`))}catch(e){Y(e,H.t(`customer_success.toasts.backfill_failed`),{operation:`cs.triggerBackfill`})}finally{e({backfilling:!1})}}},loadSummary:async n=>{try{let r=(await AQe(n)).data;if(t().selectedId!==n)return;e({summary:r,summaryGenerating:r.generating===!0})}catch(e){X(e,{operation:`cs.loadSummary`})}},regenerateSummary:async n=>{e({summaryGenerating:!0});try{await MQe(n),G.success(H.t(`customer_success.timeline.summary.regen_queued`))}catch(r){t().selectedId===n&&e({summaryGenerating:!1}),Y(r,H.t(`customer_success.timeline.summary.regen_failed`),{operation:`cs.regenerateSummary`})}},handleTimelineUpdated:e=>{let n=e.metadata?.customer_ids,{selectedId:r,loaded:i,isCustomerInScope:a}=t();i&&(!n||n.some(a))&&t().fetchCustomers(),r&&(!n||n.includes(r))&&t().openCustomer(r)},handleSummaryUpdated:e=>{let n=e.metadata?.customer_ids,{selectedId:r}=t();r&&(!n||n.includes(r))&&t().loadSummary(r)},refreshCustomer:async n=>{if(t().isCustomerInScope(n))try{let t=(await uQe(n)).data;e(e=>({customers:e.customers.map(e=>e.id===n?t:e),detail:e.selectedId===n?t:e.detail}))}catch(e){X(e,{operation:`cs.refreshCustomer`})}},isCustomerInScope:e=>{let{selectedId:n,customers:r}=t();return n===e||r.some(t=>t.id===e)}}));async function xL(e,t,n,r){n({timelineLoading:!0});try{let i=(await bQe(e,{limit:FQe,...t?{}:{before_occurred_at:r().nextBeforeOccurredAt??void 0,before_id:r().nextBeforeId??void 0}})).data;
269if(r().selectedId!==e)return;n({timeline:t?i.events:[...r().timeline,...i.events],timelineHasMore:i.has_more??!1,nextBeforeOccurredAt:i.next_before_occurred_at??null,nextBeforeId:i.next_before_id??null})}catch(e){X(e,{operation:`cs.loadTimeline`})}finally{r().selectedId===e&&n({timelineLoading:!1})}}const IQe=e=>`/api/v1/cs/customers/${e}/projects`,LQe=async(e,t)=>Z(IQe(e),{...t,method:`GET`}),RQe=e=>`/api/v1/cs/customers/${e}/projects`,zQe=async(e,t,n)=>Z(RQe(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),BQe=e=>`/api/v1/cs/projects/${e}`,VQe=async(e,t,n)=>Z(BQe(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),HQe=e=>`/api/v1/cs/projects/${e}`,UQe=async(e,t)=>Z(HQe(e),{...t,method:`DELETE`}),WQe=e=>`/api/v1/cs/projects/${e}/tasks`,GQe=async(e,t)=>Z(WQe(e),{...t,method:`GET`}),KQe=e=>`/api/v1/cs/projects/${e}/tasks`,qQe=async(e,t,n)=>Z(KQe(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),JQe=e=>`/api/v1/cs/tasks/${e}`,YQe=async(e,t,n)=>Z(JQe(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),XQe=e=>`/api/v1/cs/tasks/${e}`,ZQe=async(e,t)=>Z(XQe(e),{...t,method:`DELETE`}),QQe=e=>`/api/v1/cs/tasks/${e}/status`,$Qe=async(e,t,n)=>Z(QQe(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),e$e=e=>`/api/v1/cs/projects/${e}/tasks/reorder`,t$e=async(e,t,n)=>Z(e$e(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),n$e=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/cs/projects/${e}/decision-log?${r}`:`/api/v1/cs/projects/${e}/decision-log`},r$e=async(e,t,n)=>Z(n$e(e,t),{...n,method:`GET`}),i$e=e=>`/api/v1/cs/projects/${e}/regenerate`,a$e=async(e,t)=>Z(i$e(e),{...t,method:`POST`}),o$e=e=>`/api/v1/cs/customers/${e}/transcripts`,s$e=async(e,t,n)=>{let r=new FormData;return r.append(`file`,t.file),t.project_id!==void 0&&t.project_id!==null&&r.append(`project_id`,t.project_id),Z(o$e(e),{...n,method:`POST`,body:r})};var c$e=9e4;function SL(e=c$e){let t=new Map;return{arm(n,r){let i=t.get(n);i&&clearTimeout(i),t.set(n,setTimeout(()=>{t.delete(n),r()},e))},cancel(e){let n=t.get(e);n&&(clearTimeout(n),t.delete(e))}}}var CL=SL();const wL=Pb((e,t)=>({projectsByCustomer:{},tasksByProject:{},decisionLogByProject:{},loadingProjects:{},regenerating:{},uploadingTranscript:!1,fetchProjects:async t=>{e(e=>({loadingProjects:{...e.loadingProjects,[t]:!0}}));try{let n=await LQe(t);e(e=>({projectsByCustomer:{...e.projectsByCustomer,[t]:n.data}}))}catch(e){Y(e,H.t(`customer_success.roadmap.toasts.load_failed`),{operation:`csRoadmap.fetchProjects`})}finally{e(e=>({loadingProjects:{...e.loadingProjects,[t]:!1}}))}},createProject:async(e,n)=>{try{let r=(await zQe(e,n)).data;return G.success(H.t(`customer_success.roadmap.toasts.project_created`)),await t().fetchProjects(e),r}catch(e){return Y(e,H.t(`customer_success.roadmap.toasts.save_failed`),{operation:`csRoadmap.createProject`}),null}},updateProject:async(e,n,r)=>{try{return await VQe(e,r),await t().fetchProjects(n),G.success(H.t(`customer_success.roadmap.toasts.saved`)),!0}catch(e){return Y(e,H.t(`customer_success.roadmap.toasts.save_failed`),{operation:`csRoadmap.updateProject`}),!1}},deleteProject:async(t,n)=>{try{return await UQe(t),e(e=>({projectsByCustomer:{...e.projectsByCustomer,[n]:(e.projectsByCustomer[n]??[]).filter(e=>e.id!==t)}})),G.success(H.t(`customer_success.roadmap.toasts.project_deleted`)),!0}catch(e){return Y(e,H.t(`customer_success.roadmap.toasts.delete_failed`),{operation:`csRoadmap.deleteProject`}),!1}},fetchTasks:async t=>{try{let n=await GQe(t);e(e=>({tasksByProject:{...e.tasksByProject,[t]:n.data}}))}catch(e){Y(e,H.t(`customer_success.roadmap.toasts.load_failed`),{operation:`csRoadmap.fetchTasks`})}},createTask:async(e,n)=>{try{return await qQe(e,n),await t().fetchTasks(e),G.success(H.t(`customer_success.roadmap.toasts.task_created`)),!0}catch(e){return Y(e,H.t(`customer_success.roadmap.toasts.save_failed`),{operation:`csRoadmap.createTask`}),!1}},updateTask:async(t,n,r)=>{try{let i=(await YQe(t,r)).data;return e(e=>({tasksByProject:{...e.tasksByProject,[n]:(e.tasksByProject[n]??[]).map(e=>e.id===t?i:e)}})),!0}catch(e){return Y(e,H.t(`customer_success.roadmap.toasts.save_failed`),{operation:`csRoadmap.updateTask`}),!1}},setTaskStatus:async(n,r,i)=>{let a=t().tasksByProject[r]??[];e(e=>({tasksByProject:{...e.tasksByProject,[r]:a.map(e=>e.id===n?{...e,status:i}:e)}}));try{let t=(await $Qe(n,{status:i})).data;e(e=>({tasksByProject:{...e.tasksByProject,[r]:(e.tasksByProject[r]??[]).map(e=>e.id===n?t:e)}}))}catch(t){e(e=>({tasksByProject:{...e.tasksByProject,[r]:a}})),Y(t,H.t(`customer_success.roadmap.toasts.save_failed`),{operation:`csRoadmap.setTaskStatus`})}},reorderTasks:async(n,r)=>{let i=t().tasksByProject[n]??[],a=new Map(i.map(e=>[e.id,e])),o=r.map(e=>a.get(e)).filter(e=>!!e);e(e=>({tasksByProject:{...e.tasksByProject,[n]:o}}));try{let t=await t$e(n,{ordered_ids:r});e(e=>({tasksByProject:{...e.tasksByProject,[n]:t.data}}))}catch(t){e(e=>({tasksByProject:{...e.tasksByProject,[n]:i}})),Y(t,H.t(`customer_success.roadmap.toasts.save_failed`),{operation:`csRoadmap.reorderTasks`})}},deleteTask:async(t,n)=>{try{return await ZQe(t),e(e=>({tasksByProject:{...e.tasksByProject,[n]:(e.tasksByProject[n]??[]).filter(e=>e.id!==t)}})),!0}catch(e){return Y(e,H.t(`customer_success.roadmap.toasts.delete_failed`),{operation:`csRoadmap.deleteTask`}),!1}},fetchDecisionLog:async t=>{try{let n=await r$e(t);e(e=>({decisionLogByProject:{...e.decisionLogByProject,[t]:n.data}}))}catch(e){Y(e,H.t(`customer_success.roadmap.toasts.load_failed`),{operation:`csRoadmap.fetchDecisionLog`})}},regenerateRoadmap:async(n,r)=>{e(e=>({regenerating:{...e.regenerating,[n]:!0}})),CL.arm(n,()=>e(e=>({regenerating:{...e.regenerating,[n]:!1}}))),e(e=>({projectsByCustomer:{...e.projectsByCustomer,[r]:(e.projectsByCustomer[r]??[]).map(e=>e.id===n?{...e,roadmap_status:`generating`}:e)}}));try{await a$e(n),G.success(H.t(`customer_success.roadmap.toasts.regen_queued`))}catch(i){CL.cancel(n),e(e=>({regenerating:{...e.regenerating,[n]:!1}})),await t().fetchProjects(r),Y(i,H.t(`customer_success.roadmap.toasts.regen_failed`),{operation:`csRoadmap.regenerateRoadmap`})}},uploadTranscript:async(t,n,r)=>{e({uploadingTranscript:!0});try{return await s$e(t,{file:n,project_id:r??null}),G.success(H.t(`customer_success.roadmap.toasts.transcript_queued`)),!0}catch(e){return Y(e,H.t(`customer_success.roadmap.toasts.transcript_failed`),{operation:`csRoadmap.uploadTranscript`}),!1}finally{e({uploadingTranscript:!1})}},handleRoadmapUpdated:n=>{let r=n.metadata?.customer_ids??[],i=n.metadata?.project_id;i&&(CL.cancel(i),e(e=>({regenerating:{...e.regenerating,[i]:!1}})));let a=bL.getState().isCustomerInScope,o=r.some(a);for(let e of r)a(e)&&t().projectsByCustomer[e]&&t().fetchProjects(e);o&&i&&t().tasksByProject[i]&&t().fetchTasks(i)}})),l$e=e=>`/api/v1/cs/customers/${e}/signals`,u$e=async(e,t)=>Z(l$e(e),{...t,method:`GET`}),d$e=(e,t)=>
269{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/cs/customers/${e}/risks?${r}`:`/api/v1/cs/customers/${e}/risks`},f$e=async(e,t,n)=>Z(d$e(e,t),{...n,method:`GET`}),p$e=e=>`/api/v1/cs/customers/${e}/risks`,m$e=async(e,t,n)=>Z(p$e(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),h$e=e=>`/api/v1/cs/risks/${e}/resolve`,g$e=async(e,t)=>Z(h$e(e),{...t,method:`POST`}),_$e=e=>`/api/v1/cs/risks/${e}/dismiss`,v$e=async(e,t)=>Z(_$e(e),{...t,method:`POST`}),y$e=e=>`/api/v1/cs/risks/${e}`,b$e=async(e,t)=>Z(y$e(e),{...t,method:`DELETE`}),x$e=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/cs/customers/${e}/risk-history?${r}`:`/api/v1/cs/customers/${e}/risk-history`},S$e=async(e,t,n)=>Z(x$e(e,t),{...n,method:`GET`}),C$e=e=>`/api/v1/cs/customers/${e}/recompute`,w$e=async(e,t)=>Z(C$e(e),{...t,method:`POST`}),T$e=()=>`/api/v1/cs/risk-profile`,E$e=async e=>Z(T$e(),{...e,method:`GET`}),D$e=()=>`/api/v1/cs/risk-profile`,O$e=async(e,t)=>Z(D$e(),{...t,method:`PUT`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)});var TL=SL(),EL=e=>H.t(e);function k$e(e,t){return e.map(e=>e.id===t.id?t:e)}const DL=Pb((e,t)=>({signalsByCustomer:{},risksByCustomer:{},historyByCustomer:{},loading:{},recomputing:{},profile:null,profileLoaded:!1,profileSaving:!1,fetchProfile:async()=>{try{e({profile:(await E$e()).data??null,profileLoaded:!0})}catch(t){e({profileLoaded:!0}),Y(t,EL(`customer_success.risk.settings.toasts.load_failed`),{operation:`csRisk.fetchProfile`})}},saveProfile:async t=>{e({profileSaving:!0});try{return e({profile:(await O$e(t)).data}),G.success(EL(`customer_success.risk.settings.toasts.saved`)),!0}catch(e){return Y(e,EL(`customer_success.risk.settings.toasts.save_failed`),{operation:`csRisk.saveProfile`}),!1}finally{e({profileSaving:!1})}},fetchSignals:async t=>{try{let n=await u$e(t);e(e=>({signalsByCustomer:{...e.signalsByCustomer,[t]:n.data}}))}catch(e){Y(e,EL(`customer_success.risk.toasts.load_failed`),{operation:`csRisk.fetchSignals`})}},fetchRisks:async t=>{try{let n=await f$e(t);e(e=>({risksByCustomer:{...e.risksByCustomer,[t]:n.data}}))}catch(e){Y(e,EL(`customer_success.risk.toasts.load_failed`),{operation:`csRisk.fetchRisks`})}},fetchHistory:async t=>{try{let n=await S$e(t);e(e=>({historyByCustomer:{...e.historyByCustomer,[t]:n.data}}))}catch(e){Y(e,EL(`customer_success.risk.toasts.load_failed`),{operation:`csRisk.fetchHistory`})}},loadAll:async n=>{e(e=>({loading:{...e.loading,[n]:!0}})),await Promise.all([t().fetchSignals(n),t().fetchRisks(n),t().fetchHistory(n)]),e(e=>({loading:{...e.loading,[n]:!1}}))},createRisk:async(e,n)=>{try{return await m$e(e,n),await t().fetchRisks(e),G.success(EL(`customer_success.risk.toasts.risk_created`)),!0}catch(e){return Y(e,EL(`customer_success.risk.toasts.save_failed`),{operation:`csRisk.createRisk`}),!1}},resolveRisk:async(t,n)=>{try{let r=(await g$e(t)).data;e(e=>({risksByCustomer:{...e.risksByCustomer,[n]:k$e(e.risksByCustomer[n]??[],r)}})),G.success(EL(`customer_success.risk.toasts.resolved`))}catch(e){Y(e,EL(`customer_success.risk.toasts.save_failed`),{operation:`csRisk.resolveRisk`})}},dismissRisk:async(t,n)=>{try{let r=(await v$e(t)).data;e(e=>({risksByCustomer:{...e.risksByCustomer,[n]:k$e(e.risksByCustomer[n]??[],r)}})),G.success(EL(`customer_success.risk.toasts.dismissed`))}catch(e){Y(e,EL(`customer_success.risk.toasts.save_failed`),{operation:`csRisk.dismissRisk`})}},deleteRisk:async(t,n)=>{try{return await b$e(t),e(e=>({risksByCustomer:{...e.risksByCustomer,[n]:(e.risksByCustomer[n]??[]).filter(e=>e.id!==t)}})),G.success(EL(`customer_success.risk.toasts.risk_deleted`)),!0}catch(e){return Y(e,EL(`customer_success.risk.toasts.delete_failed`),{operation:`csRisk.deleteRisk`}),!1}},recompute:async t=>{e(e=>({recomputing:{...e.recomputing,[t]:!0}})),TL.arm(t,()=>e(e=>({recomputing:{...e.recomputing,[t]:!1}})));try{await w$e(t),G.success(EL(`customer_success.risk.toasts.recompute_queued`))}catch(n){TL.cancel(t),e(e=>({recomputing:{...e.recomputing,[t]:!1}})),Y(n,EL(`customer_success.risk.toasts.recompute_failed`),{operation:`csRisk.recompute`})}},handleRiskUpdated:n=>{let r=n.metadata?.customer_ids??[],i=bL.getState().isCustomerInScope;
269for(let n of r)TL.cancel(n),e(e=>({recomputing:{...e.recomputing,[n]:!1}})),i(n)&&((t().signalsByCustomer[n]||t().risksByCustomer[n])&&(t().fetchSignals(n),t().fetchRisks(n),t().fetchHistory(n)),bL.getState().refreshCustomer(n))}})),A$e=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/cs/customers/${e}/feedback?${r}`:`/api/v1/cs/customers/${e}/feedback`},j$e=async(e,t,n)=>Z(A$e(e,t),{...n,method:`GET`}),M$e=e=>`/api/v1/cs/customers/${e}/feedback/extract`,N$e=async(e,t)=>Z(M$e(e),{...t,method:`POST`}),P$e=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/cs/feedback/themes?${n}`:`/api/v1/cs/feedback/themes`},F$e=async(e,t)=>Z(P$e(e),{...t,method:`GET`}),I$e=(e,t)=>{let n=new URLSearchParams;Object.entries(t||{}).forEach(([e,t])=>{t!==void 0&&n.append(e,t===null?`null`:t.toString())});let r=n.toString();return r.length>0?`/api/v1/cs/feedback/themes/${e}/items?${r}`:`/api/v1/cs/feedback/themes/${e}/items`},L$e=async(e,t,n)=>Z(I$e(e,t),{...n,method:`GET`}),R$e=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/cs/discovery/suggestions?${n}`:`/api/v1/cs/discovery/suggestions`},z$e=async(e,t)=>Z(R$e(e),{...t,method:`GET`}),B$e=()=>`/api/v1/cs/discovery/dismissals`,V$e=async e=>Z(B$e(),{...e,method:`GET`}),H$e=()=>`/api/v1/cs/discovery/dismissals`,U$e=async(e,t)=>Z(H$e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),W$e=e=>`/api/v1/cs/discovery/dismissals/${e}`,G$e=async(e,t)=>Z(W$e(e),{...t,method:`DELETE`});var OL=e=>H.t(e),kL=SL();const AL=Pb((e,t)=>({itemsByCustomer:{},itemsLoading:{},extracting:{},themes:[],themesLoaded:!1,themesLoading:!1,themeDetail:null,themeDetailLoading:!1,suggestions:[],suggestionsLoading:!1,dismissals:[],eventBodies:{},fetchCustomerFeedback:async t=>{e(e=>({itemsLoading:{...e.itemsLoading,[t]:!0}}));try{let n=await j$e(t);e(e=>({itemsByCustomer:{...e.itemsByCustomer,[t]:n.data}}))}catch(e){Y(e,OL(`customer_success.feedback.toasts.load_failed`),{operation:`csFeedback.fetchCustomerFeedback`})}finally{e(e=>({itemsLoading:{...e.itemsLoading,[t]:!1}}))}},extractFeedback:async n=>{if(!t().extracting[n]){e(e=>({extracting:{...e.extracting,[n]:!0}})),kL.arm(n,()=>e(e=>({extracting:{...e.extracting,[n]:!1}})));try{await N$e(n),G.success(OL(`customer_success.feedback.toasts.extract_queued`))}catch(t){kL.cancel(n),e(e=>({extracting:{...e.extracting,[n]:!1}})),Y(t,OL(`customer_success.feedback.toasts.extract_failed`),{operation:`csFeedback.extractFeedback`})}}},fetchThemes:async()=>{e({themesLoading:!0});try{e({themes:(await F$e()).data,themesLoaded:!0})}catch(e){Y(e,OL(`customer_success.themes.toasts.load_failed`),{operation:`csFeedback.fetchThemes`})}finally{e({themesLoading:!1})}},openTheme:async t=>{e({themeDetail:null,themeDetailLoading:!0});try{e({themeDetail:(await L$e(t)).data})}catch(e){Y(e,OL(`customer_success.themes.toasts.load_failed`),{operation:`csFeedback.openTheme`})}finally{e({themeDetailLoading:!1})}},closeTheme:()=>e({themeDetail:null}),fetchSuggestions:async()=>{e({suggestionsLoading:!0});try{e({suggestions:(await z$e()).data})}catch(e){Y(e,OL(`customer_success.discovery.toasts.load_failed`),{operation:`csFeedback.fetchSuggestions`})}finally{e({suggestionsLoading:!1})}},fetchDismissals:async()=>{try{e({dismissals:(await V$e()).data})}catch(e){X(e,{operation:`csFeedback.fetchDismissals`})}},dismissDomain:async n=>{let r=t().suggestions;e({suggestions:r.filter(e=>e.domain!==n)});try{await U$e({domain:n}),G.success(OL(`customer_success.discovery.toasts.dismissed`)),t().fetchDismissals()}catch(t){e({suggestions:r}),Y(t,OL(`customer_success.discovery.toasts.dismiss_failed`),{operation:`csFeedback.dismissDomain`})}},undismissDomain:async n=>{try{await G$e(n),e(e=>({dismissals:e.dismissals.filter(e=>e.id!==n)})),t().fetchSuggestions()}catch(e){Y(e,OL(`customer_success.discovery.toasts.dismiss_failed`),{operation:`csFeedback.undismissDomain`})}},loadEventBody:async(n,r)=>{let i=t().eventBodies[r];if(!(i&&(i.loading||i.body!==null))){e(e=>({eventBodies:{...e.eventBodies,[r]:{body:null,loading:!0}}}));try{let t=(await wQe(n,r)).data;e(e=>({eventBodies:{...e.eventBodies,[r]:{body:t.body??``,loading:!1}}}))}catch(t){e(e=>({eventBodies:{...e.eventBodies,[r]:{body:null,loading:!1}}})),X(t,{operation:`csFeedback.loadEventBody`})}}},handleFeedbackUpdated:n=>{let r=n.metadata?.customer_ids??[],i=bL.getState().isCustomerInScope,a=!1;
269for(let n of r)kL.cancel(n),e(e=>({extracting:{...e.extracting,[n]:!1}})),i(n)&&(a=!0,t().itemsByCustomer[n]&&t().fetchCustomerFeedback(n));(a||r.length===0)&&t().themesLoaded&&t().fetchThemes()}})),K$e=()=>`/api/v1/cs/icp`,q$e=async e=>Z(K$e(),{...e,method:`GET`}),J$e=()=>`/api/v1/cs/icp`,Y$e=async(e,t)=>Z(J$e(),{...t,method:`PUT`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),X$e=e=>`/api/v1/cs/customers/${e}/icp-verdicts`,Z$e=async(e,t)=>Z(X$e(e),{...t,method:`GET`}),Q$e=e=>`/api/v1/cs/customers/${e}/icp-verdicts/reevaluate`,$$e=async(e,t)=>Z(Q$e(e),{...t,method:`POST`});var jL=SL(),ML=e=>H.t(e),NL=0,e1e=3e3;function t1e(){NL=0}const PL=Pb((e,t)=>({profile:null,loaded:!1,loading:!1,saving:!1,icpConfigured:null,verdictsByCustomer:{},verdictsLoading:{},evaluating:{},fetchIcp:async()=>{e({loading:!0});try{let t=(await q$e()).data;e({profile:t,loaded:!0,icpConfigured:(t.description??null)!==null})}catch(e){Y(e,ML(`customer_success.icp.toasts.load_failed`),{operation:`csIcp.fetchIcp`})}finally{e({loading:!1})}},saveIcp:async n=>{e({saving:!0});try{await Y$e({description:n});let e=n.trim()===``;G.success(ML(e?`customer_success.icp.toasts.cleared`:`customer_success.icp.toasts.saved`)),await t().fetchIcp()}catch(e){Y(e,ML(`customer_success.icp.toasts.save_failed`),{operation:`csIcp.saveIcp`})}finally{e({saving:!1})}},loadVerdicts:async t=>{e(e=>({verdictsLoading:{...e.verdictsLoading,[t]:!0}}));try{let n=(await Z$e(t)).data;e(e=>({verdictsByCustomer:{...e.verdictsByCustomer,[t]:n.verdicts??[]},evaluating:{...e.evaluating,[t]:n.evaluating===!0},icpConfigured:n.icp_configured}))}catch(e){X(e,{operation:`csIcp.loadVerdicts`})}finally{e(e=>({verdictsLoading:{...e.verdictsLoading,[t]:!1}}))}},reevaluateCustomer:async t=>{e(e=>({evaluating:{...e.evaluating,[t]:!0}})),jL.arm(t,()=>e(e=>({evaluating:{...e.evaluating,[t]:!1}})));try{await $$e(t),G.success(ML(`customer_success.icp.toasts.reeval_queued`))}catch(n){jL.cancel(t),e(e=>({evaluating:{...e.evaluating,[t]:!1}})),Y(n,ML(`customer_success.icp.toasts.reeval_failed`),{operation:`csIcp.reevaluateCustomer`})}},handleIcpUpdated:n=>{let r=n.metadata?.customer_ids??[],{selectedId:i,isCustomerInScope:a}=bL.getState();for(let n of r)jL.cancel(n),e(e=>({evaluating:{...e.evaluating,[n]:!1}})),a(n)&&(t().verdictsByCustomer[n]||n===i)&&t().loadVerdicts(n);if(t().loaded&&r.length>0){let e=Date.now();e-NL>e1e&&(NL=e,t().fetchIcp())}}})),FL=Pb((e,t)=>{let n=0,r=0,i=null,a=[],o=null,s=!1,c=()=>{i&&=(clearTimeout(i),null);let e=Math.min(5e3*2**r,6e4);r++,i=setTimeout(()=>{i=null,t().connect()},e)},l=()=>{document.visibilityState===`visible`&&(t().isConnected||(i&&=(clearTimeout(i),null),r=0,t().connect()))},u=()=>{s||(s=!0,document.addEventListener(`visibilitychange`,l),window.addEventListener(`focus`,l),window.addEventListener(`online`,l))},d=()=>{s&&(s=!1,document.removeEventListener(`visibilitychange`,l),window.removeEventListener(`focus`,l),window.removeEventListener(`online`,l))},f=()=>{let t=a;if(a=[],o=null,t.length===0)return;e(e=>({notifications:[...t.slice().reverse(),...e.notifications].slice(0,50),unreadCount:e.unreadCount+t.length}));let n=t.filter(e=>e.type!==`oauth_reauth_required`&&e.type!==`provider_unavailable`&&e.type!==`feedback_reply`);if(n.length===0)return;let r=n[n.length-1];n.length===1?G(r.title,{description:r.message}):G(H.t(`notifications.summary_title`,{count:n.length}),{description:r.title,id:`notification-summary`}),`Notification`in window&&Notification.permission===`granted`&&(n.length===1?new Notification(r.title,{body:r.message}):new Notification(H.t(`notifications.summary_title`,{count:n.length}),{body:r.title}))},p=[],m=()=>{p.forEach(clearTimeout),p=[]},h=()=>{m(),t().checkForNewBuild();for(let e of[15e3,45e3])p.push(setTimeout(()=>void t().checkForNewBuild(),e))};return{notifications:[],unreadCount:0,isConnected:!1,connecting:!1,disconnect:null,buildUpdateAvailable:!1,connect:async()=>{if(u(),t().isConnected||t().connecting)return;i&&=(clearTimeout(i),null),e({connecting:!0});let s=++n;`Notification`in window&&Notification.permission===`default`&&Notification.requestPermission();try{if(await t().loadNotifications(),s!==n)return;t().notifications.some(e=>e.type===`feedback_reply`)&&yL.getState().loadTickets();let i=await VZe(e=>{if(e.type===`frontend_build`){h();return}if(e.type===`evaluation_answer_scored`){qI.getState().applyAnswerEvent(e);return}if((e.type===`evaluation_completed`||e.type===`evaluation_failed`)&&qI.getState().applyEvaluationStatusEvent(e),e.type===`email_task_processing_started`&&Ux.getState().loadTasks(),e.type===`email_task_doc_processed`&&Ux.getState().handleDocProcessed(e),e.type===`email_task_analysis_ready`&&Ux.getState().handleEmailAnalysisReady(e),e.type===`redline_suggestions_batch`){let t=e.metadata??{},n=typeof t.document_id==`string`?t.document_id:null,r=typeof t.batch_id==`string`?t.batch_id:null;if(n&&r){let e=Ex.getState();
269e.documentId===n&&e.appendSuggestionBatch(n,r);let t=Ux.getState();t.selectedDocumentId===n&&xx(n,r).then(e=>t.appendSuggestions(n,e)).catch(e=>X(e,{operation:`notif_redline_batch_email_append`,metadata:{docId:n,batchId:r}}))}}if(e.type===`email_task_draft_ready`&&Ux.getState().handleDraftReady(e),e.type===`email_task_ready`&&Ux.getState().loadTasks(),e.type===`email_task_processing_started`||e.type===`email_task_ready`||e.type===`email_task_draft_ready`){let{selectedTask:e,thread:t,loadThread:n}=Ux.getState();e&&t&&n(e.id);let r=Yx.getState().selectedMatterId;r&&(Yx.getState().loadEmailTasks(r),Yx.getState().loadMatterThreads(r))}if(e.type===`emails_synced`){Ux.getState().loadTasks();let t=Yx.getState();t.fetchMatters();let n=t.selectedMatterId,r=e.metadata?.matter_ids;n&&(!r||r.includes(n))&&(t.loadEmailTasks(n),t.loadMatterThreads(n))}if(e.type===`mailbox_changed`){DS.getState().handleMailboxChanged(e);return}if(!(e.type===`cs_timeline_updated`&&(bL.getState().handleTimelineUpdated(e),!e.metadata?.backfill))&&!(e.type===`cs_roadmap_updated`&&(wL.getState().handleRoadmapUpdated(e),!e.metadata?.persist))&&!(e.type===`cs_risk_updated`&&(DL.getState().handleRiskUpdated(e),!e.metadata?.persist))&&!(e.type===`cs_feedback_updated`&&(AL.getState().handleFeedbackUpdated(e),!e.metadata?.persist))){if(e.type===`cs_summary_updated`){bL.getState().handleSummaryUpdated(e);return}if(e.type===`cs_icp_updated`){PL.getState().handleIcpUpdated(e);return}if(e.type===`calendar_changed`||e.type===`tasks_changed`){NS.getState().handleDashboardChanged();return}if(e.type===`sync_completed`){NS.getState().finishSync(e.metadata);return}if((e.type===`feedback_reply`||e.type===`feedback_status_changed`)&&yL.getState().handleTicketEvent(e),(e.type===`playbook_ready`||e.type===`playbook_failed`)&&ev(()=>import(`./playbookStore-5dQPQdVD.js`),[]).then(e=>e.usePlaybookStore.getState().fetchPlaybooks()),e.type===`resource_shared`){let e=lk.getState();e.fetchSharedWithMe(),e.fetchUnviewedCount()}if(e.type===`provider_unavailable`){let t=e.reference_id;(t===`gmail`||t===`google`)&&Xx.getState().fetchStatus(),G.error(e.title,{description:e.message,action:{label:H.t(`toasts.integrations.gmail_not_provisioned_action`),onClick:()=>{window.location.assign(`/settings/integrations`)}},duration:1e4})}if(e.type===`oauth_reauth_required`){let t=e.reference_id;t===`gmail`||t===`google`?Xx.getState().fetchStatus():t===`outlook`?$x.getState().fetchStatus():t===`slack`?vL.getState().fetchStatus():t===`imap`&&Qx.getState().fetchStatus(),G.error(e.title,{description:e.message,action:{label:H.t(`settings.integrations.reauthorize`),onClick:()=>{window.location.assign(`/settings/integrations`)}},duration:1e4})}a.push(e),o===null&&(o=setTimeout(f,1e3))}},()=>{s===n&&(e({connecting:!1,isConnected:!1,disconnect:null}),c())},()=>{s===n&&(r=0,e({connecting:!1,isConnected:!0}))});if(s!==n){i();return}e({disconnect:i})}catch{if(s!==n)return;e({connecting:!1,isConnected:!1,disconnect:null}),c()}},close:()=>{n++,d(),i&&=(clearTimeout(i),null),r=0,o&&=(clearTimeout(o),null),a=[],m();let s=t().disconnect;e({isConnected:!1,connecting:!1,disconnect:null}),typeof s==`function`&&s()},markAllRead:()=>e({unreadCount:0}),clearNotifications:()=>e({notifications:[],unreadCount:0}),loadNotifications:async()=>{let t=await ege();e(e=>{let n=new Set(t.map(e=>e.id).filter(Boolean)),r=[...e.notifications.filter(e=>!e.id||!n.has(e.id)),...t].slice(0,50);return{notifications:r,unreadCount:r.length}})},dismissNotification:t=>{e(e=>({notifications:e.notifications.filter(e=>e.id!==t),unreadCount:Math.max(0,e.unreadCount-1)})),ige(t)},dismissAll:()=>{e({notifications:[],unreadCount:0}),age()},checkForNewBuild:async()=>{if(!t().buildUpdateAvailable)try{let t=await fetch(`/version.json?t=${Date.now()}`,{cache:`no-store`});if(!t.ok)return;let n=await t.json(),r=typeof n.build_id==`string`?n.build_id:null;r&&r!==`4187687326cc3f82f30376dff5c9753d7622de33`&&e({buildUpdateAvailable:!0})}catch{}},dismissBuildUpdate:()=>e({buildUpdateAvailable:!1})}});function IL({className:e,children:t,...n}){return(0,K.jsxs)(CAe,{"data-slot":`scroll-area`,className:q(`relative`,e),...n,children:[(0,K.jsx)(wAe,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,K.jsx)(n1e,{}),(0,K.jsx)(TAe,{})]})}function n1e({className:e,orientation:t=`vertical`,...n}){return(0,K.jsx)(iAe,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:q(`flex touch-none p-px transition-colors select-none`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent`,e),...n,children:(0,K.jsx)(pAe,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}function r1e(e){return e.type===`credit_limit_reached`||e.reference_type&&e.reference_id!=null?!0:!!e.metadata?.matter_id}function i1e(e){switch(e){case`email_task_draft_ready`:return`response`;
269case`email_task_doc_processed`:return`analysis`;case`email_task_processing_started`:return`analysis`;default:return null}}function a1e(e,t){if(e.type===`credit_limit_reached`)return t(`/settings/usage`),!0;if(!r1e(e))return!1;switch(e.reference_type){case`email_task`:{let n=i1e(e.type);return t(`/email-task${n?`?taskId=${e.reference_id}&tab=${n}`:`?taskId=${e.reference_id}`}`),!0}case`matter`:return t(`/matters/${e.reference_id}`),!0;case`oauth_reauth`:return t(`/settings/integrations`),!0;case`feedback`:return t(`/settings/support?ticket=${e.reference_id}`),!0;default:{let n=e.metadata;return n?.matter_id?(t(`/matters/${n.matter_id}`),!0):!1}}}function o1e(){let{t:e}=V(),{formatDate:t}=jb();return n=>{let r=new Date(n);if(Number.isNaN(r.getTime()))return``;let i=(Date.now()-r.getTime())/1e3;return i<60?e(`chat.today`).toLowerCase():i<3600?`${Math.floor(i/60)}m`:i<86400?`${Math.floor(i/3600)}h`:i<604800?`${Math.floor(i/86400)}d`:t(r,`MMM d`)}}function s1e({notification:e,onDismiss:t,onClick:n,isClickable:r}){let{formatDateTime:i}=jb(),a=o1e(),o=e.created_at?a(e.created_at):``,s=e.created_at?i(e.created_at):void 0;return(0,K.jsxs)(`div`,{className:q(`group flex items-start gap-2 px-3 py-2.5 border-b last:border-b-0 hover:bg-muted/50 transition-colors`,r&&`cursor-pointer`),onClick:n,children:[(0,K.jsxs)(`div`,{className:`flex-1 flex flex-col gap-0.5 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex gap-2 items-center`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium leading-tight`,children:e.title}),o&&(0,K.jsx)(`span`,{title:s,className:`text-xs text-muted-foreground whitespace-nowrap leading-tight`,children:o})]}),(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground leading-snug`,children:e.message})]}),e.id&&t&&(0,K.jsx)(`button`,{onClick:e=>{e.stopPropagation(),t()},className:`shrink-0 p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-muted transition-opacity`,children:(0,K.jsx)(J_,{className:`h-3.5 w-3.5 text-muted-foreground`})})]})}function c1e(){let{t:e}=V(),{notifications:t,unreadCount:n,markAllRead:r,dismissNotification:i,dismissAll:a}=FL(),[o,s]=(0,B.useState)(!1),c=Sv(),l=e=>{s(e),e&&n>0&&r()},u=e=>{a1e(e,c)&&s(!1)};return(0,K.jsxs)(aP,{open:o,onOpenChange:l,children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsxs)(`button`,{className:`relative p-2 hover:bg-muted rounded-md`,children:[(0,K.jsx)(Zae,{className:`h-5 w-5`}),n>0&&(0,K.jsx)(`span`,{className:`absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center`,children:n>9?`9+`:n})]})}),(0,K.jsxs)(sP,{align:`end`,className:`w-80 p-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2.5 border-b`,children:[(0,K.jsx)(`span`,{className:`text-sm font-semibold`,children:e(`notifications.title`)}),t.length>0&&(0,K.jsx)(`button`,{onClick:()=>a(),className:`text-xs text-muted-foreground hover:text-foreground transition-colors`,children:e(`notifications.clear_all`)})]}),t.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-muted-foreground`,children:[(0,K.jsx)(l_,{className:`h-8 w-8 mb-2`}),(0,K.jsx)(`span`,{className:`text-sm`,children:e(`notifications.no_notifications`)})]}):(0,K.jsx)(IL,{className:`h-72`,children:t.map((e,t)=>(0,K.jsx)(s1e,{notification:e,onDismiss:e.id?()=>i(e.id):void 0,onClick:()=>u(e),isClickable:r1e(e)},e.id??t))})]})]})}function l1e(){let{t:e}=V(),t=xv(),n=eL(),r=XT(e=>e.status),i=XT(e=>e.mode),a=XT(e=>e.showSceneHelp),o=XT(e=>e.closeHelp);if(n||r===`active`&&i===`full`)return null;let s=JT(t.pathname);if(!s)return null;let c=r===`active`&&i===`single`;return(0,K.jsx)(`button`,{type:`button`,"aria-label":e(c?`tour.help_close_aria`:`tour.help_aria`),"aria-pressed":c,onClick:()=>c?o():a(s.id),className:q(`relative p-2 hover:bg-muted rounded-md`,c&&`bg-muted text-primary`),children:(0,K.jsx)(Wg,{className:`h-5 w-5`})})}const LL=[{key:`legal`,label:`Contracts`,Icon:i_},{key:`finance`,label:`Finance`,Icon:hoe},{key:`other`,label:`Other`,Icon:l_},{key:`irrelevant`,label:`Irrelevant`,Icon:Xae}];new Set(LL.map(e=>e.key));const u1e=z_;
269function d1e(e){return e.split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function f1e(e,t=[]){let n=LL.find(t=>t.key===e);if(n)return n.label;let r=t.find(t=>t.key===e);return r?r.name:d1e(e)}function p1e(e){let t=LL.find(t=>t.key===e);return t?t.Icon:u1e}const m1e=()=>`/api/v1/email-categories`,h1e=async e=>Z(m1e(),{...e,method:`GET`}),g1e=()=>`/api/v1/email-categories`,_1e=async(e,t)=>Z(g1e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),v1e=e=>`/api/v1/email-categories/${e}`,y1e=async(e,t,n)=>Z(v1e(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),b1e=e=>`/api/v1/email-categories/${e}`,x1e=async(e,t)=>Z(b1e(e),{...t,method:`DELETE`}),RL=Pb((e,t)=>({categories:[],isLoading:!1,fetchCategories:async()=>{e({isLoading:!0});try{e({categories:(await h1e()).data,isLoading:!1})}catch(t){X(t,{operation:`fetch_email_categories`}),e({isLoading:!1})}},createCategory:async t=>{let n=(await _1e(t)).data;return e(e=>({categories:[...e.categories,n]})),n},updateCategory:async(t,n)=>{let r=(await y1e(t,n)).data;e(e=>({categories:e.categories.map(e=>e.id===t?r:e)}))},deleteCategory:async t=>{await x1e(t),e(e=>({categories:e.categories.filter(e=>e.id!==t)}))},allCategoryOptions:()=>[...LL.map(e=>e.key),...t().categories.map(e=>e.key)]}));var S1e=[`documents`,`email_tasks`,`conversations`,`evaluations`,`redline_suggestions`,`knowledge_bases`,`calendar_events`,`finance_documents`],zL={everything:[`documents`,`conversations`,`email_tasks`,`calendar_events`,`tasks`,`prompts`,`knowledge_bases`,`org_profiles`,`playbooks`,`evaluations`,`matters`],matters:[`matters`],inbox:[`email_tasks`],calendar:[`calendar_events`],documents:[`documents`,`knowledge_bases`],vault:[`prompts`,`playbooks`,`evaluations`,`org_profiles`]},BL={everything:L_,matters:o_,inbox:l_,calendar:Fg,documents:i_,vault:Koe},VL=[{key:`all`,labelKey:`everything_search.facets.all`,types:S1e},{key:`email_tasks`,labelKey:`matters.tabs.legal`,types:[`email_tasks`]},{key:`documents`,labelKey:`matters.tabs.documents`,types:[`documents`]},{key:`conversations`,labelKey:`matters.tabs.conversations`,types:[`conversations`]},{key:`evaluations`,labelKey:`matters.tabs.evaluations`,types:[`evaluations`]},{key:`redline_suggestions`,labelKey:`matters.tabs.redlines`,types:[`redline_suggestions`]},{key:`knowledge_bases`,labelKey:`matters.tabs.knowledge_bases`,types:[`knowledge_bases`]},{key:`calendar_events`,labelKey:`matters.tabs.calendar`,types:[`calendar_events`]},{key:`finance_documents`,labelKey:`matters.tabs.finance`,types:[`finance_documents`]}],C1e=250;function w1e(e){return e.includes(`<mark>`)?e.split(/<mark>(.*?)<\/mark>/g).map((e,t)=>t%2==1?(0,K.jsx)(`mark`,{className:`rounded bg-yellow-200/60 px-0.5 dark:bg-yellow-500/30`,children:e},t):(0,K.jsx)(`span`,{children:e},t)):e}function T1e(){let{t:e}=V(),t=Sv(),n=Q(e=>e.everythingSearchOpen),r=Q(e=>e.setEverythingSearchOpen),i=Q(e=>e.setDocumentLink),a=Q(e=>e.setShowDocViewer),o=Q(e=>e.setDocViewerTarget),s=Q(e=>e.setDocViewerFromSearch),c=Q(e=>e.docViewerFromSearch),l=Q(e=>e.openItemDetail),u=Q(e=>e.itemDetail),d=LS(e=>e.loadConversation),f=LS(e=>e.loadConversations),p=RL(e=>e.categories),m=RL(e=>e.fetchCategories),[h,g]=(0,B.useState)(``),[_,v]=(0,B.useState)(null),[y,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(new Set),[C,w]=(0,B.useState)(null),[T,E]=(0,B.useState)(null),[D,O]=(0,B.useState)(`all`),[k,A]=(0,B.useState)(null),j=(0,B.useRef)(null),M=(0,B.useRef)(null),N=(0,B.useRef)(!1),[P,F]=(0,B.useState)(`results`),[I,L]=(0,B.useState)(``),[ee,R]=(0,B.useState)([]),[te,ne]=(0,B.useState)(null),[re,ie]=(0,B.useState)(null),[z,ae]=(0,B.useState)(!1),[oe,se]=(0,B.useState)(!1),[ce,le]=(0,B.useState)(null),ue=(0,B.useRef)(null),de=(0,B.useCallback)(()=>{L(``),R([]),ne(null),ie(null),ae(!1),se(!1),le(null)},[]),fe=(0,B.useMemo)(()=>[{key:`matters`,heading:e(`everything_search.matters`),icon:o_},{key:`documents`,heading:e(`everything_search.documents`),icon:i_},{key:`conversations`,heading:e(`chat.history`),icon:b_},{key:`email_tasks`,heading:e(`mail.title`),icon:__},{key:`calendar_events`,heading:e(`dashboard.calendar`),icon:Fg},{key:`tasks`,heading:e(`dashboard.tasks`),icon:h_},{key:`prompts`,heading:e(`prompts.title`),icon:Y_},{key:`knowledge_bases`,heading:e(`knowledge_bases.title`),icon:Ag},{key:`org_profiles`,heading:e(`personas.personas`),icon:k_},{key:`playbooks`,heading:e(`playbook.title`),icon:loe},{key:`evaluations`,heading:e(`evaluation.title`),icon:yse},{key:`redline_suggestions`,heading:e(`matters.tabs.redlines`),icon:bse},{key:`finance_documents`,heading:e(`matters.tabs.finance`),icon:dse}],[e]),pe=(0,B.useMemo)(()=>({everything:{label:e(`everything_search.scopes.everything_label`),icon:BL.everything,description:e(`everything_search.scopes.everything_description`),resource_types:zL.everything},matters:{label:e(`everything_search.matters`),icon:BL.matters,description:e(`everything_search.scopes.matters_description`),resource_types:zL.matters},inbox:{label:e(`dashboard.inbox`),icon:BL.inbox,description:e(`everything_search.scopes.inbox_description`),resource_types:zL.inbox},calendar:{label:e(`dashboard.calendar`),icon:BL.calendar,description:e(`everything_search.scopes.calendar_description`),resource_types:zL.calendar},documents:{label:e(`everything_search.documents`),icon:BL.documents,description:e(`everything_search.scopes.documents_description`),resource_types:zL.documents},vault:{label:e(`vault.title`),icon:BL.vault,description:e(`everything_search.scopes.vault_description`),resource_types:zL.vault}}),[e]),me=(0,B.useMemo)(()=>[...LL.filter(e=>e.key!==`irrelevant`).map(e=>({key:e.key,label:e.label})),...p.map(e=>({key:e.key,label:e.name}))],[p]),[he,ge]=(0,B.useState)(n);he!==n&&(ge(n),!n&&!c&&!u?.fromSearch&&(g(``),v(null),b(!1),S(new Set),w(null),E(null),O(`all`),A(null),F(`results`),de())),(0,B.useEffect)(()=>{n||(j.current?.abort(),ue.current?.abort(),ue.current=null,M.current&&=(window.clearTimeout(
269M.current),null))},[n]),(0,B.useEffect)(()=>{!T||N.current||(N.current=!0,m())},[T,m]);let _e=h.trim(),ve=P===`results`&&!!_e&&(!!C||!!T),[ye,be]=(0,B.useState)(ve);ye!==ve&&(be(ve),ve||(v(null),b(!1),S(new Set)));let xe=T?.id??null;(0,B.useEffect)(()=>{if(ve)return M.current&&window.clearTimeout(M.current),j.current?.abort(),M.current=window.setTimeout(()=>{let e=new AbortController;j.current=e,b(!0);let t={onStart:t=>{e.signal.aborted||(v({query:t.query,results_by_type:{},total:0}),S(new Set(t.active_types)))},onResult:t=>{e.signal.aborted||(v(e=>{let n=e??{query:_e,results_by_type:{},total:0};return{...n,results_by_type:{...n.results_by_type,[t.resource_type]:t.items},total:n.total+t.items.length}}),S(e=>{if(!e.has(t.resource_type))return e;let n=new Set(e);return n.delete(t.resource_type),n}))},onDone:()=>{e.signal.aborted||(b(!1),S(new Set))},onError:t=>{e.signal.aborted||(console.error(`everything-search stream error:`,t),b(!1),S(new Set))}},n=e=>{e.name!==`AbortError`&&console.error(`everything-search stream failed:`,e)};xe?Xhe(xe,{query:_e,limit_per_type:5,resource_types:(VL.find(e=>e.key===D)??VL[0]).types,category:D===`email_tasks`?k??void 0:void 0},t,e.signal).catch(n):C&&Yhe({query:_e,limit_per_type:5,resource_types:zL[C]},t,e.signal).catch(n)},C1e),()=>{M.current&&window.clearTimeout(M.current)}},[_e,C,xe,D,k,ve]);let Se=(0,B.useCallback)((e,t)=>{E({id:e,name:t}),O(`all`),A(null),v(null),S(new Set),b(!0)},[]),Ce=(0,B.useCallback)(()=>{E(null),O(`all`),A(null)},[]),we=(0,B.useCallback)(e=>{e!==P&&(ue.current?.abort(),ue.current=null,de(),F(e))},[P,de]),Te=(0,B.useCallback)(()=>{let t=h.trim();if(!t||z)return;ue.current?.abort();let n=new AbortController;ue.current=n,se(!0),le(null),L(``),R([]),ie(null),ae(!0);let r=C?zL[C]:void 0;Uhe({query:t,conversation_id:te??void 0,resource_types:r},{onStart:e=>{n.signal.aborted||(ne(e.conversation_id),ie(e.message_id))},onDelta:e=>{n.signal.aborted||L(t=>t+e)},onToolCall:e=>{n.signal.aborted||R(t=>[...t,{id:e.id,name:e.name,input:e.input,status:`pending`}])},onToolResult:e=>{n.signal.aborted||R(t=>t.map(t=>t.id===e.id?{...t,result:e.result,status:`done`}:t))},onDone:()=>{n.signal.aborted||ae(!1)},onError:t=>{n.signal.aborted||(ae(!1),t.startsWith(`usage_limit:`)||le(e(`everything_search.chat.error`)))},onInterrupted:()=>{n.signal.aborted||(ae(!1),le(e(`everything_search.chat.error`)))}},n.signal).catch(t=>{t.name!==`AbortError`&&(ae(!1),le(Gb(t,e(`everything_search.chat.error`),{operation:`search_chat_stream`})))})},[h,z,C,te,e]),Ee=(0,B.useCallback)(async()=>{let n=te;if(n)try{await Whe(n),await d(n),t(`/chat/${n}`),r(!1),f()}catch(t){Y(t,e(`everything_search.chat.open_failed`),{operation:`search_chat_open_in_chat`,metadata:{conversationId:n}})}},[te,d,f,t,r,e]),De=(0,B.useCallback)(async n=>{if(n.type===`matters`){Se(n.id,n.title);return}switch(r(!1),n.type){case`documents`:i(null),s(!0),a(!0),o(n.id,n.title);try{i((await ex(n.id)).data.download_url.replace(`http://minio:9000`,`/minio-proxy`))}catch(t){Y(t,e(`errors.preview_failed`),{operation:`everything_search_open_document`,metadata:{documentId:n.id}}),a(!1),o(null)}return;case`conversations`:await d(n.id),t(`/chat/${n.id}`);return;case`email_tasks`:{if(T){t(`/email-task?taskId=${n.id}`);return}let e=n.metadata?.provider;if(tS(e)){DS.getState().setProvider(e),t(`/inbox/inbox/${encodeURIComponent(n.id)}`);return}l(VI(n));return}case`calendar_events`:case`tasks`:l(VI(n));return;case`prompts`:t(`/vault/prompts?id=${encodeURIComponent(n.id)}`);return;case`knowledge_bases`:{let{expandedKBs:e,toggleExpandKB:r}=Q.getState();e.has(n.id)||r(n.id),t(`/vault/library`);return}case`org_profiles`:t(`/vault/personas?id=${encodeURIComponent(n.id)}`);return;case`playbooks`:await JI.getState().selectPlaybook(n.id),t(`/vault/playbooks`);return;case`evaluations`:await qI.getState().selectEvaluation(n.id),t(`/vault/evaluations`);return;
269case`redline_suggestions`:T&&t(`/matters/${T.id}/resources/redlines`);return;case`finance_documents`:T&&t(`/matters/${T.id}/finance`);return}},[r,i,a,o,s,d,t,e,T,Se,l]),Oe=(0,B.useCallback)(e=>{r(!1),t(`/matters/${e}`)},[r,t]),ke=_&&Object.values(_.results_by_type).some(e=>e.length>0),Ae=y&&(!_||Object.keys(_.results_by_type).length===0),je=!!C||!!T,Me=P===`chat`&&!T;return(0,K.jsxs)(HC,{open:n,onOpenChange:r,children:[(0,K.jsxs)(GC,{className:`sr-only`,children:[(0,K.jsx)(qC,{children:e(`everything_search.placeholder`)}),(0,K.jsx)(JC,{children:e(`everything_search.placeholder`)})]}),(0,K.jsx)(WC,{className:`max-w-3xl overflow-hidden p-0 sm:max-w-4xl`,onEscapeKeyDown:e=>{if(T&&(D!==`all`||k!==null)){e.preventDefault(),O(`all`),A(null);return}if(T){e.preventDefault(),Ce();return}C&&(e.preventDefault(),w(null))},children:(0,K.jsxs)(XO,{shouldFilter:!1,children:[(0,K.jsx)(ZO,{placeholder:e(Me?`everything_search.chat.placeholder`:`everything_search.placeholder`),value:h,onValueChange:g,onKeyDown:e=>{Me&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),Te())}}),!T&&(0,K.jsx)(`div`,{className:`flex items-center gap-1.5 border-b px-3 py-2`,children:[`results`,`chat`].map(t=>(0,K.jsx)(`button`,{onClick:()=>we(t),className:q(`rounded-full border px-2.5 py-0.5 text-xs transition-colors`,P===t?`border-primary bg-primary text-primary-foreground`:`bg-muted/40 hover:bg-muted`),children:e(t===`results`?`everything_search.chat.mode_results`:`everything_search.chat.mode_chat`)},t))}),T?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 border-b px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`common.search`)}),(0,K.jsxs)(`button`,{onClick:Ce,className:`inline-flex items-center gap-1.5 rounded-full border bg-muted/50 px-2 py-0.5 text-xs hover:bg-muted`,children:[(0,K.jsx)(o_,{className:`size-3`}),(0,K.jsx)(`span`,{className:`font-medium`,children:T.name}),(0,K.jsx)(J_,{className:`size-3 opacity-60`})]})]}),(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:VL.map(t=>(0,K.jsx)(`button`,{onClick:()=>{O(t.key),t.key!==`email_tasks`&&A(null)},className:q(`rounded-full border px-2 py-0.5 text-xs transition-colors`,D===t.key?`border-primary bg-primary text-primary-foreground`:`bg-muted/40 hover:bg-muted`),children:e(t.labelKey)},t.key))}),D===`email_tasks`&&(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 pl-1`,children:[(0,K.jsx)(`button`,{onClick:()=>A(null),className:q(`rounded-full border px-2 py-0.5 text-[11px] transition-colors`,k===null?`border-primary bg-primary/10 text-primary`:`bg-muted/30 hover:bg-muted`),children:e(`everything_search.all_categories`)}),me.map(e=>(0,K.jsx)(`button`,{onClick:()=>A(e.key),className:q(`rounded-full border px-2 py-0.5 text-[11px] transition-colors`,k===e.key?`border-primary bg-primary/10 text-primary`:`bg-muted/30 hover:bg-muted`),children:e.label},e.key))]})]}):C&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`common.search`)}),(0,K.jsxs)(`button`,{onClick:()=>w(null),className:`inline-flex items-center gap-1.5 rounded-full border bg-muted/50 px-2 py-0.5 text-xs hover:bg-muted`,children:[(()=>{let e=pe[C].icon;return(0,K.jsx)(e,{className:`size-3`})})(),(0,K.jsx)(`span`,{className:`font-medium`,children:pe[C].label}),(0,K.jsx)(J_,{className:`size-3 opacity-60`})]})]}),(0,K.jsx)(QO,{className:`max-h-[70vh]`,children:Me?(0,K.jsx)(k1e,{submitted:oe,streaming:z,answer:I,toolActivities:ee,conversationId:te,messageId:re,error:ce,onOpenInChat:Ee}):(0,K.jsxs)(K.Fragment,{children:[!_e&&(0,K.jsx)(`div`,{className:`py-6 text-center text-sm text-muted-foreground`,children:e(`common.search_placeholder`)}),_e&&!C&&!T&&(0,K.jsx)(E1e,{scopes:pe,query:_e,onPick:w}),_e&&je&&Ae?(0,K.jsx)($O,{children:e(`common.loading`)}):_e&&je&&!y&&!ke?(0,K.jsx)($O,{children:e(`everything_search.no_results`)}):null,_&&fe.map(({key:t,heading:n,icon:r})=>{let i=_.results_by_type[t]??[];return i.length===0?x.has(t)?(0,K.jsx)(ek,{heading:n,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5`,children:[(0,K.jsx)(r,{className:`size-4 shrink-0 opacity-30`}),(0,K.jsx)(`div`,{className:`h-3 flex-1 animate-pulse rounded bg-muted/60`})]})},t):null:(0,K.jsx)(ek,{heading:n,children:i.map(t=>(0,K.jsxs)(nk,{value:`${t.type}:${t.id}:${t.title}`,onSelect:()=>De(t),className:`flex items-start gap-2`,children:[(0,K.jsx)(r,{className:`mt-0.5 size-4 shrink-0 opacity-70`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate font-medium`,children:t.title}),typeof t.score==`number`&&(0,K.jsx)(`span`,{className:`shrink-0 rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:t.score.toFixed(2)})]}),t.preview&&(0,K.jsx)(`div`,{className:`mt-0.5 line-clamp-1 text-xs text-muted-foreground`,children:w1e(t.preview)})]}),t.type===`matters`&&(0,K.jsx)(`button`,{onClick:e=>{e.stopPropagation(),Oe(t.id)},onPointerDown:e=>e.stopPropagation(),className:`shrink-0 rounded border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted`,children:e(`everything_search.open_matter`)})]},`${t.type}:${t.id}`))},t)})]})})]})})]})}function E1e({scopes:e,query:t,onPick:n}){return(0,K.jsxs)(`div`,{className:`animate-in fade-in slide-in-from-top-1 px-2 py-3 duration-150`,children:[(0,K.jsx)(`div`,{className:`px-2 pb-2 text-xs text-muted-foreground`,children:(0,K.jsxs)(`span`,{className:`font-medium italic text-foreground`,children:[`"`,t,`"`]})}),(0,K.jsx)(ek,{children:Object.entries(e).map(([e,{label:t,icon:r,description:i}])=>(0,K.jsxs)(nk,{value:`scope:${e}`,onSelect:()=>n(e),className:`flex items-start gap-3 py-2.5`,children:[(0,K.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md border bg-muted/40`,children:(0,K.jsx)(r,{className:`size-4 opacity-80`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`font-medium`,children:t}),(0,K.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:i})]})]},e))})]})}function D1e(e){if(!e.result)return``;if(e.result.is_error)return`Error`;let t=e.result.content.split(` 270`).find(e=>e.trim().length>0)??``;return t.length>70?t.slice(0,67)+`â¦`:t}function O1e({activity:e}){let t=String(e.input.query??``).trim(),n=t?`Searching â${t}
270â`:`Searching your workspace`,r=e.status===`pending`;return(0,K.jsxs)(`div`,{className:`flex items-start gap-1.5 text-xs`,children:[r?(0,K.jsx)(W,{className:`mt-0.5 size-3 shrink-0 animate-spin text-muted-foreground`}):e.result?.is_error?(0,K.jsx)(Gg,{className:`mt-0.5 size-3 shrink-0 text-destructive`}):(0,K.jsx)(Ug,{className:`mt-0.5 size-3 shrink-0 text-green-500`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:n}),!r&&e.result&&(0,K.jsx)(`p`,{className:`truncate text-muted-foreground/80`,children:D1e(e)})]})]})}function k1e({submitted:e,streaming:t,answer:n,toolActivities:r,conversationId:i,messageId:a,error:o,onOpenInChat:s}){let{t:c}=V();return e?(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-4`,children:[r.length>0&&(0,K.jsx)(`div`,{className:`flex flex-col gap-1.5 rounded-md border bg-muted/30 p-2.5`,children:r.map(e=>(0,K.jsx)(O1e,{activity:e},e.id))}),t&&!n&&!o&&(0,K.jsx)(RI,{size:`sm`,icon:A_,label:c(`everything_search.chat.searching`)}),n&&(0,K.jsxs)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none text-foreground`,children:[(0,K.jsx)(_I,{remarkPlugins:[NI],components:YI,children:n}),t&&(0,K.jsx)(`span`,{className:`ml-0.5 inline-block h-4 w-2 animate-pulse bg-current align-middle`})]}),o&&!t&&(0,K.jsx)(`div`,{className:`text-sm text-destructive`,children:o}),i&&!t&&(n||o)&&(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-1 border-t pt-3`,children:[a&&(0,K.jsx)(mO,{subject:{type:`chat_message`,id:a,label:c(`report_issue.chat_reply`)}}),(0,K.jsxs)(`button`,{onClick:s,className:`inline-flex items-center gap-1.5 rounded-md border bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:[(0,K.jsx)(b_,{className:`size-3.5`}),c(`everything_search.chat.open_in_chat`),(0,K.jsx)(Jae,{className:`size-3.5`})]})]})]}):(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-10 text-center text-sm text-muted-foreground`,children:[(0,K.jsx)(A_,{className:`size-5 opacity-50`}),(0,K.jsx)(`span`,{children:c(`everything_search.chat.hint`)})]})}const HL={user:0,analytics:1,dev_analytics:2};function A1e(e){return e===`admin`?HL.dev_analytics:e&&e in HL?HL[e]:0}function UL(e,t){return A1e(e)>=HL[t]}const j1e=[{key:`models`,label:`Models`,minRole:`dev_analytics`},{key:`features`,label:`Features`,minRole:`dev_analytics`},{key:`classification`,label:`Classification`,minRole:`analytics`},{key:`users`,label:`Users`,minRole:`analytics`},{key:`usage`,label:`Usage & billing`,minRole:`analytics`},{key:`retention`,label:`Retention`,minRole:`analytics`},{key:`benchmark`,label:`Benchmark`,minRole:`analytics`},{key:`feature-costs`,label:`Feature usage`,minRole:`dev_analytics`},{key:`ops`,label:`Ops health`,minRole:`analytics`},{key:`metrics`,label:`System metrics`,minRole:`analytics`},{key:`feedback`,label:`Support`,minRole:`analytics`},{key:`onboarding`,label:`Onboarding`,minRole:`analytics`}];function M1e(e){return j1e.filter(t=>UL(e,t.minRole))}function N1e(e){return UL(e,`analytics`)}function P1e(e){return M1e(e)[0]?.key??null}function F1e(){return Nx(e=>e.user?.account_type)}function I1e(){let{t:e}=V(),t=FL(e=>e.buildUpdateAvailable),n=FL(e=>e.dismissBuildUpdate);return t?(0,K.jsxs)(`div`,{className:`flex items-center justify-center gap-5 border rounded-sm border-primary/20 bg-orange-500/50 text-sm text-foreground`,children:[(0,K.jsx)(E_,{className:`w-4 h-4 ml-2 shrink-0 text-primary`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`whitespace-nowrap`,children:e(`notifications.update_banner.message`)}),(0,K.jsx)(J,{type:`button`,size:`xs`,onClick:()=>window.location.reload(),children:e(`notifications.update_banner.refresh`)}),(0,K.jsx)(`button`,{type:`button`,"aria-label":e(`common.dismiss`),onClick:n,className:`rounded p-1 text-muted-foreground transition-colors hover:text-foreground`,children:(0,K.jsx)(J_,{className:`font-extrabold text-neutral-900 w-5 mr-2`})})]}):null}function L1e(){let e=Sv();return N1e(Nx(e=>e.user)?.account_type)?(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`size-8`,title:`Console`,onClick:()=>e(`/console`),children:(0,K.jsx)(I_,{className:`size-4`})}):null}function R1e(){let{t:e}=V(),t=Xx(e=>e.connected),n=$x(e=>e.connected),r=NS(e=>e.syncing),i=NS(e=>e.startSync);return!t&&!n?null:(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`size-8`,title:e(`topbar.sync.button`),disabled:r,onClick:i,children:(0,K.jsx)(E_,{className:q(`size-4`,r&&`animate-spin`)})})}function z1e(){let{t:e}=V(),t=xv(),n=Q(e=>e.toggleEverythingSearch);return(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 py-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4 w-full`,children:[NZe(t.pathname)&&(0,K.jsx)(EZe,{}),(0,K.jsx)($T,{i18nKey:`tour.dashboard.search`,side:`right`,children:(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:n,className:`relative h-8 w-full max-w-xs justify-start pr-12 text-sm font-normal text-muted-foreground`,children:[(0,K.jsx)(A_,{className:`mr-2 size-4`}),e(`everything_search.placeholder`),(0,K.jsxs)(`kbd`,{className:`pointer-events-none absolute right-1.5 top-1/2 -translate-y-1/2 inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100`,children:[(0,K.jsx)(`span`,{className:`text-xs`,children:`â`}),`K`]})]})}),(0,K.jsx)(I1e,{})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(zZe,{}),(0,K.jsx)(R1e,{}),(0,K.jsx)(L1e,{}),(0,K.jsx)(l1e,{}),(0,K.jsx)($T,{i18nKey:`tour.dashboard.notifications`,side:`bottom`,children:(0,K.jsx)(`div`,{children:(0,K.jsx)(c1e,{})})})]}),(0,K.jsx)(T1e,{})]})}var B1e=z1e;function V1e(){let e=Sv(),t=yL(e=>e.tickets),n=yL(e=>e.dismissedReplyBanners),r=yL(e=>e.dismissReplyBanner),i=(0,B.useMemo)(()=>t.filter(e=>tQe(e)&&!nQe(n,e)),[t,n]);return i.length===0?null:(0,K.jsx)(`div`,{className:`flex flex-col gap-1 px-2 pt-2`,children:i.map(t=>(0,K.jsx)(H1e,{ticket:t,onView:()=>e(`/settings/support?ticket=${t.id}`),onDismiss:()=>r(t.id)},t.id))})}function H1e({ticket:e,onView:t,onDismiss:n}){let{t:r}=V(),i=e.feedback_content?.trim().split(` 271`)[0]??``;return(0,K.jsxs)(`div`,{className:`flex items-center gap-3 rounded-sm border border-primary/20 bg-orange-500/50 px-2 py-1.5 text-sm text-foreground`,children:[(0,K.jsx)(b_,{className:`w-4 h-4 shrink-0 text-primary`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`whitespace-nowrap font-medium`,children:r(`notifications.support_reply_banner.title`)}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:i}),(0,K.jsx)(J,{type:`button`,size:`xs`,className:`shrink-0`,onClick:t,children:r(`notifications.support_reply_banner.view`)}),(0,K.jsx)(`button`,{type:`button`,"aria-label":r(`common.dismiss`),onClick:n,className:`rounded p-1 text-muted-foreground transition-colors hover:text-foreground`,children:(0,K.jsx)(J_,{className:`w-5 font-extrabold text-neutral-900`})})]})}var U1e={google:!0,outlook:!0,slack:!0,imap:!0,caldav:!0},W1e={customer_success:!1};const WL=Pb(e=>({integrations:U1e,features:W1e,recorderWindowsDownloadUrl:null,recorderMacDownloadUrl:null,loaded:!1,fetchConfig:async()=>{try{let t=await Z(`/api/v1/config`,{method:`GET`});e({integrations:{...U1e,...t.data.integrations},features:{...W1e,...t.data.features},recorderWindowsDownloadUrl:t.data.recorder_windows_download_url??null,recorderMacDownloadUrl:t.data.recorder_mac_download_url??null,loaded:!0})}catch(t){X(t,{operation:`fetch_app_config`}),e({loaded:!0})}}})),G1e=()=>
271`/api/v1/me/organizations`,K1e=async e=>Z(G1e(),{...e,method:`GET`}),q1e=()=>`/api/v1/me/active-org`,J1e=async(e,t)=>Z(q1e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),Y1e=()=>`/api/v1/organizations`,X1e=async(e,t)=>Z(Y1e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),Z1e=e=>`/api/v1/organizations/${e}`,Q1e=async(e,t,n)=>Z(Z1e(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),$1e=e=>`/api/v1/organizations/${e}`,e0e=async(e,t)=>Z($1e(e),{...t,method:`DELETE`}),t0e=e=>`/api/v1/organizations/${e}/members`,n0e=async(e,t)=>Z(t0e(e),{...t,method:`GET`}),r0e=(e,t)=>`/api/v1/organizations/${e}/members/${t}`,i0e=async(e,t,n,r)=>Z(r0e(e,t),{...r,method:`PATCH`,headers:{"Content-Type":`application/json`,...r?.headers},body:JSON.stringify(n)}),a0e=(e,t)=>`/api/v1/organizations/${e}/members/${t}`,o0e=async(e,t,n)=>Z(a0e(e,t),{...n,method:`DELETE`}),s0e=e=>`/api/v1/organizations/${e}/invites`,c0e=async(e,t,n)=>Z(s0e(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),l0e=e=>`/api/v1/organizations/${e}/invites`,u0e=async(e,t)=>Z(l0e(e),{...t,method:`GET`}),d0e=(e,t)=>`/api/v1/organizations/${e}/invites/${t}`,f0e=async(e,t,n)=>Z(d0e(e,t),{...n,method:`DELETE`}),p0e=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/invites/preview?${n}`:`/api/v1/invites/preview`},m0e=async(e,t)=>Z(p0e(e),{...t,method:`GET`}),h0e=()=>`/api/v1/invites/accept`,g0e=async(e,t)=>Z(h0e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),GL=Pb((e,t)=>({organizations:[],members:{},pendingInvites:{},isLoadingOrgs:!1,isLoadingMembers:!1,isLoadingInvites:!1,fetchMyOrganizations:async()=>{e({isLoadingOrgs:!0});try{e({organizations:(await K1e()).data,isLoadingOrgs:!1})}catch(t){X(t,{operation:`fetch_my_organizations`}),e({isLoadingOrgs:!1})}},fetchMembers:async t=>{e({isLoadingMembers:!0});try{let n=await n0e(t);e(e=>({members:{...e.members,[t]:n.data},isLoadingMembers:!1}))}catch(t){X(t,{operation:`fetch_org_members`}),e({isLoadingMembers:!1})}},fetchPendingInvites:async t=>{e({isLoadingInvites:!0});try{let n=await u0e(t);e(e=>({pendingInvites:{...e.pendingInvites,[t]:n.data},isLoadingInvites:!1}))}catch(t){X(t,{operation:`fetch_pending_invites`}),e({isLoadingInvites:!1})}},inviteMember:async(t,n,r)=>{let i=(await c0e(t,{email:n,role:r})).data;e(e=>({pendingInvites:{...e.pendingInvites,[t]:[...e.pendingInvites[t]??[],i]}}))},removeMember:async(t,n)=>{await o0e(t,n),e(e=>({members:{...e.members,[t]:(e.members[t]??[]).filter(e=>e.user_id!==n)}}))},changeRole:async(t,n,r)=>{let i=(await i0e(t,n,{role:r})).data;e(e=>({members:{...e.members,[t]:(e.members[t]??[]).map(e=>e.user_id===n?i:e)}}))},revokeInvite:async(t,n)=>{await f0e(t,n),e(e=>({pendingInvites:{...e.pendingInvites,[t]:(e.pendingInvites[t]??[]).filter(e=>e.id!==n)}}))},acceptInvite:async e=>{let n=(await g0e({token:e})).data;return await t().fetchMyOrganizations(),n},createOrganization:async e=>{let n=(await X1e({name:e})).data;return await t().fetchMyOrganizations(),n},renameOrganization:async(e,n)=>{try{await Q1e(e,{name:n})}catch(e){throw Y(e,`Failed to rename organization`,{operation:`rename_organization`}),e}await t().fetchMyOrganizations()},deleteOrganization:async e=>{try{await e0e(e)}catch(e){throw Y(e,`Failed to delete organization`,{operation:`delete_organization`}),e}await t().fetchMyOrganizations()},switchActiveOrg:async e=>{zpe();let t=(await J1e({org_id:e})).data;await Nx.getState().setToken(t.access_token,t.expires_in)},clearAll:()=>e({organizations:[],members:{},pendingInvites:{}})}));function KL({className:e,size:t=`default`,...n}){return(0,K.jsx)(BTe,{"data-slot":`avatar`,"data-size":t,className:q(`group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6`,e),...n})}function _0e({className:e,...t}){return(0,K.jsx)(VTe,{"data-slot":`avatar-image`,className:q(`aspect-square size-full`,e),...t})}function qL({className:e,...t}){return(0,K.jsx)(HTe,{"data-slot":`avatar-fallback`,className:q(`bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs`,e),...t})}const v0e={all:`All`,gmail:`Gmail`,outlook:`Outlook`,imap:`IMAP`,slack:`Slack`},JL=5e3;var y0e=120*1e3,b0e=6e4,x0e=20,S0e=20,C0e=5,YL=null,XL=null,ZL=0;function QL(){let e=[],t=Xx.getState();return t.connected&&!t.notAvailable&&e.push(`gmail`),$x.getState().connected&&e.push(`outlook`),Qx.getState().connected&&e.push(`imap`),vL.getState().connected&&e.push(`
271slack`),e}function $L(e){return[...e].sort((e,t)=>new Date(t.received_at).getTime()-new Date(e.received_at).getTime())}async function eR(e,t){let n=e.map(async e=>{let n=t.pageTokens?.[e]??void 0;try{let r=await mhe(e,{maxResults:t.maxResults,pageToken:n??void 0});return{provider:e,messages:r.messages.map(t=>({id:t.message_id,provider:e,from_email:t.from_email,from_name:t.from_name,subject:t.subject,body_preview:t.body_preview,received_at:t.received_at,thread_id:t.thread_id,has_attachments:t.has_attachments,...e===`slack`?{slack_channel_id:t.slack_channel_id,slack_channel_name:t.slack_channel_name}:{}})),nextPageToken:r.next_page_token}}catch(n){let r=n instanceof Fb&&typeof n.detail==`object`&&n.detail!==null?n.detail:null;return e===`gmail`&&n instanceof Fb&&n.status===412&&r?.reason===`provider_unavailable`?Xx.getState().markNotAvailable():t.foreground?Y(n,`We couldn't load your ${e} inbox.`,{operation:`inbox_list_messages`,metadata:{provider:e}}):X(n,{operation:`inbox_list_messages`,metadata:{provider:e}}),{provider:e,messages:[],nextPageToken:null}}}),r=await Promise.all(n),i={},a=[];for(let e of r)i[e.provider]=e.nextPageToken,a.push(...e.messages);return{messages:$L(a),newPageTokens:i}}function w0e(e,t,n){let r={...t,all:{messages:e,fetchedAt:n}},i={};for(let t of e)(i[t.provider]??=[]).push(t);for(let e of tx)r[e]={messages:i[e]??[],fetchedAt:n};return r}const tR=Pb((e,t)=>({providerFilter:`all`,messages:[],selectedId:null,replyOpen:!1,isLoading:!1,isBackgroundRefreshing:!1,unreadCounts:null,dismissedMessages:[],showHidden:!1,undoTarget:null,isArchiving:!1,cache:{},detailCache:{},pageTokens:{},exhausted:{},isRefilling:!1,selectedMessage:()=>{let{messages:e,selectedId:n}=t();return e.find(e=>e.id===n)??null},getUnreadForFilter:e=>{let{unreadCounts:n}=t();return n?e===`all`?tx.reduce((e,t)=>e+(n[t]??0),0):n[e]??0:0},setProviderFilter:n=>{ZL++,e({providerFilter:n,selectedId:null,pageTokens:{},exhausted:{}}),t().loadMessages()},setSelectedId:t=>e({selectedId:t}),setReplyOpen:t=>e({replyOpen:t}),setShowHidden:t=>e(e=>({showHidden:t(e.showHidden)})),loadMessages:async()=>{let{providerFilter:n,cache:r}=t(),i=++ZL,a=r[n];if(a&&Date.now()-a.fetchedAt<y0e){e({messages:a.messages,isLoading:!1}),!t().selectedId&&a.messages.length>0&&e({selectedId:a.messages[0].id}),t().refreshInBackground();return}e({isLoading:!0});try{let r=QL(),a=n===`all`?r:r.includes(n)?[n]:[];if(a.length===0){if(i!==ZL)return;e({messages:[],isLoading:!1,pageTokens:{},exhausted:{}});return}let{messages:o,newPageTokens:s}=await eR(a,{maxResults:x0e,foreground:!0});if(i!==ZL)return;let c=Date.now(),l=n===`all`?w0e(o,t().cache,c):{...t().cache,[n]:{messages:o,fetchedAt:c}},u={};for(let e of a)u[e]=s[e]===null;e({messages:o,cache:l,isLoading:!1,pageTokens:s,exhausted:u}),!t().selectedId&&o.length>0&&e({selectedId:o[0].id})}catch{if(i!==ZL)return;e({isLoading:!1})}},refreshInBackground:async()=>{let{providerFilter:n,isBackgroundRefreshing:r}=t();if(r)return;let i=ZL;e({isBackgroundRefreshing:!0});try{let r=QL(),a=n===`all`?r:r.includes(n)?[n]:[];if(a.length===0){e({isBackgroundRefreshing:!1});return}let{messages:o,newPageTokens:s}=await eR(a,{maxResults:x0e});if(i!==ZL){e({isBackgroundRefreshing:!1});return}let c=Date.now(),l=n===`all`?w0e(o,t().cache,c):{...t().cache,[n]:{messages:o,fetchedAt:c}},u=t().selectedId,d=o.some(e=>e.id===u),f={};for(let e of a)f[e]=s[e]===null;e({messages:o,cache:l,isBackgroundRefreshing:!1,selectedId:d?u:o[0]?.id??null,pageTokens:s,exhausted:f})}catch{e({isBackgroundRefreshing:!1})}},refillIfLow:async()=>{let{providerFilter:n,messages:r,exhausted:i,pageTokens:a,isRefilling:o}=t();if(o||r.length>=C0e)return;let s=QL(),c=(n===`all`?s:s.includes(n)?[n]:[]).filter(e=>!i[e]&&typeof a[e]==`string`);if(c.length===0)return;let l=ZL;e({isRefilling:!0});try{let{messages:n,newPageTokens:r}=await eR(c,{maxResults:S0e,pageTokens:a});if(l!==ZL){e({isRefilling:!1});return}let i=new Set(t().messages.map(e=>e.id)),o=n.filter(e=>!i.has(e.id)),s=$L([...t().messages,...o]),u={...t().pageTokens},d={...t().exhausted};for(let e of c)u[e]=r[e],r[e]===null&&(d[e]=!0);e({messages:s,pageTokens:u,exhausted:d,isRefilling:!1,selectedId:t().selectedId??s[0]?.id??null})}catch{e({isRefilling:!1})}},clearProviderData:n=>{e(e=>{let t=e.messages.filter(e=>e.provider!==n),r=e.dismissedMessages.filter(e=>e.provider!==n),i={...e.cache};delete i[n],delete i.all;let a=e.unreadCounts?{...e.unreadCounts,[n]:0}:null,o=t.some(t=>t.id===e.selectedId)?e.selectedId:t[0]?.id??null,s=e.undoTarget;return s&&s.msg.provider===n&&(clearTimeout(s.timer),XL&&clearInterval(XL),s=null),{messages:t,dismissedMessages:r,cache:i,unreadCounts:a,selectedId:o,undoTarget:s}}),t().loadMessages(),nx().then(t=>e({unreadCounts:t})).catch(()=>{})},startPolling:()=>{YL||=(nx().then(t=>e({unreadCounts:t})).catch(()=>{}),setInterval(()=>{nx().then(n=>{let r=t().unreadCounts;e({unreadCounts:n});let i=!r||tx.some(e=>
271r[e]!==n[e]),a=t().cache[t().providerFilter],o=!a||Date.now()-a.fetchedAt>=y0e;(i||o)&&t().refreshInBackground()}).catch(()=>{})},b0e))},stopPolling:()=>{YL&&=(clearInterval(YL),null)},handleArchive:n=>{let{undoTarget:r,selectedId:i,messages:a}=t();r&&(clearTimeout(r.timer),XL&&clearInterval(XL),e({undoTarget:null}));let o=a.filter(e=>e.id!==n.id),s=a.findIndex(e=>e.id===n.id),c=o[s]??o[s-1]??null;e({messages:o,dismissedMessages:[n,...t().dismissedMessages],selectedId:i===n.id?c?.id??null:i,isArchiving:!0}),vhe(n.id,n.provider).finally(()=>e({isArchiving:!1})),e({undoTarget:{msg:n,timer:setTimeout(()=>{XL&&clearInterval(XL),e({undoTarget:null})},JL),progress:100,action:`archive`}});let l=Date.now();XL=setInterval(()=>{let t=Date.now()-l,n=Math.max(0,100-t/JL*100);e(e=>e.undoTarget?{undoTarget:{...e.undoTarget,progress:n}}:{})},50),t().refillIfLow()},handleDelete:n=>{let{undoTarget:r,selectedId:i,messages:a}=t();r&&(clearTimeout(r.timer),XL&&clearInterval(XL),e({undoTarget:null}));let o=a.filter(e=>e.id!==n.id),s=a.findIndex(e=>e.id===n.id),c=o[s]??o[s-1]??null;e({messages:o,dismissedMessages:[n,...t().dismissedMessages],selectedId:i===n.id?c?.id??null:i,isArchiving:!0}),yhe(n.id,n.provider).finally(()=>e({isArchiving:!1})),e({undoTarget:{msg:n,timer:setTimeout(()=>{XL&&clearInterval(XL),e({undoTarget:null})},JL),progress:100,action:`delete`}});let l=Date.now();XL=setInterval(()=>{let t=Date.now()-l,n=Math.max(0,100-t/JL*100);e(e=>e.undoTarget?{undoTarget:{...e.undoTarget,progress:n}}:{})},50),t().refillIfLow()},handleUndo:()=>{let{undoTarget:n}=t();if(!n)return;clearTimeout(n.timer),XL&&clearInterval(XL);let r=n.msg;e({undoTarget:null}),e(e=>({dismissedMessages:e.dismissedMessages.filter(e=>e.id!==r.id),messages:$L([r,...e.messages]),selectedId:r.id})),n.action===`delete`?bhe(r.id,r.provider).catch(()=>{}):rx(r.id,r.provider).catch(()=>{})},handleRestore:n=>{let{dismissedMessages:r}=t(),i=r.find(e=>e.id===n);i&&(e(e=>({dismissedMessages:e.dismissedMessages.filter(e=>e.id!==n),messages:$L([i,...e.messages]),selectedId:n})),rx(i.id,i.provider).catch(()=>{}))},fetchMessageDetail:async(n,r)=>{let{detailCache:i}=t(),a=i[n];if(a)return a;try{let t=await hhe(n,r);return e(e=>({detailCache:{...e.detailCache,[n]:t}})),t}catch{return null}}}));function T0e(e,t,n,r=null){let{timezone:i,weekly_rules:a,...o}=e;return{...o,calendar_id:`primary`,provider:t,account_id:r,timezone:i??n,weekly_rules:a??[]}}async function E0e(){return(await Z(`/api/v1/booking-links`)).data}async function D0e(e){return(await Z(`/api/v1/booking-links`,{method:`POST`,body:JSON.stringify(e)})).data}async function O0e(e){return(await Z(`/api/v1/booking-links/${e}`)).data}async function k0e(e,t){return(await Z(`/api/v1/booking-links/${e}`,{method:`PATCH`,body:JSON.stringify(t)})).data}async function A0e(e){await Z(`/api/v1/booking-links/${e}`,{method:`DELETE`})}async function j0e(e){return(await Z(`/api/v1/booking-links/${e}/bookings`)).data}async function M0e(e){return(await Z(`/api/v1/calendars?provider=${e}`)).data}async function N0e(e,t,n){return(await Z(`/api/v1/public-booking-links/${e}/${t}/${n}`)).data}async function P0e(e,t,n,r,i,a){let o=new URLSearchParams({from:r,to:i});return a&&o.set(`tz`,a),(await Z(`/api/v1/public-booking-links/${e}/${t}/${n}/slots?${o.toString()}`)).data}async function F0e(e,t,n,r){return(await Z(`/api/v1/public-booking-links/${e}/${t}/${n}/bookings`,{method:`POST`,body:JSON.stringify(r)})).data}const nR=Pb((e,t)=>({links:[],isLoading:!1,error:null,bookingsByLink:{}
271,calendarsByProvider:{google:[],outlook:[],caldav:[]},fetchLinks:async()=>{e({isLoading:!0,error:null});try{e({links:await E0e(),isLoading:!1})}catch(t){X(t,{operation:`booking_fetch_links`}),e({isLoading:!1,error:Kb(t,H.t(`errors.fetch_failed`))})}},fetchLink:async n=>{try{let r=await O0e(n),i=t().links.slice(),a=i.findIndex(e=>e.id===n);return a>=0?i[a]=r:i.push(r),e({links:i}),r}catch(t){return X(t,{operation:`booking_fetch_link`,metadata:{id:n}}),e({error:Kb(t,H.t(`errors.fetch_failed`))}),null}},create:async n=>{let r=await D0e(n);return e({links:[r,...t().links]}),r},update:async(n,r)=>{let i=await k0e(n,r);return e({links:t().links.map(e=>e.id===n?i:e)}),i},remove:async n=>{await A0e(n),e({links:t().links.filter(e=>e.id!==n)})},fetchBookings:async n=>{try{let r=await j0e(n);e({bookingsByLink:{...t().bookingsByLink,[n]:r}})}catch(t){X(t,{operation:`booking_fetch_bookings`,metadata:{linkId:n}}),e({error:Kb(t,H.t(`errors.fetch_failed`))})}},fetchCalendars:async n=>{let r=await M0e(n);return e({calendarsByProvider:{...t().calendarsByProvider,[n]:r}}),r},clearError:()=>e({error:null})})),I0e=()=>`/api/v1/finance-documents`,L0e=async(e,t)=>Z(I0e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),R0e=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/finance-documents?${n}`:`/api/v1/finance-documents`},z0e=async(e,t)=>Z(R0e(e),{...t,method:`GET`}),B0e=e=>`/api/v1/finance-documents/${e}`,V0e=async(e,t)=>Z(B0e(e),{...t,method:`GET`}),H0e=e=>`/api/v1/finance-documents/${e}`,U0e=async(e,t,n)=>Z(H0e(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),W0e=e=>`/api/v1/finance-documents/${e}`,G0e=async(e,t)=>Z(W0e(e),{...t,method:`DELETE`}),K0e=()=>`/api/v1/finance-documents/from-upload`,q0e=async(e,t)=>{let n=new FormData;return n.append(`file`,e.file),e.matter_id!==void 0&&e.matter_id!==null&&n.append(`matter_id`,e.matter_id),e.title_override!==void 0&&e.title_override!==null&&n.append(`title_override`,e.title_override),Z(K0e(),{...t,method:`POST`,body:n})},rR=Pb((e,t)=>({selectedDocument:null,isLoading:!1,isSaving:!1,error:null,chatMessages:[],isStreaming:!1,pendingPatches:[],abortController:null,loadDocument:async t=>{e({isLoading:!0,error:null});try{let n=(await V0e(t)).data;e({selectedDocument:n,isLoading:!1})}catch(n){X(n,{operation:`finance_load_document`,metadata:{id:t}}),e({isLoading:!1,error:Kb(n,H.t(`errors.document_load_failed`))})}},createDocument:async e=>(await L0e(e)).data,updateContent:async(t,n)=>{e({isSaving:!0});try{let r=(await U0e(t,{content:n})).data;e(e=>({selectedDocument:e.selectedDocument?{...e.selectedDocument,updated_at:r.updated_at}:r,isSaving:!1}))}catch(n){X(n,{operation:`finance_update_content`,metadata:{id:t}}),e({isSaving:!1,error:Kb(n,H.t(`errors.save_failed`))})}},updateDocument:async(n,r)=>{let i=(await U0e(n,r)).data;t().selectedDocument?.id===n&&e({selectedDocument:i})},deleteDocument:async n=>{await G0e(n),t().selectedDocument?.id===n&&e({selectedDocument:null})},clearSelected:()=>e({selectedDocument:null,chatMessages:[],pendingPatches:[]}),sendLlmEdit:async n=>{let r=t().selectedDocument;if(!r)return;let i={role:`user`,content:n};e(e=>({chatMessages:[...e.chatMessages,i,{role:`assistant`,content:``}],isStreaming:!0}));let a=new AbortController;e({abortController:a});let o=t().chatMessages.slice(0,-2),s={message:n,current_content:r.content,history:o.map(e=>({role:e.role,content:e.content}))};try{await fge(r.id,s,{onDelta:t=>{e(e=>{let n=[...e.chatMessages],r=n[n.length-1];return r&&r.role===`assistant`&&(n[n.length-1]={...r,content:r.content+t}),{chatMessages:n}})},onPatch:t=>{e(e=>({pendingPatches:[...e.pendingPatches,t]}))},onDone:()=>{e({isStreaming:!1,abortController:null})},onError:t=>{e(e=>{let n=[...e.chatMessages],r=n[n.length-1];return r&&r.role===`assistant`&&!r.content&&(n[n.length-1]={...r,content:`Error: ${t}`}),{chatMessages:n,isStreaming:!1,abortController:null}})}},a.signal)}catch(t){X(t,{operation:`finance_llm_edit_stream`,metadata:{docId:r.id}}),e({isStreaming:!1,abortController:null,error:Kb(t,H.t(`errors.generic`))})}},cancelLlmEdit:()=>{let n=t().abortController;n&&n.abort(),e({isStreaming:!1,abortController:null})},consumePatch:t=>{e(e=>({pendingPatches:e.pendingPatches.filter(e=>e.seq!==t)}))},clearChat:()=>e({chatMessages:[],pendingPatches:[]})})),iR=Pb(e=>({summaries:{},allTimeSummary:null,fetchSummary:async t=>{try{let n=(await l_e({date:t})).data;e(e=>{let r=e.summaries[t];return r&&n.total_seconds<r.total_seconds?e:{summaries:{...e.summaries,[t]:n}}})}catch(e){X(e,{operation:`activity_fetch_summary`})}},fetchAllTime:async()=>{try{e({allTimeSummary:(await d_e()).data})}catch(e){X(e,{operation:`activity_fetch_all_time`})}},flush:async(t,n,r)=>{if(Object.keys(n).length===0||Yb()===null)return!0;
271if(r?.keepalive){let e=Yb();try{await fetch(`${Zb()}/api/v1/activity/heartbeat`,{method:`POST`,keepalive:!0,headers:{"Content-Type":`application/json`,...e?{Authorization:`Bearer ${e}`}:{}},body:JSON.stringify({activity_date:t,buckets:n})})}catch{}return!0}try{let r=(await s_e({activity_date:t,buckets:n})).data;return e(e=>({summaries:{...e.summaries,[t]:r}})),!0}catch(e){return X(e,{operation:`activity_flush`}),!1}}})),aR=Pb((e,t)=>({open:!1,checked:!1,maybeShow:()=>{if(t().checked)return;let n=Nx.getState().user;n&&XT.getState().status!==`active`&&(e({checked:!0}),!(n.preferences??{}).support_intro_seen_at&&e({open:!0}))},openTicket:()=>{e({open:!1}),fO.getState().openDialog(),t().markSeen()},captureScreenshot:()=>{e({open:!1}),fO.getState().captureScreenshotAndOpen(),t().markSeen()},recordScreen:()=>{e({open:!1}),fO.getState().startRecording(),t().markSeen()},dismiss:()=>{e({open:!1}),t().markSeen()},markSeen:async()=>{let e=new Date().toISOString(),{user:t,updateUser:n}=Nx.getState();if(t){let r=t.preferences??{};if(r.support_intro_seen_at)return;n({...t,preferences:{...r,support_intro_seen_at:e}})}try{await jx({preferences:{support_intro_seen_at:e}})}catch{}}}));function oR(e){e.setState(e.getInitialState(),!0)}var J0e=[[`chat`,()=>oR(LS)],[`app`,()=>oR(Q)],[`document`,()=>oR(sk)],[`mail`,()=>{oR(DS),SS()}],[`inbox`,()=>oR(tR)],[`playbook`,()=>oR(JI)],[`evaluation`,()=>oR(qI)],[`gmail`,()=>oR(Xx)],[`outlook`,()=>oR($x)],[`imap`,()=>oR(Qx)],[`redline`,()=>oR(Ex)],[`slack`,()=>oR(vL)],[`bookingLinks`,()=>oR(nR)],[`notification`,()=>oR(FL)],[`org`,()=>oR(GL)],[`finance`,()=>oR(rR)],[`matter`,()=>oR(Yx)],[`email`,()=>oR(Ux)],[`activity`,()=>oR(iR)],[`benchmark`,()=>oR(TO)],[`cs`,()=>oR(bL)],[`csIcp`,()=>{oR(PL),t1e()}],[`csFeedback`,()=>oR(AL)],[`csRisk`,()=>oR(DL)],[`csRoadmap`,()=>oR(wL)],[`integrationSync`,()=>{oR(NS),mbe()}],[`release`,()=>oR(_L)],[`supportIntro`,()=>oR(aR)]];function sR(e={}){let t=new Set(e.exclude??[]);for(let[e,n]of J0e)t.has(e)||n()}function Y0e(){let{t:e}=V(),{isMobile:t}=sL(),{user:n,clearAuth:r}=Nx(),i=Sv(),a=Q(e=>e.navRailCollapsed),o=GL(e=>e.organizations),s=GL(e=>e.fetchMyOrganizations),c=GL(e=>e.switchActiveOrg),l=GL(e=>e.createOrganization),u=Nx(e=>e.user?.current_org_id??null),[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(``),[h,g]=(0,B.useState)(!1),_=t=>t===`admin`?e(`org.roles.admin`):t===`member`?e(`org.roles.member`):t===`viewer`?e(`org.roles.viewer`):t;(0,B.useEffect)(()=>{s()},[s]);let v=o.find(e=>e.id===u)??null,y=async()=>{sR({exclude:[`org`,`notification`,`integrationSync`]}),await Promise.all([Q.getState().fetchKnowledgeBases(),Q.getState().fetchChatModels(),LS.getState().loadConversations(),Yx.getState().fetchMatters()])},b=async e=>{await c(e),await y()},x=async()=>{if(p.trim()){g(!0);try{await c((await l(p.trim())).id),await y(),f(!1),m(``)}finally{g(!1)}}},S=()=>{i(`/settings/organization`)},C=n==null?e(`nav.user_menu.guest`):`${n.first_name} ${n.last_name}`,w=n==null?e(`nav.user_menu.guest`):n.email,T=n?`${n.first_name?.[0]??``}${n.last_name?.[0]??``}`:`CN`;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(HC,{open:d,onOpenChange:f,children:(0,K.jsxs)(WC,{className:`sm:max-w-md`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:e(`org.switcher.create_org`)}),(0,K.jsx)(JC,{children:e(`auth.signup.organization_name_description`)})]}),(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:e(`auth.signup.organization_name_label`)}),(0,K.jsx)(`input`,{type:`text`,value:p,onChange:e=>m(e.target.value),placeholder:e(`auth.signup.organization_name_placeholder`),className:`w-full px-3 py-2 text-sm border border-input rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-ring`,autoFocus:!0,disabled:h})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`ghost`,onClick:()=>f(!1),disabled:h,children:e(`common.cancel`)}),(0,K.jsx)(J,{onClick:x,disabled:h||!p.trim(),children:e(h?`common.creating`:`common.create`)})]})]})}),(0,K.jsx)(pL,{children:(0,K.jsx)(mL,{children:(0,K.jsxs)(LD,{children:[(0,K.jsx)(RD,{asChild:!0,children:(0,K.jsxs)(hL,{size:`lg`,className:`data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground group-data-[collapsible=icon]:h-12! group-data-[collapsible=icon]:w-full! group-data-[collapsible=icon]:p-2!`,children:[(0,K.jsxs)(KL,{className:`h-8 w-8 rounded-lg`,children:[n?.avatar_url&&(0,K.jsx)(_0e,{src:XI(n.avatar_url),alt:C}),(0,K.jsx)(qL,{className:`rounded-lg`,children:T})]}),!a&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,K.jsx)(`span`,{className:`truncate font-medium`,children:C}),(0,K.jsx)(`span`,{className:`truncate text-xs`,children:w})]}),(0,K.jsx)(Vg,{className:`ml-auto size-4`})]})]})}),(0,K.jsxs)(zD,{className:`w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg`,side:t?`bottom`:`top`,align:`end`,sideOffset:4,children:[(0,K.jsx)(UD,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e(`org.switcher.organizations`)}),(0,K.jsxs)(VD,{onClick:()=>b(null),className:`gap-2`,children:[(0,K.jsx)(K_,{}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium truncate`,children:e(`org.switcher.personal`)}),(0,K.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e(`org.switcher.personal_account`)})]}),v===null&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e(`org.switcher.current`)})]}),o.map(t=>(0,K.jsxs)(VD,{onClick:()=>b(t.id),className:`gap-2`,children:[(0,K.jsx)(Mg,{}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium truncate`,children:t.name}),(0,K.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:_(t.role)})]}),t.id===u&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e(`org.switcher.current`)})]},t.id)),(0,K.jsxs)(VD,{onClick:()=>f(!0),className:`gap-2`,children:[(0,K.jsx)(T_,{}),(0,K.jsx)(`span`,{className:`text-sm`,children:e(`org.switcher.create_org`)})]}),v&&(0,K.jsxs)(VD,{onClick:S,className:`gap-2`,children:[(0,K.jsx)(gse,{}),(0,K.jsx)(`span`,{className:`text-sm`,children:e(`settings.organization.title`)})]}),(0,K.jsx)(WD,{}),(0,K.jsxs)(BD,{children:[(0,K.jsxs)(VD,{children:[(0,K.jsx)(ioe,{}),e(`nav.user_menu.usage_metrics`)]}),(0,K.jsxs)(VD,{onClick:()=>i(`/settings/profile`),children:[(0,K.jsx)(gse,{}),e(`nav.user_menu.settings`)]})]}),(0,K.jsx)(WD,{}),(0,K.jsxs)(BD,{children:[(0,K.jsxs)(VD,{onClick:()=>i(`/terms`),children:[(0,K.jsx)(i_,{}),e(`nav.user_menu.terms_of_service`)]}),(0,K.jsxs)(VD,{onClick:()=>i(`/privacy`),children:[(0,K.jsx)(I_,{}),e(`nav.user_menu.privacy_policy`)]})]}),(0,K.jsx)(WD,{}),(0,K.jsx)(BD,{children:(0,K.jsxs)(VD,{onSelect:()=>fO.getState().openDialog(),children:[(0,K.jsx)(f_,{}),e(`nav.user_menu.contact_support`)]})}),(0,K.jsx)(WD,{}),(0,K.jsxs)(VD,{onClick:async()=>{try{await J_e()}catch{}r(),window.location.assign(`/login`)},children:[(0,K.jsx)(Zoe,{}),e(`nav.user_menu.sign_out`)]})]})]})})})]})}function cR(){let{t:e}=V(),{setOpen:t}=sL();return(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:()=>t(!1),"aria-label":e(`sidebar.collapse_panel`),children:(0,K.jsx)(S_,{className:`size-4`})})}),(0,K.jsxs)(GT,{side:`bottom`,children:[e(`sidebar.collapse_panel`),(0,K.jsx)(`kbd`,{className:`ml-1.5 font-mono text-[10px] opacity-70`,children:`âB`})]})]})}
271var X0e=ay(`inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function lR({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,K.jsx)(n?Hje:`span`,{"data-slot":`badge`,"data-variant":t,className:q(X0e({variant:t}),e),...r})}var Z0e=e=>e===`editor`?`Editor`:`Viewer`;function Q0e({resourceType:e,resourceId:t,shares:n,ownerLabel:r,ownerInitials:i}){let a=lk(e=>e.revokeShare),o=async n=>{try{await a(e,t,n),G.success(`Access revoked`)}catch(e){Y(e,`Failed to revoke access`,{operation:`revoke_share`})}};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`ul`,{className:`divide-y divide-border/60`,children:[(0,K.jsxs)(`li`,{className:`flex items-center gap-3 py-2.5`,children:[(0,K.jsx)(KL,{size:`sm`,"aria-hidden":!0,children:(0,K.jsx)(qL,{children:i})}),(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:r})}),(0,K.jsxs)(lR,{variant:`outline`,className:`gap-1 border-border/70 text-[10.5px] font-medium text-foreground/70`,children:[(0,K.jsx)(I_,{className:`size-3`,strokeWidth:2}),`Owner`]})]}),n.map((e,t)=>{let n=e.status===`accepted`;return(0,K.jsxs)(`li`,{className:`group flex items-center gap-3 py-2.5 animate-in fade-in-0 slide-in-from-bottom-1 duration-300 motion-reduce:animate-none`,style:{animationDelay:`${t*40}ms`},children:[(0,K.jsx)(KL,{size:`sm`,"aria-hidden":!0,children:(0,K.jsx)(qL,{children:GI(null,e.grantee_email)})}),(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.grantee_email})}),(0,K.jsx)(GT,{children:e.grantee_email})]})}),(0,K.jsx)(lR,{variant:`outline`,className:`gap-1 text-[10.5px] font-medium text-muted-foreground`,children:n?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Lg,{className:`size-3`,strokeWidth:2}),`Has access`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Jg,{className:`size-3`,strokeWidth:2}),`Invite pending`]})}),(0,K.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:Z0e(e.role)}),(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:()=>o(e.id),"aria-label":`Revoke access for ${e.grantee_email}`,className:`shrink-0 text-muted-foreground opacity-0 transition-opacity hover:text-destructive focus-visible:opacity-100 group-hover:opacity-100`,children:(0,K.jsx)(V_,{className:`size-3.5`})})}),(0,K.jsx)(GT,{children:`Revoke access`})]})]},e.id)})]}),n.length===0&&(0,K.jsx)(`p`,{className:`pt-2.5 text-[11px] leading-relaxed text-muted-foreground`,children:`Invite someone above to give them access.`})]})}function uR(e){return e===`conversation`?`chat`:e===`matter`?`matter`:`document`}function $0e(e){return e===`conversation`?b_:e===`matter`?jg:i_}function e2e(e){return[{value:`viewer`,label:`Viewer`,icon:t_,disabled:!1},{value:`editor`,label:`Editor`,icon:w_,disabled:e!==`matter`}]}function t2e(e){return e===`matter`?`invite someone by email. Viewers read the documents and conversations; editors can also add their own.`:`invite someone by email. They get read-only access.`}function dR({resourceType:e,resourceId:t,resourceName:n,open:r,onOpenChange:i}){let a=lk(e=>e.createShare),o=lk(e=>e.fetchShares),s=lk(e=>e.sharesByResource)[`${e}:${t}`]??[],c=Nx(e=>e.user),[l,u]=(0,B.useState)(``),[d,f]=(0,B.useState)(`viewer`),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(!1),_=uR(e),v=e2e(e),y=c&&`${c.first_name} ${c.last_name}`.trim()||null,b=c?GI(y,c.email):`?`,x=s.length+1;(0,B.useEffect)(()=>
271{if(!r){u(``),f(`viewer`),m(!1),g(!1);return}let n=!1;return g(!0),(async()=>{try{await o(e,t)}finally{n||g(!1)}})(),()=>{n=!0}},[r,e,t,o]);let S=l.trim();return(0,K.jsx)(HC,{open:r,onOpenChange:i,children:(0,K.jsxs)(WC,{className:`sm:max-w-[480px] gap-0 overflow-hidden p-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3.5 px-6 pt-6 pb-5`,children:[(0,K.jsx)(`div`,{className:`grid size-10 shrink-0 place-items-center rounded-md border border-border/80 bg-muted/40`,children:(0,K.jsx)(P_,{className:`size-[17px] text-foreground/75`,strokeWidth:1.75})}),(0,K.jsxs)(`div`,{className:`flex-1 pt-0.5`,children:[(0,K.jsxs)(qC,{className:`text-[15px] font-semibold leading-tight tracking-tight`,children:[`Share this `,_]}),(0,K.jsxs)(JC,{className:`mt-1.5 text-xs leading-relaxed text-muted-foreground`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground/80`,children:n}),` `,`â `,t2e(e)]})]})]}),(0,K.jsx)(`div`,{className:`border-t border-border/60`}),(0,K.jsx)(`form`,{onSubmit:async n=>{if(n.preventDefault(),!(p||!S)){m(!0);try{await a(e,t,S,d),G.success(`Shared with ${S}`),u(``)}catch(e){Y(e,`Failed to share`,{operation:`create_share`})}finally{m(!1)}}},children:(0,K.jsxs)(`div`,{className:`space-y-4 px-6 py-5`,children:[(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`label`,{htmlFor:`share-email`,className:`block text-[10.5px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:`Email address`}),(0,K.jsxs)(`div`,{className:`flex h-10 items-center gap-2.5 rounded-md border bg-background px-3 transition-colors focus-within:border-foreground
271/40 focus-within:ring-2 focus-within:ring-ring/30`,children:[(0,K.jsx)(Yae,{className:`size-4 text-muted-foreground`,strokeWidth:1.75}),(0,K.jsx)(`input`,{id:`share-email`,type:`email`,value:l,onChange:e=>u(e.target.value),placeholder:`[email protected]`,className:`flex-1 bg-transparent text-sm placeholder:text-muted-foreground/55 focus:outline-none disabled:opacity-50`,disabled:p,autoFocus:!0,autoComplete:`email`})]})]}),(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`label`,{className:`block text-[10.5px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:`Access level`}),(0,K.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:v.map(e=>{let t=d===e.value,n=e.icon;return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>!e.disabled&&f(e.value),disabled:p||e.disabled,title:e.disabled?`Coming soon`:void 0,className:q(`group relative flex items-center gap-2 rounded-md border p-3 text-left transition-all duration-150`,`disabled:cursor-not-allowed disabled:opacity-45`,!e.disabled&&`hover:border-foreground
271/30`,t?`border-foreground/70 bg-accent/40 shadow-[inset_0_0_0_1px_var(--foreground)] shadow-foreground/[0.04]`:`border-border bg-background`),children:[(0,K.jsx)(n,{className:q(`size-3.5 transition-colors`,t?`text-foreground`:`text-muted-foreground`),strokeWidth:1.75}),(0,K.jsx)(`span`,{className:q(`text-[12.5px] font-medium leading-none`,t?`text-foreground`:`text-foreground/85`),children:e.label}),e.disabled&&(0,K.jsx)(`span`,{className:`absolute right-2 top-2 rounded bg-muted px-1 text-[9px] font-medium uppercase tracking-wide text-muted-foreground`,children:`Soon`})]},e.value)})})]}),(0,K.jsx)(J,{type:`submit`,size:`sm`,disabled:p||!S,className:`h-9 w-full gap-1.5`,children:p?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{className:`size-3.5 animate-spin`}),`Sharingâ¦`]}):(0,K.jsxs)(K.Fragment,{children:[`Share`,(0,K.jsx)(Eg,{className:`size-3.5`,strokeWidth:2})]})})]})}),(0,K.jsx)(`div`,{className:`border-t border-border/60`}),(0,K.jsxs)(`div`,{className:`px-6 py-4`,children:[(0,K.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10.5px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,K.jsx)(`span`,{children:`People with access`}),!h&&(0,K.jsxs)(`span`,{"aria-hidden":!0,children:[`· `,x]})]}),(0,K.jsx)(`div`,{className:`max-h-56 overflow-y-auto`,children:h?(0,K.jsx)(`div`,{className:`space-y-3 py-1.5`,children:[0,1].map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(LI,{className:`size-6 shrink-0 rounded-full`}),(0,K.jsx)(LI,{className:`h-3.5 w-40`})]},e))}):(0,K.jsx)(Q0e,{resourceType:e,resourceId:t,shares:s,ownerLabel:`You`,ownerInitials:b})})]}),(0,K.jsx)(`div`,{className:`flex items-center justify-end gap-2 border-t border-border/60 bg-muted/30 px-6 py-3.5`,children:(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>i(!1),className:`h-8`,children:`Done`})})]})})}const n2e=[`today`,`yesterday`,`previous_7_days`,`previous_30_days`,`older`];var fR=1440*60*1e3;function r2e(e,t){let n=new Date(e).getTime();return Number.isNaN(n)?`older`:n>=t?`today`:n>=t-fR?`yesterday`:n>=t-7*fR?`previous_7_days`:n>=t-30*fR?`previous_30_days`:`older`}function i2e(e,t=new Date){let n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),r=new Map;for(let t of e){let e=r2e(t.updated_at,n),i=r.get(e);i?i.push(t):r.set(e,[t])}let i=[];for(let e of n2e){let t=r.get(e);t&&t.length>0&&i.push({key:e,items:t})}return i}var a2e=300;function o2e(){let{t:e}=V(),{formatDate:t}=jb(),n=Sv(),[r,i]=B.useState(``),[a,o]=B.useState(``),[s,c]=B.useState(!1),[l,u]=B.useState(null),[d,f]=B.useState(``),[p,m]=B.useState(null),{conversations:h,conversationId:g,isLoadingConversations:_,isLoadingMoreConversations:v,conversationSearchResults:y,isSearchingConversations:b,loadConversations:x,loadMoreConversations:S,searchConversations:C,clearConversationSearch:w,deleteConversation:T,startNewConversation:E,renameConversation:D}=LS();B.useEffect(()=>{x()},[x]),B.useEffect(()=>{let e=setTimeout(()=>o(r.trim()),250);return()=>clearTimeout(e)},[r]),B.useEffect(()=>{a?C(a):w()},[a,C,w]);let O=e=>{e!==g&&n(`/chat/${e}`,{replace:!0})},k=async(e,t)=>{e.stopPropagation(),await T(t)},A=()=>{E(),n(`/chat`,{replace:!0})},j=(e,t,n)=>{e.stopPropagation(),u(t),f(n||``),c(!0)},M=(e,t,n)=>{e.stopPropagation(),m({id:t,title:n})},N=async()=>{!l||!d.trim()||(await D(l,d.trim()),c(!1),u(null),f(``))},P=e(`common.untitled`),F=r.trim()!==a,I=r.trim()?y:h,L=r.trim()?(F||b)&&I.length===0:_&&I.length===0,ee=i2e(I);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(lL,{className:`gap-3.5 border-b p-4`,children:[(0,K.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(cR,{}),(0,K.jsx)(`div`,{className:`text-base font-medium text-foreground`,children:e(`chat.history`)})]}),(0,K.jsx)(J,{variant:`ghost`,size:`icon`,onClick:A,children:(0,K.jsx)(T_,{className:`size-4`})})]}),(0,K.jsx)(OZe,{placeholder:e(`common.search_placeholder`),value:r,onChange:e=>i(e.target.value)})]}),(0,K.jsx)(uL,{onScroll:e=>{if(r.trim())return;let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<a2e&&S()},children:(0,K.jsx)(dL,{className:`px-0`,children:(0,K.jsxs)(fL,{children:[L&&(0,K.jsx)(`div`,{className:`text-center text-muted-foreground text-xs py-4`,children:e(`common.loading`)}),ee.map(n=>(0,K.jsxs)(B.Fragment,{children:[(0,K.jsx)(AZe,{className:`sticky top-0 z-10 h-8 rounded-none bg-sidebar px-4`,children:e(`chat.${n.key}`)}),n.items.map(e=>(0,K.jsx)(`div`,{role:`button`,tabIndex:0,onClick:()=>O(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),O(e.id))},className:q(`group/conversation flex flex-col items-start gap-2 border-b p-4 text-sm leading-tight last:border-b-0 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground w-full text-left cursor-pointer`,g===e.id&&`bg-sidebar-accent text-sidebar-accent-foreground`),children:(0,K.jsxs)(`div`,{className:`flex w-full items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate flex-1`,children:e.title||P}),e.org_id&&(0,K.jsx)(lP,{label:`Team`}),(0,K.jsxs)(`div`,{className:`opacity-0 group-hover/conversation:opacity-100 ml-2 flex items-center gap-1 shrink-0`,children:[!e.org_id&&(0,K.jsx)(`button`,{onClick:t=>M(t,e.id,e.title??``),className:`p-0.5 rounded hover:bg-primary/10 hover:text-primary`,title:`Share`,children:(0,K.jsx)(P_,{className:`size-4`})}),(0,K.jsx)(`button`,{onClick:t=>j(t,e.id,e.title??``),className:`p-0.5 rounded hover:bg-yellow-200 hover:text-yellow-800`,children:(0,K.jsx)(w_,{className:`size-4`})}),(0,K.jsx)(`button`,{onClick:t=>k(t,e.id),className:`p-0.5 rounded hover:bg-destructive/10 hover:text-destructive`,children:(0,K.jsx)(V_,{className:`size-4`})})]}),(0,K.jsx)(`span`,{className:`ml-auto text-xs shrink-0`,children:t(e.updated_at,`P`)})]})},e.id))]},n.key)),v&&(0,K.jsx)(`div`,{className:`text-center text-muted-foreground text-xs py-3`,children:e(`common.loading`)}),!L&&I.length===0&&(0,K.jsx)(`div`,{className:`text-center text-muted-foreground text-xs py-4`,children:e(r?`common.no_results`:`chat.no_conversations`)})]})})}),(0,K.jsx)(HC,{open:s,onOpenChange:c,children:(0,K.jsxs)(WC,{className:`sm:max-w-md`,children:[(0,K.jsx)(GC,{children:(0,K.jsx)(qC,{children:e(`chat.rename_conversation`)})}),(0,K.jsx)(dP,{value:d,onChange:e=>f(e.target.value),placeholder:e(`common.name`),onKeyDown:e=>{e.key===`Enter`&&N()}}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`outline`,onClick:()=>c(!1),children:e(`common.cancel`)}),(0,K.jsx)(J,{onClick:N,children:e(`common.save`)})]})]})}),p&&(0,K.jsx)(dR,{resourceType:`conversation`,resourceId:p.id,resourceName:p.title||P,open:!!p,onOpenChange:e=>{e||m(null)}})]})}var pR=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function mR(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function hR(e){return`nodeType`in e}function gR(e){return e?mR(e)?e:hR(e)?e.ownerDocument?.defaultView??window:window:window}function _R(e){let{Document:t}=gR(e);return e instanceof t}function vR(e){return mR(e)?!1:e instanceof gR(e).HTMLElement}function s2e(e){return e instanceof gR(e).SVGElement}function yR(e){return e?mR(e)?e.document:hR(e)?_R(e)?e:vR(e)||s2e(e)?e.ownerDocument:document:document:document}var bR=pR?B.useLayoutEffect:B.useEffect;function xR(e){let t=(0,B.useRef)(e);return bR(()=>{t.current=e}),(0,B.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function c2e(){let e=(0,B.useRef)(null);return[(0,B.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,B.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}
vendor: 40,162 bytes, lines 271-275
271function SR(e,t){t===void 0&&(t=[e]);let n=(0,B.useRef)(e);return bR(()=>{n.current!==e&&(n.current=e)},t),n}function CR(e,t){let n=(0,B.useRef)();return(0,B.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function wR(e){let t=xR(e),n=(0,B.useRef)(null);return[n,(0,B.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function TR(e){let t=(0,B.useRef)();return(0,B.useEffect)(()=>{t.current=e},[e]),t.current}var ER={};function DR(e,t){return(0,B.useMemo)(()=>{if(t)return t;let n=ER[e]==null?0:ER[e]+1;return ER[e]=n,e+`-`+n},[e,t])}function l2e(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var OR=l2e(1),kR=l2e(-1);function u2e(e){return`clientX`in e&&`clientY`in e}function AR(e){if(!e)return!1;let{KeyboardEvent:t}=gR(e.target);return t&&e instanceof t}function d2e(e){if(!e)return!1;let{TouchEvent:t}=gR(e.target);return t&&e instanceof t}function jR(e){if(d2e(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return u2e(e)?{x:e.clientX,y:e.clientY}:null}var MR=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[MR.Translate.toString(e),MR.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),f2e=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function p2e(e){return e.matches(f2e)?e:e.querySelector(f2e)}var m2e={display:`none`};function h2e(e){let{id:t,value:n}=e;return B.createElement(`div`,{id:t,style:m2e},n)}function g2e(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return B.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function _2e(){let[e,t]=(0,B.useState)(``);return{announce:(0,B.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var NR=v(),v2e=(0,B.createContext)(null);function y2e(e){let t=(0,B.useContext)(v2e);(0,B.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function b2e(){let[e]=(0,B.useState)(()=>new Set),t=(0,B.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,B.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var x2e={draggable:` 272 To pick up a draggable item, press the space bar. 273 While dragging, use the arrow keys to move the item. 274 Press space again to drop the item in its new position, or press escape to cancel. 275 `},S2e={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function C2e(e){let{announcements:t=S2e,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=x2e}=e,{announce:a,announcement:o}=_2e(),s=DR(`DndLiveRegion`),[c,l]=(0,B.useState)(!1);if((0,B.useEffect)(()=>{l(!0)},[]),y2e((0,B.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=B.createElement(B.Fragment,null,B.createElement(h2e,{id:r,value:i.draggable}),B.createElement(g2e,{id:s,announcement:o}));return n?(0,NR.createPortal)(u,n):u}var PR;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(PR||={});function FR(){}function w2e(e,t){return(0,B.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function T2e(){var e=[...arguments];return(0,B.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var IR=Object.freeze({x:0,y:0});function E2e(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function D2e(e,t){let n=jR(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function O2e(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function k2e(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function A2e(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function j2e(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function M2e(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var N2e=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=M2e(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(k2e)};function P2e(e,t){let{top:n,left:r,bottom:i,right:a}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=a}var F2e=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];let i=[];for(let e of t){let{id:t}=e,a=n.get(t);if(a&&P2e(r,a)){let n=A2e(a).reduce((e,t)=>e+E2e(r,t),0),o=Number((n/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:o}})}}return i.sort(O2e)};function I2e(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function L2e(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:IR}function R2e(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var z2e=R2e(1);function B2e(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function V2e(e,t,n){let r=B2e(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var H2e={ignoreTransform:!1};function LR(e,t){t===void 0&&(t=H2e);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=gR(e).getComputedStyle(e);t&&(n=V2e(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function U2e(e){return LR(e,{ignoreTransform:!0})}function W2e(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function G2e(e,t){return t===void 0&&(t=gR(e).getComputedStyle(e)),t.position===`fixed`}function K2e(e,t){t===void 0&&(t=gR(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function RR(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(_R(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!vR(i)||s2e(i)||n.includes(i))return n;let a=gR(e).getComputedStyle(i);return i!==e&&K2e(i,a)&&n.push(i),G2e(i,a)?n:r(i.parentNode)}return e?r(e):n}function q2e(e){let[t]=RR(e,1);return t??null}function zR(e){return!pR||!e?null:mR(e)?e:hR(e)?_R(e)||e===yR(e).scrollingElement?window:vR(e)?e:null:null}function J2e(e){return mR(e)?e.scrollX:e.scrollLeft}function Y2e(e){return mR(e)?e.scrollY:e.scrollTop}function BR(e){return{x:J2e(e),y:Y2e(e)}}var VR;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(VR||={});function X2e(e){return!pR||!e?!1:e===document.scrollingElement}function Z2e(e){let t={x:0,y:0},n=X2e(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Q2e={x:.2,y:.2};function $2e(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Q2e);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Z2e(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=VR.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=VR.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=VR.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=VR.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function e4e(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function t4e(e){return e.reduce((e,t)=>OR(e,BR(t)),IR)}function n4e(e){return e.reduce((e,t)=>e+J2e(t),0)}function r4e(e){return e.reduce((e,t)=>e+Y2e(t),0)}function i4e(e,t){if(t===void 0&&(t=LR),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);q2e(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var a4e=[[`x`,[`left`,`right`],n4e],[`y`,[`top`,`bottom`],r4e]],HR=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=RR(t),r=t4e(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of a4e)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,`rect`,{enumerable:!1})}},UR=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function o4e(e){let{EventTarget:t}=gR(e);return e instanceof t?e:yR(e)}function WR(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var GR;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(GR||={});function s4e(e){e.preventDefault()}function c4e(e){e.stopPropagation()}var KR;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(KR||={});var l4e={start:[KR.Space,KR.Enter],cancel:[KR.Esc],end:[KR.Space,KR.Enter,KR.Tab]},u4e=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case KR.Right:return{...n,x:n.x+25};case KR.Left:return{...n,x:n.x-25};case KR.Down:return{...n,y:n.y+25};case KR.Up:return{...n,y:n.y-25}}},d4e=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new UR(yR(t)),this.windowListeners=new UR(gR(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(GR.Resize,this.handleCancel),this.windowListeners.add(GR.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(GR.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&i4e(n),t(IR)}handleKeyDown(e){if(AR(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=l4e,coordinateGetter:a=u4e,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:IR;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=kR(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Z2e(n),p=e4e(n),m={x:Math.min(i===KR.Right?p.right-p.width/2:p.right,Math.max(i===KR.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===KR.Down?p.bottom-p.height/2:p.bottom,Math.max(i===KR.Down?p.top:p.top+p.height/2,u.y))},h=i===KR.Right&&!s||i===KR.Left&&!c,g=i===KR.Down&&!l||i===KR.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===KR.Right&&e<=d.x||i===KR.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===KR.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===KR.Down&&e<=d.y||i===KR.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===KR.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,OR(kR(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};d4e.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=l4e,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function f4e(e){return!!(e&&`distance`in e)}function p4e(e){return!!(e&&`delay`in e)}var qR=class{constructor(e,t,n){n===void 0&&(n=o4e(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=yR(i),this.documentListeners=new UR(this.document),this.listeners=new UR(n),this.windowListeners=new UR(gR(i)),this.initialCoordinates=jR(r)??IR,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(GR.Resize,this.handleCancel),this.windowListeners.add(GR.DragStart,s4e),this.windowListeners.add(GR.VisibilityChange,this.handleCancel),this.windowListeners.add(GR.ContextMenu,s4e),this.documentListeners.add(GR.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(p4e(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(f4e(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(GR.Click,c4e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(GR.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=jR(e)??IR,s=kR(n,o);if(!t&&a){if(f4e(a)){if(a.tolerance!=null&&WR(s,a.tolerance))return this.handleCancel();if(WR(s,a.distance))return this.handleStart()}if(p4e(a)&&WR(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===KR.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},m4e={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},JR=class extends qR{constructor(e){let{event:t}=e,n=yR(t.target);super(e,m4e,n)}};JR.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var h4e={move:{name:`mousemove`},end:{name:`mouseup`}},g4e;(function(e){e[e.RightClick=2]=`RightClick`})(g4e||={});var _4e=class extends qR{constructor(e){super(e,h4e,yR(e.event.target))}};_4e.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===g4e.RightClick?!1:(r?.({event:n}),!0)}}];var YR={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},v4e=class extends qR{constructor(e){super(e,YR)}static setup(){return window.addEventListener(YR.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(YR.move.name,e)};function e(){}}};v4e.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var XR;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(XR||={});var ZR;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(ZR||={});function y4e(e){let{acceleration:t,activator:n=XR.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=ZR.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=x4e({delta:d,disabled:!a}),[m,h]=c2e(),g=(0,B.useRef)({x:0,y:0}),_=(0,B.useRef)({x:0,y:0}),v=(0,B.useMemo)(()=>{switch(n){case XR.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case XR.DraggableRect:return i}},[n,i,c]),y=(0,B.useRef)(null),b=(0,B.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,B.useMemo)(()=>s===ZR.TreeOrder?[...l].reverse():l,[s,l]);(0,B.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=$2e(e,n,v,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){h(),y.current=e,m(b,o),g.current=a,_.current=i;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var b4e={x:{[VR.Backward]:!1,[VR.Forward]:!1},y:{[VR.Backward]:!1,[VR.Forward]:!1}};function x4e(e){let{delta:t,disabled:n}=e,r=TR(t);return CR(e=>{if(n||!r||!e)return b4e;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[VR.Backward]:e.x[VR.Backward]||i.x===-1,[VR.Forward]:e.x[VR.Forward]||i.x===1},y:{[VR.Backward]:e.y[VR.Backward]||i.y===-1,[VR.Forward]:e.y[VR.Forward]||i.y===1}}},[n,t,r])}function S4e(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return CR(e=>t==null?null:r??e??null,[r,t])}function C4e(e,t){return(0,B.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var QR;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(QR||={});var w4e;(function(e){e.Optimized=`optimized`})(w4e||={});var T4e=new Map;function E4e(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,B.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,B.useRef)(e),d=g(),f=SR(d),p=(0,B.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,B.useRef)(null),h=CR(t=>{if(d&&!n)return T4e;if(!t||t===T4e||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new HR(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,B.useEffect)(()=>{u.current=e},[e]),(0,B.useEffect)(()=>{d||p()},[n,d]),(0,B.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,B.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case QR.Always:return!1;case QR.BeforeDragging:return n;default:return!n}}}function $R(e,t){return CR(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function D4e(e,t){return $R(e,t)}function O4e(e){let{callback:t,disabled:n}=e,r=xR(t),i=(0,B.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,B.useEffect)(()=>()=>i?.disconnect(),[i]),i}function ez(e){let{callback:t,disabled:n}=e,r=xR(t),i=(0,B.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,B.useEffect)(()=>()=>i?.disconnect(),[i]),i}function k4e(e){return new HR(LR(e),e)}function A4e(e,t,n){t===void 0&&(t=k4e);let[r,i]=(0,B.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=O4e({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=ez({callback:a});return bR(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function j4e(e){return L2e(e,$R(e))}var M4e=[];function N4e(e){let t=(0,B.useRef)(e),n=CR(n=>e?n&&n!==M4e&&e&&t.current&&e.parentNode===t.current.parentNode?n:RR(e):M4e,[e]);return(0,B.useEffect)(()=>{t.current=e},[e]),n}function P4e(e){let[t,n]=(0,B.useState)(null),r=(0,B.useRef)(e),i=(0,B.useCallback)(e=>{let t=zR(e.target);t&&n(e=>e?(e.set(t,BR(t)),new Map(e)):null)},[]);return(0,B.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=zR(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,BR(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{zR(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,B.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>OR(e,t),IR):t4e(e):IR,[e,t])}function F4e(e,t){t===void 0&&(t=[]);let n=(0,B.useRef)(null);return(0,B.useEffect)(()=>{n.current=null},t),(0,B.useEffect)(()=>{let t=e!==IR;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?kR(e,n.current):IR}function I4e(e){(0,B.useEffect)(()=>{if(!pR)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function L4e(e,t){return(0,B.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function R4e(e){return(0,B.useMemo)(()=>e?W2e(e):null,[e])}var z4e=[];function B4e(e,t){t===void 0&&(t=LR);let[n]=e,r=R4e(n?gR(n):null),[i,a]=(0,B.useState)(z4e);function o(){a(()=>e.length?e.map(e=>X2e(e)?r:new HR(t(e),e)):z4e)}let s=ez({callback:o});return bR(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function V4e(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return vR(t)?t:e}function H4e(e){let{measure:t}=e,[n,r]=(0,B.useState)(null),i=ez({callback:(0,B.useCallback)(e=>{for(let{target:n}of e)if(vR(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=wR((0,B.useCallback)(e=>{let n=V4e(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,B.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var U4e=[{sensor:JR,options:{}},{sensor:d4e,options:{}}],W4e={current:{}},tz={draggable:{measure:U2e},droppable:{measure:U2e,strategy:QR.WhileDragging,frequency:w4e.Optimized},dragOverlay:{measure:LR}},nz=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},G4e={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new nz,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:FR},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:tz,measureDroppableContainers:FR,windowRect:null,measuringScheduled:!1},K4e={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:FR,draggableNodes:new Map,over:null,measureDroppableContainers:FR},rz=(0,B.createContext)(K4e),q4e=(0,B.createContext)(G4e);function J4e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new nz}}}function Y4e(e,t){switch(t.type){case PR.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case PR.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case PR.DragEnd:case PR.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case PR.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new nz(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case PR.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new nz(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case PR.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new nz(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function X4e(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,B.useContext)(rz),a=TR(r),o=TR(n?.id);return(0,B.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!AR(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=p2e(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Z4e(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Q4e(e){return(0,B.useMemo)(()=>({draggable:{...tz.draggable,...e?.draggable},droppable:{...tz.droppable,...e?.droppable},dragOverlay:{...tz.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function $4e(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,B.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;bR(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=L2e(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=q2e(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var iz=(0,B.createContext)({...IR,scaleX:1,scaleY:1}),az;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(az||={});var e3e=(0,B.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=U4e,collisionDetection:o=N2e,measuring:s,modifiers:c,...l}=e,[u,d]=(0,B.useReducer)(Y4e,void 0,J4e),[f,p]=b2e(),[m,h]=(0,B.useState)(az.Uninitialized),g=m===az.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,B.useRef)({initial:null,translated:null}),C=(0,B.useMemo)(()=>_==null?null:{id:_,data:x?.data??W4e,rect:S},[_,x]),w=(0,B.useRef)(null),[T,E]=(0,B.useState)(null),[D,O]=(0,B.useState)(null),k=SR(l,Object.values(l)),A=DR(`DndDescribedBy`,t),j=(0,B.useMemo)(()=>b.getEnabled(),[b]),M=Q4e(s),{droppableRects:N,measureDroppableContainers:P,measuringScheduled:F}=E4e(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),I=S4e(v,_),L=(0,B.useMemo)(()=>D?jR(D):null,[D]),ee=ke(),R=D4e(I,M.draggable.measure);$4e({activeNode:_==null?null:v.get(_),config:ee.layoutShiftCompensation,initialRect:R,measure:M.draggable.measure});let te=A4e(I,M.draggable.measure,R),ne=A4e(I?I.parentElement:null),re=(0,B.useRef)({activatorEvent:null,active:null,activeNode:I,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=b.getNodeFor(re.current.over?.id),z=H4e({measure:M.dragOverlay.measure}),ae=z.nodeRef.current??I,oe=g?z.rect??te:null,se=!!(z.nodeRef.current&&z.rect),ce=j4e(se?null:te),le=R4e(ae?gR(ae):null),ue=N4e(g?ie??I:null),de=B4e(ue),fe=Z4e(c,{transform:{x:y.x-ce.x,y:y.y-ce.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:te,containerNodeRect:ne,draggingNodeRect:oe,over:re.current.over,overlayNodeRect:z.rect,scrollableAncestors:ue,scrollableAncestorRects:de,windowRect:le}),pe=L?OR(L,y):null,me=P4e(ue),he=F4e(me),ge=F4e(me,[te]),_e=OR(fe,he),ve=oe?z2e(oe,fe):null,ye=C&&ve?o({active:C,collisionRect:ve,droppableRects:N,droppableContainers:j,pointerCoordinates:pe}):null,be=j2e(ye,`id`),[xe,Se]=(0,B.useState)(null),Ce=I2e(se?fe:OR(fe,ge),xe?.rect??null,te),we=(0,B.useRef)(null),Te=(0,B.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent;we.current=new n({active:w.current,activeNode:i,event:a,options:r,context:re,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,NR.unstable_batchedUpdates)(()=>{r?.(i),h(az.Initializing),d({type:PR.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(we.current),O(a)})},onMove(e){d({type:PR.DragMove,coordinates:e})},onEnd:o(PR.DragEnd),onCancel:o(PR.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=re.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===PR.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=PR.DragCancel)}w.current=null,(0,NR.unstable_batchedUpdates)(()=>{d({type:e}),h(az.Uninitialized),Se(null),E(null),O(null),we.current=null;let t=e===PR.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Ee=C4e(a,(0,B.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,Te(n,t))},[v,Te]));I4e(a),bR(()=>{te&&m===az.Initializing&&h(az.Initialized)},[te,m]),(0,B.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=re.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:_e.x,y:_e.y},over:i};(0,NR.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[_e.x,_e.y]),(0,B.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=re.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(be),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,NR.unstable_batchedUpdates)(()=>{Se(s),a?.(c),f({type:`onDragOver`,event:c})})},[be]),bR(()=>{re.current={activatorEvent:D,active:C,activeNode:I,collisionRect:ve,collisions:ye,droppableRects:N,draggableNodes:v,draggingNode:ae,draggingNodeRect:oe,droppableContainers:b,over:xe,scrollableAncestors:ue,scrollAdjustedTranslate:_e},S.current={initial:oe,translated:ve}},[C,I,ye,ve,v,ae,oe,N,b,xe,ue,_e]),y4e({...ee,delta:y,draggingRect:ve,pointerCoordinates:pe,scrollableAncestors:ue,scrollableAncestorRects:de});let De=(0,B.useMemo)(()=>({active:C,activeNode:I,activeNodeRect:te,activatorEvent:D,collisions:ye,containerNodeRect:ne,dragOverlay:z,draggableNodes:v,droppableContainers:b,droppableRects:N,over:xe,measureDroppableContainers:P,scrollableAncestors:ue,scrollableAncestorRects:de,measuringConfiguration:M,measuringScheduled:F,windowRect:le}),[C,I,te,D,ye,ne,z,v,b,N,xe,P,ue,de,M,F,le]),Oe=(0,B.useMemo)(()=>({activatorEvent:D,activators:Ee,active:C,activeNodeRect:te,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:xe,measureDroppableContainers:P}),[D,Ee,C,te,d,A,v,xe,P]);return B.createElement(v2e.Provider,{value:p},B.createElement(rz.Provider,{value:Oe},B.createElement(q4e.Provider,{value:De},B.createElement(iz.Provider,{value:Ce},i)),B.createElement(X4e,{disabled:n?.restoreFocus===!1})),B.createElement(C2e,{...n,hiddenTextDescribedById:A}));function ke(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),t3e=(0,B.createContext)(null),n3e=`button`,r3e=`Draggable`;function i3e(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=DR(r3e),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,B.useContext)(rz),{role:p=n3e,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,B.useContext)(g?iz:t3e),[v,y]=wR(),[b,x]=wR(),S=L4e(o,t),C=SR(n);return bR(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,B.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===n3e?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function a3e(){return(0,B.useContext)(q4e)}var o3e=`Droppable`,s3e={timeout:25};function c3e(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=DR(o3e),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,B.useContext)(rz),u=(0,B.useRef)({disabled:n}),d=(0,B.useRef)(!1),f=(0,B.useRef)(null),p=(0,B.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...s3e,...i},_=SR(h??r),v=ez({callback:(0,B.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=wR((0,B.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=SR(t);return(0,B.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,B.useEffect)(()=>(s({type:PR.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:PR.UnregisterDroppable,key:a,id:r})),[r]),(0,B.useEffect)(()=>{n!==u.current.disabled&&(s({type:PR.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function l3e(e){let{animation:t,children:n}=e,[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null),s=TR(n);return!n&&!r&&s&&i(s),bR(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),B.createElement(B.Fragment,null,n,r?(0,B.cloneElement)(r,{ref:o}):null)}var u3e={x:0,y:0,scaleX:1,scaleY:1};function d3e(e){let{children:t}=e;return B.createElement(rz.Provider,{value:K4e},B.createElement(iz.Provider,{value:u3e},t))}var f3e={position:`fixed`,touchAction:`none`},p3e=e=>AR(e)?`transform 250ms ease`:void 0,m3e=(0,B.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=p3e}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...f3e,width:s.width,height:s.height,top:s.top,left:s.left,transform:MR.Transform.toString(d),transformOrigin:i&&r?D2e(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return B.createElement(n,{className:o,style:f,ref:t},a)}),h3e={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:MR.Transform.toString(t)},{transform:MR.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function g3e(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return xR((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=V4e(a);if(!c)return;let{transform:l}=gR(a).getComputedStyle(a),u=B2e(l);if(!u)return;let d=typeof t==`function`?t:_3e(t);return i4e(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function _3e(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...h3e,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var v3e=0;function y3e(e){return(0,B.useMemo)(()=>{if(e!=null)return v3e++,v3e},[e])}var b3e=B.memo(e=>
275{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=a3e(),S=(0,B.useContext)(iz),C=y3e(d?.id),w=Z4e(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),T=$R(f),E=g3e({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return B.createElement(d3e,null,B.createElement(l3e,{animation:E},d&&C?B.createElement(m3e,{key:C,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:T,style:{zIndex:l,...i},transform:w},n):null))}),x3e=[`open`,`active`,`on_hold`,`closed`,`archived`];function S3e({open:e,onOpenChange:t}){let{t:n}=V(),r=Sv(),{createMatter:i}=Yx(),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(`open`),[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(null),h=e=>e===`open`?n(`matters.open_matters`):e===`closed`?n(`matters.closed_matters`):e===`active`?n(`settings.integrations.connected`):e===`archived`?n(`mail.folders.archive`):e.replace(`_`,` `),g=()=>{o(``),c(``),u(`open`),m(null)},_=e=>{e||g(),t(e)};return(0,K.jsx)(HC,{open:e,onOpenChange:_,children:(0,K.jsxs)(WC,{children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:n(`matters.new_dialog.title`)}),(0,K.jsx)(JC,{children:n(`matters.new_dialog.description`)})]}),(0,K.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!a.trim()){m(n(`common.required`));return}f(!0);try{let e=await i({name:a.trim(),description:s.trim()||null,status:l??`open`,parties:[],notes:null});_(!1),r(`/matters/${e.id}`)}catch(e){m(Kb(e,n(`toasts.matter.create_failed`)))}finally{f(!1)}},className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`matter-name`,children:n(`matters.new_dialog.matter_name`)}),(0,K.jsx)(dP,{id:`matter-name`,value:a,onChange:e=>o(e.target.value),placeholder:n(`matters.new_dialog.matter_name_placeholder`),required:!0,autoFocus:!0})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`matter-desc`,children:n(`matters.new_dialog.matter_description`)}),(0,K.jsx)(`textarea`,{id:`matter-desc`,value:s,onChange:e=>c(e.target.value),placeholder:n(`matters.new_dialog.matter_description_placeholder`),rows:3,className:`w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring`})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(pP,{children:n(`common.status`)}),(0,K.jsxs)(vO,{value:l??`open`,onValueChange:e=>u(e),children:[(0,K.jsx)(bO,{children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:x3e.map(e=>(0,K.jsx)(SO,{value:e,children:h(e)},e))})]})]}),p&&(0,K.jsx)(`p`,{className:`text-sm text-destructive`,children:p}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{type:`button`,variant:`outline`,onClick:()=>_(!1),children:n(`common.cancel`)}),(0,K.jsx)(J,{type:`submit`,disabled:d,children:n(d?`matters.new_dialog.creating`:`matters.new_dialog.create`)})]})]})]})})}var C3e=[`open`,`active`,`on_hold`,`closed`,`archived`];function w3e(){let{t:e}=V(),t=Sv(),n=xv(),r=RS(),i=t=>t===`open`?e(`matters.open_matters`):t===`closed`?e(`matters.closed_matters`):t===`active`?e(`settings.integrations.connected`):t===`archived`?e(`mail.folders.archive`):t.replace(`_`,` `),{matters:a,isLoadingMatters:o,searchResults:s,isSearching:c,statusFilter:l,setStatusFilter:u,fetchMatters:d,searchMatters:f,clearSearch:p}=Yx(),[m,h]=(0,B.useState)(``),[g,_]=(0,B.useState)(``),[v,y]=(0,B.useState)(!1);(0,B.useEffect)(()=>{d()},[d]),(0,B.useEffect)(()=>{let e=setTimeout(()=>_(m.trim()),250);return()=>clearTimeout(e)},[m]),(0,B.useEffect)(()=>{g?f(g):p()},[g,f,p]);let b=n.pathname.match(/^\/matters\/([^/]+)/)?.[1],x=m.trim()!==g,S=m.trim()?s:a,C=m.trim()?(x||c)&&S.length===0:o&&S.length===0,w=r!==`viewer`;return(0,K.jsxs)(`div`,{className:`flex h-full w-full min-w-0 flex-col`,children:[(0,K.jsxs)(lL,{className:`flex-col items-stretch gap-3 border-b p-4 pb-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(cR,{}),(0,K.jsx)($T,{i18nKey:`tour.matters.panel`,side:`bottom`,children:(0,K.jsx)(`div`,{className:`text-base font-medium text-foreground`,children:e(`matters.title`)})})]}),w&&(0,K.jsx)($T,{i18nKey:`tour.matters.new`,side:`right`,children:(0,K.jsx)(J,{size:`sm`,variant:`ghost`,className:`h-7 px-2`,onClick:()=>y(!0),"aria-label":e(`matters.new_matter`),children:(0,K.jsx)(T_,{className:`h-4 w-4`})})})]}),(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(A_,{className:`pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,K.jsx)(dP,{value:m,onChange:e=>h(e.target.value),placeholder:e(`matters.search_placeholder`),className:`h-8 pl-7 text-sm`})]}),(0,K.jsxs)(vO,{value:l??`all`,onValueChange:e=>u(e===`all`?null:e),children:[(0,K.jsx)(bO,{className:`h-8 text-xs`,children:(0,K.jsx)(yO,{placeholder:e(`common.all`)})}),(0,K.jsxs)(xO,{children:[(0,K.jsx)(SO,{value:`all`,children:e(`common.all`)}
275),C3e.map(e=>(0,K.jsx)(SO,{value:e,children:i(e)},e))]})]})]}),(0,K.jsx)(uL,{children:(0,K.jsx)(dL,{className:`px-0`,children:(0,K.jsx)(fL,{children:C?(0,K.jsx)(`div`,{className:`p-4 text-center text-sm text-muted-foreground`,children:e(`common.loading`)}):S.length===0?m.trim()?(0,K.jsx)(`div`,{className:`p-4 text-center text-sm text-muted-foreground`,children:e(`common.no_results`)}):(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2 p-6 text-center text-muted-foreground`,children:[(0,K.jsx)(jg,{className:`h-7 w-7`}),(0,K.jsx)(`div`,{className:`text-sm`,children:e(`matters.no_matters`)}),w&&(0,K.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>y(!0),children:e(`matters.create_first`)})]}):(0,K.jsx)(`ul`,{className:`flex flex-col`,children:S.map(n=>(0,K.jsx)(E3e,{matter:n,active:b===n.id,statusLabel:i,inboxLabel:e(`dashboard.inbox`),personalLabel:e(`matters.personal`),onSelect:()=>t(`/matters/${n.id}`)},n.id))})})})}),(0,K.jsx)(S3e,{open:v,onOpenChange:y})]})}function T3e({matter:e}){return e.is_inbox?(0,K.jsx)(l_,{className:`h-4 w-4 shrink-0 text-muted-foreground`}):e.is_personal?(0,K.jsx)(G_,{className:`h-4 w-4 shrink-0 text-muted-foreground`}):(0,K.jsx)(jg,{className:`h-4 w-4 shrink-0 text-muted-foreground`})}function E3e({matter:e,active:t,statusLabel:n,inboxLabel:r,personalLabel:i,onSelect:a}){let{setNodeRef:o,isOver:s,active:c}=c3e({id:`matter:${e.id}`,data:{type:`matter`,matterId:e.id}}),l=c?.data.current,u=s&&l?.type===`thread`&&l.matterId!==e.id;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{ref:o,type:`button`,onClick:a,"data-drop-target":u,className:`flex w-full items-center gap-2 border-b px-3 py-2 text-left text-sm hover:bg-muted/60 data-[drop-target=true]:bg-accent data-[drop-target=true]:ring-1 data-[drop-target=true]:ring-inset data-[drop-target=true]:ring-primary/40 `+(t?`bg-muted`:``),children:[(0,K.jsx)(T3e,{matter:e}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,K.jsx)(`span`,{children:n(e.status)}),(e.email_task_count??0)>0&&(0,K.jsxs)(`span`,{children:[`· `,e.email_task_count??0]}),(e.document_count??0)>0&&(0,K.jsxs)(`span`,{children:[`· `,e.document_count??0]})]})]}),e.is_inbox&&(0,K.jsx)(lR,{variant:`secondary`,className:`text-[10px]`,children:r}),e.is_personal&&(0,K.jsx)(lR,{variant:`secondary`,className:`text-[10px]`,children:i})]})})}function D3e(){let{t:e}=V(),t=DS(e=>e.provider),n=DS(e=>e.customFolders),r=DS(e=>e.customFoldersLoaded),i=DS(e=>e.setCurrentFolder);return!lS[t].supportsCustomFolders||!r||n.length===0?null:(0,K.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`px-2 mb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e(`mail.custom_folders`)}),(0,K.jsx)(`ul`,{className:`space-y-0.5`,children:n.map(e=>{let t=`folder:${e.id}`;return(0,K.jsx)(`li`,{children:(0,K.jsx)(Kv,{to:`/inbox/${t}`,end:!1,onClick:()=>i(t),style:{paddingLeft:`${.75+e.depth*.875}rem`},className:({isActive:e})=>q(`group relative flex h-9 items-center gap-2 rounded-md pr-3 text-sm`,`transition-colors duration-150`,e?`bg-primary/10 text-foreground font-semibold`:`hover:bg-muted/60 text-foreground/80`),children:({isActive:t})=>(0,K.jsxs)(K.Fragment,{children:[t&&(0,K.jsx)(`span`,{className:`absolute left-0 top-0 bottom-0 w-1 rounded-r-full bg-primary`}),(0,K.jsx)(Moe,{className:q(`size-4 shrink-0`,t?`text-primary`:`text-muted-foreground`)}),(0,K.jsx)(`span`,{className:`truncate`,children:e.name}),e.unread>0&&(0,K.jsx)(`span`,{className:q(`ml-auto text-xs tabular-nums`,t?`text-foreground`:`text-muted-foreground`),children:e.unread})]})})},e.id)})})]})}var O3e=[{slug:`inbox`,labelKey:`mail.folders.inbox`,icon:l_,countField:`unread`},{slug:`starred`,labelKey:`mail.folders.starred`,icon:R_,countField:`total`},{slug:`important`,labelKey:`mail.folders.important`,icon:Hg,countField:`unread`,capability:`supportsImportantFolder`},{slug:`sent`,labelKey:`mail.folders.sent`,icon:j_,countField:`total`},{slug:`drafts`,labelKey:`mail.folders.drafts`,icon:i_,countField:`total`},{slug:`all`,labelKey:`mail.folders.all`,icon:Cg},{slug:`spam`,labelKey:`mail.folders.spam`,icon:rse,countField:`unread`},{slug:`trash`,labelKey:`mail.folders.trash`,icon:V_,countField:`total`}];function k3e(){let{t:e}=V(),t=DS(e=>e.folderCounts),n=DS(e=>e.provider),r=DS(e=>e.setCurrentFolder),i=lS[n];return(0,K.jsx)(`ul`,{className:`px-1 py-1 space-y-0.5`,children:O3e.filter(e=>!e.capability||i[e.capability]).map(n=>
275{let a=i.folderCountKeys[n.slug],o=a?t[a]:null,s=o&&n.countField?o[n.countField]:0;return(0,K.jsx)(`li`,{children:(0,K.jsx)(Kv,{to:`/inbox/${n.slug}`,end:!1,onClick:()=>r(n.slug),className:({isActive:e})=>q(`group relative flex h-9 items-center gap-2 rounded-md px-3 text-sm`,`transition-colors duration-150`,e?`bg-primary/10 text-foreground font-semibold`:`hover:bg-muted/60 text-foreground/80`),children:({isActive:t})=>(0,K.jsxs)(K.Fragment,{children:[t&&(0,K.jsx)(`span`,{className:`absolute left-0 top-0 bottom-0 w-1 rounded-r-full bg-primary`}),(0,K.jsx)(n.icon,{className:q(`size-4`,t?`text-primary`:`text-muted-foreground`)}),(0,K.jsx)(`span`,{className:`truncate`,children:e(n.labelKey)}),s>0&&(0,K.jsx)(`span`,{className:q(`ml-auto text-xs tabular-nums`,t?`text-foreground`:`text-muted-foreground`),children:s})]})})},n.slug)})})}function A3e(){let e=DS(e=>e.labels),t=DS(e=>e.labelsLoaded),n=DS(e=>e.setCurrentFolder),r=e.filter(e=>e.type===`user`);return!t||r.length===0?null:(0,K.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`px-2 mb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground`,children:`Labels`}),(0,K.jsx)(`ul`,{className:`space-y-0.5`,children:r.map(e=>{let t=`label:${e.id}`;return(0,K.jsx)(`li`,{children:(0,K.jsx)(Kv,{to:`/inbox/${t}`,end:!1,onClick:()=>n(t),className:({isActive:e})=>q(`group relative flex h-9 items-center gap-2 rounded-md px-3 text-sm`,`transition-colors duration-150`,e?`bg-primary/10 text-foreground font-semibold`:`hover:bg-muted/60 text-foreground/80`),children:({isActive:t})=>(0,K.jsxs)(K.Fragment,{children:[t&&(0,K.jsx)(`span`,{className:`absolute left-0 top-0 bottom-0 w-1 rounded-r-full bg-primary`}),e.color?(0,K.jsx)(`span`,{className:`size-2 rounded-full shrink-0`,style:{backgroundColor:e.color}}):(0,K.jsx)(z_,{className:`size-3.5 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`truncate`,children:e.name}),e.unread_count>0&&(0,K.jsx)(`span`,{className:q(`ml-auto text-xs tabular-nums`,t?`text-foreground`:`text-muted-foreground`),children:e.unread_count})]})})},e.id)})})]})}function j3e(){let{t:e}=V(),t=Sv(),{folder:n}=Cv(),r=fS(),i=DS(e=>e.provider),a=DS(e=>e.setProvider),o=DS(e=>e.loadFolder),s=DS(e=>e.loadLabels),c=DS(e=>e.loadCustomFolders),l=DS(e=>e.loadFolderCounts),u=(0,B.useMemo)(()=>eS.filter(e=>r[e].connected).map(t=>({id:t,label:e(lS[t].labelKey),email:r[t].accountEmail})),[r,e]);if(u.length===0)return null;let d=u.find(e=>e.id===i)??u[0];return u.length===1?(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium text-foreground/80`,children:d.label}),d.email&&(0,K.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:d.email})]}):(0,K.jsx)(`div`,{className:`flex flex-col gap-1`,children:(0,K.jsxs)(vO,{value:d.id,onValueChange:e=>{if(e===i||!tS(e))return;a(e);let r=n??`inbox`;r===`important`&&!lS[e].supportsImportantFolder?(t(`/inbox/inbox`),o(`inbox`,{force:!0})):o(r,{force:!0}),s(),c(),l()},children:[(0,K.jsx)(bO,{className:`h-8 w-full text-xs`,children:(0,K.jsx)(yO,{placeholder:`Provider`})}),(0,K.jsx)(xO,{children:u.map(e=>(0,K.jsxs)(SO,{value:e.id,className:`text-xs`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:e.label}),e.email&&(0,K.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:e.email})]},e.id))})]})})}function M3e(){let e=Sv(),t=fS(),n=DS(e=>e.provider),r=DS(e=>e.openCompose),i=DS(e=>e.loadLabels),a=DS(e=>e.loadCustomFolders),o=DS(e=>e.loadFolderCounts),s=t[n].connected,c=eS.some(e=>
275t[e].connected);return(0,B.useEffect)(()=>{for(let e of eS)lS[e].fetchStatus()},[]),(0,B.useEffect)(()=>{s&&(i(),a(),o())},[s,n,i,a,o]),(0,K.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,K.jsxs)(lL,{className:`border-b px-4 py-3 gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(cR,{}),(0,K.jsx)($T,{i18nKey:`tour.mail.folders`,side:`right`,children:(0,K.jsx)(`div`,{className:`text-base font-semibold tracking-tight`,children:`Inbox`})})]}),c&&(0,K.jsx)(j3e,{})]}),(0,K.jsx)(`div`,{className:`px-3 pt-3`,children:(0,K.jsxs)(`button`,{type:`button`,disabled:!s,onClick:()=>{r(`new`),e(`/inbox/inbox`)},className:` 276 flex h-10 w-full items-center justify-center gap-2 rounded-lg 277 bg-blue-600 text-white shadow-sm font-medium text-sm 278 transition-colors duration-150 hover:bg-blue-700 279 disabled:cursor-not-allowed disabled:opacity-50 280 `,children:[(0,K.jsx)(w_,{className:`size-4`}),`Compose`]})}),(0,K.jsxs)(uL,{children:[(0,K.jsx)(dL,{children:(0,K.jsx)(fL,{children:(0,K.jsx)(k3e,{})})}),(0,K.jsx)(dL,{children:(0,K.jsx)(fL,{children:(0,K.jsx)(D3e,{})})}),(0,K.jsx)(dL,{children:(0,K.jsx)(fL,{children:(0,K.jsx)(A3e,{})})})]})]})}const N3e=[{titleKey:`settings.groups.account`,items:[{id:`profile`,path:`/settings/profile`,icon:K_,labelKey:`settings.tabs.profile`,descriptionKey:`settings.profile.description`},{id:`organization`,path:`/settings/organization`,icon:Mg,labelKey:`settings.tabs.organization`,descriptionKey:`settings.organization.description`,orgOnly:!0}]},{titleKey:`settings.groups.billing`,items:[{id:`billing`,path:`/settings/billing`,icon:poe,labelKey:`settings.tabs.billing`,descriptionKey:`settings.billing.description`},{id:`usage`,path:`/settings/usage`,icon:ioe,labelKey:`settings.tabs.usage`,descriptionKey:`settings.usage.description`},{id:`extra-usage`,path:`/settings/extra-usage`,icon:T_,labelKey:`settings.tabs.extra_usage`,descriptionKey:`settings.extra_usage.description`}]},{titleKey:`settings.groups.notifications`,items:[{id:`notifications`,path:`/settings/notifications`,icon:Zae,labelKey:`settings.tabs.notifications`,descriptionKey:`settings.notifications_view.description`},{id:`integrations`,path:`/settings/integrations`,icon:cse,labelKey:`settings.tabs.integrations`,descriptionKey:`settings.integrations.description`}]},{titleKey:`settings.groups.developer`,items:[{id:`api-keys`,path:`/settings/api-keys`,icon:d_,labelKey:`settings.tabs.api_keys`,descriptionKey:`settings.api_keys.description`}]},{titleKey:`settings.groups.support`,items:[{id:`support`,path:`/settings/support`,icon:f_,labelKey:`settings.tabs.support`,descriptionKey:`settings.support.description`,fullBleed:!0}]}];function P3e(e){for(let t of N3e)for(let n of t.items)if(e===n.path||e.startsWith(n.path+`/`))return n;return null}function F3e(){let{t:e}=V(),t=Sv(),n=xv(),r=Nx(e=>e.user?.current_org_id??null),i=e=>n.pathname===e||n.pathname.startsWith(e+`/`);return(0,K.jsxs)(cL,{collapsible:`none`,className:`h-svh border-r w-(--sidebar-width-icon)`,children:[(0,K.jsx)(lL,{className:`p-2`,children:(0,K.jsx)(pL,{children:(0,K.jsx)(mL,{children:(0,K.jsxs)(hL,{onClick:()=>{t(`/dashboard`)},className:`h-9 px-3 hover:bg-neutral-200 dark:hover:bg-neutral-800`,children:[(0,K.jsx)(Tg,{}),(0,K.jsx)(`span`,{children:e(`settings.back_to_app`)})]})})})}),(0,K.jsx)(uL,{children:N3e.map(n=>{let a=n.items.filter(e=>!e.orgOnly||r);return a.length===0?null:(0,K.jsxs)(dL,{children:[(0,K.jsx)(AZe,{children:e(n.titleKey)}),(0,K.jsx)(fL,{children:(0,K.jsx)(pL,{children:a.map(n=>{let r=n.icon;return(0,K.jsx)(mL,{children:(0,K.jsxs)(hL,{onClick:()=>t(n.path),isActive:i(n.path),className:`h-9 px-3 hover:bg-neutral-200 data-[active=true]:bg-neutral-300 dark:hover:bg-neutral-800 dark:data-[active=true]:bg-neutral-700`,children:[(0,K.jsx)(r,{}),(0,K.jsx)(`span`,{children:e(n.labelKey)})]})},n.id)})})})]},n.titleKey)})}),(0,K.jsx)(kZe,{children:(0,K.jsx)(Y0e,{})})]})}function oz({className:e,...t}){return(0,K.jsx)(Jke,{"data-slot":`radio-group`,className:q(`grid gap-3`,e),...t})}function sz({className:e,...t}){return(0,K.jsx)(Yke,{"data-slot":`radio-group-item`,className:q(`border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,K.jsx)(Xke,{"data-slot":`radio-group-indicator`,className:`relative flex items-center justify-center`,children:(0,K.jsx)(Kg,{className:`fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2`})})})}var cz=`none`;function I3e({open:e,onOpenChange:t,message:n,sourceTaskId:r}){let{t:i}=V(),a=Ux(e=>e.promoteMessage),o=JI(e=>e.playbooks),s=JI(e=>e.fetchPlaybooks),c=n.has_attachments===!0,[l,u]=(0,B.useState)(c?`redline`:`draft`),[d,f]=(0,B.useState)(cz),[p,m]=(0,B.useState)(!1);(0,B.useEffect)(()=>{e&&(u(c?`redline`:`draft`),f(cz),m(!1))},[e,c]),(0,B.useEffect)(()=>{e&&o.length===0&&s()},[e,o.length,s]);let h=o.filter(e=>e.is_current).sort((e,t)=>
280e.name.localeCompare(t.name)),g=async()=>{if(n.provider_message_id){m(!0);try{await a(r,n.provider_message_id,l,l===`redline`&&d!==cz?d:void 0),G.success(i(`email.thread.promote_success`)),t(!1)}catch{}finally{m(!1)}}};return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsxs)(WC,{children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:i(`email.thread.promote_title`)}),(0,K.jsx)(JC,{children:i(`email.thread.promote_description`)})]}),(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(pP,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:i(`email.thread.promote_intent_label`)}),(0,K.jsxs)(oz,{value:l,onValueChange:e=>u(e),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(sz,{value:`draft`,id:`promote-intent-draft`}),(0,K.jsx)(pP,{htmlFor:`promote-intent-draft`,className:`font-normal`,children:i(`email.thread.promote_intent_draft`)})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(sz,{value:`redline`,id:`promote-intent-redline`,disabled:!c}),(0,K.jsx)(pP,{htmlFor:`promote-intent-redline`,className:q(`font-normal`,!c&&`text-muted-foreground`),children:i(`email.thread.promote_intent_redline`)})]})]}),!c&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`email.thread.promote_redline_needs_attachment`)})]}),l===`redline`&&(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(pP,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:i(`email.thread.promote_playbook`)}),(0,K.jsxs)(vO,{value:d,onValueChange:f,children:[(0,K.jsx)(bO,{className:`w-full`,children:(0,K.jsx)(yO,{})}),(0,K.jsxs)(xO,{children:[(0,K.jsx)(SO,{value:cz,children:i(`email.thread.promote_playbook_none`)}),h.map(e=>(0,K.jsx)(SO,{value:e.id,children:e.name},e.id))]})]})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`outline`,onClick:()=>t(!1),children:i(`common.cancel`)}),(0,K.jsx)(J,{onClick:()=>void g(),disabled:p,children:i(`email.thread.promote_submit`)})]})]})})}function L3e({message:e}){let{t}=V();return e.attachments_restricted?(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,K.jsx)(g_,{className:`size-3.5 text-amber-600 dark:text-amber-400`,"aria-label":t(`email.attachments.restricted_title`)})})}),(0,K.jsx)(GT,{children:t(`email.attachments.restricted_title`)})]}):e.has_attachments?(0,K.jsx)(C_,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-label":`Has attachments`}):null}function R3e({message:e,thread:t,isActive:n=!1,variant:r=`email`}){let{t:i}=V(),{formatDate:a}=jb(),o=Sv(),s=xv(),c=Ux(e=>e.selectedTask),[l,u]=(0,B.useState)(!1),d=e.direction===`outbound`,f=e.is_processed!==!1,p=!!e.from.is_self,m=e.from.is_self?i(`common.you`):e.from.name||e.from.email||i(`common.unknown`),h=e.subject??null,g=r===`email`?!!(h&&h!==t?.subject):!!h,_=r===`email`&&!e.email_task_id&&!!e.provider_message_id&&!!c&&!d&&!p,v=r===`email`&&!f&&!d&&!p,y=t=>{if(t.stopPropagation(),e.email_task_id){o(`/email-task?taskId=${e.email_task_id}`,{replace:r===`email`,state:{from:s.pathname}});return}_&&u(!0)},b=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`mt-1 shrink-0`,children:d?(0,K.jsx)(Og,{className:`h-3.5 w-3.5 text-blue-600`}):(0,K.jsx)(wg,{className:`h-3.5 w-3.5 text-muted-foreground`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-sm font-medium`,children:m}),(0,K.jsx)(L3e,{message:e}),v&&(0,K.jsx)(lR,{variant:`outline`,className:`text-[10px] py-0`,children:i(`email.thread.not_processed`)}),r===`matter`&&e.business_days_since_previous!=null&&e.business_days_since_previous>0&&(0,K.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[`·`,` `,i(`matters.threads.business_days_later`,{count:e.business_days_since_previous})]}),(0,K.jsx)(`span`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground`,children:a(e.sent_at,`MMM d, h:mm a`)})]}),g&&(0,K.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:h||i(`email.thread.no_subject`)}),e.body_preview&&(0,K.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-muted-foreground`,children:e.body_preview})]})]});return r===`matter`?(0,K.jsx)(`button`,{type:`button`,onClick:y,className:q(`flex w-full gap-3 rounded-md border bg-background px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`,d?`border-blue-200 dark:border-blue-900`
280:`border-border`),children:b}):(0,K.jsxs)(`li`,{className:`list-none`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:y,className:q(`relative flex w-full gap-3 border-b px-3 py-2 text-left text-sm transition-colors`,e.email_task_id||_?`cursor-pointer hover:bg-muted/40`:`cursor-default`,n&&`bg-muted`,v&&`opacity-90`),children:[n&&(0,K.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-0.5 bg-primary`}),b]}),_&&c&&(0,K.jsx)(I3e,{open:l,onOpenChange:u,message:e,sourceTaskId:c.id})]})}function z3e({previous:e,current:t}){let{t:n}=V(),r=Epe(e.sent_at,t.sent_at,t.business_days_since_previous);if(!r)return null;let i;switch(r.kind){case`moments`:i=n(`email.thread.step_latency.moments`);break;case`minutes`:i=n(`email.thread.step_latency.minutes`,{count:r.count});break;case`hours`:i=r.minutes===0?n(`email.thread.step_latency.hours`,{count:r.hours}):n(`email.thread.step_latency.hours_minutes`,{hours:r.hours,minutes:r.minutes});break;case`business_days`:i=n(`email.thread.step_latency.business_days`,{count:r.count});break;case`days`:i=n(`email.thread.step_latency.days`,{count:r.count});break}return(0,K.jsx)(`li`,{className:`list-none border-b`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-center gap-1.5 px-3 py-1.5 text-[11px] text-muted-foreground`,children:[(0,K.jsx)(wg,{"aria-hidden":!0,className:`h-3 w-3 opacity-60`}),(0,K.jsx)(`span`,{children:i})]})})}function B3e({label:e}){return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground`,children:[(0,K.jsx)(Lg,{className:`size-3`}),e]})}function V3e(e,t){let n=e instanceof Date?e:new Date(e),r=t instanceof Date?t:new Date(t);if(r.getTime()<=n.getTime())return 0;let i=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()),a=Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),o=Math.round((a-i)/(1e3*60*60*24));if(o<=0)return 0;let s=Math.floor(o/7),c=o-s*7,l=s*5,u=(new Date(i).getUTCDay()+1)%7;for(let e=0;e<c;e++)u>=1&&u<=5&&(l+=1),u=(u+1)%7;return l}function H3e(e){return V3e(e,new Date)}function U3e(e,t){return e>=t.criticalDays?`critical`:e>=t.warnDays?`warn`:`ok`}function W3e({state:e,businessDays:t,lastMessageAt:n,warnDays:r,criticalDays:i}){let a=H3e(n),o=U3e(a,{warnDays:r,criticalDays:i}),s=a>t?o:e,c=Math.max(a,t);return s===`ok`?null:(0,K.jsxs)(lR,{variant:s===`critical`?`destructive`:`secondary`,className:`gap-1 text-[10px]`,children:[(0,K.jsx)(H_,{className:`h-3 w-3`}),c,` business day`,c===1?``:`s`]})}function G3e({participant:e,className:t}){let n=e.is_self?`Your turn`:`${K3e(e)}'s turn`;return(0,K.jsx)(`span`,{className:q(`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium`,e.is_self?`bg-blue-100 text-blue-900 dark:bg-blue-950 dark:text-blue-200`:`bg-muted text-muted-foreground`,t),children:n})}function K3e(e){return e.name?e.name.split(/\s+/)[0]||e.name:e.email.split(`@`)[0]||e.email}function q3e(e){let t=(e.participants??[]).filter(e=>!e.is_self);return t.length===0?`Just you`:t.slice(0,3).map(e=>e.name||e.email).join(`, `)+(t.length>3?` +${t.length-3}`:``)}function lz(){let{t:e}=V(),t=Ux(e=>e.selectedTask?.matter_id??null),n=Ux(e=>e.selectedTask?.thread_id??null),r=Ux(e=>e.thread?.is_resolved??!1),i=Ux(e=>e.markThreadCompleted),a=Ux(e=>e.reopenThread);return!t||!n?null:r?(0,K.jsx)(J,{variant:`ghost`,size:`sm`,className:`h-7 shrink-0 text-muted-foreground`,onClick:()=>void a(t,n),children:e(`email.thread.reopen`)}):(0,K.jsxs)(J,{variant:`outline`,size:`sm`,className:`h-7 shrink-0 gap-1`,onClick:()=>void i(t,n),children:[(0,K.jsx)(Lg,{className:`size-3.5`}),e(`email.thread.mark_completed`)]})}function J3e({thread:e}){let{t}=V(),n=Ux(e=>e.selectedTask?.matter_id??null),r=Ux(e=>e.selectedTask?.thread_id??null),i=Q(e=>e.knowledgeBases),a=Q(e=>e.fetchKnowledgeBases),o=Yx(e=>e.setThreadKnowledgeBase),s=e.knowledge_base_id??``,[c,l]=(0,B.useState)(s);if((0,B.useEffect)(()=>
280{l(s)},[s]),(0,B.useEffect)(()=>{a()},[a]),!n||!r)return null;let u=async e=>{let t=c;l(e);try{await o(n,r,e||null)}catch{l(t)}};return(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(kg,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`select`,{value:c,onChange:e=>void u(e.target.value),title:t(`email.thread.knowledge_base`),className:`w-full max-w-56 truncate rounded border bg-background px-1.5 py-0.5 text-[11px] text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary`,children:[(0,K.jsx)(`option`,{value:``,children:t(`email.thread.knowledge_base_inherit`)}),i.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})}function Y3e({thread:e}){let{t}=V(),n=e.sla_state??`ok`,r=e.business_days_since_last??0,i=e.warn_days??5,a=e.critical_days??10,o=e.is_resolved??!1;function s(){return o?(0,K.jsx)(B3e,{label:t(`email.thread.completed`)}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(G3e,{participant:e.whose_turn}),(0,K.jsx)(W3e,{state:n,businessDays:r,lastMessageAt:e.last_message_at,warnDays:i,criticalDays:a}),r>0&&(0,K.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t(`email.thread.business_days_since_last`,{count:r})})]})}return(0,K.jsxs)(lL,{className:`gap-2 border-b px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(cR,{}),(0,K.jsx)(`div`,{className:`text-base font-semibold tracking-tight`,children:t(`email.thread.title`)})]}),(0,K.jsx)(lz,{})]}),(0,K.jsx)(`div`,{className:`truncate text-sm font-medium`,title:e.subject??void 0,children:e.subject||t(`email.thread.no_subject`)}),(0,K.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:q3e(e)}),(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:s()}),(0,K.jsx)(J3e,{thread:e})]})}function X3e(){let{t:e}=V(),t=Ux(e=>e.selectedTask),n=Ux(e=>
280e.thread),r=Ux(e=>e.isLoadingThread);if(!t)return(0,K.jsxs)(`div`,{className:`flex h-full w-full min-w-0 flex-col`,children:[(0,K.jsx)(lL,{className:`border-b px-4 py-3`,children:(0,K.jsx)(`div`,{className:`text-base font-semibold tracking-tight`,children:e(`email.thread.title`)})}),(0,K.jsx)(uL,{children:(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 px-6 py-12 text-center text-muted-foreground`,children:[(0,K.jsx)(y_,{className:`h-6 w-6 opacity-60`}),(0,K.jsx)(`p`,{className:`text-sm`,children:e(`email.thread.empty_no_task`)})]})})]});if(r&&!n)return(0,K.jsxs)(`div`,{className:`flex h-full w-full min-w-0 flex-col`,children:[(0,K.jsx)(lL,{className:`border-b px-4 py-3`,children:(0,K.jsx)(`div`,{className:`text-base font-semibold tracking-tight`,children:e(`email.thread.title`)})}),(0,K.jsx)(uL,{children:(0,K.jsx)(dL,{children:(0,K.jsx)(fL,{children:(0,K.jsx)(`ul`,{children:Array.from({length:4}).map((e,t)=>(0,K.jsxs)(`li`,{className:`flex gap-3 border-b px-3 py-2`,"aria-hidden":!0,children:[(0,K.jsx)(`div`,{className:`mt-1 h-3.5 w-3.5 shrink-0 rounded bg-muted`}),(0,K.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,K.jsx)(`div`,{className:`h-3 w-3/4 rounded bg-muted`}),(0,K.jsx)(`div`,{className:`h-2.5 w-1/2 rounded bg-muted/70`}),(0,K.jsx)(`div`,{className:`h-2.5 w-5/6 rounded bg-muted/40`})]})]},t))})})})})]});if(!n)return(0,K.jsxs)(`div`,{className:`flex h-full w-full min-w-0 flex-col`,children:[(0,K.jsx)(lL,{className:`border-b px-4 py-3`,children:(0,K.jsx)(`div`,{className:`text-base font-semibold tracking-tight`,children:e(`email.thread.title`)})}),(0,K.jsx)(uL,{children:(0,K.jsx)(`div`,{className:`px-4 py-6 text-sm text-muted-foreground`,children:e(`email.thread.error`)})})]});let i=n.messages??[];return(0,K.jsxs)(`div`,{className:`flex h-full w-full min-w-0 flex-col`,children:[(0,K.jsx)(Y3e,{thread:n}),(0,K.jsx)(uL,{children:(0,K.jsx)(dL,{children:(0,K.jsx)(fL,{children:(0,K.jsx)(`ul`,{children:i.map((e,r)=>{let a=e.email_task_id??e.provider_message_id??`${e.sent_at}:${r}`,o=!!e.email_task_id&&e.email_task_id===t.id,s=r>0?i[r-1]:null;return(0,K.jsxs)(B.Fragment,{children:[s&&(0,K.jsx)(z3e,{previous:s,current:e}),(0,K.jsx)(R3e,{message:e,thread:n,isActive:o})]},a)})})})})})]})}function Z3e(){let{t:e}=V(),t=Nx(e=>e.user?.current_org_id??null),n=GL(e=>e.organizations).find(e=>e.id===t)??null;return(0,K.jsx)(`div`,{className:`flex h-8 min-w-0 flex-1 items-center rounded-md border border-sidebar-border bg-sidebar-accent px-2.5 text-xs font-medium text-sidebar-accent-foreground`,children:(0,K.jsx)(`span`,{className:`truncate`,children:n?n.name:e(`org.switcher.personal`)})})}var Q3e=[{titleKey:`nav.dashboard`,icon:Woe,path:`/dashboard`,hasPanel:!1},{titleKey:`nav.chat`,icon:y_,path:`/chat`,hasPanel:!0},{titleKey:`nav.vault`,icon:Nse,path:`/vault`,hasPanel:!1},{titleKey:`nav.matters`,icon:jg,path:`/matters`,hasPanel:!0},{titleKey:`nav.mail`,icon:__,path:`/inbox`,hasPanel:!0,requiresAnyIntegration:[`google`,`outlook`]},{titleKey:`nav.booking_links`,icon:roe,path:`/booking`,hasPanel:!1,requiresAnyIntegration:[`google`,`outlook`]},{titleKey:`nav.routines`,icon:Ng,path:`/routines`,hasPanel:!1}
280,{titleKey:`nav.customers`,icon:Mse,path:`/customers`,hasPanel:!1,requiresFeature:`customer_success`},{titleKey:`nav.shared`,icon:P_,path:`/shared`,hasPanel:!1}];function $3e({...e}){let{t}=V(),n=Sv(),r=xv(),{setOpen:i,open:a}=sL(),o=WL(e=>e.integrations),s=WL(e=>e.features),c=Nx(e=>e.user?.current_org_id??null),l=lk(e=>e.unviewedCount),u=lk(e=>e.fetchUnviewedCount),d=Q(e=>e.navRailCollapsed),f=Q(e=>e.toggleNavRail);B.useEffect(()=>{u()},[u]);let p=r.pathname.startsWith(`/settings`),m=Q3e.filter(e=>{let t=`requiresFeature`in e?e.requiresFeature:void 0;return!(t&&!s[t]||`requiresOrg`in e&&e.requiresOrg&&!c)}),h=e=>r.pathname.startsWith(e),g=e=>{if(e.hasPanel&&h(e.path)){i(!a);return}n(e.path,{replace:!0})},_=B.useRef(r.pathname);B.useEffect(()=>{let e=gL(_.current),t=gL(r.pathname);_.current=r.pathname,t===null?i(!1):t!==e&&i(!0)},[r.pathname,i]);let v=()=>h(`/matters`)?(0,K.jsx)(w3e,{}):h(`/inbox`)?(0,K.jsx)(M3e,{}):h(`/chat`)?(0,K.jsx)(o2e,{}):h(`/email-task`)?(0,K.jsx)(X3e,{}):null;return p?(0,K.jsx)(F3e,{}):(0,K.jsxs)(cL,{collapsible:`icon`,className:`overflow-hidden *:data-[sidebar=sidebar]:flex-row`,...e,children:[(0,K.jsxs)(cL,{collapsible:`none`,"data-rail-collapsed":d,className:`w-[calc(var(--sidebar-width-icon)+1px)]! border-r transition-[width] duration-200 ease-linear`,children:[(0,K.jsx)(lL,{children:d?(0,K.jsx)(`div`,{className:`flex flex-col items-center gap-2`,children:(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`size-8`,onClick:f,"aria-label":t(`sidebar.expand_rail`),children:(0,K.jsx)(ase,{className:`size-4`})})}):(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Z3e,{}),(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`size-8 shrink-0 ml-auto`,onClick:f,"aria-label":t(`sidebar.collapse_rail`),children:(0,K.jsx)(S_,{className:`size-4`})})]})}),(0,K.jsx)(uL,{children:(0,K.jsx)(dL,{children:(0,K.jsxs)(fL,{className:`px-1.5 md:px-0`,children:[(0,K.jsx)(pL,{children:m.map(e=>{let n=t(e.titleKey),r=`requiresAnyIntegration`in e?e.requiresAnyIntegration:void 0,i=r!==void 0&&r.every(e=>!o[e]),a=e.path===`/shared`&&l>0,s=(0,K.jsxs)(hL,{onClick:()=>!i&&g(e),isActive:h(e.path),className:q(`relative h-9 w-full hover:bg-neutral-200 data-[active=true]:bg-neutral-300 dark:hover:bg-neutral-800 dark:data-[active=true]:bg-neutral-700`,`group-data-[collapsible=icon]:h-9! group-data-[collapsible=icon]:w-full!`,d?`justify-center px-2 group-data-[collapsible=icon]:px-2!`:`px-3 group-data-[collapsible=icon]:px-3!`,i&&`opacity-40 cursor-not-allowed`),children:[(0,K.jsx)(e.icon,{}),!d&&(0,K.jsx)(`span`,{children:n}),a&&!d&&(0,K.jsx)(`span`,{className:`absolute right-2 top-1.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white`,children:l>9?`9+`:l}),a&&d&&(0,K.jsx)(`span`,{className:`absolute right-1.5 top-1.5 size-2 rounded-full bg-red-500`})]});return(0,K.jsx)(mL,{children:d||i?(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:s}),(0,K.jsx)(GT,{side:`right`,children:i?`Temporarily unavailable`:n})]}):s},e.titleKey)})}),(0,K.jsx)($T,{i18nKey:`tour.dashboard.sidebar`,side:`bottom`,children:(0,K.jsx)(`div`,{})})]})})}),(0,K.jsx)(kZe,{children:(0,K.jsx)(Y0e,{})})]}),(0,K.jsx)(cL,{collapsible:`none`,className:`hidden min-w-0 flex-1 md:flex`,children:v()})]})}function e6e({thread:e}){let t=e.message_count??0;return(0,K.jsxs)(`div`,{className:`pointer-events-none flex max-w-sm items-center gap-2 rounded-md border bg-popover px-3 py-2 text-sm text-popover-foreground shadow-lg`,children:[(0,K.jsx)(__,{className:`size-4 shrink-0 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`truncate font-medium`,children:e.subject||`(no subject)`}),(0,K.jsxs)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:[t,` message`,t===1?``:`s`]})]})}function t6e({children:e}){let t=Yx(e=>e.moveThreadToMatter),[n,r]=(0,B.useState)(null),i=T2e(w2e(JR,{activationConstraint:{distance:8}}));return(0,K.jsxs)(e3e,{sensors:i,collisionDetection:F2e,onDragStart:e=>{let t=e.active.data.current;t?.type===`thread`&&r(t.thread)},onDragEnd:e=>{let n=e.active.data.current,i=e.over?.data.current;r(null),n?.type===`thread`&&i?.type===`matter`&&i.matterId!==n.matterId&&t(n.matterId,n.thread.thread_id,i.matterId)},onDragCancel:()=>r(null),children:[e,(0,K.jsx)(b3e,{dropAnimation:null,children:n?(0,K.jsx)(e6e,{thread:n}
280):null})]})}function uz({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card`,className:q(`bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm`,e),...t})}function dz({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-header`,className:q(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,e),...t})}function fz({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-title`,className:q(`leading-none font-semibold`,e),...t})}function pz({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-description`,className:q(`text-muted-foreground text-sm`,e),...t})}function mz({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-content`,className:q(`px-6`,e),...t})}function n6e({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-footer`,className:q(`flex items-center px-6 [.border-t]:pt-6`,e),...t})}function hz({className:e,...t}){return(0,K.jsx)(`fieldset`,{"data-slot":`field-set`,className:q(`flex flex-col gap-6`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function gz({className:e,variant:t=`legend`,...n}){return(0,K.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:q(`mb-3 font-medium`,`data-[variant=legend]:text-base`,`data-[variant=label]:text-sm`,e),...n})}function _z({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`field-group`,className:q(`group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4`,e),...t})}var r6e=ay(`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`,`[&>[data-slot=field-label]]:flex-auto`,`has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto`,`@md/field-group:[&>[data-slot=field-label]]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}});function vz({className:e,orientation:t=`vertical`,...n}){return(0,K.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:q(r6e({orientation:t}),e),...n})}function yz({className:e,...t}){return(0,K.jsx)(pP,{"data-slot":`field-label`,className:q(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4`,`has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10`,e),...t})}function bz({className:e,...t}){return(0,K.jsx)(`p`,{"data-slot":`field-description`,className:q(`text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function xz({action:e}){return(0,K.jsxs)(bz,{className:`px-6 text-center text-xs`,children:[`By `,e,`, you agree to our `,(0,K.jsx)(`br`,{}),` `,(0,K.jsx)(Gv,{to:`/terms`,className:`underline hover:text-primary`,children:`Terms of Service`}),` `,`and`,` `,(0,K.jsx)(Gv,{to:`/privacy`,className:`underline hover:text-primary`,children:`Privacy Policy`}),`.`]})}function i6e({className:e,...t}){let{t:n}=V(),[r,i]=(0,B.useState)(``),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(!1),[l,u]=(0,B.useState)(null),{setAuth:d}=Nx(),f=Sv(),[p,m]=Jv();(0,B.useEffect)(()=>{p.get(`account_deleted`)===`true`&&(setTimeout(()=>G.success(n(`auth.login.account_deleted_toast`)),100),p.delete(`account_deleted`),m(p,{replace:!0}))},[]);let h=async e=>{e.preventDefault(),u(null),c(!0);try{d((await W_e({email:r,password:a})).data),f(My(p.get(`next`)),{replace:!0})}catch(e){u(e instanceof Error&&e.message==`Unauthorized`?n(`auth.login.error_unauthorized`):n(`auth.login.error_generic`))}finally{c(!1)}},g=p.get(`next`),_=g?`/signup?next=${encodeURIComponent(g)}`:`/signup`;return(0,K.jsx)(`div`,{className:q(`flex flex-col gap-6`,e),...t,children:(0,K.jsxs)(uz,{children:[(0,K.jsxs)(dz,{children:[(0,K.jsx)(fz,{children:n(`auth.login.title`)}),(0,K.jsx)(pz,{children:n(`auth.login.description`)})]}),(0,K.jsx)(mz,{children:(0,K.jsx)(`form`,{onSubmit:h,children:(0,K.jsxs)(_z,{children:[l&&(0,K.jsx)(`div`,{className:`text-sm text-red-500 bg-red-50 p-3 rounded-md`,children:l}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`email`,children:n(`auth.login.email_label`)}),(0,K.jsx)(dP,{id:`email`,type:`email`,placeholder:`[email protected]`,value:r,onChange:e=>i(e.target.value),required:!0,disabled:s})]}),(0,K.jsxs)(vz,{children:[(0,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(yz,{htmlFor:`password`,children:n(`auth.login.password_label`)}),(0,K.jsx)(Gv,{to:`/forgot-password`,className:`ml-auto inline-block text-sm underline-offset-4 hover:underline`,children:n(`auth.login.forgot_password`)})]}),(0,K.jsx)(dP,{id:`password`,type:`password`,value:a,onChange:e=>o(e.target.value),required:!0,disabled:s})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(J,{type:`submit`,disabled:s,children:n(s?`auth.login.submitting`:`auth.login.submit`)}),(0,K.jsxs)(bz,{className:`text-center`,children:[n(`auth.login.no_account`),` `,(0,K.jsx)(Gv,{to:_,className:`underline hover:text-primary`,children:n(`common.sign_up`)})]}),(0,K.jsx)(xz,{action:`signing in`})]})]})})})]})})}function a6e(){return(0,K.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center p-6 md:p-10`,children:(0,K.jsx)(`div`,{className:`w-full max-w-sm`,children:(0,K.jsx)(i6e,{})})})}var Sz=ay(`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground 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 shadow-xs hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 min-w-9 px-2`,sm:`h-8 min-w-8 px-1.5`,lg:`h-10 min-w-10 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function o6e({className:e,variant:t,size:n,...r}){return(0,K.jsx)(wMe,{"data-slot":`toggle`,className:q(Sz({variant:t,size:n,className:e})),...r})}var Cz=B.createContext({size:`default`,variant:`default`,spacing:0});function wz({className:e,variant:t,size:n,spacing:r=0,children:i,...a}){return(0,K.jsx)(LMe,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:q(`group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs`,e),...a,children:(0,K.jsx)(Cz.Provider,{value:{variant:t,size:n,spacing:r},children:i})})}function Tz({className:e,children:t,variant:n,size:r,...i}){let a=B.useContext(Cz);return(0,K.jsx)(RMe,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:q(Sz({variant:a.variant||n,size:a.size||r}),`w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10`,`data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l`,e),...i,children:t})}const Ez=[{id:`free`,title:`Free`,description:`Get started with AI-powered contract analysis.`,currency:`$`,monthlyPrice:`0`,yearlyPrice:`0`,buttonText:`Get started`,features:[{name:`10 documents`,icon:`check`,iconColor:`text-green-500`},{name:`AI chat (basic model)`,icon:`check`,iconColor:`text-blue-500`},{name:`Semantic search`,icon:`check`,iconColor:`text-teal-500`},{name:`1 knowledge base`,icon:`check`,iconColor:`text-orange-500`},{name:`50 messages / month`,icon:`check`,iconColor:`text-zinc-500`}]},{id:`pro`,title:`Pro`,description:`For teams managing contracts at scale.`,currency:`$`,monthlyPrice:`20`,yearlyPrice:`199`,buttonText:`Upgrade to Pro`,badge:``,highlight:!0,features:[{name:`100 documents`,icon:`check`,iconColor:`text-green-500`},{name:`Advanced AI models`,icon:`check`,iconColor:`text-blue-500`},{name:`Redline & track changes`,icon:`check`,iconColor:`text-orange-500`},{name:`10 knowledge bases`,icon:`check`,iconColor:`text-teal-500`},{name:`$5 credits included / month`,icon:`check`,iconColor:`text-violet-500`},{name:`Organization profiles`,icon:`check`,iconColor:`text-zinc-500`}]}];function s6e({open:e,onOpenChange:t,onPlanSelected:n,isLoading:r}){let[i,a]=(0,B.useState)(`free`),o=i===`pro`?`Continue to payment`:`Create free account`;return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsxs)(WC,{className:`sm:max-w-lg`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:`Choose your plan`}),(0,K.jsx)(JC,{children:`You can always upgrade later from Settings.`})]}),(0,K.jsx)(oz,{value:i,onValueChange:a,className:`space-y-3`,children:Ez.map(e=>(0,K.jsx)(`div`,{onClick:()=>a(e.id),className:q(`relative cursor-pointer rounded-lg border p-4 transition-all`,i===e.id?`border-primary bg-muted/40`:`border-border hover:border-primary/50`),children:(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(sz,{value:e.id,id:`signup-plan-${e.id}`,className:`pointer-events-none mt-0.5 flex-shrink-0`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(pP,{htmlFor:`signup-plan-${e.id}
280`,className:`cursor-pointer text-sm font-semibold`,children:e.title}),(0,K.jsxs)(`div`,{className:`text-right`,children:[(0,K.jsxs)(`span`,{className:`text-base font-bold`,children:[e.currency,e.monthlyPrice]}),(0,K.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`/month`})]})]}),(0,K.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:e.description}),(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.features.map((e,t)=>(0,K.jsxs)(`div`,{className:`bg-muted/20 border-border/30 flex items-center gap-1.5 rounded-md border px-2 py-1`,children:[(0,K.jsx)(`div`,{className:`bg-primary h-1 w-1 flex-shrink-0 rounded-full`}),(0,K.jsx)(`span`,{className:`text-muted-foreground text-[10px] leading-none whitespace-nowrap`,children:e.name})]},t))})]})]})},e.id))}),(0,K.jsx)(J,{className:`w-full`,disabled:r,onClick:()=>n(i),children:r?`Please wait...`:o})]})})}var Dz=JSON.parse(`[{"name":"Pacific/Midway","alternativeName":"American Samoa Time","group":["Pacific/Midway"],"continentCode":"OC","continentName":"Oceania","countryName":"United States Minor Outlying Islands","countryCode":"UM","mainCities":["Midway"],"rawOffsetInMinutes":-660,"abbreviation":"GMT-11","rawFormat":"-11:00 American Samoa Time - Midway"},{"name":"Pacific/Pago_Pago","alternativeName":"American Samoa Time","group":["Pacific/Pago_Pago","US/Samoa","Pacific/Samoa","Pacific/Midway"],"continentCode":"OC","continentName":"Oceania","countryName":"American Samoa","countryCode":"AS","mainCities":["Pago Pago"],"rawOffsetInMinutes":-660,"abbreviation":"GMT-11","rawFormat":"-11:00 American Samoa Time - Pago Pago"},{"name":"Pacific/Niue","alternativeName":"Niue Time","group":["Pacific/Niue"],"continentCode":"OC","continentName":"Oceania","countryName":"Niue","countryCode":"NU","mainCities":["Alofi"],"rawOffsetInMinutes":-660,"abbreviation":"NUT","rawFormat":"-11:00 Niue Time - Alofi"},{"name":"Pacific/Rarotonga","alternativeName":"Cook Islands Time","group":["Pacific/Rarotonga"],"continentCode":"OC","continentName":"Oceania","countryName":"Cook Islands","countryCode":"CK","mainCities":["Avarua"],"rawOffsetInMinutes":-600,"abbreviation":"CKT","rawFormat":"-10:00 Cook Islands Time - Avarua"},{"name":"America/Adak","alternativeName":"Hawaii-Aleutian Time","group":["America/Adak","US/Aleutian","America/Atka"],"continentCode":"NA","continentName":"North America","countryName":"United States","countryCode":"US","mainCities":["Adak"],"rawOffsetInMinutes":-600,"abbreviation":"HAST","rawFormat":"-10:00 Hawaii-Aleutian Time - Adak"},{"name":"Pacific/Honolulu","alternativeName":"Hawaii-Aleutian Time","group":["Pacific/Honolulu","US/Hawaii","Pacific/Johnston","HST"],"continentCode":"NA","continentName":"North America","countryName":"United States","countryCode":"US","mainCities":["Honolulu","East Honolulu","Pearl City","Makakilo / Kapolei / Honokai Hale"],"rawOffsetInMinutes":-600,"abbreviation":"HAST","rawFormat":"-10:00 Hawaii-Aleutian Time - Honolulu, East Honolulu, Pearl City, Makakilo / Kapolei / Honokai Hale"},{"name":"Pacific/Tahiti","alternativeName":"Tahiti Time","group":["Pacific/Tahiti"],"continentCode":"OC","continentName":"Oceania","countryName":"French Polynesia","countryCode":"PF","mainCities":["Faaa","Papeete","Punaauia"],"rawOffsetInMinutes":-600,"abbreviation":"TAHT","rawFormat":"-10:00 Tahiti Time - Faaa, Papeete, Punaauia"},{"name":"Pacific/Marquesas","alternativeName":"Marquesas Time","group":["Pacific/Marquesas"],"continentCode":"OC","continentName":"Oceania","countryName":"French Polynesia","countryCode":"PF","mainCities":["Marquesas"],"rawOffsetInMinutes":-570,"abbreviation":"MART","rawFormat":"-09:30 Marquesas Time - Marquesas"},{"name":"America/Anchorage","alternativeName":"Alaska Time","group":["America/Anchorage","America/Juneau","America/Metlakatla","America/Nome","America/Sitka","America/Yakutat","US/Alaska"],"continentCode":"NA","continentName":"North America","countryName":"United States","countryCode":"US","mainCities":["Anchorage","Fairbanks","Juneau","Eagle River"],"rawOffsetInMinutes":-540,"abbreviation":"AKST","rawF
280ormat":"-09:00 Alaska Time - Anchorage, Fairbanks, Juneau, Eagle River"},{"name":"Pacific/Gambier","alternativeName":"Gambier Time","group":["Pacific/Gambier"],"continentCode":"OC","continentName":"Oceania","countryName":"French Polynesia","countryCode":"PF","mainCities":["Gambier"],"rawOffsetInMinutes":-540,"abbreviation":"GAMT","rawFormat":"-09:00 Gambier Time - Gambier"},{"name":"America/Los_Angeles","alternativeName":"Pacific Time","group":["America/Los_Angeles","US/Pacific","PST8PDT"],"continentCode":"NA","continentName":"North America","countryName":"United States","countryCode":"US","mainCities":["Los Angeles","San Diego","San Jose","San Francisco"],"rawOffsetInMinutes":-480,"abbreviation":"PST","rawFormat":"-08:00 Pacific Time - Los Angeles, San Diego, San Jose, San Francisco"},{"name":"America/Tijuana","alternativeName":"Pacific Time","group":["America/Tijuana","Mexico/BajaNorte","America/Ensenada","America/Santa_Isabel"],"continentCode":"NA","continentName":"North America","countryName":"Mexico","countryCode":"MX","mainCities":["Tijuana","Mexicali","Ensenada","Rosarito"],"rawOffsetInMinutes":-480,"abbreviation":"PST","rawFormat":"-08:00 Pacific Time - Tijuana, Mexicali, Ensenada, Rosarito"},{"name":"America/Vancouver","alternativeName":"Pacific Time","group":["America/Vancouver","Canada/Pacific"],"continentCode":"NA","continentName":"North America","countryName":"Canada","countryCode":"CA","mainCities":["Vancouver","Surrey","Victoria","Burnaby"],"rawOffsetInMinutes":-480,"abbreviation":"PST","rawFormat":"-08:00 Pacific Time - Vancouver, Surrey, Victoria, Burnaby"},{"name":"Pacific/Pitcairn","alternativeName":"Pitcairn Time","group":["Pacific/Pitcairn"],"continentCode":"OC","continentName":"Oceania","countryName":"Pitcairn","countryCode":"PN","mainCities":["Adamstown"],"rawOffsetInMinutes":-480,"abbreviation":"PST","rawFormat":"-08:00 Pitcairn Time - Adamstown"},{"name":"America/Hermosillo","alternativeName":"Mexican Pacific Time","group":["America/Hermosillo","America/Mazatlan","Mexico/BajaSur"],"continentCode":"NA","continentName":"North America","countryName":"Mexico","countryCode":"MX","mainCities":["Hermosillo","Culiacán","Mazatlán","Tepic"],"rawOffsetInMinutes":-420,"abbreviation":"GMT-7","rawFormat":"-07:00 Mexican Pacific Time - Hermosillo, Culiacán, Mazatlán, Tepic"},{"name":"America/Edmonton","alternativeName":"Mountain Time","group":["America/Cambridge_Bay","America/Edmonton","America/Inuvik","Canada/Mountain","America/Yellowknife"],"continentCode":"NA","continentName":"North America","countryName":"Canada","countryCode":"CA","mainCities":["Calgary","Edmonton","Lethbridge","Red Deer"],"rawOffsetInMinutes":-420,"abbreviation":"MST","rawFormat":"-07:00 Mountain Time - Calgary, Edmonton, Lethbridge, Red Deer"},{"name":"America/Ciudad_Juarez","alternativeName":"Mountain Time","group":["America/Ciudad_Juarez"],"continentCode":"NA","continentName":"North America","countryName":"Mexico","countryCode":"MX","mainCities":["Ciudad Juárez"],"rawOffsetInMinutes":-420,"abbreviation":"MST","rawFormat":"-07:00 Mountain Time - Ciudad Juárez"},{"name":"America/Denver","alternativeName":"Mountain Time","group":["America/Boise","America/Denver","MST7MDT","Navajo","US/Mountain","America/Shiprock"],"continentCode":"NA","continentName":"North America","countryName":"United States","countryCode":"US","mainCities":["Denver","El Paso","Albuquerque","Colorado Springs"],"rawOffsetInMinutes":-420,"abbreviation":"MST","rawFormat":"-07:00 Mountain Time - Denver, El Paso, Albuquerque, Colorado Springs"},{"name":"America/Phoenix","alternativeName":"Mountain Time","group":["America/Phoenix","MST","US/Arizona","America/Creston"],"continentCode":"NA","continentName":"North America","countryName":"United States","countryCode":"US","mainCities":["Phoenix","Tucson","Mesa","Chandler"],"rawOffsetInMinutes":-420,"abbreviation":"MST","rawFormat":"-07:00 Mountain Time - Phoenix, Tucson, Mesa, Chandler"},{"name":"America/Whitehorse","alternativeName":"Yukon Time","group":["America/Creston","America/Dawson","America/Dawson_Creek","America/Fort_Nelson","America/Whitehorse","Canada
280/Yukon"],"continentCode":"NA","continentName":"North America","countryName":"Canada","countryCode":"CA","mainCities":["Whitehorse","Fort St. John","Creston","Dawson"],"rawOffsetInMinutes":-420,"abbreviation":"YT","rawFormat":"-07:00 Yukon Time - Whitehorse, Fort St. John, Creston, Dawson"},{"name":"America/Belize","alternativeName":"Central Time","group":["America/Belize"],"continentCode":"NA","continentName":"North America","countryName":"Belize","countryCode":"BZ","mainCities":["Belize City","San Pedro","Orange Walk","Belmopan"],"rawOffsetInMinutes":-360,"abbreviation":"CST","rawFormat":"-06:00 Central Time - Belize City, San Pedro, Orange Walk, Belmopan"},{"name":"America/Chicago","alternativeName":"Central Time","group":["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","CST6CDT","US/Central","US/Indiana-Starke","America/Knox_IN"],"continentCode":"NA","continentName":"North America","countryName":"United States","countryCode":"US","mainCities":["Chicago","Houston","San Antonio","Dallas"],"rawOffsetInMinutes":-360,"abbreviation":"CST","rawFormat":"-06:00 Central Time - Chicago, Houston, San Antonio, Dallas"},{"name":"America/Guatemala","alternativeName":"Central Time","group":["America/Guatemala"],"continentCode":"NA","continentName":"North America","countryName":"Guatemala","countryCode":"GT","mainCities":["Guatemala City","Villa Nueva","Mixco","Cobán"],"rawOffsetInMinutes":-360,"abbreviation":"CST","rawFormat":"-06:00 Central Time - Guatemala City, Villa Nueva, Mixco, Cobán"},{"name":"America/Managua","alternativeName":"Central Time","group":["America/Managua"],"continentCode":"NA","continentName":"North America","countryName":"Nicaragua","countryCode":"NI","mainCities":["Managua","León","Masaya","Chinandega"],"rawOffsetInMinutes":-360,"abbreviation":"CST","rawFormat":"-06:00 Central Time - Managua, León, Masaya, Chinandega"},{"name":"America/Mexico_City","alternativeName":"Central Time","group":["America/Bahia_Banderas","America/Chihuahua","America/Merida","America/Mexico_City","America/Monterrey","Mexico/General"],"continentCode":"NA","continentName":"North America","countryName":"Mexico","countryCode":"MX","mainCities":["Mexico City","Iztapalapa","Puebla","Ecatepec de Morelos"],"rawOffsetInMinutes":-360,"abbreviation":"CST","rawFormat":"-06:00 Central Time - Mexico City, Iztapalapa, Puebla, Ecatepec de Morelos"},{"name":"America/Matamoros","alternativeName":"Central Time","group":["America/Matamoros","America/Ojinaga"],"continentCode":"NA","continentName":"North America","countryName":"Mexico","countryCode":"MX","mainCities":["Reynosa","Heroica Matamoros","Nuevo Laredo","Ciudad Acuña"],"rawOffsetInMinutes":-360,"abbreviation":"CST","rawFormat":"-06:00 Central Time - Reynosa, Heroica Matamoros, Nuevo Laredo, Ciudad Acuña"},{"name":"America/Costa_Rica","alternativeName":"Central Time","group":["America/Costa_Rica"],"continentCode":"NA","continentName":"North America","countryName":"Costa Rica","countryCode":"CR","mainCities":["San José","Limón","San Francisco","Alajuela"],"rawOffsetInMinutes":-360,"abbreviation":"CST","rawFormat":"-06:00 Central Time - San José, Limón, San Francisco, Alajuela"},{"name":"America/El_Salvador","alternativeName":"Central Time","group":["America/El_Salvador"],"continentCode":"NA","continentName":"North America","countryName":"El Salvador","countryCode":"SV","mainCities":["San Salvador","Soyapango","San Miguel","Santa Ana"],"rawOffsetInMinutes":-360,"abbreviation":"CST","rawFormat":"-06:00 Central Time - San Salvador, Soyapango, San Miguel, Santa Ana"},{"name":"America/Regina","alternativeName":"Central Time","group":["America/Regina","America/Swift_Current","Canada/Saskatchewan"],"continentCode":"NA","continentName":"North America","countryName":"Canada","countryCode":"CA","mainCities":["Saskatoon","Regina","Prince Albert","Moose Jaw"],"rawOffsetInMinutes":-360,"abbreviation":"CST","rawFormat":"-06:00 Central Time - Saskatoon, Regina, Prince Albert, Moose Jaw"},{"name":"America/Tegucigalpa","alternativeName":"Central Time","group":["America/Tegucigalpa"],"continentCode":"NA","continentName":"North America","countryName":"Honduras","countryCode":"HN","mainCities":["Tegucigalpa","San Pedro Sula","La Ceiba","Choloma"],"rawOffsetInMinutes":-360,"abbreviation":"CST","rawF
280ormat":"-06:00 Central Time - Tegucigalpa, San Pedro Sula, La Ceiba, Choloma"},{"name":"America/Winnipeg","alternativeName":"Central Time","group":["America/Rankin_Inlet","America/Resolute","America/Winnipeg","Canada/Central","America/Rainy_River"],"continentCode":"NA","continentName":"North America","countryName":"Canada","countryCode":"CA","mainCities":["Winnipeg","Brandon","Steinbach","Kenora"],"rawOffsetInMinutes":-360,"abbreviation":"CST","rawFormat":"-06:00 Central Time - Winnipeg, Brandon, Steinbach, Kenora"},{"name":"Pacific/Easter","alternativeName":"Easter Island Time","group":["Pacific/Easter","Chile/EasterIsland"],"continentCode":"SA","continentName":"South America","countryName":"Chile","countryCode":"CL","mainCities":["Easter"],"rawOffsetInMinutes":-360,"abbreviation":"EAST","rawFormat":"-06:00 Easter Island Time - Easter"},{"name":"Pacific/Galapagos","alternativeName":"Galapagos Time","group":["Pacific/Galapagos"],"continentCode":"SA","continentName":"South America","countryName":"Ecuador","countryCode":"EC","mainCities":["Galapagos"],"rawOffsetInMinutes":-360,"abbreviation":"GALT","rawFormat":"-06:00 Galapagos Time - Galapagos"},{"name":"America/Rio_Branco","alternativeName":"Acre Time","group":["America/Eirunepe","America/Rio_Branco","Brazil/Acre","America/Porto_Acre"],"continentCode":"SA","continentName":"South America","countryName":"Brazil","countryCode":"BR","mainCities":["Rio Branco","Cruzeiro do Sul","Tarauacá","Sena Madureira"],"rawOffsetInMinutes":-300,"abbreviation":"ACT","rawFormat":"-05:00 Acre Time - Rio Branco, Cruzeiro do Sul, Tarauacá, Sena Madureira"},{"name":"America/Bogota","alternativeName":"Colombia Time","group":["America/Bogota"],"continentCode":"SA","continentName":"South America","countryName":"Colombia","countryCode":"CO","mainCities":["Bogotá","Cali","MedellÃn","Barranquilla"],"rawOffsetInMinutes":-300,"abbreviation":"COT","rawFormat":"-05:00 Colombia Time - Bogotá, Cali, MedellÃn, Barranquilla"},{"name":"America/Havana","alternativeName":"Cuba Time","group":["America/Havana","Cuba"],"continentCode":"NA","continentName":"North America","countryName":"Cuba","countryCode":"CU","mainCities":["Havana","Santiago de Cuba","Camagüey","HolguÃn"],"rawOffsetInMinutes":-300,"abbreviation":"CST","rawFormat":"-05:00 Cuba Time - Havana, Santiago de Cuba, Camagüey, HolguÃn"},{"name":"America/Atikokan","alternativeName":"Eastern Time","group":["America/Atikokan"],"continentCode":"NA","continentName":"North America","countryName":"Canada","countryCode":"CA","mainCities":["Atikokan"],"rawOffsetInMinutes":-300,"abbreviation":"EST","rawFormat":"-05:00 Eastern Time - Atikokan"},{"name":"America/Cancun","alternativeName":"Eastern Time","group":["America/Cancun"],"continentCode":"NA","continentName":"North America","countryName":"Mexico","countryCode":"MX","mainCities":["Cancún","Chetumal","Playa del Carmen","Cozumel"],"rawOffsetInMinutes":-300,"abbreviation":"EST","rawFormat":"-05:00 Eastern Time - Cancún, Chetumal, Playa del Carmen, Cozumel"},{"name":"America/Cayman","alternativeName":"Eastern Time","group":["America/Cayman"],"continentCode":"NA","continentName":"North America","countryName":"Cayman Islands","countryCode":"KY","mainCities":["George Town","West Bay"],"rawOffsetInMinutes":-300,"abbreviation":"EST","rawFormat":"-05:00 Eastern Time - George Town, West Bay"},{"name":"America/Jamaica","alternativeName":"Eastern Time","group":["America/Jamaica","Jamaica"],"continentCode":"NA","continentName":"North America","countryName":"Jamaica","countryCode":"JM","mainCities":["Kingston","New Kingston","Spanish Town","Portmore"],"rawOffsetInMinutes":-300,"abbreviation":"EST","rawFormat":"-05:00 Eastern Time - Kingston, New Kingston, Spanish Town, Portmore"},{"name":"America/Nassau","alternativeName":"Eastern Time","group":["America/Nassau"],"continentCode":"NA","continentName":"North America","countryName":"Bahamas","countryCode":"BS","mainCities":["Nassau","Lucaya","Freeport","Killarney"],"rawOffsetInMinutes":-300,"abbreviation":"EST","rawFormat":"-05:00 Eastern Time - Nassau, Lucaya, Freeport, Killarney"}
280,{"name":"America/New_York","alternativeName":"Eastern Time","group":["America/Detroit","America/Indiana/Indianapolis","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Kentucky/Louisville","America/Kentucky/Monticello","America/New_York","US/Michigan","US/East-Indiana","America/Indianapolis","America/Fort_Wayne","America/Louisville","EST5EDT","US/Eastern"],"continentCode":"NA","continentName":"North America","countryName":"United States","countryCode":"US","mainCities":["New York City","Brooklyn","Queens","Philadelphia"],"rawOffsetInMinutes":-300,"abbreviation":"EST","rawFormat":"-05:00 Eastern Time - New York City, Brooklyn, Queens, Philadelphia"},{"name":"America/Panama","alternativeName":"Eastern Time","group":["America/Panama","EST","America/Atikokan","America/Cayman","America/Coral_Harbour"],"continentCode":"NA","continentName":"North America","countryName":"Panama","countryCode":"PA","mainCities":["Panamá","San Miguelito","Juan DÃaz","David"],"rawOffsetInMinutes":-300,"abbreviation":"EST","rawFormat":"-05:00 Eastern Time - Panamá, San Miguelito, Juan DÃaz, David"},{"name":"America/Port-au-Prince","alternativeName":"Eastern Time","group":["America/Port-au-Prince"],"continentCode":"NA","continentName":"North America","countryName":"Haiti","countryCode":"HT","mainCities":["Port-au-Prince","Carrefour","Delmas","Port-de-Paix"],"rawOffsetInMinutes":-300,"abbreviation":"EST","rawFormat":"-05:00 Eastern Time - Port-au-Prince, Carrefour, Delmas, Port-de-Paix"},{"name":"America/Grand_Turk","alternativeName":"Eastern Time","group":["America/Grand_Turk"],"continentCode":"NA","continentName":"North America","countryName":"Turks and Caicos Islands","countryCode":"TC","mainCities":["Providenciales","Cockburn Town"],"rawOffsetInMinutes":-300,"abbreviation":"EST","rawFormat":"-05:00 Eastern Time - Providenciales, Cockburn Town"},{"name":"America/Toronto","alternativeName":"Eastern Time","group":["America/Iqaluit","America/Toronto","America/Pangnirtung","Canada/Eastern","America/Nassau","America/Montreal","America/Nipigon","America/Thunder_Bay"],"continentCode":"NA","continentName":"North America","countryName":"Canada","countryCode":"CA","mainCities":["Toronto","Montréal","Ottawa","Mississauga"],"rawOffsetInMinutes":-300,"abbreviation":"EST","rawFormat":"-05:00 Eastern Time - Toronto, Montréal, Ottawa, Mississauga"},{"name":"America/Guayaquil","alternativeName":"Ecuador Time","group":["America/Guayaquil"],"continentCode":"SA","continentName":"South America","countryName":"Ecuador","countryCode":"EC","mainCities":["Quito","Guayaquil","Cuenca","Santo Domingo de los Colorados"],"rawOffsetInMinutes":-300,"abbreviation":"ECT","rawFormat":"-05:00 Ecuador Time - Quito, Guayaquil, Cuenca, Santo Domingo de los Colorados"},{"name":"America/Lima","alternativeName":"Peru Time","group":["America/Lima"],"continentCode":"SA","continentName":"South America","countryName":"Peru","countryCode":"PE","mainCities":["Lima","Callao","Arequipa","Trujillo"],"rawOffsetInMinutes":-300,"abbreviation":"PET","rawFormat":"-05:00 Peru Time - Lima, Callao, Arequipa, Trujillo"},{"name":"America/Manaus","alternativeName":"Amazon Time","group":["America/Boa_Vista","America/Campo_Grande","America/Cuiaba","America/Manaus","America/Porto_Velho","Brazil/West"],"continentCode":"SA","continentName":"South America","countryName":"Brazil","countryCode":"BR","mainCities":["Manaus","Campo Grande","Cuiabá","Porto Velho"],"rawOffsetInMinutes":-240,"abbreviation":"AMT","rawFormat":"-04:00 Amazon Time - Manaus, Campo Grande, Cuiabá, Porto Velho"},{"name":"America/St_Kitts","alternativeName":"Atlantic Time","group":["America/St_Kitts"],"continentCode":"NA","continentName":"North America","countryName":"Saint Kitts and Nevis","countryCode":"KN","mainCities":["Basseterre"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Basseterre"},{"name":"America/Blanc-Sablon","alternativeName":"Atlantic Time","group":["America/Blanc-Sablon"],"continentCode":"NA","continentName":"North America","countryName":"Canada","countryCode":"CA","mainCities":["Blanc-Sablon"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawF
280ormat":"-04:00 Atlantic Time - Blanc-Sablon"},{"name":"America/Montserrat","alternativeName":"Atlantic Time","group":["America/Montserrat"],"continentCode":"NA","continentName":"North America","countryName":"Montserrat","countryCode":"MS","mainCities":["Brades","Plymouth"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Brades, Plymouth"},{"name":"America/Barbados","alternativeName":"Atlantic Time","group":["America/Barbados"],"continentCode":"NA","continentName":"North America","countryName":"Barbados","countryCode":"BB","mainCities":["Bridgetown"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Bridgetown"},{"name":"America/Port_of_Spain","alternativeName":"Atlantic Time","group":["America/Port_of_Spain"],"continentCode":"NA","continentName":"North America","countryName":"Trinidad and Tobago","countryCode":"TT","mainCities":["Chaguanas","Mon Repos","San Fernando","Port of Spain"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Chaguanas, Mon Repos, San Fernando, Port of Spain"},{"name":"America/Martinique","alternativeName":"Atlantic Time","group":["America/Martinique"],"continentCode":"NA","continentName":"North America","countryName":"Martinique","countryCode":"MQ","mainCities":["Fort-de-France","Le Lamentin","Le Robert","Sainte-Marie"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Fort-de-France, Le Lamentin, Le Robert, Sainte-Marie"},{"name":"America/St_Lucia","alternativeName":"Atlantic Time","group":["America/St_Lucia"],"continentCode":"NA","continentName":"North America","countryName":"Saint Lucia","countryCode":"LC","mainCities":["Gros Islet","Castries"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Gros Islet, Castries"},{"name":"America/St_Barthelemy","alternativeName":"Atlantic Time","group":["America/St_Barthelemy"],"continentCode":"NA","continentName":"North America","countryName":"Saint Barthelemy","countryCode":"BL","mainCities":["Gustavia"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Gustavia"},{"name":"America/Halifax","alternativeName":"Atlantic Time","group":["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","Canada/Atlantic"],"continentCode":"NA","continentName":"North America","countryName":"Canada","countryCode":"CA","mainCities":["Halifax","Sydney","Dartmouth","Moncton"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Halifax, Sydney, Dartmouth, Moncton"},{"name":"Atlantic/Bermuda","alternativeName":"Atlantic Time","group":["Atlantic/Bermuda"],"continentCode":"NA","continentName":"North America","countryName":"Bermuda","countryCode":"BM","mainCities":["Hamilton"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Hamilton"},{"name":"America/St_Vincent","alternativeName":"Atlantic Time","group":["America/St_Vincent"],"continentCode":"NA","continentName":"North America","countryName":"Saint Vincent and the Grenadines","countryCode":"VC","mainCities":["Kingstown","Calliaqua"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Kingstown, Calliaqua"},{"name":"America/Kralendijk","alternativeName":"Atlantic Time","group":["America/Kralendijk"],"continentCode":"NA","continentName":"North America","countryName":"Bonaire, Saint Eustatius and Saba ","countryCode":"BQ","mainCities":["Kralendijk"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Kralendijk"},{"name":"America/Guadeloupe","alternativeName":"Atlantic Time","group":["America/Guadeloupe"],"continentCode":"NA","continentName":"North America","countryName":"Guadeloupe","countryCode":"GP","mainCities":["Les Abymes","Baie-Mahault","Le Gosier","Petit-Bourg"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Les Abymes, Baie-Mahault, Le Gosier, Petit-Bourg"},{"name":"America/Marigot","alternativeName":"Atlantic Time","group":["America/Marigot"],"continentCode":"NA","continentName":"North America","countryName":"Saint Martin","countryCode":"MF","mainCities":["Marigot"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawF
280ormat":"-04:00 Atlantic Time - Marigot"},{"name":"America/Aruba","alternativeName":"Atlantic Time","group":["America/Aruba"],"continentCode":"NA","continentName":"North America","countryName":"Aruba","countryCode":"AW","mainCities":["Oranjestad","Noord","Tanki Leendert","San Nicolas"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Oranjestad, Noord, Tanki Leendert, San Nicolas"},{"name":"America/Lower_Princes","alternativeName":"Atlantic Time","group":["America/Lower_Princes"],"continentCode":"NA","continentName":"North America","countryName":"Sint Maarten","countryCode":"SX","mainCities":["Philipsburg"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Philipsburg"},{"name":"America/Tortola","alternativeName":"Atlantic Time","group":["America/Tortola"],"continentCode":"NA","continentName":"North America","countryName":"British Virgin Islands","countryCode":"VG","mainCities":["Road Town"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Road Town"},{"name":"America/Dominica","alternativeName":"Atlantic Time","group":["America/Dominica"],"continentCode":"NA","continentName":"North America","countryName":"Dominica","countryCode":"DM","mainCities":["Roseau"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Roseau"},{"name":"America/St_Thomas","alternativeName":"Atlantic Time","group":["America/St_Thomas"],"continentCode":"NA","continentName":"North America","countryName":"U.S. Virgin Islands","countryCode":"VI","mainCities":["Saint Croix","Charlotte Amalie"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Saint Croix, Charlotte Amalie"},{"name":"America/Grenada","alternativeName":"Atlantic Time","group":["America/Grenada"],"continentCode":"NA","continentName":"North America","countryName":"Grenada","countryCode":"GD","mainCities":["Saint George's"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Saint George's"},{"name":"America/Antigua","alternativeName":"Atlantic Time","group":["America/Antigua"],"continentCode":"NA","continentName":"North America","countryName":"Antigua and Barbuda","countryCode":"AG","mainCities":["Saint Johnâs"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Saint Johnâs"},{"name":"America/Puerto_Rico","alternativeName":"Atlantic Time","group":["America/Puerto_Rico","America/Virgin","America/Anguilla","America/Antigua","America/Aruba","America/Blanc-Sablon","America/Curacao","America/Dominica","America/Grenada","America/Guadeloupe","America/Kralendijk","America/Lower_Princes","America/Marigot","America/Montserrat","America/Port_of_Spain","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola"],"continentCode":"NA","continentName":"North America","countryName":"Puerto Rico","countryCode":"PR","mainCities":["San Juan","Bayamón","Carolina","Ponce"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - San Juan, Bayamón, Carolina, Ponce"},{"name":"America/Santo_Domingo","alternativeName":"Atlantic Time","group":["America/Santo_Domingo"],"continentCode":"NA","continentName":"North America","countryName":"Dominican Republic","countryCode":"DO","mainCities":["Santo Domingo","Santiago de los Caballeros","Santo Domingo Oeste","Santo Domingo Este"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Santo Domingo, Santiago de los Caballeros, Santo Domingo Oeste, Santo Domingo Este"},{"name":"America/Anguilla","alternativeName":"Atlantic Time","group":["America/Anguilla"],"continentCode":"NA","continentName":"North America","countryName":"Anguilla","countryCode":"AI","mainCities":["The Valley"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - The Valley"},{"name":"America/Thule","alternativeName":"Atlantic Time","group":["America/Thule"],"continentCode":"NA","continentName":"North America","countryName":"Greenland","countryCode":"GL","mainCities":["Thule"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawF
280ormat":"-04:00 Atlantic Time - Thule"},{"name":"America/Curacao","alternativeName":"Atlantic Time","group":["America/Curacao"],"continentCode":"NA","continentName":"North America","countryName":"Curacao","countryCode":"CW","mainCities":["Willemstad","Bandariba"],"rawOffsetInMinutes":-240,"abbreviation":"AST","rawFormat":"-04:00 Atlantic Time - Willemstad, Bandariba"},{"name":"America/La_Paz","alternativeName":"Bolivia Time","group":["America/La_Paz"],"continentCode":"SA","continentName":"South America","countryName":"Bolivia","countryCode":"BO","mainCities":["La Paz","Santa Cruz de la Sierra","Cochabamba","Sucre"],"rawOffsetInMinutes":-240,"abbreviation":"BOT","rawFormat":"-04:00 Bolivia Time - La Paz, Santa Cruz de la Sierra, Cochabamba, Sucre"},{"name":"America/Santiago","alternativeName":"Chile Time","group":["America/Santiago","Chile/Continental"],"continentCode":"SA","continentName":"South America","countryName":"Chile","countryCode":"CL","mainCities":["Santiago","Puente Alto","Maipú","Antofagasta"],"rawOffsetInMinutes":-240,"abbreviation":"CLT","rawFormat":"-04:00 Chile Time - Santiago, Puente Alto, Maipú, Antofagasta"},{"name":"America/Guyana","alternativeName":"Guyana Time","group":["America/Guyana"],"continentCode":"SA","continentName":"South America","countryName":"Guyana","countryCode":"GY","mainCities":["Georgetown","Linden","New Amsterdam"],"rawOffsetInMinutes":-240,"abbreviation":"GYT","rawFormat":"-04:00 Guyana Time - Georgetown, Linden, New Amsterdam"},{"name":"America/Caracas","alternativeName":"Venezuela Time","group":["America/Caracas"],"continentCode":"SA","continentName":"South America","countryName":"Venezuela","countryCode":"VE","mainCities":["Caracas","Maracaibo","Valencia","Barquisimeto"],"rawOffsetInMinutes":-240,"abbreviation":"VET","rawFormat":"-04:00 Venezuela Time - Caracas, Maracaibo, Valencia, Barquisimeto"},{"name":"America/St_Johns","alternativeName":"Newfoundland Time","group":["America/St_Johns","Canada/Newfoundland"],"continentCode":"NA","continentName":"North America","countryName":"Canada","countryCode":"CA","mainCities":["St. John's","Mount Pearl","Paradise","Corner Brook"],"rawOffsetInMinutes":-210,"abbreviation":"NST","rawFormat":"-03:30 Newfoundland Time - St. John's, Mount Pearl, Paradise, Corner Brook"},{"name":"America/Argentina/Buenos_Aires","alternativeName":"Argentina Time","group":["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Argentina/ComodRivadavia","America/Cordoba","America/Rosario","America/Jujuy","America/Mendoza"],"continentCode":"SA","continentName":"South America","countryName":"Argentina","countryCode":"AR","mainCities":["Buenos Aires","Córdoba","Rosario","Mar del Plata"],"rawOffsetInMinutes":-180,"abbreviation":"ART","rawFormat":"-03:00 Argentina Time - Buenos Aires, Córdoba, Rosario, Mar del Plata"},{"name":"America/Sao_Paulo","alternativeName":"Brasilia Time","group":["America/Araguaina","America/Bahia","America/Belem","America/Fortaleza","America/Maceio","America/Recife","America/Santarem","America/Sao_Paulo","Brazil/East"],"continentCode":"SA","continentName":"South America","countryName":"Brazil","countryCode":"BR","mainCities":["São Paulo","Rio de Janeiro","Belo Horizonte","Salvador"],"rawOffsetInMinutes":-180,"abbreviation":"BRT","rawFormat":"-03:00 Brasilia Time - São Paulo, Rio de Janeiro, Belo Horizonte, Salvador"},{"name":"Antarctica/Palmer","alternativeName":"Chile Time","group":["Antarctica/Palmer","Antarctica/Rothera"],"continentCode":"AN","continentName":"Antarctica","countryName":"Antarctica","countryCode":"AQ","mainCities":["Palmer","Rothera"],"rawOffsetInMinutes":-180,"abbreviation":"CLT","rawFormat":"-03:00 Chile Time - Palmer, Rothera"},{"name":"America/Punta_Arenas","alternativeName":"Chile Time","group":["America/Coyhaique","America/Punta_Arenas"],"continentCode":"SA","continentName":"South America","countryName":"Chile","countryCode":"CL","mainCities":["Punta Arenas","Coyhaique","Puerto Natales","Puerto Aysén"],"rawOffsetInMinutes":-180,"abbreviation":"CLT","rawF
280ormat":"-03:00 Chile Time - Punta Arenas, Coyhaique, Puerto Natales, Puerto Aysén"},{"name":"Atlantic/Stanley","alternativeName":"Falkland Islands Time","group":["Atlantic/Stanley"],"continentCode":"SA","continentName":"South America","countryName":"Falkland Islands","countryCode":"FK","mainCities":["Stanley"],"rawOffsetInMinutes":-180,"abbreviation":"FKST","rawFormat":"-03:00 Falkland Islands Time - Stanley"},{"name":"America/Cayenne","alternativeName":"French Guiana Time","group":["America/Cayenne"],"continentCode":"SA","continentName":"South America","countryName":"French Guiana","countryCode":"GF","mainCities":["Cayenne","Matoury","Saint-Laurent-du-Maroni","Kourou"],"rawOffsetInMinutes":-180,"abbreviation":"GFT","rawFormat":"-03:00 French Guiana Time - Cayenne, Matoury, Saint-Laurent-du-Maroni, Kourou"},{"name":"America/Asuncion","alternativeName":"Paraguay Time","group":["America/Asuncion"],"continentCode":"SA","continentName":"South America","countryName":"Paraguay","countryCode":"PY","mainCities":["Asunción","Ciudad del Este","San Lorenzo","Capiatá"],"rawOffsetInMinutes":-180,"abbreviation":"PYT","rawFormat":"-03:00 Paraguay Time - Asunción, Ciudad del Este, San Lorenzo, Capiatá"},{"name":"America/Miquelon","alternativeName":"St. Pierre & Miquelon Time","group":["America/Miquelon"],"continentCode":"NA","continentName":"North America","countryName":"Saint Pierre and Miquelon","countryCode":"PM","mainCities":["Saint-Pierre"],"rawOffsetInMinutes":-180,"abbreviation":"PM","rawFormat":"-03:00 St. Pierre & Miquelon Time - Saint-Pierre"},{"name":"America/Paramaribo","alternativeName":"Suriname Time","group":["America/Paramaribo"],"continentCode":"SA","continentName":"South America","countryName":"Suriname","countryCode":"SR","mainCities":["Paramaribo","Blauwgrond","Rainville","Flora"],"rawOffsetInMinutes":-180,"abbreviation":"SRT","rawFormat":"-03:00 Suriname Time - Paramaribo, Blauwgrond, Rainville, Flora"},{"name":"America/Montevideo","alternativeName":"Uruguay Time","group":["America/Montevideo"],"continentCode":"SA","continentName":"South America","countryName":"Uruguay","countryCode":"UY","mainCities":["Montevideo","Salto","Paysandú","Las Piedras"],"rawOffsetInMinutes":-180,"abbreviation":"UYT","rawFormat":"-03:00 Uruguay Time - Montevideo, Salto, Paysandú, Las Piedras"},{"name":"America/Noronha","alternativeName":"Fernando de Noronha Time","group":["America/Noronha","Brazil/DeNoronha"],"continentCode":"SA","continentName":"South America","countryName":"Brazil","countryCode":"BR","mainCities":["Noronha"],"rawOffsetInMinutes":-120,"abbreviation":"FNT","rawFormat":"-02:00 Fernando de Noronha Time - Noronha"},{"name":"America/Nuuk","alternativeName":"Greenland Time","group":["America/Nuuk","America/Scoresbysund","America/Godthab"],"continentCode":"NA","continentName":"North America","countryName":"Greenland","countryCode":"GL","mainCities":["Nuuk","Scoresbysund"],"rawOffsetInMinutes":-120,"abbreviation":"GMT-2","rawFormat":"-02:00 Greenland Time - Nuuk, Scoresbysund"},{"name":"Atlantic/South_Georgia","alternativeName":"South Georgia Time","group":["Atlantic/South_Georgia"],"continentCode":"AN","continentName":"Antarctica","countryName":"South Georgia and the South Sandwich Islands","countryCode":"GS","mainCities":["Grytviken"],"rawOffsetInMinutes":-120,"abbreviation":"GST","rawFormat":"-02:00 South Georgia Time - Grytviken"},{"name":"Atlantic/Azores","alternativeName":"Azores Time","group":["Atlantic/Azores"],"continentCode":"EU","continentName":"Europe","countryName":"Portugal","countryCode":"PT","mainCities":["Ponta Delgada"],"rawOffsetInMinutes":-60,"abbreviation":"AZOT","rawFormat":"-01:00 Azores Time - Ponta Delgada"},{"name":"Atlantic/Cape_Verde","alternativeName":"Cape Verde Time","group":["Atlantic/Cape_Verde"],"continentCode":"AF","continentName":"Africa","countryName":"Cabo Verde","countryCode":"CV","mainCities":["Praia","Mindelo","Espargos","Assomada"],"rawOffsetInMinutes":-60,"abbreviation":"CVT","rawFormat":"-01:00 Cape Verde Time - Praia, Mindelo, Espargos, Assomada"},{"name":"Africa/Abidjan","alternativeName":"Greenwich Mean Time","group":["Africa/Abidjan","Iceland","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Nouakchott","Africa/Ouagadougou","Atlantic/Reykjavik","Atlantic/St_Helena","Africa/Timbuktu"],"continentCode":"AF","continentName":"Africa","countryName":"Ivory Coast","countryCode":"CI","mainCities":["Abidjan","Abobo","Bouaké","Korhogo"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawF
280ormat":"+00:00 Greenwich Mean Time - Abidjan, Abobo, Bouaké, Korhogo"},{"name":"Africa/Bamako","alternativeName":"Greenwich Mean Time","group":["Africa/Bamako"],"continentCode":"AF","continentName":"Africa","countryName":"Mali","countryCode":"ML","mainCities":["Bamako","Sikasso","Koutiala","Ségou"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Bamako, Sikasso, Koutiala, Ségou"},{"name":"Africa/Bissau","alternativeName":"Greenwich Mean Time","group":["Africa/Bissau"],"continentCode":"AF","continentName":"Africa","countryName":"Guinea-Bissau","countryCode":"GW","mainCities":["Bissau","Gabú","Bafatá","Xitole"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Bissau, Gabú, Bafatá, Xitole"},{"name":"Africa/Conakry","alternativeName":"Greenwich Mean Time","group":["Africa/Conakry"],"continentCode":"AF","continentName":"Africa","countryName":"Guinea","countryCode":"GN","mainCities":["Conakry","Camayenne","Nzérékoré","Kankan"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Conakry, Camayenne, Nzérékoré, Kankan"},{"name":"Africa/Dakar","alternativeName":"Greenwich Mean Time","group":["Africa/Dakar"],"continentCode":"AF","continentName":"Africa","countryName":"Senegal","countryCode":"SN","mainCities":["Dakar","Touba","Pikine","Guédiawaye"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Dakar, Touba, Pikine, Guédiawaye"},{"name":"America/Danmarkshavn","alternativeName":"Greenwich Mean Time","group":["America/Danmarkshavn"],"continentCode":"NA","continentName":"North America","countryName":"Greenland","countryCode":"GL","mainCities":["Danmarkshavn"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Danmarkshavn"},{"name":"Europe/Isle_of_Man","alternativeName":"Greenwich Mean Time","group":["Europe/Isle_of_Man"],"continentCode":"EU","continentName":"Europe","countryName":"Isle of Man","countryCode":"IM","mainCities":["Douglas"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Douglas"},{"name":"Europe/Dublin","alternativeName":"Greenwich Mean Time","group":["Europe/Dublin","Eire"],"continentCode":"EU","continentName":"Europe","countryName":"Ireland","countryCode":"IE","mainCities":["Dublin","South Dublin","Cork","Limerick"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Dublin, South Dublin, Cork, Limerick"},{"name":"Africa/Freetown","alternativeName":"Greenwich Mean Time","group":["Africa/Freetown"],"continentCode":"AF","continentName":"Africa","countryName":"Sierra Leone","countryCode":"SL","mainCities":["Freetown","Bo","Kenema","Koidu"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Freetown, Bo, Kenema, Koidu"},{"name":"Atlantic/St_Helena","alternativeName":"Greenwich Mean Time","group":["Atlantic/St_Helena"],"continentCode":"AF","continentName":"Africa","countryName":"Saint Helena","countryCode":"SH","mainCities":["Jamestown"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Jamestown"},{"name":"Africa/Accra","alternativeName":"Greenwich Mean Time","group":["Africa/Accra"],"continentCode":"AF","continentName":"Africa","countryName":"Ghana","countryCode":"GH","mainCities":["Kumasi","Accra","Tamale","Takoradi"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Kumasi, Accra, Tamale, Takoradi"},{"name":"Africa/Lome","alternativeName":"Greenwich Mean Time","group":["Africa/Lome"],"continentCode":"AF","continentName":"Africa","countryName":"Togo","countryCode":"TG","mainCities":["Lomé","Sokodé","Kara","Atakpamé"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Lomé, Sokodé, Kara, Atakpamé"},{"name":"Europe/London","alternativeName":"Greenwich Mean Time","group":["Europe/London","GB","GB-Eire","Europe/Guernsey","Europe/Isle_of_Man","Europe/Jersey","Europe/Belfast"],"continentCode":"EU","continentName":"Europe","countryName":"United Kingdom","countryCode":"GB","mainCities":["London","Birmingham","Glasgow","Manchester"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawF
280ormat":"+00:00 Greenwich Mean Time - London, Birmingham, Glasgow, Manchester"},{"name":"Africa/Monrovia","alternativeName":"Greenwich Mean Time","group":["Africa/Monrovia"],"continentCode":"AF","continentName":"Africa","countryName":"Liberia","countryCode":"LR","mainCities":["Monrovia","Gbarnga","Buchanan","Ganta"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Monrovia, Gbarnga, Buchanan, Ganta"},{"name":"Africa/Nouakchott","alternativeName":"Greenwich Mean Time","group":["Africa/Nouakchott"],"continentCode":"AF","continentName":"Africa","countryName":"Mauritania","countryCode":"MR","mainCities":["Nouakchott","Nouadhibou","Kiffa","Dar Naim"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Nouakchott, Nouadhibou, Kiffa, Dar Naim"},{"name":"Africa/Ouagadougou","alternativeName":"Greenwich Mean Time","group":["Africa/Ouagadougou"],"continentCode":"AF","continentName":"Africa","countryName":"Burkina Faso","countryCode":"BF","mainCities":["Ouagadougou","Bobo-Dioulasso","Koudougou","Saaba"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Ouagadougou, Bobo-Dioulasso, Koudougou, Saaba"},{"name":"Atlantic/Reykjavik","alternativeName":"Greenwich Mean Time","group":["Atlantic/Reykjavik"],"continentCode":"EU","continentName":"Europe","countryName":"Iceland","countryCode":"IS","mainCities":["ReykjavÃk","Kópavogur","Hafnarfjörður","Reykjanesbær"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - ReykjavÃk, Kópavogur, Hafnarfjörður, Reykjanesbær"},{"name":"Europe/Jersey","alternativeName":"Greenwich Mean Time","group":["Europe/Jersey"],"continentCode":"EU","continentName":"Europe","countryName":"Jersey","countryCode":"JE","mainCities":["Saint Helier"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Saint Helier"},{"name":"Europe/Guernsey","alternativeName":"Greenwich Mean Time","group":["Europe/Guernsey"],"continentCode":"EU","continentName":"Europe","countryName":"Guernsey","countryCode":"GG","mainCities":["Saint Peter Port"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Saint Peter Port"},{"name":"Africa/Banjul","alternativeName":"Greenwich Mean Time","group":["Africa/Banjul"],"continentCode":"AF","continentName":"Africa","countryName":"Gambia","countryCode":"GM","mainCities":["Serekunda","Brikama","Bununka Kunda","Sukuta"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Serekunda, Brikama, Bununka Kunda, Sukuta"},{"name":"Africa/Sao_Tome","alternativeName":"Greenwich Mean Time","group":["Africa/Sao_Tome"],"continentCode":"AF","continentName":"Africa","countryName":"Sao Tome and Principe","countryCode":"ST","mainCities":["São Tomé"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - São Tomé"},{"name":"Antarctica/Troll","alternativeName":"Greenwich Mean Time","group":["Antarctica/Troll"],"continentCode":"AN","continentName":"Antarctica","countryName":"Antarctica","countryCode":"AQ","mainCities":["Troll"],"rawOffsetInMinutes":0,"abbreviation":"GMT","rawFormat":"+00:00 Greenwich Mean Time - Troll"},{"name":"Africa/Casablanca","alternativeName":"Western European Time","group":["Africa/Casablanca"],"continentCode":"AF","continentName":"Africa","countryName":"Morocco","countryCode":"MA","mainCities":["Casablanca","Rabat","Fes","Tangier"],"rawOffsetInMinutes":0,"abbreviation":"WET","rawFormat":"+00:00 Western European Time - Casablanca, Rabat, Fes, Tangier"},{"name":"Africa/El_Aaiun","alternativeName":"Western European Time","group":["Africa/El_Aaiun"],"continentCode":"AF","continentName":"Africa","countryName":"Western Sahara","countryCode":"EH","mainCities":["Laayoune","Dakhla","Boujdour"],"rawOffsetInMinutes":0,"abbreviation":"WET","rawFormat":"+00:00 Western European Time - Laayoune, Dakhla, Boujdour"},{"name":"Atlantic/Canary","alternativeName":"Western European Time","group":["Atlantic/Canary"],"continentCode":"EU","continentName":"Europe","countryName":"Spain","countryCode":"ES","mainCities":["Las Palmas de Gran Canaria","Santa Cruz de Tenerife","La Laguna","Telde"],"rawOffsetInMinutes":0,"abbreviation":"WET","rawF
280ormat":"+00:00 Western European Time - Las Palmas de Gran Canaria, Santa Cruz de Tenerife, La Laguna, Telde"},{"name":"Europe/Lisbon","alternativeName":"Western European Time","group":["Atlantic/Madeira","Europe/Lisbon","Portugal","WET"],"continentCode":"EU","continentName":"Europe","countryName":"Portugal","countryCode":"PT","mainCities":["Lisbon","Porto","Amadora","Braga"],"rawOffsetInMinutes":0,"abbreviation":"WET","rawFormat":"+00:00 Western European Time - Lisbon, Porto, Amadora, Braga"},{"name":"Atlantic/Faroe","alternativeName":"Western European Time","group":["Atlantic/Faroe","Atlantic/Faeroe"],"continentCode":"EU","continentName":"Europe","countryName":"Faroe Islands","countryCode":"FO","mainCities":["Tórshavn"],"rawOffsetInMinutes":0,"abbreviation":"WET","rawFormat":"+00:00 Western European Time - Tórshavn"},{"name":"Africa/Windhoek","alternativeName":"Central Africa Time","group":["Africa/Windhoek"],"continentCode":"AF","continentName":"Africa","countryName":"Namibia","countryCode":"NA","mainCities":["Windhoek","Rundu","Walvis Bay","Swakopmund"],"rawOffsetInMinutes":60,"abbreviation":"CAT","rawFormat":"+01:00 Central Africa Time - Windhoek, Rundu, Walvis Bay, Swakopmund"},{"name":"Africa/Algiers","alternativeName":"Central European Time","group":["Africa/Algiers"],"continentCode":"AF","continentName":"Africa","countryName":"Algeria","countryCode":"DZ","mainCities":["Algiers","Oran","Constantine","Annaba"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Algiers, Oran, Constantine, Annaba"},{"name":"Europe/Andorra","alternativeName":"Central European Time","group":["Europe/Andorra"],"continentCode":"EU","continentName":"Europe","countryName":"Andorra","countryCode":"AD","mainCities":["Andorra la Vella","les Escaldes"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Andorra la Vella, les Escaldes"},{"name":"Europe/Belgrade","alternativeName":"Central European Time","group":["Europe/Belgrade","Europe/Ljubljana","Europe/Podgorica","Europe/Sarajevo","Europe/Skopje","Europe/Zagreb"],"continentCode":"EU","continentName":"Europe","countryName":"Serbia","countryCode":"RS","mainCities":["Belgrade","NiÅ¡","Novi Sad","Zemun"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Belgrade, NiÅ¡, Novi Sad, Zemun"},{"name":"Europe/Berlin","alternativeName":"Central European Time","group":["Europe/Berlin","Europe/Busingen","Arctic/Longyearbyen","Europe/Copenhagen","Europe/Oslo","Europe/Stockholm","Atlantic/Jan_Mayen"],"continentCode":"EU","continentName":"Europe","countryName":"Germany","countryCode":"DE","mainCities":["Berlin","Hamburg","Munich","Köln"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Berlin, Hamburg, Munich, Köln"},{"name":"Europe/Bratislava","alternativeName":"Central European Time","group":["Europe/Bratislava"],"continentCode":"EU","continentName":"Europe","countryName":"Slovakia","countryCode":"SK","mainCities":["Bratislava","KoÅ¡ice","Petržalka","Nitra"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Bratislava, KoÅ¡ice, Petržalka, Nitra"},{"name":"Europe/Brussels","alternativeName":"Central European Time","group":["Europe/Brussels","CET","MET","Europe/Amsterdam","Europe/Luxembourg"],"continentCode":"EU","continentName":"Europe","countryName":"Belgium","countryCode":"BE","mainCities":["Brussels","Antwerpen","Gent","Charleroi"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Brussels, Antwerpen, Gent, Charleroi"},{"name":"Europe/Budapest","alternativeName":"Central European Time","group":["Europe/Budapest"],"continentCode":"EU","continentName":"Europe","countryName":"Hungary","countryCode":"HU","mainCities":["Budapest","Debrecen","Szeged","Miskolc"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Budapest, Debrecen, Szeged, Miskolc"},{"name":"Europe/Copenhagen","alternativeName":"Central European Time","group":["Europe/Copenhagen"],"continentCode":"EU","continentName":"Europe","countryName":"Denmark","countryCode":"DK","mainCities":["Copenhagen","Ã
rhus","Odense","Aalborg"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawF
280ormat":"+01:00 Central European Time - Copenhagen, Ã
rhus, Odense, Aalborg"},{"name":"Europe/Gibraltar","alternativeName":"Central European Time","group":["Europe/Gibraltar"],"continentCode":"EU","continentName":"Europe","countryName":"Gibraltar","countryCode":"GI","mainCities":["Gibraltar"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Gibraltar"},{"name":"Europe/Ljubljana","alternativeName":"Central European Time","group":["Europe/Ljubljana"],"continentCode":"EU","continentName":"Europe","countryName":"Slovenia","countryCode":"SI","mainCities":["Ljubljana","Maribor","Celje","Kranj"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Ljubljana, Maribor, Celje, Kranj"},{"name":"Arctic/Longyearbyen","alternativeName":"Central European Time","group":["Arctic/Longyearbyen"],"continentCode":"EU","continentName":"Europe","countryName":"Svalbard and Jan Mayen","countryCode":"SJ","mainCities":["Longyearbyen"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Longyearbyen"},{"name":"Europe/Luxembourg","alternativeName":"Central European Time","group":["Europe/Luxembourg"],"continentCode":"EU","continentName":"Europe","countryName":"Luxembourg","countryCode":"LU","mainCities":["Luxembourg","Esch-sur-Alzette","Dudelange"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Luxembourg, Esch-sur-Alzette, Dudelange"},{"name":"Europe/Madrid","alternativeName":"Central European Time","group":["Africa/Ceuta","Europe/Madrid"],"continentCode":"EU","continentName":"Europe","countryName":"Spain","countryCode":"ES","mainCities":["Madrid","Barcelona","Valencia","Zaragoza"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Madrid, Barcelona, Valencia, Zaragoza"},{"name":"Europe/Monaco","alternativeName":"Central European Time","group":["Europe/Monaco"],"continentCode":"EU","continentName":"Europe","countryName":"Monaco","countryCode":"MC","mainCities":["Monaco","Monte-Carlo"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Monaco, Monte-Carlo"},{"name":"Europe/Oslo","alternativeName":"Central European Time","group":["Europe/Oslo"],"continentCode":"EU","continentName":"Europe","countryName":"Norway","countryCode":"NO","mainCities":["Oslo","Bergen","Trondheim","Stavanger"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Oslo, Bergen, Trondheim, Stavanger"},{"name":"Europe/Paris","alternativeName":"Central European Time","group":["Europe/Paris","Europe/Monaco"],"continentCode":"EU","continentName":"Europe","countryName":"France","countryCode":"FR","mainCities":["Paris","Marseille","Lyon","Toulouse"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Paris, Marseille, Lyon, Toulouse"},{"name":"Europe/Podgorica","alternativeName":"Central European Time","group":["Europe/Podgorica"],"continentCode":"EU","continentName":"Europe","countryName":"Montenegro","countryCode":"ME","mainCities":["Podgorica","NikÅ¡iÄ","Herceg Novi","Pljevlja"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Podgorica, NikÅ¡iÄ, Herceg Novi, Pljevlja"},{"name":"Europe/Prague","alternativeName":"Central European Time","group":["Europe/Prague","Europe/Bratislava"],"continentCode":"EU","continentName":"Europe","countryName":"Czechia","countryCode":"CZ","mainCities":["Prague","Brno","Ostrava","Pilsen"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Prague, Brno, Ostrava, Pilsen"},{"name":"Europe/Rome","alternativeName":"Central European Time","group":["Europe/Rome","Europe/San_Marino","Europe/Vatican"],"continentCode":"EU","continentName":"Europe","countryName":"Italy","countryCode":"IT","mainCities":["Rome","Milan","Naples","Turin"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Rome, Milan, Naples, Turin"},{"name":"Europe/Amsterdam","alternativeName":"Central European Time","group":["Europe/Amsterdam"],"continentCode":"EU","continentName":"Europe","countryName":"The Netherlands","countryCode":"NL","mainCities":["Rotterdam","Amsterdam","The Hague","Utrecht"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawF
280ormat":"+01:00 Central European Time - Rotterdam, Amsterdam, The Hague, Utrecht"},{"name":"Europe/San_Marino","alternativeName":"Central European Time","group":["Europe/San_Marino"],"continentCode":"EU","continentName":"Europe","countryName":"San Marino","countryCode":"SM","mainCities":["San Marino"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - San Marino"},{"name":"Europe/Malta","alternativeName":"Central European Time","group":["Europe/Malta"],"continentCode":"EU","continentName":"Europe","countryName":"Malta","countryCode":"MT","mainCities":["San Pawl il-Baħar","Birkirkara","Mosta","Sliema"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - San Pawl il-Baħar, Birkirkara, Mosta, Sliema"},{"name":"Europe/Sarajevo","alternativeName":"Central European Time","group":["Europe/Sarajevo"],"continentCode":"EU","continentName":"Europe","countryName":"Bosnia and Herzegovina","countryCode":"BA","mainCities":["Sarajevo","Banja Luka","Zenica","Tuzla"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Sarajevo, Banja Luka, Zenica, Tuzla"},{"name":"Europe/Skopje","alternativeName":"Central European Time","group":["Europe/Skopje"],"continentCode":"EU","continentName":"Europe","countryName":"North Macedonia","countryCode":"MK","mainCities":["Skopje","Kumanovo","Prilep","Bitola"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Skopje, Kumanovo, Prilep, Bitola"},{"name":"Europe/Stockholm","alternativeName":"Central European Time","group":["Europe/Stockholm"],"continentCode":"EU","continentName":"Europe","countryName":"Sweden","countryCode":"SE","mainCities":["Stockholm","Göteborg","Malmö","Uppsala"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Stockholm, Göteborg, Malmö, Uppsala"},{"name":"Europe/Tirane","alternativeName":"Central European Time","group":["Europe/Tirane"],"continentCode":"EU","continentName":"Europe","countryName":"Albania","countryCode":"AL","mainCities":["Tirana","Durrës","Vlorë","Elbasan"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Tirana, Durrës, Vlorë, Elbasan"},{"name":"Africa/Tunis","alternativeName":"Central European Time","group":["Africa/Tunis"],"continentCode":"AF","continentName":"Africa","countryName":"Tunisia","countryCode":"TN","mainCities":["Tunis","Sfax","Sousse","Kairouan"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Tunis, Sfax, Sousse, Kairouan"},{"name":"Europe/Vaduz","alternativeName":"Central European Time","group":["Europe/Vaduz"],"continentCode":"EU","continentName":"Europe","countryName":"Liechtenstein","countryCode":"LI","mainCities":["Vaduz"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Vaduz"},{"name":"Europe/Vatican","alternativeName":"Central European Time","group":["Europe/Vatican"],"continentCode":"EU","continentName":"Europe","countryName":"Vatican","countryCode":"VA","mainCities":["Vatican City"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Vatican City"},{"name":"Europe/Vienna","alternativeName":"Central European Time","group":["Europe/Vienna"],"continentCode":"EU","continentName":"Europe","countryName":"Austria","countryCode":"AT","mainCities":["Vienna","Graz","Linz","Favoriten"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Vienna, Graz, Linz, Favoriten"},{"name":"Europe/Warsaw","alternativeName":"Central European Time","group":["Europe/Warsaw","Poland"],"continentCode":"EU","continentName":"Europe","countryName":"Poland","countryCode":"PL","mainCities":["Warsaw","Åódź","Kraków","WrocÅaw"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Warsaw, Åódź, Kraków, WrocÅaw"},{"name":"Europe/Zagreb","alternativeName":"Central European Time","group":["Europe/Zagreb"],"continentCode":"EU","continentName":"Europe","countryName":"Croatia","countryCode":"HR","mainCities":["Zagreb","Split","Rijeka","Osijek"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawF
280ormat":"+01:00 Central European Time - Zagreb, Split, Rijeka, Osijek"},{"name":"Europe/Zurich","alternativeName":"Central European Time","group":["Europe/Zurich","Europe/Busingen","Europe/Vaduz"],"continentCode":"EU","continentName":"Europe","countryName":"Switzerland","countryCode":"CH","mainCities":["Zürich","Genève","Basel","Lausanne"],"rawOffsetInMinutes":60,"abbreviation":"CET","rawFormat":"+01:00 Central European Time - Zürich, Genève, Basel, Lausanne"},{"name":"Africa/Bangui","alternativeName":"West Africa Time","group":["Africa/Bangui"],"continentCode":"AF","continentName":"Africa","countryName":"Central African Republic","countryCode":"CF","mainCities":["Bangui","Bimbo","Bégoua","Carnot"],"rawOffsetInMinutes":60,"abbreviation":"WAT","rawFormat":"+01:00 West Africa Time - Bangui, Bimbo, Bégoua, Carnot"},{"name":"Africa/Malabo","alternativeName":"West Africa Time","group":["Africa/Malabo"],"continentCode":"AF","continentName":"Africa","countryName":"Equatorial Guinea","countryCode":"GQ","mainCities":["Bata","Malabo","Ebebiyin"],"rawOffsetInMinutes":60,"abbreviation":"WAT","rawFormat":"+01:00 West Africa Time - Bata, Malabo, Ebebiyin"},{"name":"Africa/Brazzaville","alternativeName":"West Africa Time","group":["Africa/Brazzaville"],"continentCode":"AF","continentName":"Africa","countryName":"Republic of the Congo","countryCode":"CG","mainCities":["Brazzaville","Pointe-Noire","Dolisie","Nkayi"],"rawOffsetInMinutes":60,"abbreviation":"WAT","rawFormat":"+01:00 West Africa Time - Brazzaville, Pointe-Noire, Dolisie, Nkayi"},{"name":"Africa/Porto-Novo","alternativeName":"West Africa Time","group":["Africa/Porto-Novo"],"continentCode":"AF","continentName":"Africa","countryName":"Benin","countryCode":"BJ","mainCities":["Cotonou","Abomey-Calavi","Porto-Novo","Parakou"],"rawOffsetInMinutes":60,"abbreviation":"WAT","rawFormat":"+01:00 West Africa Time - Cotonou, Abomey-Calavi, Porto-Novo, Parakou"},{"name":"Africa/Douala","alternativeName":"West Africa Time","group":["Africa/Douala"],"continentCode":"AF","continentName":"Africa","countryName":"Cameroon","countryCode":"CM","mainCities":["Douala","Yaoundé","Bamenda","Bafoussam"],"rawOffsetInMinutes":60,"abbreviation":"WAT","rawFormat":"+01:00 West Africa Time - Douala, Yaoundé, Bamenda, Bafoussam"},{"name":"Africa/Kinshasa","alternativeName":"West Africa Time","group":["Africa/Kinshasa"],"continentCode":"AF","continentName":"Africa","countryName":"Democratic Republic of the Congo","countryCode":"CD","mainCities":["Kinshasa","Kikwit","Masina","Mbandaka"],"rawOffsetInMinutes":60,"abbreviation":"WAT","rawFormat":"+01:00 West Africa Time - Kinshasa, Kikwit, Masina, Mbandaka"},{"name":"Africa/Lagos","alternativeName":"West Africa Time","group":["Africa/Lagos","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Niamey","Africa/Porto-Novo"],"continentCode":"AF","continentName":"Africa","countryName":"Nigeria","countryCode":"NG","mainCities":["Lagos","Kano","Ibadan","Abuja"],"rawOffsetInMinutes":60,"abbreviation":"WAT","rawFormat":"+01:00 West Africa Time - Lagos, Kano, Ibadan, Abuja"},{"name":"Africa/Libreville","alternativeName":"West Africa Time","group":["Africa/Libreville"],"continentCode":"AF","continentName":"Africa","countryName":"Gabon","countryCode":"GA","mainCities":["Libreville","Port-Gentil","Franceville","Owendo"],"rawOffsetInMinutes":60,"abbreviation":"WAT","rawFormat":"+01:00 West Africa Time - Libreville, Port-Gentil, Franceville, Owendo"},{"name":"Africa/Luanda","alternativeName":"West Africa Time","group":["Africa/Luanda"],"continentCode":"AF","continentName":"Africa","countryName":"Angola","countryCode":"AO","mainCities":["Luanda","Lubango","Huambo","Benguela"],"rawOffsetInMinutes":60,"abbreviation":"WAT","rawFormat":"+01:00 West Africa Time - Luanda, Lubango, Huambo, Benguela"},{"name":"Africa/Ndjamena","alternativeName":"West Africa Time","group":["Africa/Ndjamena"],"continentCode":"AF","continentName":"Africa","countryName":"Chad","countryCode":"TD","mainCities":["N'Djamena","Moundou","Abéché","Sarh"],"rawOffsetInMinutes":60,"abbreviation":"WAT","rawFormat":"+01:00 West Africa Time - N'Djamena, Moundou, Abéché, Sarh"},{"name":"Africa/Niamey","alternativeName":"West Africa Time","group":["Africa/Niamey"],"continentCode":"AF","continentName":"Africa","countryName":"Niger","countryCode":"NE","mainCities":["Niamey","Maradi","Zinder","Tahoua"],"rawOffsetInMinutes":60,"abbreviation":"WAT","rawFormat":"+01:00 West Africa Time - Niamey, Maradi, Zinder, Tahoua"},{"name":"Africa/Bujumbura","alternativeName":"Central Africa Time","group":["Africa/Bujumbura"],"continentCode":"AF","continentName":"Africa","countryName":"Burundi","countryCode":"BI","mainCities":["Bujumbura","Gitega","Ngozi","Rumonge"],"rawOffsetInMinutes":120,"abbreviation":"CAT","rawFormat":"+02:00 Central Africa Time - Bujumbura, Gitega, Ngozi, Rumonge"},{"name":"Africa/Gaborone","alternativeName":"Central Africa Time","group":["Africa/Gaborone"],"continentCode":"AF","continentName":"Africa","countryName":"Botswana","countryCode":"BW","mainCities":["Gaborone","Francistown","Mogoditshane","Maun"],"rawOffsetInMinutes":120,"abbreviation":"CAT","rawFormat":"+02:00 Central Africa Time - Gaborone, Francistown, Mogoditshane, Maun"},{"name":"Africa/Harare","alternativeName":"Central Africa Time","group":["Africa/Harare"],"continentCode":"AF","continentName":"Africa","countryName":"Zimbabwe","countryCode":"ZW","mainCities":["Harare","Bulawayo","Chitungwiza","Mutare"],"rawOffsetInMinutes":120,"abbreviation":"CAT","rawFormat":"+02:00 Central Africa Time - Harare, Bulawayo, Chitungwiza, Mutare"},{"name":"Africa/Juba","alternativeName":"Central Africa Time","group":["Africa/Juba"],"continentCode":"AF","continentName":"Africa","countryName":"South Sudan","countryCode":"SS","mainCities":["Juba","Winejok","Yei","Malakal"],"rawOffsetInMinutes":120,"abbreviation":"CAT","rawFormat":"+02:00 Central Africa Time - Juba, Winejok, Yei, Malakal"},{"name":"Africa/Khartoum","alternativeName":"Central Africa Time","group":["Africa/Khartoum"],"continentCode":"AF","continentName":"Africa","countryName":"Sudan","countryCode":"SD","mainCities":["Khartoum","Omdurman","Khartoum North","Nyala"],"rawOffsetInMinutes":120,"abbreviation":"CAT","rawFormat":"+02:00 Central Africa Time - Khartoum, Omdurman, Khartoum North, Nyala"}
280,{"name":"Africa/Kigali","alternativeName":"Central Africa Time","group":["Africa/Kigali"],"continentCode":"AF","continentName":"Africa","countryName":"Rwanda","countryCode":"RW","mainCities":["Kigali","Gisenyi","Musanze","Nyagatare"],"rawOffsetInMinutes":120,"abbreviation":"CAT","rawFormat":"+02:00 Central Africa Time - Kigali, Gisenyi, Musanze, Nyagatare"},{"name":"Africa/Blantyre","alternativeName":"Central Africa Time","group":["Africa/Blantyre"],"continentCode":"AF","continentName":"Africa","countryName":"Malawi","countryCode":"MW","mainCities":["Lilongwe","Blantyre","Mzuzu","Zomba"],"rawOffsetInMinutes":120,"abbreviation":"CAT","rawFormat":"+02:00 Central Africa Time - Lilongwe, Blantyre, Mzuzu, Zomba"},{"name":"Africa/Lubumbashi","alternativeName":"Central Africa Time","group":["Africa/Lubumbashi"],"continentCode":"AF","continentName":"Africa","countryName":"Democratic Republic of the Congo","countryCode":"CD","mainCities":["Lubumbashi","Mbuji-Mayi","Kananga","Kisangani"],"rawOffsetInMinutes":120,"abbreviation":"CAT","rawFormat":"+02:00 Central Africa Time - Lubumbashi, Mbuji-Mayi, Kananga, Kisangani"},{"name":"Africa/Lusaka","alternativeName":"Central Africa Time","group":["Africa/Lusaka"],"continentCode":"AF","continentName":"Africa","countryName":"Zambia","countryCode":"ZM","mainCities":["Lusaka","Kitwe","Ndola","Chipata"],"rawOffsetInMinutes":120,"abbreviation":"CAT","rawFormat":"+02:00 Central Africa Time - Lusaka, Kitwe, Ndola, Chipata"},{"name":"Africa/Maputo","alternativeName":"Central Africa Time","group":["Africa/Maputo","Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka"],"continentCode":"AF","continentName":"Africa","countryName":"Mozambique","countryCode":"MZ","mainCities":["Maputo","Matola","Nampula","Beira"],"rawOffsetInMinutes":120,"abbreviation":"CAT","rawFormat":"+02:00 Central Africa Time - Maputo, Matola, Nampula, Beira"},{"name":"Europe/Athens","alternativeName":"Eastern European Time","group":["Europe/Athens","EET"],"continentCode":"EU","continentName":"Europe","countryName":"Greece","countryCode":"GR","mainCities":["Athens","ThessalonÃki","Pátra","Piraeus"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Athens, ThessalonÃki, Pátra, Piraeus"},{"name":"Asia/Beirut","alternativeName":"Eastern European Time","group":["Asia/Beirut"],"continentCode":"AS","continentName":"Asia","countryName":"Lebanon","countryCode":"LB","mainCities":["Beirut","Raâs BayrÅ«t","Tripoli","Sidon"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Beirut, Raâs BayrÅ«t, Tripoli, Sidon"},{"name":"Europe/Bucharest","alternativeName":"Eastern European Time","group":["Europe/Bucharest"],"continentCode":"EU","continentName":"Europe","countryName":"Romania","countryCode":"RO","mainCities":["Bucharest","Sector 3","IaÅi","Sector 6"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Bucharest, Sector 3, IaÅi, Sector 6"},{"name":"Africa/Cairo","alternativeName":"Eastern European Time","group":["Africa/Cairo","Egypt"],"continentCode":"AF","continentName":"Africa","countryName":"Egypt","countryCode":"EG","mainCities":["Cairo","Alexandria","Giza","ShubrÄ al Khaymah"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Cairo, Alexandria, Giza, ShubrÄ al Khaymah"},{"name":"Europe/Chisinau","alternativeName":"Eastern European Time","group":["Europe/Chisinau","Europe/Tiraspol"],"continentCode":"EU","continentName":"Europe","countryName":"Moldova","countryCode":"MD","mainCities":["Chisinau","Tiraspol","BÄlÅ£i","Bender"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Chisinau, Tiraspol, BÄlÅ£i, Bender"},{"name":"Asia/Hebron","alternativeName":"Eastern European Time","group":["Asia/Gaza","Asia/Hebron"],"continentCode":"AS","continentName":"Asia","countryName":"Palestinian Territory","countryCode":"PS","mainCities":["East Jerusalem","Gaza","KhÄn YÅ«nis","JabÄlyÄ"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawF
280ormat":"+02:00 Eastern European Time - East Jerusalem, Gaza, KhÄn YÅ«nis, JabÄlyÄ"},{"name":"Europe/Helsinki","alternativeName":"Eastern European Time","group":["Europe/Helsinki","Europe/Mariehamn"],"continentCode":"EU","continentName":"Europe","countryName":"Finland","countryCode":"FI","mainCities":["Helsinki","Espoo","Tampere","Vantaa"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Helsinki, Espoo, Tampere, Vantaa"},{"name":"Europe/Kaliningrad","alternativeName":"Eastern European Time","group":["Europe/Kaliningrad"],"continentCode":"EU","continentName":"Europe","countryName":"Russia","countryCode":"RU","mainCities":["Kaliningrad","Chernyakhovsk","Sovetsk","Baltiysk"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Kaliningrad, Chernyakhovsk, Sovetsk, Baltiysk"},{"name":"Europe/Kyiv","alternativeName":"Eastern European Time","group":["Europe/Kyiv","Europe/Uzhgorod","Europe/Zaporozhye","Europe/Kiev"],"continentCode":"EU","continentName":"Europe","countryName":"Ukraine","countryCode":"UA","mainCities":["Kyiv","Kharkiv","Odesa","Dnipro"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Kyiv, Kharkiv, Odesa, Dnipro"},{"name":"Europe/Mariehamn","alternativeName":"Eastern European Time","group":["Europe/Mariehamn"],"continentCode":"EU","continentName":"Europe","countryName":"Aland Islands","countryCode":"AX","mainCities":["Mariehamn"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Mariehamn"},{"name":"Asia/Nicosia","alternativeName":"Eastern European Time","group":["Asia/Famagusta","Asia/Nicosia","Europe/Nicosia"],"continentCode":"EU","continentName":"Europe","countryName":"Cyprus","countryCode":"CY","mainCities":["Nicosia","Limassol","Larnaca","Stróvolos"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Nicosia, Limassol, Larnaca, Stróvolos"},{"name":"Europe/Riga","alternativeName":"Eastern European Time","group":["Europe/Riga"],"continentCode":"EU","continentName":"Europe","countryName":"Latvia","countryCode":"LV","mainCities":["Riga","Daugavpils","LiepÄja","Jelgava"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Riga, Daugavpils, LiepÄja, Jelgava"},{"name":"Europe/Sofia","alternativeName":"Eastern European Time","group":["Europe/Sofia"],"continentCode":"EU","continentName":"Europe","countryName":"Bulgaria","countryCode":"BG","mainCities":["Sofia","Plovdiv","Varna","Burgas"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Sofia, Plovdiv, Varna, Burgas"},{"name":"Europe/Tallinn","alternativeName":"Eastern European Time","group":["Europe/Tallinn"],"continentCode":"EU","continentName":"Europe","countryName":"Estonia","countryCode":"EE","mainCities":["Tallinn","Tartu","Narva","Pärnu"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Tallinn, Tartu, Narva, Pärnu"},{"name":"Africa/Tripoli","alternativeName":"Eastern European Time","group":["Africa/Tripoli","Libya"],"continentCode":"AF","continentName":"Africa","countryName":"Libya","countryCode":"LY","mainCities":["Tripoli","Benghazi","Misratah","Zliten"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Tripoli, Benghazi, Misratah, Zliten"},{"name":"Europe/Vilnius","alternativeName":"Eastern European Time","group":["Europe/Vilnius"],"continentCode":"EU","continentName":"Europe","countryName":"Lithuania","countryCode":"LT","mainCities":["Vilnius","Kaunas","KlaipÄda","Å iauliai"],"rawOffsetInMinutes":120,"abbreviation":"EET","rawFormat":"+02:00 Eastern European Time - Vilnius, Kaunas, KlaipÄda, Å iauliai"},{"name":"Asia/Jerusalem","alternativeName":"Israel Time","group":["Asia/Jerusalem","Israel","Asia/Tel_Aviv"],"continentCode":"AS","continentName":"Asia","countryName":"Israel","countryCode":"IL","mainCities":["Jerusalem","Tel Aviv","West Jerusalem","Haifa"],"rawOffsetInMinutes":120,"abbreviation":"IST","rawF
280ormat":"+02:00 Israel Time - Jerusalem, Tel Aviv, West Jerusalem, Haifa"},{"name":"Africa/Johannesburg","alternativeName":"South Africa Time","group":["Africa/Johannesburg","Africa/Maseru","Africa/Mbabane"],"continentCode":"AF","continentName":"Africa","countryName":"South Africa","countryCode":"ZA","mainCities":["Johannesburg","Cape Town","Durban","Pretoria"],"rawOffsetInMinutes":120,"abbreviation":"SAST","rawFormat":"+02:00 South Africa Time - Johannesburg, Cape Town, Durban, Pretoria"},{"name":"Africa/Mbabane","alternativeName":"South Africa Time","group":["Africa/Mbabane"],"continentCode":"AF","continentName":"Africa","countryName":"Eswatini","countryCode":"SZ","mainCities":["Manzini","Mbabane","Lobamba"],"rawOffsetInMinutes":120,"abbreviation":"SAST","rawFormat":"+02:00 South Africa Time - Manzini, Mbabane, Lobamba"},{"name":"Africa/Maseru","alternativeName":"South Africa Time","group":["Africa/Maseru"],"continentCode":"AF","continentName":"Africa","countryName":"Lesotho","countryCode":"LS","mainCities":["Maseru","Maputsoe","Mohale's Hoek","Mafeteng"],"rawOffsetInMinutes":120,"abbreviation":"SAST","rawFormat":"+02:00 South Africa Time - Maseru, Maputsoe, Mohale's Hoek, Mafeteng"},{"name":"Asia/Kuwait","alternativeName":"Arabian Time","group":["Asia/Kuwait"],"continentCode":"AS","continentName":"Asia","countryName":"Kuwait","countryCode":"KW","mainCities":["Al AḩmadÄ«","ḨawallÄ«","As SÄlimÄ«yah","ÅabÄḩ as SÄlim"],"rawOffsetInMinutes":180,"abbreviation":"AST","rawFormat":"+03:00 Arabian Time - Al AḩmadÄ«, ḨawallÄ«, As SÄlimÄ«yah, ÅabÄḩ as SÄlim"},{"name":"Asia/Bahrain","alternativeName":"Arabian Time","group":["Asia/Bahrain"],"continentCode":"AS","continentName":"Asia","countryName":"Bahrain","countryCode":"BH","mainCities":["Al Muharraq","Manama","MadÄ«nat Ḩamad","Ar RifÄâ"],"rawOffsetInMinutes":180,"abbreviation":"AST","rawFormat":"+03:00 Arabian Time - Al Muharraq, Manama, MadÄ«nat Ḩamad, Ar RifÄâ"},{"name":"Asia/Baghdad","alternativeName":"Arabian Time","group":["Asia/Baghdad"],"continentCode":"AS","continentName":"Asia","countryName":"Iraq","countryCode":"IQ","mainCities":["Baghdad","Al MawÅil al JadÄ«dah","Al BaÅrah al QadÄ«mah","Mosul"],"rawOffsetInMinutes":180,"abbreviation":"AST","rawFormat":"+03:00 Arabian Time - Baghdad, Al MawÅil al JadÄ«dah, Al BaÅrah al QadÄ«mah, Mosul"},{"name":"Asia/Qatar","alternativeName":"Arabian Time","group":["Asia/Qatar","Asia/Bahrain"],"continentCode":"AS","continentName":"Asia","countryName":"Qatar","countryCode":"QA","mainCities":["Doha","Ar RayyÄn","Al MaÅ£Är al âAtÄ«q","Al ManÅÅ«rah"],"rawOffsetInMinutes":180,"abbreviation":"AST","rawFormat":"+03:00 Arabian Time - Doha, Ar RayyÄn, Al MaÅ£Är al âAtÄ«q, Al ManÅÅ«rah"},{"name":"Asia/Riyadh","alternativeName":"Arabian Time","group":["Asia/Riyadh","Antarctica/Syowa","Asia/Aden","Asia/Kuwait"],"continentCode":"AS","continentName":"Asia","countryName":"Saudi Arabia","countryCode":"SA","mainCities":["Jeddah","Riyadh","Makkah","Madinah"],"rawOffsetInMinutes":180,"abbreviation":"AST","rawFormat":"+03:00 Arabian Time - Jeddah, Riyadh, Makkah, Madinah"},{"name":"Asia/Aden","alternativeName":"Arabian Time","group":["Asia/Aden"],"continentCode":"AS","continentName":"Asia","countryName":"Yemen","countryCode":"YE","mainCities":["Sanaa","Aden","Taiz","Ibb"],"rawOffsetInMinutes":180,"abbreviation":"AST","rawFormat":"+03:00 Arabian Time - Sanaa, Aden, Taiz, Ibb"},{"name":"Asia/Amman","alternativeName":"Asia/Amman","group":["Asia/Amman"],"continentCode":"AS","continentName":"Asia","countryName":"Jordan","countryCode":"JO","mainCities":["Amman","Zarqa","Irbid","Russeifa"],"rawOffsetInMinutes":180,"abbreviation":"GMT+3","rawFormat":"+03:00 Asia/Amman - Amman, Zarqa, Irbid, Russeifa"},{"name":"Asia/Damascus","alternativeName":"Asia/Damascus","group":["Asia/Damascus"],"continentCode":"AS","continentName":"Asia","countryName":"Syria","countryCode":"SY","mainCities":["Aleppo","Damascus","Homs","Latakia"],"rawOffsetInMinutes":180,"abbreviation":"GMT+3","rawFormat":"+03:00 Asia/Damascus - Aleppo, Damascus, Homs, Latakia"},{"name":"Africa/Addis_Ababa","alternativeName":"East Africa Time","group":["Africa/Addis_Ababa"],"continentCode":"AF","continentName":"Africa","countryName":"Ethiopia","countryCode":"ET","mainCities":["Addis Ababa","Jijiga","Gonder","Mek'ele"],"rawOffsetInMinutes":180,"abbreviation":"EAT","rawFormat":"+03:00 East Africa Time - Addis Ababa, Jijiga, Gonder, Mek'ele"},{"name":"Indian/Antananarivo","alternativeName":"East Africa Time","group":["Indian/Antananarivo"],"continentCode":"AF","continentName":"Africa","countryName":"Madagascar","countryCode":"MG","mainCities":["Antananarivo","Toamasina","Antsirabe","Mahajanga"],"rawOffsetInMinutes":180,"abbreviation":"EAT","rawFormat":"+03:00 East Africa Time - Antananarivo, Toamasina, Antsirabe, Mahajanga"},{"name":"Africa/Asmara","alternativeName":"East Africa Time","group":["Africa/Asmara"],"continentCode":"AF","continentName":"Africa","countryName":"Eritrea","countryCode":"ER","mainCities":["Asmara","Keren","Himora","Massawa"],"rawOffsetInMinutes":180,"abbreviation":"EAT","rawFormat":"+03:00 East Africa Time - Asmara, Keren, Himora, Massawa"},{"name":"Africa/Dar_es_Salaam","alternativeName":"East Africa Time","group":["Africa/Dar_es_Salaam"],"continentCode":"AF","continentName":"Africa","countryName":"Tanzania","countryCode":"TZ","mainCities":["Dar es Salaam","Mwanza","Dodoma","Zanzibar"],"rawOffsetInMinutes":180,"abbreviation":"EAT","rawFormat":"+03:00 East Africa Time - Dar es Salaam, Mwanza, Dodoma, Zanzibar"},{"name":"Africa/Djibouti","alternativeName":"East Africa Time","group":["Africa/Djibouti"],"continentCode":"AF","continentName":"Africa","countryName":"Djibouti","countryCode":"DJ","mainCities":["Djibouti","Ali Sabih","Dikhil","Tadjoura"],"rawOffsetInMinutes":180,"abbreviation":"EAT","rawFormat":"+03:00 East Africa Time - Djibouti, Ali Sabih, Dikhil, Tadjoura"},{"name":"Africa/Kampala","alternativeName":"East Africa Time","group":["Africa/Kampala"],"continentCode":"AF","continentName":"Africa","countryName":"Uganda","countryCode":"UG","mainCities":["Kampala","Nansana","Kira","Bunamwaya"],"rawOffsetInMinutes":180,"abbreviation":"EAT","rawFormat":"+03:00 East Africa Time - Kampala, Nansana, Kira, Bunamwaya"},{"name":"Indian/Mayotte","alternativeName":"East Africa Time","group":["Indian/Mayotte"],"continentCode":"AF","continentName":"Africa","countryName":"Mayotte","countryCode":"YT","mainCities":["Mamoudzou","Koungou","Labattoir","Kaouéni"],"rawOffsetInMinutes":180,"abbreviation":"EAT","rawFormat":"+03:00 East Africa Time - Mamoudzou, Koungou, Labattoir, Kaouéni"},{"name":"Africa/Mogadishu","alternativeName":"East Africa Time","group":["Africa/Mogadishu"],"continentCode":"AF","continentName":"Africa","countryName":"Somalia","countryCode":"SO","mainCities":["Mogadishu","Borama","Hargeysa","Berbera"],"rawOffsetInMinutes":180,"abbreviation":"EAT","rawFormat":"+03:00 East Africa Time - Mogadishu, Borama, Hargeysa, Berbera"},{"name":"Indian/Comoro","alternativeName":"East Africa Time","group":["Indian/Comoro"],"continentCode":"AF","continentName":"Africa","countryName":"Comoros","countryCode":"KM","mainCities":["Moroni","Moutsamoudou","Fomboni"],"rawOffsetInMinutes":180,"abbreviation":"EAT","rawFormat":"+03:00 East Africa Time - Moroni, Moutsamoudou, Fomboni"},{"name":"Africa/Nairobi","alternativeName":"East Africa Time","group":["Africa/Nairobi","Africa/Addis_Ababa","Africa/Asmara","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Kampala","Africa/Mogadishu","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte","Africa/Asmera"],"continentCode":"AF","continentName":"Africa","countryName":"Kenya","countryCode":"KE","mainCities":["Nairobi","Kakamega","Mombasa","Nakuru"],"rawOffsetInMinutes":180,"abbreviation":"EAT","rawFormat":"+03:00 East Africa Time - Nairobi, Kakamega, Mombasa, Nakuru"},{"name":"Europe/Minsk","alternativeName":"Moscow Time","group":["Europe/Minsk"],"continentCode":"EU","continentName":"Europe","countryName":"Belarus","countryCode":"BY","mainCities":["Minsk","Homyel'","Hrodna","Vitebsk"],"rawOffsetInMinutes":180,"abbreviation":"MSK","rawFormat":"+03:00 Moscow Time - Minsk, Homyel', Hrodna, Vitebsk"},{"name":"Europe/Moscow","alternativeName":"Moscow Time","group":["Europe/Kirov","Europe/Moscow","Europe/Volgograd","W-SU"],"continentCode":"EU","continentName":"Europe","countryName":"Russia","countryCode":"RU","mainCities":["Moscow","Saint Petersburg","Nizhniy Novgorod","Kazan"],"rawOffsetInMinutes":180,"abbreviation":"MSK","rawFormat":"+03:00 Moscow Time - Moscow, Saint Petersburg, Nizhniy Novgorod, Kazan"},{"name":"Europe/Simferopol","alternativeName":"Moscow Time","group":["Europe/Simferopol"],"continentCode":"EU","continentName":"Europe","countryName":"Ukraine","countryCode":"UA","mainCities":["Sevastopol","Simferopol","Kerch","Yevpatoriya"],"rawOffsetInMinutes":180,"abbreviation":"MSK","rawFormat":"+03:00 Moscow Time - Sevastopol, Simferopol, Kerch, Yevpatoriya"},{"name":"Antarctica/Syowa","alternativeName":"Syowa Time","group":["Antarctica/Syowa"],"continentCode":"AN","continentName":"Antarctica","countryName":"Antarctica","countryCode":"AQ","mainCities":["Syowa"],"rawOffsetInMinutes":180,"abbreviation":"SYOT","rawFormat":"+03:00 Syowa Time - Syowa"},{"name":"Europe/Istanbul","alternativeName":"Turkey Time","group":["Europe/Istanbul","Turkey","Asia/Istanbul"],"continentCode":"AS","continentName":"Asia","countryName":"Turkey","countryCode":"TR","mainCities":["Istanbul","Ankara","Bursa","İzmir"],"rawOffsetInMinutes":180,"abbreviation":"TRT","rawF
280ormat":"+03:00 Turkey Time - Istanbul, Ankara, Bursa, İzmir"},{"name":"Asia/Tehran","alternativeName":"Iran Time","group":["Asia/Tehran","Iran"],"continentCode":"AS","continentName":"Asia","countryName":"Iran","countryCode":"IR","mainCities":["Tehran","Mashhad","Isfahan","Karaj"],"rawOffsetInMinutes":210,"abbreviation":"IRST","rawFormat":"+03:30 Iran Time - Tehran, Mashhad, Isfahan, Karaj"},{"name":"Asia/Yerevan","alternativeName":"Armenia Time","group":["Asia/Yerevan"],"continentCode":"AS","continentName":"Asia","countryName":"Armenia","countryCode":"AM","mainCities":["Yerevan","Malatia-Sebastia","Shengavit","Nor Nork"],"rawOffsetInMinutes":240,"abbreviation":"AMT","rawFormat":"+04:00 Armenia Time - Yerevan, Malatia-Sebastia, Shengavit, Nor Nork"},{"name":"Asia/Baku","alternativeName":"Azerbaijan Time","group":["Asia/Baku"],"continentCode":"AS","continentName":"Asia","countryName":"Azerbaijan","countryCode":"AZ","mainCities":["Baku","Sumqayıt","Ganja","Lankaran"],"rawOffsetInMinutes":240,"abbreviation":"AZT","rawFormat":"+04:00 Azerbaijan Time - Baku, Sumqayıt, Ganja, Lankaran"},{"name":"Asia/Tbilisi","alternativeName":"Georgia Time","group":["Asia/Tbilisi"],"continentCode":"AS","continentName":"Asia","countryName":"Georgia","countryCode":"GE","mainCities":["Tbilisi","Batumi","Kutaisi","Rustavi"],"rawOffsetInMinutes":240,"abbreviation":"GET","rawFormat":"+04:00 Georgia Time - Tbilisi, Batumi, Kutaisi, Rustavi"},{"name":"Asia/Dubai","alternativeName":"Gulf Time","group":["Asia/Dubai","Asia/Muscat","Indian/Mahe","Indian/Reunion"],"continentCode":"AS","continentName":"Asia","countryName":"United Arab Emirates","countryCode":"AE","mainCities":["Dubai","Abu Dhabi","Sharjah","Al Ain City"],"rawOffsetInMinutes":240,"abbreviation":"GST","rawFormat":"+04:00 Gulf Time - Dubai, Abu Dhabi, Sharjah, Al Ain City"},{"name":"Asia/Muscat","alternativeName":"Gulf Time","group":["Asia/Muscat"],"continentCode":"AS","continentName":"Asia","countryName":"Oman","countryCode":"OM","mainCities":["Muscat","Seeb","Bawshar","âIbrÄ«"],"rawOffsetInMinutes":240,"abbreviation":"GST","rawFormat":"+04:00 Gulf Time - Muscat, Seeb, Bawshar, âIbrÄ«"},{"name":"Indian/Mauritius","alternativeName":"Mauritius Time","group":["Indian/Mauritius"],"continentCode":"AF","continentName":"Africa","countryName":"Mauritius","countryCode":"MU","mainCities":["Port Louis","Vacoas","Beau Bassin-Rose Hill","Curepipe"],"rawOffsetInMinutes":240,"abbreviation":"MUT","rawFormat":"+04:00 Mauritius Time - Port Louis, Vacoas, Beau Bassin-Rose Hill, Curepipe"},{"name":"Indian/Reunion","alternativeName":"Réunion Time","group":["Indian/Reunion"],"continentCode":"AF","continentName":"Africa","countryName":"Reunion","countryCode":"RE","mainCities":["Saint-Denis","Saint-Paul","Saint-Pierre","Le Tampon"],"rawOffsetInMinutes":240,"abbreviation":"RET","rawFormat":"+04:00 Réunion Time - Saint-Denis, Saint-Paul, Saint-Pierre, Le Tampon"},{"name":"Europe/Samara","alternativeName":"Samara Time","group":["Europe/Astrakhan","Europe/Samara","Europe/Saratov","Europe/Ulyanovsk"],"continentCode":"EU","continentName":"Europe","countryName":"Russia","countryCode":"RU","mainCities":["Samara","Saratov","Tolyatti","Izhevsk"],"rawOffsetInMinutes":240,"abbreviation":"SAMT","rawFormat":"+04:00 Samara Time - Samara, Saratov, Tolyatti, Izhevsk"},{"name":"Indian/Mahe","alternativeName":"Seychelles Time","group":["Indian/Mahe"],"continentCode":"AF","continentName":"Africa","countryName":"Seychelles","countryCode":"SC","mainCities":["Victoria"],"rawOffsetInMinutes":240,"abbreviation":"SCT","rawFormat":"+04:00 Seychelles Time - Victoria"},{"name":"Asia/Kabul","alternativeName":"Afghanistan Time","group":["Asia/Kabul"],"continentCode":"AS","continentName":"Asia","countryName":"Afghanistan","countryCode":"AF","mainCities":["Kabul","HerÄt","MazÄr-e SharÄ«f","KandahÄr"],"rawOffsetInMinutes":270,"abbreviation":"AFT","rawFormat":"+04:30 Afghanistan Time - Kabul, HerÄt, MazÄr-e SharÄ«f, KandahÄr"},{"name":"Indian/Kerguelen","alternativeName":"French Southern & Antarctic Time","group":["Indian/Kerguelen"],"continentCode":"AN","continentName":"Antarctica","countryName":"French Southern Territories","countryCode":"TF","mainCities":["Port-aux-Français"],"rawOffsetInMinutes":300,"abbreviation":"FSAT","rawFormat":"+05:00 French Southern & Antarctic Time - Port-aux-Français"},{"name":"Asia/Almaty","alternativeName":"Kazakhstan Time","group":["Asia/Almaty","Asia/Aqtau","Asia/Aqtobe","Asia/Atyrau","Asia/Oral","Asia/Qostanay","Asia/Qyzylorda"],"continentCode":"AS","continentName":"Asia","countryName":"Kazakhstan","countryCode":"KZ","mainCities":["Almaty","Shymkent","Aktobe","Karagandy"],"rawOffsetInMinutes":300,"abbreviation":"GMT+5","rawFormat":"+05:00 K
280azakhstan Time - Almaty, Shymkent, Aktobe, Karagandy"},{"name":"Indian/Maldives","alternativeName":"Maldives Time","group":["Indian/Maldives","Indian/Kerguelen"],"continentCode":"AS","continentName":"Asia","countryName":"Maldives","countryCode":"MV","mainCities":["Male"],"rawOffsetInMinutes":300,"abbreviation":"MVT","rawFormat":"+05:00 Maldives Time - Male"},{"name":"Antarctica/Mawson","alternativeName":"Mawson Time","group":["Antarctica/Mawson","Antarctica/Vostok"],"continentCode":"AN","continentName":"Antarctica","countryName":"Antarctica","countryCode":"AQ","mainCities":["Mawson","Vostok"],"rawOffsetInMinutes":300,"abbreviation":"MAWT","rawFormat":"+05:00 Mawson Time - Mawson, Vostok"},{"name":"Asia/Karachi","alternativeName":"Pakistan Time","group":["Asia/Karachi"],"continentCode":"AS","continentName":"Asia","countryName":"Pakistan","countryCode":"PK","mainCities":["Lahore","Karachi","Peshawar","Faisalabad"],"rawOffsetInMinutes":300,"abbreviation":"PKT","rawFormat":"+05:00 Pakistan Time - Lahore, Karachi, Peshawar, Faisalabad"},{"name":"Asia/Dushanbe","alternativeName":"Tajikistan Time","group":["Asia/Dushanbe"],"continentCode":"AS","continentName":"Asia","countryName":"Tajikistan","countryCode":"TJ","mainCities":["Dushanbe","Isfara","Istaravshan","KÅlob"],"rawOffsetInMinutes":300,"abbreviation":"TJT","rawFormat":"+05:00 Tajikistan Time - Dushanbe, Isfara, Istaravshan, KÅlob"},{"name":"Asia/Ashgabat","alternativeName":"Turkmenistan Time","group":["Asia/Ashgabat","Asia/Ashkhabad"],"continentCode":"AS","continentName":"Asia","countryName":"Turkmenistan","countryCode":"TM","mainCities":["Ashgabat","Türkmenabat","DaÅoguz","Mary"],"rawOffsetInMinutes":300,"abbreviation":"TMT","rawFormat":"+05:00 Turkmenistan Time - Ashgabat, Türkmenabat, DaÅoguz, Mary"},{"name":"Asia/Tashkent","alternativeName":"Uzbekistan Time","group":["Asia/Samarkand","Asia/Tashkent"],"continentCode":"AS","continentName":"Asia","countryName":"Uzbekistan","countryCode":"UZ","mainCities":["Tashkent","Andijon","Namangan","Samarkand"],"rawOffsetInMinutes":300,"abbreviation":"UZT","rawFormat":"+05:00 Uzbekistan Time - Tashkent, Andijon, Namangan, Samarkand"},{"name":"Asia/Yekaterinburg","alternativeName":"Yekaterinburg Time","group":["Asia/Yekaterinburg"],"continentCode":"EU","continentName":"Europe","countryName":"Russia","countryCode":"RU","mainCities":["Yekaterinburg","Chelyabinsk","Ufa","Perm"],"rawOffsetInMinutes":300,"abbreviation":"YEKT","rawFormat":"+05:00 Yekaterinburg Time - Yekaterinburg, Chelyabinsk, Ufa, Perm"},{"name":"Asia/Colombo","alternativeName":"India Time","group":["Asia/Colombo"],"continentCode":"AS","continentName":"Asia","countryName":"Sri Lanka","countryCode":"LK","mainCities":["Colombo","Dehiwala-Mount Lavinia","Maharagama","Jaffna"],"rawOffsetInMinutes":33
2800,"abbreviation":"IST","rawFormat":"+05:30 India Time - Colombo, Dehiwala-Mount Lavinia, Maharagama, Jaffna"},{"name":"Asia/Kolkata","alternativeName":"India Time","group":["Asia/Kolkata","Asia/Calcutta"],"continentCode":"AS","continentName":"Asia","countryName":"India","countryCode":"IN","mainCities":["Mumbai","Delhi","Bengaluru","Hyderabad"],"rawOffsetInMinutes":330,"abbreviation":"IST","rawFormat":"+05:30 India Time - Mumbai, Delhi, Bengaluru, Hyderabad"},{"name":"Asia/Kathmandu","alternativeName":"Nepal Time","group":["Asia/Kathmandu","Asia/Katmandu"],"continentCode":"AS","continentName":"Asia","countryName":"Nepal","countryCode":"NP","mainCities":["Kathmandu","Pokhara","Bharatpur","PÄtan"],"rawOffsetInMinutes":345,"abbreviation":"NPT","rawFormat":"+05:45 Nepal Time - Kathmandu, Pokhara, Bharatpur, PÄtan"},{"name":"Asia/Dhaka","alternativeName":"Bangladesh Time","group":["Asia/Dhaka","Asia/Dacca"],"continentCode":"AS","continentName":"Asia","countryName":"Bangladesh","countryCode":"BD","mainCities":["Dhaka","Chattogram","Gazipur","Khulna"],"rawOffsetInMinutes":360,"abbreviation":"BST","rawFormat":"+06:00 Bangladesh Time - Dhaka, Chattogram, Gazipur, Khulna"},{"name":"Asia/Thimphu","alternativeName":"Bhutan Time","group":["Asia/Thimphu","Asia/Thimbu"],"continentCode":"AS","continentName":"Asia","countryName":"Bhutan","countryCode":"BT","mainCities":["Thimphu","Phuntsholing","Tsirang","PunÄkha"],"rawOffsetInMinutes":360,"abbreviation":"BTT","rawFormat":"+06:00 Bhutan Time - Thimphu, Phuntsholing, Tsirang, PunÄkha"},{"name":"Asia/Urumqi","alternativeName":"China Time","group":["Asia/Urumqi","Asia/Kashgar"],"continentCode":"AS","continentName":"Asia","countryName":"China","countryCode":"CN","mainCities":["Ãrümqi","Shihezi","Korla","Aqsu"],"rawOffsetInMinutes":360,"abbreviation":"CST","rawFormat":"+06:00 China Time - Ãrümqi, Shihezi, Korla, Aqsu"},{"name":"Indian/Chagos","alternativeName":"Indian Ocean Time","group":["Indian/Chagos"],"continentCode":"AS","continentName":"Asia","countryName":"British Indian Ocean Territory","countryCode":"IO","mainCities":["Chagos"],"rawOffsetInMinutes":360,"abbreviation":"IOT","rawFormat":"+06:00 Indian Ocean Time - Chagos"},{"name":"Asia/Bishkek","alternativeName":"Kyrgyzstan Time","group":["Asia/Bishkek"],"continentCode":"AS","continentName":"Asia","countryName":"Kyrgyzstan","countryCode":"KG","mainCities":["Bishkek","Osh","Jalal-Abad","Karakol"],"rawOffsetInMinutes":360,"abbreviation":"KGT","rawFormat":"+06:00 Kyrgyzstan Time - Bishkek, Osh, Jalal-Abad, Karakol"},{"name":"Asia/Omsk","alternativeName":"Omsk Time","group":["Asia/Omsk"],"continentCode":"EU","continentName":"Europe","countryName":"Russia","countryCode":"RU","mainCities":["Omsk","Tara","Kalachinsk","Isilâkulâ"],"rawOffsetInMinutes":360,"abbreviation":"OMST","rawFormat":"+06:00 Omsk Time - Omsk, Tara, Kalachinsk, Isilâkulâ"},{"name":"Indian/Cocos","alternativeName":"Cocos Islands Time","group":["Indian/Cocos"],"continentCode":"AS","continentName":"Asia","countryName":"Cocos Islands","countryCode":"CC","mainCities":["West Island"],"rawOffsetInMinutes":390,"abbreviation":"CCT","rawFormat":"+06:30 Cocos Islands Time - West Island"},{"name":"Asia/Yangon","alternativeName":"Myanmar Time","group":["Asia/Yangon","Indian/Cocos","Asia/Rangoon"],"continentCode":"AS","continentName":"Asia","countryName":"Myanmar","countryCode":"MM","mainCities":["Yangon","Mandalay","Nay Pyi Taw","Hlaingthaya Township"],"rawOffsetInMinutes":390,"abbreviation":"MMT","rawFormat":"+06:30 Myanmar Time - Yangon, Mandalay, Nay Pyi Taw, Hlaingthaya Township"},{"name":"Indian/Christmas","alternativeName":"Christmas Island Time","group":["Indian/Christmas"],"continentCode":"OC","continentName":"Oceania","countryName":"Christmas Island","countryCode":"CX","mainCities":["Flying Fish Cove"],"rawOffsetInMinutes":420,"abbreviation":"CXT","rawFormat":"+07:00 Christmas Island Time - Flying Fish Cove"},{"name":"Antarctica/Davis","alternativeName":"Davis Time","group":["Antarctica/Davis"],"continentCode":"AN","continentName":"Antarctica","countryName":"Antarctica","countryCode":"AQ","mainCities":["Davis"],"rawOffsetInMinutes":420,"abbreviation":"DAVT","rawF
280ormat":"+07:00 Davis Time - Davis"},{"name":"Asia/Hovd","alternativeName":"Hovd Time","group":["Asia/Hovd"],"continentCode":"AS","continentName":"Asia","countryName":"Mongolia","countryCode":"MN","mainCities":["Ulaangom","Khovd","Ãlgii","Altai"],"rawOffsetInMinutes":420,"abbreviation":"HOVT","rawFormat":"+07:00 Hovd Time - Ulaangom, Khovd, Ãlgii, Altai"},{"name":"Asia/Bangkok","alternativeName":"Indochina Time","group":["Asia/Bangkok","Asia/Phnom_Penh","Asia/Vientiane","Indian/Christmas"],"continentCode":"AS","continentName":"Asia","countryName":"Thailand","countryCode":"TH","mainCities":["Bangkok","Samut Prakan","Mueang Nonthaburi","Chon Buri"],"rawOffsetInMinutes":420,"abbreviation":"ICT","rawFormat":"+07:00 Indochina Time - Bangkok, Samut Prakan, Mueang Nonthaburi, Chon Buri"},{"name":"Asia/Ho_Chi_Minh","alternativeName":"Indochina Time","group":["Asia/Ho_Chi_Minh","Asia/Saigon"],"continentCode":"AS","continentName":"Asia","countryName":"Vietnam","countryCode":"VN","mainCities":["Ho Chi Minh City","Cần ThÆ¡","Da Nang","Biên Hòa"],"rawOffsetInMinutes":420,"abbreviation":"ICT","rawFormat":"+07:00 Indochina Time - Ho Chi Minh City, Cần ThÆ¡, Da Nang, Biên Hòa"},{"name":"Asia/Phnom_Penh","alternativeName":"Indochina Time","group":["Asia/Phnom_Penh"],"continentCode":"AS","continentName":"Asia","countryName":"Cambodia","countryCode":"KH","mainCities":["Phnom Penh","Takeo","Siem Reap","Battambang"],"rawOffsetInMinutes":420,"abbreviation":"ICT","rawFormat":"+07:00 Indochina Time - Phnom Penh, Takeo, Siem Reap, Battambang"},{"name":"Asia/Vientiane","alternativeName":"Indochina Time","group":["Asia/Vientiane"],"continentCode":"AS","continentName":"Asia","countryName":"Laos","countryCode":"LA","mainCities":["Vientiane","Savannakhet","Pakse","Thakhèk"],"rawOffsetInMinutes":420,"abbreviation":"ICT","rawFormat":"+07:00 Indochina Time - Vientiane, Savannakhet, Pakse, Thakhèk"},{"name":"Asia/Novosibirsk","alternativeName":"Novosibirsk Time","group":["Asia/Barnaul","Asia/Krasnoyarsk","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Tomsk"],"continentCode":"EU","continentName":"Europe","countryName":"Russia","countryCode":"RU","mainCities":["Novosibirsk","Krasnoyarsk","Barnaul","Tomsk"],"rawOffsetInMinutes":420,"abbreviation":"NOVT","rawFormat":"+07:00 Novosibirsk Time - Novosibirsk, Krasnoyarsk, Barnaul, Tomsk"},{"name":"Asia/Jakarta","alternativeName":"Western Indonesia Time","group":["Asia/Jakarta","Asia/Pontianak"],"continentCode":"AS","continentName":"Asia","countryName":"Indonesia","countryCode":"ID","mainCities":["Jakarta","Surabaya","Bekasi","Bandung"],"rawOffsetInMinutes":420,"abbreviation":"WIB","rawFormat":"+07:00 Western Indonesia Time - Jakarta, Surabaya, Bekasi, Bandung"},{"name":"Antarctica/Casey","alternativeName":"Australian Western Time","group":["Antarctica/Casey"],"continentCode":"AN","continentName":"Antarctica","countryName":"Antarctica","countryCode":"AQ","mainCities":["Casey"],"rawOffsetInMinutes":480,"abbreviation":"AWST","rawFormat":"+08:00 Australian Western Time - Casey"},{"name":"Australia/Perth","alternativeName":"Australian Western Time","group":["Australia/Perth","Australia/West"],"continentCode":"OC","continentName":"Oceania","countryName":"Australia","countryCode":"AU","mainCities":["Perth","Mandurah","Bunbury","Geraldton"],"rawOffsetInMinutes":480,"abbreviation":"AWST","rawFormat":"+08:00 Australian Western Time - Perth, Mandurah, Bunbury, Geraldton"},{"name":"Asia/Brunei","alternativeName":"Brunei Time","group":["Asia/Brunei"],"continentCode":"AS","continentName":"Asia","countryName":"Brunei","countryCode":"BN","mainCities":["Bandar Seri Begawan","Sengkurong","Mentiri","Kuala Belait"],"rawOffsetInMinutes":480,"abbreviation":"GMT+8","rawFormat":"+08:00 Brunei Time - Bandar Seri Begawan, Sengkurong, Mentiri, Kuala Belait"},{"name":"Asia/Makassar","alternativeName":"Central Indonesia Time","group":["Asia/Makassar","Asia/Ujung_Pandang"],"continentCode":"AS","continentName":"Asia","countryName":"Indonesia","countryCode":"ID","mainCities":["Makassar","Samarinda","Denpasar","Balikpapan"],"rawOffsetInMinutes":480,"abbreviation":"WITA","rawFormat":"+08:00 Central Indonesia Time - Makassar, Samarinda, Denpasar, Balikpapan"},{"name":"Asia/Macau","alternativeName":"China Time","group":["Asia/Macau","Asia/Macao"],"continentCode":"AS","continentName":"Asia","countryName":"Macao","countryCode":"MO","mainCities":["Macau","Taipa","Sé","Luhuan"],"rawOffsetInMinutes":480,"abbreviation":"CST","rawF
280ormat":"+08:00 China Time - Macau, Taipa, Sé, Luhuan"},{"name":"Asia/Shanghai","alternativeName":"China Time","group":["Asia/Shanghai","PRC","Asia/Chongqing","Asia/Harbin","Asia/Chungking"],"continentCode":"AS","continentName":"Asia","countryName":"China","countryCode":"CN","mainCities":["Shanghai","Beijing","Shenzhen","Guangzhou"],"rawOffsetInMinutes":480,"abbreviation":"CST","rawFormat":"+08:00 China Time - Shanghai, Beijing, Shenzhen, Guangzhou"},{"name":"Asia/Hong_Kong","alternativeName":"Hong Kong Time","group":["Asia/Hong_Kong","Hongkong"],"continentCode":"AS","continentName":"Asia","countryName":"Hong Kong","countryCode":"HK","mainCities":["Hong Kong","New Territories","Kowloon","Hong Kong Island"],"rawOffsetInMinutes":480,"abbreviation":"HKT","rawFormat":"+08:00 Hong Kong Time - Hong Kong, New Territories, Kowloon, Hong Kong Island"},{"name":"Asia/Irkutsk","alternativeName":"Irkutsk Time","group":["Asia/Irkutsk"],"continentCode":"EU","continentName":"Europe","countryName":"Russia","countryCode":"RU","mainCities":["Irkutsk","Ulan-Ude","Bratsk","Angarsk"],"rawOffsetInMinutes":480,"abbreviation":"IRKT","rawFormat":"+08:00 Irkutsk Time - Irkutsk, Ulan-Ude, Bratsk, Angarsk"},{"name":"Asia/Kuala_Lumpur","alternativeName":"Malaysia Time","group":["Asia/Kuala_Lumpur","Asia/Kuching","Asia/Brunei"],"continentCode":"AS","continentName":"Asia","countryName":"Malaysia","countryCode":"MY","mainCities":["Kuala Lumpur","Johor Bahru","Kampung Baru Subang","Petaling Jaya"],"rawOffsetInMinutes":480,"abbreviation":"MYT","rawFormat":"+08:00 Malaysia Time - Kuala Lumpur, Johor Bahru, Kampung Baru Subang, Petaling Jaya"},{"name":"Asia/Manila","alternativeName":"Philippine Time","group":["Asia/Manila"],"continentCode":"AS","continentName":"Asia","countryName":"Philippines","countryCode":"PH","mainCities":["Quezon City","Davao","Caloocan City","Manila"],"rawOffsetInMinutes":480,"abbreviation":"PHT","rawFormat":"+08:00 Philippine Time - Quezon City, Davao, Caloocan City, Manila"},{"name":"Asia/Singapore","alternativeName":"Singapore Time","group":["Asia/Singapore","Singapore","Asia/Kuala_Lumpur"],"continentCode":"AS","continentName":"Asia","countryName":"Singapore","countryCode":"SG","mainCities":["Singapore","Ulu Bedok","Bedok New Town","Tampines Estate"],"rawOffsetInMinutes":480,"abbreviation":"SGT","rawFormat":"+08:00 Singapore Time - Singapore, Ulu Bedok, Bedok New Town, Tampines Estate"},{"name":"Asia/Taipei","alternativeName":"Taiwan Time","group":["Asia/Taipei","ROC"],"continentCode":"AS","continentName":"Asia","countryName":"Taiwan","countryCode":"TW","mainCities":["Taipei","New Taipei City","Taichung","Kaohsiung"],"rawOffsetInMinutes":480,"abbreviation":"GMT+8","rawFormat":"+08:00 Taiwan Time - Taipei, New Taipei City, Taichung, Kaohsiung"},{"name":"Asia/Ulaanbaatar","alternativeName":"Ulaanbaatar Time","group":["Asia/Ulaanbaatar","Asia/Choibalsan","Asia/Ulan_Bator"],"continentCode":"AS","continentName":"Asia","countryName":"Mongolia","countryCode":"MN","mainCities":["Ulan Bator","Erdenet","Darhan","Choibalsan"],"rawOffsetInMinutes":480,"abbreviation":"ULAT","rawFormat":"+08:00 Ulaanbaatar Time - Ulan Bator, Erdenet, Darhan, Choibalsan"},{"name":"Australia/Eucla","alternativeName":"Australian Central Western Time","group":["Australia/Eucla"],"continentCode":"OC","continentName":"Oceania","countryName":"Australia","countryCode":"AU","mainCities":["Eucla"],"rawOffsetInMinutes":525,"abbreviation":"ACWST","rawF
280ormat":"+08:45 Australian Central Western Time - Eucla"},{"name":"Asia/Jayapura","alternativeName":"Eastern Indonesia Time","group":["Asia/Jayapura"],"continentCode":"AS","continentName":"Asia","countryName":"Indonesia","countryCode":"ID","mainCities":["Jayapura","Ambon","Sorong","Ternate"],"rawOffsetInMinutes":540,"abbreviation":"WIT","rawFormat":"+09:00 Eastern Indonesia Time - Jayapura, Ambon, Sorong, Ternate"},{"name":"Asia/Tokyo","alternativeName":"Japan Time","group":["Asia/Tokyo","Japan"],"continentCode":"AS","continentName":"Asia","countryName":"Japan","countryCode":"JP","mainCities":["Tokyo","Yokohama","Osaka","Nagoya"],"rawOffsetInMinutes":540,"abbreviation":"JST","rawFormat":"+09:00 Japan Time - Tokyo, Yokohama, Osaka, Nagoya"},{"name":"Asia/Pyongyang","alternativeName":"Korean Time","group":["Asia/Pyongyang"],"continentCode":"AS","continentName":"Asia","countryName":"North Korea","countryCode":"KP","mainCities":["Pyongyang","HamhÅng","Nampâo","SunchâÅn"],"rawOffsetInMinutes":540,"abbreviation":"KST","rawFormat":"+09:00 Korean Time - Pyongyang, HamhÅng, Nampâo, SunchâÅn"},{"name":"Asia/Seoul","alternativeName":"Korean Time","group":["Asia/Seoul","ROK"],"continentCode":"AS","continentName":"Asia","countryName":"South Korea","countryCode":"KR","mainCities":["Seoul","Busan","Incheon","Daegu"],"rawOffsetInMinutes":540,"abbreviation":"KST","rawFormat":"+09:00 Korean Time - Seoul, Busan, Incheon, Daegu"},{"name":"Pacific/Palau","alternativeName":"Palau Time","group":["Pacific/Palau"],"continentCode":"OC","continentName":"Oceania","countryName":"Palau","countryCode":"PW","mainCities":["Ngerulmud"],"rawOffsetInMinutes":540,"abbreviation":"PWT","rawFormat":"+09:00 Palau Time - Ngerulmud"},{"name":"Asia/Dili","alternativeName":"Timor-Leste Time","group":["Asia/Dili"],"continentCode":"OC","continentName":"Oceania","countryName":"Timor Leste","countryCode":"TL","mainCities":["Dili","Maliana","Suai","Likisá"],"rawOffsetInMinutes":540,"abbreviation":"GMT+9","rawFormat":"+09:00 Timor-Leste Time - Dili, Maliana, Suai, Likisá"},{"name":"Asia/Chita","alternativeName":"Yakutsk Time","group":["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"],"continentCode":"EU","continentName":"Europe","countryName":"Russia","countryCode":"RU","mainCities":["Chita","Yakutsk","Blagoveshchensk","Belogorsk"],"rawOffsetInMinutes":540,"abbreviation":"YAKT","rawFormat":"+09:00 Yakutsk Time - Chita, Yakutsk, Blagoveshchensk, Belogorsk"},{"name":"Australia/Adelaide","alternativeName":"Australian Central Time","group":["Australia/Adelaide","Australia/Broken_Hill","Australia/South","Australia/Yancowinna"],"continentCode":"OC","continentName":"Oceania","countryName":"Australia","countryCode":"AU","mainCities":["Adelaide","Adelaide Hills","Mount Gambier","Morphett Vale"],"rawOffsetInMinutes":570,"abbreviation":"ACST","rawFormat":"+09:30 Australian Central Time - Adelaide, Adelaide Hills, Mount Gambier, Morphett Vale"},{"name":"Australia/Darwin","alternativeName":"Australian Central Time","group":["Australia/Darwin","Australia/North"],"continentCode":"OC","continentName":"Oceania","countryName":"Australia","countryCode":"AU","mainCities":["Darwin","Palmerston","Alice Springs"],"rawOffsetInMinutes":570,"abbreviation":"ACST","rawFormat":"+09:30 Australian Central Time - Darwin, Palmerston, Alice Springs"},{"name":"Australia/Brisbane","alternativeName":"Australian Eastern Time","group":["Australia/Brisbane","Australia/Lindeman","Australia/Queensland"],"continentCode":"OC","continentName":"Oceania","countryName":"Australia","countryCode":"AU","mainCities":["Brisbane","Gold Coast","Sunshine Coast","Logan City"],"rawOffsetInMinutes":600,"abbreviation":"AEST","rawFormat":"+10:00 Australian Eastern Time - Brisbane, Gold Coast, Sunshine Coast, Logan City"},{"name":"Australia/Sydney","alternativeName":"Australian Eastern Time","group":["Antarctica/Macquarie","Australia/Hobart","Australia/Melbourne","Australia/Sydney","Australia/Tasmania","Australia/Currie","Australia/Victoria","Australia/ACT","Australia/NSW","Australia/Canberra"],"continentCode":"OC","continentName":"Oceania","countryName":"Australia","countryCode":"AU","mainCities":["Sydney","Melbourne","Newcastle","Canberra"],"rawOffsetInMinutes":600,"abbreviation":"AEST","rawF
280ormat":"+10:00 Australian Eastern Time - Sydney, Melbourne, Newcastle, Canberra"},{"name":"Pacific/Guam","alternativeName":"Chamorro Time","group":["Pacific/Guam","Pacific/Saipan"],"continentCode":"OC","continentName":"Oceania","countryName":"Guam","countryCode":"GU","mainCities":["Dededo Village","Yigo Village","Tamuning-Tumon-Harmon Village","Tamuning"],"rawOffsetInMinutes":600,"abbreviation":"ChST","rawFormat":"+10:00 Chamorro Time - Dededo Village, Yigo Village, Tamuning-Tumon-Harmon Village, Tamuning"},{"name":"Pacific/Saipan","alternativeName":"Chamorro Time","group":["Pacific/Saipan"],"continentCode":"OC","continentName":"Oceania","countryName":"Northern Mariana Islands","countryCode":"MP","mainCities":["Saipan"],"rawOffsetInMinutes":600,"abbreviation":"ChST","rawFormat":"+10:00 Chamorro Time - Saipan"},{"name":"Pacific/Chuuk","alternativeName":"Chuuk Time","group":["Pacific/Chuuk"],"continentCode":"OC","continentName":"Oceania","countryName":"Micronesia","countryCode":"FM","mainCities":["Chuuk"],"rawOffsetInMinutes":600,"abbreviation":"CHUT","rawFormat":"+10:00 Chuuk Time - Chuuk"},{"name":"Antarctica/DumontDUrville","alternativeName":"Dumont dâUrville Time","group":["Antarctica/DumontDUrville"],"continentCode":"AN","continentName":"Antarctica","countryName":"Antarctica","countryCode":"AQ","mainCities":["DumontDUrville"],"rawOffsetInMinutes":600,"abbreviation":"GMT+10","rawFormat":"+10:00 Dumont dâUrville Time - DumontDUrville"},{"name":"Pacific/Port_Moresby","alternativeName":"Papua New Guinea Time","group":["Pacific/Port_Moresby","Antarctica/DumontDUrville","Pacific/Chuuk","Pacific/Yap","Pacific/Truk"],"continentCode":"OC","continentName":"Oceania","countryName":"Papua New Guinea","countryCode":"PG","mainCities":["Port Moresby","Lae","Mount Hagen","Popondetta"],"rawOffsetInMinutes":600,"abbreviation":"PGT","rawFormat":"+10:00 Papua New Guinea Time - Port Moresby, Lae, Mount Hagen, Popondetta"},{"name":"Asia/Vladivostok","alternativeName":"Vladivostok Time","group":["Asia/Ust-Nera","Asia/Vladivostok"],"continentCode":"EU","continentName":"Europe","countryName":"Russia","countryCode":"RU","mainCities":["Khabarovsk","Vladivostok","Khabarovsk Vtoroy","Komsomolsk-on-Amur"],"rawOffsetInMinutes":600,"abbreviation":"VLAT","rawFormat":"+10:00 Vladivostok Time - Khabarovsk, Vladivostok, Khabarovsk Vtoroy, Komsomolsk-on-Amur"},{"name":"Australia/Lord_Howe","alternativeName":"Lord Howe Time","group":["Australia/Lord_Howe","Australia/LHI"],"continentCode":"OC","continentName":"Oceania","countryName":"Australia","countryCode":"AU","mainCities":["Lord Howe"],"rawOffsetInMinutes":630,"abbreviation":"LHST","rawFormat":"+10:30 Lord Howe Time - Lord Howe"},{"name":"Pacific/Bougainville","alternativeName":"Bougainville Time","group":["Pacific/Bougainville"],"continentCode":"OC","continentName":"Oceania","countryName":"Papua New Guinea","countryCode":"PG","mainCities":["Arawa"],"rawOffsetInMinutes":660,"abbreviation":"BST","rawFormat":"+11:00 Bougainville Time - Arawa"},{"name":"Pacific/Kosrae","alternativeName":"Kosrae Time","group":["Pacific/Kosrae","Pacific/Pohnpei"],"continentCode":"OC","continentName":"Oceania","countryName":"Micronesia","countryCode":"FM","mainCities":["Kosrae","Palikir"],"rawOffsetInMinutes":660,"abbreviation":"KOST","rawFormat":"+11:00 Kosrae Time - Kosrae, Palikir"},{"name":"Pacific/Noumea","alternativeName":"New Caledonia Time","group":["Pacific/Noumea"],"continentCode":"OC","continentName":"Oceania","countryName":"New Caledonia","countryCode":"NC","mainCities":["Nouméa","Mont-Dore","Dumbéa"],"rawOffsetInMinutes":660,"abbreviation":"NCT","rawFormat":"+11:00 New Caledonia Time - Nouméa, Mont-Dore, Dumbéa"},{"name":"Pacific/Norfolk","alternativeName":"Norfolk Island Time","group":["Pacific/Norfolk"],"continentCode":"OC","continentName":"Oceania","countryName":"Norfolk Island","countryCode":"NF","mainCities":["Kingston"],"rawOffsetInMinutes":660,"abbreviation":"NFT","rawFormat":"+11:00 Norfolk Island Time - Kingston"},{"name":"Asia/Sakhalin","alternativeName":"Sakhalin Time","group":["Asia/Magadan","Asia/Sakhalin","Asia/Srednekolymsk"],"continentCode":"EU","continentName":"Europe","countryName":"Russia","countryCode":"RU","mainCities":["Yuzhno-Sakhalinsk","Magadan","Korsakov","Kholmsk"],"rawOffsetInMinutes":660,"abbreviation":"SAKT","rawF
280ormat":"+11:00 Sakhalin Time - Yuzhno-Sakhalinsk, Magadan, Korsakov, Kholmsk"},{"name":"Pacific/Guadalcanal","alternativeName":"Solomon Islands Time","group":["Pacific/Guadalcanal","Pacific/Pohnpei","Pacific/Ponape"],"continentCode":"OC","continentName":"Oceania","countryName":"Solomon Islands","countryCode":"SB","mainCities":["Honiara","Panatina","Nggosi","Tandai"],"rawOffsetInMinutes":660,"abbreviation":"SBT","rawFormat":"+11:00 Solomon Islands Time - Honiara, Panatina, Nggosi, Tandai"},{"name":"Pacific/Efate","alternativeName":"Vanuatu Time","group":["Pacific/Efate"],"continentCode":"OC","continentName":"Oceania","countryName":"Vanuatu","countryCode":"VU","mainCities":["Port-Vila"],"rawOffsetInMinutes":660,"abbreviation":"VUT","rawFormat":"+11:00 Vanuatu Time - Port-Vila"},{"name":"Pacific/Fiji","alternativeName":"Fiji Time","group":["Pacific/Fiji"],"continentCode":"OC","continentName":"Oceania","countryName":"Fiji","countryCode":"FJ","mainCities":["Nasinu","Suva","Lautoka","Nadi"],"rawOffsetInMinutes":720,"abbreviation":"FJT","rawFormat":"+12:00 Fiji Time - Nasinu, Suva, Lautoka, Nadi"},{"name":"Pacific/Tarawa","alternativeName":"Gilbert Islands Time","group":["Pacific/Tarawa","Pacific/Funafuti","Pacific/Majuro","Pacific/Wake","Pacific/Wallis"],"continentCode":"OC","continentName":"Oceania","countryName":"Kiribati","countryCode":"KI","mainCities":["Tarawa"],"rawOffsetInMinutes":720,"abbreviation":"GILT","rawFormat":"+12:00 Gilbert Islands Time - Tarawa"},{"name":"Asia/Kamchatka","alternativeName":"Kamchatka Time","group":["Asia/Anadyr","Asia/Kamchatka"],"continentCode":"EU","continentName":"Europe","countryName":"Russia","countryCode":"RU","mainCities":["Petropavlovsk-Kamchatsky","Yelizovo","Vilyuchinsk","Anadyr"],"rawOffsetInMinutes":720,"abbreviation":"PETT","rawFormat":"+12:00 Kamchatka Time - Petropavlovsk-Kamchatsky, Yelizovo, Vilyuchinsk, Anadyr"},{"name":"Pacific/Majuro","alternativeName":"Marshall Islands Time","group":["Pacific/Kwajalein","Pacific/Majuro","Kwajalein"],"continentCode":"OC","continentName":"Oceania","countryName":"Marshall Islands","countryCode":"MH","mainCities":["Majuro","Kwajalein"],"rawOffsetInMinutes":720,"abbreviation":"MHT","rawFormat":"+12:00 Marshall Islands Time - Majuro, Kwajalein"},{"name":"Pacific/Nauru","alternativeName":"Nauru Time","group":["Pacific/Nauru"],"continentCode":"OC","continentName":"Oceania","countryName":"Nauru","countryCode":"NR","mainCities":["Yaren"],"rawOffsetInMinutes":720,"abbreviation":"NRT","rawFormat":"+12:00 Nauru Time - Yaren"},{"name":"Pacific/Auckland","alternativeName":"New Zealand Time","group":["Pacific/Auckland","NZ","Antarctica/McMurdo","Antarctica/South_Pole"],"continentCode":"OC","continentName":"Oceania","countryName":"New Zealand","countryCode":"NZ","mainCities":["Auckland","Christchurch","Wellington","Manukau City"],"rawOffsetInMinutes":720,"abbreviation":"NZST","rawFormat":"+12:00 New Zealand Time - Auckland, Christchurch, Wellington, Manukau City"},{"name":"Antarctica/McMurdo","alternativeName":"New Zealand Time","group":["Antarctica/McMurdo"],"continentCode":"AN","continentName":"Antarctica","countryName":"Antarctica","countryCode":"AQ","mainCities":["McMurdo"],"rawOffsetInMinutes":720,"abbreviation":"NZST","rawFormat":"+12:00 New Zealand Time - McMurdo"},{"name":"Pacific/Funafuti","alternativeName":"Tuvalu Time","group":["Pacific/Funafuti"],"continentCode":"OC","continentName":"Oceania","countryName":"Tuvalu","countryCode":"TV","mainCities":["Funafuti"],"rawOffsetInMinutes":720,"abbreviation":"TVT","rawFormat":"+12:00 Tuvalu Time - Funafuti"},{"name":"Pacific/Wake","alternativeName":"Wake Island Time","group":["Pacific/Wake"],"continentCode":"OC","continentName":"Oceania","countryName":"United States Minor Outlying Islands","countryCode":"UM","mainCities":["Wake"],"rawOffsetInMinutes":720,"abbreviation":"WAKT","rawFormat":"+12:00 Wake Island Time - Wake"},{"name":"Pacific/Wallis","alternativeName":"Wallis & Futuna Time","group":["Pacific/Wallis"],"continentCode":"OC","continentName":"Oceania","countryName":"Wallis and Futuna","countryCode":"WF","mainCities":["Mata-Utu"],"rawOffsetInMinutes":720,"abbreviation":"WFT","rawF
280ormat":"+12:00 Wallis & Futuna Time - Mata-Utu"},{"name":"Pacific/Chatham","alternativeName":"Chatham Time","group":["Pacific/Chatham","NZ-CHAT"],"continentCode":"OC","continentName":"Oceania","countryName":"New Zealand","countryCode":"NZ","mainCities":["Chatham"],"rawOffsetInMinutes":765,"abbreviation":"CHAST","rawFormat":"+12:45 Chatham Time - Chatham"},{"name":"Pacific/Kanton","alternativeName":"Phoenix Islands Time","group":["Pacific/Kanton","Pacific/Enderbury"],"continentCode":"OC","continentName":"Oceania","countryName":"Kiribati","countryCode":"KI","mainCities":["Kanton"],"rawOffsetInMinutes":780,"abbreviation":"PHOT","rawFormat":"+13:00 Phoenix Islands Time - Kanton"},{"name":"Pacific/Apia","alternativeName":"Samoa Time","group":["Pacific/Apia"],"continentCode":"OC","continentName":"Oceania","countryName":"Samoa","countryCode":"WS","mainCities":["Apia"],"rawOffsetInMinutes":780,"abbreviation":"SST","rawFormat":"+13:00 Samoa Time - Apia"},{"name":"Pacific/Fakaofo","alternativeName":"Tokelau Time","group":["Pacific/Fakaofo"],"continentCode":"OC","continentName":"Oceania","countryName":"Tokelau","countryCode":"TK","mainCities":["Fakaofo"],"rawOffsetInMinutes":780,"abbreviation":"TKT","rawFormat":"+13:00 Tokelau Time - Fakaofo"},{"name":"Pacific/Tongatapu","alternativeName":"Tonga Time","group":["Pacific/Tongatapu"],"continentCode":"OC","continentName":"Oceania","countryName":"Tonga","countryCode":"TO","mainCities":["Nukuâalofa"],"rawOffsetInMinutes":780,"abbreviation":"TOT","rawFormat":"+13:00 Tonga Time - Nukuâalofa"},{"name":"Pacific/Kiritimati","alternativeName":"Line Islands Time","group":["Pacific/Kiritimati"],"continentCode":"OC","continentName":"Oceania","countryName":"Kiribati","countryCode":"KI","mainCities":["Kiritimati"],"rawOffsetInMinutes":840,"abbreviation":"LINT","rawFormat":"+14:00 Line Islands Time - Kiritimati"}]`),Oz=null;function c6e(){return Oz||=fetch(`/timezones-polygons.json`).then(e=>{if(!e.ok)throw Error(`Failed to load timezone polygons: ${e.status}`);return e.json()}),Oz}var kz=null;function l6e(){if(kz)return kz;let e={};for(let t of Dz){let n=t.continentName||`Other`;(e[n]??=[]).push(t)}for(let t of Object.keys(e))e[t].sort((e,t)=>e.name.localeCompare(t.name));return kz=e,e}var Az=null;function u6e(){if(Az)return Az;let e=new Map;for(let t of Dz){for(let n of t.group)e.set(n,t.name);e.set(t.name,t.name)}return Az=e,e}function jz(e){return e&&(u6e().get(e)??e)}var Mz=null;function d6e(){if(Mz)return Mz;let e=new Map;for(let t of Dz)e.set(t.name,t.rawOffsetInMinutes);return Mz=e,e}function Nz(e){let t=jz(e),n=d6e().get(t);if(n==null)return``;let r=n>=0?`+`:`-`,i=Math.abs(n),a=Math.floor(i/60),o=i%60;return o===0?`GMT${r}${a}`:`GMT${r}${a}:${String(o).padStart(2,`0`)}`}const Pz=String.raw`\+?[\d\s\(\)\-\.]{7,25}`;function f6e({...e}){let{t}=V(),[n,r]=Jv(),i=n.get(`email`),a=n.get(`next`),o=(a??``).includes(`/share/accept`),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(``),[d,f]=(0,B.useState)(i??``),[p,m]=(0,B.useState)(``),[h,g]=(0,B.useState)(``),[_,v]=(0,B.useState)(``),[y,b]=(0,B.useState)(`personal`),[x,S]=(0,B.useState)(``),[C,w]=(0,B.useState)(!1),[T,E]=(0,B.useState)(null),[D,O]=(0,B.useState)(!1),{setAuth:k}=Nx(),A=GL(e=>e.createOrganization),j=GL(e=>e.switchActiveOrg),M=Sv();(0,B.useEffect)(()=>{let e=n.get(`cancelled_reg`);e&&(fetch(`${Zb()}/api/v1/auth/pending-registration/${e}`,{method:`DELETE`}).catch(()=>{}),n.delete(`cancelled_reg`),r(n,{replace:!0}))},[]);let N=e=>{if(e.preventDefault(),E(null),h.length<8){E(t(`auth.signup.error_password_short`));return}if(h!==_){E(t(`auth.signup.error_passwords_mismatch`));return}O(!0)},P=async e=>{w(!0),E(null);let r=jz(Intl.DateTimeFormat().resolvedOptions().timeZone),i=(navigator.language??``).toLowerCase().startsWith(`es`)?`es`:`en`;try{if(e===`free`){if(k((await H_e({email:d,password:h,first_name:s.trim(),last_name:l.trim(),phone_number:p||void 0,timezone:r,ui_language:i})).data),y===`organization`&&x.trim())try{await j((await A(x.trim())).id)}catch{}o&&await YT(),M(My(n.get(`next`),`/settings/integrations`),{replace:!0})}else{let e=await fetch(`${Zb()}/api/v1/auth/register-checkout`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({email:d,password:h,first_name:s.trim(),last_name:l.trim(),...p?{phone_number:p}:{},timezone:r,ui_language:i})});if(!e.ok){let t=(await e.json().catch(()=>({}))).detail;throw new Fb(Ib(t)??(typeof t==`string`?t:`Request failed: ${e.status}`),e.status,t)}let{url:t}=await e.json();window.location.href=t}}catch(e){E(Gb(e,t(`auth.signup.error_generic`),{operation:`auth.signup`})),O(!1)}finally{w(!1)}},F=a?`/login?next=${encodeURIComponent(a)}`:`/login`;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(uz,{...e,children:[(0,K.jsxs)(dz,{children:[(0,K.jsx)(fz,{children:t(`auth.signup.title`)}),(0,K.jsx)(pz,{children:t(`auth.signup.description`)})]}),(0,K.jsx)(mz,{children:(0,K.jsx)(`form`,{onSubmit:N,children:(0,K.jsxs)(_z,{children:[T&&(0,K.jsx)(`div`,{className:`text-sm text-red-500 bg-red-50 p-3 rounded-md`,children:T}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{children:t(`auth.signup.account_type_label`)}),(0,K.jsxs)(wz,{type:`single`,value:y,onValueChange:e=>{(e===`personal`||e===`organization`)&&b(e)},className:`justify-start`,children:[(0,K.jsx)(Tz,{value:`personal`,className:`px-4`,children:t(`auth.signup.account_type_personal`)}),(0,K.jsx)(Tz,{value:`organization`,className:`px-4`,children:t(`auth.signup.account_type_organization`)})]})]}),y===`organization`&&(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`org-name`,children:t(`auth.signup.organization_name_label`)}),(0,K.jsx)(dP,{id:`org-name`,type:`text`,placeholder:t(`auth.signup.organization_name_placeholder`),value:x,onChange:e=>S(e.target.value),required:y===`organization`,disabled:C}),(0,K.jsx)(bz,{children:t(`auth.signup.organization_name_description`)})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`first-name`,children:t(`auth.signup.first_name_label`)}),(0,K.jsx)(dP,{id:`first-name`,type:`text`,placeholder:t(`auth.signup.first_name_placeholder`),value:s,onChange:e=>c(e.target.value),required:!0,disabled:C})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`last-name`,children:t(`auth.signup.last_name_label`)}),(0,K.jsx)(dP,{id:`last-name`,type:`text`,placeholder:t(`auth.signup.last_name_placeholder`),value:l,onCh
280ange:e=>u(e.target.value),required:!0,disabled:C})]})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`email`,children:t(`auth.signup.email_label`)}),(0,K.jsx)(dP,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`[email protected]`,value:d,onChange:e=>f(e.target.value),required:!0,disabled:C,readOnly:o&&!!i}),(0,K.jsx)(bz,{children:o&&i?`This is the email your invitation was sent to.`:t(`auth.signup.email_description`)})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`phone`,children:t(`auth.signup.phone_label`)}),(0,K.jsx)(dP,{id:`phone`,name:`phone`,type:`tel`,autoComplete:`tel`,inputMode:`tel`,pattern:Pz,title:t(`auth.signup.phone_invalid`),placeholder:`+1 (555) 123-4567`,value:p,onChange:e=>m(e.target.value),disabled:C}),(0,K.jsx)(bz,{children:t(`auth.signup.phone_description`)})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`password`,children:t(`auth.signup.password_label`)}),(0,K.jsx)(dP,{id:`password`,type:`password`,value:h,onChange:e=>g(e.target.value),required:!0,disabled:C}),(0,K.jsx)(bz,{children:t(`auth.signup.password_description`)})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`confirm-password`,children:t(`auth.signup.confirm_password_label`)}),(0,K.jsx)(dP,{id:`confirm-password`,type:`password`,value:_,onChange:e=>v(e.target.value),required:!0,disabled:C}),(0,K.jsx)(bz,{children:t(`auth.signup.confirm_password_description`)})]}),(0,K.jsx)(_z,{children:(0,K.jsxs)(vz,{children:[(0,K.jsx)(J,{type:`submit`,disabled:C,children:t(C?`auth.signup.submitting`:`auth.signup.submit`)}),(0,K.jsxs)(bz,{className:`px-6 text-center`,children:[t(`auth.signup.have_account`),` `,(0,K.jsx)(Gv,{to:F,className:`underline hover:text-primary`,children:t(`common.sign_in`)})]}),(0,K.jsx)(xz,{action:`creating an account`})]})})]})})})]}),(0,K.jsx)(s6e,{open:D,onOpenChange:O,onPlanSelected:P,isLoading:C})]})}function p6e(){return(0,K.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center p-6 md:p-10`,children:(0,K.jsx)(`div`,{className:`w-full max-w-sm`,children:(0,K.jsx)(f6e,{})})})}function m6e(){let[e]=Jv(),t=Sv(),{setAuth:n}=Nx(),[r,i]=(0,B.useState)(null);return(0,B.useEffect)(()=>{let r=e.get(`session_id`);if(!r){i(`Missing session information.`);return}let a=!1;async function o(){try{let e=await fetch(`${Zb()}/api/v1/auth/complete-registration`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({session_id:r})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.detail||`Registration failed: ${e.status}`)}let i=await e.json();a||(n(i),t(`/settings/integrations`,{replace:!0}))}catch(e){a||i(Gb(e,`Failed to complete registration`,{operation:`auth.completeRegistration`}))}}return o(),()=>{a=!0}},[]),r?(0,K.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center p-6`,children:(0,K.jsxs)(`div`,{className:`w-full max-w-sm text-center space-y-4`,children:[(0,K.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Registration Error`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}),(0,K.jsx)(Gv,{to:`/signup`,className:`text-sm underline hover:text-primary`,children:`Back to sign up`})]})}):(0,K.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center p-6`,children:(0,K.jsxs)(`div`,{className:`text-center space-y-3`,children:[(0,K.jsx)(`div`,{className:`mx-auto h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Setting up your account...`})]})})}function h6e({className:e,...t}){let{t:n}=V(),[r,i]=(0,B.useState)(``),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(!1),d=async e=>{e.preventDefault(),c(null),o(!0);try{await ive({email:r}),u(!0)}catch{c(n(`auth.forgot_password.error_generic`))}finally{o(!1)}};return(0,K.jsx)(`div`,{className:q(`flex flex-col gap-6`,e),...t,children:(0,K.jsx)(uz,{children:l?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(dz,{children:[(0,K.jsx)(fz,{children:n(`auth.forgot_password.confirmation_title`)}),(0,K.jsx)(pz,{children:n(`auth.forgot_password.confirmation_description`,{email:r})})]}),(0,K.jsx)(mz,{children:(0,K.jsx)(bz,{className:`text-center`,children:(0,K.jsx)(Gv,{to:`/login`,className:`underline hover:text-primary`,children:n(`common.back_to_login`)})})})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(dz,{children:[(0,K.jsx)(fz,{children:n(`auth.forgot_password.title`)}),(0,K.jsx)(pz,{children:n(`auth.forgot_password.description`)})]}),(0,K.jsx)(mz,{children:(0,K.jsx)(`form`,{onSubmit:d,children:(0,K.jsxs)(_z,{children:[s&&(0,K.jsx)(`div`,{className:`text-sm text-red-500 bg-red-50 p-3 rounded-md`,children:s}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`email`,children:n(`auth.forgot_password.email_label`)}),(0,K.jsx)(dP,{id:`email`,type:`email`,placeholder:`[email protected]`,value:r,onChange:e=>i(e.target.value),required:!0,disabled:a})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(J,{type:`submit`,disabled:a,children:n(a?`auth.forgot_password.submitting`:`auth.forgot_password.submit`)}),(0,K.jsxs)(bz,{className:`text-center`,children:[n(`auth.forgot_password.remember_password`),` `,(0,K.jsx)(Gv,{to:`/login`,className:`underline hover:text-primary`,children:n(`common.back_to_login`)})]})]})]})})})]})})})}function g6e(){return(0,K.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center p-6 md:p-10`,children:(0,K.jsx)(`div`,{className:`w-full max-w-sm`,children:(0,K.jsx)(h6e,{})})})}function _6e({className:e,token:t,...n}){let{t:r}=V(),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(null),[f,p]=(0,B.useState)(!1),m=Sv(),h=async e=>{if(e.preventDefault(),d(null),i.length<8){d(r(`auth.reset_password.error_password_short`));return}if(i!==o){d(r(`auth.reset_password.error_passwords_mismatch`));return}l(!0);try{await ove({token:t,new_password:i}),G.success(r(`toasts.password_reset.password_updated`)),m(`/login`,{replace:!0})}catch(e){e instanceof Error&&e.message.toLowerCase().includes(`bad request`)?p(!0):d(r(`auth.reset_password.error_generic`))}finally{l(!1)}};return f?(0,K.jsx)(`div`,{className:q(`flex flex-col gap-6`,e),...n,children:(0,K.jsxs)(uz,{children:[(0,K.jsxs)(dz,{children:[(0,K.jsx)(fz,{children:r(`auth.reset_password.error_token_invalid`)}),(0,K.jsx)(pz,{children:r(`toasts.password_reset.invalid_token`)})]}),(0,K.jsx)(mz,{children:(0,K.jsx)(bz,{className:`text-center`,children:(0,K.jsx)(Gv,{to:`/forgot-password`,className:`underline hover:text-primary`,children:r(`auth.forgot_password.title`)})})})]})}):(0,K.jsx)(`div`,{className:q(`flex flex-col gap-6`,e),...n,children:(0,K.jsxs)(uz,{children:[(0,K.jsxs)(dz,{children:[(0,K.jsx)(fz,{children:r(`auth.reset_password.title`)}),(0,K.jsx)(pz,{children:r(`auth.reset_password.description`)})]}),(0,K.jsx)(mz,{children:(0,K.jsx)(`form`,{onSubmit:h,children:(0,K.jsxs)(_z,{children:[u&&(0,K.jsx)(`div`,{className:`text-sm text-red-500 bg-red-50 p-3 rounded-md`,children:u}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`password`,children:r(`auth.reset_password.new_password_label`)}),(0,K.jsx)(dP,{id:`password`,type:`password`,value:i,onChange:e=>a(e.target.value),required:!0,disabled:c}),(0,K.jsx)(bz,{children:r(`auth.signup.password_description`)})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`confirm-password`,children:r(`auth.reset_password.confirm_password_label`)}),(0,K.jsx)(dP,{id:`confirm-password`,type:`password`,value:o,onChange:e=>s(e.target.value),required:!0,disabled:c})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(J,{type:`submit`,disabled:c,
280children:r(c?`auth.reset_password.submitting`:`auth.reset_password.submit`)}),(0,K.jsx)(bz,{className:`text-center`,children:(0,K.jsx)(Gv,{to:`/login`,className:`underline hover:text-primary`,children:r(`common.back_to_login`)})})]})]})})})]})})}function v6e(){let[e]=Jv(),t=e.get(`token`);return(0,K.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center p-6 md:p-10`,children:(0,K.jsx)(`div`,{className:`w-full max-w-sm`,children:t?(0,K.jsx)(_6e,{token:t}):(0,K.jsxs)(uz,{children:[(0,K.jsxs)(dz,{children:[(0,K.jsx)(fz,{children:`Reset link is missing`}),(0,K.jsx)(pz,{children:`Open the link from the email we sent you, or request a new one.`})]}),(0,K.jsx)(mz,{children:(0,K.jsx)(bz,{className:`text-center`,children:(0,K.jsx)(Gv,{to:`/forgot-password`,className:`underline hover:text-primary`,children:`Request a new link`})})})]})})})}var y6e=`modinsight-desktop://authorized`;function b6e(){let[e]=Jv(),t=e.get(`state`),n=e.get(`code_challenge`),[r,i]=(0,B.useState)(`idle`),[a,o]=(0,B.useState)(null),s=!t||!n;async function c(){if(!s){i(`approving`),o(null);try{await Z(`/api/v1/desktop-auth/approve`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({state:t,code_challenge:n})}),i(`done`),window.location.href=y6e}catch(e){o(Gb(e,`Could not authorize the app. Please try again.`,{operation:`desktop_auth_approve`})),i(`idle`)}}}return(0,K.jsx)(`div`,{className:`flex min-h-svh w-full items-center justify-center p-6 md:p-10`,children:(0,K.jsx)(`div`,{className:`w-full max-w-sm`,children:s?(0,K.jsx)(uz,{children:(0,K.jsxs)(dz,{children:[(0,K.jsx)(fz,{children:`Authorization link is incomplete`}),(0,K.jsx)(pz,{children:`Open this page from the modInsight Recorder app so it can finish signing in on this computer.`})]})}):r===`done`?(0,K.jsxs)(uz,{children:[(0,K.jsxs)(dz,{children:[(0,K.jsx)(`div`,{className:`mb-2 flex justify-center`,children:(0,K.jsx)(Ug,{className:`size-10 text-emerald-500`})}),(0,K.jsx)(fz,{className:`text-center`,children:`You're all set`}),(0,K.jsx)(pz,{className:`text-center`,children:`Return to the modInsight Recorder app. It will finish connecting automatically.`})]}),(0,K.jsx)(mz,{children:(0,K.jsx)(bz,{className:`text-center`,children:`You can close this tab.`})})]}):(0,K.jsxs)(uz,{children:[(0,K.jsxs)(dz,{children:[(0,K.jsx)(`div`,{className:`mb-2 flex justify-center`,children:(0,K.jsx)(nse,{className:`size-10 text-muted-foreground`})}),(0,K.jsx)(fz,{className:`text-center`,children:`Authorize modInsight Recorder?`}),(0,K.jsx)(pz,{className:`text-center`,children:`This lets the desktop app on this computer record meetings and send transcripts to your modInsight account.`})]}),(0,K.jsxs)(mz,{className:`flex flex-col gap-3`,children:[a?(0,K.jsx)(`p`,{className:`text-center text-sm text-destructive`,children:a}):null,(0,K.jsx)(J,{type:`button`,onClick:c,disabled:r===`approving`,children:r===`approving`?`Authorizingâ¦`:`Authorize this computer`}),(0,K.jsx)(bz,{className:`text-center`,children:`Only approve this if you just started signing in from the modInsight Recorder app.`})]})]})})})}function x6e(){let[e]=Jv(),t=Sv(),n=e.get(`token`)??``,r=Nx(Px),i=GL(e=>e.acceptInvite),a=GL(e=>e.switchActiveOrg),[o,s]=(0,B.useState)(null),[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(!0),[f,p]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{if(!n){l(`Missing invitation token.`),d(!1);return}let e=!0;return m0e({token:n}).then(t=>{e&&(s(t.data),d(!1))}).catch(()=>{e&&(l(`This invitation is invalid or has expired.`),d(!1))}),()=>{e=!1}},[n]),(0,K.jsx)(`div`,{className:`min-h-screen flex items-center justify-center px-4 bg-muted/30`,children:(0,K.jsxs)(uz,{className:`w-full max-w-md`,children:[(0,K.jsxs)(dz,{className:`space-y-2`,children:[(0,K.jsx)(`div`,{className:`size-10 rounded-md bg-muted flex items-center justify-center`,children:(0,K.jsx)(Mg,{className:`size-5`})}),(0,K.jsx)(fz,{children:`You've been invited`}),(0,K.jsx)(pz,{children:`Accept the invitation to join the organization.`})]}),(0,K.jsx)(mz,{className:`space-y-4`,children:u?(0,K.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,K.jsx)(W,{className:`size-5 animate-spin text-muted-foreground`})}):c?(0,K.jsx)(`p`,{className:`text-sm text-destructive`,children:c}):o?(0,K.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Organization: `}),(0,K.jsx)(`span`,{className:`font-medium`,children:o.org_name})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Role: `}),(0,K.jsx)(`span`,{className:`font-medium capitalize`,children:o.role})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Invited by: `}),(0,K.jsx)(`span`,{className:`font-medium`,children:o.invited_by_email})]})]}):null}),!c&&o&&(0,K.jsx)(n6e,{className:`flex flex-col gap-2`,children:r?(0,K.jsx)(J,{onClick:async()=>
280{if(n){p(!0);try{let e=await i(n);await a(e.id),G.success(`Joined ${e.name}`),t(`/dashboard`)}catch(e){Y(e,`Failed to accept invitation`,{operation:`org.acceptInvite`})}finally{p(!1)}}},disabled:f,className:`w-full`,children:f?`Acceptingâ¦`:`Accept invitation`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground text-center`,children:`Sign in with the email this invitation was sent to.`}),(0,K.jsx)(J,{onClick:()=>{t(`/login?next=${encodeURIComponent(`/invite/accept?token=${n}`)}`)},className:`w-full`,children:`Sign in to accept`})]})})]})})}function S6e(){let[e]=Jv(),t=Sv(),n=e.get(`token`)??``,r=Nx(Px),i=lk(e=>e.previewShare),a=lk(e=>e.acceptShare),[o,s]=(0,B.useState)(null),[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(!!n),[f,p]=(0,B.useState)(!1);(0,B.useEffect)(()=>{if(!n)return;let e=!0;return i(n).then(t=>{e&&(s(t),d(!1))}).catch(()=>{e&&(l(`This share link is invalid or has expired.`),d(!1))}),()=>{e=!1}},[n,i]);let m=n?c:`Missing share token.`,h=e=>{e.resource_type===`conversation`?t(`/chat/${e.resource_id}`):e.resource_type===`matter`?t(`/matters/${e.resource_id}`):t(`/?doc=${e.resource_id}`)},g=async()=>{if(n){p(!0);try{let e=await a(n);G.success(`Access granted`),h(e)}catch(e){Y(e,`Couldn't accept â this link may be for a different email.`,{operation:`share.accept`}),p(!1)}}},_=`/share/accept?token=${n}`,v=()=>{t(`/login?next=${encodeURIComponent(_)}`)},y=()=>{let e=o?.grantee_email??``;t(`/signup?next=${encodeURIComponent(_)}&email=${encodeURIComponent(e)}`)},b=o?uR(o.resource_type):`document`;return(0,K.jsx)(`div`,{className:`min-h-screen flex items-center justify-center px-4 bg-muted/30`,children:(0,K.jsxs)(uz,{className:`w-full max-w-md`,children:[(0,K.jsxs)(dz,{className:`space-y-2`,children:[(0,K.jsx)(`div`,{className:`size-10 rounded-md bg-muted flex items-center justify-center`,children:(0,K.jsx)(o?.resource_type===`conversation`?b_:o?.resource_type===`matter`?jg:i_,{className:`size-5`})}),(0,K.jsx)(fz,{children:`Shared with you`}),(0,K.jsx)(pz,{children:o?`${o.owner_email} shared a ${b} with you.`:`Open a resource that was shared with you.`})]}),(0,K.jsx)(mz,{className:`space-y-4`,children:u?(0,K.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,K.jsx)(W,{className:`size-5 animate-spin text-muted-foreground`})}):m?(0,K.jsx)(`p`,{className:`text-sm text-destructive`,children:m}):o?(0,K.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`span`,{className:`text-muted-foreground capitalize`,children:[b,`:`,` `]}),(0,K.jsx)(`span`,{className:`font-medium`,children:o.resource_name})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Shared by: `}),(0,K.jsx)(`span`,{className:`font-medium`,children:o.owner_email})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Access: `}),(0,K.jsx)(`span`,{className:`font-medium capitalize`,children:o.role})]})]}):null}),!m&&o&&(0,K.jsx)(n6e,{className:`flex flex-col gap-2`,children:r?(0,K.jsx)(J,{onClick:g,disabled:f,className:`w-full`,children:f?`Openingâ¦`:`Open shared ${b}`}):o.grantee_has_account?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[`Sign in as`,` `,(0,K.jsx)(`span`,{className:`font-medium`,children:o.grantee_email}),` `,`to open it.`]}),(0,K.jsx)(J,{onClick:v,className:`w-full`,children:`Sign in to continue`})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[`Create an account for`,` `,(0,K.jsx)(`span`,{className:`font-medium`,children:o.grantee_email}),` `,`to open it.`]}),(0,K.jsx)(J,{onClick:y,className:`w-full`,children:`Create account to continue`}),(0,K.jsx)(`button`,{onClick:v,className:`text-xs text-muted-foreground underline-offset-4 hover:underline`,children:`Already have an account? Sign in`})]})})]})})}function Fz({value:e,onChange:t,className:n}){let[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(null),[d,f]=(0,B.useState)(``);(0,B.useEffect)(()=>
280{if(!r||a)return;let e=!1;return c6e().then(t=>{e||o(t)}).catch(t=>{e||c(Gb(t,`Failed to load map`,{operation:`booking.timezonePicker.loadPolygons`}))}),()=>{e=!0}},[r,a]);let p=jz(e),m=l6e();return(0,K.jsxs)(HC,{open:r,onOpenChange:i,children:[(0,K.jsx)(UC,{asChild:!0,children:(0,K.jsxs)(J,{variant:`outline`,className:q(`w-full justify-start gap-2 font-normal`,n),children:[(0,K.jsx)(Foe,{className:`size-4 opacity-60`}),(0,K.jsx)(`span`,{className:`truncate`,children:p}),(0,K.jsx)(`span`,{className:`text-muted-foreground ml-auto text-xs`,children:Nz(p)})]})}),(0,K.jsxs)(WC,{className:`gap-3 p-0 sm:max-w-4xl`,children:[(0,K.jsxs)(GC,{className:`px-6 pt-5`,children:[(0,K.jsx)(qC,{children:`Pick a timezone`}),(0,K.jsx)(JC,{children:`Click a country on the map, or search by city or IANA name.`})]}),(0,K.jsxs)(`div`,{className:`bg-muted/30 relative border-y`,children:[a?(0,K.jsx)(`svg`,{viewBox:`0 0 500 250`,className:`block w-full`,role:`img`,"aria-label":`World timezone map`,children:a.map((e,n)=>{let r=l===e.timezone||p===e.timezone;return(0,K.jsx)(`polygon`,{points:e.points,onMouseEnter:()=>u(e.timezone),onMouseLeave:()=>u(null),onClick:()=>{t(e.timezone),i(!1)},className:q(`stroke-background cursor-pointer transition-colors`,r?`fill-primary`:`fill-muted-foreground/35`),style:{strokeWidth:.3}},n)})}):s?(0,K.jsx)(`div`,{className:`text-destructive p-8 text-center text-xs`,children:s}):(0,K.jsx)(`div`,{className:`text-muted-foreground p-8 text-center text-xs`,children:`Loading mapâ¦`}),l&&(0,K.jsxs)(`div`,{className:`bg-popover border-border absolute bottom-2 left-2 rounded border px-3 py-1.5 text-sm shadow`,children:[l,` `,(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:Nz(l)})]})]}),(0,K.jsxs)(XO,{className:`pb-2`,children:[(0,K.jsx)(ZO,{value:d,onValueChange:f,placeholder:`Search timezoneâ¦`}),(0,K.jsxs)(QO,{className:`max-h-72`,children:[(0,K.jsx)($O,{children:`No timezone found.`}),Object.entries(m).map(([e,n])=>(0,K.jsx)(ek,{heading:e,children:n.map(e=>(0,K.jsxs)(nk,{value:`${e.name} ${e.alternativeName} ${e.mainCities.join(` `)}`,onSelect:()=>{t(e.name),i(!1)},children:[(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:e.name}),(0,K.jsx)(`span`,{className:`text-muted-foreground ml-2 text-xs`,children:Nz(e.name)})]},e.name))},e))]})]})]})]})}function Iz(e){return`${Math.floor(e/60)}:${String(e%60).padStart(2,`0`)}`}function C6e(e){return e%60==0?`${e/60}h`:e>60?`${Math.floor(e/60)}h ${e%60}m`:`${e}m`}function w6e({onConfirm:e,disabled:t}){let{t:n}=V(),[r,i]=B.useState(!1),[a,o]=B.useState([]),[s,c]=B.useState(``),[l,u]=B.useState(!1),[d,f]=B.useState(null),[p,m]=B.useState(!1),[h,g]=B.useState(null),_=wP(),[v,y]=B.useState(null),b=TP(_,v)??DP(_,`google`),x=b?.provider??`google`,S=_.length>=2,C=B.useRef(null),w=B.useRef(null),T=[n(`booking.weekdays.short.mon`),n(`booking.weekdays.short.tue`),n(`booking.weekdays.short.wed`),n(`booking.weekdays.short.thu`),n(`booking.weekdays.short.fri`),n(`booking.weekdays.short.sat`),n(`booking.weekdays.short.sun`)],E=B.useMemo(()=>jz(Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`),[]),D=d!==null;B.useEffect(()=>{w.current?.scrollIntoView({behavior:`smooth`})},[a,l]);function O(){C.current?.abort(),o([]),c(``),f(null),u(!1),m(!1),g(null)}function k(e){e?y(null):O(),i(e)}function A(e){TP(_,e)&&y(e)}async function j(){let e=s.trim();if(!e||l)return;let t={role:`user`,content:e},n=[...a,t];o(n),c(``),u(!0),g(null);let r=``;o(e=>[...e,{role:`assistant`,content:``}]);let i=new AbortController;C.current=i,await qhe(n,E,{onDelta:e=>{r+=e,o(e=>{let t=[...e];return t[t.length-1]={role:`assistant`,content:r},t})},onToolUse:(e,t)=>{o(e=>{let t=e[e.length-1];return t?.role===`assistant`&&!t.content?e.slice(0,-1):e}),e===`create_booking_link`&&f(t)},onDone:()=>{u(!1)},onError:e=>{u(!1),g(e),o(e=>{let t=e[e.length-1];return t?.role===`assistant`&&!t.content?e.slice(0,-1):e})}},i.signal)}async function M(){if(d){m(!0),g(null);try{await e(T0e(d,x,E,b?.accountId??null))}catch{m(!1)}}}function N(){f(null),o(e=>[...e,{role:`assistant`,content:n(`booking.describe.changed_prompt`)}])}function P(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),j())}let F=[];if(d){let e=Math.max(d.buffer_before_minutes??0,d.buffer_after_minutes??0);e>0&&F.push(n(`booking.describe.buffer`,{minutes:e})),d.min_notice_minutes&&d.min_notice_minutes>0&&F.push(n(`booking.describe.notice`,{duration:C6e(d.min_notice_minutes)})),d.max_per_day&&d.max_per_day>0&&F.push(n(`booking.describe.per_day`,{count:d.max_per_day}));let t=d.optional_questions?.length??0;t>0&&F.push(n(`booking.describe.question`,{count:t}))}return(0,K.jsxs)(aP,{open:r,onOpenChange:k,children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsxs)(J,{variant:`outline`,disabled:t,className:`gap-1.5`,children:[(0,K.jsx)(L_,{className:`size-4`}),n(`booking.describe.button`)]})}),(0,K.jsxs)(sP,{className:`w-88 p-0 flex flex-col`,align:`end`,side:`bottom`,sideOffset:6,children:[(0,K.jsxs)(`div`,{className:`px-3 py-2.5 border-b flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`text-sm font-semibold`,children:n(`booking.describe.title`)}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`booking.describe.subtitle`)})]}),S&&(0,K.jsxs)(vO,{value:b?.accountId??``,onValueChange:A,children:[(0,K.jsx)(bO,{className:`h-7 w-44 shrink-0 text-xs`,children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:_.map(e=>(0,K.jsxs)(SO,{value:e.accountId,className:`text-xs`,children:[e.email,` · `,n(CP[e.provider])]},e.accountId))})]})]}),(0,K.jsx)(IL,{className:``,children:(0,K.jsxs)(`div`,{className:`px-3 py-2 space-y-2 min-h-[60
280px]`,children:[a.length===0&&!l&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:n(`booking.describe.hint`)}),a.map((e,t)=>(0,K.jsx)(`div`,{className:`flex ${e.role===`user`?`justify-end`:`justify-start`}`,children:(0,K.jsx)(`span`,{className:`text-xs rounded-lg px-2.5 py-1.5 max-w-[85%] whitespace-pre-wrap ${e.role===`user`?`bg-primary text-primary-foreground`:`bg-muted text-foreground`}`,children:e.content})},t)),l&&a[a.length-1]?.content===``&&(0,K.jsx)(`div`,{className:`flex justify-start`,children:(0,K.jsx)(`span`,{className:`bg-muted rounded-lg px-2.5 py-1.5`,children:(0,K.jsx)(RI,{size:`sm`,label:n(`ai.activity.thinking`)})})}),(0,K.jsx)(`div`,{ref:w})]})}),d&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{className:`px-3 py-2.5 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-md border bg-muted/40 p-2.5 space-y-1.5`,children:[(0,K.jsxs)(`p`,{className:`text-xs font-semibold flex items-center gap-1`,children:[(0,K.jsx)(roe,{className:`size-3 text-primary`}),d.name]}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[d.duration_minutes,` `,n(`booking.describe.minutes_short`),` `,`·`,` `,b?.email??n(CP[x])]}),(d.weekly_rules?.length??0)>0&&(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:(d.weekly_rules??[]).map((e,t)=>(0,K.jsxs)(`span`,{className:`bg-muted rounded px-1.5 py-0.5 text-[11px] text-muted-foreground`,children:[T[e.day_of_week],` `,Iz(e.start_minute),`â`,Iz(e.end_minute)]},t))}),F.length>0&&(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:F.join(` · `)}),d.description&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:d.description})]}),h&&(0,K.jsx)(`p`,{className:`text-xs text-destructive`,children:h}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsxs)(J,{size:`sm`,className:`flex-1 h-7 text-xs`,onClick:M,disabled:p,children:[p?(0,K.jsx)(W,{className:`size-3 animate-spin mr-1`}):null,n(p?`booking.describe.creating`:`booking.describe.confirm`)]}),(0,K.jsx)(J,{size:`sm`,variant:`outline`,className:`h-7 text-xs`,onClick:N,disabled:p,children:n(`booking.describe.edit`)})]})]})]}),!D&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(tL,{}),h&&(0,K.jsx)(`p`,{className:`px-3 pt-2 text-xs text-destructive`,children:h}),(0,K.jsxs)(`div`,{className:`flex items-end gap-2 px-3 py-2`,children:[(0,K.jsx)(`textarea`,{className:`flex-1 resize-none text-xs bg-transparent outline-none placeholder:text-muted-foreground min-h-[32px] max-h-[80px]`,placeholder:n(`booking.describe.placeholder`),value:s,onChange:e=>c(e.target.value),onKeyDown:P,rows:1,disabled:l}),(0,K.jsx)(J,{size:`icon`,variant:`ghost`,className:`size-7 shrink-0`,onClick:j,disabled:!s.trim()||l,children:l?(0,K.jsx)(W,{className:`size-3 animate-spin`}):(0,K.jsx)(j_,{className:`size-3`})})]})]})]})]})}function Lz(e){try{return fb(_b(e),`EEE, MMM d yyyy 'at' h:mm a`)}catch{return e}}function T6e({onEventCreated:e,provider:t=`google`}){let{t:n}=V(),[r,i]=B.useState(!1),[a,o]=B.useState([]),[s,c]=B.useState(``),[l,u]=B.useState(!1),[d,f]=B.useState(null),[p,m]=B.useState(null),[h,g]=B.useState(!1),[_,v]=B.useState(null),y=wP(),[b,x]=B.useState(null),S=TP(y,b)??DP(y,t),C=S?.provider??t,w=y.length>=2,T=B.useRef(null),E=B.useRef(null),D=d!==null||p!==null;B.useEffect(()=>{E.current?.scrollIntoView({behavior:`smooth`})},[a,l]);function O(e){e||(T.current?.abort(),o([]),c(``),f(null),m(null),u(!1),g(!1),v(null),x(null)),i(e)}function k(e){!e||e===S?.accountId||l||D||(T.current?.abort(),o([]),c(``),f(null),m(null),u(!1),g(!1),v(null),x(e))}async function A(){let e=s.trim();if(!e||l)return;let t={role:`user`,content:e},n=[...a,t];o(n),c(``),u(!0),v(null);let r=``;o(e=>[...e,{role:`assistant`,content:``}]);let i=new AbortController;T.current=i,await Khe(n,Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,{onDelta:e=>{r+=e,o(e=>{let t=[...e];return t[t.length-1]={role:`assistant`,content:r},t})},onToolUse:(e,t)=>{o(e=>{let t=e[e.length-1];return t?.role===`assistant`&&!t.content?e.slice(0,-1):e}),e===`create_task`?m(t):f(t)},onDone:()=>{u(!1)},onError:e=>{u(!1),v(e),o(e=>{let t=e[e.length-1];return t?.role===`assistant`&&!t.content?e.slice(0,-1):e})}},i.signal,C)}async function j(){g(!0),v(null);try{p?await hx(p,C):d&&await Age(d,C,S?.accountId??null),e(),O(!1)}catch(e){v(Gb(e,`Failed to create`,{operation:`dashboard.createEvent`})),g(!1)}}function M(){f(null),m(null),o(e=>[...e,{role:`assistant`,content:`No problem. What would you like to change?`}])}function N(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),A())}return(0,K.jsxs)(aP,{open:r,onOpenChange:O,children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsxs)(J,{variant:`outline`,size:`sm`,className:`h-7 ga
280p-1 text-xs`,children:[(0,K.jsx)(T_,{className:`size-3`}),`New`]})}),(0,K.jsxs)(sP,{className:`w-88 p-0 flex flex-col`,align:`end`,side:`bottom`,sideOffset:6,children:[(0,K.jsxs)(`div`,{className:`px-3 py-2.5 border-b flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-sm font-semibold`,children:`New Event or Task`}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Describe it naturally`})]}),w&&(0,K.jsxs)(vO,{value:S?.accountId??``,onValueChange:k,disabled:l||D,children:[(0,K.jsx)(bO,{className:`h-7 w-44 text-xs`,children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:y.map(e=>(0,K.jsxs)(SO,{value:e.accountId,className:`text-xs`,children:[e.email,` · `,n(CP[e.provider])]},e.accountId))})]})]}),(0,K.jsx)(IL,{className:``,children:(0,K.jsxs)(`div`,{className:`px-3 py-2 space-y-2 min-h-[60px]`,children:[a.length===0&&!l&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`Try: "Lunch with Sarah tomorrow at noon" or "Remind me to send the report by Friday"`}),a.map((e,t)=>(0,K.jsx)(`div`,{className:`flex ${e.role===`user`?`justify-end`:`justify-start`}`,children:(0,K.jsx)(`span`,{className:`text-xs rounded-lg px-2.5 py-1.5 max-w-[85%] whitespace-pre-wrap ${e.role===`user`?`bg-primary text-primary-foreground`:`bg-muted text-foreground`}`,children:e.content})},t)),l&&a[a.length-1]?.content===``&&(0,K.jsx)(`div`,{className:`flex justify-start`,children:(0,K.jsx)(`span`,{className:`bg-muted rounded-lg px-2.5 py-1.5`,children:(0,K.jsx)(RI,{size:`sm`,label:n(`ai.activity.thinking`)})})}),(0,K.jsx)(`div`,{ref:E})]})}),d&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{className:`px-3 py-2.5 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-md border bg-muted/40 p-2.5 space-y-1`,children:[(0,K.jsxs)(`p`,{className:`text-xs font-semibold flex items-center gap-1`,children:[(0,K.jsx)(Ng,{className:`size-3 text-primary`}),d.summary]}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Lz(d.start_datetime)}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`â `,Lz(d.end_datetime)]}),d.location&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d.location}),d.description&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:d.description}),d.attendees&&d.attendees.length>0&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d.attendees.join(`, `)})]}),_&&(0,K.jsx)(`p`,{className:`text-xs text-destructive`,children:_}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsxs)(J,{size:`sm`,className:`flex-1 h-7 text-xs`,onClick:j,disabled:h,children:[h?(0,K.jsx)(W,{className:`size-3 animate-spin mr-1`}):null,`Confirm`]}),(0,K.jsx)(J,{size:`sm`,variant:`outline`,className:`h-7 text-xs`,onClick:M,disabled:h,children:`Edit`})]})]})]}),p&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{className:`px-3 py-2.5 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-md border bg-muted/40 p-2.5 space-y-1`,children:[(0,K.jsxs)(`p`,{className:`text-xs font-semibold flex items-center gap-1`,children:[(0,K.jsx)(h_,{className:`size-3 text-primary`}),p.title]}),p.due_date&&(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Due:`,` `,fb(_b(p.due_date),`EEE, MMM d yyyy`)]}),p.notes&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:p.notes})]}),_&&(0,K.jsx)(`p`,{className:`text-xs text-destructive`,children:_}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsxs)(J,{size:`sm`,className:`flex-1 h-7 text-xs`,onClick:j,disabled:h,children:[h?(0,K.jsx)(W,{className:`size-3 animate-spin mr-1`}):null,`Confirm`]}),(0,K.jsx)(J,{size:`sm`,variant:`outline`,className:`h-7 text-xs`,onClick:M,disabled:h,children:`Edit`})]})]})]}),!D&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(tL,{}),_&&(0,K.jsx)(`p`,{className:`px-3 pt-2 text-xs text-destructive`,children:_}),(0,K.jsxs)(`div`,{className:`flex items-end gap-2 px-3 py-2`,children:[(0,K.jsx)(`textarea`,{className:`flex-1 resize-none text-xs bg-transparent outline-none placeholder:text-muted-foreground min-h-[32px] max-h-[80px]`,placeholder:`Describe your event or task...`,value:s,onChange:e=>c(e.target.value),onKeyDown:N,rows:1,disabled:l}),(0,K.jsx)(J,{size:`icon`,variant:`ghost`,className:`size-7 shrink-0`,onClick:A,disabled:!s.trim()||l,children:l?(0,K.jsx)(W,{className:`size-3 animate-spin`}):(0,K.jsx)(j_,{className:`size-3`})})]})]})]})]})}function E6e(e,t,n=`long`){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(` `)}var D6e={},Rz={};function zz(e,t){try{let n=(D6e[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in Rz?Rz[n]:Bz(n,n.split(`:`))}catch{if(e in Rz)return Rz[e];let t=e?.match(O6e);return t?Bz(e,t.slice(1)):NaN}}var O6e=/([+-]\d\d):?(\d\d)?/;function Bz(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return Rz[e]=n*60+r>0?n*60+r+i:n*60-r-i}var Vz=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(zz(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`
280number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Wz(this,NaN),Uz(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){let e=-zz(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Uz(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},Hz=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Hz.test(e))return;let t=e.replace(Hz,`$1UTC`);Vz.prototype[t]&&(e.startsWith(`get`)?Vz.prototype[e]=function(){return this.internal[t]()}:(Vz.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),k6e(this),+this},Vz.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Uz(this),+this}))});function Uz(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-zz(e.timeZone,e)*60))}function k6e(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Wz(e)}function Wz(e){let t=zz(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let i=-new Date(+e).getTimezoneOffset(),a=i- -new Date(+r).getTimezoneOffset(),o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=i-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=new Date(+e);c.setUTCSeconds(0);let l=i>0?c.getSeconds():(c.getSeconds()-60)%60,u=Math.round(-(zz(e.timeZone,e)*60))%60;(u||l)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+l));let d=zz(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-f,m=f!==n,h=p-s;if(m&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);let t=zz(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var Gz=class e extends Vz{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${E6e(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset();return[e>0?`-`:`+`,String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),String(Math.abs(e)%60).padStart(2,`0`)]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},Kz=5,A6e=4;function j6e(e,t){let n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,i=t.addDays(e,-r+1),a=t.addDays(i,Kz*7-1);return t.getMonth(e)===t.getMonth(a)?Kz:A6e}function qz(e,t){let n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function M6e(e,t){let n=qz(e,t),r=j6e(e,t);return t.addDays(n,r*7-1)}const Jz={...ib,labels:{labelDayButton:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>fb(e,t,{locale:ib,...n});let a=i(e,`PPPP`);return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:`Choose the Month`,labelNext:`Go to the Next Month`,labelPrevious:`Go to the Previous Month`,labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:`Choose the Year`,labelGrid:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>fb(e,n,{locale:ib,...t}),r(e,`LLLL yyyy`)},labelGridcell:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>fb(e,t,{locale:ib,...n});let a=i(e,`PPPP`);return t?.today&&(a=`Today, ${a}`),a},labelNav:`Navigation bar`,labelWeekNumberHeader:`Week Number`,labelWeekday:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>fb(e,n,{locale:ib,...t}),r(e,`cccc`)}}};var Yz=class e{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Gz.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n
vendor: 11,969 bytes, line 280
280)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new Gz(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):Hy(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):Uy(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):qde(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):Jde(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):Xy(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):eb(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):sfe(e),this.eachYearOfInterval=e=>{let t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):dfe(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;let r=[];return n.forEach(e=>{r.push(new Date(e,0,1))}),r},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):M6e(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):pfe(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):nfe(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):ffe(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):lfe(e),this.format=(e,t,n)=>{let r=this.overrides?.format?this.overrides.format(e,t,this.options):fb(e,t,this.options);return this.options.numerals&&this.options.numerals!==`latn`?this.replaceDigits(r):r},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):ab(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):Kfe(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):qfe(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):ob(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):Jfe(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):Yfe(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):Zde(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):$y(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):mb(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):Zfe(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):Yde(e),this.min=e=>this.overrides?.min?this.overrides.min(e):Xde(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):mpe(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):hpe(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):qz(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):Yy(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):Ky(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):cfe(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):Gy(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):ufe(e),this.options={locale:Jz,...e},this.overrides=t}getDigitMap(){let{numerals:e=`latn`}=this.options,t=new Intl.NumberFormat(`en-US`,{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){let t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){let t=this.options.locale?.code;return t&&e.yearFirstLocales.has(t)?`year-first`:`month-first`}formatMonthYear(t){let{locale:n,timeZone:r,numerals:i}=this.options,a=n?.code;if(a&&e.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:`long`,year:`numeric`,timeZone:r,numberingSystem:i}).format(t)}catch{}let o=this.getMonthYearOrder()===`year-first`?`y LLLL`:`LLLL y`;return this.format(t,o)}};Yz.yearFirstLocales=new Set([`eu`,`hu`,`ja`,`ja-Hira`,`ja-JP`,`ko`,`ko-KR`,`lt`,`lt-LT`,`lv`,`lv-LV`,`mn`,`mn-MN`,`zh`,`zh-CN`,`zh-HK`,`zh-TW`]);const Xz=new Yz;var Zz=class{constructor(e,t,n=Xz){this.date=e,this.displayMonth=t,this.outside=!!(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,`yyyy-MM-dd`),this.displayMonthId=n.format(t,`yyyy-MM`),this.dateMonthId=n.format(e,`yyyy-MM`)}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}},N6e=class{constructor(e,t){this.date=e,this.weeks=t}},P6e=class{constructor(e,t){this.days=t,this.weekNumber=e}};function F6e(e){return B.createElement(`button`,{...e})}function I6e(e){return B.createElement(`span`,{...e})}function L6e(e){let{size:t=24,orientation:n=`left`,className:r}=e;return B.createElement(`svg`,{className:r,width:t,height:t,viewBox:`0 0 24 24`},n===`up`&&B.createElement(`polygon`,{points:`6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28`}),n===`down`&&B.createElement(`polygon`,{points:`6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72`}),n===`left`&&B.createElement(`polygon`,{points:`16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20`}),n===`right`&&B.createElement(`polygon`,{points:`8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20`}))}function R6e(e){let{day:t,modifiers:n,...r}=e;return B.createElement(`td`,{...r})}function z6e(e){let{day:t,modifiers:n,...r}=e,i=B.useRef(null);return B.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),B.createElement(`button`,{ref:i,...r})}var Qz;(function(e){e.Root=`root`,e.Chevron=`chevron`,e.Day=`day`,e.DayButton=`day_button`,e.CaptionLabel=`caption_label`,e.Dropdowns=`dropdowns`,e.Dropdown=`dropdown`,e.DropdownRoot=`dropdown_root`,e.Footer=`footer`,e.MonthGrid=`month_grid`,e.MonthCaption=`month_caption`,e.MonthsDropdown=`months_dropdown`,e.Month=`month`,e.Months=`months`,e.Nav=`nav`,e.NextMonthButton=`button_next`,e.PreviousMonthButton=`button_previous`,e.Week=`week`,e.Weeks=`weeks`,e.Weekday=`weekday`,e.Weekdays=`weekdays`,e.WeekNumber=`week_number`,e.WeekNumberHeader=`week_number_header`,e.YearsDropdown=`years_dropdown`})(Qz||={});var $z;(function(e){e.disabled=`disabled`,e.hidden=`hidden`,e.outside=`outside`,e.focused=`focused`,e.today=`today`})($z||={});var eB;(function(e){e.range_end=`range_end`,e.range_middle=`range_middle`,e.range_start=`range_start`,e.selected=`selected`})(eB||={});var tB;(function(e){e.weeks_before_enter=`weeks_before_enter`,e.weeks_before_exit=`weeks_before_exit`,e.weeks_after_enter=`weeks_after_enter`,e.weeks_after_exit=`weeks_after_exit`,e.caption_after_enter=`caption_after_enter`,e.caption_after_exit=`caption_after_exit`,e.caption_before_enter=`caption_before_enter`,e.caption_before_exit=`caption_before_exit`})(tB||={});function B6e(e){let{options:t,className:n,components:r,classNames:i,...a}=e,o=[i[Qz.Dropdown],n].join(` `),s=t?.find(({value:e})=>e===a.value);return B.createElement(`span`,{"data-disabled":a.disabled,className:i[Qz.DropdownRoot]},B.createElement(r.Select,{className:o,...a},t?.map(({value:e,label:t,disabled:n})=>B.createElement(r.Option,{key:e,value:e,disabled:n},t))),B.createElement(`span`,{className:i[Qz.CaptionLabel],"aria-hidden":!0},s?.label,B.createElement(r.Chevron,{orientation:`down`,size:18,className:i[Qz.Chevron]})))}function V6e(e){return B.createElement(`div`,{...e})}function H6e(e){return B.createElement(`div`,{...e})}function U6e(e){let{calendarMonth:t,displayIndex:n,...r}=e;return B.createElement(`div`,{...r},e.children)}function W6e(e){let{calendarMonth:t,displayIndex:n,...r}=e;return B.createElement(`div`,{...r})}function G6e(e){return B.createElement(`table`,{...e})}function K6e(e){return B.createElement(`div`,{...e})}const nB=(0,B.createContext)(void 0);function rB(){let e=(0,B.useContext)(nB);if(e===void 0)throw Error(`useDayPicker() must be used within a custom component.`);return e}function q6e(e){let{components:t}=rB();return B.createElement(t.Dropdown,{...e})}function J6e(e){let{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:i,...a}=e,{components:o,classNames:s,labels:{labelPrevious:c,labelNext:l}}=rB(),u=(0,B.useCallback)(e=>{i&&n?.(e)},[i,n]),d=(0,B.useCallback)(e=>{r&&t?.(e)},[r,t]);return B.createElement(`nav`,{...a},B.createElement(o.PreviousMonthButton,{type:`button`,className:s[Qz.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:d},B.createElement(o.Chevron,{disabled:r?void 0:!0,className:s[Qz.Chevron],orientation:`left`})),B.createElement(o.NextMonthButton,{type:`button`,className:s[Qz.NextMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":l(i),onClick:u},B.createElement(o.Chevron,{disabled:i?void 0:!0,orientation:`right`,className:s[Qz.Chevron]})))}function Y6e(e){let{components:t}=rB();return B.createElement(t.Button,{...e})}function X6e(e){return B.createElement(`option`,{...e})}function Z6e(e){let{components:t}=rB();return B.createElement(t.Button,{...e})}function Q6e(e){let{rootRef:t,...n}=e;return B.createElement(`div`,{...n,ref:t})}function $6e(e){return B.createElement(`select`,{...e})}function e8e(e){let{week:t,...n}=e;return B.createElement(`tr`,{...n})}function t8e(e){return B.createElement(`th`,{...e})}function n8e(e){return B.createElement(`thead`,{"aria-hidden":!0},B.createElement(`tr`,{...e}))}function r8e(e){let{week:t,...n}=e;return B.createElement(`th`,{...n})}function i8e(e){return B.createElement(`th`,{...e})}function a8e(e){return B.createElement(`tbody`,{...e})}function o8e(e){let{components:t}=rB();return B.createElement(t.Dropdown,{...e})}var s8e=c({Button:()=>F6e,CaptionLabel:()=>I6e,Chevron:()=>L6e,Day:()=>R6e,DayButton:()=>z6e,Dropdown:()=>B6e,DropdownNav:()=>V6e,Footer:()=>H6e,Month:()=>U6e,MonthCaption:()=>W6e,MonthGrid:()=>G6e,Months:()=>K6e,MonthsDropdown:()=>q6e,Nav:()=>J6e,NextMonthButton:()=>Y6e,Option:()=>X6e,PreviousMonthButton:()=>Z6e,Root:()=>Q6e,Select:()=>$6e,Week:()=>e8e,WeekNumber:()=>r8e,WeekNumberHeader:()=>i8e,Weekday:()=>t8e,Weekdays:()=>n8e,Weeks:()=>a8e,YearsDropdown:()=>o8e});function iB(e,t,n=!1,r=Xz){let{from:i,to:a}=e,{differenceInCalendarDays:o,isSameDay:s}=r;return i&&a?(o(a,i)<0&&([i,a]=[a,i]),o(t,i)>=(n?1:0)&&o(a,t)>=(n?1:0)):!n&&a?s(a,t):!n&&i?s(i,t):!1}function aB(e){return!!(e&&typeof e==`object`&&`before`in e&&`after`in e)}function oB(e){return!!(e&&typeof e==`object`&&`from`in e)}function sB(e){return!!(e&&typeof e==`object`&&`after`in e)}function cB(e){return!!(e&&typeof e==`object`&&`before`in e)}function lB(e){return!!(e&&typeof e==`object`&&`dayOfWeek`in e)}function uB(e,t){return Array.isArray(e)&&e.every(t.isDate)}function dB(e,t,n=Xz){let r=Array.isArray(t)?t:[t],{isSameDay:i,differenceInCalendarDays:a,isAfter:o}=n;return r.some(t=>{if(typeof t==`boolean`)return t;if(n.isDate(t))return i(e,t);if(uB(t,n))return t.some(t=>i(e,t));if(oB(t))return iB(t,e,!1,n);if(lB(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(aB(t)){let n=a(t.before,e),r=a(t.after,e),i=n>0,s=r<0;return o(t.before,t.after)?s&&i:i||s}return sB(t)?a(e,t.after)>0:cB(t)?a(t.before,e)>0:typeof t==`function`?t(e):!1})}function c8e(e,t,n,r,i){let{disabled:a,hidden:o,modifiers:s,showOutsideDays:c,broadcastCalendar:l,today:u=i.today()}=t,{isSameDay:d,isSameMonth:f,startOfMonth:p,isBefore:m,endOfMonth:h,isAfter:g}=i,_=n&&p(n),v=r&&h(r),y={[$z.focused]:[],[$z.outside]:[],[$z.disabled]:[],[$z.hidden]:[],[$z.today]:[]},b={};for(let t of e){let{date:e,displayMonth:n}=t,r=!!(n&&!f(e,n)),p=!!(_&&m(e,_)),h=!!(v&&g(e,v)),x=!!(a&&dB(e,a,i)),S=!!(o&&dB(e,o,i))||p||h||!l&&!c&&r||l&&c===!1&&r,C=d(e,u);
vendor: 5,675 bytes, line 280
280r&&y.outside.push(t),x&&y.disabled.push(t),S&&y.hidden.push(t),C&&y.today.push(t),s&&Object.keys(s).forEach(n=>{let r=s?.[n];r&&dB(e,r,i)&&(b[n]?b[n].push(t):b[n]=[t])})}return e=>{let t={[$z.focused]:!1,[$z.disabled]:!1,[$z.hidden]:!1,[$z.outside]:!1,[$z.today]:!1},n={};for(let n in y)t[n]=y[n].some(t=>t===e);for(let t in b)n[t]=b[t].some(t=>t===e);return{...t,...n}}}function l8e(e,t,n={}){return Object.entries(e).filter(([,e])=>e===!0).reduce((e,[r])=>(n[r]?e.push(n[r]):t[$z[r]]?e.push(t[$z[r]]):t[eB[r]]&&e.push(t[eB[r]]),e),[t[Qz.Day]])}function u8e(e){return{...s8e,...e}}function d8e(e){let t={"data-mode":e.mode??void 0,"data-required":`required`in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith(`data-`)&&(t[e]=n)}),t}function fB(){let e={};for(let t in Qz)e[Qz[t]]=`rdp-${Qz[t]}`;for(let t in $z)e[$z[t]]=`rdp-${$z[t]}`;for(let t in eB)e[eB[t]]=`rdp-${eB[t]}`;for(let t in tB)e[tB[t]]=`rdp-${tB[t]}`;return e}function pB(e,t,n){return(n??new Yz(t)).formatMonthYear(e)}const f8e=pB;function p8e(e,t,n){return(n??new Yz(t)).format(e,`d`)}function m8e(e,t=Xz){return t.format(e,`LLLL`)}function h8e(e,t,n){return(n??new Yz(t)).format(e,`cccccc`)}function g8e(e,t=Xz){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function _8e(){return``}function mB(e,t=Xz){return t.format(e,`yyyy`)}const v8e=mB;var y8e=c({formatCaption:()=>pB,formatDay:()=>p8e,formatMonthCaption:()=>f8e,formatMonthDropdown:()=>m8e,formatWeekNumber:()=>g8e,formatWeekNumberHeader:()=>_8e,formatWeekdayName:()=>h8e,formatYearCaption:()=>v8e,formatYearDropdown:()=>mB});function b8e(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...y8e,...e}}function hB(e,t,n,r){let i=(r??new Yz(n)).format(e,`PPPP`);return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i}const x8e=hB;function gB(e,t,n){return(n??new Yz(t)).formatMonthYear(e)}const S8e=gB;function _B(e,t,n,r){let i=(r??new Yz(n)).format(e,`PPPP`);return t?.today&&(i=`Today, ${i}`),i}function vB(e){return`Choose the Month`}function yB(){return``}var C8e=`Go to the Next Month`;function bB(e,t){return C8e}function xB(e){return`Go to the Previous Month`}function SB(e,t,n){return(n??new Yz(t)).format(e,`cccc`)}function CB(e,t){return`Week ${e}`}function wB(e){return`Week Number`}function TB(e){return`Choose the Year`}var w8e=c({labelCaption:()=>S8e,labelDay:()=>x8e,labelDayButton:()=>hB,labelGrid:()=>gB,labelGridcell:()=>_B,labelMonthDropdown:()=>vB,labelNav:()=>yB,labelNext:()=>bB,labelPrevious:()=>xB,labelWeekNumber:()=>CB,labelWeekNumberHeader:()=>wB,labelWeekday:()=>SB,labelYearDropdown:()=>TB}),EB=(e,t,n)=>t||(n?typeof n==`function`?n:(...e)=>n:e);function T8e(e,t){let n=t.locale?.labels??{};return{...w8e,...e??{},labelDayButton:EB(hB,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:EB(vB,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:EB(bB,e?.labelNext,n.labelNext),labelPrevious:EB(xB,e?.labelPrevious,n.labelPrevious),labelWeekNumber:EB(CB,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:EB(TB,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:EB(gB,e?.labelGrid,n.labelGrid),labelGridcell:EB(_B,e?.labelGridcell,n.labelGridcell),labelNav:EB(yB,e?.labelNav,n.labelNav),labelWeekNumberHeader:EB(wB,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:EB(SB,e?.labelWeekday,n.labelWeekday)}}function E8e(e,t,n,r,i){let{startOfMonth:a,startOfYear:o,endOfYear:s,eachMonthOfInterval:c,getMonth:l}=i;return c({start:o(e),end:s(e)}).map(e=>{let o=r.formatMonthDropdown(e,i);return{value:l(e),label:o,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function D8e(e,t={},n={}){let r={...t?.[Qz.Day]};return Object.entries(e).filter(([,e])=>e===!0).forEach(([e])=>{r={...r,...n?.[e]}}),r}function O8e(e,t,n,r){let i=r??e.today(),a=n?e.startOfBroadcastWeek(i,e):t?e.startOfISOWeek(i):e.startOfWeek(i),o=[];for(let t=0;t<7;t++){let n=e.addDays(a,t);o.push(n)}return o}function k8e(e,t,n,r,i=!1){if(!e||!t)return;let{startOfYear:a,endOfYear:o,eachYearOfInterval:s,getYear:c}=r,l=s({start:a(e),end:o(t)});return i&&l.reverse(),l.map(e=>{let t=n.formatYearDropdown(e,r);return{value:c(e),label:t,disabled:!1}})}function A8e(e,t={}){let{weekStartsOn:n,locale:r}=t,i=n??r?.options?.weekStartsOn??0,a=t=>{let n=typeof t==`number`||typeof t==`string`?new Date(t):t;return new Gz(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},o=e=>{let t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(Gz.tz(e)),newDate:(t,n,r)=>new Gz(t,n,r,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{let n=a(e),r=t?.weekStartsOn??i,o=(n.getDay()-r+7)%7;return n.setDate(n.getDate()-o),n},startOfISOWeek:e=>{let t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{let t=a(e);return t.setDate(1),t},startOfYear:e=>{let t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{let n=a(e),r=(((t?.weekStartsOn??i)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+r),n},endOfISOWeek:e=>{let t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{let t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{let t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new Gz(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=r.getFullYear()*12+r.getMonth();for(;o.getFullYear()*12+o.getMonth()<=s;
vendor: 20,122 bytes, line 280
280)i.push(new Gz(o,e)),o.setMonth(o.getMonth()+1,1);return i},addDays:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t*7),n},addMonths:(e,t)=>{let n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{let n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new Gz(n.getFullYear(),0,1,12,0,0,e);for(;o.getFullYear()<=r.getFullYear();)i.push(new Gz(o,e)),o.setFullYear(o.getFullYear()+1,0,1);return i},getWeek:(e,t)=>ob(o(e),{weekStartsOn:t?.weekStartsOn??i,firstWeekContainsDate:t?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1}),getISOWeek:e=>ab(o(e)),differenceInCalendarDays:(e,t)=>Xy(o(e),o(t)),differenceInCalendarMonths:(e,t)=>eb(o(e),o(t))}}var DB=e=>e instanceof HTMLElement?e:null,OB=e=>[...e.querySelectorAll(`[data-animated-month]`)??[]],j8e=e=>DB(e.querySelector(`[data-animated-month]`)),kB=e=>DB(e.querySelector(`[data-animated-caption]`)),AB=e=>DB(e.querySelector(`[data-animated-weeks]`)),M8e=e=>DB(e.querySelector(`[data-animated-nav]`)),N8e=e=>DB(e.querySelector(`[data-animated-weekdays]`));function P8e(e,t,{classNames:n,months:r,focused:i,dateLib:a}){let o=(0,B.useRef)(null),s=(0,B.useRef)(r),c=(0,B.useRef)(!1);(0,B.useLayoutEffect)(()=>{let l=s.current;if(s.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;let u=a.isSameMonth(r[0].date,l[0].date),d=a.isAfter(r[0].date,l[0].date),f=d?n[tB.caption_after_enter]:n[tB.caption_before_enter],p=d?n[tB.weeks_after_enter]:n[tB.weeks_before_enter],m=o.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement?(OB(h).forEach(e=>{if(!(e instanceof HTMLElement))return;let t=j8e(e);t&&e.contains(t)&&e.removeChild(t);let n=kB(e);n&&n.classList.remove(f);let r=AB(e);r&&r.classList.remove(p)}),o.current=h):o.current=null,c.current||u||i)return;let g=m instanceof HTMLElement?OB(m):[],_=OB(e.current);if(_?.every(e=>e instanceof HTMLElement)&&g&&g.every(e=>e instanceof HTMLElement)){c.current=!0;let t=[];e.current.style.isolation=`isolate`;let r=M8e(e.current);r&&(r.style.zIndex=`1`),_.forEach((i,a)=>{let o=g[a];if(!o)return;i.style.position=`relative`,i.style.overflow=`hidden`;let s=kB(i);s&&s.classList.add(f);let l=AB(i);l&&l.classList.add(p);let u=()=>{c.current=!1,e.current&&(e.current.style.isolation=``),r&&(r.style.zIndex=``),s&&s.classList.remove(f),l&&l.classList.remove(p),i.style.position=``,i.style.overflow=``,i.contains(o)&&i.removeChild(o)};t.push(u),o.style.pointerEvents=`none`,o.style.position=`absolute`,o.style.overflow=`hidden`,o.setAttribute(`aria-hidden`,`true`);let m=N8e(o);m&&(m.style.opacity=`0`);let h=kB(o);h&&(h.classList.add(d?n[tB.caption_before_exit]:n[tB.caption_after_exit]),h.addEventListener(`animationend`,u));let _=AB(o);_&&_.classList.add(d?n[tB.weeks_before_exit]:n[tB.weeks_after_exit]),i.insertBefore(o,i.firstChild)})}})}function F8e(e,t,n,r){let i=e[0],a=e[e.length-1],{ISOWeek:o,fixedWeeks:s,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:m,endOfWeek:h,isAfter:g,startOfBroadcastWeek:_,startOfISOWeek:v,startOfWeek:y}=r,b=c?_(i,r):o?v(i):y(i),x=c?f(a):o?p(m(a)):h(m(a)),S=t&&(c?f(t):o?p(t):h(t)),C=u(S&&g(x,S)?S:x,b),w=d(a,i)+1,T=[];for(let e=0;e<=C;e++){let t=l(b,e);T.push(t)}let E=(c?35:42)*w;if(s&&T.length<E){let e=E-T.length;for(let t=0;t<e;t++){let e=l(T[T.length-1],1);T.push(e)}}return T}function I8e(e){let t=[];return e.reduce((e,n)=>{let r=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(r.slice())},t.slice())}function L8e(e,t,n,r){let{numberOfMonths:i=1}=n,a=[];for(let n=0;n<i;n++){let i=r.addMonths(e,n);if(t&&i>t)break;a.push(i)}return a}function jB(e,t,n,r){let{month:i,defaultMonth:a,today:o=r.today(),numberOfMonths:s=1}=e,c=i||a||o,{differenceInCalendarMonths:l,addMonths:u,startOfMonth:d}=r;return n&&l(n,c)<s-1&&(c=u(n,-1*(s-1))),t&&l(c,t)<0&&(c=t),d(c)}function R8e(e,t,n,r){let{addDays:i,endOfBroadcastWeek:a,endOfISOWeek:o,endOfMonth:s,endOfWeek:c,getISOWeek:l,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:p}=r,m=e.reduce((e,m)=>{let h=n.broadcastCalendar?d(m,r):n.ISOWeek?f(m):p(m),g=n.broadcastCalendar?a(m):n.ISOWeek?o(s(m)):c(s(m)),_=t.filter(e=>e>=h&&e<=g),v=n.broadcastCalendar?35:42;if(n.fixedWeeks&&_.length<v){let e=t.filter(e=>{let t=v-_.length;return e>g&&e<=i(g,t)});_.push(...e)}let y=new N6e(m,_.reduce((e,t)=>{let i=n.ISOWeek?l(t):u(t),a=e.find(e=>e.weekNumber===i),o=new Zz(t,m,r);return a?a.days.push(o):e.push(new P6e(i,[o])),e},[]));return e.push(y),e},[]);return n.reverseMonths?m.reverse():m}function z8e(e,t){let{startMonth:n,endMonth:r}=e,{startOfYear:i,startOfDay:a,startOfMonth:o,endOfMonth:s,addYears:c,endOfYear:l,newDate:u,today:d}=t,{fromYear:f,toYear:p,fromMonth:m,toMonth:h}=e;!n&&m&&(n=m),!n&&f&&(n=t.newDate(f,0,1)),!r&&h&&(r=h),!r&&p&&(r=u(p,11,31));let g=e.captionLayout===`dropdown`||e.captionLayout===`dropdown-years`;return n?n=o(n):f?n=u(f,0,1):!n&&g&&(n=i(c(e.today??d(),-100))),r?r=s(r):p?r=u(p,11,31):!r&&g&&(r=l(e.today??d())),[n&&a(n),r&&a(r)]}function B8e(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a=1}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a:1,u=o(e);if(!t||!(c(t,e)<a))return s(u,l)}function V8e(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a??1:1,u=o(e);if(!t||!(c(u,t)<=0))return s(u,-l)}function H8e(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}function MB(e,t){let[n,r]=(0,B.useState)(e);return[t===void 0?n:t,r]}function U8e(e,t){let[n,r]=z8e(e,t),{startOfMonth:i,endOfMonth:a}=t,o=jB(e,n,r,t),[s,c]=MB(o,e.month?o:void 0);(0,B.useEffect)(()=>{c(jB(e,n,r,t))},[e.timeZone]);let{months:l,weeks:u,days:d,previousMonth:f,nextMonth:p}=(0,B.useMemo)(()=>{let i=L8e(s,r,{numberOfMonths:e.numberOfMonths},t),o=R8e(i,F8e(i,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t);return{months:o,weeks:H8e(o),days:I8e(o),previousMonth:V8e(s,n,e,t),nextMonth:B8e(s,r,e,t)}},[t,s.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:m,onMonthChange:h}=e,g=e=>u.some(t=>t.days.some(t=>t.isEqualTo(e))),_=e=>{if(m)return;let t=i(e);n&&t<i(n)&&(t=i(n)),r&&t>i(r)&&(t=i(r)),c(t),h?.(t)};return{months:l,weeks:u,days:d,navStart:n,navEnd:r,previousMonth:f,nextMonth:p,goToMonth:_,goToDay:e=>{g(e)||_(e.date)}}}var NB;(function(e){e[e.Today=0]=`Today`,e[e.Selected=1]=`Selected`,e[e.LastFocused=2]=`LastFocused`,e[e.FocusedModifier=3]=`FocusedModifier`})(NB||={});function PB(e){return!e[$z.disabled]&&!e[$z.hidden]&&!e[$z.outside]}function W8e(e,t,n,r){let i,a=-1;for(let o of e){let e=t(o);PB(e)&&(e[$z.focused]&&a<NB.FocusedModifier?(i=o,a=NB.FocusedModifier):r?.isEqualTo(o)&&a<NB.LastFocused?(i=o,a=NB.LastFocused):n(o.date)&&a<NB.Selected?(i=o,a=NB.Selected):e[$z.today]&&a<NB.Today&&(i=o,a=NB.Today))}return i||=e.find(e=>PB(t(e))),i}function G8e(e,t,n,r,i,a,o){let{ISOWeek:s,broadcastCalendar:c}=a,{addDays:l,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:m,endOfWeek:h,max:g,min:_,startOfBroadcastWeek:v,startOfISOWeek:y,startOfWeek:b}=o,x={day:l,week:d,month:u,year:f,startOfWeek:e=>c?v(e,o):s?y(e):b(e),endOfWeek:e=>c?p(e):s?m(e):h(e)}[e](n,t===`after`?1:-1);return t===`before`&&r?x=g([r,x]):t===`after`&&i&&(x=_([i,x])),x}function FB(e,t,n,r,i,a,o,s=0){if(s>365)return;let c=G8e(e,t,n.date,r,i,a,o),l=!!(a.disabled&&dB(c,a.disabled,o)),u=!!(a.hidden&&dB(c,a.hidden,o)),d=new Zz(c,c,o);return!l&&!u?d:FB(e,t,d,r,i,a,o,s+1)}function K8e(e,t,n,r,i){let{autoFocus:a}=e,[o,s]=(0,B.useState)(),c=W8e(t.days,n,r||(()=>!1),o),[l,u]=(0,B.useState)(a?c:void 0);return{isFocusTarget:e=>!!c?.isEqualTo(e),setFocused:u,focused:l,blur:()=>{s(l),u(void 0)},moveFocus:(n,r)=>{if(!l)return;let a=FB(n,r,l,t.navStart,t.navEnd,e,i);a&&(e.disableNavigation&&!t.days.some(e=>e.isEqualTo(a))||(t.goToDay(a),u(a)))}}}function q8e(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=MB(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t,l=e=>s?.some(t=>c(t,e))??!1,{min:u,max:d}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(l(e)){if(s?.length===u||r&&s?.length===1)return;a=s?.filter(t=>!c(t,e))}else a=s?.length===d?[e]:[...a,e];return i||o(a),i?.(a,e,t,n),a},isSelected:l}}function J8e(e,t,n=0,r=0,i=!1,a=Xz){let{from:o,to:s}=t||{},{isSameDay:c,isAfter:l,isBefore:u}=a,d;if(!o&&!s)d={from:e,to:n>0?void 0:e};else if(o&&!s)d=c(o,e)?n===0?{from:o,to:e}:i?{from:o,to:void 0}:void 0:u(e,o)?{from:e,to:o}:{from:o,to:e};else if(o&&s)if(c(o,e)&&c(s,e))d=i?{from:o,to:s}:void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(s,e))d={from:e,to:n>0?void 0:e};else if(u(e,o))d={from:e,to:s};else if(l(e,o))d={from:o,to:e};else if(l(e,s))d={from:o,to:e};else throw Error(`Invalid range`);if(d?.from&&d?.to){let t=a.differenceInCalendarDays(d.to,d.from);(r>0&&t>r||n>1&&t<n)&&(d={from:e,to:void 0})}return d}function Y8e(e,t,n=Xz){let r=Array.isArray(t)?t:[t],i=e.from,a=n.differenceInCalendarDays(e.to,e.from),o=Math.min(a,6);for(let e=0;e<=o;e++){if(r.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function IB(e,t,n=Xz){return iB(e,t.from,!1,n)||iB(e,t.to,!1,n)||iB(t,e.from,!1,n)||iB(t,e.to,!1,n)}function X8e(e,t,n=Xz){let r=Array.isArray(t)?t:[t];if(r.filter(e=>typeof e!=`function`).some(t=>typeof t==`boolean`?t:n.isDate(t)?iB(e,t,!1,n):uB(t,n)?t.some(t=>iB(e,t,!1,n)):oB(t)?t.from&&t.to?IB(e,{from:t.from,to:t.to},n):!1:lB(t)?Y8e(e,t.dayOfWeek,n):aB(t)?n.isAfter(t.before,t.after)?IB(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):dB(e.from,t,n)||dB(e.to,t,n):sB(t)||cB(t)?dB(e.from,t,n)||dB(e.to,t,n):!1))return!0;let i=r.filter(e=>typeof e==`function`);if(i.length){let t=e.from,r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(i.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}function Z8e(e,t){let{disabled:n,excludeDisabled:r,resetOnSelect:i,selected:a,required:o,onSelect:s}=e,[c,l]=MB(a,s?a:void 0),u=s?a:c;return{selected:u,select:(a,c,d)=>{let{min:f,max:p}=e,m;if(a){let e=u?.from,n=u?.to,r=!!e&&!!n,s=!!e&&!!n&&t.isSameDay(e,n)&&t.isSameDay(a,e);m=i&&(r||!u?.from)?!o&&s?void 0:{from:a,to:void 0}:J8e(a,u,f,p,o,t)}return r&&n&&m?.from&&m.to&&X8e({from:m.from,to:m.to},n,t)&&(m.from=a,m.to=void 0),s||l(m),s?.(m,a,c,d),m},isSelected:e=>u&&iB(u,e,!1,t)}}function Q8e(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=MB(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!r&&s&&s&&c(e,s)&&(a=void 0),i||o(a),i?.(a,e,t,n),a},isSelected:e=>s?c(s,e):!1}}function $8e(e,t){let n=Q8e(e,t),r=q8e(e,t),i=Z8e(e,t);switch(e.mode){case`single`:return n;case`multiple`:return r;case`range`:return i;default:return}}function LB(e,t){return e instanceof Gz&&e.timeZone===t?e:new Gz(e,t)}function RB(e,t,n){if(!n)return LB(e,t);let r=LB(e,t),i=new Gz(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0,t);return new Date(i.getTime())}function zB(e,t,n){return typeof e==`boolean`||typeof e==`function`?e:e instanceof Date?RB(e,t,n):Array.isArray(e)?e.map(e=>e instanceof Date?RB(e,t,n):e):oB(e)?{...e,from:e.from?LB(e.from,t):e.from,to:e.to?LB(e.to,t):e.to}:aB(e)?{before:RB(e.before,t,n),after:RB(e.after,t,n)}:sB(e)?{after:RB(e.after,t,n)}:cB(e)?{before:RB(e.before,t,n)}:e}function BB(e,t,n){return e&&(Array.isArray(e)?e.map(e=>zB(e,t,n)):zB(e,t,n))}function e5e(e){let t=e,n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&=LB(t.today,n),t.month&&=LB(t.month,n),t.defaultMonth&&=LB(t.defaultMonth,n),t.startMonth&&=LB(t.startMonth,n),t.endMonth&&=LB(t.endMonth,n),t.mode===`single`&&t.selected?t.selected=LB(t.selected,n):t.mode===`multiple`&&t.selected?t.selected=t.selected?.map(e=>LB(e,n)):t.mode===`range`&&t.selected&&(t.selected={from:t.selected.from?LB(t.selected.from,n):t.selected.from,to:t.selected.to?LB(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=BB(t.disabled,n)),t.hidden!==void 0&&(t.hidden=BB(t.hidden,n)),t.modifiers)){let e={};Object.keys(t.modifiers).forEach(r=>{e[r]=BB(t.modifiers?.[r],n)}),t.modifiers=e}let{components:r,formatters:i,labels:a,dateLib:o,locale:s,classNames:c}=(0,B.useMemo)(()=>{let e={...Jz,...t.locale},n=t.broadcastCalendar?1:t.weekStartsOn,r=t.noonSafe&&t.timeZone?A8e(t.timeZone,{weekStartsOn:n,locale:e}):void 0,i=t.dateLib&&r?{...r,...t.dateLib}:t.dateLib??r,a=new Yz({locale:e,weekStartsOn:n,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},i);return{dateLib:a,components:u8e(t.components),formatters:b8e(t.formatters),labels:T8e(t.labels,a.options),locale:e,classNames:{...fB(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:o.today()});let{captionLayout:l,mode:u,navLayout:d,numberOfMonths:f=1,onDayBlur:p,onDayClick:m,onDayFocus:h,onDayKeyDown:g,onDayMouseEnter:_,onDayMouseLeave:v,onNextClick:y,onPrevClick:b,showWeekNumber:x,styles:S}=t,{formatCaption:C,formatDay:w,formatMonthDropdown:T,formatWeekNumber:E,formatWeekNumberHeader:D,formatWeekdayName:O,formatYearDropdown:k}=i,A=U8e(t,o),{days:j,months:M,navStart:N,navEnd:P,previousMonth:F,nextMonth:I,goToMonth:L}=A,ee=c8e(j,t,N,P,o),{isSelected:R,select:te,selected:ne}=$8e(t,o)??{},{blur:re,focused:ie,isFocusTarget:z,moveFocus:ae,setFocused:oe}=K8e(t,A,ee,R??(()=>!1),o),{labelDayButton:se,labelGridcell:ce,labelGrid:le,labelMonthDropdown:ue,labelNav:de,labelPrevious:fe,labelNext:pe,labelWeekday:me,labelWeekNumber:he,labelWeekNumberHeader:ge,labelYearDropdown:_e}=a,ve=(0,B.useMemo)(()=>O8e(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),ye=u!==void 0||m!==void 0,be=(0,B.useCallback)(()=>{F&&(L(F),b?.(F))},[F,L,b]),xe=(0,B.useCallback)(()=>{I&&(L(I),y?.(I))},[L,I,y]),Se=(0,B.useCallback)((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),oe(e),!t.disabled&&(te?.(e.date,t,n),m?.(e.date,t,n))},[te,m,oe]),Ce=(0,B.useCallback)((e,t)=>n=>{oe(e),h?.(e.date,t,n)},[h,oe]),we=(0,B.useCallback)((e,t)=>n=>{re(),p?.(e.date,t,n)},[re,p]),Te=(0,B.useCallback)((e,n)=>r=>{let i={ArrowLeft:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`after`:`before`],ArrowRight:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`before`:`after`],ArrowDown:[r.shiftKey?`year`:`week`,`after`],ArrowUp:[r.shiftKey?`year`:`week`,`before`],PageUp:[r.shiftKey?`year`:`month`,`before`],PageDown:[r.shiftKey?`year`:`month`,`after`],Home:[`startOfWeek`,`before`],End:[`endOfWeek`,`after`]};if(i[r.key]){r.preventDefault(),r.stopPropagation();let[e,t]=i[r.key];ae(e,t)}g?.(e.date,n,r)},[ae,g,t.dir]),Ee=(0,B.useCallback)((e,t)=>n=>{_?.(e.date,t,n)},[_]),De=(0,B.useCallback)((e,t)=>n=>{v?.(e.date,t,n)},[v]),Oe=(0,B.useCallback)(e=>t=>{let n=Number(t.target.value);L(o.setMonth(o.startOfMonth(e),n))},[o,L]),ke=(0,B.useCallback)(e=>t=>{let n=Number(t.target.value);L(o.setYear(o.startOfMonth(e),n))},[o,L]),{className:Ae,style:je}=(0,B.useMemo)(()=>({className:[c[Qz.Root],t.className].filter(Boolean).join(` `),style:{...S?.[Qz.Root],...t.style}}),[c,t.className,t.style,S]),Me=d8e(t),Ne=(0,B.useRef)(null);P8e(Ne,!!t.animate,{classNames:c,months:M,focused:ie,dateLib:o});let Pe={dayPickerProps:t,selected:ne,select:te,isSelected:R,months:M,nextMonth:I,previousMonth:F,goToMonth:L,getModifiers:ee,components:r,classNames:c,styles:S,labels:a,formatters:i};return B.createElement(nB.Provider,{value:Pe},B.createElement(r.Root,{rootRef:t.animate?Ne:void 0,className:Ae,style:je,dir:t.dir,id:t.id,lang:t.lang??s.code,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t[`aria-label`],"aria-labelledby":t[`aria-labelledby`],...Me},B.createElement(r.Months,{className:c[Qz.Months],style:S?.[Qz.Months]},!t.hideNavigation&&!d&&B.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[Qz.Nav],style:S?.[Qz.Nav],"aria-label":de(),onPreviousClick:be,onNextClick:xe,previousMonth:F,nextMonth:I}),M.map((e,n)=>B.createElement(r.Month,{"data-animated-month":t.animate?`true`:void 0,className:c[Qz.Month],style:S?.[Qz.Month],key:n,displayIndex:n,calendarMonth:e},d===`around`&&!t.hideNavigation&&n===0&&B.createElement(r.PreviousMonthButton,{type:`button`,className:c[Qz.PreviousMonthButton],tabIndex:F?void 0:-1,"aria-disabled":F?void 0:!0,"aria-label":fe(F),onClick:be,"data-animated-button":t.animate?`true`:void 0},B.createElement(r.Chevron,{disabled:F?void 0:!0,className:c[Qz.Chevron],orientation:t.dir===`rtl`?`right`:`left`})),B.createElement(r.MonthCaption,{"data-animated-caption":t.animate?`true`:void 0,className:c[Qz.MonthCaption],style:S?.[Qz.MonthCaption],calendarMonth:e,displayIndex:n},l?.startsWith(`dropdown`)?B.createElement(r.DropdownNav,{className:c[Qz.Dropdowns],style:S?.[Qz.Dropdowns]},(()=>{let n=l===`dropdown`||l===`dropdown-months`?B.createElement(r.MonthsDropdown,{key:`month`,className:c[Qz.MonthsDropdown],"aria-label":ue(),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:Oe(e.date),options:E8e(e.date,N,P,i,o),style:S?.[Qz.Dropdown],value:o.getMonth(e.date)}):B.createElement(`span`,{key:`month`},T(e.date,o)),a=l===`dropdown`||l===`dropdown-years`?B.createElement(r.YearsDropdown,{key:`year`,className:c[Qz.YearsDropdown],"aria-label":_e(o.options),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:ke(e.date),options:k8e(N,P,i,o,!!t.reverseYears),style:S?.[Qz.Dropdown],value:o.getYear(e.date)}):B.createElement(`span`,{key:`year`},k(e.date,o));return o.getMonthYearOrder()===`year-first`?[a,n]:[n,a]})(),B.createElement(`span`,{role:`status`,"aria-live":`polite`,style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`}},C(e.date,o.options,o))):B.createElement(r.CaptionLabel,{className:c[Qz.CaptionLabel],role:`status`,"aria-live":`polite`},C(e.date,o.options,o))),d===`around`&&!t.hideNavigation&&n===f-1&&B.createElement(r.NextMonthButton,{type:`button`,className:c[Qz.NextMonthButton],tabIndex:I?void 0:-1,"aria-disabled":I?void 0:!0,"aria-label":pe(I),onClick:xe,"data-animated-button":t.animate?`true`:void 0},B.createElement(r.Chevron,{disabled:I?void 0:!0,className:c[Qz.Chevron],orientation:t.dir===`rtl`?`left`:`right`})),n===f-1&&d===`after`&&!t.hideNavigation&&B.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[Qz.Nav],style:S?.[Qz.Nav],"aria-label":de(),onPreviousClick:be,onNextClick:xe,previousMonth:F,nextMonth:I}),B.createElement(r.MonthGrid,{role:`grid`,"aria-multiselectable":u===`multiple`||u===`range`,"aria-label":le(e.date,o.options,o)||void 0,className:c[Qz.MonthGrid],style:S?.[Qz.MonthGrid]},!t.hideWeekdays&&B.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?`true`:void 0,className:c[Qz.Weekdays],style:S?.[Qz.Weekdays]},x&&B.createElement(r.WeekNumberHeader,{"aria-label":ge(o.options),className:c[Qz.WeekNumberHeader],style:S?.[Qz.WeekNumberHeader],scope:`col`},D()),ve.map(e=>B.createElement(r.Weekday,{"aria-label":me(e,o.options,o),className:c[Qz.Weekday],key:String(e),style:S?.[Qz.Weekday],scope:`col`},O(e,o.options,o)))),B.createElement(r.Weeks,{"data-animated-weeks":t.animate?`true`:void 0,className:c[Qz.Weeks],style:S?.[Qz.Weeks]},e.weeks.map(e=>B.createElement(r.Week,{className:c[Qz.Week],key:e.weekNumber,style:S?.[Qz.Week],week:e},x&&B.createElement(r.WeekNumber,{week:e,style:S?.[Qz.WeekNumber],"aria-label":he(e.weekNumber,{locale:s}),className:c[Qz.WeekNumber],scope:`row`,role:`rowheader`},E(e.weekNumber,o)),e.days.map(e=>{let{date:n}=e,i=ee(e);
280if(i[$z.focused]=!i.hidden&&!!ie?.isEqualTo(e),i[eB.selected]=R?.(n)||i.selected,oB(ne)){let{from:e,to:t}=ne;i[eB.range_start]=!!(e&&t&&o.isSameDay(n,e)),i[eB.range_end]=!!(e&&t&&o.isSameDay(n,t)),i[eB.range_middle]=iB(ne,n,!0,o)}let a=D8e(i,S,t.modifiersStyles),s=l8e(i,c,t.modifiersClassNames),l=!ye&&!i.hidden?ce(n,i,o.options,o):void 0;return B.createElement(r.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:i,className:s.join(` `),style:a,role:`gridcell`,"aria-selected":i.selected||void 0,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":i.selected||void 0,"data-disabled":i.disabled||void 0,"data-hidden":i.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":i.focused||void 0,"data-today":i.today||void 0},!i.hidden&&ye?B.createElement(r.DayButton,{className:c[Qz.DayButton],style:S?.[Qz.DayButton],type:`button`,day:e,modifiers:i,disabled:!i.focused&&i.disabled||void 0,"aria-disabled":i.focused&&i.disabled||void 0,tabIndex:z(e)?0:-1,"aria-label":se(n,i,o.options,o),onClick:Se(e,i),onBlur:we(e,i),onFocus:Ce(e,i),onKeyDown:Te(e,i),onMouseEnter:Ee(e,i),onMouseLeave:De(e,i)},w(n,o.options,o)):!i.hidden&&w(e.date,o.options,o))})))))))),t.footer&&B.createElement(r.Footer,{className:c[Qz.Footer],style:S?.[Qz.Footer],role:`status`,"aria-live":`polite`},t.footer)))}function VB({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r=`label`,buttonVariant:i=`ghost`,formatters:a,components:o,...s}){let c=fB();return(0,K.jsx)(e5e,{showOutsideDays:n,className:q(`group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:e=>e.toLocaleString(`default`,{month:`short`}),...a},classNames:{root:q(`w-fit`,c.root),months:q(`relative flex flex-col gap-4 md:flex-row`,c.months),month:q(`flex w-full flex-col gap-4`,c.month),nav:q(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,c.nav),button_previous:q(Ny({variant:i}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,c.button_previous),button_next:q(Ny({variant:i}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,c.button_next),month_caption:q(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,c.month_caption),dropdowns:q(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,c.dropdowns),dropdown_root:q(`relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50`,c.dropdown_root),dropdown:q(`absolute inset-0 bg-popover opacity-0`,c.dropdown),caption_label:q(`font-medium select-none`,r===`label`?`text-sm`:`flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground`,c.caption_label),table:`w-full border-collapse`,weekdays:q(`flex`,c.weekdays),weekday:q(`flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none`,c.weekday),week:q(`mt-2 flex w-full`,c.week),week_number_header:q(`w-(--cell-size) select-none`,c.week_number_header),week_number:q(`text-[0.8rem] text-muted-foreground select-none`,c.week_number),day:q(`group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md`,s.showWeekNumber?`[&:nth-child(2)[data-selected=true]_button]:rounded-l-md`:`[&:first-child[data-selected=true]_button]:rounded-l-md`,c.day),range_start:q(`rounded-l-md bg-accent`,c.range_start),range_middle:q(`rounded-none`,c.range_middle),range_end:q(`rounded-r-md bg-accent`,c.range_end),today:q(`rounded-md bg-foreground
280/15 text-accent-foreground data-[selected=true]:rounded-none`,c.today),outside:q(`text-muted-foreground aria-selected:text-muted-foreground`,c.outside),disabled:q(`text-muted-foreground opacity-50`,c.disabled),hidden:q(`invisible`,c.hidden),...t},components:{Root:({className:e,rootRef:t,...n})=>(0,K.jsx)(`div`,{"data-slot":`calendar`,ref:t,className:q(e),...n}),Chevron:({className:e,orientation:t,...n})=>t===`left`?(0,K.jsx)(zg,{className:q(`size-4`,e),...n}):t===`right`?(0,K.jsx)(Bg,{className:q(`size-4`,e),...n}):(0,K.jsx)(Rg,{className:q(`size-4`,e),...n}),DayButton:t5e,WeekNumber:({children:e,...t})=>(0,K.jsx)(`td`,{...t,children:(0,K.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:e})}),...o},...s})}function t5e({className:e,day:t,modifiers:n,...r}){let i=fB(),a=B.useRef(null);return B.useEffect(()=>{n.focused&&a.current?.focus()},[n.focused]),(0,K.jsx)(J,{ref:a,variant:`ghost`,size:`icon`,"data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:q(`flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70`,i.day,e),...r})}function HB({className:e,...t}){return(0,K.jsx)(YTe,{"data-slot":`checkbox`,className:q(`peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary`,e),...t,children:(0,K.jsx)(ZTe,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:(0,K.jsx)(Lg,{className:`size-3.5`})})})}const n5e=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/calendar/events?${n}`:`/api/v1/calendar/events`},UB=async(e,t)=>Z(n5e(e),{...t,method:`GET`}),r5e=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/calendar/events/search?${n}`:`/api/v1/calendar/events/search`},i5e=async(e,t)=>Z(r5e(e),{...t,method:`GET`}),a5e=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/calendar/events/month?${n}`:`/api/v1/calendar/events/month`},o5e=async(e,t)=>Z(a5e(e),{...t,method:`GET`}),s5e=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/outlook-tasks/search?${n}`:`/api/v1/outlook-tasks/search`},c5e=async(e,t)=>Z(s5e(e),{...t,method:`GET`}),l5e=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/caldav-tasks/search?${n}`:`/api/v1/caldav-tasks/search`},u5e=async(e,t)=>Z(l5e(e),{...t,method:`GET`});function WB(e,t){let{intervalMs:n,throttleMs:r=1e4}=t??{},i=(0,B.useRef)(e);(0,B.useEffect)(()=>{i.current=e},[e]);let a=(0,B.useRef)(0);(0,B.useEffect)(()=>{function e(){if(document.visibilityState!==`visible`)return;let e=Date.now();e-a.current<r||(a.current=e,i.current())}document.addEventListener(`visibilitychange`,e),window.addEventListener(`focus`,e);let t=n?window.setInterval(e,n):null;return()=>{document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`focus`,e),t!==null&&window.clearInterval(t)}},[n,r])}const GB=[{key:`dashboard`,pathPrefixes:[`/dashboard`],labelKey:`nav.dashboard`},{key:`chat`,pathPrefixes:[`/chat`],labelKey:`nav.chat`},{key:`evaluations`,pathPrefixes:[`/vault/evaluations`],labelKey:`nav.evaluations`},{key:`playbooks`,pathPrefixes:[`/vault/playbooks`],labelKey:`nav.playbooks`},{key:`vault`,pathPrefixes:[`/vault`],labelKey:`nav.vault`},{key:`matters`,pathPrefixes:[`/matters`],labelKey:`nav.matters`},{key:`mail`,pathPrefixes:[`/inbox`,`/email-task`],labelKey:`nav.mail`},{key:`booking`,pathPrefixes:[`/booking`],labelKey:`nav.booking_links`}
280,{key:`routines`,pathPrefixes:[`/routines`],labelKey:`nav.routines`},{key:`console`,pathPrefixes:[`/console`],labelKey:`nav.console`},{key:`shared`,pathPrefixes:[`/shared`],labelKey:`nav.shared`},{key:`settings`,pathPrefixes:[`/settings`],labelKey:`nav.settings`},{key:`other`,pathPrefixes:[],labelKey:`dashboard.time_on_site.other`}],KB=Object.fromEntries(GB.map(e=>[e.key,e.labelKey]));function qB(e){for(let t of GB)if(t.key!==`other`&&t.pathPrefixes.some(t=>e.startsWith(t)))return t.key;return`other`}function d5e(e,t){let n=new URLSearchParams(t),r=e.match(/^\/matters\/([^/]+)/);if(r){let e=r[1];return{type:`matter`,id:e,route:`/matters/${e}`}}let i=e.match(/^\/chat\/([^/]+)/);if(i){let e=i[1];return{type:`chat`,id:e,route:`/chat/${e}`}}if(e===`/email-task`){let e=n.get(`taskId`);if(e)return{type:`email_task`,id:e,route:`/email-task?taskId=${e}`}}let a=n.get(`doc`);return a?{type:`document`,id:a,route:`/vault?doc=${a}`}:null}function JB(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60);return t>0?`${t}h ${n}m`:n>0?`${n}m`:e>0?`<1m`:`0m`}function f5e({date:e}){let{t}=V(),n=fb(e,`yyyy-MM-dd`),[r,i]=B.useState(`today`),a=iR(e=>e.summaries[n]),o=iR(e=>e.allTimeSummary),s=iR(e=>e.fetchSummary),c=iR(e=>e.fetchAllTime);B.useEffect(()=>{r===`all_time`?c():s(n)},[r,n,s,c]);let l=r===`all_time`?o:a,u=l?.sections??[],d=l?.total_seconds??0,f=u.reduce((e,t)=>Math.max(e,t.seconds),0),p=r===`all_time`?`dashboard.time_on_site.empty_all_time`:`dashboard.time_on_site.empty`;return(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold leading-none`,children:t(`dashboard.time_on_site.title`)}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`dashboard.time_on_site.total`,{duration:JB(d)})})]}),(0,K.jsxs)(wz,{type:`single`,size:`sm`,variant:`outline`,value:r,onValueChange:e=>{e&&i(e)},children:[(0,K.jsx)(Tz,{value:`today`,className:`h-6 px-2 text-xs`,children:t(`dashboard.today`)}),(0,K.jsx)(Tz,{value:`all_time`,className:`h-6 px-2 text-xs`,children:t(`dashboard.time_on_site.all_time`)})]})]}),u.length===0&&(0,K.jsx)(`div`,{className:`flex h-[120px] items-center justify-center`,children:(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground text-center`,children:t(p)})}),u.length>0&&(0,K.jsx)(`div`,{className:`space-y-3`,children:u.map(e=>{let n=KB[e.section]??`dashboard.time_on_site.other`,r=f>0?e.seconds/f*100:0;return(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,K.jsx)(`span`,{className:`truncate`,children:t(n)}),(0,K.jsx)(`span`,{className:`tabular-nums text-muted-foreground shrink-0 ml-2`,children:JB(e.seconds)})]}),(0,K.jsx)(`div`,{className:`h-2 w-full rounded-full bg-muted overflow-hidden`,children:(0,K.jsx)(`div`,{className:`h-full rounded-full bg-primary`,style:{width:`${r}%`}})})]},e.section)})})]})}var YB=[{id:`google`,labelKey:`dashboard.provider_google`,dot:`bg-red-500`},{id:`outlook`,labelKey:`dashboard.provider_outlook`,dot:`bg-blue-500`},{id:`caldav`,labelKey:`dashboard.provider_caldav`,dot:`bg-emerald-500`}],p5e={1:`grid-cols-1`,2:`grid-cols-1 @3xs/events:grid-cols-2`,3:`grid-cols-1 @sm/events:grid-cols-3`};function m5e(e){return YB.find(t=>t.id===e)?.dot??`bg-gray-400`}function h5e(){let{t:e}=V(),{formatTime:t}=jb();return n=>n.is_all_day?e(`dashboard.all_day`):n.start_time?t(new Date(n.start_time)):`â`}function g5e(e){let t=[],n=new Map;for(let r of e){let e=r.account_id??`__none__`,i=n.get(e);i===void 0&&(i=t.length,n.set(e,i),t.push({accountId:r.account_id??null,events:[]})),t[i].events.push(r)}return t}function _5e({event:e,isPast:t,onClick:n,accountEmail:r}){let{t:i}=V(),{formatDate:a,formatTime:o}=jb(),s=h5e(),c=m5e(e.provider),l=e.start_time??e.start_date,u=l?a(new Date(l),`EEE, MMM d, yyyy`):null,d=e.is_all_day?i(`dashboard.all_day`):e.start_time&&e.end_time?`${o(new Date(e.start_time))} â ${o(new Date(e.end_time))}`:s(e);return(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsx)(`div`,{role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n?.())}
280,className:`cursor-pointer rounded hover:bg-muted/40 ${t?`opacity-50`:``}`,children:(0,K.jsxs)(`p`,{className:`text-sm leading-snug truncate`,children:[(0,K.jsx)(`span`,{className:`inline-block size-1.5 rounded-full mr-1.5 align-middle ${c}`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`tabular-nums`,children:s(e)}),` - `,e.title||i(`dashboard.no_title`)]})})}),(0,K.jsxs)(GT,{side:`left`,align:`start`,className:`max-w-sm space-y-1.5 text-left`,children:[(0,K.jsx)(`div`,{className:`font-medium text-sm`,children:e.title||i(`dashboard.no_title`)}),(0,K.jsx)(`div`,{className:`text-xs opacity-80`,children:u?`${u} · ${d}`:d}),e.location&&(0,K.jsxs)(`div`,{className:`text-xs opacity-80`,children:[(0,K.jsx)(`span`,{className:`opacity-60`,children:i(`dashboard.location_label`)}),` `,e.location]}),e.description&&(0,K.jsx)(`div`,{className:`text-xs whitespace-pre-wrap line-clamp-6 opacity-80`,children:e.description}),(0,K.jsxs)(`div`,{className:`text-[10px] opacity-60`,children:[i(YB.find(t=>t.id===e.provider)?.labelKey??`dashboard.provider_google`),r?` · ${r}`:``]})]})]})}function v5e({task:e,onToggle:t,onClick:n}){let{t:r}=V(),{formatDate:i}=jb(),a=e.status===`completed`,o=e.provider===`outlook`?e.body_content:e.notes,s=e.due_date;return(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n?.())},className:`flex gap-3 items-start cursor-pointer rounded p-1 -m-1 hover:bg-muted/40`,children:[(0,K.jsx)(`span`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:(0,K.jsx)(HB,{checked:a,onCheckedChange:t,className:`mt-0.5`})}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0 break-words space-y-0.5`,children:[(0,K.jsx)(`p`,{className:`text-sm leading-snug ${a?`line-through text-muted-foreground`:``}`,children:e.title||r(`common.untitled`)}),o&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-1`,children:o}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:s?i(new Date(s),`MMM d`):r(`dashboard.no_due_date`)})]})]})}function XB(){let{t:e}=V();jb();let t=Q(e=>e.openItemDetail),n=$x(e=>e.connected),r=$x(e=>e.fetchStatus),i=Xx(e=>e.connected),a=Xx(e=>e.fetchStatus),o=Qx(e=>e.caldavConnected),s=Qx(e=>e.fetchStatus),c=wP(),l=lHe(c),u=n?`outlook`:i?`google`:o?`caldav`:`google`,[d,f]=B.useState(new Date),[p,m]=B.useState([]),[h,g]=B.useState(!1),[_,v]=B.useState([]),[y,b]=B.useState(!1),[x,S]=B.useState([]),[C,w]=B.useState(!1),[T,E]=B.useState([]),[D,O]=B.useState(!1),[k,A]=B.useState(new Set),[j,M]=B.useState(``),[N,P]=B.useState([]),[F,I]=B.useState(!1),[L,ee]=B.useState([]),[R,te]=B.useState(!1),ne=B.useCallback(async(e,t)=>{t?.silent||g(!0);try{let t=(await UB({date:Tb(e,`yyyy-MM-dd`)})).data;m(t)}catch{t?.silent||m([])}finally{t?.silent||g(!1)}},[]),re=B.useCallback(async(e,t)=>{t?.silent||b(!0);try{v((await yge({date:Tb(e,`yyyy-MM-dd`)})).data??[])}catch{t?.silent||v([])}finally{t?.silent||b(!1)}},[]),ie=B.useCallback(async(e,t)=>{t?.silent||w(!0);try{S((await Z(`/api/v1/outlook-tasks?date=${Tb(e,`yyyy-MM-dd`)}`,{method:`GET`})).data??[])}catch{t?.silent||S([])}finally{t?.silent||w(!1)}},[]),z=B.useCallback(async(e,t)=>{t?.silent||O(!0);try{E((await Z(`/api/v1/caldav-tasks?date=${Tb(e,`yyyy-MM-dd`)}`,{method:`GET`})).data??[])}catch{t?.silent||E([])}finally{t?.silent||O(!1)}},[]),ae=B.useCallback(async(e,t)=>{try{let t=(await o5e({year:e.getFullYear(),month:e.getMonth()+1})).data;A(new Set(t))}catch{t?.silent||A(new Set)}},[]);B.useEffect(()=>{let e=new Date;ne(e),re(e),ie(e),z(e),ae(e),r(),a(),s()},[ne,re,ie,z,ae,r,a,s]);let oe=B.useRef(i),se=B.useRef(n),ce=B.useRef(o);B.useEffect(()=>{let e=oe.current,t=se.current,r=ce.current;oe.current=i,se.current=n,ce.current=o;let a=e&&!i,s=t&&!n,c=r&&!o;if(!a&&!s&&!c)return;a&&(m(e=>e.filter(e=>e.provider!==`google`)),v([])),s&&(m(e=>e.filter(e=>e.provider!==`outlook`)),S([])),c&&(m(e=>e.filter(e=>e.provider!==`caldav`)),E([]));let l=d??new Date;ne(l),ae(l),a&&re(l),s&&ie(l),c&&z(l)},[i,n,o,d,ne,ae,re,ie,z]),B.useEffect(()=>{let e=j.trim();if(!e){P([]),I(!1),ee([]),te(!1);return}I(!0),te(!0);let t=setTimeout(async()=>{let[t,n,r,i]=await Promise.allSettled([i5e({q:e}),xge({q:e}),c5e({q:e}),u5e({q:e})]);P(t.status===`fulfilled`?t.value.data:[]),I(!1);let a=n.status===`fulfilled`?(n.value.data??[]).map(e=>({...e,provider:`google`})):[],o=r.status===`fulfilled`?(r.value.data??[]).map(e=>({...e,provider:`outlook`})):[],s=i.status===`fulfilled`?(i.value.data??[]).map(e=>({...e,provider:`caldav`})):[];ee([...a,...o,...s]),te(!1)},300);return()=>clearTimeout(t)},[j]);let le=NS(e=>e.refreshNonce),ue=B.useRef(d);ue.current=d,B.useEffect(()=>{if(le===0)return;let e=ue.current??new Date;ne(e,{silent:!0}),re(e,{silent:!0}),ie(e,{silent:!0}),z(e,{silent:!0}),ae(e,{silent:!0})},[le,ne,re,ie,z,ae]);function de(e){f(e),e&&(ne(e),re(e),ie(e),z(e))}function fe(e){ae(e)}function pe(e,t){let n=t?`completed`:`needsAction`,r=t?`completed`:`notStarted`,i=t?`completed`:`needsAction`;e.provider===`google`?v(t=>t.map(t=>t.google_task_id===e.google_task_id?{...t,status:n}:t)):e.provider===`outlook`?S(t=>t.map(t=>t.outlook_task_id===e.outlook_task_id?{...t,status:r}:t)):E(t=>t.map(t=>
280t.id===e.id?{...t,status:i}:t)),ee(t=>t.map(t=>e.provider===`google`&&t.provider===`google`&&t.google_task_id===e.google_task_id?{...t,status:n}:e.provider===`outlook`&&t.provider===`outlook`&&t.outlook_task_id===e.outlook_task_id?{...t,status:r}:e.provider===`caldav`&&t.provider===`caldav`&&t.id===e.id?{...t,status:i}:t))}async function me(t){let n=t.status===`completed`,r=t.provider===`google`?t.google_task_id:t.provider===`outlook`?t.outlook_task_id:t.id;pe(t,!n);try{await fx(t.provider,r,!n)}catch(i){pe(t,n),Y(i,e(`errors.save_failed`),{operation:`dashboard_toggle_task`,metadata:{taskId:r,provider:t.provider}})}}let he=B.useMemo(()=>{let e=[];for(let t of k){let[n,r,i]=t.split(`-`).map(Number);e.push(new Date(n,r-1,i))}return{hasEvent:e}},[k]),[ge,_e]=B.useState(!1),[ve,ye]=B.useState(()=>new Date);B.useEffect(()=>{let e=setInterval(()=>ye(new Date),6e4);return()=>clearInterval(e)},[]),WB(B.useCallback(()=>{let e=d??new Date;ne(e,{silent:!0}),re(e,{silent:!0}),ie(e,{silent:!0}),z(e,{silent:!0}),ae(e,{silent:!0})},[d,ne,re,ie,z,ae]),{intervalMs:6e4});let be=j.trim().length>0,xe=!be&&hb(d||new Date),Se={google:i,outlook:n,caldav:o},Ce=be?N:p,we=YB.filter(e=>Se[e.id]||Ce.some(t=>t.provider===e.id)),Te=be?F:h,Ee=e(be?`dashboard.no_matching_events`:`dashboard.no_events`),De=d?Tb(d,`yyyy-MM-dd`):null,Oe=[..._.map(e=>({...e,provider:`google`})),...x.map(e=>({...e,provider:`outlook`})),...T.map(e=>({...e,provider:`caldav`}))].sort((e,t)=>(e.due_date===De?0:1)-(t.due_date===De?0:1)),ke=y||C||D,Ae=be?L:Oe,je=be?R:ke,Me=ge?Ae.filter(e=>e.status!==`completed`):Ae,Ne=Ce.length+Me.length;return(0,K.jsxs)(uz,{className:`@container/card`,children:[(0,K.jsx)(dz,{children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(fz,{children:e(be?`dashboard.search_results`:`dashboard.todays_schedule`)}),(0,K.jsx)(pz,{children:be?e(`dashboard.searching_description`):d?Tb(d,`EEEE, MMMM d, yyyy`):e(`dashboard.select_date`)})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(aP,{children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsx)(J,{variant:`outline`,children:e(`dashboard.time_on_site.title`)})}),(0,K.jsx)(sP,{className:`w-80`,children:d&&(0,K.jsx)(f5e,{date:d})})]}),(0,K.jsx)(lR,{variant:!be&&hb(d||new Date)?`default`:`outline`,children:Te||je?`â¦`:e(`dashboard.items`,{count:Ne})}),(0,K.jsx)(T6e,{provider:u,onEventCreated:()=>{let e=d||new Date;ne(e),re(e),ie(e),z(e),ae(e)}})]})]})}),(0,K.jsx)(mz,{className:`p-6`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 @lg/card:flex-row`,children:[(0,K.jsx)(`div`,{className:`self-center @lg/card:self-auto`,children:(0,K.jsx)(VB,{mode:`single`,selected:d,onSelect:de,onMonthChange:fe,modifiers:he,modifiersClassNames:{hasEvent:`after:absolute after:bottom-1 after:left-1/2 after:-translate-x-1/2 after:w-1 after:h-1 after:rounded-full after:bg-primary relative`},className:`rounded-md border`})}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`relative mb-3`,children:[(0,K.jsx)(A_,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 size-4 text-muted-foreground`}),(0,K.jsx)(dP,{placeholder:e(`dashboard.search_placeholder`),value:j,onChange:e=>M(e.target.value),className:`pl-8 h-8 text-sm`})]}),(0,K.jsxs)(`div`,{className:`flex gap-4`,children:[(0,K.jsxs)(`div`,{className:`@container/events flex-1 min-w-0`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2`,children:e(`dashboard.upcoming_events`)}),(0,K.jsxs)(IL,{className:`h-[300px] [&>[data-slot=scroll-area-viewport]>div]:block!`,children:[Te&&(0,K.jsx)(`div`,{className:`space-y-4`,children:[1,2,3].map(e=>(0,K.jsxs)(`div`,{className:`flex gap-3 items-stretch`,children:[(0,K.jsx)(`div`,{className:`flex items-center min-w-[12px] py-0.5`,children:(0,K.jsx)(LI,{className:`w-[3px] h-12 rounded-full`})}),(0,K.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,K.jsx)(LI,{className:`h-4 w-3/4`}),(0,K.jsx)(LI,{className:`h-5 w-24`}),(0,K.jsx)(LI,{className:`h-3 w-full`})]})]},e))}),!Te&&Ce.length===0&&(0,K.jsx)(`div`,{className:`flex h-[260px] items-center justify-center`,children:(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground text-center`,children:Ee})}),!Te&&Ce.length>0&&(0,K.jsx)(`div`,{className:`grid gap-y-3 ${p5e[we.length]??`grid-cols-1`}`,children:we.map(n=>{let r=Ce.filter(e=>e.provider===n.id),i=(e,n)=>(0,K.jsx)(_5e,{event:e,isPast:xe&&!!e.end_time&&new Date(e.end_time)<ve,onClick:()=>t(dXe(e)),accountEmail:n},e.id);return(0,K.jsxs)(`div`,{className:`space-y-1 pr-4`,children:[(0,K.jsx)(`span`,{className:`block truncate text-sm text-muted-foreground`,children:e(n.labelKey)}),l.has(n.id)?g5e(r).map(t=>(0,K.jsxs)(`div`,{className:`space-y-1`,children:[t.accountId!==null&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground
280/70`,children:EP(c,t.accountId)??e(`dashboard.account_unknown`)}),t.events.map(e=>i(e,EP(c,e.account_id??null)))]},t.accountId??`__none__`)):r.map(e=>i(e))]},n.id)})})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e(`dashboard.tasks`)}),(0,K.jsx)(`button`,{onClick:()=>_e(e=>!e),title:e(ge?`dashboard.show_completed`:`dashboard.hide_completed`),className:`text-muted-foreground hover:text-foreground transition-colors`,children:ge?(0,K.jsx)(t_,{className:`size-3.5`}):(0,K.jsx)(e_,{className:`size-3.5`})})]}),(0,K.jsxs)(IL,{className:`h-[300px] [&>[data-slot=scroll-area-viewport]>div]:block!`,children:[je&&(0,K.jsx)(`div`,{className:`space-y-3`,children:[1,2].map(e=>(0,K.jsxs)(`div`,{className:`flex gap-3 items-center`,children:[(0,K.jsx)(LI,{className:`size-4 rounded`}),(0,K.jsx)(LI,{className:`h-4 flex-1`})]},e))}),!je&&Me.length===0&&(0,K.jsx)(`div`,{className:`flex h-[260px] items-center justify-center`,children:(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground text-center`,children:e(be?`dashboard.no_matching_tasks`:ge?`dashboard.no_incomplete_tasks`:`dashboard.no_tasks`)})}),!je&&Me.length>0&&(0,K.jsx)(`div`,{className:`space-y-3 pr-4`,children:Me.map(e=>(0,K.jsx)(v5e,{task:e,onToggle:()=>me(e),onClick:()=>t({...fXe(e),onStatusChange:t=>pe(e,t)})},e.id))})]})]})]})]})]})})]})}function y5e(){return[0,1,2,3,4].map(e=>({day_of_week:e,start_minute:540,end_minute:1020}))}function b5e(){let{t:e}=V(),t=Sv(),n=[e(`booking.weekdays.short.mon`),e(`booking.weekdays.short.tue`),e(`booking.weekdays.short.wed`),e(`booking.weekdays.short.thu`),e(`booking.weekdays.short.fri`),e(`booking.weekdays.short.sat`),e(`booking.weekdays.short.sun`)],{links:r,isLoading:i,error:a,fetchLinks:o,update:s,create:c,fetchCalendars:l}=nR(),u=Xx(e=>e.initialized),d=Xx(e=>e.fetchStatus),f=Xx(e=>e.connect),p=$x(e=>e.initialized),m=$x(e=>e.fetchStatus),h=Qx(e=>e.initialized),g=Qx(e=>e.fetchStatus),_=wP(),[v,y]=(0,B.useState)(!1),[b,x]=(0,B.useState)(!1),[S,C]=(0,B.useState)(null),[w,T]=(0,B.useState)([]),[E,D]=(0,B.useState)(null),[O,k]=(0,B.useState)({name:`30-min intro`,duration_minutes:30,timezone:jz(Intl.DateTimeFormat().resolvedOptions().timeZone),provider:`google`,account_id:null,calendar_id:`primary`,weekly_rules:y5e()}),A=TP(_,S)??DP(_,`google`);(0,B.useEffect)(()=>{o()},[o]),(0,B.useEffect)(()=>{u||d()},[u,d]),(0,B.useEffect)(()=>{p||m()},[p,m]),(0,B.useEffect)(()=>{h||g()},[h,g]);let j=A?.provider===`google`&&A.calendarScopeOk===!1,M=u&&p&&h&&_.length===0;async function N(t){if(T([]),D(null),k(e=>({...e,provider:t.provider,account_id:t.accountId,calendar_id:`primary`})),t.isPrimary)try{let e=await l(t.provider);if(T(e),e.length>0){let t=e.find(e=>e.primary)??e[0];k(e=>({...e,calendar_id:t.id}))}}catch(t){D(Gb(t,e(`toasts.common.load_failed`),{operation:`booking.fetchCalendars`}))}}function P(e){let t=TP(_,e);t&&(C(e),N(t))}async function F(){x(!0);try{let n=await c(O);y(!1),G.success(e(`toasts.booking.link_created`)),t(`/booking/${n.id}`)}catch(t){Y(t,e(`toasts.booking.link_create_failed`),{operation:`booking.link.create`})}finally{x(!1)}}async function I(n){try{let r=await c(n);G.success(e(`toasts.booking.link_created`)),t(`/booking/${r.id}`)}catch(t){throw Y(t,e(`toasts.booking.link_create_failed`),{operation:`booking_ai_create`}),t}}return(0,K.jsxs)(`div`,{className:`mx-auto max-w-5xl px-6 py-8`,children:[(0,K.jsx)(`div`,{className:`mb-6`,children:(0,K.jsx)(XB,{})}),(0,K.jsxs)(`div`,{className:`mb-6 flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-2xl font-semibold`,children:e(`booking.title`)}),(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e(`booking.description`)})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(w6e,{onConfirm:I,disabled:M}),(0,K.jsx)($T,{i18nKey:`tour.booking.new`,side:`left`,children:(0,K.jsx)(J,{disabled:M,onClick:()=>{y(!0),!w.length&&A&&N(A)},children:e(`booking.new_link`)})})]})]}),a&&(0,K.jsx)(`div`,{className:`bg-destructive/10 text-destructive mb-4 rounded-md p-3 text-sm`,children:a}),M&&(0,K.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3 rounded-md border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:[(0,K.jsx)(`span`,{children:e(`settings.integrations.scope_missing`)}),(0,K.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>t(`/settings/integrations`),children:e(`common.settings`)})]}),j&&(0,K.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3 rounded-md border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:[(0,K.jsx)(`span`,{children:e(`settings.integrations.scope_missing`)}),(0,K.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>f(),children:e(`settings.integrations.reauthorize`)})]}),v&&(0,K.jsxs)(uz,{className:`mb-6`,children:[(0,K.jsx)(dz,{children:(0,K.jsx)(fz,{children:e(`booking.new_link`)})}),(0,K.jsxs)(mz,{className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{htmlFor:`name`,children:e(`booking.fields.name`)}),(0,K.jsx)(dP,{id:`name`,value:O.name,onChange:e=>k({...O,name:e.target.value})})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{htmlFor:`duration`,children:e(`booking.fields.duration_minutes`)}),(0,K.jsx)(dP,{id:`duration`,type:`number`,value:O.duration_minutes,onChange:e=>k({...O,duration_minutes:Number(e.target.value)||30})})]}),(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{children:e(`booking.fields.timezone`)}
280),(0,K.jsx)(Fz,{value:O.timezone,onChange:e=>k({...O,timezone:e})})]})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{children:e(`booking.fields.account`)}),(0,K.jsxs)(vO,{value:A?.accountId??``,onValueChange:P,children:[(0,K.jsx)(bO,{children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:_.map(t=>(0,K.jsxs)(SO,{value:t.accountId,children:[t.email,` ·`,` `,e(CP[t.provider])]},t.accountId))})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{children:e(`dashboard.calendar`)}),(0,K.jsxs)(vO,{value:O.calendar_id,onValueChange:e=>k({...O,calendar_id:e}),disabled:A?!A.isPrimary:!1,children:[(0,K.jsx)(bO,{children:(0,K.jsx)(yO,{placeholder:w.length?e(`common.select`):e(`common.loading`)})}),(0,K.jsxs)(xO,{children:[(0,K.jsx)(SO,{value:`primary`,children:e(`personas.default`)}),w.map(e=>(0,K.jsxs)(SO,{value:e.id,children:[e.summary,e.primary?` (â
)`:``]},e.id))]})]}),A&&!A.isPrimary&&(0,K.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:e(`booking.non_primary_calendar_hint`)}),E&&(0,K.jsx)(`p`,{className:`text-destructive text-xs`,children:E})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{children:e(`booking.fields.availability`)}),(0,K.jsx)(`div`,{className:`text-muted-foreground flex flex-wrap gap-2 text-xs`,children:(O.weekly_rules??[]).map((e,t)=>(0,K.jsxs)(`span`,{className:`bg-muted rounded px-2 py-1`,children:[n[e.day_of_week],` `,Math.floor(e.start_minute/60),`:`,String(e.start_minute%60).padStart(2,`0`),`â`,Math.floor(e.end_minute/60),`:`,String(e.end_minute%60).padStart(2,`0`)]},t))})]}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,K.jsx)(J,{variant:`outline`,onClick:()=>y(!1),disabled:b,children:e(`common.cancel`)}),(0,K.jsx)(J,{onClick:F,disabled:b,children:e(b?`common.creating`:`common.create`)})]})]})]}),i&&(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e(`common.loading`)}),!i&&r.length===0&&!M&&(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e(`booking.no_links`)}),(0,K.jsx)($T,{i18nKey:`tour.booking.list`,side:`left`,children:(0,K.jsx)(`div`,{className:`grid gap-3`,children:r.map(t=>(0,K.jsx)(uz,{className:q(!t.active&&`opacity-60`),children:(0,K.jsxs)(mz,{className:`flex items-center justify-between p-4`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(Gv,{to:`/booking/${t.id}`,className:`text-base font-medium hover:underline`,children:t.name}),(0,K.jsxs)(`p`,{className:`text-muted-foreground truncate text-xs`,children:[t.duration_minutes,` min ·`,` `,EP(_,t.account_id??null)??t.provider,` `,`· `,t.timezone]}),t.public_url&&(0,K.jsx)(`a`,{href:t.public_url,target:`_blank`,rel:`noreferrer`,className:`text-primary mt-1 inline-block text-xs hover:underline`,children:t.public_url})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(mP,{checked:t.active,onCheckedChange:async n=>{try{await s(t.id,{active:n})}catch(t){Y(t,e(`toasts.common.update_failed`),{operation:`booking.link.toggle_active`})}}}),(0,K.jsx)(`span`,{className:`text-muted-foreground w-12 text-xs`,children:t.active?e(`settings.integrations.connected`):e(`common.no`)})]})]})},t.id))})})]})}const ZB=1440;function QB(e){return e/60*48}function $B(e,t=!0){let n=e/48*60;return t?Math.max(0,Math.min(ZB,Math.round(n/15)*15)):Math.max(0,Math.min(ZB,Math.round(n)))}function eV(e){return Math.max(0,Math.min(ZB,e))}function tV(e){let t=e.getDay();return Yy(Hy(e,t===0?-6:1-t))}function x5e(e){return Array.from({length:7},(t,n)=>Hy(e,n))}function nV(e){let t=e.getDay();return t===0?6:t-1}function rV(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function iV(e){return e.getHours()*60+e.getMinutes()}function aV(e,t){return`${oV(e)} â ${oV(t)}`}function oV(e){let t=Math.floor(e/60),n=e%60,r=t>=12?`PM`:`AM`;return`${t===0?12:t>12?t-12:t}:${String(n).padStart(2,`0`)} ${r}`}var S5e=Array.from({length:24},(e,t)=>t);function C5e(e){return e===0?`12 AM`:e===12?`12 PM`:e<12?`${e} AM`:`${e-12} PM`}function w5e(){return(0,K.jsx)(`div`,{className:`relative w-14 shrink-0 border-r`,style:{height:1152}
280,"aria-hidden":!0,children:S5e.map(e=>(0,K.jsx)(`div`,{className:`text-muted-foreground absolute right-2 -translate-y-1/2 text-[10px] tabular-nums`,style:{top:e*48},children:C5e(e)},e))})}function T5e({event:e}){let t=QB(e.startMin);return(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsxs)(`div`,{className:`pointer-events-auto absolute z-10 overflow-hidden rounded-sm border border-gray-400/40 bg-gray-300/30 px-1.5 py-0.5 text-[10px] leading-tight text-gray-700 dark:border-gray-500/50 dark:bg-gray-500/20 dark:text-gray-200`,style:{top:t,height:Math.max(8,QB(e.endMin)-t),left:0,right:0,backgroundImage:`repeating-linear-gradient(135deg, transparent 0 4px, rgba(0,0,0,0.06) 4px 6px)`},children:[(0,K.jsx)(`div`,{className:`truncate font-medium`,children:e.title||`(No title)`}),(0,K.jsx)(`div`,{className:`text-[9px] tabular-nums opacity-80`,children:aV(e.startMin,e.endMin)})]})}),(0,K.jsxs)(GT,{side:`right`,className:`max-w-xs`,children:[(0,K.jsx)(`div`,{className:`font-medium`,children:e.title||`(No title)`}),(0,K.jsx)(`div`,{className:`text-xs tabular-nums opacity-90`,children:aV(e.startMin,e.endMin)}),(0,K.jsx)(`div`,{className:`text-muted-foreground mt-1 text-[10px]`,children:`Calendar event â bookers won't see these times.`})]})]})}function E5e({rule:e,dayLabel:t,conflict:n,onMouseDownBody:r,onMouseDownTop:i,onMouseDownBottom:a,onDelete:o}){let s=QB(e.startMin),c=Math.max(16,QB(e.endMin)-s);return(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsxs)(`div`,{className:q(`group pointer-events-auto absolute z-20 cursor-grab select-none overflow-hidden rounded-sm border bg-primary/15 text-[10px] leading-tight active:cursor-grabbing`,`border-primary/70 text-primary-foreground/90`),style:{top:s,height:c,left:0,right:0},onMouseDown:r,role:`button`,tabIndex:0,children:[(0,K.jsx)(`div`,{className:`absolute inset-x-0 top-0 z-30 h-1.5 cursor-ns-resize hover:bg-primary/40`,onMouseDown:e=>{e.stopPropagation(),i(e)},"aria-label":`Resize start`}),(0,K.jsxs)(`div`,{className:`text-primary px-1.5 py-0.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[n&&(0,K.jsx)(H_,{className:`size-2.5 text-amber-600`,"data-testid":`rule-conflict-indicator`}),(0,K.jsx)(`span`,{className:`truncate font-medium`,children:`Weekly hours`})]}),(0,K.jsx)(`div`,{className:`text-[9px] tabular-nums opacity-80`,children:aV(e.startMin,e.endMin)})]}),(0,K.jsx)(`button`,{type:`button`,className:`absolute right-0.5 top-0.5 z-30 hidden size-4 items-center justify-center rounded-sm bg-white/60 text-primary hover:bg-white group-hover:flex dark:bg-black/30 dark:text-primary-foreground dark:hover:bg-black/60`,onMouseDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),o()},"aria-label":`Delete weekly hours`,children:(0,K.jsx)(J_,{className:`size-2.5`})}),(0,K.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 z-30 h-1.5 cursor-ns-resize hover:bg-primary/40`,onMouseDown:e=>{e.stopPropagation(),a(e)},"aria-label":`Resize end`})]})}),(0,K.jsxs)(GT,{side:`right`,className:`max-w-xs`,children:[(0,K.jsxs)(`div`,{className:`font-medium`,children:[`Weekly hours · every `,t]}),(0,K.jsx)(`div`,{className:`text-xs tabular-nums opacity-90`,children:aV(e.startMin,e.endMin)}),n&&(0,K.jsx)(`div`,{className:`mt-1 text-[10px] text-amber-600`,children:`Calendar event overlaps â those minutes won't be offered to bookers.`})]})]})}function D5e({override:e,dateLabel:t,onMouseDownBody:n,onMouseDownTop:r,onMouseDownBottom:i,onDelete:a,onToggleKind:o}){let s=QB(e.startMin),c=Math.max(16,QB(e.endMin)-s),l=e.available;return(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsxs)(`div`,{className:q(`group pointer-events-auto absolute z-20 cursor-grab select-none overflow-hidden rounded-sm border border-dashed text-[10px] leading-tight active:cursor-grabbing`,l?`border-emerald-500 bg-emerald-500/15 text-emerald-800 dark:text-emerald-200`:`border-red-500 bg-red-500/10 text-red-800 dark:text-red-200`),style:{top:s,height:c,left:0,right:0,backgroundImage:l?void 0:`repeating-linear-gradient(135deg, transparent 0 4px, rgba(239,68,68,0.15) 4px 7px)`},onMouseDown:n,role:`button`,tabIndex:0,children:[(0,K.jsx)(`div`,{className:`absolute inset-x-0 top-0 z-30 h-1.5 cursor-ns-resize hover:bg-black/10`,onMouseDown:e=>{e.stopPropagation(),r(e)},"aria-label":`Resize start`}),(0,K.jsxs)(`div`,{className:`px-1.5 py-0.5`,children:[(0,K.jsx)(`div`,{className:`truncate font-medium`,children:l?`Extra availability`:`Blocked`}),(0,K.jsx)(`div`,{className:`text-[9px] tabular-nums opacity-80`,children:aV(e.startMin,e.endMin)})]}),(0,K.jsxs)(`div`,{className:`absolute right-0.5 top-0.5 z-30 hidden gap-0.5 group-hover:flex`,children:[(0,K.jsx)(`button`,{type:`button`,className:`size-4 rounded-sm bg-white/70 px-0.5 text-[8px] font-semibold text-gray-700 hover:bg-white dark:bg-black/30 dark:text-gray-200 dark:hover:bg-black/60`,onMouseDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),o()},title:l?`Flip to blocked`:`Flip to available`,children:`â`}),(0,K.jsx)(`button`,{type:`button`,className:`size-4 flex items-center justify-center rounded-sm bg-white/70 hover:bg-white dark:bg-black/30 dark:hover:bg-black/60`,onMouseDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),a()},"aria-label":`Delete override`,children:(0,K.jsx)(J_,{className:`size-2.5`})})]}),(0,K.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 z-30 h-1.5 cursor-ns-resize hover:bg-black/10`,onMouseDown:e=>{e.stopPropagation(),i(e)},"aria-label":`Resize end`})]})}),(0,K.jsxs)(GT,{side:`right`,className:`max-w-xs`,children:[(0,K.jsxs)(`div`,{className:`font-medium`,children:[l?`Extra availability`:`Blocked`,` · `,t]}),(0,K.jsx)(`div`,{className:`text-xs tabular-nums opacity-90`,children:aV(e.startMin,e.endMin)}),(0,K.jsxs)(`div`,{className:`text-muted-foreground mt-1 text-[10px]`,children:[`Date-specific override â only affects `,t,`.`]})]})]})}function O5e({booking:e,onClick:t}){let n=QB(e.startMin);return(0,K.jsxs)(`button`,{type:`button`,className:`pointer-events-auto absolute z-30 overflow-hidden rounded-sm border border-primary bg-primary/60 px-1.5 py-0.5 text-[10px] leading-tight text-primary-foreground shadow hover:bg-primary/70 focus:outline-none focus:ring-2 focus:ring-primary/40`,style:{to
280p:n,height:Math.max(16,QB(e.endMin)-n),left:0,right:0},onClick:e=>{e.stopPropagation(),t()},onMouseDown:e=>e.stopPropagation(),children:[(0,K.jsx)(`div`,{className:`truncate font-medium`,children:e.recipientName}),(0,K.jsx)(`div`,{className:`text-[9px] tabular-nums opacity-90`,children:aV(e.startMin,e.endMin)})]})}function k5e({startMin:e,endMin:t,variant:n,label:r}){let i=QB(e),a=Math.max(8,QB(t)-i);return(0,K.jsxs)(`div`,{className:q(`pointer-events-none absolute z-40 overflow-hidden rounded-sm border-2 px-1.5 py-0.5 text-[10px] leading-tight`,n===`rule`&&`border-primary bg-primary/30 text-primary`,n===`override-available`&&`border-emerald-500 bg-emerald-500/30 text-emerald-900 dark:text-emerald-100 border-dashed`,n===`override-unavailable`&&`border-red-500 bg-red-500/20 text-red-900 dark:text-red-100 border-dashed`),style:{top:i,height:a,left:0,right:0},children:[(0,K.jsx)(`div`,{className:`truncate font-medium`,children:r}),(0,K.jsx)(`div`,{className:`text-[9px] tabular-nums opacity-80`,children:aV(e,t)})]})}var sV=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`];function A5e({date:e,isToday:t,rules:n,overrides:r,events:i,bookings:a,activeDrag:o,onStartDrag:s,onBookingClick:c,onDeleteRule:l,onDeleteOverride:u,onToggleOverrideKind:d,hasRuleConflict:f}){let p=nV(e),m=fb(e,`yyyy-MM-dd`),h=fb(e,`EEE MMM d`);function g(e){e.button===0&&(e.target.closest(`[data-block]`)||s({kind:`create`,dayOfWeek:p,dateISO:m},e))}let _=n.length>0||r.length>0||o!==null&&cV(o,p,m),v=[...n.map(e=>({startMin:e.startMin,endMin:e.endMin})),...r.map(e=>({startMin:e.startMin,endMin:e.endMin}))],y=(e,t)=>v.some(n=>e<n.endMin&&t>n.startMin),b=o&&(o.intent.kind===`move-rule`||o.intent.kind===`resize-rule`)&&o.intent.dayOfWeek===p?o.intent.ruleIndex:null,x=o&&(o.intent.kind===`move-override`||o.intent.kind===`resize-override`)&&o.intent.dateISO===m?o.intent.overrideIndex:null;return(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col border-r last:border-r-0`,children:[(0,K.jsxs)(`div`,{className:q(`sticky top-0 z-50 border-b bg-background px-1 py-1 text-center text-[11px]`,t&&`text-primary font-semibold`),children:[(0,K.jsx)(`div`,{className:`text-muted-foreground`,children:sV[p]}),(0,K.jsx)(`div`,{className:q(`text-sm`,t&&`rounded bg-primary/15 px-1`),children:fb(e,`MMM d`)})]}),(0,K.jsxs)(`div`,{"data-day-column":!0,className:`relative flex-1 cursor-crosshair select-none`,style:{height:1152},onMouseDown:g,children:[Array.from({length:24},(e,t)=>(0,K.jsx)(`div`,{className:q(`absolute inset-x-0 border-t`,t%6==0?`border-border`:`border-border/40`),style:{top:t*48},"aria-hidden":!0},t)),_&&(0,K.jsxs)(`div`,{className:`absolute inset-y-0 left-0`,style:{right:`80%`},children:[n.map(e=>e.ruleIndex===b?null:(0,K.jsx)(`div`,{"data-block":!0,children:(0,K.jsx)(E5e,{rule:e,dayLabel:sV[p],conflict:f(e),onMouseDownBody:t=>{t.stopPropagation(),s({kind:`move-rule`,ruleIndex:e.ruleIndex,originalStart:e.startMin,originalEnd:e.endMin,dayOfWeek:p},t)},onMouseDownTop:t=>s({kind:`resize-rule`,ruleIndex:e.ruleIndex,edge:`top`,anchorMin:e.endMin,dayOfWeek:p},t),onMouseDownBottom:t=>s({kind:`resize-rule`,ruleIndex:e.ruleIndex,edge:`bottom`,anchorMin:e.startMin,dayOfWeek:p},t),onDelete:()=>l(e.ruleIndex)})},`r-${e.ruleIndex}`)),r.map(e=>e.overrideIndex===x?null:(0,K.jsx)(`div`,{"data-block":!0,children:(0,K.jsx)(D5e,{override:e,dateLabel:h,onMouseDownBody:t=>{t.stopPropagation(),s({kind:`move-override`,overrideIndex:e.overrideIndex,originalStart:e.startMin,originalEnd:e.endMin,dateISO:m},t)},onMouseDownTop:t=>s({kind:`resize-override`,overrideIndex:e.overrideIndex,edge:`top`,anchorMin:e.endMin,dateISO:m},t),onMouseDownBottom:t=>s({kind:`resize-override`,overrideIndex:e.overrideIndex,edge:`bottom`,anchorMin:e.startMin,dateISO:m},t),onDelete:()=>u(e.overrideIndex),onToggleKind:()=>d(e.overrideIndex)})},`o-${e.overrideIndex}`)),o&&cV(o,p,m)&&(0,K.jsx)(k5e,{startMin:o.startMin,endMin:o.endMin,variant:j5e(o),label:N5e(o,sV[p],h)})]}),i.map(e=>(0,K.jsx)(`div`,{className:`absolute inset-y-0 right-0`,style:{left:y(e.startMin,e.endMin)?`20%`:0},"data-block":!0,children:(0,K.jsx)(T5e,{event:e})},e.id)),a.map(e=>(0,K.jsx)(`div`,{className:`absolute inset-y-0 right-0`,style:{left:y(e.startMin,e.endMin)?`20%`:0},"data-block":!0,children:(0,K.jsx)(O5e,{booking:e,onClick:()=>c(e.id)})},e.id)),t&&(0,K.jsx)(M5e,{})]})]})}function cV(e,t,n){let r=e.intent;return r.kind===`create`?r.dayOfWeek===t&&r.dateISO===n:r.kind===`move-rule`||r.kind===`resize-rule`?r.dayOfWeek===t:r.kind===`move-override`||r.kind===`resize-override`?r.dateISO===n:!1}function j5e(e){let t=e.intent;return t.kind===`create`?e.shift?`override-available`:`rule`:t.kind===`move-rule`||t.kind===`resize-rule`?`rule`:`override-available`}function M5e(){let[e,t]=(0,B.useState)(()=>iV(new Date));return(0,B.useEffect)(()=>{let e=setInterval(()=>t(iV(new Date)),6e4);return()=>clearInterval(e)},[]),(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 z-30 border-t-2 border-red-500`,style:{to
280p:QB(e)},"aria-hidden":!0,children:(0,K.jsx)(`span`,{className:`absolute -left-1 -top-1.5 size-2.5 rounded-full bg-red-500`})})}function N5e(e,t,n){let r=e.intent;return r.kind===`create`?e.shift?`Override on ${n}`:`Weekly · every ${t}`:r.kind===`move-rule`||r.kind===`resize-rule`?`Weekly · every ${t}`:`Override · ${n}`}var P5e=[`free`,`working_elsewhere`];function F5e(e){let t=e.show_as??`busy`;return!P5e.includes(t)}function I5e({onCommit:e,onCancel:t}){let[n,r]=(0,B.useState)(null),i=(0,B.useRef)(null),a=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{a.current=n},[n]);let o=(0,B.useCallback)((e,t)=>{let n=t.currentTarget.closest(`[data-day-column]`)??t.currentTarget,o=n.getBoundingClientRect(),s=eV($B(t.clientY-o.top+n.scrollTop)),c=s,l=s+15;e.kind===`move-rule`||e.kind===`move-override`?(c=e.originalStart,l=e.originalEnd):(e.kind===`resize-rule`||e.kind===`resize-override`)&&(e.edge===`top`?(c=s,l=e.anchorMin):(c=e.anchorMin,l=s)),i.current={intent:e,columnRect:o,downMinute:s};let u={intent:e,startMin:c,endMin:l,cursorX:t.clientX,cursorY:t.clientY,shift:t.shiftKey};a.current=u,r(u),t.preventDefault()},[]);return(0,B.useEffect)(()=>{if(!n)return;function o(e){let t=i.current;return t?eV($B(e-t.columnRect.top)):0}function s(e){let t=i.current,n=a.current;if(!t||!n)return;let s=o(e.clientY),c=n.startMin,l=n.endMin;if(t.intent.kind===`create`)s<t.downMinute?(c=s,l=t.downMinute+15):(c=t.downMinute,l=Math.max(s,t.downMinute+15));else if(t.intent.kind===`move-rule`||t.intent.kind===`move-override`){let e=s-t.downMinute,n=t.intent.originalEnd-t.intent.originalStart,r=t.intent.originalStart+e;r<0&&(r=0),r+n>1440&&(r=1440-n),r=Math.round(r/15)*15,c=r,l=r+n}else (t.intent.kind===`resize-rule`||t.intent.kind===`resize-override`)&&(t.intent.edge===`top`?(c=Math.min(s,t.intent.anchorMin-15),l=t.intent.anchorMin):(c=t.intent.anchorMin,l=Math.max(s,t.intent.anchorMin+15)));let u={...n,startMin:c,endMin:l,cursorX:e.clientX,cursorY:e.clientY,shift:e.shiftKey};a.current=u,r(u)}function c(){let t=a.current;t&&e(t),i.current=null,a.current=null,r(null)}function l(e){if(e.key===`Escape`)i.current=null,a.current=null,r(null),t?.();else if(e.key===`Shift`){let e=a.current;if(e){let t={...e,shift:!0};a.current=t,r(t)}}}function u(e){if(e.key===`Shift`){let e=a.current;if(e){let t={...e,shift:!1};a.current=t,r(t)}}}return window.addEventListener(`mousemove`,s),window.addEventListener(`mouseup`,c),window.addEventListener(`keydown`,l),window.addEventListener(`keyup`,u),()=>{window.removeEventListener(`mousemove`,s),window.removeEventListener(`mouseup`,c),window.removeEventListener(`keydown`,l),window.removeEventListener(`keyup`,u)}},[n,e,t]),{active:n,startDrag:o}}function L5e({weeklyRules:e,overrides:t,bookings:n,onChangeRules:r,onChangeOverrides:i,onBookingClick:a}){let[o,s]=(0,B.useState)(()=>tV(new Date)),[c,l]=(0,B.useState)([]),[u,d]=(0,B.useState)(!1),f=(0,B.useRef)(null),p=(0,B.useMemo)(()=>x5e(o),[o]),m=new Date;(0,B.useEffect)(()=>{let e=!1,t=o,n=Hy(o,7),r={from:t.toISOString(),to:n.toISOString()};return d(!0),UB(r).then(t=>{e||l(t.data)}).catch(()=>{e||l([])}).finally(()=>{e||d(!1)}),()=>{e=!0}},[o]),(0,B.useEffect)(()=>{f.current&&(f.current.scrollTop=336)},[]),(0,B.useEffect)(()=>{function e(e){e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||(e.key===`ArrowLeft`?s(e=>Hy(e,-7)):e.key===`ArrowRight`&&s(e=>Hy(e,7)))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let{active:h,startDrag:g}=I5e({onCommit:(0,B.useCallback)(n=>{if(n.endMin-n.startMin<15)return;let a=n.intent;if(a.kind===`create`)if(n.shift){let[e,r,o]=a.dateISO.split(`-`).map(e=>parseInt(e,10)),s=new Date(e,r-1,o,0,0,0,0),c=new Date(s.getTime()+n.startMin*6e4),l=new Date(s.getTime()+n.endMin*6e4);i([...t,{start_time:c.toISOString(),end_time:l.toISOString(),kind:`available`}])}else r([...e,{day_of_week:a.dayOfWeek,start_minute:n.startMin,end_minute:n.endMin}]);else a.kind===`move-rule`||a.kind===`resize-rule`?r(e.map((e,t)=>t===a.ruleIndex?{...e,start_minute:n.startMin,end_minute:n.endMin}:e)):(a.kind===`move-override`||a.kind===`resize-override`)&&i(t.map((e,t)=>{if(t!==a.overrideIndex)return e;let r=new Date(e.start_time);r.setHours(0,0,0,0);let i=new Date(r.getTime()+n.startMin*6e4),o=new Date(r.getTime()+n.endMin*6e4);return{...e,start_time:i.toISOString(),end_time:o.toISOString()}}))},[t,e,i,r])}),_=(0,B.useMemo)(()=>{let e={};for(let t of c){if(!F5e(t))continue;let n=t.is_all_day?t.start_date?new Date(`${t.start_date}T00:00:00`):null:t.start_time?new Date(t.start_time):null,r=t.is_all_day?t.end_date?new Date(`${t.end_date}T00:00:00`):null:t.end_time?new Date(t.end_time):null;if(!(!n||!r))for(let i of p){let a=new Date(i);a.setHours(0,0,0,0);let o=new Date(a);if(o.setDate(o.getDate()+1),r<=a||n>=o)continue;let s=n<a?a:n,c=r>o?o:r,l=fb(i,`yyyy-MM-dd`);(e[l]??=[]).push({kind:`calendar`,id:t.is_all_day?`${t.id}-${l}`:t.id,title:t.title??``,startMin:iV(s),endMin:c.getTime()===o.getTime()?1440:iV(c),isAllDay:t.is_all_day,provider:t.provider})}}return e},[c,p]),v=(0,B.useMemo)(()=>{let t={};return e.forEach((e,n)=>{(t[e.day_of_week]??=[]).push({kind:`rule`,ruleIndex:n,dayOfWeek:e.day_of_week,startMin:e.start_minute,endMin:e.end_minute})}),t},[e]),y=(0,B.useMemo)(()=>{let e={};return t.forEach((t,n)=>{let r=new Date(t.start_time),i=new Date(t.end_time),a=fb(r,`yyyy-MM-dd`);(e[a]??=[]).push({kind:`override`,overrideIndex:n,dateISO:a,startMin:iV(r),endMin:rV(r,i)&&iV(i)>0?iV(i):1440,available:t.kind===`available`})}),e},[t]),b=(0,B.useMemo)(()=>{let e={};
280return n.forEach(t=>{if(t.status!==`confirmed`)return;let n=new Date(t.start_time),r=new Date(t.end_time),i=fb(n,`yyyy-MM-dd`);(e[i]??=[]).push({kind:`booking`,id:t.id,recipientName:t.recipient_name,recipientEmail:t.recipient_email,status:t.status,startMin:iV(n),endMin:rV(n,r)&&iV(r)>0?iV(r):1440})}),e},[n]),x=(0,B.useCallback)(e=>{for(let t of p){if(nV(t)!==e.dayOfWeek)continue;let n=_[fb(t,`yyyy-MM-dd`)]??[];for(let t of n)if(t.endMin>e.startMin&&t.startMin<e.endMin)return!0}return!1},[p,_]),S=(0,B.useCallback)(t=>{r(e.filter((e,n)=>n!==t))},[r,e]),C=(0,B.useCallback)(e=>{i(t.filter((t,n)=>n!==e))},[i,t]),w=(0,B.useCallback)(e=>{i(t.map((t,n)=>n===e?{...t,kind:t.kind===`available`?`unavailable`:`available`}:t))},[i,t]),T=(0,B.useCallback)(e=>{let t=n.find(t=>t.id===e);t&&a(t)},[n,a]),E=`${fb(p[0],`MMM d`)} â ${fb(p[6],`MMM d, yyyy`)}`;return(0,K.jsxs)(HT,{delayDuration:300,children:[(0,K.jsxs)(`div`,{className:`flex flex-col overflow-hidden rounded-lg border`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between border-b bg-muted/30 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>s(e=>Hy(e,-7)),"aria-label":`Previous week`,children:(0,K.jsx)(zg,{className:`size-4`})}),(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:()=>s(tV(new Date)),children:[(0,K.jsx)(Pg,{className:`size-3.5`}),`Today`]}),(0,K.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>s(e=>Hy(e,7)),"aria-label":`Next week`,children:(0,K.jsx)(Bg,{className:`size-4`})}),(0,K.jsx)(`div`,{className:`ml-2 text-sm font-medium`,children:E})]}),(0,K.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:u?`Loading eventsâ¦`:`Drag to add hours · Shift-drag for date overrides`})]}),(0,K.jsx)(`div`,{ref:f,className:`relative max-h-[640px] overflow-y-auto`,children:(0,K.jsxs)(`div`,{className:`flex`,children:[(0,K.jsx)(w5e,{}),(0,K.jsx)(`div`,{className:`flex flex-1 min-w-0`,children:p.map(e=>{let t=nV(e),n=fb(e,`yyyy-MM-dd`);return(0,K.jsx)(A5e,{date:e,isToday:rV(e,m),rules:v[t]??[],overrides:y[n]??[],events:_[n]??[],bookings:b[n]??[],activeDrag:h,onStartDrag:g,onBookingClick:T,onDeleteRule:S,onDeleteOverride:C,onToggleOverrideKind:w,hasRuleConflict:x},n)})})]})}),(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-3 border-t bg-muted/30 px-3 py-1.5 text-[10px]`,children:[(0,K.jsx)(lV,{swatch:`bg-primary/30 border-primary`,label:`Weekly hours`}),(0,K.jsx)(lV,{swatch:`bg-emerald-500/20 border-emerald-500 border-dashed`,label:`Override · available`}),(0,K.jsx)(lV,{swatch:`bg-red-500/15 border-red-500 border-dashed`,label:`Override · blocked`}),(0,K.jsx)(lV,{swatch:`bg-gray-300/40 border-gray-400/60`,label:`Calendar event`}),(0,K.jsx)(lV,{swatch:`bg-primary/60 border-primary`,label:`Booking`})]})]}),(0,K.jsxs)(`div`,{className:`sr-only`,children:[`Default view: `,7,`:00 â `,21,`:00`]})]})}function lV({swatch:e,label:t}){return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`inline-block size-3 rounded border ${e}`}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:t})]})}var R5e=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`];function uV(e){return`${Math.floor(e/60).toString().padStart(2,`0`)}:${(e%60).toString().padStart(2,`0`)}`}function dV(e){let[t,n]=e.split(`:`).map(Number);return(t??0)*60+(n??0)}function z5e({weeklyRules:e,onChangeRules:t}){function n(t){return e.filter(e=>e.day_of_week===t)}function r(n){t([...e,{day_of_week:n,start_minute:540,end_minute:1020}])}function i(r,i){let a=n(r)[i];t(e.filter(e=>e!==a))}function a(r,i,a){let o=n(r)[i];t(e.map(e=>e===o?{...e,start_minute:dV(a)}:e))}function o(r,i,a){let o=n(r)[i];t(e.map(e=>e===o?{...e,end_minute:dV(a)}:e))}return(0,K.jsxs)(`div`,{className:`space-y-3`,children:[R5e.map((e,t)=>{let s=n(t);return(0,K.jsxs)(`div`,{className:`flex gap-3`,children:[(0,K.jsx)(`span`,{className:`w-9 shrink-0 pt-1.5 text-sm font-medium`,children:e}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[s.length===0&&(0,K.jsx)(`span`,{className:`pt-1.5 text-sm text-muted-foreground`,children:`No windows`}),s.map((e,n)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`time`,className:`h-8 rounded border px-2 text-sm`,value:uV(e.start_minute),onChange:e=>a(t,n,e.target.value)}),(0,K.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`â`}),(0,K.jsx)(`input`,{type:`time`,className:`h-8 rounded border px-2 text-sm`,value:uV(e.end_minute),onChange:e=>o(t,n,e.target.value)}),(0,K.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-destructive text-sm leading-none`,"aria-label":`Remove window`,onClick:()=>i(t,n),children:`Ã`})]},n)),(0,K.jsx)(`button`,{type:`button`,className:`w-fit text-sm text-primary hover:underline`,onClick:()=>r(t),children:`+ Add window`})]})]},t)}),(0,K.jsx)(`p`,{className:`pt-2 text-xs text-muted-foreground`,children:`Date-specific overrides are only visible in the grid view.`})]})}function B5e({booking:e,open:t,onOpenChange:n}){let{t:r}=V(),{formatDateTime:i}=jb();return(0,K.jsx)(nL,{open:t,onOpenChange:n,children:(0,K.jsxs)(rL,{side:`right`,className:`w-96`,children:[(0,K.jsxs)(iL,{children:[(0,K.jsx)(aL,{children:r(`booking.bookings.details`)}),(0,K.jsx)(oL,{children:e?e.recipient_name:r(`common.no_data`)})]}),e&&(0,K.jsxs)(`div`,{className:`space-y-3 px-4 pb-4 text-sm`,children:[(0,K.jsx)(fV,{label:r(`booking.bookings.guest_name`),value:e.recipient_name}),(0,K.jsx)(fV,{label:r(`booking.bookings.guest_email`),value:e.recipient_email}),(0,K.jsx)(fV,{label:r(`booking.bookings.start`),value:i(e.start_time)}),(0,K.jsx)(fV,{label:r(`booking.bookings.end`),value:i(e.end_time)}),(0,K.jsx)(fV,{label:r(`common.status`),value:(e=>e===`pending`?r(`booking.bookings.status_pending`):e===`confirmed`?r(`booking.bookings.status_confirmed`):e
280===`cancelled`?r(`booking.bookings.status_cancelled`):e)(e.status)}),e.answers&&Object.keys(e.answers).length>0&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-muted-foreground mb-1 text-xs uppercase`,children:r(`booking.bookings.notes`)}),(0,K.jsx)(`div`,{className:`grid gap-1`,children:Object.entries(e.answers).map(([e,t])=>(0,K.jsx)(fV,{label:e,value:String(t)},e))})]})]})]})})}function fV({label:e,value:t}){return(0,K.jsxs)(`div`,{className:`grid grid-cols-[80px_1fr] gap-2`,children:[(0,K.jsx)(`span`,{className:`text-muted-foreground text-xs uppercase`,children:e}),(0,K.jsx)(`span`,{className:`break-words`,children:t})]})}function V5e(){let{t:e}=V(),{formatDateTime:t}=jb(),{id:n}=Cv(),r=Sv(),{fetchLink:i,update:a,remove:o,fetchBookings:s,bookingsByLink:c}=nR(),[l,u]=(0,B.useState)(null),[d,f]=(0,B.useState)(``),[p,m]=(0,B.useState)(``),[h,g]=(0,B.useState)(30),[_,v]=(0,B.useState)(0),[y,b]=(0,B.useState)(0),[x,S]=(0,B.useState)(!0),[C,w]=(0,B.useState)([]),[T,E]=(0,B.useState)([]),[D,O]=(0,B.useState)(!1),[k,A]=(0,B.useState)(null),[j,M]=(0,B.useState)(!1),[N,P]=(0,B.useState)(`grid`),F=(0,B.useMemo)(()=>n?c[n]??[]:[],[c,n]);function I(){return l?d!==l.name||(p||null)!==(l.description??null)||h!==l.duration_minutes||_!==l.buffer_before_minutes||y!==l.buffer_after_minutes||!H5e(C,l.weekly_rules??[])||!U5e(T,l.overrides??[]):!1}let L=I();(0,B.useEffect)(()=>{n&&(i(n).then(e=>{e&&ee(e)}),s(n))},[n,i,s]);function ee(e){u(e),f(e.name),m(e.description??``),g(e.duration_minutes),v(e.buffer_before_minutes),b(e.buffer_after_minutes),S(e.active),w(e.weekly_rules??[]),E(e.overrides??[])}if(!l)return(0,K.jsx)(`div`,{className:`p-8 text-muted-foreground`,children:e(`common.loading`)});async function R(){if(n){O(!0);try{ee(await a(n,{name:d,description:p||null,duration_minutes:h,buffer_before_minutes:_,buffer_after_minutes:y,weekly_rules:C,overrides:T})),G.success(e(`toasts.booking.link_saved`))}catch(t){Y(t,e(`toasts.booking.link_save_failed`),{operation:`booking.link.save`})}finally{O(!1)}}}async function te(){n&&confirm(e(`matters.edit_dialog.delete_confirm`))&&(await o(n),G.success(e(`toasts.booking.link_deleted`)),r(`/booking`))}return(0,K.jsxs)(`div`,{className:`mx-auto max-w-6xl px-6 py-8`,children:[(0,K.jsxs)(`div`,{className:`mb-6 flex items-start justify-between`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex px-2 items-center`,children:[(0,K.jsx)(Tg,{onClick:()=>{r(`/booking`)},className:`cursor-pointer`}),(0,K.jsx)(`h1`,{className:`text-2xl font-semibold`,children:l.name})]}),l.public_url&&(0,K.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,K.jsx)(`code`,{className:`bg-muted truncate rounded px-2 py-1 text-xs`,children:l.public_url}),(0,K.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>{l.public_url&&(navigator.clipboard.writeText(l.public_url),G.success(e(`toasts.booking.link_url_copied`)))},children:e(`common.copy`)})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[L&&(0,K.jsx)(`span`,{className:`rounded bg-amber-100 px-2 py-1 text-[11px] font-medium text-amber-800 dark:bg-amber-900/40 dark:text-amber-200`,children:e(`common.saving`)}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(mP,{checked:x,onCheckedChange:async t=>{if(n){S(t);try{await a(n,{active:t})}catch(n){S(!t),Y(n,e(`toasts.common.update_failed`),{operation:`booking.link.toggleActive`})}}}}),(0,K.jsx)(pP,{className:`text-sm`,children:e(`settings.integrations.connected`)})]}),(0,K.jsx)(J,{onClick:R,disabled:D,children:e(D?`common.saving`:`common.save`)}),(0,K.jsx)(J,{variant:`destructive`,onClick:te,children:e(`common.delete`)})]})]}),(0,K.jsxs)(uz,{className:`mb-4`,children:[(0,K.jsx)(dz,{children:(0,K.jsx)(fz,{className:`text-lg`,children:e(`common.details`)})}),(0,K.jsxs)(mz,{className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{htmlFor:`name`,children:e(`booking.fields.name`)}),(0,K.jsx)(dP,{id:`name`,value:d,onChange:e=>f(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{htmlFor:`desc`,children:e(`booking.fields.description`)}),(0,K.jsx)(dP,{id:`desc`,value:p,onChange:e=>m(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-3 gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{htmlFor:`dur`,children:e(`booking.fields.duration_minutes`)}),(0,K.jsx)(dP,{id:`dur`,type:`number`,value:h,onChange:e=>g(Number(e.target.value)||30)})]}),(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{htmlFor:`bb`,children:e(`booking.fields.buffer_minutes`)}
280),(0,K.jsx)(dP,{id:`bb`,type:`number`,value:_,onChange:e=>v(Number(e.target.value)||0)})]}),(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{htmlFor:`ba`,children:e(`booking.fields.buffer_minutes`)}),(0,K.jsx)(dP,{id:`ba`,type:`number`,value:y,onChange:e=>b(Number(e.target.value)||0)})]})]})]})]}),(0,K.jsxs)(uz,{className:`mb-4`,children:[(0,K.jsxs)(dz,{className:`flex flex-row items-center justify-between`,children:[(0,K.jsx)(fz,{className:`text-lg`,children:e(`booking.fields.availability`)}),(0,K.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border text-sm`,children:[(0,K.jsx)(`button`,{type:`button`,className:q(`px-3 py-1`,N===`grid`?`bg-muted font-medium`:`hover:bg-muted/50`),onClick:()=>P(`grid`),children:e(`dashboard.week`)}),(0,K.jsx)(`button`,{type:`button`,className:q(`border-l px-3 py-1`,N===`list`?`bg-muted font-medium`:`hover:bg-muted/50`),onClick:()=>P(`list`),children:e(`common.view`)})]})]}),(0,K.jsx)(mz,{children:N===`grid`?(0,K.jsx)(L5e,{weeklyRules:C,overrides:T,bookings:F,onChangeRules:w,onChangeOverrides:E,onBookingClick:e=>{A(e),M(!0)}}):(0,K.jsx)(z5e,{weeklyRules:C,onChangeRules:w})})]}),(0,K.jsxs)(uz,{children:[(0,K.jsx)(dz,{children:(0,K.jsx)(fz,{className:`text-lg`,children:e(`booking.bookings.title`)})}),(0,K.jsx)(mz,{children:F.length===0?(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e(`booking.bookings.no_bookings`)}):(0,K.jsx)(`div`,{className:`grid gap-2`,children:F.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`flex items-center justify-between rounded border p-2 text-sm hover:bg-muted/50`,onClick:()=>{A(e),M(!0)},children:[(0,K.jsxs)(`div`,{className:`text-left`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:e.recipient_name}),` `,(0,K.jsxs)(`span`,{className:`text-muted-foreground`,children:[`<`,e.recipient_email,`>`]})]}),(0,K.jsxs)(`div`,{className:`text-muted-foreground text-xs`,children:[t(e.start_time),` · `,e.status]})]},e.id))})})]}),(0,K.jsx)(B5e,{booking:k,open:j,onOpenChange:e=>{M(e),e||A(null)}})]})}function H5e(e,t){if(e.length!==t.length)return!1;let n=e.map(pV).sort(),r=t.map(pV).sort();return n.every((e,t)=>e===r[t])}function pV(e){return`${e.day_of_week}:${e.start_minute}-${e.end_minute}`}function U5e(e,t){if(e.length!==t.length)return!1;let n=e.map(mV).sort(),r=t.map(mV).sort();return n.every((e,t)=>e===r[t])}function mV(e){return`${e.kind}:${e.start_time}:${e.end_time}`}var W5e={step:`pick`,slots:[],slotsLoading:!1};function G5e(e,t){switch(t.type){case`meta_loaded`:return{...e,meta:t.meta,metaError:void 0};case`meta_error`:return{...e,metaError:t.error};case`set_date`:return{...e,date:t.date,slots:[],slotsError:void 0};case`slots_loading`:return{...e,slotsLoading:!0,slotsError:void 0};case`slots_loaded`:return{...e,slotsLoading:!1,slots:t.slots};case`slots_error`:return{...e,slotsLoading:!1,slotsError:t.error};case`pick_slot`:return{...e,slot:t.slot,step:`form`,formError:void 0};case`back_to_pick`:return{...e,step:`pick`,slot:void 0};case`submit_start`:return{...e,step:`submitting`,formError:void 0};case`submit_error`:return{...e,step:`form`,formError:t.error};default:return e}}function hV(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function K5e(){let{t:e}=V(),{formatDate:t,formatTime:n,formatDateTime:r}=jb(),{firstName:i,meetingTitle:a,slug:o}=Cv(),s=Sv(),[c,l]=(0,B.useReducer)(G5e,W5e),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(``),[m,h]=(0,B.useState)(new Date),[g,_]=(0,B.useState)(new Set),[v,y]=(0,B.useState)(!1),b=Intl.DateTimeFormat().resolvedOptions().timeZone;if((0,B.useEffect)(()=>{!i||!a||!o||N0e(i,a,o).then(e=>l({type:`meta_loaded`,meta:e})).catch(e=>l({type:`meta_error`,error:Gb(e,`Not found`,{operation:`publicBooking.loadLink`,expectedNotFound:!0})}))},[i,a,o]),(0,B.useEffect)(()=>{if(!i||!a||!o||!c.date)return;let e=hV(c.date);l({type:`slots_loading`}),P0e(i,a,o,e,e,b).then(e=>l({type:`slots_loaded`,slots:e.slots})).catch(e=>l({type:`slots_error`,error:Gb(e,`Failed to load slots`,{operation:`publicBooking.loadSlots`})}))},[i,a,o,c.date,b]),(0,B.useEffect)(()=>
280{if(!i||!a||!o||!c.meta)return;let e=new Date;e.setHours(0,0,0,0);let t=new Date;t.setDate(t.getDate()+c.meta.max_advance_days);let n=new Date(m.getFullYear(),m.getMonth(),1),r=new Date(m.getFullYear(),m.getMonth()+1,0),s=n<e?e:n,l=r>t?t:r;if(s>l){_(new Set),y(!1);return}y(!0),P0e(i,a,o,hV(s),hV(l),b).then(e=>{let t=new Set;for(let n of e.slots)t.add(hV(new Date(n.start)));_(t)}).catch(()=>_(new Set)).finally(()=>y(!1))},[i,a,o,m,c.meta,b]),c.metaError)return(0,K.jsx)(`div`,{className:`flex min-h-screen items-center justify-center p-6`,children:(0,K.jsxs)(uz,{className:`max-w-md`,children:[(0,K.jsx)(dz,{children:(0,K.jsx)(fz,{children:`Link not found`})}),(0,K.jsx)(mz,{children:(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:c.metaError})})]})});if(!c.meta)return(0,K.jsx)(`div`,{className:`flex min-h-screen items-center justify-center text-muted-foreground`,children:`Loadingâ¦`});async function x(){if(!(!i||!a||!o||!c.slot)){l({type:`submit_start`});try{s(`/book/${i}/${a}/${o}/confirmed?bookingId=${(await F0e(i,a,o,{start_time:c.slot.start,recipient_name:u,recipient_email:f})).booking_id}`)}catch(t){l({type:`submit_error`,error:Gb(t,e(`toasts.booking.book_failed`),{operation:`publicBooking.create`})})}}}let S={};for(let e of c.slots){let t=`${new Date(e.start).getHours()}`;S[t]=S[t]??[],S[t].push(e)}return(0,K.jsx)(`div`,{className:`min-h-screen bg-muted/30 px-4 py-10`,children:(0,K.jsxs)(`div`,{className:`mx-auto max-w-4xl`,children:[(0,K.jsxs)(`div`,{className:`mb-6`,children:[(0,K.jsx)(`h1`,{className:`text-2xl font-semibold`,children:c.meta.name}),c.meta.description&&(0,K.jsx)(`p`,{className:`text-muted-foreground mt-1 text-sm`,children:c.meta.description}),(0,K.jsxs)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:[c.meta.duration_minutes,` min · `,b]})]}),c.step===`pick`&&(0,K.jsx)(uz,{children:(0,K.jsxs)(mz,{className:`grid grid-cols-1 gap-6 p-6 md:grid-cols-[auto_1fr]`,children:[(0,K.jsx)(`div`,{children:(0,K.jsx)(VB,{mode:`single`,month:m,onMonthChange:h,selected:c.date,onSelect:e=>e&&l({type:`set_date`,date:e}),disabled:e=>{let t=new Date;if(t.setHours(0,0,0,0),e<t)return!0;let n=new Date;return n.setDate(n.getDate()+c.meta.max_advance_days),e>n?!0:v?!1:!g.has(hV(e))}})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`mb-3 font-medium`,children:c.date?t(c.date,`EEEE, MMM d`):e(`booking.public.pick_date`)}),c.slotsLoading&&(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e(`common.loading`)}),c.slotsError&&(0,K.jsx)(`p`,{className:`text-destructive text-sm`,children:c.slotsError}),!c.slotsLoading&&c.date&&c.slots.length===0&&!c.slotsError&&(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e(`booking.public.no_slots`)}),(0,K.jsx)(`div`,{className:`grid grid-cols-2 gap-2 md:grid-cols-3`,children:c.slots.map(e=>(0,K.jsx)(J,{variant:`outline`,onClick:()=>l({type:`pick_slot`,slot:e}),children:n(new Date(e.start))},e.start))})]})]})}),c.step!==`pick`&&c.slot&&(0,K.jsxs)(uz,{children:[(0,K.jsx)(dz,{children:(0,K.jsx)(fz,{children:e(`booking.bookings.details`)})}),(0,K.jsxs)(mz,{className:`grid gap-4`,children:[(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,K.jsx)(`strong`,{children:r(c.slot.start)})}),(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{htmlFor:`name`,children:e(`booking.public.name_label`)}),(0,K.jsx)(dP,{id:`name`,value:u,onChange:e=>d(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(pP,{htmlFor:`email`,children:e(`booking.public.email_label`)}),(0,K.jsx)(dP,{id:`email`,type:`email`,value:f,onChange:e=>p(e.target.value)})]}),c.formError&&(0,K.jsx)(`p`,{className:`text-destructive text-sm`,children:c.formError}),(0,K.jsxs)(`div`,{className:`flex justify-between`,children:[(0,K.jsx)(J,{variant:`outline`,onClick:()=>l({type:`back_to_pick`}),children:e(`common.back`)}),(0,K.jsx)(J,{onClick:x,disabled:!u||!f||c.step===`submitting`,children:c.step===`submitting`?e(`booking.public.booking`):e(`booking.public.confirm_booking`)})]})]})]})]})})}function q5e(){let[e]=Jv(),t=e.get(`bookingId`);return(0,K.jsx)(`div`,{className:`bg-muted/30 flex min-h-screen items-center justify-center px-4 py-10`,children:(0,K.jsxs)(uz,{className:`max-w-md`,children:[(0,K.jsx)(dz,{children:(0,K.jsx)(fz,{children:`Booking confirmed`})}),(0,K.jsxs)(mz,{className:`grid gap-3`,children:[(0,K.jsx)(`p`,{className:`text-sm`,children:`You're all set. A confirmation email with a calendar invite is on its way.`}),t&&(0,K.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Booking reference: `,t]})]})]})})}const J5e=()=>`/api/v1/routines/templates`,Y5e=async e=>Z(J5e(),{...e,method:`GET`}),X5e=()=>`/api/v1/routines`,Z5e=async e=>Z(X5e(),{...e,method:`GET`}),Q5e=()=>`/api/v1/routines`,$5e=async(e,t)=>Z(Q5e(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),e7e=e=>`/api/v1/routines/${e}`,t7e=async(e,t)=>Z(e7e(e),{...t,method:`GET`}),n7e=e=>`/api/v1/routines/${e}`,r7e=async(e,t,n)=>Z(n7e(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),i7e=e=>`/api/v1/routines/${e}`,a7e=async(e,t)=>Z(i7e(e),{...t,method:`DELETE`}),o7e=e=>`/api/v1/routines/${e}/run`,s7e=async(e,t)=>Z(o7e(e),{...t,method:`POST`}),c7e=e=>`/api/v1/routines/${e}/runs`,l7e=async(e,t)=>Z(c7e(e),{...t,method:`GET`}),gV=Pb((e,t)=>
280({routines:[],templates:[],runsByRoutine:{},selectedRoutine:null,isLoading:!1,isLoadingTemplates:!1,isLoadingDetail:!1,isCreating:!1,isRunningManually:!1,error:null,fetchRoutines:async()=>{e({isLoading:!0,error:null});try{e({routines:(await Z5e()).data,isLoading:!1})}catch(t){X(t,{operation:`fetch_routines`}),e({error:Kb(t,H.t(`errors.fetch_failed`)),isLoading:!1})}},fetchTemplates:async()=>{if(!(t().templates.length>0)){e({isLoadingTemplates:!0});try{e({templates:(await Y5e()).data,isLoadingTemplates:!1})}catch(t){X(t,{operation:`fetch_routine_templates`}),e({error:Kb(t,H.t(`errors.fetch_failed`)),isLoadingTemplates:!1})}}},selectRoutine:async t=>{e({isLoadingDetail:!0,error:null});try{let n=(await t7e(t)).data;return e({selectedRoutine:n,isLoadingDetail:!1}),n}catch(t){return X(t,{operation:`select_routine`}),e({error:Kb(t,H.t(`errors.fetch_failed`)),isLoadingDetail:!1}),null}},createRoutine:async t=>{e({isCreating:!0,error:null});try{let n=(await $5e(t)).data,r=_V(n);return e(e=>({routines:[r,...e.routines],selectedRoutine:n,isCreating:!1})),n}catch(t){return X(t,{operation:`create_routine`}),e({error:Kb(t,H.t(`errors.create_failed`)),isCreating:!1}),null}},updateRoutine:async(t,n)=>{e({error:null});try{let r=(await r7e(t,n)).data,i=_V(r);return e(e=>({routines:e.routines.map(e=>e.id===t?i:e),selectedRoutine:e.selectedRoutine?.id===t?r:e.selectedRoutine})),r}catch(t){return X(t,{operation:`update_routine`}),e({error:Kb(t,H.t(`errors.save_failed`))}),null}},deleteRoutine:async t=>{e({error:null});try{return await a7e(t),e(e=>({routines:e.routines.filter(e=>e.id!==t),selectedRoutine:e.selectedRoutine?.id===t?null:e.selectedRoutine})),!0}catch(t){return X(t,{operation:`delete_routine`}),e({error:Kb(t,H.t(`errors.could_not_delete`))}),!1}},runRoutineNow:async t=>{e({isRunningManually:!0,error:null});try{return await s7e(t),e({isRunningManually:!1}),!0}catch(t){return X(t,{operation:`run_routine_now`}),e({error:Kb(t,H.t(`errors.generic`)),isRunningManually:!1}),!1}},fetchRuns:async t=>{e({error:null});try{let n=await l7e(t);e(e=>({runsByRoutine:{...e.runsByRoutine,[t]:n.data}}))}catch(t){X(t,{operation:`fetch_routine_runs`}),e({error:Kb(t,H.t(`errors.fetch_failed`))})}},clearSelection:()=>e({selectedRoutine:null}),clearError:()=>e({error:null})}));function _V(e){return{id:e.id,name:e.name,description:e.description,template_id:e.template_id,frequency:e.frequency,time_of_day:e.time_of_day,day_of_week:e.day_of_week,day_of_month:e.day_of_month,enabled:e.enabled,integrations:e.integrations,notify:e.notify,last_run_at:e.last_run_at,next_run_at:e.next_run_at,created_at:e.created_at,updated_at:e.updated_at}}var u7e=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`];function d7e({routine:e,onEdit:t,onShowRuns:n}){let{updateRoutine:r,deleteRoutine:i,runRoutineNow:a}=gV(),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(!1),u=Nx(e=>e.user?.preferences?.timezone),d=typeof u==`string`?Nz(u):``,f=async t=>{l(!0);let n=await r(e.id,{enabled:t});l(!1),n&&G.success(t?`Routine enabled`:`Routine paused`)},p=async()=>{s(!0);let t=await a(e.id);s(!1),t&&G.success(`Routine queued. Check runs in a few seconds.`)};return(0,K.jsxs)(uz,{className:`flex flex-col`,children:[(0,K.jsxs)(dz,{className:`flex-row items-start justify-between gap-2 space-y-0 pb-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`h3`,{className:`truncate text-base font-medium`,children:e.name}),e.enabled?(0,K.jsx)(lR,{variant:`default`,className:`h-5 text-[10px]`,children:`Active`}):(0,K.jsx)(lR,{variant:`secondary`,className:`h-5 text-[10px]`,children:`Paused`})]}),e.description&&(0,K.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-muted-foreground`,children:e.description})]}),(0,K.jsxs)(LD,{children:[(0,K.jsx)(RD,{asChild:!0,children:(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`-mr-2 -mt-1 size-7`,children:(0,K.jsx)(Zg,{className:`size-4`})})}),(0,K.jsxs)(zD,{align:`end`,children:[(0,K.jsxs)(VD,{onClick:t,children:[(0,K.jsx)(w_,{className:`size-4`}),`Edit`]}),(0,K.jsxs)(VD,{onClick:p,disabled:o,children:[(0,K.jsx)(sse,{className:`size-4`}),`Run now`]}),(0,K.jsxs)(VD,{onClick:n,children:[(0,K.jsx)(c_,{className:`size-4`}),`View runs`]}
280),(0,K.jsxs)(VD,{onClick:async()=>{window.confirm(`Delete routine "${e.name}"?`)&&await i(e.id)&&G.success(`Routine deleted`)},variant:`destructive`,children:[(0,K.jsx)(V_,{className:`size-4`}),`Delete`]})]})]})]}),(0,K.jsxs)(mz,{className:`flex flex-col gap-3 pt-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.integrations.gmail&&(0,K.jsx)(vV,{icon:(0,K.jsx)(__,{className:`size-3`}),label:`Email`}),e.integrations.calendar&&(0,K.jsx)(vV,{icon:(0,K.jsx)(Pg,{className:`size-3`}),label:`Calendar`}),e.integrations.tasks&&(0,K.jsx)(vV,{icon:(0,K.jsx)(m_,{className:`size-3`}),label:`Tasks`}),!e.integrations.gmail&&!e.integrations.calendar&&!e.integrations.tasks&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`No integrations`})]}),(0,K.jsxs)(`div`,{className:`rounded border border-border bg-muted/30 px-3 py-2 text-xs`,children:[(0,K.jsxs)(`div`,{className:`font-medium capitalize`,children:[e.frequency,e.frequency===`weekly`&&e.day_of_week!==null&&(0,K.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,u7e[e.day_of_week??0]]}),e.frequency===`monthly`&&e.day_of_month!==null&&(0,K.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· day `,e.day_of_month]}),(0,K.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`at `,f7e(e.time_of_day),d&&` · ${d}`]})]}),(0,K.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-muted-foreground`,children:[(0,K.jsx)(`span`,{children:e.last_run_at?`Last run ${yV(e.last_run_at)}`:`Never run`}),(0,K.jsx)(`span`,{children:e.next_run_at?`Next ${yV(e.next_run_at)}`:`â`})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground cursor-pointer select-none`,children:[(0,K.jsx)(mP,{checked:e.enabled,onCheckedChange:f,disabled:c}),`Enabled`]}),(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:p,disabled:o,className:`gap-1.5`,children:[o?(0,K.jsx)(W,{className:`size-3 animate-spin`}):(0,K.jsx)(sse,{className:`size-3`}),`Run now`]})]})]})]})}function vV({icon:e,label:t}){return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] text-foreground/80`,children:[e,t]})}function f7e(e){let t=e.split(`:`);return t.length>=2?`${t[0]}:${t[1]}`:e}function yV(e){let t=new Date(e),n=new Date,r=t.getTime()-n.getTime(),i=Math.abs(r),a=60*1e3,o=60*a,s=24*o;if(i<o){let e=Math.round(i/a);return r>=0?`in ${e}m`:`${e}m ago`}if(i<s){let e=Math.round(i/o);return r>=0?`in ${e}h`:`${e}h ago`}let c=Math.round(i/s);return r>=0?`in ${c}d`:`${c}d ago`}function p7e({open:e,onOpenChange:t,onCreated:n}){let{templates:r,isLoadingTemplates:i,fetchTemplates:a,createRoutine:o,isCreating:s}=gV(),[c,l]=(0,B.useState)(null);(0,B.useEffect)(()=>{e&&a()},[e,a]);let[u,d]=(0,B.useState)(e);u!==e&&(d(e),e||l(null));let f=async e=>{l(e.id);let t=await o({template_id:e.id});t?n(t.id):l(null)};return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsxs)(WC,{className:`max-w-3xl`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:`New routine`}),(0,K.jsx)(JC,{children:`Pick a template to start. You can edit the prompt, schedule, and integrations after creating the routine.`})]}),i&&r.length===0?(0,K.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loading templatesâ¦`}):(0,K.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 max-h-[60vh] overflow-y-auto pr-1`,children:[r.map(e=>{let t=s&&c===e.id;return(0,K.jsxs)(`button`,{onClick:()=>f(e),disabled:s,className:q(`flex flex-col items-start gap-2 rounded-lg border border-border bg-background p-4 text-left transition hover:border-foreground
280/40 hover:bg-muted/40`,s&&`opacity-60 cursor-not-allowed`),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(L_,{className:`size-4 text-foreground/60`}),(0,K.jsx)(`span`,{className:`font-medium`,children:e.name}),e.popular&&(0,K.jsx)(lR,{variant:`default`,className:`h-5 text-[10px]`,children:`Popular`})]}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-3`,children:e.description}),(0,K.jsxs)(`div`,{className:`mt-auto flex items-center justify-between w-full pt-1`,children:[(0,K.jsxs)(`span`,{className:`text-[10px] text-muted-foreground capitalize`,children:[e.default_frequency,` at `,m7e(e.default_time_of_day)]}),t&&(0,K.jsx)(W,{className:`size-3 animate-spin`})]})]},e.id)}),(0,K.jsxs)(`div`,{title:`Custom routines coming soon. For now, instantiate a template and edit it.`,className:`flex flex-col items-start gap-2 rounded-lg border border-dashed border-border bg-muted/30 p-4 text-left opacity-60 cursor-not-allowed`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Fse,{className:`size-4 text-foreground/60`}),(0,K.jsx)(`span`,{className:`font-medium`,children:`Create custom`}),(0,K.jsx)(lR,{variant:`secondary`,className:`h-5 text-[10px]`,children:`Soon`})]}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Start from scratch with your own prompt and schedule.`})]})]})]})})}function m7e(e){let t=e.split(`:`);return t.length>=2?`${t[0]}:${t[1]}`:e}function bV({className:e,orientation:t=`horizontal`,...n}){return(0,K.jsx)(yMe,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:q(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var h7e=ay(`rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function xV({className:e,variant:t=`default`,...n}){return(0,K.jsx)(bMe,{"data-slot":`tabs-list`,"data-variant":t,className:q(h7e({variant:t}),e),...n})}function SV({className:e,...t}){return(0,K.jsx)(xMe,{"data-slot":`tabs-trigger`,className:q(`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_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-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground`,`after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function CV({className:e,...t}){return(0,K.jsx)(SMe,{"data-slot":`tabs-content`,className:q(`flex-1 outline-none`,e),...t})}var g7e=[{value:0,label:`Mon`},{value:1,label:`Tue`},{value:2,label:`Wed`},{value:3,label:`Thu`},{value:4,label:`Fri`},{value:5,label:`Sat`},{value:6,label:`Sun`}];
280function _7e({routineId:e,onOpenChange:t}){let{selectRoutine:n,updateRoutine:r,deleteRoutine:i}=gV(),[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)({}),[l,u]=(0,B.useState)(!1),[d,f]=(0,B.useState)(!1),p=e!==null,[m,h]=(0,B.useState)(e);return m!==e&&(h(e),e?u(!0):(o(null),c({}))),(0,B.useEffect)(()=>{if(!e)return;let t=!0;return n(e).then(e=>{t&&(o(e),e&&c({name:e.name,description:e.description??void 0,prompt:e.prompt,frequency:e.frequency,time_of_day:EV(e.time_of_day),day_of_week:e.day_of_week,day_of_month:e.day_of_month,enabled:e.enabled,integrations:e.integrations,notify:e.notify}),u(!1))}),()=>{t=!1}},[e,n]),(0,K.jsx)(HC,{open:p,onOpenChange:e=>t(e),children:(0,K.jsxs)(WC,{className:`max-w-2xl`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:a?a.name:`Edit routine`}),(0,K.jsx)(JC,{children:`Adjust the routine's name, schedule, integrations, and prompt.`})]}),(0,K.jsxs)(`form`,{onSubmit:async n=>{if(n.preventDefault(),!e)return;f(!0);let i=await r(e,s);f(!1),i&&(G.success(`Routine saved`),t(!1))},className:`grid gap-4`,children:[l||!a?(0,K.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`Loadingâ¦`}):(0,K.jsxs)(`div`,{className:`space-y-4 max-h-[70vh] overflow-y-auto px-1`,children:[(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`r-name`,children:`Name`}),(0,K.jsx)(dP,{id:`r-name`,value:s.name??``,onChange:e=>c({...s,name:e.target.value}),required:!0})]}),(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(pP,{children:`Schedule`}),(0,K.jsxs)(bV,{value:s.frequency??`daily`,onValueChange:e=>{let t=e;c(e=>({...e,frequency:t,day_of_week:t===`weekly`?e.day_of_week??0:null,day_of_month:t===`monthly`?e.day_of_month??1:null}))},children:[(0,K.jsxs)(xV,{className:`grid grid-cols-3`,children:[(0,K.jsx)(SV,{value:`daily`,children:`Daily`}),(0,K.jsx)(SV,{value:`weekly`,children:`Weekly`}),(0,K.jsx)(SV,{value:`monthly`,children:`Monthly`})]}),(0,K.jsx)(CV,{value:`daily`,className:`pt-3`,children:(0,K.jsx)(TV,{value:s.time_of_day??`08:00`,onChange:e=>c({...s,time_of_day:e})})}),(0,K.jsxs)(CV,{value:`weekly`,className:`pt-3 space-y-3`,children:[(0,K.jsx)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:g7e.map(e=>(0,K.jsx)(J,{type:`button`,variant:s.day_of_week===e.value?`default`:`outline`,size:`sm`,className:`h-7`,onClick:()=>c({...s,day_of_week:e.value}),children:e.label},e.value))}),(0,K.jsx)(TV,{value:s.time_of_day??`08:00`,onChange:e=>c({...s,time_of_day:e})})]}),(0,K.jsxs)(CV,{value:`monthly`,className:`pt-3 space-y-3`,children:[(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`r-dom`,children:`Day of month`}),(0,K.jsx)(dP,{id:`r-dom`,type:`number`,min:1,max:31,value:s.day_of_month??1,onChange:e=>c({...s,day_of_month:Math.max(1,Math.min(31,parseInt(e.target.value||`1`,10)))}),className:`max-w-[120px]`}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`If the month has fewer days, the routine runs on the last day.`})]}),(0,K.jsx)(TV,{value:s.time_of_day??`09:00`,onChange:e=>c({...s,time_of_day:e})})]})]})]}),(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(pP,{children:`Integrations`}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 rounded border border-border bg-muted/20 p-3`,children:[(0,K.jsx)(wV,{label:`Email`,checked:s.integrations?.gmail??!1,onChange:e=>c({...s,integrations:{...s.integrations??DV(),gmail:e}})}),(0,K.jsx)(wV,{label:`Calendar`,checked:s.integrations?.calendar??!1,onChange:e=>c({...s,integrations:{...s.integrations??DV(),calendar:e}})}),(0,K.jsx)(wV,{label:`Tasks`,checked:s.integrations?.tasks??!1,onChange:e=>c({...s,integrations:{...s.integrations??DV(),tasks:e}})})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between rounded border border-border bg-muted/20 px-3 py-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`cursor-pointer`,children:`Send a notification when complete`}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`You'll see the report in your notification feed.`})]}),(0,K.jsx)(mP,{checked:s.notify??!0,onCheckedChange:e=>c({...s,notify:e})})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`r-prompt`,children:`Prompt`}),(0,K.jsx)(`textarea`,{id:`r-prompt`,value:s.prompt??``,onChange:e=>c({...s,prompt:e.target.value}),rows:10,className:`w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono leading-relaxed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`})]})]}),(0,K.jsxs)(KC,{className:`justify-between`,children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:async()=>{!e||!a||window.confirm(`Delete routine "${a.name}"?`)&&await i(e)&&(G.success(`Routine deleted`),t(!1))},className:`text-destructive`,children:`Delete`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(J,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,K.jsxs)(J,{type:`submit`,disabled:d||l,className:`gap-1.5`,children:[d&&(0,K.jsx)(W,{className:`size-3 animate-spin`}),`Save changes`]})]})]})]})]})})}function wV({label:e,checked:t,onChange:n}){return(0,K.jsxs)(`label`,{className:`flex items-center justify-between text-sm cursor-pointer`,children:[(0,K.jsx)(`span`,{children:e}),(0,K.jsx)(mP,{checked:t,onCheckedChange:n})]})}
280function TV({value:e,onChange:t}){return(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`r-tod`,children:`Time of day`}),(0,K.jsx)(dP,{id:`r-tod`,type:`time`,value:EV(e),onChange:e=>t(e.target.value),className:`max-w-[160px]`})]})}function EV(e){let t=e.split(`:`);return t.length>=2?`${t[0]}:${t[1]}`:e}function DV(){return{gmail:!1,calendar:!1,tasks:!1}}function OV({message:e,showContactSupport:t=!0,className:n}){let{t:r}=V();return(0,K.jsxs)(`div`,{className:q(`flex flex-col items-center justify-center gap-3 text-center text-sm text-muted-foreground`,n),children:[(0,K.jsx)(`p`,{children:e}),t&&(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>fO.getState().openDialog(),children:[(0,K.jsx)(f_,{className:`size-4`}),r(`support.menu.contact`)]})]})}function v7e({routineId:e,onOpenChange:t}){let n=e!==null,{runsByRoutine:r,routines:i,fetchRuns:a}=gV(),o=e?r[e]??[]:[],s=e?i.find(t=>t.id===e):null;return(0,B.useEffect)(()=>{e&&a(e)},[e,a]),(0,K.jsx)(nL,{open:n,onOpenChange:t,children:(0,K.jsxs)(rL,{side:`right`,className:`w-full sm:max-w-2xl overflow-y-auto`,children:[(0,K.jsxs)(iL,{children:[(0,K.jsx)(aL,{children:s?.name??`Routine runs`}),(0,K.jsx)(oL,{children:`Recent executions of this routine. Each run includes the generated report and any tool calls the agent made.`})]}),(0,K.jsx)(`div`,{className:`mt-4 space-y-4 px-4 pb-6`,children:o.length===0?(0,K.jsx)(`div`,{className:`rounded border border-dashed border-border bg-muted/30 px-4 py-8 text-center text-sm text-muted-foreground`,children:`No runs yet. Click "Run now" on the routine card to trigger one.`}):o.map(e=>(0,K.jsxs)(`article`,{className:`rounded-lg border border-border bg-background p-4 shadow-sm`,children:[(0,K.jsxs)(`header`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(y7e,{status:e.status}),(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:b7e(e.started_at)})]}),e.model_used&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.model_used})]}),e.status===`failed`&&e.error&&(0,K.jsx)(OV,{message:e.error,className:`items-start gap-2 rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-left text-xs text-destructive`}),e.output_markdown&&(0,K.jsx)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none`,children:(0,K.jsx)(_I,{remarkPlugins:[NI],children:e.output_markdown})}),(e.tokens_input||e.tokens_output)&&(0,K.jsxs)(`footer`,{className:`mt-3 pt-3 border-t border-border/60 text-[10px] text-muted-foreground font-mono`,children:[`tokens in: `,e.tokens_input??0,` · out: `,e.tokens_output??0]})]},e.id))})]})})}function y7e({status:e}){return e===`success`?(0,K.jsxs)(lR,{variant:`default`,className:`gap-1 text-[10px]`,children:[(0,K.jsx)(Ug,{className:`size-3`}),`Success`]}):e===`failed`?(0,K.jsxs)(lR,{variant:`destructive`,className:`gap-1 text-[10px]`,children:[(0,K.jsx)(Hg,{className:`size-3`}),`Failed`]}):e===`running`?(0,K.jsxs)(lR,{variant:`secondary`,className:`gap-1 text-[10px]`,children:[(0,K.jsx)(W,{className:`size-3 animate-spin`}),`Running`]}):(0,K.jsxs)(lR,{variant:`secondary`,className:`gap-1 text-[10px]`,children:[(0,K.jsx)(Jg,{className:`size-3`}),e]})}function b7e(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}var x7e=[`all`,`daily`,`weekly`,`monthly`];function S7e(){let{t:e}=V(),{routines:t,isLoading:n,error:r,fetchRoutines:i,clearError:a}=gV(),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(null),[f,p]=(0,B.useState)(`all`),[m,h]=(0,B.useState)(``);(0,B.useEffect)(()=>{i()},[i]);let g=(0,B.useMemo)(()=>{let e=m.trim().toLowerCase();return t.filter(t=>!(f!==`all`&&t.frequency!==f||e&&!t.name.toLowerCase().includes(e)))},[t,f,m]);return(0,K.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`text-2xl font-semibold`,children:e(`nav.routines`)}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Sc
280heduled AI agents that run on a recurring basis and deliver reports to you.`})]}),(0,K.jsx)($T,{i18nKey:`tour.routines.new`,side:`left`,children:(0,K.jsxs)(J,{onClick:()=>s(!0),className:`gap-1.5`,children:[(0,K.jsx)(T_,{className:`size-4`}),`New routine`]})})]}),(0,K.jsx)($T,{i18nKey:`tour.routines.filters`,side:`right`,children:(0,K.jsxs)(`div`,{className:`w-fit flex items-center gap-3 px-6 py-3 border-b border-border`,children:[(0,K.jsxs)(`div`,{className:`relative flex-1 max-w-sm`,children:[(0,K.jsx)(A_,{className:`absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground`}),(0,K.jsx)(dP,{value:m,onChange:e=>h(e.target.value),placeholder:`Search routines`,className:`pl-8`})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-1`,children:x7e.map(e=>(0,K.jsx)(J,{variant:f===e?`default`:`outline`,size:`sm`,className:`h-7 capitalize`,onClick:()=>p(e),children:e},e))})]})}),(0,K.jsx)($T,{i18nKey:`tour.routines.cards`,side:`top`,children:(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-6`,children:[r&&(0,K.jsxs)(`div`,{className:`mb-4 flex items-center justify-between rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[(0,K.jsx)(`span`,{children:r}),(0,K.jsx)(J,{variant:`ghost`,size:`xs`,onClick:a,children:`Dismiss`})]}),n&&t.length===0?(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Loading routinesâ¦`}):g.length===0?(0,K.jsx)(C7e,{onCreate:()=>s(!0),hasAny:t.length>0}):(0,K.jsx)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`,children:g.map(e=>(0,K.jsx)(d7e,{routine:e,onEdit:()=>l(e.id),onShowRuns:()=>d(e.id)},e.id))})]})}),(0,K.jsx)(p7e,{open:o,onOpenChange:s,onCreated:e=>{s(!1),l(e)}}),(0,K.jsx)(_7e,{routineId:c,onOpenChange:e=>{e||l(null)}}),(0,K.jsx)(v7e,{routineId:u,onOpenChange:e=>{e||d(null)}})]})}function C7e({onCreate:e,hasAny:t}){return(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed border-border bg-muted/30 px-6 py-16 text-center`,children:[(0,K.jsx)(`h3`,{className:`text-base font-medium`,children:t?`No routines match your filters`:`No routines yet`}),(0,K.jsx)(`p`,{className:`mt-1 max-w-md text-sm text-muted-foreground`,children:t?`Try clearing the search or filter to see your routines.`:`Pick a template to get started. You can edit the prompt, schedule, and integrations once it's created.`}),!t&&(0,K.jsxs)(J,{className:`mt-4 gap-1.5`,onClick:e,children:[(0,K.jsx)(T_,{className:`size-4`}),`Create your first routine`]})]})}function w7e(){let e=Sv(),{formatDate:t}=jb(),n=lk(e=>e.sharedWithMe),r=lk(e=>e.fetchSharedWithMe),i=lk(e=>e.markViewed),a=Q(e=>e.viewDocumentInKB);(0,B.useEffect)(()=>{r()},[r]);let o=t=>{i(t.share_id),t.resource_type===`conversation`?e(`/chat/${t.resource_id}`):t.resource_type===`matter`?e(`/matters/${t.resource_id}`):a(t.resource_id,t.resource_name)};return(0,K.jsxs)(`div`,{className:`mx-auto max-w-3xl p-6`,children:[(0,K.jsxs)(`div`,{className:`mb-6 flex items-center gap-2`,children:[(0,K.jsx)(P_,{className:`size-5`}),(0,K.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Shared with me`})]}),n.length===0?(0,K.jsx)(`div`,{className:`rounded-lg border border-dashed py-16 text-center text-sm text-muted-foreground`,children:`Nothing has been shared with you yet.`}):(0,K.jsx)(`ul`,{className:`divide-y divide-border/60 rounded-lg border`,children:n.map(e=>{let n=$0e(e.resource_type),r=!e.viewed_at;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{onClick:()=>o(e),className:`flex w-full items-center gap-3 px-4 py-3 text-left hover:bg-accent/50`,children:[(0,K.jsx)(n,{className:`size-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.resource_name}),r&&(0,K.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-red-500`})]}),(0,K.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[(0,K.jsx)(`span`,{className:`capitalize`,children:uR(e.resource_type)}),` `,`· shared by `,e.owner_email,` ·`,` `,t(e.shared_at)]})]}),(0,K.jsx)(`span`,{className:`text-[11px] capitalize text-muted-foreground`,children:e.role})]})},e.share_id)})})]})}function T7e(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function E7e(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function D7e(e){return e/100*window.innerHeight}function O7e(e){return e/100*window.innerWidth}function k7e(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function kV({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=k7e(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=E7e(t,i);break;case`em`:r=T7e(t,i);break;case`vh`:r=D7e(i);break;case`vw`:r=O7e(i);break}return r}function AV(e){return parseFloat(e.toFixed(3))}function jV({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),
2800)}function MV(e){let{panels:t}=e,n=jV({group:e});return n===0?t.map(e=>({collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=AV(kV({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=AV(kV({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=AV(kV({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=AV(kV({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function NV(e,t=`Assertion error`){if(!e)throw Error(t)}function PV(e,t){return Array.from(t).sort(e===`horizontal`?A7e:j7e)}function A7e(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function j7e(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function FV(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function IV(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function M7e({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=IV(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return NV(i,`No rect found`),i}var LV;function N7e(){return LV===void 0&&(LV=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),LV}function RV(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=PV(n,Array.from(t.children).filter(FV).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.ariaDisabled===null&&(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,M7e({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=N7e()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:jV({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var P7e=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}};function zV(e,t,n=0){return Math.abs(AV(e)-AV(t))<=n}var BV={cursorFlags:0,interactionState:{state:`inactive`},mountedGroups:new Map},VV=new P7e;function HV(){return BV}function UV(e){let t=typeof e==`function`?e(BV):e;if(BV===t)return BV;let n=BV;return BV={...BV,...t}
280,t.cursorFlags!==void 0&&VV.emit(`cursorFlagsChange`,BV.cursorFlags),t.interactionState!==void 0&&VV.emit(`interactionStateChange`,BV.interactionState),t.mountedGroups!==void 0&&(BV.mountedGroups.forEach((e,t)=>{e.derivedPanelConstraints.forEach(r=>{if(r.collapsible){let{layout:i}=n.mountedGroups.get(t)??{};if(i){let n=zV(r.collapsedSize,e.layout[r.panelId]),a=zV(r.collapsedSize,i[r.panelId]);n&&!a&&(t.inMemoryLastExpandedPanelSizes[r.panelId]=i[r.panelId])}}})}),VV.emit(`mountedGroupsChange`,BV.mountedGroups)),BV}function F7e(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=IV(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function I7e(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function L7e(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:KV(e),b:KV(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();NV(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:GV(WV(n.a)),b:GV(WV(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var R7e=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function z7e(e){let t=getComputedStyle(qV(e)??e).display;return t===`flex`||t===`inline-flex`}function B7e(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||z7e(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||R7e.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function WV(e){let t=e.length;for(;t--;){let n=e[t];if(NV(n,`Missing node`),B7e(n))return n}return null}function GV(e){return e&&Number(getComputedStyle(e).zIndex)||0}function KV(e){let t=[];for(;e;)t.push(e),e=qV(e);return t}function qV(e){let{parentNode:t}=e;return I7e(t)?t.host:t}function V7e(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function H7e({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!FV(n)||n.contains(e)||e.contains(n))return!0;if(L7e(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(V7e(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function JV(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=RV(r),a=F7e(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&H7e({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function U7e(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function YV(e,t){return zV(e,t)?0:e>t?1:-1}function XV({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(YV(r,c)<0)if(a){let e=(i+c)/2;r=YV(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=AV(r),r}function ZV({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(zV(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;NV(u!=null,`Invalid first pivot index`),NV(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];NV(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(NV(n!=null,`Previous layout not found for panel index ${t}`),zV(n,i)){let t=o-n;YV(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];NV(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(NV(n!=null,`Previous layout not found for panel index ${t}`),zV(n,o)){let t=n-i;YV(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];NV(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&YV(i,c)<0)if(e>0){let t=c-o,n=t/2;
280YV(i+e,c)<0&&(e=YV(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;YV(i-e,c)<0&&(e=YV(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];NV(e!=null,`Previous layout not found for panel index ${r}`);let a=XV({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];NV(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=XV({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!zV(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(U7e(c,l))return i;{let t=e<0?d:u,r=s[t];NV(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=XV({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!zV(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];NV(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=XV({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(zV(i,s)||(t-=s-i,l[r]=s),zV(t,0))break;e>0?r--:r++}}}if(!zV(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function QV(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||YV(e[n],t[n])!==0)return!1;return!0}function $V({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!zV(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];NV(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];NV(i!=null,`No layout data found for index ${e}`);let o=r[e];NV(o!=null,`No layout data found for index ${e}`);let s=XV({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!zV(a,0))for(let e=0;e<t.length;e++){let n=r[e];NV(n!=null,`No layout data found for index ${e}`);let i=n+a,o=XV({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,zV(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function eH({groupId:e,panelId:t}){let n=()=>{let{mountedGroups:t}=HV();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,separatorToPanels:o}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,layout:a,separatorToPanels:o};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,layout:c,separatorToPanels:l}=n(),u=s.panels.findIndex(e=>e.id===t),d=u===s.panels.length-1,f=$V({layout:ZV({delta:d?r-e:e-r,initialLayout:c,panelConstraints:o,pivotIndices:d?[u-1,u]:[u,u+1],prevLayout:c,trigger:`imperative-api`}),panelConstraints:o});QV(c,f)||UV(e=>({mountedGroups:new Map(e.mountedGroups).set(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,layout:f,separatorToPanels:l})}))};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&zV(t,n)},resize:e=>{if(a()!==e){let t;switch(typeof e){case`number`:{let{group:r}=n();t=AV(e/jV({group:r})*100);break}case`string`:t=parseFloat(e);break}o(t)}}}}function tH(e){if(e.defaultPrevented)return;let{mountedGroups:t}=HV();JV(e,t).forEach(t=>{if(t.separator){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=eH({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function nH(e){let{mountedGroups:t}=HV();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function rH({groupId:e}){let t=()=>{let{mountedGroups:t}=HV();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,layout:a,separatorToPanels:o}=t(),s=$V({layout:e,panelConstraints:r});if(n)return a;
280if(!QV(a,s)){UV(e=>({mountedGroups:new Map(e.mountedGroups).set(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,layout:s,separatorToPanels:o})}));let e=i.panels.map(({id:e})=>e).join(`,`);i.inMemoryLayouts[e]=s}return s}}}function iH(e){let{mountedGroups:t}=HV(),n=t.get(e);return NV(n,`Mounted Group ${e.id} not found`),n}function aH(e,t){let n=nH(e),r=iH(n),i=n.separators.find(t=>t.element===e);NV(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);NV(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=rH({groupId:n.id}).getLayout(),c=$V({layout:ZV({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});QV(s,c)||UV(e=>({mountedGroups:new Map(e.mountedGroups).set(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,layout:c,separatorToPanels:r.separatorToPanels})}))}function oH(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=nH(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&aH(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&aH(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&aH(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&aH(t,-5);break;case`End`:e.preventDefault(),aH(t,100);break;case`Enter`:{e.preventDefault();let n=nH(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=iH(n),o=n.separators.find(e=>e.element===t);NV(o,`Matching separator not found`);let s=a.get(o);NV(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(NV(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];aH(t,(l.collapsedSize===e?n.inMemoryLastExpandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=nH(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);NV(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus();break}case`Home`:e.preventDefault(),aH(t,-100);break}}function sH(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let{mountedGroups:t}=HV(),n=JV(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus()));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),UV({interactionState:{hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}}),n.length&&e.preventDefault()}var W7e=e=>e,cH=()=>{},lH=1,uH=2,dH=4,fH=8,pH=3,mH=12,hH;function gH(){return hH===void 0&&(hH=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(hH=!0)),hH}function G7e({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&gH()){let t=(e&lH)!==0,n=(e&uH)!==0,r=(e&dH)!==0,i=(e&fH)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return gH()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var _H=new WeakMap;function vH(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=_H.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets.push(n));let{cursorFlags:r,interactionState:i}=HV();switch(i.state){case`active`:case`hover`:{let e=G7e({cursorFlags:r,groups:i.hitRegions.map(e=>e.group),state:i.state}),a=`*, *:hover {cursor: ${e} !important; ${i.state===`active`?`touch-action: none;`:``} }`;if(t===a)return;t=a,e?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}_H.set(e,{prevStyle:t,styleSheet:n})}function yH({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0,c=new Map(i);
280n.forEach(e=>{let{group:n,groupSize:o}=e,{disableCursor:l,orientation:u,panels:d}=n,f=0;f=a?u===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:u===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let p=r.get(n),{defaultLayoutDeferred:m,derivedPanelConstraints:h,layout:g,separatorToPanels:_}=i.get(n)??{defaultLayoutDeferred:!1};if(h&&p&&g&&_){let t=ZV({delta:f,initialLayout:p,panelConstraints:h,pivotIndices:e.panels.map(e=>d.indexOf(e)),prevLayout:g,trigger:`mouse-or-touch`});if(QV(t,g)){if(f!==0&&!l)switch(u){case`horizontal`:s|=f<0?lH:uH;break;case`vertical`:s|=f<0?dH:fH;break}}else{c.set(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,layout:t,separatorToPanels:_});let n=e.group.panels.map(({id:e})=>e).join(`,`);e.group.inMemoryLayouts[n]=t}}});let l=0;t.movementX===0?l|=o&pH:l|=s&pH,t.movementY===0?l|=o&mH:l|=s&mH,UV({cursorFlags:l,mountedGroups:c}),vH(e)}function bH(e){let{cursorFlags:t,interactionState:n,mountedGroups:r}=HV();switch(n.state){case`active`:yH({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:r,prevCursorFlags:t})}}function xH(e){if(e.defaultPrevented)return;let{cursorFlags:t,interactionState:n,mountedGroups:r}=HV();switch(n.state){case`active`:if(e.buttons===0){UV(e=>e.interactionState.state===`inactive`?e:{cursorFlags:0,interactionState:{state:`inactive`}}),UV(e=>({mountedGroups:new Map(e.mountedGroups)}));return}yH({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:t});break;default:{let t=JV(e,r);t.length===0?n.state!==`inactive`&&UV({interactionState:{state:`inactive`}}):UV({interactionState:{hitRegions:t,state:`hover`}}),vH(e.currentTarget);break}}}function SH(e){if(e.relatedTarget instanceof HTMLIFrameElement){let{interactionState:e}=HV();switch(e.state){case`hover`:UV({interactionState:{state:`inactive`}})}}}function CH(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let{interactionState:t}=HV();switch(t.state){case`active`:UV({cursorFlags:0,interactionState:{state:`inactive`}}),t.hitRegions.length>0&&(vH(e.currentTarget),UV(e=>({mountedGroups:new Map(e.mountedGroups)})),e.preventDefault())}}function wH(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=AV(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=AV((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function K7e(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=jV({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:AV(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function q7e(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function J7e(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var TH=new Map;function Y7e(e){let t=!0;NV(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){if(jV({group:e})===0)return;UV(t=>{let n=t.mountedGroups.get(e);if(n){let r=MV(e),i=n.defaultLayoutDeferred?wH(r):n.layout,a=$V({layout:i,panelConstraints:r});return!n.defaultLayoutDeferred&&QV(i,a)&&q7e(n.derivedPanelConstraints,r)?t:{mountedGroups:new Map(t.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,layout:a,separatorToPanels:n.separatorToPanels})}}return t})}}else K7e(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{NV(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=jV({group:e}),s=MV(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.defaultLayout;l&&(J7e(e.panels,l)||(l=void 0));let u=$V({layout:e.inMemoryLayouts[c]??l??wH(s),panelConstraints:s}),d=RV(e),f=e.element.ownerDocument;return UV(t=>{let n=new Map;
280return TH.set(f,(TH.get(f)??0)+1),d.forEach(e=>{e.separator&&n.set(e.separator,e.panels)}),{mountedGroups:new Map(t.mountedGroups).set(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,layout:u,separatorToPanels:n})}}),e.separators.forEach(e=>{NV(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,oH)}),TH.get(f)===1&&(f.addEventListener(`dblclick`,tH,!0),f.addEventListener(`pointerdown`,sH,!0),f.addEventListener(`pointerleave`,bH),f.addEventListener(`pointermove`,xH),f.addEventListener(`pointerout`,SH),f.addEventListener(`pointerup`,CH,!0)),function(){t=!1,TH.set(f,Math.max(0,(TH.get(f)??0)-1)),UV(t=>{let n=new Map(t.mountedGroups);return n.delete(e),{mountedGroups:n}}),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,oH)}),TH.get(f)||(f.removeEventListener(`dblclick`,tH,!0),f.removeEventListener(`pointerdown`,sH,!0),f.removeEventListener(`pointerleave`,bH),f.removeEventListener(`pointermove`,xH),f.removeEventListener(`pointerout`,SH),f.removeEventListener(`pointerup`,CH,!0)),a.disconnect()}}function X7e(){let[e,t]=(0,B.useState)({});return[e,(0,B.useCallback)(()=>t({}),[])]}function EH(e){let t=(0,B.useId)();return`${e??t}`}var DH=typeof window<`u`?B.useLayoutEffect:B.useEffect;function OH(e){let t=(0,B.useRef)(e);return DH(()=>{t.current=e},[e]),(0,B.useCallback)((...e)=>t.current?.(...e),[t])}function kH(...e){return OH(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function AH(e){let t=(0,B.useRef)({...e});return DH(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var jH=(0,B.createContext)(null);function Z7e(e,t){let n=(0,B.useRef)({getLayout:()=>({}),setLayout:W7e});(0,B.useImperativeHandle)(t,()=>n.current,[]),DH(()=>{Object.assign(n.current,rH({groupId:e}))})}function MH({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,B.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=OH(e=>{QV(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=OH(e=>{QV(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=EH(s),v=(0,B.useRef)(null),[y,b]=X7e(),x=(0,B.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=kH(v,a);Z7e(_,o);let C=OH((e,t)=>{let{interactionState:r,mountedGroups:i}=HV();for(let n of i.keys())if(n.id===e){let e=i.get(n);if(e){let i=!1;switch(r.state){case`active`:i=r.hitRegions.some(e=>e.group===n);break}return{flexGrow:e.layout[t]??1,pointerEvents:i?`none`:void 0}}}return{flexGrow:n?.[t]??1}}),w=AH({defaultLayout:n,disableCursor:r}),T=(0,B.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=PV(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=PV(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},togglePanelDisabled:(e,t)=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let{mountedGroups:r}=HV();for(let e of r.keys())if(e.id===_){let t=r.get(e);t&&(t.derivedPanelConstraints=MV(e))}},toggleSeparatorDisabled:(e,t)=>{let n=x.current.separators.find(t=>t.id===e);n&&(n.disabled=t)}}),[C,_,b,u,w]),E=(0,B.useRef)(null);return DH(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={defaultLayout:n,disableCursor:!!w.disableCursor,disabled:!!i,element:e,id:_,inMemoryLastExpandedPanelSizes:x.current.lastExpandedPanelSizes,inMemoryLayouts:x.current.layouts,orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=Y7e(r),o=HV().mountedGroups.get(r);if(o){let{defaultLayoutDeferred:e,derivedPanelConstraints:t,layout:n}=o;!e&&t.length>0&&(h(n),g(n))}let s=VV.addListener(`interactionStateChange`,e=>{e.state}),c=VV.addListener(`mountedGroupsChange`,e=>{let t=e.get(r);if(t){let{defaultLayoutDeferred:e,derivedPanelConstraints:n,layout:r}=t;if(e||n.length===0)return;let{interactionState:i}=HV(),a=i.state!==`active`;h(r),a&&g(r)}});return()=>{E.current=null,a(),s(),c()}},[i,_,g,h,u,y,w]),(0,B.useEffect)(()=>{let e=E.current;e&&(e.defaultLayout=n,e.disableCursor=!!r)}),(0,K.jsx)(jH.Provider,{value:T,children:(0,K.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,dis
280play:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`},children:e})})}MH.displayName=`Group`;function NH(){let e=(0,B.useContext)(jH);return NV(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Q7e(e,t){let{id:n}=NH(),r=(0,B.useRef)({collapse:cH,expand:cH,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:cH});(0,B.useImperativeHandle)(t,()=>r.current,[]),DH(()=>{Object.assign(r.current,eH({groupId:n,panelId:e}))})}function PH({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,id:s,maxSize:c=`100%`,minSize:l=`0%`,onResize:u,panelRef:d,style:f,...p}){let m=!!s,h=EH(s),g=AH({disabled:a}),_=(0,B.useRef)(null),v=kH(_,o),{getPanelStyles:y,id:b,registerPanel:x,togglePanelDisabled:S}=NH(),C=u!==null,w=OH((e,t,n)=>{u?.(e,s,n)});DH(()=>{let e=_.current;if(e!==null)return x({element:e,id:h,idIsStable:m,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:C?w:void 0,panelConstraints:{collapsedSize:n,collapsible:r,defaultSize:i,disabled:g.disabled,maxSize:c,minSize:l}})},[n,r,i,C,h,m,c,l,w,x,g]),(0,B.useEffect)(()=>{S(h,!!a)},[a,h,S]),Q7e(h,d);let T=(0,B.useSyncExternalStore)(e=>(VV.addListener(`mountedGroupsChange`,e),()=>{VV.removeListener(`mountedGroupsChange`,e)}),()=>JSON.stringify(y(b,h)),()=>JSON.stringify(y(b,h)));return(0,K.jsx)(`div`,{...p,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":h,id:h,ref:v,style:{...$7e,dis
280play:`flex`,flexBasis:0,flexShrink:1,overflow:`hidden`,...JSON.parse(T)},children:(0,K.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,...f},children:e})})}PH.displayName=`Panel`;var $7e={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function e9e({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=$V({layout:ZV({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=$V({layout:ZV({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function FH({children:e,className:t,disabled:n,elementRef:r,id:i,style:a,...o}){let s=EH(i),c=AH({disabled:n}),[l,u]=(0,B.useState)({}),[d,f]=(0,B.useState)(`inactive`),p=(0,B.useRef)(null),m=kH(p,r),{disableCursor:h,id:g,orientation:_,registerSeparator:v,toggleSeparatorDisabled:y}=NH(),b=_===`horizontal`?`vertical`:`horizontal`;DH(()=>{let e=p.current;if(e!==null){let t={disabled:c.disabled,element:e,id:s},n=v(t),r=VV.addListener(`interactionStateChange`,e=>{f(e.state!==`inactive`&&e.hitRegions.some(e=>e.separator===t)?e.state:`inactive`)}),i=VV.addListener(`mountedGroupsChange`,e=>{e.forEach(({derivedPanelConstraints:e,layout:n,separatorToPanels:r},i)=>{if(i.id===g){let a=r.get(t);if(a){let t=a[0],r=i.panels.indexOf(t);u(e9e({layout:n,panelConstraints:e,panelId:t.id,panelIndex:r}))}}})});return()=>{r(),i(),n()}}},[g,s,v,c]),(0,B.useEffect)(()=>{y(s,!!n)},[n,s,y]);let x;return n&&!h&&(x=`not-allowed`),(0,K.jsx)(`div`,{...o,"aria-controls":l.valueControls,"aria-disabled":n||void 0,"aria-orientation":b,"aria-valuemax":l.valueMax,"aria-valuemin":l.valueMin,"aria-valuenow":l.valueNow,children:e,className:t,"data-separator":n?`disabled`:d,"data-testid":s,id:s,ref:m,role:`separator`,style:{flexBasis:`auto`,cursor:x,...a,flexGrow:0,flexShrink:0},tabIndex:n?void 0:0})}FH.displayName=`Separator`;function IH({className:e,...t}){return(0,K.jsx)(MH,{"data-slot":`resizable-panel-group`,className:q(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function LH({...e}){return(0,K.jsx)(PH,{"data-slot":`resizable-panel`,...e})}function RH({withHandle:e,className:t,...n}){return(0,K.jsx)(FH,{"data-slot":`resizable-handle`,className:q(`bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...n,children:e&&(0,K.jsx)(`div`,{className:`bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border`,children:(0,K.jsx)(Ioe,{className:`size-2.5`})})})}const zH={healthy:`bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300`,watch:`bg-yellow-100 text-yellow-800 dark:bg-yellow-900/40 dark:text-yellow-300`,at_risk:`bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300`,high_risk:`bg-orange-100 text-orange-800 dark:bg-orange-900/40 dark:text-orange-300`,critical:`bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300`},BH={healthy:`bg-emerald-500`,watch:`bg-yellow-500`,at_risk:`bg-amber-500`,high_risk:`bg-orange-500`,critical:`bg-red-500`},t9e={healthy:`#10b981`,watch:`#eab308`,at_risk:`#f59e0b`,high_risk:`#f97316`,critical:`#ef4444`};function VH(e){return e<=20?`healthy`:e<=40?`watch`:e<=60?`at_risk`:e<=80?`high_risk`:`critical`}const n9e={critical:`bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300`,high:`bg-orange-100 text-orange-800 dark:bg-orange-900/40 dark:text-orange-300`,medium:`bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300`,low:`bg-neutral-100 text-neutral-600 dar
280k:bg-neutral-800 dark:text-neutral-300`},HH=[`single_thread`,`engagement_decay`,`concerns`,`pilot_stall`],r9e={single_thread:`stakeholder_drop`,engagement_decay:`response_lag`,concerns:`value_gap`,pilot_stall:`implementation_drift`},i9e={stakeholder_drop:3,response_lag:3,value_gap:3,implementation_drift:2},a9e=[{key:`engagement`,max:35},{key:`sentiment`,max:25},{key:`outcomes`,max:30},{key:`relationship`,max:10}];var o9e=new Set(`gmail.com,googlemail.com,outlook.com,hotmail.com,hotmail.co.uk,live.com,live.co.uk,msn.com,yahoo.com,ymail.com,rocketmail.com,icloud.com,me.com,mac.com,proton.me,protonmail.com,pm.me,gmx.com,gmx.net,gmx.de,aol.com,zoho.com,fastmail.com,mail.com,yandex.com,hey.com`.split(`,`)),s9e=new Set([`yahoo`,`gmx`]);function c9e(e){let t=(e||``).trim().toLowerCase().replace(/^@+/,``);return t.includes(`@`)&&(t=t.split(`@`).pop()??``),t=t.replace(/^\.+|\.+$/g,``),!t||!t.includes(`.`)||t.includes(` `)?null:t}function l9e(e){let t=c9e(e);return t?o9e.has(t)?!0:s9e.has(t.split(`.`)[0]):!1}function UH({label:e,values:t,onChange:n,placeholder:r,validate:i,hint:a}){let{t:o}=V(),[s,c]=(0,B.useState)(``),l=[];if(i)for(let e of t){let t=i(e);t&&l.push(t)}let u=e=>{let r=e.trim().toLowerCase();if(r){if(t.some(e=>e.toLowerCase()===r)){c(``);return}n([...t,r]),c(``)}},d=e=>{e.key===`Enter`||e.key===`,`?(e.preventDefault(),u(s)):e.key===`Backspace`&&!s&&t.length>0&&n(t.slice(0,-1))},f=e=>n(t.filter((t,n)=>n!==e));return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{children:e}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 rounded-md border border-input bg-transparent px-2 py-1.5`,children:[t.map((e,t)=>(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-neutral-200 px-1.5 py-0.5 text-xs dark:bg-neutral-700`,children:[e,(0,K.jsx)(`button`,{type:`button`,onClick:()=>f(t),className:`text-muted-foreground hover:text-foreground`,"aria-label":o(`customer_success.dialog.remove_chip`),children:(0,K.jsx)(J_,{className:`size-3`})})]},`${e}-${t}`)),(0,K.jsx)(dP,{value:s,onChange:e=>c(e.target.value),onKeyDown:d,onBlur:()=>u(s),placeholder:t.length===0?r:``,className:`h-6 flex-1 border-0 p-0 shadow-none focus-visible:ring-0`})]}),a&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a}),l.map((e,t)=>(0,K.jsx)(`p`,{className:`text-xs text-amber-600 dark:text-amber-500`,children:e},t))]})}function u9e({customer:e,initialName:t,initialDomains:n,onDone:r}){let{t:i}=V(),a=bL(e=>e.createCustomer),o=bL(e=>e.updateCustomer),s=!!e,[c,l]=(0,B.useState)(e?.name??t??``),[u,d]=(0,B.useState)(e?.domains??n??[]),[f,p]=(0,B.useState)(e?.contact_emails??[]),[m,h]=(0,B.useState)(e?.arr==null?``:String(e.arr)),[g,_]=(0,B.useState)(e?.notes??``),[v,y]=(0,B.useState)(!1);return(0,K.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault(),y(!0);let n=m.trim()===``?null:Number(m),i={name:c.trim(),domains:u,contact_emails:f,arr:Number.isFinite(n)?n:null,notes:g.trim()||null},l=!1;l=s&&e?await o(e.id,i):await a(i)!==null,y(!1),l&&r()},children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:i(s?`customer_success.dialog.edit_title`:`customer_success.dialog.create_title`)}),(0,K.jsx)(JC,{children:i(`customer_success.dialog.subtitle`)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 py-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-name`,children:i(`customer_success.dialog.name`)}),(0,K.jsx)(dP,{id:`cs-name`,value:c,onChange:e=>l(e.target.value),required:!0,maxLength:255,placeholder:i(`customer_success.dialog.name_placeholder`)})]}),(0,K.jsx)(UH,{label:i(`customer_success.dialog.domains`),values:u,onChange:d,placeholder:`acme.com`,validate:e=>l9e(e)?i(`customer_success.dialog.freemail_warning`):null,hint:i(`customer_success.dialog.domains_hint`)}),(0,K.jsx)(UH,{label:i(`customer_success.dialog.contacts`),values:f,onChange:p,placeholder:`[email protected]`,hint:i(`customer_success.dialog.contacts_hint`)}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-arr`,children:i(`customer_success.dialog.arr`)}),(0,K.jsx)(dP,{id:`cs-arr`,type:`number`,min:0,step:`0.01`,value:m,onChange:e=>h(e.target.value),placeholder:`0.00`})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-notes`,children:i(`customer_success.dialog.notes`)}),(0,K.jsx)(hP,{id:`cs-notes`,value:g,onChange:e=>_(e.target.value),rows:3})]})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:r,children:i(`common.cancel`)}),(0,K.jsx)(J,{type:`submit`,disabled:v||!c.trim(),children:i(s?`customer_success.dialog.save`:`customer_success.dialog.create`)})]})]})}function WH({open:e,onOpenChange:t,customer:n,initialName:r,initialDomains:i}){return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsx)(WC,{className:`sm:max-w-lg`,children:e&&(0,K.jsx)(u9e,{customer:n,initialName:r,initialDomains:i,onDone:()=>t(!1)})})})}function d9e(e){let t=(e.split(`.`)[0]||e).trim();return t?t.charAt(0).toUpperCase()+t.slice(1):e}function f9e({suggestion:e,canMutate:t,onConfirm:n,onDismiss:r}){let{t:i}=V(),a=e.sample_contacts??[];return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1 border-b border-border px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.domain}),(0,K.jsx)(`span`,{className:`ml-auto shrink-0 text-[10px] text-muted-foreground`,children:i(`customer_success.discovery.count`,{events:e.event_c
280ount,contacts:e.contact_count})})]}),a.length>0&&(0,K.jsx)(`p`,{className:`truncate text-[10px] text-muted-foreground`,children:a.join(`, `)}),t&&(0,K.jsxs)(`div`,{className:`mt-0.5 flex gap-1`,children:[(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 flex-1 text-[11px]`,onClick:n,children:[(0,K.jsx)(T_,{className:`size-3`}),i(`customer_success.discovery.confirm`)]}),(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`ghost`,className:`h-6 text-[11px] text-muted-foreground`,onClick:r,children:[(0,K.jsx)(J_,{className:`size-3`}),i(`customer_success.discovery.dismiss`)]})]})]})}function p9e({canMutate:e}){let{t}=V(),n=AL(e=>e.suggestions),r=AL(e=>e.fetchSuggestions),i=AL(e=>e.dismissDomain),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(null);return(0,B.useEffect)(()=>{r()},[r]),n.length===0?null:(0,K.jsxs)(`div`,{className:`border-b border-border bg-muted/30`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{let e=!a;o(e),e&&r()},className:`flex w-full items-center gap-1.5 px-3 py-2 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[a?(0,K.jsx)(Rg,{className:`size-3.5`}):(0,K.jsx)(Bg,{className:`size-3.5`}),(0,K.jsx)(L_,{className:`size-3.5 text-emerald-600 dark:text-emerald-500`}),t(`customer_success.discovery.title`),(0,K.jsx)(`span`,{className:`ml-auto rounded bg-emerald-100 px-1.5 text-[10px] text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-300`,children:n.length})]}),a&&(0,K.jsx)(`div`,{className:`max-h-64 overflow-y-auto`,children:n.map(t=>(0,K.jsx)(f9e,{suggestion:t,canMutate:e,onConfirm:()=>c({name:d9e(t.domain),domains:[t.domain]}),onDismiss:()=>void i(t.domain)},t.domain))}),(0,K.jsx)(WH,{open:s!==null,onOpenChange:e=>{e||c(null)},initialName:s?.name,initialDomains:s?.domains})]})}function m9e({customer:e,active:t,onSelect:n}){let{t:r}=V(),i=e.domains??[],a=e.events_30d??0,o=e.risk_band??null;return(0,K.jsxs)(`button`,{type:`button`,onClick:n,className:`flex w-full flex-col gap-1 border-b border-border px-3 py-2.5 text-left hover:bg-neutral-100 dark:hover:bg-neutral-800 ${t?`bg-neutral-200 dark:bg-neutral-700`:``}`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.name}),e.status===`archived`&&(0,K.jsx)(lR,{variant:`secondary`,className:`text-[10px]`,children:r(`customer_success.detail.archived`)}),(0,K.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:[o&&(0,K.jsx)(lR,{className:`border-0 text-[10px] ${zH[o]??``}`,children:r(`customer_success.risk.bands.${o}`,{defaultValue:o})}),a>0&&(0,K.jsx)(lR,{variant:`outline`,className:`text-[10px]`,children:a})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[i.slice(0,2).map(e=>(0,K.jsx)(`span`,{className:`rounded bg-neutral-100 px-1 text-[10px] text-muted-foreground dark:bg-neutral-800`,children:e},e)),i.length>2&&(0,K.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[`+`,i.length-2]})]}),e.last_event_at&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:Db(e.last_event_at)})]})}function h9e({selectedId:e,onSelect:t,onCreate:n,onImport:r,canMutate:i}){let{t:a}=V(),o=bL(e=>e.customers),s=bL(e=>e.loading),c=bL(e=>e.search),l=bL(e=>e.setSearch),u=bL(e=>e.includeArchived),d=bL(e=>e.setIncludeArchived);return(0,K.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border p-2`,children:[(0,K.jsxs)(`div`,{className:`relative flex-1`,children:[(0,K.jsx)(A_,{className:`absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,K.jsx)(dP,{value:c,onChange:e=>l(e.target.value),placeholder:a(`customer_success.list.search_placeholder`),className:`h-8 pl-7 text-sm`})]}),(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsx)(o6e,{size:`sm`,pressed:u,onPressedChange:d,"aria-label":a(u?`customer_success.list.hide_archived`:`customer_success.list.show_archived`),className:`h-8`,children:(0,K.jsx)(Cg,{className:`size-4`})})}),(0,K.jsx)(GT,{children:a(u?`customer_success.list.hide_archived`:`customer_success.list.show_archived`)})]}),i&&r&&(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`outline`,onClick:r,className:`h-8`,"aria-label":a(`customer_success.import.title`),children:(0,K.jsx)(Doe,{className:`size-4`})})}),(0,K.jsx)(GT,{children:a(`customer_success.import.title`)})]}),i&&(0,K.jsx)(J,{type:`button`,size:`sm`,onClick:n,className:`h-8`,children:(0,K.jsx)(T_,{className:`size-4`})})]}),(0,K.jsx)(p9e,{canMutate:i}),(0,K.jsx)(IL,{type:`auto`,className:`min-h-0 flex-1`,children:s&&o.length===0?(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(W,{className:`size-5 animate-spin text-muted-foreground`})}):o.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center text-muted-foreground`,children:[(0,K.jsx)(Mse,{className:`size-8`}),(0,K.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:a(`customer_success.list.empty_title`)}),i&&(0,K.jsx)(J,{type:`button`,size:`sm`,onClick:n,children:a(`customer_success.list.add_first`)})]}):o.map(n=>(0,K.jsx)(m9e,{customer:n,active:n.id===e,onSelect:()=>t(n.id)},n.id))})]})}function GH(e){let t=document.createElement(`a`);t.href=XI(e),t.download=``,t.rel=`noopener`,document.body.appendChild(t),t.click(),t.remove()}async function KH(e){GH((await ex(e,{preview:!1,attachment:!0})).data.download_url)}function qH(e){if(e==null)return null;let t=Number(e);return Number.isFinite(t)?t:null}function g9e(){let{t:e}=V(),t=bL(e=>e.detail),n=bL(e=>e.timeline),r=bL(e=>e.selectedId),i=bL(e=>e.summary),a=bL(e=>e.summaryGenerating),o=bL(e=>e.regenerateSummary),s=BS();if(!t)return null;
280let c=qH(t.risk_score),l=qH(t.health_score),u=qH(t.events_30d),d=qH(t.days_since_contact),f=t.risk_band??null,p=t.risk_calibrating===!0||c==null,m=t.risk_pillars??{};if(!(t.risk_calibrating!=null||l!=null||c!=null)&&n.length===0)return null;let h=[],g=null;p?g=e(`customer_success.timeline.summary.risk_calibrating`):f&&(g=e(`customer_success.timeline.summary.risk_band`,{band:e(`customer_success.risk.bands.${f}`,{defaultValue:f}),score:c})),g&&l!=null?g=e(`customer_success.timeline.summary.with_health`,{status:g,health:l}):g&&l==null&&(g=e(`customer_success.timeline.summary.health_calibrating`,{status:g})),g&&h.push(`${g}.`);let _=u??n.length,v;v=_===0?e(`customer_success.timeline.summary.activity_none`):e(_===1?`customer_success.timeline.summary.activity_one`:`customer_success.timeline.summary.activity_other`,{count:_});let y=null;d!=null&&(y=d<=0?e(`customer_success.timeline.summary.last_contact_today`):d===1?e(`customer_success.timeline.summary.last_contact_yesterday`):e(`customer_success.timeline.summary.last_contact_days`,{count:d})),h.push(y?`${v}, ${y}.`:`${v}.`);let b=HH.map(e=>({key:e,score:qH(m[e])??0})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score).slice(0,3).map(t=>e(`customer_success.risk.pillars.${t.key}`,{defaultValue:t.key}));b.length>0&&h.push(`${e(`customer_success.timeline.summary.drivers`,{list:b.join(`, `)})}.`),h.length===0&&h.push(e(`customer_success.timeline.summary.nothing`));let x=a||i?.generating===!0,S=i?.summary?.trim()||null,C=i?.error?Ub(i.error,{operation:`cs.loadSummary`})??e(`customer_success.timeline.summary.ai_error`):null,w=s?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r&&void o(r),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,K.jsx)(L_,{className:`size-3`}),e(`customer_success.timeline.summary.generate`)]}):null;return(0,K.jsxs)(`div`,{className:`mb-4 rounded-md border border-border bg-muted/40 p-3`,children:[(0,K.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,K.jsx)(Sg,{className:`size-3.5`}),e(`customer_success.timeline.summary.title`)]}),(0,K.jsx)(`p`,{className:`text-sm leading-relaxed text-foreground`,children:h.join(` `)}),(0,K.jsxs)(`div`,{className:`mt-3 border-t border-border/60 pt-3`,children:[(0,K.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,K.jsx)(L_,{className:`size-3.5`}),e(`customer_success.timeline.summary.ai_title`)]}),S&&!x&&s&&(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r&&void o(r),className:`inline-flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,K.jsx)(E_,{className:`size-3`}),e(`customer_success.timeline.summary.refresh`)]})]}),x?(0,K.jsx)(zI,{label:e(`customer_success.timeline.summary.generating`)}):S?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`text-sm leading-relaxed text-foreground`,children:S}),i?.computed_at&&(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`customer_success.timeline.summary.updated_ago`,{ago:Db(i.computed_at)})})]}):C?(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:C}),w]}):(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`customer_success.timeline.summary.ai_empty`)}),w]})]})]})}const JH=[`fits`,`partial`,`does_not_fit`,`unclear`],YH={fits:`bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300`,partial:`bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300`,does_not_fit:`bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300`,unclear:`bg-neutral-100 text-neutral-600 dar
280k:bg-neutral-800 dark:text-neutral-300`},_9e={fits:`bg-emerald-500`,partial:`bg-amber-500`,does_not_fit:`bg-red-500`,unclear:`bg-neutral-400`},XH={fits:70,partial:40};var v9e={fits:1,partial:.5,does_not_fit:0},y9e=.5;function b9e(e){return JH.includes(e)}function x9e(e){return e>=XH.fits?`fits`:e>=XH.partial?`partial`:`does_not_fit`}function S9e(e,t){return e===null||new Date(t).getTime()>new Date(e).getTime()?t:e}function C9e(e){let t={fits:0,partial:0,does_not_fit:0,unclear:0},n=0,r=0,i=0,a=0,o=null;for(let s of e){if(s.stale===!0&&(a+=1),s.computed_at&&(o=S9e(o,s.computed_at)),!b9e(s.verdict))continue;t[s.verdict]+=1;let e=v9e[s.verdict];if(e===void 0)continue;let c=s.confidence??y9e;n+=1,r+=c*e,i+=c}if(n===0||i===0)return{counts:t,scored:n,fitPct:null,overall:`unclear`,staleCount:a,latestComputedAt:o};let s=Math.round(100*r/i);return{counts:t,scored:n,fitPct:s,overall:x9e(s),staleCount:a,latestComputedAt:o}}function w9e(e,t){return t.size===0?e:e.filter(e=>!e.latest_event_id||!t.has(e.latest_event_id))}function ZH({verdict:e}){let{t}=V(),n=e.stale===!0,r=e.confidence==null?null:Math.round(e.confidence*100),i=t(`customer_success.icp.verdicts.${e.verdict}`,{defaultValue:e.verdict});return(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(`span`,{className:q(`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium`,YH[e.verdict]),children:[(0,K.jsx)(B_,{className:`size-3`}),i]}),r!=null&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`customer_success.icp.confidence`,{pct:r})})]}),(0,K.jsx)(`p`,{className:`text-sm leading-relaxed text-foreground`,children:e.explanation}),e.key_signals&&e.key_signals.length>0&&(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:t(`customer_success.icp.signals_title`)}),(0,K.jsx)(`ul`,{className:`list-disc space-y-0.5 pl-4`,children:e.key_signals.map((e,t)=>(0,K.jsx)(`li`,{className:`text-xs text-foreground`,children:e},t))})]}),n&&(0,K.jsx)(`p`,{className:`text-xs italic text-amber-700 dark:text-amber-400`,children:t(`customer_success.icp.stale_hint`)})]})}function T9e({verdict:e,customerId:t,canMutate:n}){let{t:r}=V(),i=PL(e=>e.evaluating[t]??!1),a=PL(e=>e.reevaluateCustomer),o=e.stale===!0,s=r(`customer_success.icp.verdicts.${e.verdict}`,{defaultValue:e.verdict});return(0,K.jsxs)(aP,{children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,title:o?r(`customer_success.icp.stale_hint`):void 0,className:q(`inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium transition-opacity`,YH[e.verdict],o&&`opacity-50`),children:[(0,K.jsx)(B_,{className:`size-2.5`}),s]})}),(0,K.jsx)(sP,{className:`w-80 p-3`,align:`start`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(ZH,{verdict:e}),i?(0,K.jsx)(zI,{label:r(`customer_success.icp.evaluating`)}):(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2 pt-1`,children:[e.computed_at&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`customer_success.icp.evaluated_ago`,{ago:Db(e.computed_at)})}),n&&(0,K.jsxs)(`button`,{type:`button`,onClick:()=>void a(t),className:`ml-auto inline-flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,K.jsx)(E_,{className:`size-3`}),r(`customer_success.icp.reevaluate`)]})]})]})})]})}function E9e(){let e=fS();return(0,B.useMemo)(()=>{let t=[];for(let n of eS)for(let r of e[n].accounts)t.push({id:r.id,email:r.email,provider:n});return t},[e])}function D9e({customerId:e,selected:t,canMutate:n}){let{t:r}=V(),i=E9e(),a=bL(e=>e.setIngestMailboxes);if((0,B.useEffect)(()=>{for(let e of eS){let t=lS[e].getStatus();!t.initialized&&!t.loading&&lS[e].fetchStatus()}},[]),i.length<2)return null;let o=i.map(e=>e.id),s=Array.isArray(t)&&t.length>0,c=new Set(s?t.filter(e=>o.includes(e)):o),l=c.size===i.length,u=t=>{a(e,t.size===i.length?[]:Array.from(t))},d=e=>{let t=new Set(c);
280if(t.has(e)){if(t.size===1)return;t.delete(e)}else t.add(e);u(t)},f=l?r(`customer_success.timeline.mailboxes_all`):r(`customer_success.timeline.mailboxes_count`,{count:c.size,total:i.length});return(0,K.jsxs)(LD,{children:[(0,K.jsx)(RD,{asChild:!0,children:(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,disabled:!n,className:`h-7 gap-1.5 text-xs text-muted-foreground`,children:[(0,K.jsx)(l_,{className:`size-3.5`}),f]})}),(0,K.jsxs)(zD,{align:`start`,className:`w-64`,children:[(0,K.jsx)(UD,{className:`text-xs`,children:r(`customer_success.timeline.mailboxes_label`)}),(0,K.jsx)(WD,{}),(0,K.jsx)(VD,{onSelect:e=>e.preventDefault(),onClick:()=>u(new Set(o)),className:`text-xs`,children:r(`customer_success.timeline.mailboxes_all`)}),(0,K.jsx)(WD,{}),i.map(e=>(0,K.jsxs)(HD,{checked:c.has(e.id),onCheckedChange:()=>d(e.id),onSelect:e=>e.preventDefault(),className:`text-xs`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.email}),(0,K.jsx)(`span`,{className:`ml-2 shrink-0 text-[10px] capitalize text-muted-foreground`,children:e.provider})]},e.id))]})]})}var QH=[];function O9e({eventType:e,direction:t}){return e===`transcript`?(0,K.jsx)(ese,{className:`size-4 text-violet-600 dark:text-violet-500`}):t===`inbound`?(0,K.jsx)(qae,{className:`size-4 text-emerald-600 dark:text-emerald-500`}):t===`outbound`?(0,K.jsx)(Jae,{className:`size-4 text-blue-600 dark:text-blue-500`}):(0,K.jsx)(__,{className:`size-4 text-muted-foreground`})}function k9e(e){if(e.event_type!==`transcript`)return null;let t=e.payload;return t?.document_id?{id:t.document_id,filename:t.filename??null}:null}function $H(e){let t=new Map;for(let n of e){let e=Tb(n.occurred_at),r=t.get(e);r?r.push(n):t.set(e,[n])}return Array.from(t.entries())}function eU({event:e,icpVerdict:t,canMutate:n,hidden:r=!1}){let{t:i}=V(),a=e.payload?.provider,o=bL(e=>e.selectedId),s=bL(e=>e.hideEvent),c=bL(e=>e.unhideEvent),l=AL(t=>t.eventBodies[e.id]),u=AL(e=>e.loadEventBody),d=Q(e=>e.viewDocumentInKB),[f,p]=(0,B.useState)(!1),m=e.has_body??!1,h=k9e(e),g=async e=>{try{await KH(e)}catch(t){Y(t,i(`errors.download_failed`),{operation:`download_cs_transcript`,metadata:{documentId:e}})}};return(0,K.jsx)(`div`,{className:`py-2.5`,children:(0,K.jsxs)(`div`,{className:`flex gap-3`,children:[(0,K.jsx)(`div`,{className:`mt-0.5`,children:(0,K.jsx)(O9e,{eventType:e.event_type,direction:e.direction})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.title||e.actor_name||e.actor_email||`â`}),a&&(0,K.jsx)(lR,{variant:`outline`,className:`shrink-0 text-[10px] capitalize`,children:a}),t&&o&&(0,K.jsx)(T9e,{verdict:t,customerId:o,canMutate:n}),(0,K.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:Eb(e.occurred_at)})]}),e.actor_email&&(0,K.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.actor_name?`${e.actor_name} <${e.actor_email}>`:e.actor_email}),e.snippet&&!f&&(0,K.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.snippet}),(m||h||n)&&(0,K.jsxs)(`div`,{className:`mt-1 flex items-center gap-3`,children:[h&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>d(h.id,h.filename),className:`flex items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground`,children:[(0,K.jsx)(i_,{className:`size-3`}),i(`customer_success.timeline.view_transcript`)]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>void g(h.id),className:`flex items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground`,children:[(0,K.jsx)(Xg,{className:`size-3`}),i(`customer_success.timeline.download_transcript`)]})]}),m&&(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{let t=!f;p(t),t&&o&&!l&&u(o,e.id)},className:`flex items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground`,children:[f?(0,K.jsx)(Rg,{className:`size-3`}):(0,K.jsx)(Bg,{className:`size-3`}),i(f?`customer_success.timeline.collapse`:`customer_success.timeline.show_full`)]}),n&&(0,K.jsxs)(`button`,{type:`button`,onClick:()=>void(r?c(e.id):s(e.id)),className:`flex items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground`,children:[r?(0,K.jsx)(mse,{className:`size-3`}):(0,K.jsx)(e_,{className:`size-3`}),i(r?`customer_success.timeline.restore`:`customer_success.timeline.hide`)]})]}),f&&(0,K.jsx)(`div`,{className:`mt-1.5 rounded border border-border bg-muted/40 p-2`,children:l?.loading?(0,K.jsx)(`div`,{className:`flex justify-center py-2`,children:(0,K.jsx)(W,{className:`size-4 animate-spin text-muted-foreground`})}):l?.body?(0,K.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-sans text-xs text-foreground`,children:l.body}):(0,K.jsx)(`p`,{className:`text-xs italic text-muted-foreground`,children:i(`customer_success.timeline.no_body`)})})]})]})})}function A9e(){let{t:e}=V(),t=bL(e=>e.timeline),n=bL(e=>e.timelineLoading),r=bL(e=>e.timelineHasMore),i=bL(e=>e.loadMoreTimeline),a=bL(e=>e.selectedId),o=bL(e=>e.detail),s=bL(e=>e.hiddenEvents),c=bL(e=>e.showHidden),l=bL(e=>e.toggleShowHidden),u=BS(),d=PL(e=>e.loadVerdicts),f=PL(e=>a?e.verdictsByCustomer[a]??QH:QH);(0,B.useEffect)(()=>{a&&d(a)},[a,d]);let p=(0,B.useMemo)(()=>new Map(f.filter(e=>e.latest_event_id).map(e=>[e.latest_event_id,e])),[f]),m=$H(t),h=Array.isArray(o?.ingest_account_ids)&&o.ingest_account_ids.length>0,g=!n&&t.length===0,_=g&&s.length===0&&!h;return(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[(0,K.jsx)(g9e,{}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between py-1`,children:[(0,K.jsx)(`div`,{children:a&&(0,K.jsx)(D9e,{customerId:a,selected:o?.ingest_account_ids,canMutate:u})}),s.length>0&&(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>l(),className:`h-7 text-xs text-muted-foreground`,children:c?e(`customer_success.timeline.hide_hidden`):e(`customer_success.timeline.show_hidden`,{count:s.length})})]}),c&&s.length>0&&(0,K.jsxs)(`div`,{className:`mb-3 rounded-md border border-dashed border-border p-2`,children:[(0,K.jsx)(`div`,{className:`py-1 text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:e(`customer_success.timeline.hidden_section`)}),$H(s).map(([e,t])=>(0,K.jsxs)(`div`,{className:`mb-2`,children:[(0,K.jsx)(`div`,{className:`py-1 text-xs font-medium text-muted-foreground`,children:e}
280),(0,K.jsx)(`div`,{className:`divide-y divide-border`,children:t.map(e=>(0,K.jsx)(eU,{event:e,canMutate:u,hidden:!0},e.id))})]},e))]}),g?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-16 text-center text-muted-foreground`,children:[(0,K.jsx)(__,{className:`size-8`}),(0,K.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e(_?`customer_success.timeline.empty_title`:`customer_success.timeline.all_hidden_title`)}),(0,K.jsx)(`p`,{className:`max-w-sm text-xs`,children:e(_?`customer_success.timeline.empty_body`:`customer_success.timeline.all_hidden_body`)})]}):(0,K.jsxs)(K.Fragment,{children:[m.map(([e,t])=>(0,K.jsxs)(`div`,{className:`mb-2`,children:[(0,K.jsx)(`div`,{className:`sticky top-0 z-10 bg-background/95 py-1 text-xs font-medium text-muted-foreground backdrop-blur`,children:e}),(0,K.jsx)(`div`,{className:`divide-y divide-border`,children:t.map(e=>(0,K.jsx)(eU,{event:e,icpVerdict:p.get(e.id),canMutate:u},e.id))})]},e)),r&&(0,K.jsx)(`div`,{className:`flex justify-center py-3`,children:(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void i(),disabled:n,children:[n&&(0,K.jsx)(W,{className:`mr-2 size-3 animate-spin`}),e(`customer_success.timeline.load_more`)]})})]}),n&&t.length===0&&(0,K.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,K.jsx)(W,{className:`size-5 animate-spin text-muted-foreground`})})]})}function j9e({customerId:e,project:t,onDone:n}){let{t:r}=V(),i=wL(e=>e.createProject),a=wL(e=>e.updateProject),o=!!t,[s,c]=(0,B.useState)(t?.name??``),[l,u]=(0,B.useState)(t?.description??``),[d,f]=(0,B.useState)(t?.target_date?String(t.target_date).slice(0,10):``),[p,m]=(0,B.useState)(!1);return(0,K.jsxs)(`form`,{onSubmit:async r=>{r.preventDefault(),m(!0);let c={name:s.trim(),description:l.trim(),target_date:d?new Date(d).toISOString():null},u=!1;u=o&&t?await a(t.id,e,c):await i(e,c)!==null,m(!1),u&&n()},children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:r(o?`customer_success.roadmap.project_dialog.edit_title`:`customer_success.roadmap.project_dialog.create_title`)}),(0,K.jsx)(JC,{children:r(`customer_success.roadmap.project_dialog.subtitle`)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 py-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-project-name`,children:r(`customer_success.roadmap.project_dialog.name`)}),(0,K.jsx)(dP,{id:`cs-project-name`,value:s,onChange:e=>c(e.target.value),required:!0,maxLength:255,placeholder:r(`customer_success.roadmap.project_dialog.name_placeholder`)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-project-desc`,children:r(`customer_success.roadmap.project_dialog.description`)}),(0,K.jsx)(hP,{id:`cs-project-desc`,value:l,onChange:e=>u(e.target.value),rows:3})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-project-target`,children:r(`customer_success.roadmap.project_dialog.target_date`)}),(0,K.jsx)(dP,{id:`cs-project-target`,type:`date`,value:d,onChange:e=>f(e.target.value)})]})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:n,children:r(`common.cancel`)}),(0,K.jsx)(J,{type:`submit`,disabled:p||!s.trim(),children:r(o?`customer_success.roadmap.project_dialog.save`:`customer_success.roadmap.project_dialog.create`)})]})]})}function M9e({open:e,onOpenChange:t,customerId:n,project:r}){return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsx)(WC,{className:`sm:max-w-lg`,children:e&&(0,K.jsx)(j9e,{customerId:n,project:r,onDone:()=>t(!1)})})})}function N9e(e){return(e.phases??[]).slice().sort((e,t)=>(e.order??0)-(t.order??0)).map(e=>({...e,milestones:(e.milestones??[]).slice().sort((e,t)=>(e.order??0)-(t.order??0))}))}function P9e(e){let t=[];for(let n of e)for(let e of n.milestones??[])t.push({id:e.id,title:e.title,phaseId:n.id,phaseTitle:n.title});return t}function F9e(e,t=new Date){if(!e.due_date||e.status===`done`)return!1;let n=new Date(e.due_date);return Number.isNaN(n.getTime())?!1:n<new Date(t.getFullYear(),t.getMonth(),t.getDate())}function I9e({projectId:e,task:t,phases:n,onDone:r}){let{t:i}=V(),a=wL(e=>e.createTask),o=wL(e=>
280e.updateTask),s=!!t,[c,l]=(0,B.useState)(t?.title??``),[u,d]=(0,B.useState)(t?.description??``),[f,p]=(0,B.useState)(t?.status??`todo`),[m,h]=(0,B.useState)(t?.priority??`none`),[g,_]=(0,B.useState)(t?.due_date?String(t.due_date).slice(0,10):``),[v,y]=(0,B.useState)(t?.assignee_name??``),[b,x]=(0,B.useState)(t?.roadmap_milestone_id??`none`),[S,C]=(0,B.useState)(!1),w=P9e(n);return(0,K.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault(),C(!0);let i=w.find(e=>e.id===b),l={title:c.trim(),description:u.trim()||null,status:f,priority:m===`none`?null:m,due_date:g?new Date(g).toISOString():null,assignee_name:v.trim()||null,roadmap_milestone_id:i?i.id:null,roadmap_phase_id:i?i.phaseId:null};!s&&i&&(l.roadmap_milestone_title=i.title,l.roadmap_phase_title=i.phaseTitle);let d=!1;d=s&&t?await o(t.id,e,l):await a(e,l),C(!1),d&&r()},children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:i(s?`customer_success.roadmap.task_dialog.edit_title`:`customer_success.roadmap.task_dialog.create_title`)}),(0,K.jsx)(JC,{children:i(`customer_success.roadmap.task_dialog.subtitle`)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 py-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-task-title`,children:i(`customer_success.roadmap.task_dialog.title`)}),(0,K.jsx)(dP,{id:`cs-task-title`,value:c,onChange:e=>l(e.target.value),required:!0,maxLength:500})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-task-desc`,children:i(`customer_success.roadmap.task_dialog.description`)}),(0,K.jsx)(hP,{id:`cs-task-desc`,value:u,onChange:e=>d(e.target.value),rows:3})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{children:i(`customer_success.roadmap.task_dialog.status`)}),(0,K.jsxs)(vO,{value:f,onValueChange:e=>p(e),children:[(0,K.jsx)(bO,{children:(0,K.jsx)(yO,{})}),(0,K.jsxs)(xO,{children:[(0,K.jsx)(SO,{value:`todo`,children:i(`customer_success.roadmap.status.todo`)}),(0,K.jsx)(SO,{value:`in_progress`,children:i(`customer_success.roadmap.status.in_progress`)}),(0,K.jsx)(SO,{value:`done`,children:i(`customer_success.roadmap.status.done`)})]})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-task-due`,children:i(`customer_success.roadmap.task_dialog.due_date`)}),(0,K.jsx)(dP,{id:`cs-task-due`,type:`date`,value:g,onChange:e=>_(e.target.value)})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-task-assignee`,children:i(`customer_success.roadmap.task_dialog.assignee`)}),(0,K.jsx)(dP,{id:`cs-task-assignee`,value:v,onChange:e=>y(e.target.value),placeholder:i(`customer_success.roadmap.task_dialog.assignee_placeholder`),maxLength:255})]}),w.length>0&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{children:i(`customer_success.roadmap.task_dialog.milestone`)}),(0,K.jsxs)(vO,{value:b,onValueChange:x,children:[(0,K.jsx)(bO,{children:(0,K.jsx)(yO,{})}),(0,K.jsxs)(xO,{children:[(0,K.jsx)(SO,{value:`none`,children:i(`customer_success.roadmap.task_dialog.milestone_none`)}),w.map(e=>(0,K.jsxs)(SO,{value:e.id,children:[e.phaseTitle,` · `,e.title]},e.id))]})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{children:i(`customer_success.roadmap.task_dialog.priority`)}),(0,K.jsxs)(vO,{value:m,onValueChange:e=>h(e),children:[(0,K.jsx)(bO,{children:(0,K.jsx)(yO,{})}),(0,K.jsxs)(xO,{children:[(0,K.jsx)(SO,{value:`none`,children:i(`customer_success.roadmap.task_dialog.priority_none`)}),(0,K.jsx)(SO,{value:`low`,children:i(`customer_success.roadmap.priority.low`)}),(0,K.jsx)(SO,{value:`medium`,children:i(`customer_success.roadmap.priority.medium`)}),(0,K.jsx)(SO,{value:`high`,children:i(`customer_success.roadmap.priority.high`)})]})]})]})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:r,children:i(`common.cancel`)}),(0,K.jsx)(J,{type:`submit`,disabled:S||!c.trim(),children:i(s?`customer_success.roadmap.task_dialog.save`:`customer_success.roadmap.task_dialog.create`)})]})]})}function L9e({open:e,onOpenChange:t,projectId:n,task:r,phases:i=[]}){return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsx)(WC,{className:`sm:max-w-lg`,children:e&&(0,K.jsx)(I9e,{projectId:n,task:r,phases:i,onDone:()=>t(!1)})})})}var R9e={regen:`default`,skip:`secondary`,defer:`secondary`};function z9e({projectId:e}){let{t}=V(),[n,r]=(0,B.useState)(!1),i=wL(t=>t.decisionLogByProject[e]),a=wL(e=>e.fetchDecisionLog);return(0,B.useEffect)(()=>{n&&i===void 0&&a(e)},[n,i,e,a]),(0,K.jsxs)(`div`,{className:`mt-6 border-t border-border pt-3`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[n?(0,K.jsx)(Rg,{className:`size-3.5`}):(0,K.jsx)(Bg,{className:`size-3.5`}),t(`customer_success.roadmap.decision_log.title`)]}),n&&(0,K.jsx)(`div`,{className:`mt-2 flex flex-col gap-1.5`,children:(i??[]).length===0?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`customer_success.roadmap.decision_log.empty`)}):(i??[]).map(e=>(0,K.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-border/60 px-2.5 py-1.5 text-xs`,children:[(0,K.jsx)(lR,{variant:R9e[e.decision]??`secondary`,className:`mt-0.5 shrink-0`,children:e.decision}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-muted-foreground`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.signal}),(0,K.jsx)(`span`,{children:`·`}
280),(0,K.jsx)(`span`,{children:new Date(e.created_at).toLocaleString()}),e.churn_signal_detected&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-amber-600 dark:text-amber-500`,children:[(0,K.jsx)(H_,{className:`size-3`}),t(`customer_success.roadmap.decision_log.churn`)]})]}),(0,K.jsx)(`p`,{className:`mt-0.5 text-foreground/80`,children:e.reason})]})]},e.id))})]})}function B9e(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`})}var V9e={low:`secondary`,medium:`default`,high:`destructive`};function H9e({project:e,customerId:t,onEditProject:n,onDeleteProject:r}){let{t:i}=V(),a=BS(),o=VS(),s=wL(t=>t.tasksByProject[e.id]),c=wL(e=>e.fetchTasks),l=wL(e=>e.setTaskStatus),u=wL(e=>e.deleteTask),d=wL(e=>e.regenerateRoadmap),f=wL(t=>t.regenerating[e.id]),p=wL(e=>e.uploadTranscript),m=wL(e=>e.uploadingTranscript),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(null),y=(0,B.useRef)(null);(0,B.useEffect)(()=>{c(e.id)},[e.id,c]);let b=e.roadmap_status??null,x=b===`generating`||!!f,S=()=>y.current?.click(),C=async n=>{let r=n.target.files?.[0];n.target.value=``,r&&await p(t,r,e.id)},w=()=>{v(null),g(!0)},T=e=>{v(e),g(!0)},E=N9e(e),D=s??[],O=e=>D.filter(t=>t.roadmap_milestone_id===e),k=new Set(E.flatMap(e=>(e.milestones??[]).map(e=>e.id))),A=D.filter(e=>!e.roadmap_milestone_id||!k.has(e.roadmap_milestone_id));return(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h3`,{className:`truncate text-base font-semibold`,children:e.name}),e.description&&(0,K.jsx)(`p`,{className:`mt-0.5 truncate text-sm text-muted-foreground`,children:e.description})]}),a&&(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[n&&(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,onClick:n,title:i(`customer_success.roadmap.edit_project`),
280children:(0,K.jsx)(w_,{className:`size-4`})}),o&&r&&(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,onClick:r,title:i(`customer_success.roadmap.delete_project`),className:`text-muted-foreground hover:text-destructive`,children:(0,K.jsx)(V_,{className:`size-4`})}),(0,K.jsx)(`input`,{ref:y,type:`file`,accept:`.txt,.md,.vtt,.srt,.pdf,.docx`,className:`hidden`,onChange:e=>void C(e)}),(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:S,disabled:m,children:[m?(0,K.jsx)(W,{className:`size-4 animate-spin`}):(0,K.jsx)(W_,{className:`size-4`}),i(`customer_success.roadmap.add_transcript`)]}),(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void d(e.id,t),disabled:x,children:[(0,K.jsx)(E_,{className:`size-4 ${x?`animate-spin`:``}`}),i(`customer_success.roadmap.regenerate`)]}),(0,K.jsxs)(J,{type:`button`,size:`sm`,onClick:w,children:[(0,K.jsx)(T_,{className:`size-4`}),i(`customer_success.roadmap.add_task`)]})]})]}),x?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border py-10 text-sm text-muted-foreground`,children:[(0,K.jsx)(W,{className:`size-6 animate-spin`}),i(`customer_success.roadmap.generating`)]}):b===`error`?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-destructive/50 py-10 text-center`,children:[(0,K.jsx)(Hg,{className:`size-6 text-destructive`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i(`customer_success.roadmap.error`)}),a&&(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void d(e.id,t),children:[(0,K.jsx)(E_,{className:`size-4`}),i(`customer_success.roadmap.retry`)]})]}):(0,K.jsxs)(K.Fragment,{children:[b===`needs_context`&&(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-lg border border-dashed border-border px-3 py-2.5 text-sm text-muted-foreground`,children:[(0,K.jsx)(`span`,{className:`min-w-0`,children:i(`customer_success.roadmap.needs_context`)}),a&&(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`outline`,onClick:S,disabled:m,children:[(0,K.jsx)(W_,{className:`size-4`}),i(`customer_success.roadmap.add_transcript`)]})]}),E.length===0&&D.length===0?b===`needs_context`?null:(0,K.jsx)(`div`,{className:`rounded-lg border border-dashed border-border py-10 text-center text-sm text-muted-foreground`,children:i(`customer_success.roadmap.empty`)}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[E.map(t=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h4`,{className:`mb-2 text-sm font-semibold text-foreground`,children:t.title}),(0,K.jsx)(`div`,{className:`flex flex-col gap-3 border-l-2 border-border pl-3`,children:(t.milestones??[]).map(t=>(0,K.jsx)(U9e,{title:t.title,tasks:O(t.id),projectId:e.id,canMutate:a,isAdmin:o,onToggle:l,onEdit:T,onDelete:u},t.id))})]},t.id)),A.length>0&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h4`,{className:`mb-2 text-sm font-semibold text-muted-foreground`,children:i(`customer_success.roadmap.other_tasks`)}),(0,K.jsx)(`div`,{className:`flex flex-col gap-1`,children:A.map(t=>(0,K.jsx)(tU,{task:t,projectId:e.id,canMutate:a,isAdmin:o,onToggle:l,onEdit:T,onDelete:u},t.id))})]})]})]}),(0,K.jsx)(z9e,{projectId:e.id}),(0,K.jsx)(L9e,{open:h,onOpenChange:g,projectId:e.id,task:_,phases:E})]})}function U9e({title:e,tasks:t,...n}){return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:e}),(0,K.jsx)(`div`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,K.jsx)(tU,{task:e,...n},e.id))})]})}function tU({task:e,projectId:t,canMutate:n,isAdmin:r,onToggle:i,onEdit:a,onDelete:o}){let{t:s}=V(),c=e.status===`done`,l=e.status===`in_progress`,u=F9e(e);return(0,K.jsxs)(`div`,{className:`group flex items-center gap-2 rounded-md px-1.5 py-1 hover:bg-muted/50`,children:[(0,K.jsx)(`button`,{type:`button`,disabled:!n,onClick:()=>i(e.id,t,c?`todo`:`done`),className:`shrink-0 text-muted-foreground hover:text-foreground disabled:cursor-default`,children:c?(0,K.jsx)(Ug,{className:`size-4 text-emerald-600 dark:text-emerald-500`}
280):l?(0,K.jsx)(soe,{className:`size-4 text-blue-600 dark:text-blue-500`}):(0,K.jsx)(Kg,{className:`size-4`})}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm ${c?`text-muted-foreground line-through`:``}`,children:e.title}),e.assignee_name&&(0,K.jsx)(`span`,{className:`shrink-0 truncate text-xs text-muted-foreground`,children:e.assignee_name}),e.due_date&&(0,K.jsxs)(lR,{variant:u?`destructive`:`secondary`,className:`shrink-0 text-[10px]`,children:[u?`${s(`customer_success.roadmap.overdue`)} · `:``,B9e(e.due_date)]}),e.priority&&(0,K.jsx)(lR,{variant:V9e[e.priority]??`secondary`,className:`shrink-0 text-[10px]`,children:e.priority}),n&&(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 opacity-0 group-hover:opacity-100`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>a(e),className:`p-1 text-muted-foreground hover:text-foreground`,children:(0,K.jsx)(w_,{className:`size-3.5`})}),r&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>o(e.id,t),className:`p-1 text-muted-foreground hover:text-destructive`,children:(0,K.jsx)(V_,{className:`size-3.5`})})]})]})}function W9e({customerId:e}){let{t}=V(),n=BS(),r=wL(t=>t.projectsByCustomer[e]),i=wL(t=>t.loadingProjects[e]),a=wL(e=>e.fetchProjects),o=wL(e=>e.deleteProject),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(!1),[d,f]=(0,B.useState)(null);(0,B.useEffect)(()=>{a(e)},[e,a]);let p=r??[],m=p.find(e=>e.id===s)??p[0]??null,h=m?.id??null,g=()=>{f(null),u(!0)},_=()=>{m&&(f(m),u(!0))},v=async()=>{m&&window.confirm(t(`customer_success.roadmap.delete_project_confirm`))&&await o(m.id,e)};return i&&!r?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,K.jsx)(W,{className:`size-6 animate-spin text-muted-foreground`})}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-muted-foreground`,children:t(`customer_success.roadmap.projects`)}),n&&(0,K.jsxs)(J,{type:`button`,size:`sm`,onClick:g,children:[(0,K.jsx)(T_,{className:`size-4`}),t(`customer_success.roadmap.new_project`)]})]}),!r||r.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border py-10 text-center text-sm text-muted-foreground`,children:[(0,K.jsx)(Aoe,{className:`size-6`}),t(`customer_success.roadmap.no_projects`)]}):(0,K.jsxs)(K.Fragment,{children:[r.length>1&&(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>c(e.id),className:`rounded-full border px-3 py-1 text-xs transition-colors ${e.id===h?`border-primary bg-primary/10 text-foreground`:`border-border text-muted-foreground hover:text-foreground`}`,children:[e.name,(e.open_task_count??0)>0&&(0,K.jsx)(lR,{variant:`secondary`,className:`ml-1.5 text-[10px]`,children:e.open_task_count})]},e.id))}),m&&(0,K.jsx)(H9e,{project:m,customerId:e,onEditProject:_,onDeleteProject:()=>void v()})]}),(0,K.jsx)(M9e,{open:l,onOpenChange:e=>{u(e),e||f(null)},customerId:e,project:d})]})}function G9e({signal:e}){let{t}=V(),n=t(`customer_success.risk.signal_types.${e.signal_type}`,{defaultValue:e.signal_type}),r=e.occurrences??1;return(0,K.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:n}),(0,K.jsx)(lR,{variant:`outline`,className:`shrink-0 text-[10px]`,children:t(`customer_success.risk.confidence`,{value:e.severity})})]}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e.summary}),e.evidence&&(0,K.jsx)(`p`,{className:`mt-2 border-l-2 border-border pl-2 text-xs italic text-muted-foreground`,children:e.evidence}),(0,K.jsxs)(`p`,{className:`mt-2 text-[10px] text-muted-foreground`,children:[Db(e.detected_at),r>1&&(0,K.jsxs)(K.Fragment,{children:[` · `,t(`customer_success.risk.signal_seen`,{count:r,since:e.first_detected_at?Tb(e.first_detected_at):Tb(e.detected_at)})]})]})]})}function K9e({risk:e,canMutate:t,isAdmin:n,onResolve:r,onDismiss:i,onDelete:a}){let{t:o}=V(),s=e.status===`open`,c=o(`customer_success.risk.kinds.${e.kind}`,{defaultValue:e.kind});return(0,K.jsxs)(`div`,{className:`rounded-md border border-border p-3 ${s?``:`opacity-60`}`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),e.source===`manual`&&(0,K.jsx)(lR,{variant:`secondary`,className:`text-[10px]`,children:o(`customer_success.risk.manual_badge`)})]}),(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c})]}),(0,K.jsx)(lR,{className:`shrink-0 border-0 text-[10px] ${n9e[e.severity]??``}`,children:o(`customer_success.risk.severities.${e.severity}`,{defaultValue:e.severity})})]}),e.description&&(0,K.jsx)(`p`,{className:`mt-1.5 text-sm text-muted-foreground`,children:e.description}),(0,K.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:s?Db(e.detected_at):o(`customer_success.risk.statuses.${e.status}`,{defaultValue:e.status})}),s&&(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,onClick:()=>r(e.id),children:[(0,K.jsx)(Lg,{className:`size-3.5`}),o(`customer_success.risk.resolve`)]}),(0,K.jsxs)(J,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7`,onClick:()=>i(e.id),children:[(0,K.jsx)(J_,{className:`size-3.5`}),o(`customer_success.risk.dismiss`)]})]}),n&&(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 text-destructive hover:text-destructive`,onClick:()=>a(e.id),children:(0,K.jsx)(V_,{className:`size-3.5`})})]})]})]})}function q9e({customerId:e,onDone:t}){let{t:n}=V(),r=DL(e=>e.createRisk),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(`medium`),[u,d]=(0,B.useState)(!1);return(0,K.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault(),d(!0);let a=await r(e,{title:i.trim(),description:o.trim()||null,severity:c});d(!1),a&&t()},children:[(0,K.jsx)(GC,{children:(0,K.jsx)(qC,{children:n(`customer_success.risk.dialog.title`)})}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 py-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-risk-title`,children:n(`customer_success.risk.dialog.title_label`)}),(0,K.jsx)(dP,{id:`cs-risk-title`,value:i,onChange:e=>a(e.target.value),placeholder:n(`customer_success.risk.dialog.title_placeholder`),required:!0,maxLength:500})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`cs-risk-desc`,children:n(`customer_success.risk.dialog.description_label`)}),(0,K.jsx)(hP,{id:`cs-risk-desc`,value:o,onChange:e=>s(e.target.value),placeholder:n(`customer_success.risk.dialog.description_placeholder`),rows:3})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{children:n(`customer_success.risk.dialog.severity_label`)}),(0,K.jsxs)(vO,{value:c,onValueChange:e=>l(e),children:[(0,K.jsx)(bO,{children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:[`critical`,`high`,`medium`,`low`].map(e=>(0,K.jsx)(SO,{value:e,children:n(`customer_success.risk.severities.${e}`)},e))})]})]})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:t,children:n(`customer_success.risk.dialog.cancel`)}),(0,K.jsx)(J,{type:`submit`,disabled:u||!i.trim(),children:n(`customer_success.risk.dialog.submit`)})]})]})}function J9e({open:e,onOpenChange:t,customerId:n}){return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsx)(WC,{className:`sm:max-w-lg`,children:e&&(0,K.jsx)(q9e,{customerId:n,onDone:()=>t(!1)})})})}function Y9e({onDone:e}){let{t}=V(),n=DL(e=>e.saveProfile),r=DL(e=>e.profileSaving),i=DL.getState().profile,[a,o]=(0,B.useState)(()=>{let e=i?.enabled_pillars;return Array.isArray(e)&&e.length>0?new Set(e.filter(e=>HH.includes(e))):new Set(HH)}),[s,c]=(0,B.useState)(()=>({...i9e,...i?.weights??{}})),[l,u]=(0,B.useState)(i?.pillar_coverage_threshold??3),d=e=>{o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},f=(e,t)=>{c(n=>({...n,[e]:t}))},p=a.size>0&&l<=a.size;return(0,K.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault(),p&&await n({weights:s,enabled_pillars:a.size===HH.length?null:Array.from(a),pillar_coverage_threshold:l})&&e()},children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:t(`customer_success.risk.settings.title`)}),(0,K.jsx)(JC,{children:t(`customer_success.risk.settings.subtitle`)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 py-4`,children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_auto] items-center gap-x-3 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:[(0,K.jsx)(`span`,{children:t(`customer_success.risk.settings.pillar`)}),(0,K.jsx)(`span`,{className:`w-16 text-center`,children:t(`customer_success.risk.settings.weight`)}),(0,K.jsx)(`span`,{className:`w-12 text-center`,children:t(`customer_success.risk.settings.enabled`)})]}),HH.map(e=>{let n=r9e[e],r=a.has(e);return(0,K.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_auto] items-center gap-x-3`,children:[(0,K.jsx)(pP,{className:`text-sm`,children:t(`customer_success.risk.pillars.${e}`,{defaultValue:e})}),(0,K.jsx)(dP,{type:`number`,min:0,max:10,value:s[n]??0,disabled:!r,onChange:e=>f(n,Math.max(0,Math.min(10,Number(e.target.value)||0))),className:`h-8 w-16 text-center`}),(0,K.jsx)(`div`,{className:`flex w-12 justify-center`,children:(0,K.jsx)(mP,{checked:r,onCheckedChange:()=>d(e)})})]},e)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(pP,{children:t(`customer_success.risk.settings.coverage`)}),(0,K.jsxs)(vO,{value:String(l),onValueChange:e=>u(Number(e)),children:[(0,K.jsx)(bO,{className:`w-24`,children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:[1,2,3,4].map(e=>(0,K.jsx)(SO,{value:String(e),children:e},e))})]}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`customer_success.risk.settings.coverage_hint`)})]}),(0,K.jsxs)(KC,{className:`mt-4`,children:[!p&&(0,K.jsx)(`p`,{className:`mr-auto self-center text-xs text-destructive`,children:t(`customer_success.risk.settings.min_one_pillar`)}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:e,children:t(`common.cancel`)}),(0,K.jsx)(J,{type:`submit`,disabled:r||!p,children:t(r?`customer_success.risk.settings.saving`:`customer_success.risk.settings.save`)})]})]})}function X9e({open:e,onOpenChange:t}){let n=DL(e=>e.profileLoaded),r=DL(e=>e.fetchProfile);return(0,B.useEffect)(()=>{e&&!n&&r()},[e,n,r]),(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsx)(WC,{className:`sm:max-w-md`,children:e&&(n?(0,K.jsx)(Y9e,{onDone:()=>t(!1)}):(0,K.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,K.jsx)(W,{className:`size-6 animate-spin text-muted-foreground`})}))})})}var Z9e=[],Q9e=[],$9e=[];function nU({value:e,max:t,fill:n}){let r=Math.max(0,Math.min(100,e/t*100));return(0,K.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-neutral-200 dark:bg-neutral-800`,children:(0,K.jsx)(`div`,{className:`h-full rounded-full ${n}`,style:{width:`${r}%`}})})}function eet({history:e}){let{t}=V(),n=e.slice().reverse().filter(e=>e.score!=null);if(n.length<2)return(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`customer_success.risk.trend_empty`)});let r=t9e[VH(n[n.length-1].score)]??`#f59e0b`,i=n.map((e,t)=>{let r=t/(n.length-1)*100,i=30-Math.max(0,Math.min(100,e.score))/100*30;return`${r.toFixed(2)},${i.toFixed(2)}`});
280return(0,K.jsx)(`svg`,{viewBox:`0 0 100 30`,preserveAspectRatio:`none`,className:`h-10 w-full`,role:`img`,"aria-label":t(`customer_success.risk.trend_title`),children:(0,K.jsx)(`polyline`,{points:i.join(` `),fill:`none`,stroke:r,strokeWidth:1.5,vectorEffect:`non-scaling-stroke`,strokeLinejoin:`round`,strokeLinecap:`round`})})}function tet({customer:e,canMutate:t,isAdmin:n}){let{t:r}=V(),i=e.id,a=DL(e=>e.signalsByCustomer[i])??Z9e,o=DL(e=>e.risksByCustomer[i])??Q9e,s=DL(e=>e.historyByCustomer[i])??$9e,c=DL(e=>e.loading[i]??!1),l=DL(e=>e.recomputing[i]??!1),u=DL(e=>e.loadAll),d=DL(e=>e.recompute),f=DL(e=>e.resolveRisk),p=DL(e=>e.dismissRisk),m=DL(e=>e.deleteRisk),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(!1);(0,B.useEffect)(()=>{u(i)},[i,u]);let y=e.risk_pillars??{},b=e.health_pillars??{},x=e.risk_calibrating!=null||e.health_score!=null,S=e.risk_calibrating===!0||e.risk_score==null,C=e.risk_band??`watch`,w=o.filter(e=>e.status===`open`),T=e=>{window.confirm(r(`customer_success.risk.delete_confirm`))&&m(e,i)};return(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold`,children:r(`customer_success.detail.tab_risk`)}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[n&&(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>v(!0),title:r(`customer_success.risk.settings.open`),children:(0,K.jsx)(N_,{className:`size-4`})}),t&&(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void d(i),disabled:l,children:[l?(0,K.jsx)(W,{className:`size-4 animate-spin`}):(0,K.jsx)(E_,{className:`size-4`}),r(l?`customer_success.risk.recomputing`:`customer_success.risk.recompute`)]})]})]}),(0,K.jsx)(X9e,{open:_,onOpenChange:v}),x?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-md border border-border p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`customer_success.risk.score_label`)}),!S&&(0,K.jsx)(lR,{className:`border-0 ${zH[C]??``}`,children:r(`customer_success.risk.bands.${C}`,{defaultValue:C})})]}),S?(0,K.jsxs)(`div`,{className:`mt-2`,children:[(0,K.jsx)(`p`,{className:`text-lg font-semibold`,children:r(`customer_success.risk.calibrating`)}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`customer_success.risk.calibrating_hint`)})]}):(0,K.jsxs)(`div`,{className:`mt-2`,children:[(0,K.jsxs)(`p`,{className:`text-3xl font-semibold tabular-nums`,children:[e.risk_score,(0,K.jsx)(`span`,{className:`text-base text-muted-foreground`,children:`/100`})]}),(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(nU,{value:e.risk_score??0,max:100,fill:BH[C]??`bg-amber-500`})})]}),e.days_since_contact!=null&&(0,K.jsx)(`p`,{className:`mt-3 text-[11px] text-muted-foreground`,children:r(`customer_success.risk.days_quiet`,{count:e.days_since_contact})})]}),(0,K.jsxs)(`div`,{className:`rounded-md border border-border p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r(`customer_success.risk.health_label`)}),e.health_score!=null&&(0,K.jsxs)(`span`,{className:`text-sm font-medium tabular-nums`,children:[e.health_score,`/100`]})]}),e.health_score==null?(0,K.jsxs)(`div`,{className:`mt-2`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:r(`customer_success.risk.calibrating`)}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:r(`customer_success.risk.health_calibrating_hint`)})]}):(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(nU,{value:e.health_score,max:100,fill:`bg-emerald-500`})}),(0,K.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:r(`customer_success.risk.trend_title`)}),(0,K.jsx)(`div`,{className:`mt-1`,children:(0,K.jsx)(eet,{history:s})})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:r(`customer_success.risk.pillars_title`)}),(0,K.jsx)(`div`,{className:`flex flex-col gap-2`,children:HH.map(e=>(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex justify-between text-[11px]`,children:[(0,K.jsx)(`span`,{children:r(`customer_success.risk.pillars.${e}`,{defaultValue:e})}),(0,K.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:y[e]??0})]}),(0,K.jsx)(nU,{value:y[e]??0,max:100,fill:BH[VH(y[e]??0)]})]},e))})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:r(`customer_success.risk.health_pillars_title`)}),(0,K.jsx)(`div`,{className:`flex flex-col gap-2`,children:a9e.map(({key:e,max:t})=>(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex justify-between text-[11px]`,children:[(0,K.jsx)(`span`,{children:r(`customer_success.risk.health_pillar_labels.${e}`,{defaultValue:e})}),(0,K.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[b[e]??0,`/`,t]})]}),(0,K.jsx)(nU,{value:b[e]??0,max:t,fill:`bg-emerald-500`})]},e))})]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:r(`customer_success.risk.signals_title`)}),c&&a.length===0?(0,K.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,K.jsx)(W,{className:`size-4 animate-spin text-muted-foreground`})}):a.length===0?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`customer_success.risk.signals_empty`)}):(0,K.jsx)(`div`,{className:`flex flex-col gap-2`,children:a.map(e=>(0,K.jsx)(G9e,{signal:e},e.id))})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,K.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:r(`customer_success.risk.risks_title`)}),t&&(0,K.jsxs)(J,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7`,onClick:()=>g(!0),children:[(0,K.jsx)(T_,{className:`size-3.5`}),r(`customer_success.risk.add_risk`)]})]}),w.length===0?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`customer_success.risk.risks_empty`)}):(0,K.jsx)(`div`,{className:`flex flex-col gap-2`,children:w.map(e=>(0,K.jsx)(K9e,{risk:e,canMutate:t,isAdmin:n,onResolve:e=>void f(e,i),onDismiss:e=>void p(e,i),onDelete:T},e.id))})]})]}):(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2 rounded-md border border-dashed border-border py-10 text-center text-muted-foreground`,children:[(0,K.jsx)(F_,{className:`size-7`}),(0,K.jsx)(`p`,{className:`max-w-xs text-sm`,children:r(`customer_success.risk.no_data`)})]}),(0,K.jsx)(J9e,{open:h,onOpenChange:g,customerId:i})]})}var net={positive:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-300`,neutral:`bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300`,negative:`bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300`,frustrated:`bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300`};function ret({item:e}){let{t}=V(),n=e.sentiment??`neutral`;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1 border-b border-border py-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 text-sm font-medium`,children:e.need}),(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:Tb(e.occurred_at)}),(0,K.jsx)(lR,{className:`shrink-0 border-0 text-[10px] ${net[n]??``}`,children:t(`customer_success.feedback.sentiment.${n}`,{defaultValue:n})})]}),e.verbatim&&(0,K.jsxs)(`p`,{className:`border-l-2 border-border pl-2 text-xs italic text-muted-foreground`,children:[`â`,e.verbatim,`â`]}),e.proposed_solution&&(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,K.jsxs)(`span`,{className:`font-medium`,children:[t(`customer_success.feedback.proposed`),`:`]}),` `,e.proposed_solution]}),e.cluster_title&&(0,K.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,K.jsx)(z_,{className:`size-3`}),e.cluster_category?`${e.cluster_category} · ${e.cluster_title}`:e.cluster_title]})]})}function iet({customerId:e,canMutate:t}){let{t:n}=V(),r=AL(t=>
280t.itemsByCustomer[e]),i=AL(t=>t.itemsLoading[e]),a=AL(t=>t.extracting[e]),o=AL(e=>e.fetchCustomerFeedback),s=AL(e=>e.extractFeedback);(0,B.useEffect)(()=>{o(e)},[e,o]);let c=r??[];return(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold`,children:n(`customer_success.feedback.title`)}),t&&(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void s(e),disabled:a,children:[a?(0,K.jsx)(W,{className:`size-4 animate-spin`}):(0,K.jsx)(L_,{className:`size-4`}),n(`customer_success.feedback.extract`)]})]}),i&&c.length===0?(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(W,{className:`size-5 animate-spin text-muted-foreground`})}):c.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-16 text-center text-muted-foreground`,children:[(0,K.jsx)(y_,{className:`size-8`}),(0,K.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:n(`customer_success.feedback.empty_title`)}),(0,K.jsx)(`p`,{className:`max-w-sm text-xs`,children:n(`customer_success.feedback.empty_body`)})]}):(0,K.jsx)(`div`,{className:`flex flex-col`,children:c.map(e=>(0,K.jsx)(ret,{item:e},e.id))})]})}var aet=[];function rU(e){return e?new Date(e).getTime():0}function oet(e){return[...e].sort((e,t)=>rU(t.latest_event_at)-rU(e.latest_event_at))}function set({rollup:e}){let{t}=V(),n=t(`customer_success.icp.verdicts.${e.overall}`);return(0,K.jsxs)(`div`,{className:`rounded-md border border-border bg-muted/40 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,K.jsxs)(`span`,{className:q(`inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-sm font-semibold`,YH[e.overall]),children:[(0,K.jsx)(B_,{className:`size-4`}),n]}),e.fitPct==null?(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:t(`customer_success.icp.rollup_no_score`)}):(0,K.jsx)(`span`,{className:`text-2xl font-semibold tabular-nums`,children:t(`customer_success.icp.fit_score`,{pct:e.fitPct})})]}),(0,K.jsx)(`div`,{className:`mt-3 h-1.5 w-full overflow-hidden rounded-full bg-border`,children:(0,K.jsx)(`div`,{className:q(`h-full rounded-full`,_9e[e.overall]),style:{width:`${e.fitPct??0}%`}})}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:JH.filter(t=>e.counts[t]>0).map(n=>(0,K.jsxs)(`span`,{className:q(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium`,YH[n]),children:[t(`customer_success.icp.verdicts.${n}`),(0,K.jsx)(`span`,{className:`tabular-nums`,children:e.counts[n]})]},n))}),(0,K.jsx)(`p`,{className:`mt-3 text-xs leading-relaxed text-muted-foreground`,children:t(`customer_success.icp.rollup_rationale`,{scored:e.scored,fits:e.counts.fits,partial:e.counts.partial,does_not_fit:e.counts.does_not_fit,unclear:e.counts.unclear})}),e.latestComputedAt&&(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t(`customer_success.icp.evaluated_ago`,{ago:Db(e.latestComputedAt)})}),e.staleCount>0&&(0,K.jsx)(`p`,{className:`mt-1 text-xs italic text-amber-700 dark:text-amber-400`,children:t(`customer_success.icp.stale_count`,{count:e.staleCount})})]})}function cet({verdict:e,subject:t}){let{t:n}=V(),r=e.event_count??0;return(0,K.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:t??n(`customer_success.icp.chain_untitled`)}),r>0&&(0,K.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:n(`customer_success.icp.chain_messages`,{count:r})}),e.latest_event_at&&(0,K.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:Db(e.latest_event_at)})]}),(0,K.jsx)(ZH,{verdict:e})]})}function uet({customerId:e,canMutate:t}){let{t:n}=V(),r=PL(t=>t.verdictsByCustomer[e]??aet),i=PL(t=>t.verdictsLoading[e]??!1),a=PL(t=>t.evaluating[e]??!1),o=PL(e=>e.icpConfigured),s=PL(e=>e.loadVerdicts),c=PL(e=>e.reevaluateCustomer),l=bL(e=>e.timeline),u=bL(e=>e.hiddenEvents);(0,B.useEffect)(()=>{s(e)},[e,s]);let d=(0,B.useMemo)(()=>w9e(r,new Set(u.map(e=>e.id))),[r,u]),f=(0,B.useMemo)(()=>
280C9e(d),[d]),p=(0,B.useMemo)(()=>oet(d),[d]),m=(0,B.useMemo)(()=>{let t=new Map;for(let n of l)n.customer_id!==e||!n.title||t.set(n.id,n.title);return t},[l,e]),h=e=>e.latest_event_id?m.get(e.latest_event_id)??null:null;return(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[(0,K.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,K.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-sm font-semibold`,children:[(0,K.jsx)(B_,{className:`size-4`}),n(`customer_success.icp.fit_title`)]}),t&&(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void c(e),disabled:a,children:[a?(0,K.jsx)(W,{className:`size-4 animate-spin`}):(0,K.jsx)(E_,{className:`size-4`}),n(`customer_success.icp.reevaluate`)]})]}),(()=>o===!1?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-16 text-center text-muted-foreground`,children:[(0,K.jsx)(B_,{className:`size-8`}),(0,K.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:n(`customer_success.icp.not_configured_title`)}),(0,K.jsx)(`p`,{className:`max-w-sm text-xs`,children:n(`customer_success.icp.not_configured_body`)})]}):i&&r.length===0?(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(W,{className:`size-5 animate-spin text-muted-foreground`})}):!a&&r.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-16 text-center text-muted-foreground`,children:[(0,K.jsx)(B_,{className:`size-8`}),(0,K.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:n(`customer_success.icp.stats_empty`)}),(0,K.jsx)(`p`,{className:`max-w-sm text-xs`,children:n(`customer_success.icp.empty_body`)})]}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[a?(0,K.jsx)(`div`,{className:`rounded-md border border-border bg-muted/40 p-4`,children:(0,K.jsx)(zI,{label:n(`customer_success.icp.evaluating`)})}):(0,K.jsx)(set,{rollup:f}),p.length>0&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`h4`,{className:`text-xs font-medium text-muted-foreground`,children:[n(`customer_success.icp.chains_title`),` `,(0,K.jsxs)(`span`,{className:`tabular-nums`,children:[`(`,p.length,`)`]})]}),p.map(e=>(0,K.jsx)(cet,{verdict:e,subject:h(e)},e.id))]})]}))()]})}function det({onDeleted:e}){let{t}=V(),n=bL(e=>e.detail),r=bL(e=>e.loadingDetail),i=bL(e=>e.backfilling),a=bL(e=>e.archiveCustomer),o=bL(e=>e.restoreCustomer),s=bL(e=>e.deleteCustomer),c=bL(e=>e.triggerBackfill),l=PL(e=>e.icpConfigured),u=BS(),d=VS(),[f,p]=(0,B.useState)(!1);if(r&&!n)return(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,K.jsx)(W,{className:`size-6 animate-spin text-muted-foreground`})});if(!n)return(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:t(`customer_success.detail.select_prompt`)});let m=n.domains??[],h=n.contact_emails??[],g=n.status===`archived`,_=async()=>{window.confirm(t(`customer_success.detail.delete_confirm`))&&await s(n.id)&&e()};return(0,K.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,K.jsxs)(`div`,{className:`border-b border-border p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`truncate text-lg font-semibold`,children:n.name}),g&&(0,K.jsx)(lR,{variant:`secondary`,children:t(`customer_success.detail.archived`)})]}),n.arr!=null&&(0,K.jsxs)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:[t(`customer_success.detail.arr_label`),`:`,` `,Ob(Number(n.arr))]})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[u&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>p(!0),children:[(0,K.jsx)(w_,{className:`size-4`}),t(`customer_success.detail.edit`)]}),(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void c(n.id),disabled:i,children:[i?(0,K.jsx)(W,{className:`size-4 animate-spin`}):(0,K.jsx)(c_,{className:`size-4`}),t(`customer_success.detail.backfill`)]}),g?(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void o(n.id),children:[(0,K.jsx)(Kae,{className:`size-4`}),t(`customer_success.detail.restore`)]}):(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void a(n.id),children:[(0,K.jsx)(Cg,{className:`size-4`}),t(`customer_success.detail.archive`)]})]}),d&&(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void _(),className:`text-destructive hover:text-destructive`,children:(0,K.jsx)(V_,{className:`size-4`})})]})]}),(m.length>0||h.length>0)&&(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-1.5`,children:[m.map(e=>(0,K.jsx)(lR,{variant:`outline`,className:`text-xs`,children:e},e)),h.map(e=>(0,K.jsx)(lR,{variant:`secondary`,className:`text-xs`,children:e},e))]})]}),(0,K.jsxs)(bV,{defaultValue:`timeline`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,K.jsxs)(xV,{className:`mx-4 mt
280-3 self-start`,children:[(0,K.jsx)(SV,{value:`timeline`,children:t(`customer_success.detail.tab_timeline`)}),(0,K.jsx)(SV,{value:`roadmap`,children:t(`customer_success.detail.tab_roadmap`)}),(0,K.jsx)(SV,{value:`risk`,children:t(`customer_success.detail.tab_risk`)}),(0,K.jsx)(SV,{value:`feedback`,children:t(`customer_success.detail.tab_feedback`)}),l!==!1&&(0,K.jsx)(SV,{value:`icp`,children:t(`customer_success.detail.tab_icp`)})]}),(0,K.jsx)(CV,{value:`timeline`,className:`min-h-0 flex-1`,children:(0,K.jsx)(IL,{className:`h-full`,children:(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsx)(A9e,{})})})}),(0,K.jsx)(CV,{value:`roadmap`,className:`min-h-0 flex-1`,children:(0,K.jsx)(IL,{className:`h-full`,children:(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsx)(W9e,{customerId:n.id})})})}),(0,K.jsx)(CV,{value:`risk`,className:`min-h-0 flex-1`,children:(0,K.jsx)(IL,{className:`h-full`,children:(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsx)(tet,{customer:n,canMutate:u,isAdmin:d})})})}),(0,K.jsx)(CV,{value:`feedback`,className:`min-h-0 flex-1`,children:(0,K.jsx)(IL,{className:`h-full`,children:(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsx)(iet,{customerId:n.id,canMutate:u})})})}),(0,K.jsx)(CV,{value:`icp`,className:`min-h-0 flex-1`,children:(0,K.jsx)(IL,{className:`h-full`,children:(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsx)(uet,{customerId:n.id,canMutate:u})})})})]}),(0,K.jsx)(WH,{open:f,onOpenChange:p,customer:n})]})}function iU({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,K.jsx)(`table`,{"data-slot":`table`,className:q(`w-full caption-bottom text-sm`,e),...t})})}function aU({className:e,...t}){return(0,K.jsx)(`thead`,{"data-slot":`table-header`,className:q(`[&_tr]:border-b`,e),...t})}function oU({className:e,...t}){return(0,K.jsx)(`tbody`,{"data-slot":`table-body`,className:q(`[&_tr:last-child]:border-0`,e),...t})}function sU({className:e,...t}){return(0,K.jsx)(`tr`,{"data-slot":`table-row`,className:q(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,e),...t})}function cU({className:e,...t}){return(0,K.jsx)(`th`,{"data-slot":`table-head`,className:q(`text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function lU({className:e,...t}){return(0,K.jsx)(`td`,{"data-slot":`table-cell`,className:q(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}var fet=`.csv,.xlsx`,pet=/\.(csv|xlsx)$/i,uU=10;function met(e){return e===`ok`?`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-200`:e===`warning`?`bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-200`:e===`conflict`?`bg-orange-100 text-orange-800 dark:bg-orange-900/40 dark:text-orange-200`:e===`duplicate`?`bg-neutral-200 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-200`:`bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-200`}function het(e){if(e==null||e===``)return``;let t=Number(e);return Number.isFinite(t)?t.toLocaleString(void 0,{maximumFractionDigits:2}):String(e)}function get(e){return(e.counts.ok??0)+(e.counts.warning??0)}function _et(e){return e.counts.total??e.rows.length}function vet(e){return pet.test(e.name)?e.size<=uU*1024*1024:!1}function yet({onFile:e,uploading:t,progress:n,error:r}){let{t:i}=V(),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(null),l=n=>{t||!n||n.length===0||e(n[0])},u=()=>{if(t)return;let e=document.createElement(`input`);e.type=`file`,e.accept=fet,e.onchange=e=>l(e.target.files),e.click()},d=e=>{e.preventDefault(),o(!0)},f=e=>{e.preventDefault(),o(!1)},p=e=>{e.preventDefault(),o(!1),l(Array.from(e.dataTransfer.files))},m=async e=>{c(e);try{await uge(e)}catch(t){Y(t,i(`customer_success.toasts.import_failed`),{operation:`cs.downloadImportTemplate`,metadata:{format:e}})}finally{c(null)}};return(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 py-4`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:u,onDragOver:d,onDragLeave:f,onDrop:p,disabled:t,className:`flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed px-6 py-10 text-center transition-colors ${a?`border-primary bg-primary/5`:`border-border hover:border-neutral-400 dark:hover:border-neutral-500`}`,children:[t?(0,K.jsx)(W,{className:`size-6 animate-spin text-muted-foreground`}):(0,K.jsx)(Doe,{className:`size-6 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:t?i(`customer_success.import.uploading`,{percent:n}):i(`customer_success.import.dropzone`)}),(0,K.jsx)(`span`,{className:`max-w-md text-xs text-muted-foreground`,children:i(`customer_success.import.dropzone_hint`)})]}),r&&(0,K.jsxs)(`p`,{className:`flex items-start gap-2 text-sm text-destructive`,children:[(0,K.jsx)(H_,{className:`mt-0.5 size-4 shrink-0`}),(0,K.jsx)(`span`,{children:r})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,K.jsx)(Xg,{className:`size-3.5`}),(0,K.jsxs)(`span`,{children:[i(`customer_success.import.template`),`:`]}),(0,K.jsx)(J,{type:`button`,variant:`link`,size:`sm`,className:`h-auto p-0 text-xs`,disabled:s!==null,onClick:()=>void m(`xlsx`),children:i(`customer_success.import.template_xlsx`)}
280),(0,K.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,K.jsx)(J,{type:`button`,variant:`link`,size:`sm`,className:`h-auto p-0 text-xs`,disabled:s!==null,onClick:()=>void m(`csv`),children:i(`customer_success.import.template_csv`)})]})]})}function bet({mapping:e,source:t}){let{t:n}=V(),r=Object.entries(e);return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,K.jsxs)(`span`,{className:`font-medium text-foreground`,children:[n(`customer_success.import.mapping_caption`),`:`]}),r.map(([e,t])=>(0,K.jsxs)(`span`,{className:`rounded bg-neutral-100 px-1.5 py-0.5 dark:bg-neutral-800`,children:[(0,K.jsx)(`span`,{className:`text-foreground`,children:e}),` â `,n(`customer_success.import.field.${t}`,{defaultValue:t})]},e))]}),t===`llm`&&(0,K.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,K.jsx)(L_,{className:`size-3.5`}),n(`customer_success.import.mapping_ai`)]})]})}function xet({row:e}){let{t}=V();return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(lR,{className:`w-fit border-0 text-[10px] ${met(e.status)}`,children:t(`customer_success.import.status.${e.status}`)}),e.conflict_with&&(0,K.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t(`customer_success.import.conflict_with`,{name:e.conflict_with})})]})}function Cet({rows:e}){let{t}=V(),n=e=>e.status===`ok`||e.status===`warning`;return(0,K.jsx)(`div`,{className:`max-h-[45vh] overflow-auto rounded-md border border-border`,children:(0,K.jsxs)(iU,{children:[(0,K.jsx)(aU,{children:(0,K.jsxs)(sU,{children:[(0,K.jsx)(cU,{className:`w-10`,children:t(`customer_success.import.columns.row`)}),(0,K.jsx)(cU,{children:t(`customer_success.import.columns.status`)}),(0,K.jsx)(cU,{children:t(`customer_success.import.columns.name`)}),(0,K.jsx)(cU,{children:t(`customer_success.import.columns.domains`)}),(0,K.jsx)(cU,{children:t(`customer_success.import.columns.contacts`)}),(0,K.jsx)(cU,{className:`text-right`,children:t(`customer_success.import.columns.arr`)}),(0,K.jsx)(cU,{children:t(`customer_success.import.columns.notes`)})]})}),(0,K.jsx)(oU,{children:e.map(e=>(0,K.jsxs)(sU,{className:n(e)?``:`opacity-60`,children:[(0,K.jsx)(lU,{className:`text-xs text-muted-foreground`,children:e.row_number}),(0,K.jsx)(lU,{children:(0,K.jsx)(xet,{row:e})}),(0,K.jsxs)(lU,{className:`max-w-48`,children:[(0,K.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name||`â`}),(e.warnings??[]).length>0&&(0,K.jsx)(`ul`,{className:`mt-0.5 flex flex-col gap-0.5`,children:(e.warnings??[]).map(e=>(0,K.jsx)(`li`,{className:`text-[11px] text-amber-700 dark:text-amber-300`,children:e},e))})]}),(0,K.jsx)(lU,{className:`text-xs`,children:(e.domains??[]).join(`, `)}),(0,K.jsx)(lU,{className:`text-xs`,children:(e.contact_emails??[]).join(`, `)}),(0,K.jsx)(lU,{className:`text-right text-xs tabular-nums`,children:het(e.arr)}),(0,K.jsx)(lU,{className:`max-w-64`,children:e.notes&&(0,K.jsx)(`p`,{className:`line-clamp-2 whitespace-pre-line text-xs text-muted-foreground`,title:e.notes,children:e.notes})})]},e.row_number))})]})})}function wet({preview:e,polishNotes:t,onPolishChange:n,onConfirm:r,onStartOver:i,committing:a}){let{t:o}=V(),s=get(e),c=_et(e),l=c-s,u=s===1?o(`customer_success.import.confirm_one`):o(`customer_success.import.confirm`,{count:s});return(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 py-2`,children:[(0,K.jsx)(bet,{mapping:e.mapping,source:e.mapping_source}),e.truncated&&(0,K.jsxs)(`p`,{className:`flex items-center gap-2 rounded-md bg-amber-50 px-3 py-2 text-xs text-amber-800 dark:bg-amber-900/30 dark:text-amber-200`,children:[(0,K.jsx)(H_,{className:`size-3.5 shrink-0`}),o(`customer_success.import.truncated`,{max:e.max_rows})]}),(0,K.jsx)(Cet,{rows:e.rows}),(0,K.jsxs)(KC,{className:`flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(HB,{id:`cs-import-polish`,checked:t,onCheckedChange:e=>n(e===!0),disabled:a,className:`mt-0.5`}),(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[(0,K.jsxs)(pP,{htmlFor:`cs-import-polish`,className:`flex items-center gap-1.5 text-sm`,children:[(0,K.jsx)(L_,{className:`size-3.5`}),o(`customer_success.import.polish_notes`)]}),(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o(`customer_success.import.polish_notes_hint`)})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-col items-end gap-1.5 sm:flex-row sm:items-center sm:gap-3`,children:[(0,K.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[o(`customer_success.import.importable_count`,{count:s,total:c}),l>0&&(0,K.jsxs)(K.Fragment,{children:[` · `,o(`customer_success.import.skipped_count`,{count:l})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:i,disabled:a,children:o(`customer_success.import.start_over`)}),(0,K.jsxs)(J,{type:`button`,onClick:r,disabled:a||s===0,children:[a&&(0,K.jsx)(W,{className:`size-4 animate-spin`}),a?o(`customer_success.import.importing`):u]})]})]})]})]})}function Tet({result:e,onClose:t,onRetry:n,committing:r}){let{t:i}=V(),a=e.created===1?i(`customer_success.import.result_created_one`):i(`customer_success.import.result_created`,{count:e.created});return(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 py-4`,children:[(0,K.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,K.jsx)(Ug,{className:`size-4 text-emerald-600 dark:text-emerald-400`}),a]}),e.skipped>0&&(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i(`customer_success.import.result_skipped`,{count:e.skipped})}),e.failed>0&&(0,K.jsxs)(`p`,{className:`flex items-start gap-2 text-sm text-amber-700 dark:text-amber-300`,children:[(0,K.jsx)(H_,{className:`mt-0.5 size-4 shrink-0`}),i(`customer_success.import.result_failed`,{count:e.failed})]}),e.created>0&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`customer_success.import.result_backfill`)}),e.polish_queued&&(0,K.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,K.jsx)(L_,{className:`size-3.5`}
280),i(`customer_success.import.result_polish`)]}),(0,K.jsxs)(KC,{children:[e.failed>0&&(0,K.jsxs)(J,{type:`button`,variant:`outline`,onClick:n,disabled:r,children:[r&&(0,K.jsx)(W,{className:`size-4 animate-spin`}),i(`common.retry`)]}),(0,K.jsx)(J,{type:`button`,onClick:t,children:i(`common.done`)})]})]})}function Eet({onDone:e}){let{t}=V(),n=bL(e=>e.commitImport),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(!1),[l,u]=(0,B.useState)(0),[d,f]=(0,B.useState)(null),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(!1),_=async e=>{if(f(null),!vet(e)){f(t(`customer_success.import.invalid_file`,{max:uU}));return}c(!0),u(0);try{i(await lge(e,u))}catch(n){f(Gb(n,t(`customer_success.import.preview_failed`),{operation:`cs.previewImport`,metadata:{filename:e.name,size:e.size}}))}finally{c(!1)}},v=async()=>{if(!r||h)return;g(!0);let e=await n(r.import_id,{polishNotes:p});g(!1),e&&o(e)};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:t(`customer_success.import.title`)}),(0,K.jsx)(JC,{children:t(`customer_success.import.subtitle`)})]}),a&&(0,K.jsx)(Tet,{result:a,onClose:e,onRetry:()=>void v(),committing:h}),!a&&r&&(0,K.jsx)(wet,{preview:r,polishNotes:p,onPolishChange:m,onConfirm:()=>void v(),onStartOver:()=>{i(null),o(null),f(null)},committing:h}),!a&&!r&&(0,K.jsx)(yet,{onFile:e=>void _(e),uploading:s,progress:l,error:d})]})}function Det({open:e,onOpenChange:t}){return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsx)(WC,{className:`sm:max-w-3xl`,children:e&&(0,K.jsx)(Eet,{onDone:()=>t(!1)})})})}function Oet({theme:e,active:t,onSelect:n}){let{t:r}=V();return(0,K.jsxs)(`button`,{type:`button`,onClick:n,className:`flex w-full flex-col gap-1 border-b border-border px-3 py-2.5 text-left hover:bg-neutral-100 dark:hover:bg-neutral-800 ${t?`bg-neutral-200 dark:bg-neutral-700`:``}`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.title||r(`customer_success.themes.untitled`)}),(0,K.jsx)(lR,{variant:`outline`,className:`shrink-0 text-[10px]`,children:e.item_count})]}),e.category&&(0,K.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e.category}),e.summary&&(0,K.jsx)(`p`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:e.summary})]})}function ket({themeId:e}){let{t}=V(),n=AL(e=>e.themeDetail),r=AL(e=>e.themeDetailLoading),i=bL(e=>e.customers),a=e=>i.find(t=>t.id===e)?.name??t(`customer_success.themes.view_customer`);if(!e)return(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:t(`customer_success.themes.select_prompt`)});if(r&&!n)return(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,K.jsx)(W,{className:`size-6 animate-spin text-muted-foreground`})});if(!n)return null;let{theme:o,items:s}=n,c=o.recommendations??[];return(0,K.jsx)(IL,{className:`h-full [&>[data-slot=scroll-area-viewport]>div]:block!`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-lg font-semibold`,children:o.title||t(`customer_success.themes.untitled`)}),o.category&&(0,K.jsx)(lR,{variant:`secondary`,className:`text-xs`,children:o.category})]}),o.summary&&(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:o.summary})]}),c.length>0&&(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`h3`,{className:`mb-1 flex items-center gap-1.5 text-sm font-semibold`,children:[(0,K.jsx)(p_,{className:`size-4 text-amber-500`}),t(`customer_success.themes.recommendations`)]}),(0,K.jsx)(`ul`,{className:`ml-1 list-disc space-y-1 pl-4 text-sm text-muted-foreground`,children:c.map((e,t)=>(0,K.jsx)(`li`,{children:e},t))})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{className:`mb-1 text-sm font-semibold`,children:t(`customer_success.themes.items`,{count:s.length})}),(0,K.jsx)(`div`,{className:`flex flex-col`,children:s.map(e=>(0,K.jsxs)(`div`,{className:`border-b border-border py-2`,children:[(0,K.jsxs)(`div`,{className:`mb-0.5 flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,K.jsx)(Gv,{to:`/cu
280stomers?customer=${e.customer_id}`,className:`truncate font-medium text-foreground hover:underline`,children:a(e.customer_id)}),(0,K.jsx)(`span`,{className:`shrink-0`,children:Tb(e.occurred_at)})]}),(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:e.need}),e.verbatim&&(0,K.jsxs)(`p`,{className:`border-l-2 border-border pl-2 text-xs italic text-muted-foreground`,children:[`â`,e.verbatim,`â`]})]},e.id))})]})]})})}function Aet(){let{t:e}=V(),t=AL(e=>e.themes),n=AL(e=>e.themesLoading),r=AL(e=>e.themesLoaded),i=AL(e=>e.fetchThemes),a=AL(e=>e.openTheme),o=Nx(e=>e.user?.current_org_id??null),[s,c]=(0,B.useState)(null);(0,B.useEffect)(()=>{r||i()},[i,o,r]);let l=e=>{c(e),a(e)};return(0,K.jsxs)(IH,{orientation:`horizontal`,className:`h-full`,children:[(0,K.jsx)(LH,{defaultSize:28,minSize:22,children:(0,K.jsx)(`div`,{className:`flex h-full flex-col`,children:n&&t.length===0?(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(W,{className:`size-5 animate-spin text-muted-foreground`})}):t.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-16 text-center text-muted-foreground`,children:[(0,K.jsx)(Uoe,{className:`size-8`}),(0,K.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e(`customer_success.themes.empty_title`)}),(0,K.jsx)(`p`,{className:`max-w-sm text-xs`,children:e(`customer_success.themes.empty_body`)})]}):(0,K.jsx)(IL,{type:`auto`,className:`min-h-0 flex-1 [&>[data-slot=scroll-area-viewport]>div]:block!`,children:t.map(e=>(0,K.jsx)(Oet,{theme:e,active:e.id===s,onSelect:()=>l(e.id)},e.id))})})}),(0,K.jsx)(RH,{}),(0,K.jsx)(LH,{defaultSize:66,minSize:30,children:(0,K.jsx)(ket,{themeId:s})})]})}var dU=4e3;function jet(){let{t:e}=V(),t=PL(e=>e.profile),n=PL(e=>e.loading),r=PL(e=>e.saving),i=PL(e=>e.loaded),a=PL(e=>e.fetchIcp),o=PL(e=>e.saveIcp),s=VS();(0,B.useEffect)(()=>{i||a()},[a,Nx(e=>e.user?.current_org_id??null),i]);let[c,l]=(0,B.useState)(null),u=t?.description??``,d=c??u,f=c!==null&&c!==u,p=async()=>{await o(d),l(null)},m=async()=>{await o(``),l(null)},h=t?.stats,g=h?.by_verdict??{},_=t?.updated_at??null;return(0,K.jsx)(IL,{className:`h-full`,children:(0,K.jsxs)(`div`,{className:`mx-auto flex max-w-2xl flex-col gap-5 p-6`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(B_,{className:`size-4 text-muted-foreground`}),(0,K.jsx)(`h2`,{className:`text-base font-semibold`,children:e(`customer_success.icp.title`)})]}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`customer_success.icp.subtitle`)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(hP,{rows:10,maxLength:dU,value:d,disabled:!s||r,placeholder:e(`customer_success.icp.placeholder`),onChange:e=>l(e.target.value),className:`resize-none`}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`customer_success.icp.chars`,{count:d.length,max:dU})}),_&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`customer_success.icp.last_updated`,{ago:Db(_)})})]}),s?(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(J,{type:`button`,size:`sm`,disabled:r||!f,onClick:()=>void p(),children:e(r?`customer_success.icp.saving`:`customer_success.icp.save`)}),u&&(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`outline`,disabled:r,onClick:()=>void m(),children:e(`customer_success.icp.clear`)})]}):(0,K.jsx)(`p`,{className:`text-xs italic text-muted-foreground`,children:e(`customer_success.icp.read_only_hint`)}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`customer_success.icp.reeval_hint`)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border pt-4`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium`,children:e(`customer_success.icp.stats_title`)}),h&&h.threads?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:JH.map(t=>(0,K.jsxs)(`span`,{className:q(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium`,YH[t]),children:[e(`customer_success.icp.verdicts.${t}`),(0,K.jsx)(`span`,{className:`tabular-nums`,children:g[t]??0})]},t))}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e(`customer_success.icp.stats_threads`,{count:h.threads??0}),` · `,e(`customer_success.icp.stats_customers`,{count:h.customers??0})]})]}):(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n?``:e(`customer_success.icp.stats_empty`)})]})]})})}var fU=`cs.list-panel-size`;function Met(){try{let e=localStorage.getItem(fU),t=e?Number(e):NaN;if(Number.isFinite(t)&&t>15&&t<70)return t}catch{}return 32}function Net(){let e=Sv(),{t}=V(),n=WL(e=>e.features.customer_success),r=WL(e=>e.loaded),i=bL(e=>e.selectedId),a=bL(e=>e.loaded),o=bL(e=>e.fetchCustomers),s=bL(e=>e.openCustomer),c=bL(e=>e.closeCustomer),l=BS(),u=Nx(e=>e.user?.current_org_id??null),[d,f]=Jv(),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(!1);(0,B.useEffect)(()=>{r&&!n&&e(`/dashboard`,{replace:!0})},[r,n,e]),(0,B.useEffect)(()=>{a||o()},[o,u,a]);let _=e=>{f(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`customer`):n.set(`customer`,e),n},{replace:!0})},v=(0,B.useRef)(u);(0,B.useEffect)(()=>{v.current!==u&&(v.current=u,d.get(`customer`)&&_(null))},[u]);let y=d.get(`customer`);(0,B.useEffect)(()=>{y&&y!==bL.getState().selectedId&&s(y)},[y,s]);let b=e=>{_(e),s(e)};if(!n)return null;let x=d.get(`view`),S=x===`themes`||x===`icp`?x:`customers`,C=e=>{f(t=>{let n=new URLSearchParams(t);return e===`customers`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})};return(0,K.jsxs)(bV,{value:S,onValueChange:e=>C(e),className:`flex h-full flex-col gap-0`,children:[(0,K.jsx)(`div`,{className:`border-b border-border px-3 py-1.5`,children:(0,K.jsxs)(xV,{children:[(0,K.jsx)(SV,{value:`customers`,children:t(`customer_success.view_toggle.customers`)}),(0,K.jsx)(SV,{value:`themes`,children:t(`customer_success.view_toggle.themes`)}),(0,K.jsx)(SV,{value:`icp`,children:t(`customer_success.view_toggle.icp`)}
280)]})}),(0,K.jsx)(CV,{value:`customers`,className:`min-h-0 flex-1`,children:(0,K.jsxs)(IH,{orientation:`horizontal`,className:`h-full`,onLayoutChanged:e=>{if(e[0])try{localStorage.setItem(fU,String(e[0]))}catch{}},children:[(0,K.jsx)(LH,{defaultSize:Met(),minSize:20,children:(0,K.jsx)(h9e,{selectedId:i,onSelect:b,onCreate:()=>m(!0),onImport:()=>g(!0),canMutate:l})}),(0,K.jsx)(RH,{}),(0,K.jsx)(LH,{defaultSize:68,minSize:30,children:(0,K.jsx)(det,{onDeleted:()=>{_(null),c()}})})]})}),(0,K.jsx)(CV,{value:`themes`,className:`min-h-0 flex-1`,children:(0,K.jsx)(Aet,{})}),(0,K.jsx)(CV,{value:`icp`,className:`min-h-0 flex-1`,children:(0,K.jsx)(jet,{})}),(0,K.jsx)(WH,{open:p,onOpenChange:m}),(0,K.jsx)(Det,{open:h,onOpenChange:g})]})}function pU({source:e,title:t,lastUpdated:n,documentTitle:r}){return(0,B.useEffect)(()=>{document.title=r},[r]),(0,K.jsx)(`div`,{className:`flex min-h-svh w-full justify-center p-6 md:p-10`,children:(0,K.jsxs)(`div`,{className:`w-full max-w-3xl`,children:[(0,K.jsxs)(uz,{children:[(0,K.jsxs)(dz,{children:[(0,K.jsx)(fz,{className:`text-2xl`,children:t}),(0,K.jsxs)(pz,{children:[`Last updated: `,n]})]}),(0,K.jsx)(mz,{className:[`text-sm leading-relaxed`,`[&_h1]:mt-8 [&_h1]:mb-3 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:first:mt-0`,`[&_h2]:mt-8 [&_h2]:mb-3 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:first:mt-0`,`[&_h3]:mt-5 [&_h3]:mb-2 [&_h3]:text-base [&_h3]:font-semibold`,`[&_p]:my-3`,`[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-6 [&_ul_li]:my-1.5`,`[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-6 [&_ol_li]:my-1.5`,`[&_table]:my-4 [&_table]:w-full [&_table]:border-collapse [&_table]:text-xs`,`[&_th]:border [&_th]:border-border [&_th]:bg-muted [&_th]:p-2 [&_th]:text-left [&_th]:font-semibold`,`[&_td]:border [&_td]:border-border [&_td]:p-2 [&_td]:align-top`,`[&_a]:underline [&_a]:hover:text-primary`,`[&_blockquote]:my-4 [&_blockquote]:rounded-md [&_blockquote]:border [&_blockquote]:border-border [&_blockquote]:bg-muted/30 [&_blockquote]:p-4 [&_blockquote]:text-xs [&_blockquote]:[&_p]:my-1`,`[&_strong]:font-semibold`].join(` `),children:(0,K.jsx)(_I,{remarkPlugins:[NI],components:{a:({href:e,children:t,...n})=>(0,K.jsx)(`a`,{href:e,target:e?.startsWith(`http`)?`_blank`:void 0,rel:e?.startsWith(`http`)?`noopener noreferrer`:void 0,...n,children:t})},children:e})})]}),(0,K.jsx)(`div`,{className:`mt-4 text-center text-sm`,children:(0,K.jsx)(Gv,{to:`/signup`,className:`underline hover:text-primary`,children:`Back to signup`})})]})})}var Pet=`## Introduction 281 282This privacy policy ("Policy") describes how mCIO Next, Inc. ("modInsight," "Company," "we," and "our") processes, collects, uses and shares personal data when using the modInsight Platform and made available at [https://login.modinsight.ai](https://login.modinsight.ai) (the "Platform"). Please read the following information carefully to understand our practices regarding your personal data and how we will process data. 283 284## Purposes of Processing 285 286### What is personal data? 287 288We collect information about you in a range of forms, including personal data. As used in this Policy, "personal data" is as defined in the General Data Protection Regulation, this includes any information which, either alone or in combination with other information we process about you, identifies you as an individual, including, for example, your name, postal address, email address and telephone number. 289 290### Why is modInsight entitled to process your data? 291 292modInsight is entitled to process your data based on provisions of law (i.e. the respective state constitutions and public records act which mandate the Secretary of State to provide public access to its records for viewing and copying). 293 294modInsight also processes your personal data when it is necessary in order to take steps at your request prior to entering a contract, such as when you register in our Platform with the intention to use or subscribe to our services. 295 296We also process your personal data for the purpose and in scope necessary to pursue our legitimate interests. 297 298In other cases, your personal data is processed based on your consent, e.g. when you use our Platform and services. 299 300## Collecting Your Personal Data 301 302### How we obtain and use your data 303 304We collect personal information in connection with your visits to and use of the Platform. This collection includes information that you provide in connection with the Platform, information from third parties, and information that is collected automatically such as through the use of cookies and other technologies. 305 306The categories of information we collect can include: 307 308### Service Inquiries and Consultation Requests 309 310We collect personal information that you provide when you inquire about our Platform or schedule a demo. This information includes your first name, last name, email, phone number,
310company, and any other information you provide, including your interests in relation to our Platform or applicable business information. We use this information to communicate with you about your inquiry or interests, and schedule a demo of our service. 311 312### Registration Information 313 314We collect personal and/or business information that you provide when you register for an account to use our service, including the Platform. This information may include your name, email, and password. We use this information to administer your account, provide you with the relevant services and information, communicate with you regarding your account, the Platform, and for customer support purposes. 315 316### Information Collected Through the Use of the Platform 317 318You may upload, or transmit files, documents, videos, images, data, or information through your communications with us or your use of the Platform (collectively, "User Content"). User Content and any information contained in the User Content, including personal information you may have included, is stored and collected as part of the service. We use the User Content to provide you with the service. 319 320### Payment Information 321 322If you sign up for our service, information is collected in connection with your payment. Depending on your subscription type, you may be able to pay via wire transfer, credit card, or check and we may collect the financial information associated with such payment (e.g., routing and account number, wire transfer information details). Please note that we use third party payment processors, to process credit card payments made to us. As such, we do not retain any personally identifiable financial information in connection with credit card payments, such as credit card numbers. Rather, all such information is provided directly by you to our third-party processor. The payment processor's use of your personal information is governed by their privacy notice. 323 324### Communications 325 326If you communicate with us through any paper or electronic form, we may collect your name, email address, mailing address, phone number, or any other personal information you choose to provide to us. We use this information to investigate and respond to your inquiries, and to communicate with you, to enhance the services we offer to our users and to manage and grow our organization. If you register for our newsletters or updates, we may communicate with you by email. 327 328### Marketing Emails 329 330If you sign up to receive news or alerts from us, we collect your email and applicable interests and communication preferences in order to send you regular updates about the Platform. We use this information to manage our communications with you and send you information about products and services we think may be of interest to you. If you wish to stop receiving email messages from us, simply click the "unsubscribe link" provided at the bottom of the email communication. Note that you cannot unsubscribe from certain services-related email communications (e.g., account verification, confirmations of transactions, technical or legal notices). 331 332### Employment Applications 333 334If you apply for employment, we collect your contact and demographic information, educational and work history, employment interests, information obtained during interviews and any other information you choose to provide. We use the information provided to evaluate your candidacy for employment, to communicate with you during the application process and to facilitate the onboarding process. 335 336### Information from Third Party Sources 337 338We may receive personal information about you from our business partners and service providers and combine this information with other data we collect from you. The third parties may include website and service operators, payment processors, marketing partners, and shipping providers. The information may include contact information, demographic information, information about your communications and related activities, and information about your orders. We may use this information to administer and facilitate our services, your orders, and our marketing activities. 339
340## Google Workspace API Data 341 342The Platform integrates with Google Workspace (Gmail, Google Calendar, and Google Tasks) when you choose to connect a Google account. Below we describe exactly what data we access, why we access it, and how we restrict our use of that data. 343 344### Scopes we request 345 346| Scope | Data accessed | Purpose | 347|---|---|---| 348| \`gmail.readonly\` | Inbox messages, headers, and attachments | Ingest contract-related emails for risk analysis and review | 349| \`gmail.send\` | Send-mail capability | Send AI-drafted reply emails after explicit user approval | 350| \`gmail.modify\` | Message labels and read state | Label processed messages so we do not reprocess them | 351| \`calendar.events\` | Calendar event metadata (titles, times, locations) | Display upcoming events on the dashboard | 352| \`tasks\` | Google Tasks list contents | Display the user's task list on the dashboard | 353| \`userinfo.email\` | Account email address | Identify the connected Google account | 354 355You can disconnect any Google scope at any time by visiting your [Google Account permissions page](https://myaccount.google.com/permissions) or by using the in-app controls described under "Storage, retention, and deletion" below. 356 357### Limited Use of Google User Data 358 359modInsight's use and transfer of information received from Google APIs to any other app will adhere to the [Google API Services User Data Policy](https://developers.google.com/terms/api-services-user-data-policy), including the Limited Use requirements. 360 361Specifically: 362 363- **No advertising.** We do not use or transfer Google user data for serving ads, including retargeting, personalized, or interest-based advertising. 364- **No AI/ML model training.** We do not use, transfer, or retain Google Workspace data to develop, train, fine-tune, or improve any generalized or non-personalized machine learning or artificial intelligence models, including large language models such as Anthropic Claude, OpenAI GPT, or any other generative AI system. Google Workspace data is processed only at request time to deliver user-facing features (contract analysis, email drafting, calendar/task display) and is never used as training data, fed to third-party model providers for training, or retained for model-development purposes. 365- **No human review.** We do not allow humans to read your Google user data, except (a) with your explicit affirmative consent for specific messages or files, (b) where necessary for security purposes such as investigating abuse, (c) to comply with applicable law, or (d) for internal operations only after the data has been aggregated and anonymized in a way that cannot be re-associated with you. 366- **No third-party transfer.** We only transfer Google user data to others as necessary to provide or improve user-facing features that are prominent in our application's user interface, to comply with applicable law, or as part of a merger, acquisition, or sale of assets with notice to you. 367 368### Storage, retention, and deletion 369 370Email content and attachments ingested via Gmail are stored encrypted in our document store and indexed for retrieval. Calendar events and Tasks are cached for dashboard display. You may disconnect your Google account or delete all synced Google data at any time from **Settings â Integrations**. Disconnection deletes stored OAuth tokens immediately. "Delete synced data" removes ingested email content, derived contract documents, evaluations, redlines, calendar events, and tasks within 24 hours, except where retention is required by law. You may also revoke modInsight's access directly via your Google Account at [https://myaccount.google.com/permissions](https://myaccount.google.com/permissions). 371 372## Microsoft Graph API Data (Outlook) 373 374The Platform optionally integrates with Microsoft 365 (Outlook Mail, Outlook Calendar, and Microsoft To Do) when you choose to connect a Microsoft account. We request permissions equivalent to the Google scopes above (\`Mail.Read\`, \`Mail.Send\`, \`Calendars.Read\`, \`Tasks.ReadWrite\`, \`User.Read\`) and use them solely to provide the same user-facing features:
374ingest contract emails for analysis, send approved replies, and display calendar events and tasks on the dashboard. 375 376We apply the same restrictions to Microsoft user data that we apply to Google user data: no advertising use, no AI/ML model training, no unauthorized human review, and no transfer to third parties beyond what is necessary to deliver these features. You may disconnect or delete synced Microsoft data from **Settings â Integrations** at any time, and revoke access via [https://myaccount.microsoft.com/](https://myaccount.microsoft.com/). 377 378## Single Sign-On 379 380We may use single sign-on ("SSO") to allow a user to authenticate their account using one set of login information. We will have access to certain information from those third parties in accordance with the authorization procedures determined by those third parties, which may include, for example, your name, username, email address, language preference, and profile picture. We use this information to operate, maintain, and provide to you the features and functionality of the Platform. We may also send you service-related emails or messages (e.g., account verification, purchase confirmation, customer support, changes, or updates to features of the Platform, technical and security notices). 381 382### Social Media 383 384When you interact with our site through various social media, such as when you click on the social media icon on the site, follow us on a social media site, or post a comment to one of our pages, we may receive information from the social network such as your profile information, profile picture, gender, username, user ID associated with your social media account, age range, language, country, and any other information you permit the social network to share with third parties. The data we receive is dependent upon your privacy settings with the social network. We use this information to operate, maintain, and provide to you the features and functionality of the Platform, as well as to communicate directly with you, such as to send you email messages about products and services that may be of interest to you. 385 386### Information from Other Sources 387 388We may obtain information from other sources, including through third-party information providers, our shareholders, customers, or through transactions such as mergers and acquisitions. We may combine this information with other information we collect from or about you. In these cases, our Privacy Notice governs the handling of the combined personal information. We use this information to operate, maintain, and provide to you the features and functionality of the Service, as well as to communicate directly with you, such as to send you email messages about products and services that may be of interest to you. 389 390### Other Uses of Personal Information 391 392In addition to the uses described above, we may collect and use personal information for the following purposes: 393 394- For our business activities, including to operate and improve our service, including the Platform, and to provide you with the features and functionality of our service; 395- To communicate with you and respond to your requests, such as to respond to your questions, contact you about changes to the service, and communicate about account related matters; 396- To authenticate your account credentials and identify you, as necessary to log you in and/or ensure the security of your account; 397- For marketing and advertising purposes, such as to market to you or offer you with information and updates on our products or services we think that you may be interested in, including to provide other news or information about modInsight and our select partners; 398- For analytics and research purposes; 399- To enforce our contracts, including our Platform Terms of Service, to resolve disputes, to carry out our obligations and enforce our rights, and to protect our business interests and the interests and rights of third parties; 400- To comply with contractual and legal obligations and requirements; 401- Enable you to communicate and share files with users you designate; 402- To fulfill any other purpose for which you provide personal information; and 403- For any other lawful purpose, or other purpose that you consent to. 404
405We may use aggregated and/or de-identified data for any purpose, except that data derived from Google Workspace APIs or Microsoft Graph APIs is governed by the "Limited Use of Google User Data" and "Microsoft Graph API Data (Outlook)" sections above and is not used to develop or train generalized AI/ML models even in aggregated or de-identified form. 406 407### Automated Decision Making and Profiling 408 409We do not use your personal data for the purposes of automated decision-making, including profiling. By profiling, we mean the processing of your data by using them to evaluate certain information about you, in particular to analyze or forecast your personal preferences or interests. However, we may do so to fulfill obligations imposed by law, in which case we will inform you of any such processing and provide you with an opportunity to object. 410 411## Cookies 412 413### What are cookies? 414 415We may collect information using "cookies." Cookies are small data files stored on the hard drive of your computer or mobile device by a Platform. We may use both session cookies (which expire once you close your web browser) and persistent cookies (which stay on your computer or mobile device until you delete them) to provide you with a more personal and interactive experience on our Platform. 416 417We use two broad categories of cookies: (1) first party cookies, served directly by us to your computer or mobile device, which are used only by us to recognize your computer or mobile device when it revisits our Platform; and (2) third party cookies, which are served by service providers on our Platform, and can be used by such service providers to recognize your computer or mobile device when it visits other Platforms. 418 419### Cookies we use 420 421Our Platform uses the following types of cookies for the purposes set out below: 422 423| Type of cookie | Purpose | 424|---|---| 425| Essential Cookies | These cookies are essential to provide you with services available through our Platform and to enable you to use some of its features. For example, they allow you to log in to secure areas of our Platform and help the content of the pages you request load quickly. Without these cookies, the services that you have asked for cannot be provided, and we only use these cookies to provide you with those services. | 426| Functionality Cookies | These cookies allow our Platform to remember choices you make when you use our Platform, such as remembering your language preferences, remembering your login details and remembering the changes you make to other parts of our Platform which you can customize. The purpose of these cookies is to provide you with a more personal experience and to avoid you having to re-enter your preferences every time you visit our Platform. | 427| Analytics and Performance Cookies | These cookies are used to collect information about traffic to our Platform and how users use our Platform. The information gathered does not identify any individual visitor. It includes the number of visitors to our Platform, the Platforms that referred them to our Platform, the pages they visited on our Platform, what time of day they visited our Platform, whether they have visited our Platform before, and other similar information. We use this information to help operate our Platform more efficiently, to gather broad demographic information and to monitor the level of activity on our Platform. | 428| Targeted and advertising cookies | These cookies track your browsing habits to enable us to show advertising which is more likely to be of interest to you. These cookies use information about your browsing history to group you with other users who have similar interests. Based on that information, and with our permission, third party advertisers can place cookies to enable them to show adverts which we think will be relevant to your interests while you are on third party Platforms. You can disable cookies which remember your browsing habits and target advertising at you by visiting [http://www.youronlinechoices.com/uk/your-ad-choices](http://www.youronlinechoices.com/uk/your-ad-choices). If you choose to remove targeted or advertising cookies, you will still see adverts but they may not be relevant to you. Even if you do choose to remove cookies by the companies listed at the above link, not all c
428ompanies that serve online behavioral advertising are included in this list, and so you may still receive some cookies and tailored adverts from companies that are not listed. | 429| Social Media Cookies | These cookies are used when you share information using a social media sharing button or "like" button on our Platform or you link your account or engage with our content on or through a social networking Platform such as Facebook, Twitter or LinkedIn. The social network will record that you have done this. | 430 431### Disabling cookies 432 433You can typically remove or reject cookies via your browser settings. In order to do this, follow the instructions provided by your browser (usually located within the "settings," "help," "tools" or "edit" facility). Many browsers are set to accept cookies until you change your settings. 434 435If you would prefer not to accept cookies, most browsers will allow you to: (i) change your browser settings to notify you when you receive a cookie, which lets you choose whether or not to accept it; (ii) disable existing cookies; or (iii) set your browser to automatically reject cookies. Please note that doing so may negatively impact your experience using the sites, as some features and services on our sites may not work properly. Depending on your mobile device and operating system, you may not be able to delete or block all cookies. You may also set your e-mail options to prevent the automatic downloading of images that may contain technologies that would allow us to know whether you have accessed our e-mail and performed certain functions with it. 436 437### Advertising 438 439To learn more about interest-based advertising and how you may be able to opt-out of some of this advertising, you may wish to visit the Digital Advertising Alliance's (DAA) resources and/or the Network Advertising Initiative's (NAI) online resources, at [www.aboutads.info/choices](http://www.aboutads.info/choices) or [http://www.networkadvertising.org/choices/](http://www.networkadvertising.org/choices/) and you can opt-out of receiving some interest-based advertisements on mobile apps by visiting [http://www.aboutads.info/appchoices](http://www.aboutads.info/appchoices). 440 441Please note that when you opt out of receiving interest-based advertisements, this does not mean you will no longer see advertisements from us or on our online services. It means that the online ads that you do see from DAA program participants should not be based on your interests. We are not responsible for the effectiveness of, or compliance with, any third-parties' opt-out options or programs or the accuracy of their statements regarding their programs. In addition, third parties may still use cookies to collect information about your use of our online services, including for analytics and fraud prevention as well as any other purpose permitted under the DAA's Principles. 442 443## Sharing Your Personal Data 444 445We may share your personal data as follows: 446 447- **Third Parties Designated by You.** We may share your personal data with third parties where you have provided your consent to do so. 448- **Our Third Party Service Providers.** We may share your personal data with our third party service providers who provide services such as data analysis, payment processing, information technology and related infrastructure provision, customer service, email delivery, auditing and other similar services. 449- **Third Party Sites.** Our Platform may contain links to third party Platforms and features. This Policy does not cover the privacy practices of such third parties. These third parties have their own privacy policies and we do not accept any responsibility or liability for their Platforms, features or policies. Please read their privacy policies before you submit any data to them. 450 451## Customer Data 452 453In providing our Service, our customers may upload data to our Platform, or we may collect data on their behalf, which may include personal information or data about our customers' end users ("Customer Data"). We collect and process Customer Data as needed to provide our Services to our customers in accordance with our customer agreements. This Privacy Notice does not apply to the processing of Customer Data. 454 455### European Economic Area, United Kingdom or Switzerland Customers 456 457modInsight acts as a data "processor" for purposes of Regulation (EU) 2016/679 (the "EU GDPR") or, where applicable, the "UK GDPR" as defined in the UK Data Protection Act (collectively "GDPR"). As such, our customers act as data "controllers" in relation to the data processed by modInsight in the performance of the Services. We process Customer Data solely on behalf of, and as directed by, our customers. We enter into data processing agreements with our customers which set out our obligations under the GDPR, including to direct any end user individual rights requests to our customers. In addition, we frequently enter into the EU Commission's
457Standard Contractual Clauses with our customers in order to legitimize the transfer of Customer Data outside of the European Economic Area, United Kingdom or Switzerland to the US. 458 459### California (United States) Customers 460 461For purposes of the California Consumer Privacy Act ("CCPA"), in the same way as we act as a data "processor" for GDPR purposes, modInsight acts as a "service provider" in relation to the Customer Data we process in the performance of the Services. We process, retain, use, and disclose personal information only as necessary to provide the Services. In other words, we use the Customer Data strictly for business purposes (as defined by the CCPA). We enter into data processing agreements with our customers which set out our obligations under the CCPA, which includes forwarding our customers any end user individual rights requests and providing reasonable and timely assistance to our customers in complying with our customer's obligations with respect to consumer access and deletion requests under the CCPA. 462 463## Security 464 465We seek to use reasonable organizational, technical and administrative measures to protect personal data within our organization. Unfortunately, no transmission or storage system can be guaranteed to be completely secure, and transmission of information via the Internet is not completely secure. If you have reason to believe that your interaction with us is no longer secure (for example, if you feel that the security of any account you might have with us has been compromised), please immediately notify us of the problem by contacting us. 466 467## Retention 468 469We will only retain your personal data as long as reasonably required for you to use the Platform until you close your account/cancel your subscription unless a longer retention period is required or permitted by law (for example for regulatory purposes). 470 471## Our Policy on Children 472 473Our Platform is/are not directed to children under 16. If a parent or guardian becomes aware that his or her child has provided us with information without their consent, he or she should contact us. We will delete such information from our files as soon as reasonably practicable. 474 475## Your Rights 476 477- **Opt-out.** You may contact us anytime to opt-out of: (i) direct marketing communications; (ii) automated decision-making and/or profiling; (iii) our collection of sensitive personal data; (iv) any new processing of your personal data that we may carry out beyond the original purpose; or (v) the transfer of your personal data outside the EEA. Please note that your use of some of the Platform may be ineffective upon opt-out. 478- **Access.** You may access the information we hold about you at any time via your profile/account or by contacting us directly. 479- **Amend.** You can also contact us to update or correct any inaccuracies in your personal data. 480- **Move / Data Portability.** Your personal data is portable, i.e. you to have the flexibility to move your data to other service providers as you wish. 481- **Erase and forget.** In certain situations, for example when the information we hold about you is no longer relevant or is incorrect, you can request that we erase your data. 482- **Object to processing.** You have the right to object to modInsight's processing of your personal data, under certain conditions. 483- **Restrict processing.** You have the right to request that modInsight restrict the processing of your personal data, under certain conditions. 484 485If you wish to exercise any of these rights, please contact us. In your request, please make clear: (i) what personal data is concerned; and (ii) which of the above rights you would like to enforce. For your protection, we may only implement requests with respect to the personal data associated with the particular email address that you use to send us your request, and we may need to verify your identity before implementing your request. We will try to comply with your request as soon as reasonably practicable and in any event, within sixty days of your request. Please note that we may need to retain certain information for recordkeeping purposes and/or to complete any transactions that you began prior to requesting such change or deleti
485on. 486 487## Complaints 488 489We are committed to resolve any complaints about our collection or use of your personal data. If you would like to make a complaint regarding this Policy or our practices in relation to your personal data, please contact us through the information listed on our Platform. We will reply to your complaint as soon as we can. We hope to resolve any complaint brought to our attention, however if you feel that your complaint has not been adequately resolved, you reserve the right to contact your local data protection supervisory authority. 490 491## Privacy policies of other websites 492 493For your convenience, our service may provide links to third-party websites or services that we do not own or operate. We are not responsible for the practices employed by any websites or services linked to or from the services, including the information or content contained within them. Your browsing and interaction on any other website or service are subject to the applicable third party's rules and policies, not ours. If you are using a third-party website or service, you do so at your own risk. We encourage you to review the privacy policies of any website or service before providing any personal information. 494 495## Changes to our Privacy Policy 496 497modInsight keeps its privacy policy under regular review and places any updates on this web page. This Policy was last updated on May 8, 2026. 498 499## Contact Information 500 501We welcome your comments or questions about this Policy. You may contact us in writing or through this email address: [[email protected]](mailto:[email protected]) 502`;function Fet(){return(0,K.jsx)(pU,{source:Pet,title:`Privacy Policy`,lastUpdated:`May 8, 2026`,documentTitle:`Privacy Policy â modInsight`})}var Iet=`Please read this Terms of Service agreement (the "Agreement") carefully before using the Services. This Agreement governs the provision of Services by mCIO Next, Inc. ("modInsight") to you (the "Customer" or "you") and Customer's use of the Services. 503 504> You indicate your acceptance of this Agreement and all of the terms and conditions hereunder by accessing or using any modInsight Solutions or Data. If you do not agree to these terms and conditions, you may not access or use any modInsight Services, Data, or modInsight Intellectual Property. You agree that this Agreement is enforceable like any written Agreement signed by you. 505 506> If you are using any modInsight Services as an employee, contractor, or agent of a corporation, partnership or similar entity, then you must be authorized to sign for and bind such entity in order to accept the terms of this Agreement, and you represent and warrant that you have the authority to do so with your continued usage hereof. The rights granted under this Agreement are expressly conditioned upon acceptance by such authorized personnel. 507 508## Definitions 509 5101. **"Documentation"** shall mean any user manuals, technical specifications, and other materials provided by modInsight relating to the Services and solely to the extent published and made available at [https://login.modinsight.ai](https://login.modinsight.ai) or a related web property dedicated to the support materials of the foregoing services offering by modInsight. 5112. **"Effective Date"** shall mean the date which is the earlier of (a) Customer's initial access to any modInsight Service through any online provisioning, registration or order process or (b) the effective date of the first Order Form referencing this Agreement. 5123. **"Order Form"** shall mean the document issued by modInsight to Customer stating the materials, services and quantities provided for a specified price as set out in a modInsight issued invoice, through a signed written contract, or through the Platform including any additional Services purchased therein. 5134. **"Platform"** shall mean the technology environment provided by modInsight and made available at [https://login.modinsight.ai](https://login.modinsight.ai) or a similar online access point. 5145. **"Services"** shall mean the service solution provided by modInsight to Customer. 5156. **"Subscription Term"** shall mean the current period and any applicable renewal period as set out in the Order Form including month-to-month during which Customer has a valid license to use the Services. 516 517## 2. Services 518 519### 2.1 Provision of Services 520 521modInsight agrees to provide the Services to Customer during the Subscription Term. The Services shall be provided in accordance with this Agreement and the Documentation. 522 523### 2.2 Access and Use 524 525Subject to the terms of this Agreement, modInsight grants Customer a limited, non-exclusive, non-transferable right to access and use the Services for the intended business purpose during the Term. Customer shall be responsible for any acts or omissions by its affiliates or contractors provided with access to the Services. The Services are subject to usage limits as specified in the Order Form and in the Documentation. Customer will execute an Order Form for additional quantities as necessary during the Subscription Term. 526 527### 2.3 Sensitive Data 528 529Customer agrees that it will not provide modInsight access to sensitive data, regulated data including personal or trade sensitive information, or any information that has a heightened degree of protection by applicable law ("Sensitive Data"). If Customer discovers that due to human error or otherwise, customer data does include Sensitive Data, Customer will immediately notify modInsight and modInsight will promptly delete the Sensitive Data in its control or possession. 530 531### 2.4 Restrictions 532 533Customer will not modify, translate, reverse engineer, or copy the Services or related documentation in any manner; (b) reverse assemble, decompile, reverse engineer, translate or otherwise attempt to derive or obtain the source code, the underlying ideas, algorithms, structure or organization of the Services or otherwise seek to obtain the non-public APIs to the Service; (c) copy or duplicate some or all of the Services or otherwise access the Services to build or develop competitive products; (d) use the Services for the benefit of any third party or to provide substantially similar services to the Services; (e) publish any benchmark testing results on the Services without modInsight's written consent; (f) remove or obscure any proprietary markings or notices contained in the Service or (g) access or use the Services other than for the stated purpose and under no circumstances for a purpose designed to circumvent, facilitate, or contribute to the breach of any contract or violation of law. 534 535## 3. Terms and Conditions 536 537### 3.1 Subscription Term 538 539Either party may terminate this Agreement upon written notice. The Agreement may al
539so terminate upon the expiration of any applicable Subscription Term, unless expressly stated otherwise therein or in this Agreement. 540 541### 3.2 Termination for Cause 542 543Either Party may terminate for cause in the event of a material breach by the other Party, provided that the non-breaching Party provides written notice of the breach, and the breaching Party fails to cure such breach within 30 days of receiving written notice. modInsight may terminate at any time for Customer's failure to make payment or for a violation of Section 2.2, 2.3 or 2.4 without limiting other remedies that may be available under equity or law. 544 545### 3.3 Effect of Termination 546 547Upon termination, Customer's right to access the Services shall immediately cease. 548 549## 4. Confidentiality 550 551Each party will protect the confidentiality of the other party's Confidential Information using the same degree of care that it uses for its own confidential information of the other party (the "Disclosing Party") for any purpose outside the scope of this Agreement; and (b) except as otherwise authorized by the Disclosing Party in writing, limit access to Confidential Information of the Disclosing Party to those of its and its Affiliates' employees and contractors who need that access for purposes consistent with this Agreement and who are bound by obligations of confidentiality to the Receiving Party containing protections not materially less protective of the Confidential Information than those herein. If Receiving Party is required by law or court order to disclose Confidential Information, then Receiving Party shall, to the extent legally permitted, provide Disclosing Party with advance written notice and cooperate in any effort to obtain confidential treatment of the Confidential Information. The Receiving Party acknowledges that disclosure of Confidential Information would cause substantial harm for which damages alone would not be a sufficient remedy, and therefore that upon any such disclosure by the Receiving Party, the Disclosing Party will be entitled to seek appropriate equitable relief in addition to whatever other remedies it might have at law. 552 553## 5. Intellectual Property 554 555### 5.1 Ownership 556 557Customer acknowledges and agrees that all intellectual property rights in the Services and Documentation, including any modifications or enhancements, are and shall remain the exclusive property of modInsight. 558 559### 5.2 Customer Data 560 561Customer shall retain all right, title, and interest in and to any data or information uploaded to the Services ("Customer Data"). Customer grants modInsight a limited, non-exclusive, worldwide license to use, host, backup, transmit, and display the Customer Data as necessary to provide, operate, maintain, enhance, and update the Services and to perform its obligations under this Agreement. Notwithstanding the foregoing, You agree that modInsight has the right to: (a) access and use Customer Data for the foregoing purpose and to provide statistical insights and analysis related to usage of the Services; and (b) anonymize and aggregate Your Data (such anonymized and aggregated data, "Aggregate Data") to prepare reports, studies, analyses, and other work product resulting from such Aggregate Data, provided that under no circumstances will modInsight distribute or otherwise make available to any third party any data in violation of Section 4 above. Except as necessary to provide the Services to Customer, modInsight shall not use Customer Data to improve or train it's models and shall maintain the safeguards set out in Section 4 to protect Customer Data received by modInsight under the Agreement. 562 563### 5.3 Feedback 564 565Customer may be asked or may at their option provide feedback regarding their use of the Services. Customer acknowledges that modInsight owns all feedback provided and hereby grants modInsight a perpetual, non-revocable, royalty-free worldwide license to use and otherwise incorporate such feedback into any of modInsight products or services at any time at modInsight's sole discretion. If modInsight chooses to publish such feedback, it will do so in compliance with the terms of this Agreement including modInsight's commitment to confidentiality under Section 4. modInsight may al
565so monitor how you use the Services and use that information to improve the Services or other products and services subject to this Section 5.2. 566 567## 6. Payment Agreement 568 569### 6.1 Subscription Fee 570 571Customer shall pay modInsight the stated amount on the Order Form, which may vary from the standard charge based on the Customer's actual usage. Any amounts paid shall be non-cancelable, non-refundable and payable in advance. 572 573### 6.2 Taxes 574 575Customer shall be responsible for all applicable taxes, duties, or other governmental charges arising out of or related to this Agreement, excluding taxes based on modInsight's net income. 576 577## 7. Warranty and Disclaimer 578 579### 7.1 Service Warranty 580 581modInsight warrants that: (a) the Services will operate in substantial conformity with the applicable Documentation; and (b) Services and deliverables as set out in an Order Form will be provided in a professional and workmanlike manner. 582 583### 7.2 Mutual Warranty 584 585Each party warrants that it has validly entered into this Agreement and has the legal power to do so. 586 587### 7.3 Warranty Disclaimer 588 589> Except as expressly set forth in this Agreement, Services and corresponding data are provided "as is," and modInsight makes no other warranties, express or implied, statutory or otherwise, including but not limited to, warranties of merchantability, title, fitness for a particular purpose, or non-infringement. modInsight does not warrant that the use of the Services will be uninterrupted or error-free, nor does modInsight warrant that it will review the Customer Data for accuracy. 590 591## 8. Limitation of Liability 592 593> In no event shall either party be liable for any direct, incidental, special or consequential damages or damages for loss of profits, revenue, data or interruption of business incurred by the other party or any third party whether in action in contract or tort, arising from Customer's access to, or use of the Services or any content provided through the Services. Except for a breach of Section 2.4, Section 5, or Section 6, each party's sole and exclusive liability under this Agreement shall limited to no more than the subscription fees actually paid to modInsight for the preceding twelve (12) months or $500, whichever is lower. 594 595## 9. Customer Reference 596 597modInsight may identify Customer as its customer to other modInsight customers or prospective customers. Without limiting the foregoing, modInsight may use and display Customer's name, logo, trademarks, and service marks on modInsight's website and in modInsight's marketing materials identifying Customer as a customer of modInsight. Upon Customer's written request, modInsight will promptly remove any such marks from modInsight's website and marketing materials. 598 599## 10. Assignment 600 601Neither Party may assign or transfer its rights or obligations under this Agreement, in whole or in part, without the prior written consent of the other Party, except that either Party may assign this Agreement without consent to a successor-in-interest in connection with a merger, acquisition, or sale of all or substantially all of its assets. 602 603## 11. Survival 604 605The following sections will survive any expiration or termination of this Agreement: Section 1 (Definitions), Section 2.4 (Restrictions on Use), Section 3 (Term and Termination), Section 4 (Confidentiality), Section 5 (Intellectual Property), Section 6 (Payment Agreement), Section 7.3 (Warranty Disclaimer), Section 8 (Limitation of Liability), and Sections 11 through 13. 606 607## 12. Governing Law 608 609This Agreement shall be governed by and construed in accordance with the laws of the State of Delaware, without regard to its conflict of laws principles. 610 611## 13. Miscellaneous 612 613### 13.1 Entire Agreement 614 615This Agreement shall be governed by and construed in accordance with the laws of the State of Delaware, without regard to its conflict of laws principles. 616 617### 13.2 Amendments 618 619From time to time, modInsight may modify this Agreement. Unless otherwise specified by modInsight, changes become effective for Customer upon renewal of the then-current Subscription Term or upon the effective date of a new Order Form after the updated version of this Agreement goes into effect. Customer may be required to click to accept or otherwise agree to the modified Agreement before renewing a Subscription Term or upon the effective date of a new Order Form, and in any event continued use of any Service after the updated version of this Agreement goes into effect will constitute Customer's acceptance of such updated version. 620 621### 13.3 Severability 622 623If any provision of this Agreement is held to be invalid, illegal, or unenforceable, the remaining provisions shall remain in full force and effect. 624 625### 13.4 No Waiver 626 627The failure of either Party to enforce any provision of this Agreement shall not be deemed a waiver of that provision or any other provision of this Agreement. Any waiver of a provision of this Agreement shall only be effective if it is in writing and signed by the Party granting the waiver. 628`;function Let(){return(0,K.jsx)(pU,{source:Iet,title:`Platform Terms of Service`,lastUpdated:`April 23, 2026`,documentTitle:`Platform Terms of Service â modInsight`})}var Ret=`admin_policy_enforced`;function zet(){let{t:e}=V(),[t]=Jv(),n=Sv(),{handleCallback:r}=Xx(),i=(0,B.useRef)(!1);return(0,B.useEffect)(()=>
628{if(i.current)return;i.current=!0;let a=t.get(`code`),o=t.get(`state`),s=t.get(`error`);if(s){if(X(Error(`Google OAuth refused: ${s}`),{operation:`gmail_oauth_callback_error`,metadata:{error:s}}),s===Ret){n(`/settings/integrations?google_blocked=${encodeURIComponent(s)}`);return}G.error(e(`callbacks.gmail_error`)),n(`/settings/integrations`);return}if(!a||!o){G.error(e(`callbacks.gmail_error`)),n(`/`);return}r(a,o).then(t=>{G.success(e(`toasts.integrations.gmail_connected`),{description:t}),n(`/settings/integrations`)}).catch(t=>{G.error(Kb(t,e(`callbacks.gmail_error`))),n(`/settings/integrations`)})},[t,n,r,e]),(0,K.jsx)(`div`,{className:`flex items-center justify-center h-screen`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-3 text-gray-500`,children:[(0,K.jsx)(W,{size:20,className:`animate-spin`}),(0,K.jsx)(`span`,{className:`text-sm`,children:e(`callbacks.gmail_connecting`)})]})})}function Bet(){let{t:e}=V(),[t]=Jv(),n=Sv(),{handleCallback:r}=$x(),i=(0,B.useRef)(!1);return(0,B.useEffect)(()=>{if(i.current)return;i.current=!0;let a=t.get(`code`),o=t.get(`state`);if(!a||!o){G.error(e(`callbacks.outlook_error`)),n(`/`);return}r(a,o).then(t=>{G.success(e(`toasts.integrations.outlook_connected`),{description:t}),n(`/settings/integrations`)}).catch(t=>{G.error(Kb(t,e(`callbacks.outlook_error`))),n(`/settings/integrations`)})},[t,n,r,e]),(0,K.jsx)(`div`,{className:`flex items-center justify-center h-screen`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-3 text-gray-500`,children:[(0,K.jsx)(W,{size:20,className:`animate-spin`}),(0,K.jsx)(`span`,{className:`text-sm`,children:e(`callbacks.outlook_connecting`)})]})})}function Vet(){let{t:e}=V(),[t]=Jv(),n=Sv(),{handleCallback:r}=vL(),i=(0,B.useRef)(!1);return(0,B.useEffect)(()=>{if(i.current)return;i.current=!0;let a=t.get(`code`),o=t.get(`state`);if(!a||!o){G.error(e(`callbacks.slack_error`)),n(`/`);return}r(a,o).then(()=>{G.success(e(`toasts.integrations.slack_connected`)),n(`/settings/notifications`)}).catch(()=>{G.error(e(`callbacks.slack_error`)),n(`/`)})},[t,n,r,e]),(0,K.jsx)(`div`,{className:`flex items-center justify-center h-screen`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-3 text-gray-500`,children:[(0,K.jsx)(W,{size:20,className:`animate-spin`}),(0,K.jsx)(`span`,{className:`text-sm`,children:e(`callbacks.slack_connecting`)})]})})}function Het({taskId:e,currentCategory:t,trigger:n}){let[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(null),s=Ux(e=>e.reclassify),c=RL(e=>e.categories),l=RL(e=>e.allCategoryOptions)(),u=async n=>{if(!a){if(n===t){i(!1);return}o(n);try{await s(e,n),i(!1)}finally{o(null)}}};return(0,K.jsxs)(aP,{open:r,onOpenChange:i,children:[(0,K.jsx)(oP,{asChild:!0,children:n??(0,K.jsx)(J,{variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-[11px]`,"aria-label":`Reclassify`,onClick:e=>e.stopPropagation(),children:(0,K.jsx)(z_,{className:`h-3.5 w-3.5`})})}),(0,K.jsx)(sP,{className:`w-44 p-1`,align:`end`,onClick:e=>e.stopPropagation(),children:(0,K.jsx)(`div`,{className:`flex flex-col`,children:l.map(e=>{let n=p1e(e),r=e===t,i=a===e;return(0,K.jsxs)(`button`,{type:`button`,disabled:r||a!==null,onClick:()=>u(e),className:`flex items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs hover:bg-muted disabled:opacity-60 disabled:cursor-not-allowed`,children:[(0,K.jsx)(n,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:f1e(e,c)}),r&&(0,K.jsx)(Lg,{className:`h-3.5 w-3.5 text-muted-foreground`}),i&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`â¦`})]},e)})})})]})}const mU=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed/i,hU=`stale-chunk-reloads`,gU=Number(sessionStorage.getItem(`stale-chunk-reloads`)||`0`);function _U(){gU>=1||(sessionStorage.setItem(hU,String(gU+1)),window.location.reload())}function vU(e){return(0,B.lazy)(async()=>{let t;try{t=await e()}catch{throw _U(),Error(`Failed to fetch dynamically imported module (stale chunk)`)}if(!t||t.default===void 0)throw _U(),Error(`Failed to fetch dynamically imported module (stale chunk)`);return t})}var Uet=vU(()=>ev(()=>import(`./DocumentSpreadsheetPreview-BJcChBnu.js`),__vite__mapDeps([0,1,2,3])));function Wet(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Get(e,t){return e&&t?`${e} <${t}>`:t||e||``}function Ket({status:e}){return e===`pending`?(0,K.jsx)(Jg,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}):e===`processing`?(0,K.jsx)(W,{className:`h-3.5 w-3.5 animate-spin text-blue-500 shrink-0`}):e===`completed`?(0,K.jsx)(n_,{className:`h-3.5 w-3.5 text-green-500 shrink-0`}):(0,K.jsx)(Hg,{className:`h-3.5 w-3.5 text-destructive shrink-0`})}function qet({doc:e}){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(!1),a=e.original_filename.toLowerCase(),o=a.endsWith(`.csv`)||a.endsWith(`.xlsx`)||a.endsWith(`.xls`),s=`${e.document_id??``}|${e.status}`,[c,l]=(0,B.useState)(s);return c!==s&&(l(s),n(null),i(e.status===`completed`&&!!e.document_id)),(0,B.useEffect)(()=>{e.status!==`completed`||!e.document_id||ex(e.document_id).then(e=>{n(e.data.download_url.replace(`http://minio:9000`,`/minio-proxy`))}).catch(()=>{n(null)}).finally(()=>i(!1))}
628,[e.document_id,e.status]),e.status===`pending`?(0,K.jsx)(`div`,{className:`flex items-center justify-center flex-1`,children:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Waiting to processâ¦`})}):e.status===`processing`?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 flex-1`,children:[(0,K.jsx)(W,{className:`h-5 w-5 animate-spin text-muted-foreground`}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Processingâ¦`})]}):e.status===`failed`?(0,K.jsx)(`div`,{className:`flex items-center justify-center flex-1`,children:(0,K.jsx)(`p`,{className:`text-xs text-destructive`,children:Ub(e.processing_error,{operation:`email.document.processingError`})||`Processing failed`})}):r?(0,K.jsx)(`div`,{className:`flex items-center justify-center flex-1`,children:(0,K.jsx)(W,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):t?o?(0,K.jsx)(B.Suspense,{fallback:(0,K.jsx)(`div`,{className:`flex items-center justify-center flex-1`,children:(0,K.jsx)(W,{className:`h-5 w-5 animate-spin text-muted-foreground`})}),children:(0,K.jsx)(Uet,{previewUrl:t,filename:e.original_filename})}):(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(`iframe`,{src:t,className:`w-full flex-1 border-0`,title:`Document preview: ${e.original_filename}`})}):(0,K.jsx)(`div`,{className:`flex items-center justify-center flex-1`,children:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Preview unavailable`})})}function yU(e,t){return`att:${e.attachment_id??`idx-${t}`}`}function Jet({att:e}){return e.download_blocked?(0,K.jsx)(g_,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}):e.can_process?(0,K.jsx)(C_,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}):(0,K.jsx)(Ooe,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`})}function Yet({taskId:e,att:t}){let{processAttachment:n,downloadAttachment:r}=Ux(),[i,a]=(0,B.useState)(!1);async function o(){a(!0);try{await n(e,t.attachment_id??``,t.filename)}finally{a(!1)}}async function s(){a(!0);try{await r(e,t.attachment_id??``,t.filename)}finally{a(!1)}}return t.download_blocked?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 flex-1 p-6 text-center`,children:[(0,K.jsx)(g_,{className:`h-8 w-8 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium break-all`,children:t.filename}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.reason})]})]}):t.can_process?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 flex-1 p-6 text-center`,children:[(0,K.jsx)(C_,{className:`h-8 w-8 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium break-all`,children:t.filename}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Not processed: `,t.reason]})]}),(0,K.jsx)(J,{size:`sm`,onClick:o,disabled:i,children:i?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{className:`h-4 w-4 mr-1 animate-spin`}),` Processingâ¦`]}):`Process`})]}):(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 flex-1 p-6 text-center`,children:[(0,K.jsx)(Ooe,{className:`h-8 w-8 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium break-all`,children:t.filename}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.reason})]}),(0,K.jsx)(J,{size:`sm`,variant:`outline`,onClick:s,disabled:i,children:i?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{className:`h-4 w-4 mr-1 animate-spin`}),` Downloadingâ¦`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Xg,{className:`h-4 w-4 mr-1`}),` Download`]})})]})}function Xet({task:e,onDismiss:t}){let n=Sv(),{t:r}=V(),{documents:i,selectedDocumentId:a,selectDocument:o}=Ux(),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(!1),d=(0,B.useMemo)(()=>[...i].sort((e,t)=>e.display_order-t.display_order),[i]),f=d.length>0,p=(0,B.useMemo)(()=>e.unprocessed_attachments??[],[e.unprocessed_attachments]),m=f||p.length>0,h=(0,B.useMemo)(()=>f?d.find(e=>e.document_id===a)?.id??d[0].id:p.length>0?yU(p[0],0):null,[f,d,a,p]),[g,_]=(0,B.useState)(h),[v,y]=(0,B.useState)(h);v!==h&&(y(h),_(h));let b=`${e.document_id??``}|${f?1:0}`,[x,S]=(0,B.useState)(b);x!==b&&(S(b),u(!f&&!!e.document_id)),(0,B.useEffect)(()=>{f||!e.document_id||ex(e.document_id).then(e=>{let t=e.data;c(t.download_url.replace(`http://minio:9000`,`/minio-proxy`))}).catch(()=>c(null)).finally(()=>u(!1))},[e.document_id,f]);function C(e){_(e);let t=d.find(t=>
628t.id===e);t?.status===`completed`&&t.document_id&&o(t.document_id)}function w(){return m?(0,K.jsxs)(bV,{value:g??void 0,onValueChange:C,className:`flex flex-col flex-1 overflow-hidden`,children:[(0,K.jsxs)(xV,{className:`shrink-0 mx-3 mt-2 w-auto justify-start overflow-x-auto flex-wrap h-auto gap-1`,children:[d.map(e=>(0,K.jsxs)(SV,{value:e.id,className:`flex items-center gap-1`,children:[(0,K.jsx)(Ket,{status:e.status}),(0,K.jsx)(`span`,{className:`overflow-x-clip`,title:e.original_filename,children:e.original_filename})]},e.id)),p.map((e,t)=>{let n=yU(e,t);return(0,K.jsxs)(SV,{value:n,className:`flex items-center gap-1`,children:[(0,K.jsx)(Jet,{att:e}),(0,K.jsx)(`span`,{className:`overflow-x-clip`,title:e.filename,children:e.filename})]},n)})]}),d.map(e=>(0,K.jsx)(CV,{value:e.id,className:`flex-1 overflow-hidden flex flex-col mt-0`,children:(0,K.jsx)(qet,{doc:e})},e.id)),p.map((t,n)=>{let r=yU(t,n);return(0,K.jsx)(CV,{value:r,className:`flex-1 overflow-hidden flex flex-col mt-0`,children:(0,K.jsx)(Yet,{taskId:e.id,att:t})},r)})]}):e.document_id?l?(0,K.jsx)(`div`,{className:`flex items-center justify-center flex-1`,children:(0,K.jsx)(W,{className:`h-5 w-5 animate-spin text-muted-foreground`})}):s?(0,K.jsx)(`iframe`,{src:s,className:`w-full flex-1 border-0`,title:`Document preview`}):(0,K.jsx)(`div`,{className:`flex items-center justify-center flex-1`,children:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Preview unavailable`})}):(0,K.jsx)(`div`,{className:`flex items-center justify-center flex-1`,children:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No document attached`})})}return(0,K.jsxs)(`div`,{className:`flex flex-col h-full min-h-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 p-3 border-b shrink-0`,children:[(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>{n(-1)},children:(0,K.jsx)(Tg,{className:`h-4 w-4`})}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium truncate`,children:e.subject||`(no subject)`}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground truncate`,children:[`From `,Get(e.from_name,e.from_email)]}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground truncate`,children:[`To `,e.to_email||`â`,e.received_at?` · ${Wet(e.received_at)}`:``]}),e.cc_email&&(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground truncate`,children:[`CC `,e.cc_email]})]}),(0,K.jsx)(Het,{taskId:e.id,currentCategory:e.category??`legal`}),(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>t(e.id),children:[(0,K.jsx)(Gg,{className:`h-4 w-4 mr-1`}),` Dismiss`]})]}),e.attachments_restricted&&(0,K.jsxs)(`div`,{className:`flex items-start gap-2 border-b bg-amber-50 px-3 py-2 shrink-0 text-amber-900 dark:bg-amber-950/40 dark:text-amber-200`,children:[(0,K.jsx)(F_,{className:`h-4 w-4 mt-0.5 shrink-0`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:r(`email.attachments.restricted_title`)}),(0,K.jsx)(`p`,{className:`text-xs text-amber-800/80 dark:text-amber-200/70`,children:r(`email.attachments.restricted_hint`)})]})]}),e.body&&(0,K.jsx)(`div`,{className:`p-3 border-b shrink-0 max-h-48 overflow-y-auto`,children:(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground whitespace-pre-wrap break-words`,children:e.body})}),(0,K.jsx)(`div`,{className:`flex-1 overflow-hidden flex flex-col`,children:w()})]})}function Zet(e){let t=Xx(e=>e.contactsScopeOk),n=$x(e=>e.contactsScopeOk);return e===`gmail`?t:e===`outlook`?n:!0}function Qet(e){let t=e.lastIndexOf(`,`);return(t===-1?e:e.slice(t+1)).trim()}function $et(e){return e.name&&!/[",<>]/.test(e.name)?`${e.name} <${e.email}>`:e.email}function bU({value:e,onChange:t,provider:n,placeholder:r,disabled:i,autoFocus:a,id:o,className:s,inputClassName:c}){let{t:l}=V(),u=(0,B.useId)(),d=o??`recipient-${u}`,f=`${u}-listbox`,p=e=>`${u}-opt-${e}`,m=Zet(n),[h,g]=(0,B.useState)([]),[_,v]=(0,B.useState)(!1),[y,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(0),C=(0,B.useRef)(null),w=(0,B.useRef)(null),T=Qet(e);(0,B.useEffect)(()=>{C.current&&window.clearTimeout(C.current);let e=!1;return C.current=window.setTimeout(async()=>
628{if(i||T.length<2){g([]),v(!1),b(!1);return}b(!0);try{let t=await She(T,n,8);if(e)return;g(t),S(0),v(t.length>0||!m)}catch(t){if(e)return;X(t,{operation:`recipient_autocomplete`}),g([]),v(!1)}finally{e||b(!1)}},180),()=>{e=!0,C.current&&window.clearTimeout(C.current)}},[T,n,i,m]);let E=n=>{let r=e.lastIndexOf(`,`);t(`${r===-1?``:`${e.slice(0,r+1).trimEnd()} `}${$et(n)}, `),v(!1),g([]),w.current?.focus()},D=e=>{!_||h.length===0||(e.key===`ArrowDown`?(e.preventDefault(),S(e=>(e+1)%h.length)):e.key===`ArrowUp`?(e.preventDefault(),S(e=>(e-1+h.length)%h.length)):e.key===`Enter`?(e.preventDefault(),E(h[x])):e.key===`Escape`&&(e.preventDefault(),v(!1)))},O=_&&(h.length>0||!m);return(0,K.jsxs)(`div`,{className:q(`relative w-full`,s),children:[(0,K.jsx)(dP,{ref:w,id:d,name:d,value:e,onChange:e=>t(e.target.value),onKeyDown:D,onFocus:()=>{(h.length>0||!m&&T.length>=2)&&v(!0)},onBlur:()=>window.setTimeout(()=>v(!1),120),placeholder:r,disabled:i,autoFocus:a,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":O,"aria-controls":f,"aria-activedescendant":O&&h.length>0?p(x):void 0,autoComplete:`off-${u}`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":`true`,"data-form-type":`other`,className:q(y&&`pr-7`,c)}),y&&(0,K.jsx)(W,{className:`pointer-events-none absolute right-2 top-1/2 size-3.5 -translate-y-1/2 animate-spin text-muted-foreground`,"aria-hidden":`true`}),O&&(0,K.jsxs)(`div`,{id:f,className:`absolute left-0 right-0 top-full z-50 mt-1 max-h-64 overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md`,role:`listbox`,children:[h.map((e,t)=>(0,K.jsxs)(`button`,{id:p(t),type:`button`,role:`option`,"aria-selected":t===x,onMouseDown:t=>{t.preventDefault(),E(e)},onMouseEnter:()=>S(t),className:q(`flex w-full flex-col items-start gap-0 rounded-sm px-2 py-1.5 text-left`,t===x?`bg-
628accent text-accent-foreground`:``),children:[(0,K.jsx)(`span`,{className:`text-sm leading-tight`,children:e.name??e.email}),e.name&&(0,K.jsx)(`span`,{className:`text-xs leading-tight text-muted-foreground`,children:e.email})]},`${e.email}-${t}`)),!m&&(0,K.jsx)(`div`,{className:q(`px-2 py-1.5 text-[11px] text-muted-foreground`,h.length>0&&`mt-1 border-t border-border/60 pt-2`),children:l(`mail.contacts.reconnect_hint`)})]})]})}var xU={pending:{label:`Pending`,className:`bg-yellow-100 text-yellow-800`},processing:{label:`Processing`,className:`bg-blue-100 text-blue-800`,showSpinner:!0},completed:{label:`Completed`,className:`bg-green-100 text-green-800`},failed:{label:`Failed`,className:`bg-red-100 text-red-800`},failed_twice:{label:`Failed`,className:`bg-gray-900 text-white`},reference_only:{label:`Reference only`,className:`bg-gray-100 text-gray-600`}};function SU({status:e}){let{t}=V(),n=xU[e]??xU.pending;return(0,K.jsx)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded-full ${n.className}`,title:e===`reference_only`?`Stored for reference â not indexed or searchable`:void 0,children:n.showSpinner?(0,K.jsx)(RI,{size:`sm`,label:t(`ai.activity.processing`)}):n.label})}function ett(e,t){return t!==`docx`||e.toLowerCase().endsWith(`.docx`)?e:e.replace(/\.[^.]*$/,``)+`.docx`}function CU({isSlack:e=!1}){let{t}=V(),{draft:n,selectedTask:r,documents:i,updateDraft:a,autoSaveDraft:o,saveToDrafts:s,send:c}=Ux(),[l,u]=(0,B.useState)(n?.subject??``),[d,f]=(0,B.useState)(n?.body??``),[p,m]=(0,B.useState)(n?.cc_email??``),[h,g]=(0,B.useState)(n?.bcc_email??``),[_,v]=(0,B.useState)(!!(n?.cc_email||n?.bcc_email)),[y,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(!1),[C,w]=(0,B.useState)(!1),[T,E]=(0,B.useState)(`idle`),D=(0,B.useRef)(null),O=(0,B.useRef)(null),k=(0,B.useRef)({subject:l,body:d,cc:p,bcc:h}),A=(0,B.useRef)({subject:n?.subject??``,body:n?.body??``,cc:n?.cc_email??``,bcc:n?.bcc_email??``});k.current={subject:l,body:d,cc:p,bcc:h};let j=n?.id??null,[M,N]=(0,B.useState)(j);M!==j&&(N(j),n&&(u(n.subject??``),f(n.body??``),m(n.cc_email??``),g(n.bcc_email??``),v(!!(n.cc_email||n.bcc_email)),E(`i
628dle`))),(0,B.useEffect)(()=>{n&&(A.current={subject:n.subject??``,body:n.body??``,cc:n.cc_email??``,bcc:n.bcc_email??``})},[j,n]);let P=(0,B.useCallback)(()=>{E(`saved`),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>E(`idle`),3e3)},[]),F=(0,B.useCallback)(async()=>{if(!n)return;let e=k.current,t=A.current;if(e.subject===t.subject&&e.body===t.body&&e.cc===t.cc&&e.bcc===t.bcc){E(`idle`);return}await o(n.id,{subject:e.subject,body:e.body,cc_email:e.cc,bcc_email:e.bcc}),A.current={...e},P()},[n,o,P]),I=(0,B.useCallback)(()=>{D.current&&clearTimeout(D.current),E(`saving`),D.current=setTimeout(F,1e3)},[F]);(0,B.useEffect)(()=>()=>{D.current&&(clearTimeout(D.current),F()),O.current&&clearTimeout(O.current)},[F]);let L=(0,B.useCallback)(async(e,t)=>{if(!e)return;let n=e=>e.replace(`http://minio:9000`,`/minio-proxy`).replace(`http://localhost:9000`,`/minio-proxy`);try{let r;r=t===`docx`?(await Yge(e)).download_url:(await ex(e)).data.download_url,window.open(n(r),`_blank`,`noopener`)}catch{}},[]);if(!n)return null;let ee=e=>{u(e.target.value),I()},R=e=>{f(e.target.value),I()},te=()=>{D.current&&clearTimeout(D.current)},ne=async()=>{te(),b(!0);try{await a(n.id,{subject:l,body:d,cc_email:p,bcc_email:h}),A.current={subject:l,body:d,cc:p,bcc:h},P()}finally{b(!1)}},re=async()=>{te(),b(!0);try{await a(n.id,{subject:l,body:d,cc_email:p,bcc_email:h}),await s(n.id),A.current={subject:l,body:d,cc:p,bcc:h},P()}finally{b(!1)}},ie=async()=>{te(),w(!1),S(!0);try{await a(n.id,{subject:l,body:d,cc_email:p,bcc_email:h}),await c(n.id)}finally{S(!1)}},z=n.status===`sent`,ae=n.status===`in_drafts`,oe=r?.slack_channel_name?`#${r.slack_channel_name}`:r?.from_name||r?.from_email||`Slack`;return(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`div`,{children:(z||ae)&&(0,K.jsx)(lR,{variant:z?`default`:`secondary`,children:z?`Sent`:`Saved to Drafts`})}),(0,K.jsx)(lz,{})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground w-16`,children:`To:`}),(0,K.jsx)(`span`,{className:`text-sm`,children:e?oe:n.to_email}),!e&&!z&&!_&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>v(!0),className:`ml-auto text-xs text-muted-foreground hover:text-foreground`,children:`Cc/Bcc`})]}),!e&&_&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground w-16`,children:`Cc:`}),(0,K.jsx)(bU,{value:p,onChange:e=>{m(e),I()},provider:r?.provider??`gmail`,disabled:z,inputClassName:`text-sm`})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground w-16`,children:`Bcc:`}),(0,K.jsx)(bU,{value:h,onChange:e=>{g(e),I()},provider:r?.provider??`gmail`,disabled:z,inputClassName:`text-sm`})]})]}),!e&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground w-16`,children:`Subject:`}),(0,K.jsx)(dP,{value:l,onChange:ee,disabled:z,className:`text-sm`})]}),(0,K.jsx)(`textarea`,{value:d,onChange:R,disabled:z,className:`w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 resize-y field-sizing-content`}),n.attachments?.length?(0,K.jsx)(`div`,{className:`space-y-1`,children:n.attachments.map(e=>{let t=i.find(t=>t.document_id===e.document_id);return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>L(e.document_id,e.file_type),title:`Download attachment to be sent`,className:`group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors max-w-full`,children:[(0,K.jsx)(C_,{className:`h-4 w-4 shrink-0`}),(0,K.jsx)(`span`,{className:`truncate`,children:ett(e.original_filename,e.file_type)}),t&&(0,K.jsx)(SU,{status:t.status}),(0,K.jsx)(Xg,{className:`h-3.5 w-3.5 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity`})]},e.document_id)})}):null,!z&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:ne,disabled:y,children:[y?(0,K.jsx)(W,{className:`h-4 w-4 animate-spin mr-1`}):null,`Save Draft`]}),!e&&(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:re,disabled:y,children:[y?(0,K.jsx)(W,{className:`h-4 w-4 animate-spin mr-1`}):(0,K.jsx)(O_,{className:`h-4 w-4 mr-1`}),`Save to Drafts`]}),(0,K.jsxs)(J,{size:`sm`,onClick:()=>w(!0),disabled:x,children:[x?(0,K.jsx)(W,{className:`h-4 w-4 animate-spin mr-1`}):(0,K.jsx)(j_,{className:`h-4 w-4 mr-1`}),e?`Send to Slack`:`Send`]}),T!==`idle`&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground ml-1`,children:T===`saving`?`Saving...`:`Saved`}),(0,K.jsx)(`div`,{className:`ml-auto flex items-center gap-1`,children:(0,K.jsx)(mO,{subject:{type:`email_draft`,id:n.id,label:t(`report_issue.email_draft`,{subject:Ab(n.subject||t(`common.no_subject`))})}})})]}),(0,K.jsx)(HC,{open:C,onOpenChange:w,children:(0,K.jsxs)(WC,{children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:e?`Send Slack Reply`:`Send Email`}),(0,K.jsx)(JC,{children:e?`This will post your reply to ${oe} in the original thread. This action cannot be undone.`:n.attachments?.length?`This will send the email to ${n.to_email} with ${n.attachments.length} attachment${n.attachments.length===1?``:`s`}. This action cannot be undone.`:`This will send the email to ${n.to_email}. This action cannot be undone.`})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`outline`,onClick:()=>w(!1),children:`Cancel`}),(0,K.jsxs)(J,{onClick:ie,children:[(0,K.jsx)(j_,{className:`h-4 w-4 mr-1`}),e?`Send to Slack`:`Send Now`]})]})]})})]})}
628function wU({value:e,onChange:t,noneLabel:n,disabled:r,className:i}){let{t:a}=V(),[o,s]=(0,B.useState)(!1),c=Q(e=>e.knowledgeBases),l=Q(e=>e.fetchKnowledgeBases);(0,B.useEffect)(()=>{l()},[l]);let u=c.find(t=>t.id===e);return(0,K.jsxs)(aP,{open:o,onOpenChange:s,children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,disabled:r,className:q(`flex w-full items-center justify-between gap-2 rounded border bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-primary disabled:opacity-50`,i),children:[(0,K.jsx)(`span`,{className:`truncate`,children:u?u.name:n}),(0,K.jsx)(Vg,{className:`size-3.5 shrink-0 opacity-50`})]})}),(0,K.jsx)(sP,{align:`start`,className:`w-64 p-0`,children:(0,K.jsxs)(XO,{children:[(0,K.jsx)(ZO,{placeholder:a(`grounding.search_kb`),onKeyDown:e=>e.stopPropagation()}),(0,K.jsxs)(QO,{children:[(0,K.jsx)($O,{children:a(`grounding.no_kbs`)}),(0,K.jsxs)(ek,{children:[(0,K.jsxs)(nk,{value:n,onSelect:()=>{t(void 0),s(!1)},children:[(0,K.jsx)(Lg,{className:q(`size-3.5`,e?`opacity-0`:`opacity-100`)}),(0,K.jsx)(`span`,{className:`truncate`,children:n})]}),c.map(n=>(0,K.jsxs)(nk,{value:n.name,onSelect:()=>{t(n.id),s(!1)},children:[(0,K.jsx)(Lg,{className:q(`size-3.5`,e===n.id?`opacity-100`:`opacity-0`)}),(0,K.jsx)(`span`,{className:`truncate`,children:n.name})]},n.id))]})]})]})})]})}var ttt=3e3;function TU({value:e,onChange:t,excludeDocumentId:n,max:r=3,disabled:i,className:a}){let{t:o}=V(),[s,c]=(0,B.useState)(!1),[l,u]=(0,B.useState)(!1),[d,f]=(0,B.useState)([]),p=(0,B.useRef)(null),m=sk(e=>e.documents),h=sk(e=>e.fetchDocuments),g=sk(e=>e.uploadDocument);(0,B.useEffect)(()=>{h()},[h]);let _=(0,B.useRef)({value:e,onChange:t,max:r});(0,B.useEffect)(()=>{_.current={value:e,onChange:t,max:r}},[e,t,r]),(0,B.useEffect)(()=>{if(d.length===0)return;let e=!1,t=window.setInterval(async()=>{if(await h(),e)return;let t=sk.getState().documents,{value:n,onChange:r,max:i}=_.current,a=new Set,s=n;for(let e of d){let n=t.find(t=>t.id===e);n&&(n.status===`completed`?(a.add(e),!s.includes(e)&&s.length<i&&(s=[...s,e])):(n.status===`failed`||n.status===`failed_twice`)&&(a.add(e),Y(Error(`Processing failed for ${n.original_filename}`),o(`errors.upload_failed`),{operation:`grounding_exemplar_processing`,metadata:{documentId:e}})))}s!==n&&r(s),a.size>0&&f(e=>e.filter(e=>!a.has(e)))},ttt);return()=>{e=!0,clearInterval(t)}},[d,h,o]);let v=m.filter(e=>e.status===`completed`&&e.id!==n),y=e.length>=r,b=n=>{if(e.includes(n))t(e.filter(e=>e!==n));else if(e.length>=r)return;else t([...e,n])};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`input`,{ref:p,type:`file`,accept:ik,className:`hidden`,onChange:async e=>{let t=e.target.files?.[0];if(t){u(!0);try{let e=await g(t);e?.id&&f(t=>[...t,e.id])}catch(e){Y(e,o(`errors.upload_failed`),{operation:`grounding_exemplar_upload`,metadata:{fileName:t.name}})}finally{u(!1),p.current&&(p.current.value=``)}}}}),(0,K.jsxs)(aP,{open:s,onOpenChange:c,children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,disabled:i,className:q(`flex w-full items-center justify-between gap-2 rounded border bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-primary disabled:opacity-50`,a),children:[(0,K.jsx)(`span`,{className:`truncate`,children:e.length>0?o(`grounding.selected_count`,{count:e.length}):o(`grounding.none_selected`)}),(0,K.jsx)(Vg,{className:`size-3.5 shrink-0 opacity-50`})]})}),(0,K.jsx)(sP,{align:`start`,className:`w-72 p-0`,children:(0,K.jsxs)(XO,{children:[(0,K.jsx)(ZO,{placeholder:o(`grounding.search_documents`),onKeyDown:e=>e.stopPropagation()}),(0,K.jsxs)(QO,{children:[(0,K.jsxs)(nk,{value:`__upload_new__`,onSelect:()=>p.current?.click(),children:[l?(0,K.jsx)(W,{className:`size-3.5 animate-spin`}):(0,K.jsx)(T_,{className:`size-3.5`}),(0,K.jsx)(`span`,{className:`text-xs`,children:o(l?`common.uploading`:`grounding.upload_new`)})]}),d.map(e=>{let t=m.find(t=>t.id===e)?.original_filename??e;return(0,K.jsxs)(nk,{value:`__pending__${e}`,disabled:!0,children:[(0,K.jsx)(W,{className:`size-3.5 animate-spin`}),(0,K.jsx)(`span`,{className:`truncate text-xs`,children:o(`grounding.processing`,{name:t})})]},`pending-${e}`)}),(0,K.jsx)(tk,{}),(0,K.jsx)($O,{children:o(`grounding.no_documents`)}),(0,K.jsx)(ek,{heading:o(`grounding.cap_reached`,{max:r}),children:v.map(t=>{let n=e.includes(t.id);return(0,K.jsxs)(nk,{value:t.original_filename,disabled:y&&!n,onSelect:()=>b(t.id),children:[(0,K.jsx)(Lg,{className:q(`size-3.5`,n?`opacity-100`:`opacity-0`)}),(0,K.jsx)(`span`,{className:`truncate`,children:t.original_filename})]},t.id)})})]})]})})]})]})}
628function EU({value:e,onChange:t,excludeDocumentId:n,disabled:r}){let{t:i}=V(),a=e.groundingDocumentIds??[],o=(e.knowledgeBaseId?1:0)+a.length;return(0,K.jsxs)(aP,{children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,disabled:r,title:i(`redline.grounding_title`),className:`flex items-center gap-1 rounded border px-2 py-1 text-xs disabled:opacity-50 ${o>0?`border-purple-300 bg-purple-50 text-purple-700`:`border-gray-200 text-gray-500 hover:bg-gray-50`}`,children:[(0,K.jsx)(kg,{size:12}),o>0?i(`redline.grounding_active`,{count:o}):i(`redline.grounding`)]})}),(0,K.jsxs)(sP,{align:`end`,className:`w-72 p-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:i(`redline.grounding_kb`)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-[10px] text-muted-foreground`,children:i(`redline.grounding_kb_hint`)}),(0,K.jsx)(wU,{value:e.knowledgeBaseId,onChange:n=>t({...e,knowledgeBaseId:n}),noneLabel:i(`redline.grounding_kb_none`),disabled:r,className:`mt-1`})]}),(0,K.jsxs)(`div`,{className:`mt-3`,children:[(0,K.jsx)(`label`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:i(`redline.grounding_exemplars`)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-[10px] text-muted-foreground`,children:i(`redline.grounding_exemplars_hint`,{max:3})}),(0,K.jsx)(TU,{value:a,onChange:n=>t({...e,groundingDocumentIds:n}),excludeDocumentId:n,max:3,disabled:r,className:`mt-1`})]})]})]})}function ntt(){let{t:e}=V(),t=Ux(e=>e.documents),n=Ux(e=>e.selectedDocumentId),r=Ux(e=>e.setDocumentGrounding),i=Q(e=>e.knowledgeBases),a=Q(e=>e.fetchKnowledgeBases),o=(0,B.useMemo)(()=>t.find(e=>e.document_id===n)??null,[t,n]),s=(0,B.useMemo)(()=>({knowledgeBaseId:o?.knowledge_base_id??void 0,groundingDocumentIds:o?.grounding_document_ids??[]}),[o?.knowledge_base_id,o?.grounding_document_ids]),[c,l]=(0,B.useState)(s);if((0,B.useEffect)(()=>
628{l(s)},[s]),(0,B.useEffect)(()=>{a()},[a]),!o||o.is_contract!==!0||!o.document_id||!(o.risk_analysis??``).trim())return null;let u=o.document_id,d=o.knowledge_base_id?i.find(e=>e.id===o.knowledge_base_id)?.name??e(`email.grounding.unknown_kb`):null,f=(c.knowledgeBaseId??``)!==(s.knowledgeBaseId??``)||(c.groundingDocumentIds??[]).join(`|`)!==(s.groundingDocumentIds??[]).join(`|`),p=async()=>{await r(u,{knowledge_base_id:c.knowledgeBaseId??null,grounding_document_ids:c.groundingDocumentIds?.length?c.groundingDocumentIds:null}),G.success(e(`email.grounding.rerun_started`))};return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-lg border border-purple-200 bg-purple-50/60 px-3 py-2 dark:border-purple-900/40 dark:bg-purple-950/20`,children:[(0,K.jsx)(kg,{className:`size-4 shrink-0 text-purple-600 dark:text-purple-300`}),(0,K.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-xs text-purple-900 dark:text-purple-200`,children:d?e(`email.grounding.grounded_on`,{name:d}):e(`email.grounding.not_grounded`)}),(0,K.jsx)(EU,{value:c,onChange:l,excludeDocumentId:u}),f&&(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`outline`,className:`h-7`,onClick:()=>void p(),children:e(`email.grounding.rerun`)})]})}function rtt({riskAnalysis:e,emailAnalysis:t,processingError:n,reason:r,reasonDetail:i,isAnalyzing:a,onAnalyze:o,showRedlineButton:s,isRedlining:c,redlineCapable:l,onRedline:u}){let{t:d}=V(),f=!!r?.showAnalyzeButton&&!!r.analyzableDocumentId,p=Ub(i??null,{operation:`email.analysis.reasonDetail`}),m=Ub(n,{operation:`email.analysis.processingError`});function h(){if(!f)return null;let e=r?.reasonKey===`skipped_by_gate`?`email.analysis.analyze`:`email.analysis.analyze_anyway`;return(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,disabled:a||c,onClick:()=>o(r.analyzableDocumentId),children:[a&&(0,K.jsx)(W,{className:`h-4 w-4 animate-spin`}),d(a?`email.analysis.analyzing`:e)]})}function g(e){return s?(0,K.jsxs)(J,{type:`button`,size:`sm`,disabled:c||a||!l,title:l?void 0:d(`email.redlines.not_word`),onClick:u,children:[c?(0,K.jsx)(W,{className:`h-4 w-4 animate-spin`}):(0,K.jsx)(L_,{className:`h-4 w-4`}),d(c?`email.analysis.redlining`:e)]}):null}return!e&&!n&&t?(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(__,{className:`h-4 w-4 text-sky-500`}),(0,K.jsx)(`h4`,{className:`text-sm font-medium`,children:d(`email.analysis.email_heading`)})]}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d(`email.analysis.email_subtitle`)}),(0,K.jsx)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none bg-muted/50 rounded-lg p-3`,children:(0,K.jsx)(_I,{remarkPlugins:[NI],children:t})})]}),r&&(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-t pt-3`,children:[(0,K.jsxs)(`p`,{className:`flex-1 min-w-[12rem] text-xs text-muted-foreground`,children:[d(`email.analysis.reasons.${r.reasonKey}`),p?` ${p}`:``]}),h(),g(`email.analysis.analyze_and_suggest`)]})]}):!e&&!n?r?.reasonKey===`processing`?(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,K.jsx)(RI,{size:`lg`,label:d(`email.analysis.analyzing`)})}):(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,K.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-3 text-center`,children:[(0,K.jsx)(Toe,{className:`h-8 w-8 text-muted-foreground/60`}),(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:d(`email.analysis.not_analyzed_title`)}),r&&(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:d(`email.analysis.reasons.${r.reasonKey}`)}),p&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:p}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[h(),g(`email.analysis.analyze_and_suggest`)]})]})}):(0,K.jsxs)(`div`,{className:`space-y-4`,children:[m&&(0,K.jsx)(`div`,{className:`bg-destructive/10 rounded-lg p-3`,children:(0,K.jsx)(`p`,{className:`text-sm text-destructive`,children:m})}),e&&(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(ntt,{}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(_se,{className:`h-4 w-4 text-amber-500`}),(0,K.jsx)(`h4`,{className:`text-sm font-medium`,children:d(`email.analysis.heading`)})]}),(0,K.jsx)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none bg-muted/50 rounded-lg p-3`,children:(0,K.jsx)(_I,{remarkPlugins:[NI],children:e})})]}),e&&s&&(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-t pt-3`,children:[(0,K.jsx)(`p`,{className:`flex-1 min-w-[12rem] text-xs text-muted-foreground`,children:d(`email.analysis.redlines_not_generated`)}),g(`email.analysis.suggest_from_analysis`)]})]})}var itt=/\w+|\W+/g;function DU(e){return e.match(itt)??[]}var att={"â":`'`,"â":`'`,"â":`'`,"â":`'`,"â²":`'`,"â":`"`,"â":`"`,"â":`"`,"â":`"`,"â³":`"`,"â":`-`,"â":`-`,"â":`-`,"â":`-`,"â":`-`,"â":`-`,"â":`-`};function OU(e){let t=``;for(let n of e)t+=att[n]??n;return t}function ott(e,t){let n=e.length,r=t.length,i=new Int32Array(r+1),a=new Int32Array(r+1),o=[];for(let s=0;s<=n;s++){if(s===0){o.push(Array.from(i));continue}for(let n=0;n<=r;n++)n===0?a[n]=0:e[s-1]===t[n-1]?a[n]=i[n-1]+1:a[n]=Math.max(i[n],a[n-1]);o.push(Array.from(a)),i.set(a)}let s=[],c=n,l=r;
628for(;c>0&&l>0;)e[c-1]===t[l-1]?(s.push([c-1,l-1]),c--,l--):o[c-1][l]>=o[c][l-1]?c--:l--;s.reverse();let u=[];for(let[e,t]of s){if(u.length>0){let n=u[u.length-1];if(n[0]+n[2]===e&&n[1]+n[2]===t){n[2]++;continue}}u.push([e,t,1])}return u.push([n,r,0]),u}function stt(e,t){let n=ott(e,t),r=[],i=0,a=0;for(let[e,t,o]of n)i<e&&a<t?r.push([`replace`,i,e,a,t]):i<e?r.push([`delete`,i,e,a,t]):a<t&&r.push([`insert`,i,e,a,t]),o>0&&r.push([`equal`,e,e+o,t,t+o]),i=e+o,a=t+o;return r}function kU(e,t){let n=DU(e),r=DU(t),i=stt(n.map(OU),r.map(OU)),a=[],o=e=>{e&&a.push({kind:`del`,text:e})},s=e=>{e&&a.push({kind:`ins`,text:e})},c=``,l=``,u=()=>{o(c),s(l),c=``,l=``};for(let e of i){let[t,i,o,s,d]=e;t===`equal`?(u(),a.push({kind:`equal`,text:n.slice(i,o).join(``)})):(c+=n.slice(i,o).join(``),l+=r.slice(s,d).join(``))}return u(),a}function AU(e){let t=[],n=-1,r=!1;for(let i of e){if(i.kind===`equal`){r=!1,t.push(-1);continue}r||=(n++,!0),t.push(n)}return t}function ctt(e,t,n){let r=kU(e,t),i=AU(r),a=i.reduce((e,t)=>Math.max(e,t),-1)+1;if(n<0||n>=a)return t;let o=``;return r.forEach((e,t)=>{if(e.kind===`equal`){o+=e.text;return}i[t]===n?e.kind===`del`&&(o+=e.text):e.kind===`ins`&&(o+=e.text)}),o}function jU(e){switch(e){case`insert`:return`insert`;case`delete`:return`delete`;case`replace`:case void 0:case null:case``:return`replace`;default:return`readonly`}}function MU(e,t){if(!t)return null;let n=e.indexOf(t);if(n>=0)return[n,n+t.length];let r=[],i=[];for(let t=0;t<e.length;t++){let n=e[t];/\s/.test(n)||(r.push(OU(n)),i.push(t))}let a=OU(t.replace(/\s+/g,``));if(!a)return null;let o=r.join(``).indexOf(a);return o<0?null:[i[o],i[o+a.length-1]+1]}function ltt(e,t){let n=e.length;if(n===0)return 1;let r=0;for(let n of kU(e,t))n.kind===`equal`&&(r+=n.text.length);return r/n}function utt(e,t,n){let r=jU(e);return r===`insert`||r===`readonly`||t.length<200?null:r===`delete`?`delete`:ltt(t,n)<.4?`rewrite`:null}function dtt(e,t){let n=[],r=[];for(let i of t){let t=MU(e,i.original_text);if(!t){i.id&&n.push(i.id);continue}let[a,o]=t;r.push({start:a,end:o,suggestion:i,matched:e.slice(a,o)})}r.sort((e,t)=>e.start-t.start);let i=[],a=-1;for(let e of r){if(e.start<a){e.suggestion.id&&n.push(e.suggestion.id);continue}i.push(e),a=e.end}let o=[],s=0;for(let t of i){t.start>s&&o.push({kind:`text`,text:e.slice(s,t.start)});let n=t.suggestion,r=jU(n.change_type);if(r===`insert`)t.matched&&o.push({kind:`text`,text:t.matched}),n.suggested_text&&o.push({kind:`ins`,text:n.suggested_text,suggestionId:n.id});else if(r===`delete`)t.matched&&o.push({kind:`del`,text:t.matched,suggestionId:n.id});else if(r===`readonly`)t.matched&&o.push({kind:`text`,text:t.matched});else for(let e of kU(t.matched,n.suggested_text))e.kind===`equal`?o.push({kind:`text`,text:e.text}):e.kind===`del`?o.push({kind:`del`,text:e.text,suggestionId:n.id}):o.push({kind:`ins`,text:e.text,suggestionId:n.id});s=t.end}return s<e.length&&o.push({kind:`text`,text:e.slice(s)}),{pieces:o,unlocated:n}}function ftt(e,t){if(e.length===0||t.length===0)return null;let n=``,r=[];e.forEach((e,t)=>{if(e.type!==`del`){n+=e.text;for(let n=0;n<e.text.length;n++)r.push(t)}});let i=t=>e[t].type===`text`&&e[t].comment_id==null,a=new Map;for(let e of t){let t=MU(n,e.original_text);if(!t)continue;let[o,s]=t,c=r[o],l=r[s-1];if(c==null||l==null||c!==l||!i(c))continue;let u=a.get(c)??[];u.push(e),a.set(c,u)}if(a.size===0)return null;let o=[],s=[];return e.forEach((e,t)=>{let n=a.get(t);if(!n){o.push({kind:`run`,run:e,runIndex:t});return}let{pieces:r,unlocated:i}=dtt(e.text,n),c=new Set(i);for(let e of n)e.id&&!c.has(e.id)&&s.push(e.id);o.push({kind:`pieces`,pieces:r,runIndex:t})}),s.length===0?null:{segments:o,splicedIds:s}}function NU(e){return(e?.preferences?.redline_author_name)?.trim()||`${e?.first_name??``} ${e?.last_name??``}`.trim()}function ptt(e){let t=NU(e),n=`${e?.first_name??``} ${e?.last_name??``}`.trim();return[...new Set([t,n].filter(Boolean))]}var PU=`text-red-600 line-through bg-red-50`,FU=`text-green-700 dark:text-green-400 underline bg-green-50`;function IU({originalText:e,suggestedText:t}){return(0,K.jsx)(K.Fragment,{children:(0,B.useMemo)(()=>kU(e,t),[e,t]).map((e,t)=>e.kind===`equal`?(0,K.jsx)(`span`,{children:e.text},t):e.kind===`del`?(0,K.jsx)(`span`,{className:PU,children:e.text},t):(0,K.jsx)(`span`,{className:FU,children:e.text},t))})}function mtt(e){let t=``,n=r=>{if(r.nodeType===Node.TEXT_NODE){t+=r.data;return}if(r.nodeType!==Node.ELEMENT_NODE)return;let i=r;
628if(!i.hasAttribute(`data-del`)){if(i.tagName===`BR`){i!==e.lastChild&&(t+=` 629`);return}i.childNodes.forEach(n)}};return e.childNodes.forEach(n),t}function LU(e,t){let n=e.parentNode;for(;n&&n!==t;){if(n instanceof HTMLElement&&n.hasAttribute(`data-del`))return!0;n=n.parentNode}return!1}function RU(e,t,n){let r=document.createRange();r.setStart(e,0),r.setEnd(t,n);let i=0,a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),o=a.nextNode();for(;o;){let s=o;if(!LU(s,e))if(r.comparePoint(s,s.length)<=0)i+=s.length;else{s===t&&(i+=n);break}o=a.nextNode()}return i}function htt(e){let t=window.getSelection();if(!t||t.rangeCount===0)return null;let{endContainer:n,endOffset:r}=t.getRangeAt(0);return e.contains(n)?RU(e,n,r):null}function gtt(e,t){let n=window.getSelection();if(!n)return;let r=document.createRange(),i=Math.max(0,t),a=null,o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),s=o.nextNode();for(;s;){let t=s;if(!LU(t,e)){if(i<=t.length){r.setStart(t,i),r.collapse(!0),n.removeAllRanges(),n.addRange(r);return}i-=t.length,a=t}s=o.nextNode()}a?r.setStart(a,a.length):r.selectNodeContents(e),r.collapse(!1),n.removeAllRanges(),n.addRange(r)}function _tt(e,t,n,r,i){e.textContent=``,t.forEach((t,i)=>{if(t.kind===`equal`){e.appendChild(document.createTextNode(t.text));return}let a=document.createElement(`span`);a.textContent=t.text,t.kind===`del`?(a.className=`${PU} cursor-pointer rounded-sm hover:ring-1 hover:ring-amber-300`,a.setAttribute(`contenteditable`,`false`),a.setAttribute(`role`,`button`),a.title=r,a.dataset.del=``,a.dataset.hunk=String(n[i])):(a.className=FU,a.dataset.ins=``),e.appendChild(a)}),i&&e.appendChild(document.createElement(`br`))}function vtt({originalText:e,draft:t,onDraftChange:n,onRevertHunk:r,onKeyDown:i,ariaLabel:a}){let{t:o}=V(),s=(0,B.useRef)(null),c=(0,B.useRef)(null),l=(0,B.useRef)(!1),[u,d]=(0,B.useState)(0),f=(0,B.useMemo)(()=>kU(e,t),[e,t]),p=(0,B.useMemo)(()=>AU(f),[f]),m=o(`redline.revert_hunk_hint`);(0,B.useLayoutEffect)(()=>{let e=s.current;if(!e)return;_tt(e,f,p,m,t.endsWith(` 630`));let n=c.current;c.current=null,document.activeElement!==e&&e.focus(),gtt(e,n??t.length)},[f,p,m,t,u]);let h=()=>{let e=s.current;if(!e)return;c.current=htt(e);let r=mtt(e);d(e=>e+1),r!==t&&n(r)},g=e=>{let t=s.current;if(!t)return;document.activeElement!==t&&t.focus();let n=!1;try{n=typeof document.execCommand==`function`&&document.execCommand(`insertText`,!1,e)}catch{n=!1}if(n)return;let r=window.getSelection();if(!r||r.rangeCount===0)return;let i=r.getRangeAt(0);if(!t.contains(i.startContainer))return;i.deleteContents();let a=document.createTextNode(e);i.insertNode(a),i.setStartAfter(a),i.collapse(!0),r.removeAllRanges(),r.addRange(i),h()},_=e=>{i?.(e),!e.defaultPrevented&&e.key===`Enter`&&(e.preventDefault(),g(` 631`))},v=e=>{e.preventDefault(),g(e.clipboardData.getData(`text/plain`))},y=e=>{let t=s.current,n=e.target.closest?.(`[data-hunk]`);if(!t||!(n instanceof HTMLElement)||!t.contains(n))return;e.preventDefault();let i=n.parentNode;i&&(c.current=RU(t,i,Array.prototype.indexOf.call(i.childNodes,n))+(n.textContent??``).length),d(e=>e+1),r(Number(n.dataset.hunk))};return(0,K.jsx)(`div`,{ref:s,role:`textbox`,"aria-multiline":`true`,"aria-label":a,tabIndex:0,contentEditable:!0,className:`min-h-12 cursor-text rounded bg-white px-2 py-1 text-sm leading-relaxed whitespace-pre-wrap ring-1 ring-blue-300 outline-none focus:ring-2 focus:ring-blue-400`,onInput:()=>{l.current||h()},onCompositionStart:()=>{l.current=!0},onCompositionEnd:()=>{l.current=!1,h()},onKeyDown:_,onPaste:v,onDrop:e=>e.preventDefault(),onClick:y})}function zU({suggestion:e}){let{t}=V(),n=e.anchor_status??`ok`;return n===`ok`?null:(0,K.jsxs)(`span`,{title:t(`redline.anchor_status.${n}_hint`),className:`inline-flex shrink-0 items-center gap-1 rounded bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700`,children:[(0,K.jsx)(H_,{size:10}),t(`redline.anchor_status.${n}`)]})}function BU({reason:e}){let{t}=V();return e?(0,K.jsxs)(`span`,{title:e,className:`inline-flex shrink-0 items-center gap-1 rounded bg-red-50 px-1.5 py-0.5 text-[10px] font-medium text-red-700`,children:[(0,K.jsx)(H_,{size:10}),t(`redline.apply_failed`)]}):null}function VU({kind:e}){let{t}=V();return(0,K.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-medium text-blue-700`,children:[(0,K.jsx)(W,{size:10,
631className:`animate-spin`}),t(e===`apply`?`redline.applying`:`redline.undoing`)]})}function ytt(e){return!!(e.revision_ids&&e.revision_ids.length>0)}function HU(e){return e.edited_text??e.suggested_text}function btt(e,t,n){let r=t.clause_label?Ab(t.clause_label,40):null;if(n){let t=Ab(n,40);return r?e(`report_issue.suggestion_on`,{clause:r,filename:t}):e(`report_issue.suggestion`,{filename:t})}return r?e(`report_issue.suggestion_on_clause`,{clause:r}):e(`report_issue.suggestion_generic`)}function xtt(e){return e===`rejected`?`bg-red-50/50`:e===`applied`?`bg-muted`:`bg-green-50`}function UU({children:e}){return(0,K.jsx)(`kbd`,{className:`border bg-muted/50 px-1 py-0 rounded text-[10px] font-mono text-muted-foreground`,children:e})}function WU({suggestion:e}){let{t}=V();return(0,K.jsxs)(`div`,{className:`rounded bg-muted/50 px-2 py-1 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase`,children:t(`redline.insert_after`)}),(0,K.jsx)(`span`,{className:`ml-1 text-muted-foreground`,children:e.original_text})]})}function Stt({suggestion:e}){let{t}=V(),n=jU(e.change_type);return n===`insert`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(WU,{suggestion:e}),(0,K.jsxs)(`div`,{className:`rounded bg-green-50 px-2 py-1 text-sm`,children:[(0,K.jsx)(`span`,{className:`mb-0.5 block text-[10px] font-medium uppercase text-green-700`,children:t(`redline.insert_paragraph_after`)}),(0,K.jsx)(`span`,{className:`text-green-700 underline whitespace-pre-wrap`,children:HU(e)})]})]}):n===`delete`?(0,K.jsxs)(`div`,{className:`rounded bg-red-50/50 px-2 py-1 text-sm`,children:[(0,K.jsx)(`span`,{className:`mb-0.5 block text-[10px] font-medium uppercase text-red-700`,children:t(`redline.delete_paragraph`)}),(0,K.jsx)(`span`,{className:`text-red-600 line-through decoration-red-400 whitespace-pre-wrap`,children:e.original_text})]}):n===`readonly`?(0,K.jsx)(`div`,{className:`rounded bg-muted/20 px-2 py-1 text-sm whitespace-pre-wrap leading-relaxed text-muted-foreground`,children:e.original_text}):(0,K.jsx)(`div`,{className:`rounded bg-muted/20 px-2 py-1 text-sm whitespace-pre-wrap leading-relaxed`,children:(0,K.jsx)(IU,{originalText:e.original_text,suggestedText:HU(e)})})}function GU(){let{t:e}=V();return(0,K.jsxs)(`span`,{title:e(`redline.target_missing_hint`),className:`inline-flex shrink-0 items-center gap-1 rounded bg-gray-100 px-1.5 py-0.5 text-[10px] font-medium text-gray-500`,children:[(0,K.jsx)(H_,{size:10}),e(`redline.target_missing`)]})}function KU({variant:e}){let{t}=V(),n=e===`delete`?`redline.whole_clause_delete`:`redline.large_rewrite`;return(0,K.jsxs)(`span`,{title:t(e===`delete`?`redline.whole_clause_delete_hint`:`redline.large_rewrite_hint`),className:`inline-flex shrink-0 items-center gap-1 rounded bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700`,children:[(0,K.jsx)(H_,{size:10}),t(n)]})}function qU({suggestion:e,selected:t=!1,standalone:n=!1,showKbdHints:r=!1,filename:i=null,isEditing:a,onEditingChange:o,isDocPreviewOn:s=!0,onToggleDocPreview:c,inFlight:l=null,failureReason:u=null,targetMissing:d=!1,onAccept:f,onReject:p,onEditSave:m,onUndo:h}){let{t:g}=V(),_=jU(e.change_type)===`delete`,v=_||d,y=d?`opacity-60 bg-muted/40`:``,[b,x]=(0,B.useState)(!1),S=a??b,C=e=>{a===void 0&&x(e),o?.(e)},w=btt(g,e,i),T=e.status,E=T===`pending`,D=T===`applied`,O=t?`ring-2 ring-blue-300`:``,k=(0,B.useMemo)(()=>utt(e.change_type,e.original_text,e.edited_text??e.suggested_text),[e.change_type,e.original_text,e.edited_text,e.suggested_text]),A=!E&&!!h&&!l&&(!D||ytt(e)),j=n||t,M=!E&&(0,K.jsx)(lR,{variant:T===`rejected`?`destructive`:`default`,className:`shrink-0 text-[10px]`,children:g(`redline.suggestion_status.${T}`)}),N=A&&h&&(0,K.jsxs)(`button`,{type:`button`,onClick:h,title:g(D?`redline.undo_applied_hint`:`redline.undo`),className:`flex shrink-0 items-center gap-1 rounded px-1.5 py-0.5 text-muted-foreground hover:bg-white/70 hover:text-foreground`,children:[(0,K.jsx)(kse,{size:12}),g(`redline.undo`)]});return j?(0,K.jsxs)(`div`,{className:`rounded-lg border bg-white p-3 space-y-2 ${y} ${O}`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[M,e.clause_label&&(0,K.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:e.clause_label}),E&&d&&(0,K.jsx)(GU,{}),E&&!d&&(0,K.jsx)(zU,{suggestion:e}),E&&!d&&k&&(0,K.jsx)(KU,{variant:k}),E&&(0,K.jsx)(BU,{reason:u}),l&&(0,K.jsx)(VU,{kind:l}),e.id&&(0,K.jsx)(`span`,{className:`ml-auto flex items-center gap-1`,children:(0,K.jsx)(mO,{subject:{type:`redline_suggestion`,id:e.id,label:w}})})]}),!S&&(0,K.jsx)(Stt,{suggestion:e}),S&&(0,K.jsx)(Ttt,{suggestion:e,onCancel:()=>C(!1),onSave:e=>{m(e),C(!1)}}),e.rationale&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:e.rationale}),!S&&!E&&N&&(0,K.jsx)(`div`,{className:`flex items-center gap-1.5 pt-1`,children:N}),!S&&E&&(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:f,disabled:!!l||d,title:g(d?`redline.target_missing_hint`:`redline.apply_suggestion`),className:`flex items-center gap-1 rounded border border-green-200 bg-green-50 px-2 py-1 text-xs font-medium text-green-700 hover:bg-green-100 disabled:cursor-not-allowed disabled:opacity-60`,children:[l===`apply`?(0,K.jsx)(W,{size:13,className:`animate-spin`}):(0,K.jsx)(Lg,{size:13}),g(`redline.accept`),r&&(0,K.jsx)(UU,{children:`A`})]}),(0,K.jsxs)(`button`,{type:`button`,onClick:p,title:g(`redline.reject_suggestion`),className:`flex items-center gap-1 rounded border border-red-200 bg-red-50/50 px-2 py-1 text-xs font-medium text-red-600 hover:bg-red-100`,children:[(0,K.jsx)(J_,{size:13}),g(`redline.reject`),r&&(0,K.jsx)(UU,{children:`D`})]}),!v&&(0,K.jsxs)(`button`,{type:`button`,onClick:()=>C(!0),title:g(`common.edit`),className:`flex items-center gap-1 rounded border px-2 py-1 text-xs font-medium text-muted-foreground hover:bg-muted`,children:[(0,K.jsx)(w_,{size:13}),g(`common.edit`),r&&(0,K.jsx)(UU,{children:`E`})]}),c&&(0,K.jsxs)(`button`,{type:`button`,onClick:c,"aria-pressed":s,title:g(s?`redline.hide_doc_preview`:`redline.show_doc_preview`),className:`ml-auto flex items-center gap-1 rounded border px-2 py-1 text-xs font-medium ${s?`border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100`:`text-muted-foreground hover:bg-muted`}`,children:[s?(0,K.jsx)(t_,{size:13}):(0,K.jsx)(e_,{size:13}),g(`redline.preview`),r&&(0,K.jsx)(UU,{children:`Q`})]})]})]}):(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border px-3 py-1.5 text-xs ${E?``:xtt(T)} ${y} ${O}`,children:[M,e.clause_label&&(0,K.jsx)(`span`,{className:`shrink-0 font-medium text-muted-foreground`,children:e.clause_label}),E&&d&&(0,K.jsx)(GU,{}),E&&!d&&(0,K.jsx)(zU,{suggestion:e}),E&&!d&&k&&(0,K.jsx)(KU,{variant:k}),E&&(0,K.jsx)(BU,{reason:u}),l&&(0,K.jsx)(VU,{kind:l}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground ${_?`line-through decoration-red-400`:``}`,children:Ab(_?e.original_text:HU(e),90)}),N]})}var Ctt=200;function wtt(e){let[t,n]=(0,B.useState)(e),r=(0,B.useRef)(e),i=(0,B.useRef)([]),a=(0,B.useRef)([]),o=e=>{r.current=e,n(e)};return{value:t,set:e=>{e!==r.current&&(i.current.push(r.current),i.current.length>Ctt&&i.current.shift(),a.current=[],o(e))},undo:()=>{let e=i.current.pop();e!==void 0&&(a.current.push(r.current),o(e))},redo:()=>{let e=a.current.pop();e!==void 0&&(i.current.push(r.current),o(e))}}}function Ttt({suggestion:e,onCancel:t,onSave:n}){let{t:r}=V(),i=e.original_text,a=e.suggested_text,o=jU(e.change_type)===`insert`,s=wtt(HU(e)),c=s.value.trim(),l=c===``,u=!o&&c===i.trim(),d=l||u,f=()=>{d||n(s.value)};return(0,K.jsxs)(`div`,{className:`space-y-2`,children:[o&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(WU,{suggestion:e}),(0,K.jsx)(`span`,{className:`block text-[10px] font-medium uppercase text-green-700`,children:r(`redline.insert_paragraph_after`)})]}),(0,K.jsx)(vtt,{originalText:o?``:i,draft:s.value,onDraftChange:s.set,onRevertHunk:e=>s.set(ctt(i,s.value,e)),onKeyDown:e=>{let n=e.metaKey||e.ctrlKey;if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),t();return}if(n&&e.key===`Enter`){e.preventDefault(),f();return}if(n&&!e.altKey&&e.key.toLowerCase()===`z`){e.preventDefault(),e.shiftKey?s.redo():s.undo();return}n&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`y`&&(e.preventDefault(),s.redo())},ariaLabel:r(`redline.edit_inline_label`)}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:r(`redline.edit_inline_hint`)}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[!
631o&&s.value!==i&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>s.set(i),className:`rounded border px-2 py-0.5 text-xs text-muted-foreground hover:bg-muted`,children:r(`redline.start_from_original`)}),s.value!==a&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>s.set(a),className:`rounded border px-2 py-0.5 text-xs text-muted-foreground hover:bg-muted`,children:r(`redline.reset_to_suggestion`)}),(0,K.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:t,className:`rounded px-2 py-0.5 text-xs text-muted-foreground hover:bg-muted`,children:r(`common.cancel`)}),(0,K.jsx)(`button`,{type:`button`,onClick:f,disabled:d,title:r(u?`redline.edit_no_change_hint`:`redline.save_shortcut_hint`),className:`rounded bg-green-500 px-2 py-0.5 text-xs text-white hover:bg-green-600 disabled:cursor-not-allowed disabled:opacity-60`,children:r(`common.save`)})]})]})]})}var Ett=[{titleKey:`redline.shortcuts.navigate`,shortcuts:[{keys:[`W`,`K`],labelKey:`redline.shortcuts.prev`},{keys:[`S`,`J`],labelKey:`redline.shortcuts.next`}]},{titleKey:`redline.shortcuts.triage`,shortcuts:[{keys:[`A`],labelKey:`redline.shortcuts.accept`},{keys:[`D`],labelKey:`redline.shortcuts.reject`},{keys:[`E`],labelKey:`redline.shortcuts.edit`},{keys:[`Q`],labelKey:`redline.shortcuts.toggle_preview`}]},{titleKey:`redline.shortcuts.undo`,shortcuts:[{keys:[`Z`],labelKey:`redline.shortcuts.undo_last`}]},{titleKey:`redline.shortcuts.help`,shortcuts:[{keys:[`?`],labelKey:`redline.shortcuts.help_toggle`}]}];function Dtt({children:e}){return(0,K.jsx)(`kbd`,{className:`border bg-muted/50 px-1.5 py-0.5 rounded text-[11px] font-mono`,children:e})}function Ott({open:e,onOpenChange:t}){let{t:n}=V();return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsxs)(WC,{className:`bg-popover/80 backdrop-blur-md supp
631orts-[backdrop-filter]:bg-popover/65 border max-w-md`,children:[(0,K.jsx)(GC,{children:(0,K.jsx)(qC,{children:n(`redline.shortcuts.title`)})}),(0,K.jsx)(`div`,{className:`flex flex-col gap-4`,children:Ett.map(e=>(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:n(e.titleKey)}),(0,K.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.shortcuts.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,K.jsx)(`span`,{children:n(e.labelKey)}),(0,K.jsx)(`span`,{className:`flex items-center gap-1`,children:e.keys.map((e,t)=>(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[t>0&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`/`}),(0,K.jsx)(Dtt,{children:e})]},e))})]},e.labelKey))})]},e.titleKey))})]})})}function ktt(e){let t=(0,B.useRef)(e);(0,B.useEffect)(()=>{t.current=e}),(0,B.useEffect)(()=>{let e=e=>{let n=e.target;if(n&&/^(INPUT|TEXTAREA|SELECT)$/.test(n.tagName)||n?.isContentEditable||e.metaKey||e.ctrlKey||e.altKey)return;let r=t.current;if(e.key===`?`){e.preventDefault(),r.onHelp();return}switch(e.key.toLowerCase()){case`w`:case`k`:e.preventDefault(),r.onPrev();break;case`s`:case`j`:e.preventDefault(),r.onNext();break;case`a`:e.preventDefault(),r.onAccept();break;case`d`:e.preventDefault(),r.onReject();break;case`e`:e.preventDefault(),r.onEdit();break;case`q`:e.preventDefault(),r.onTogglePreview();break;case`z`:e.preventDefault(),r.onUndo();break}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}var JU=`redline.review.hide-reviewed`;function Att(){try{return localStorage.getItem(JU)===`1`}catch{return!1}}function YU({controller:e,isStreaming:t=!1,onSelectRow:n,onHoverRow:r,hoveredRowId:i,onScrollToParagraph:a,isDocPreviewOn:o=!0,onToggleDocPreview:s,surface:c}){let{t:l}=V(),{rows:u,onUpdate:d,onApply:f,onApplyMany:p,onRejectMany:m,onUnapply:h,inFlightById:g,failureById:_}=e,[v,y]=(0,B.useState)(null),b=(0,B.useRef)(!1),[x,S]=(0,B.useState)(null),[C,w]=(0,B.useState)(Att),[T,E]=(0,B.useState)(!1),D=(0,B.useRef)([]),[O,k]=(0,B.useState)(null),[A,j]=(0,B.useState)(!1),M=(0,B.useRef)(new Map),N=C?u.filter(e=>e.status===`pending`):u,P=u.filter(e=>e.status===`pending`),F=P.length,I=u.length-F,L=e.isSuggesting||Object.keys(g).length>0,ee=Ex(e=>e.paragraphs),R=Ex(e=>e.documentId),te=Ex(e=>e.originalFilename),ne=Nx(e=>NU(e.user)),re=(0,B.useMemo)(()=>{let e=new Set;if(!ee.length)return e;let t=ee.map(e=>e.runs.filter(e=>e.type!==`del`).map(e=>e.text).join(``));for(let n of u)n.status===`pending`&&(R&&n.document_id!==R||t.some(e=>MU(e,n.original_text)!==null)||e.add(n.id));return e},[u,ee,R]),ie=N.find(e=>e.id===v)??null,z=N.find(e=>e.status===`pending`&&e.id!==O)??null;v!==null&&!ie?y(z?.id??null):v===null&&z&&!A&&y(z.id);let ae=e=>{j(!1),y(e),b.current=!0},oe=e=>{if(e.id===v){if(x===e.id)return;j(!0),y(null);return}ae(e.id)},se=(0,B.useRef)(n),ce=(0,B.useRef)(u),le=(0,B.useRef)(c);(0,B.useEffect)(()=>{se.current=n,ce.current=u,le.current=c}),(0,B.useEffect)(()=>{let e=ce.current.find(e=>e.id===v)??null;se.current?.(e),v&&M.current.get(v)?.scrollIntoView({block:`nearest`});let t=b.current?`user`:`auto`;b.current=!1,e&&Sx({event_type:`redline_suggestion_opened`,surface:le.current,document_id:e.document_id,batch_id:e.batch_id,suggestion_id:e.id,metadata:{trigger:t}})},[v]),(0,B.useEffect)(()=>()=>{se.current?.(null)},[]);let ue=e=>{let t=Math.max(0,N.findIndex(t=>t.id===e));for(let n=1;n<N.length;n++){let r=N[(t+n)%N.length];if(r.id!==e&&r.status===`pending`){ae(r.id);return}}ae(null)},de=async e=>{let t=D.current.indexOf(e);t>=0&&D.current.splice(t,1),k(null),ae(e.id);try{await d(e.id,{status:e.prevStatus,edited_text:e.prevEditedText??null})}catch(t){Y(t,l(`errors.save_failed`),{operation:`redline_undo_triage`,metadata:{suggestionId:e.id}})}},fe=e=>{let t=D.current.indexOf(e);t>=0&&D.current.splice(t,1),!(u.find(t=>t.id===e.id)?.status!==`applied`&&g[e.id]!==`apply`)&&(k(null),ae(e.id),h(e.id))},pe=async(e,t,n)=>{if(e.status===`applied`||e.status===`superseded`)return!1;let r={kind:`triage`,id:e.id,prevStatus:e.status,prevEditedText:e.edited_text};D.current.push(r),k(e.id),n?.advance&&ue(e.id),n?.toastUndo&&G(l(`toasts.redline.suggestion_rejected`),{action:{label:l(`redline.undo`),onClick:()=>{de(r)}}});try{return await d(e.id,t),!0}catch(n){let i=D.current.indexOf(r);return i>=0&&D.current.splice(i,1),Y(n,l(`errors.save_failed`),{operation:`redline_triage_suggestion`,metadata:{suggestionId:e.id,status:t.status}}),!1}},me=e=>{e.status!==`pending`&&e.status!==`rejected`||re.has(e.id)||g[e.id]||(D.current.push({kind:`apply`,id:e.id}
631),k(e.id),e.status===`pending`&&ue(e.id),f(e.id))},he=e=>{e.status===`pending`?pe(e,{status:`rejected`},{advance:!0,toastUndo:!0}):(e.status===`accepted`||e.status===`edited`)&&pe(e,{status:`rejected`},{toastUndo:!0})},ge=async(e,t)=>{await pe(e,{status:`edited`,edited_text:t})&&(D.current.push({kind:`apply`,id:e.id}),f(e.id))},_e=(e,t)=>{ge(e,t)},ve=()=>{let e=P.filter(e=>!re.has(e.id)).map(e=>e.id);if(e.length!==0){for(let t of e)D.current.push({kind:`apply`,id:t});p(e)}},ye=()=>{if(P.length!==0){for(let e of P)D.current.push({kind:`triage`,id:e.id,prevStatus:`pending`,prevEditedText:e.edited_text});m(P.map(e=>e.id))}},be=e=>{if(e.status===`applied`||g[e.id]===`apply`){fe([...D.current].reverse().find(t=>t.kind===`apply`&&t.id===e.id)??{kind:`apply`,id:e.id});return}let t=[...D.current].reverse().find(t=>t.kind===`triage`&&t.id===e.id);if(t){de(t);return}k(null),ae(e.id),d(e.id,{status:`pending`,edited_text:null})},xe=()=>{let e=D.current[D.current.length-1];if(e){if(e.kind===`apply`){fe(e);return}de(e)}},Se=e=>{if(N.length===0)return;let t=N.findIndex(e=>e.id===v);ae(N[t===-1?e===1?0:N.length-1:Math.min(N.length-1,Math.max(0,t+e))].id)};return ktt({onPrev:()=>Se(-1),onNext:()=>Se(1),onAccept:()=>{ie&&me(ie)},onReject:()=>{ie&&he(ie)},onEdit:()=>{ie?.status===`pending`&&S(e=>e===ie.id?null:ie.id)},onTogglePreview:()=>{s?.()},onUndo:xe,onHelp:()=>E(e=>!e)}),u.length===0?null:(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,K.jsxs)(`div`,{className:`shrink-0 border-b border-gray-200 bg-white px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`text-xs ${F===0?`font-medium text-green-700`:`text-gray-500`}`,children:l(`redline.progress_reviewed`,{reviewed:I,total:u.length})}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-[11px] text-gray-500`,children:[(0,K.jsx)(mP,{checked:C,onCheckedChange:e=>{w(e);try{localStorage.setItem(JU,e?`1`:`0`)}catch{}},className:`scale-75`}),l(`redline.hide_reviewed`)]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>E(!0),title:l(`redline.shortcuts.title`),className:`rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600`,children:(0,K.jsx)(Wg,{size:14})})]})]}),ne&&(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-gray-400`,children:[l(`redline.attributed_to`),`:`,` `,(0,K.jsx)(`span`,{className:`font-medium text-gray-500`,children:ne}),` · `,(0,K.jsx)(Gv,{to:`/settings/profile`,className:`text-gray-500 underline hover:text-gray-700`,children:l(`redline.change_author_name`)})]}),F>0&&(0,K.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:ve,disabled:L,className:`flex items-center gap-1 rounded border border-green-200 bg-green-50 px-2 py-1 text-xs font-medium text-green-700 hover:bg-green-100 disabled:cursor-not-allowed disabled:opacity-60`,children:l(`redline.apply_all`,{count:F})}),(0,K.jsx)(`button`,{type:`button`,onClick:ye,disabled:L,className:`flex items-center gap-1 rounded border border-red-200 bg-red-50/50 px-2 py-1 text-xs font-medium text-red-600 hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-60`,children:l(`redline.reject_all`)})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 space-y-2 overflow-auto px-3 py-2`,children:[N.map(e=>(0,K.jsx)(jtt,{row:e,isHovered:e.id===i,onHover:r,onScrollTo:a,onSelect:()=>oe(e),cardRef:t=>{t?M.current.set(e.id,t):M.current.delete(e.id)},children:(0,K.jsx)(qU,{suggestion:e,selected:e.id===v,showKbdHints:!0,filename:e.document_id===R?te:null,isEditing:x===e.id&&e.id===v,onEditingChange:t=>S(t?e.id:null),isDocPreviewOn:o,onToggleDocPreview:s,inFlight:g[e.id]??null,failureReason:_[e.id]??null,targetMissing:re.has(e.id),onAccept:()=>me(e),onReject:()=>he(e),onEditSave:t=>_e(e,t),onUndo:()=>be(e)})},e.id)),t&&(0,K.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,K.jsx)(RI,{size:`sm`,label:l(`redline.generating_more`)})})]}),(0,K.jsx)(Ott,{open:T,onOpenChange:E})]})}function jtt({row:e,isHovered:t,onHover:n,onScrollTo:r,onSelect:i,cardRef:a,children:o}){let s=(0,B.useRef)(null),c=()=>{s.current&&=(clearTimeout(s.current),null)};return(0,B.useEffect)(()=>
631c,[]),(0,K.jsx)(`div`,{ref:a,className:`cursor-pointer rounded-lg transition-shadow ${t?`ring-2 ring-yellow-300`:``}`,onMouseEnter:()=>{!n&&!r||(c(),s.current=setTimeout(()=>{n?.(e.id),r?.(e.paragraph_index)},150))},onMouseLeave:()=>{c(),n?.(null)},onClick:e=>{e.target.closest(`button,a,input,textarea,[role=button],[contenteditable]`)||window.getSelection()?.toString()||i()},children:o})}function XU(e){let t=Ux(e=>e.suggestions),n=Ux(e=>e.applyInFlightById),r=Ux(e=>e.applyFailureById),i=Ux(e=>e.updateSuggestion),a=Ux(e=>e.applySuggestionsNow),o=Ux(e=>e.batchTriageSuggestions),s=Ux(e=>e.unapplySuggestion),c=Ux(e=>e.appendSuggestions),l=Ux(e=>e.documents),u=Ex(e=>e.party),d=l.find(t=>t.document_id===e)?.knowledge_base_id,[f,p]=(0,B.useState)(`idle`),[m,h]=(0,B.useState)(null),g=(0,B.useRef)(null);(0,B.useEffect)(()=>()=>{g.current?.abort(),g.current=null},[e]);let _=t.filter(t=>t.document_id===e),v=async(t,n)=>{g.current?.abort();let r=new AbortController;g.current=r,p(`streaming`),h(null);try{await pge(e,{party:u||void 0,question:t,knowledge_base_id:n?.knowledgeBaseId||d||void 0,grounding_document_ids:n?.groundingDocumentIds?.length?n.groundingDocumentIds:void 0},{onBatch:t=>{c(e,t)},onDone:e=>{h(e.no_suggestions_reason??null),p(`done`)},onError:e=>{p(`done`),Y(Error(e),`Failed to generate suggestions`,{operation:`suggestRedlinesStream`})},onInterrupted:t=>{p(`done`),Y(Error(`redline suggest stream interrupted: ${t}`),H.t(`errors.stream_interrupted`),{operation:`suggestRedlinesStream`,metadata:{documentId:e,reason:t},fingerprint:[`redline-suggest-stream-interrupted`]})}},r.signal)}catch(e){p(`done`),Y(e,`Failed to generate suggestions`,{operation:`suggestRedlinesStream`})}finally{(!g.current||g.current===r)&&p(`done`)}};return{rows:_,isSuggesting:!1,streamStatus:f,noSuggestionsReason:m,onRequest:(e,t)=>{v(e,t)},onApply:t=>{a(e,[t])},onApplyMany:t=>{a(e,t)},onRejectMany:t=>{o(e,t,`rejected`)},onUnapply:t=>{s(e,t)},inFlightById:n,failureById:r,onUpdate:(t,n)=>i(e,t,n)}}function ZU({redlineCapable:e,onEnterRedline:t}){let{t:n}=V();return(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:t,disabled:!e,title:e?void 0:n(`email.redlines.not_word`),children:[(0,K.jsx)(xoe,{className:`h-4 w-4 mr-1`}),`Open Redline Editor`]})}function Mtt({documentId:e,reason:t,redlineCapable:n,isGenerating:r,hasAnalysis:i,onEnterRedline:a,onRedline:o}){return e?(0,K.jsx)(Ftt,{documentId:e,reason:t,redlineCapable:n,isGenerating:r,hasAnalysis:i,onEnterRedline:a,onRedline:o}):r?(0,K.jsx)(QU,{}):(0,K.jsx)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No redline suggestions`})})}function QU(){let{t:e}=V();return(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,K.jsx)(RI,{size:`lg`,label:e(`ai.activity.reviewing_redlines`)})})}function Ntt({documentId:e,reason:t,redlineCapable:n,hasAnalysis:r,onEnterRedline:i,onRedline:a}){let{t:o}=V(),s=Ux(e=>e.setDocumentSide),[c,l]=(0,B.useState)(!1);async function u(){if(!(!t.retrySide||c)){l(!0);try{await s(e,t.retrySide)}finally{l(!1)}}}if(t.reasonKey===`generation_failed`)return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,K.jsx)(H_,{className:`h-5 w-5 text-amber-500`}),(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:o(`email.redlines.failed_title`)}),(0,K.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:t.detail||o(`email.redlines.failed_body`)}),t.retrySide?(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:u,disabled:c,children:[(0,K.jsx)(E_,{className:`h-4 w-4 mr-1 ${c?`animate-spin`:``}`}),o(c?`email.redlines.retrying`:`email.redlines.retry`)]}):(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o(`email.redlines.retry_needs_side`)})]});if(t.reasonKey===`partial`)return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,K.jsx)(H_,{className:`h-5 w-5 text-amber-500`}),(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:o(`email.redlines.partial_title`)}),(0,K.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:t.detail||o(`email.redlines.partial_body`)}),t.retrySide?(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:u,disabled:c,
631children:[(0,K.jsx)(E_,{className:`h-4 w-4 mr-1 ${c?`animate-spin`:``}`}),o(c?`email.redlines.retrying`:`email.redlines.retry`)]}):null]});if(t.reasonKey===`skipped`){let e=Ub(t.detail,{operation:`email.redlines.gateReason`})||o(`email.redlines.skipped_body`);return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:o(`email.redlines.skipped_title`)}),(0,K.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:e}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,K.jsxs)(J,{type:`button`,size:`sm`,onClick:a,disabled:!n,title:n?void 0:o(`email.redlines.not_word`),children:[(0,K.jsx)(L_,{className:`h-4 w-4 mr-1`}),o(r?`email.redlines.suggest_from_analysis`:`email.redlines.analyze_and_suggest`)]}),(0,K.jsx)(ZU,{redlineCapable:n,onEnterRedline:i})]})]})}return t.reasonKey===`no_changes`?(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:o(`email.redlines.no_changes_title`)}),t.detail&&(0,K.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:t.detail}),(0,K.jsx)(ZU,{redlineCapable:n,onEnterRedline:i})]}):(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No redline suggestions`}),(0,K.jsx)(ZU,{redlineCapable:n,onEnterRedline:i})]})}function Ptt({detail:e}){let{t}=V();return(0,K.jsxs)(`div`,{className:`mx-3 mt-3 flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-900 dark:text-amber-200`,children:[(0,K.jsx)(H_,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`span`,{className:`font-medium`,children:[t(`email.redlines.partial_title`),`.`]}),` `,e||t(`email.redlines.partial_body`)]})]})}function Ftt({documentId:e,reason:t,redlineCapable:n,isGenerating:r,hasAnalysis:i,onEnterRedline:a,onRedline:o}){let s=XU(e);return s.rows.length===0?r?(0,K.jsx)(QU,{}):(0,K.jsx)(Ntt,{documentId:e,reason:t,redlineCapable:n,hasAnalysis:i,onEnterRedline:a,onRedline:o}):(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[t.reasonKey===`partial`&&(0,K.jsx)(Ptt,{detail:t.detail}),(0,K.jsx)(`div`,{className:`flex shrink-0 items-center justify-end px-3 pt-3 pb-2`,children:(0,K.jsx)(ZU,{redlineCapable:n,onEnterRedline:a})}),(0,K.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,K.jsx)(YU,{controller:s,surface:`email`},e)})]})}function $U(e){this.content=e}$U.prototype={constructor:$U,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new $U(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new $U(n)},addToStart:function(e,t){return new $U([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new $U(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new $U(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=$U.from(e),e.size?new $U(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=$U.from(e),e.size?new $U(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=$U.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},$U.from=function(e){if(e instanceof $U)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new $U(t)};var eW=$U;function tW(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=tW(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function nW(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=nW(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var rW=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}
vendor: 15,698 bytes, line 631
631textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return tW(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return nW(this,e,t,n)}findIndex(e){if(e==0)return aW(0,e);if(e==this.size)return aW(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?aW(t+1,i):aW(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};rW.empty=new rW([],0);var iW={index:0,offset:0};function aW(e,t){return iW.index=e,iW.offset=t,iW}function oW(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!oW(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!oW(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var sW=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&oW(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};sW.none=[];var cW=class extends Error{},lW=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=dW(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(uW(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(rW.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};lW.empty=new lW(rW.empty,0,0);function uW(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(uW(a.content,t-i-1,n-i-1)))}function dW(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=dW(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function Itt(e,t,n){if(n.openStart>e.depth)throw new cW(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new cW(`Inconsistent open depths`);return fW(e,t,n,0)}function fW(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=fW(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return _W(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=Ltt(n,e);return _W(a,vW(e,i,o,t,r))}else return _W(a,yW(e,t,r))}function pW(e,t){if(!t.type.compatibleContent(e.type))throw new cW(`Cannot join `+t.type.name+` onto `+e.type.name)}function mW(e,t,n){let r=e.node(n);return pW(r,t.node(n)),r}function hW(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function gW(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(hW(e.nodeAfter,r),a++));for(let e=a;e<o;e++)hW(i.child(e),r);t&&t.depth==n&&t.textOffset&&hW(t.nodeBefore,r)}function _W(e,t){return e.type.checkContent(t),e.copy(t)}function vW(e,t,n,r,i){let a=e.depth>i&&mW(e,t,i+1),o=r.depth>i&&mW(n,r,i+1),s=[];return gW(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(pW(a,o),hW(_W(a,vW(e,t,n,r,i+1)),s)):(a&&hW(_W(a,yW(e,t,i+1)),s),gW(t,n,i,s),o&&hW(_W(o,yW(n,r,i+1)),s)),gW(r,null,i,s),new rW(s)}function yW(e,t,n){let r=[];return gW(null,e,n,r),e.depth>n&&hW(_W(mW(e,t,n+1),yW(e,t,n+1)),r),gW(t,null,n,r),new rW(r)}function Ltt(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(rW.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var bW=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return sW.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new SW(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=xW.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else xW.set(t,r=new Rtt);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ztt,i}},Rtt=class{constructor(){this.elts=[],this.i=0}},ztt=12,xW=new WeakMap,SW=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Btt=Object.create(null),CW=class e{constructor(e,t,n,r=sW.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||rW.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&oW(this.attrs,t||e.defaultAttrs||Btt)&&sW.sameSet(this.marks,n||sW.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return lW.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new lW(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Itt(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return bW.resolveCached(this,e)}resolveNoCache(e){return bW.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),wW(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=rW.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=sW.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!sW.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>
631e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=rW.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};CW.prototype.text=void 0;var Vtt=class e extends CW{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):wW(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function wW(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var TW=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Htt(t,n);if(r.next==null)return e.empty;let i=EW(r);r.next&&r.err(`Unexpected trailing text`);let a=Ytt(Jtt(i));return Xtt(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return rW.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(` 632`)}};TW.empty=new TW(!0);var Htt=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function EW(e){let t=[];do t.push(Utt(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Utt(e){let t=[];do t.push(Wtt(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Wtt(e){let t=qtt(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Gtt(e,t);else break;return t}function DW(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Gtt(e,t){let n=DW(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:DW(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Ktt(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function qtt(e){if(e.eat(`(`)){let t=EW(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Ktt(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Jtt(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}
vendor: 11,538 bytes, line 632
632function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function OW(e,t){return t-e}function kW(e,t){let n=[];return r(t),n.sort(OW);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Ytt(e){let t=Object.create(null);return n(kW(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);kW(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new TW(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(OW);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Xtt(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function AW(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function jW(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function MW(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function NW(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Qtt(e,r,t[r]);return n}var PW=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=NW(e,n.attrs),this.defaultAttrs=AW(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==TW.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:jW(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new CW(this,this.computeAttrs(e),rW.from(t),sW.setFrom(n))}createChecked(e=null,t,n){return t=rW.from(t),this.checkContent(t),new CW(this,this.computeAttrs(e),t,sW.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=rW.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(rW.empty,!0);return i?new CW(this,e,t.append(i),sW.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){MW(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:sW.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Ztt(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Qtt=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Ztt(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},FW=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=NW(e,r.attrs),this.excluded=null;let i=AW(this.attrs);this.instance=i?new sW(this,i):null}create(e=null){return!e&&this.instance?this.instance:new sW(this,jW(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){MW(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},IW=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=eW.from(e.nodes),t.marks=eW.from(e.marks||{}),this.nodes=PW.compile(this.spec.nodes,this),this.marks=FW.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=TW.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?LW(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:LW(this,n.split(` `))}this.nodeFromJSON=e=>CW.fromJSON(this,e),this.markFromJSON=e=>sW.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(e instanceof PW){if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`)}else throw RangeError(`Invalid node type: `+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Vtt(n,n.defaultAttrs,e,sW.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function LW(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function $tt(e){return e.tag!=null}function ent(e){return e.style!=null}var RW=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if($tt(e))this.tags.push(e);else if(ent(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new KW(this,t,!1);return n.addAll(e,sW.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new KW(this,t,!0);return n.addAll(e,sW.none,t.from,t.to),lW.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(rnt(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=qW(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=qW(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},zW={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},tnt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},BW={ol:!0,ul:!0},VW=1,HW=2,UW=4;function WW(e,t,n){return t==null?e&&e.whitespace==`pre`?VW|HW:n&~UW:(t?VW:0)|(t===`full`?HW:0)}var GW=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=sW.none,this.match=i||(a&UW?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(rW.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&VW)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=rW.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(rW.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!zW.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},KW=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=WW(null,t.preserveWhitespace,0)|(n?UW:0);i=r?new GW(r.type,r.attrs,sW.none,!0,t.topMatch||r.type.contentMatch,a):n?new GW(null,null,sW.none,!0,null,a):new GW(e.schema.topNodeType,null,sW.
vendor: 2,739 bytes, lines 632-634
632none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&HW?`full`:this.localPreserveWS||(r.options&VW)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if(i===`full`)n=n.replace(/\r\n?/g,` 633`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);else if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;BW.hasOwnProperty(a)&&this.parser.normalizeLists&&nnt(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:tnt.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(zW.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` 634`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;
vendor: 45,397 bytes, lines 634-635
634if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=sW.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):JW(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=WW(e,i,a.options);a.options&UW&&a.content.length==0&&(o|=UW);let s=sW.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):JW(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new GW(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=VW);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function nnt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&BW.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function rnt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function qW(e){let t={};for(let n in e)t[n]=e[n];return t}function JW(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var YW=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=ZW(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return ZW(t).createTextNode(e.text);let{dom:n,contentDOM:r}=$W(ZW(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&$W(ZW(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:$W(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=XW(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return XW(e.marks)}};function XW(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ZW(e){return e.document||window.document}var QW=new WeakMap;function int(e){let t=QW.get(e);return t===void 0&&QW.set(e,t=ant(e)),t}function ant(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function $W(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=int(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){for(let e in u=2,l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=$W(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var eG=65535,tG=2**16;function ont(e,t){return e+t*tG}function nG(e){return e&eG}function snt(e){return(e-(e&eG))/tG}var rG=1,iG=2,aG=4,oG=8,sG=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&oG)>0}get deletedBefore(){return(this.delInfo&(rG|aG))>0}get deletedAfter(){return(this.delInfo&(iG|aG))>0}get deletedAcross(){return(this.delInfo&aG)>0}},cG=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=nG(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+snt(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:ont(o/3,e-s),f=e==s?iG:e==u?rG:aG;return(t<0?e!=s:e!=u)&&(f|=oG),new sG(a,f,d)}r+=l-c}return n?e+r:new sG(e+r,0,null)}touches(e,t){let n=0,r=nG(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};cG.empty=new cG([]);var lG=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new sG(e,r,null)}},uG=Object.create(null),dG=class{getMap(){return cG.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=uG[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in uG)throw RangeError(`Duplicate use of step JSON ID `+e);return uG[e]=t,t.prototype.jsonID=e,t}},fG=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof cW)return e.fail(t.message);throw t}}};function pG(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(pG(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return rW.fromArray(r)}var mG=class e extends dG{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new lW(pG(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return fG.fromReplace(e,this.from,this.to,i)}invert(){return new hG(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};dG.jsonID(`addMark`,mG);var hG=class e extends dG{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new lW(pG(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return fG.fromReplace(e,this.from,this.to,n)}invert(){return new mG(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};dG.jsonID(`removeMark`,hG);var gG=class e extends dG{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return fG.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return fG.fromReplace(e,this.pos,this.pos+1,new lW(rW.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new _G(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};dG.jsonID(`addNodeMark`,gG);var _G=class e extends dG{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return fG.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return fG.fromReplace(e,this.pos,this.pos+1,new lW(rW.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new gG(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};dG.jsonID(`removeNodeMark`,_G);var vG=class e extends dG{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&bG(e,this.from,this.to)?fG.fail(`Structure replace would overwrite content`):fG.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new cG([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?lW.empty:new lW(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?lW.empty:new lW(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,lW.fromJSON(t,n.slice),!!n.structure)}};vG.MAP_BIAS=1,dG.jsonID(`replace`,vG);var yG=class e extends dG{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(bG(e,this.from,this.gapFrom)||bG(e,this.gapTo,this.to)))return fG.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return fG.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?fG.fromReplace(e,this.from,this.to,n):fG.fail(`Content does not fit in gap`)}getMap(){return new cG([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,lW.fromJSON(t,n.slice),n.insert,!!n.structure)}};dG.jsonID(`replaceAround`,yG);function bG(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function cnt(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new hG(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new mG(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function lnt(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof FW){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new hG(t.from,t.to,t.style)))}function xG(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new vG(s,l,lW.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new hG(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new lW(rW.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new vG(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(rW.empty,!0);e.replace(s,s,new lW(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function unt(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function SG(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!unt(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function dnt(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=rW.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=rW.from(r.node(e).copy(u)),d++):c--;let f=rW.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=rW.from(i.node(e).copy(f)),p++):l++;e.step(new yG(c,l,o,s,new lW(u.append(f),d,p),u.size-d,!0))}function CG(e,t,n=null,r=e){let i=fnt(e,t),a=i&&pnt(r,t);return a?i.map(wG).concat({type:t,attrs:n}).concat(a.map(wG)):null}function wG(e){return{type:e,attrs:null}}function fnt(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function pnt(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function mnt(e,t,n){let r=rW.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=rW.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new yG(i,a,i,a,new lW(r,0,0),n.length,!0))}function hnt(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&gnt(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&EG(e,t,n,a),xG(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new yG(c,l,c+1,l-1,new lW(rW.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&TG(e,t,n,a),!1}})}function TG(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function EG(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(` 635`))}})}function gnt(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function _nt(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new yG(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new lW(rW.from(o),0,0),1,!0))}function DG(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function vnt(e,t,n=1,r){let i=e.doc.resolve(t),a=rW.empty,o=rW.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=rW.from(i.node(e).copy(a));let t=r&&r[s];o=rW.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new vG(t,t,new lW(a.append(o),n,n),!0))}function OG(e,t){let n=e.resolve(t),r=n.index();return kG(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ynt(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function kG(e,t){return!!(e&&t&&!e.isLeaf&&ynt(e,t))}function AG(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&kG(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function bnt(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);EG(e,r.node(),r.before(),s)}o.inlineContent&&xG(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new vG(l,c.map(t+n,-1),lW.empty,!0)),r===!0){let t=e.doc.resolve(l);TG(e,t.node(),t.before(),e.steps.length)}return e}function xnt(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function jG(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+(n>0?1:0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function MG(e,t,n=t,r=lW.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return NG(i,a,r)?new vG(t,n,r):new Snt(i,a,r).fit()}function NG(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Snt=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=rW.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=rW.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new lW(i,a,o);return e>-1?new yG(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new vG(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=IG(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(rW.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=IG(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new lW(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=IG(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new lW(PG(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new lW(PG(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(LG(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=FG(this.placed,t,rW.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?lW.empty:new lW(PG(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new lW(PG(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!RG(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=RG(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=RG(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=FG(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=FG(this.placed,this.depth,rW.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(rW.empty,!0);e.childCount&&(this.placed=FG(this.placed,this.frontier.length,e))}};function PG(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(PG(e.firstChild.content,t-1,n)))}function FG(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(FG(e.lastChild.content,t-1,n)))}function IG(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function LG(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,LG(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(rW.empty,!0)))),e.copy(r)}function RG(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!Cnt(n,a.content,o)?s:null}function Cnt(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function wnt(e){return e.spec.defining||e.spec.definingForContent}function Tnt(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(NG(i,a,r))return e.step(new vG(t,n,r));let o=BG(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=wnt(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new lW(zG(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function zG(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(zG(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(rW.empty,!0))}return e}function Ent(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=xnt(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new lW(rW.from(r),0,0))}function Dnt(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=BG(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function BG(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var VG=class e extends dG{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return fG.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return fG.fromReplace(e,this.pos,this.pos+1,new lW(rW.from(r),0,t.isLeaf?0:1))}getMap(){return cG.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};dG.jsonID(`attr`,VG);var HG=class e extends dG{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return fG.ok(n)}getMap(){return cG.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};dG.jsonID(`docAttr`,HG);var UG=class extends Error{};UG=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},UG.prototype=Object.create(Error.prototype),UG.prototype.constructor=UG,UG.prototype.name=`TransformError`;var WG=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new lG}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new UG(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=lW.empty){let r=MG(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new lW(rW.from(n),0,0))}delete(e,t){return this.replace(e,t,lW.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Tnt(this,e,t,n),this}replaceRangeWith(e,t,n){return Ent(this,e,t,n),this}deleteRange(e,t){return Dnt(this,e,t),this}lift(e,t){return dnt(this,e,t),this}join(e,t=1){return bnt(this,e,t),this}wrap(e,t){return mnt(this,e,t),this}setBlockType(e,t=e,n,r=null){return hnt(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return _nt(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new VG(e,t,n)),this}setDocAttribute(e,t){return this.step(new HG(e,t)),this}addNodeMark(e,t){return this.step(new gG(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof sW)t.isInSet(n.marks)&&this.step(new _G(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new _G(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return vnt(this,e,t,n),this}addMark(e,t,n){return cnt(this,e,t,n),this}removeMark(e,t,n){return lnt(this,e,t,n),this}clearIncompatible(e,t,n){return xG(this,e,t,n),this}},GG=Object.create(null),KG=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new qG(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=lW.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?lW.empty:t),o==0&&tK(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),tK(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new XG(e):eK(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?eK(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):eK(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new $G(e.node(0))}static atStart(e){return eK(e,e,0,0,1)||new $G(e)}static atEnd(e){return eK(e,e,e.content.size,e.childCount,-1)||new $G(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=GG[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in GG)throw RangeError(`Duplicate use of selection JSON ID `+e);return GG[e]=t,t.prototype.jsonID=e,t}getBookmark(){return XG.between(this.$anchor,this.$head).getBookmark()}};KG.prototype.visible=!0;var qG=class{constructor(e,t){this.$from=e,this.$to=t}},JG=!1;function YG(e){!JG&&!e.parent.inlineContent&&(JG=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var XG=class e extends KG{constructor(e,t=e){YG(e),YG(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return KG.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=lW.empty){if(super.replace(e,t),t==lW.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new ZG(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=KG.findFrom(n,r,!0)||KG.findFrom(n,-r,!0);if(e)n=e.$head;else return KG.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(KG.findFrom(t,-r,!0)||KG.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};KG.jsonID(`text`,XG);var ZG=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return XG.between(e.resolve(this.anchor),e.resolve(this.head))}},QG=class e extends KG{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?KG.near(a):new e(a)}content(){return new lW(rW.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new Ont(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};QG.prototype.visible=!1,KG.jsonID(`node`,QG);var Ont=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new ZG(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&QG.isSelectable(n)?new QG(t):KG.near(t)}},$G=class e extends KG{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=lW.empty){if(t==lW.empty){e.delete(0,e.doc.content.size);let t=KG.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return knt}};KG.jsonID(`all`,$G);var knt={map(){return this},resolve(e){return new $G(e)}};function eK(e,t,n,r,i,a=!1){if(t.inlineContent)return XG.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(r.isAtom){if(!a&&QG.isSelectable(r))return QG.create(e,n-(i<0?r.nodeSize:0))}else{let t=eK(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}n+=r.nodeSize*i}return null}function tK(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof vG||i instanceof yG))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(KG.near(e.doc.resolve(o),n))}var nK=1,rK=2,iK=4,Ant=class extends WG{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|nK)&~rK,this.storedMarks=null,this}get selectionSet(){return(this.updated&nK)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=rK,this}
635ensureMarks(e){return sW.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&rK)>0}addStep(e,t){super.addStep(e,t),this.updated&=~rK,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||sW.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(KG.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=iK,this}get scrolledIntoView(){return(this.updated&iK)>0}};function aK(e,t){return!t||!e?e:e.bind(t)}var oK=class{constructor(e,t,n){this.name=e,this.init=aK(t.init,n),this.apply=aK(t.apply,n)}},jnt=[new oK(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new oK(`selection`,{init(e,t){return e.selection||KG.atStart(t.doc)},apply(e){return e.selection}}),new oK(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new oK(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],sK=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=jnt.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new oK(e.key,e.spec.state,e))})}},Mnt=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Ant(this)}static create(t){let n=new sK(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new sK(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new sK(t.schema,t.plugins),a=new e(i);
vendor: 4,268 bytes, line 635
635return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=CW.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=KG.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function cK(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=cK(i,t,{})),n[r]=i}return n}var lK=class{constructor(e){this.spec=e,this.props={},e.props&&cK(e.props,this,this.props),this.key=e.key?e.key.key:dK(`plugin`)}getState(e){return e[this.key]}},uK=Object.create(null);function dK(e){return e in uK?e+`$`+ ++uK[e]:(uK[e]=0,e+`$`)}var fK=class{constructor(e=`key`){this.key=dK(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},pK=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function mK(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var hK=(e,t,n)=>{let r=mK(e,n);if(!r)return!1;let i=yK(r);if(!i){let n=r.blockRange(),i=n&&SG(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(kK(e,i,t,-1))return!0;if(r.parent.content.size==0&&(_K(a,`end`)||QG.isSelectable(a)))for(let n=r.depth;;n--){let o=MG(e.doc,r.before(n),r.after(n),lW.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(_K(a,`end`)?KG.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):QG.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Nnt=(e,t,n)=>{let r=mK(e,n);if(!r)return!1;let i=yK(r);return i?gK(e,i,t):!1},Pnt=(e,t,n)=>{let r=bK(e,n);if(!r)return!1;let i=CK(r);return i?gK(e,i,t):!1};function gK(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=MG(e.doc,i,o,lW.empty);if(!s||s.from!=i||s instanceof vG&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(XG.create(t.doc,i)),n(t.scrollIntoView())}return!0}function _K(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var vK=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=yK(r)}let o=a&&a.nodeBefore;return!o||!QG.isSelectable(o)?!1:(t&&t(e.tr.setSelection(QG.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function yK(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function bK(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var xK=(e,t,n)=>{let r=bK(e,n);if(!r)return!1;let i=CK(r);if(!i)return!1;let a=i.nodeAfter;if(kK(e,i,t,1))return!0;if(r.parent.content.size==0&&(_K(a,`start`)||QG.isSelectable(a))){let n=MG(e.doc,r.before(),r.after(),lW.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(_K(a,`start`)?KG.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):QG.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},SK=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=CK(r)}let o=a&&a.nodeAfter;return!o||!QG.isSelectable(o)?!1:(t&&t(e.tr.setSelection(QG.create(e.doc,a.pos)).scrollIntoView()),!0)};function CK(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var Fnt=(e,t)=>
vendor: 5,944 bytes, lines 635-636
635{let n=e.selection,r=n instanceof QG,i;if(r){if(n.node.isTextblock||!OG(e.doc,n.from))return!1;i=n.from}else if(i=AG(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(QG.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Int=(e,t)=>{let n=e.selection,r;if(n instanceof QG){if(n.node.isTextblock||!OG(e.doc,n.to))return!1;r=n.to}else if(r=AG(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Lnt=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&SG(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},wK=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(` 636`).scrollIntoView()),!0)};function TK(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var EK=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=TK(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(KG.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},DK=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof $G||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=TK(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(XG.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},OK=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(DG(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&SG(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function Rnt(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof QG&&t.selection.node.isBlock)return!r.parentOffset||!DG(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=TK(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof XG||t.selection instanceof $G)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=DG(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,DG(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var znt=Rnt(),Bnt=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(QG.create(e.doc,i))),!0)},Vnt=(e,t)=>(t&&t(e.tr.setSelection(new $G(e.doc))),!0);function Hnt(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||OG(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function kK(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Hnt(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=rW.empty;for(let e=o.length-1;e>=0;e--)s=rW.from(o[e].create(null,s));s=rW.from(i.copy(s));let c=e.tr.step(new yG(t.pos-1,r,t.pos,r,new lW(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&OG(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:KG.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&SG(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&_K(a,`start`,!0)&&_K(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=rW.empty;for(let e=o.length-1;e>=0;e--)r=rW.from(o[e].copy(r));n(e.tr.step(new yG(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new lW(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function AK(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(XG.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var jK=AK(-1),MK=AK(1);function Unt(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&CG(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function NK(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function PK(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var FK=PK(pK,hK,vK),IK=PK(pK,xK,SK),LK={Enter:PK(wK,DK,OK,znt),"Mod-Enter":EK,Backspace:FK,"Mod-Backspace":FK,"Shift-Backspace":FK,Delete:IK,"Mod-Delete":IK,"Mod-a":Vnt},Wnt={"Ctrl-h":LK.Backspace,"Alt-Backspace":LK[`Mod-Backspace`],"Ctrl-d":LK.Delete,"Ctrl-Alt-Backspace":LK[`Mod-Delete`],"Alt
636-Delete":LK[`Mod-Delete`],"Alt-d":LK[`Mod-Delete`],"Ctrl-a":jK,"Ctrl-e":MK};for(let e in LK)Wnt[e]=LK[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function Gnt(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return Knt(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Knt(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new SW(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new SW(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=CG(a,n,r,t);return s?(e&&qnt(e,t,s,i,n),!0):!1}function qnt(e,t,n,r,i){let a=rW.empty;for(let e=n.length-1;e>=0;e--)a=rW.from(n[e].type.create(n[e].attrs,a));e.step(new yG(t.start-(r?2:0),t.end,t.start,t.end,new lW(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&DG(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Jnt(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?Ynt(t,n,e,a):Xnt(t,n,a):!0:!1}}function Ynt(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new yG(a-1,o,a,o,new lW(rW.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new SW(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=SG(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return OG(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Xnt(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+(s?0:1),u+1,o.content.append(c?rW.empty:rW.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;
vendor: 133,420 bytes, lines 636-642
636return r.step(new yG(d-(s?1:0),f+(c?1:0),d+1,f-1,new lW((s?rW.empty:rW.from(i.copy(rW.empty))).append(c?rW.empty:rW.from(i.copy(rW.empty))),s?0:1,c?0:1),s?0:1)),t(r.scrollIntoView()),!0}function Znt(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=rW.from(r?e.create():null),o=new lW(rW.from(e.create(null,rW.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new yG(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var RK=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},zK=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},BK=null,VK=function(e,t,n){let r=BK||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Qnt=function(){BK=null},HK=function(e,t,n,r){return n&&(UK(e,t,n,r,-1)||UK(e,t,n,r,1))},$nt=/^(img|br|input|textarea|hr)$/i;function UK(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:WK(e))){let n=e.parentNode;if(!n||n.nodeType!=1||GK(e)||$nt.test(e.nodeName)||e.contentEditable==`false`)return!1;t=RK(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?WK(e):0}else return!1}}function WK(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ert(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=WK(e)}else if(e.parentNode&&!GK(e))t=RK(e),e=e.parentNode;else return null}}function trt(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!GK(e))t=RK(e)+1,e=e.parentNode;else return null}}function nrt(e,t,n){for(let r=t==0,i=t==WK(e);r||i;){if(e==n)return!0;let t=RK(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==WK(e)}}function GK(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var KK=function(e){return e.focusNode&&HK(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function qK(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function rrt(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function irt(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(WK(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(WK(r.startContainer),r.startOffset)}}}var JK=typeof navigator<`u`?navigator:null,YK=typeof document<`u`?document:null,XK=JK&&JK.userAgent||``,ZK=/Edge\/(\d+)/.exec(XK),QK=/MSIE \d/.exec(XK),$K=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(XK),eq=!!(QK||$K||ZK),tq=QK?document.documentMode:$K?+$K[1]:ZK?+ZK[1]:0,nq=!eq&&/gecko\/(\d+)/i.test(XK);nq&&+(/Firefox\/(\d+)/.exec(XK)||[0,0])[1];var rq=!eq&&/Chrome\/(\d+)/.exec(XK),iq=!!rq,aq=rq?+rq[1]:0,oq=!eq&&!!JK&&/Apple Computer/.test(JK.vendor),sq=oq&&(/Mobile\/\w+/.test(XK)||!!JK&&JK.maxTouchPoints>2),cq=sq||(JK?/Mac/.test(JK.platform):!1),lq=JK?/Win/.test(JK.platform):!1,uq=/Android \d/.test(XK),dq=!!YK&&`webkitFontSmoothing`in YK.documentElement.style,art=dq?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ort(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function fq(e,t){return typeof e==`number`?e:e[t]}function srt(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function pq(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=zK(o);continue}let e=o,n=e==a.body,s=n?ort(a):srt(e),c=0,l=0;if(t.top<s.top+fq(r,`top`)?l=-(s.top-t.top+fq(i,`top`)):t.bottom>s.bottom-fq(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+fq(i,`top`)-s.top:t.bottom-s.bottom+fq(i,`bottom`)),t.left<s.left+fq(r,`left`)?c=-(s.left-t.left+fq(i,`left`)):t.right>s.right-fq(r,`right`)&&(c=t.right-s.right+fq(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:zK(o)}}function crt(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:mq(e.dom)}}function mq(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=zK(r));return t}function lrt({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;hq(n,r==0?0:r-t)}function hq(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var gq=null;function urt(e){if(e.setActive)return e.setActive();if(gq)return e.focus(gq);let t=mq(e);e.focus(gq==null?{get preventScroll(){return gq={preventScroll:!0},!0}}:void 0),gq||(gq=!1,hq(t,0))}function _q(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=VK(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?drt(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:_q(n,i)}function drt(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=xq(r,1);if(n.top!=n.bottom&&vq(t,n)){i={node:e,offset:a+(t.left>=(n.left+n.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function vq(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function frt(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function prt(e,t,n){let{node:r,offset:i}=_q(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function mrt(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function yq(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(vq(t,i))return yq(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function hrt(e,t){let n=e.dom.ownerDocument,r,i=0,a=irt(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!vq(t,n)||(o=yq(e.dom,t,n),!o))return null}if(oq)for(let e=o;r&&e;e=zK(e))e.draggable&&(r=void 0);if(o=frt(o,t),r){if(nq&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;dq&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=mrt(e,r,i,t))}s??=prt(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function bq(e){return e.top<e.bottom||e.left<e.right}function xq(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(bq(e))return e}return Array.prototype.find.call(n,bq)||e.getBoundingClientRect()}var grt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Sq(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=dq||nq;if(r.nodeType==3)if(o&&(grt.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=xq(VK(r,i,i),n);if(nq&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=xq(VK(r,i-1,i-1),-1);if(t.top==e.top){let n=xq(VK(r,i,i+1),-1);if(n.top!=e.top)return Cq(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,Cq(xq(VK(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==WK(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return wq(e.getBoundingClientRect(),!1)}if(a==null&&i<WK(r)){let e=r.childNodes[i];if(e.nodeType==1)return wq(e.getBoundingClientRect(),!0)}return wq(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==WK(r))){let e=r.childNodes[i-1],t=e.nodeType==3?VK(e,WK(e)-(o?0:1)):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Cq(xq(t,1),!1)}if(a==null&&i<WK(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?VK(e,0,o?0:1):e.nodeType==1?e:null:null;if(t)return Cq(xq(t,-1),!0)}return Cq(xq(r.nodeType==3?VK(r):r,-n),n>=0)}function Cq(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function wq(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Tq(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function _rt(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Tq(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Sq(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=VK(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var vrt=/[\u0590-\u08ac]/;function yrt(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!vrt.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Tq(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var Eq=null,Dq=null,Oq=!1;function brt(e,t,n){return Eq==t&&Dq==n?Oq:(Eq=t,Dq=n,Oq=n==`up`||n==`down`?_rt(e,t,n):yrt(e,t,n))}var kq=0,Aq=1,jq=2,Mq=3,Nq=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=kq,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>RK(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof zq){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof Pq&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?RK(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?RK(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=RK(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=RK(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((nq||oq)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==` 637`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:RK(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(nq&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&oq)&&HK(o.node,o.offset,l.anchorNode,l.anchorOffset)&&HK(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&nq)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?jq:Aq,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Mq:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?jq:Mq}n=a}this.dirty=jq}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?jq:Aq;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Pq=class extends Nq{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==kq&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},xrt=class extends Nq{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Fq=class e extends Nq{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=YW.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Mq||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Mq&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=kq){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=kq}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Jq(a,n,o,r)),t>0&&(a=Jq(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Iq=class e extends Nq{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=YW.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Gq(u,r,n),l?c=new Srt(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new Rq(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>rW.empty)}return e}matchesNode(e,t,n){return this.dirty==kq&&e.eq(this.node)&&Kq(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new wrt(this,a&&a.node,e);Drt(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?sW.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==jq)&&(a&&this.protectLocalComposition(e,a),Bq(this.contentDOM,this.children,e),sq&&Ort(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof XG)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=krt(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new xrt(this,i,t,r);e.input.compositionNodes.push(a),this.children=Jq(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==Mq||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=kq}updateOuterDeco(e){if(Kq(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Wq(this.dom,this.nodeDOM,Uq(this.outerDeco,this.node,t),Uq(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Lq(e,t,n,r,i){Gq(r,t,e);let a=new Iq(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var Rq=class e extends Iq{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==Mq||this.dirty!=kq&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=kq||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=kq,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Mq)}get domAtom(){return!1}isText(e){return this.node.text==e}},zq=class extends Nq{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==kq&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},Srt=class extends Iq{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==Mq)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Bq(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=qq(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof Fq){let t=r?r.previousSibling:e.lastChild;Bq(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=qq(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var Vq=function(e){e&&(this.nodeName=e)};Vq.prototype=Object.create(null);var Hq=[new Vq];function Uq(e,t,n){if(e.length==0)return Hq;let r=n?Hq[0]:new Vq,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o)for(let e in o.nodeName&&i.push(r=new Vq(o.nodeName)),o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new Vq(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}return i}function Wq(e,t,n,r){if(n==Hq&&r==Hq)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=Hq[0],i=t)}Crt(i,o||Hq[0],a)}return i}function Crt(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function Gq(e,t,n){return Wq(e,e,Hq,Uq(t,n,e.nodeType!=1))}function Kq(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function qq(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var wrt=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Trt(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=kq,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=Fq.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==Mq&&a.dom==a.contentDOM&&(a.dirty=jq),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Iq){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Mq&&Kq(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=jq,u.updateChildren(r,a+1),u.dirty=kq),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Kq(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=Iq.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=Iq.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new Pq(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Fq;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Rq)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((oq||iq)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new zq(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function Trt(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Fq)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Ert(e,t){return e.type.side-t.type.side}function Drt(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Ert);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Ort(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function krt(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function Jq(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function Yq(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(KK(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&QG.isSelectable(e)&&i.parent&&!(e.isInline&&nrt(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new QG(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=iJ(e,u,s,n)}return l}function Xq(e){return e.editable?e.hasFocus():oJ(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Zq(e,t=!1){let n=e.state.selection;if(nJ(e,n),Xq(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&iq){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&HK(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)jrt(e);else{let{anchor:r,head:i}=n,a,o;Qq&&!(n instanceof XG)&&(n.$from.parent.inlineContent||(a=$q(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=$q(e,n.to))),e.docView.setSelection(r,i,e,t),Qq&&(a&&tJ(a),o&&tJ(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Art(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var Qq=oq||iq&&aq<63;function $q(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(oq&&i&&i.contentEditable==`false`)return eJ(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return eJ(i);if(a)return eJ(a)}}function eJ(e){return e.contentEditable=`true`,oq&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function tJ(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Art(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!Xq(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function jrt(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,RK(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&eq&&tq<=11&&(n.disabled=!0,n.disabled=!1)}function nJ(e,t){if(t instanceof QG){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(rJ(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else rJ(e)}function rJ(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function iJ(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||XG.between(t,n,r)}function aJ(e){return e.editable&&!e.hasFocus()?!1:oJ(e)}function oJ(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Mrt(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return HK(t.node,t.offset,n.anchorNode,n.anchorOffset)}function sJ(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&KG.findFrom(a,t)}function cJ(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function lJ(e,t,n){let r=e.state.selection;if(r instanceof XG)if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return cJ(e,new XG(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=sJ(e.state,t);return n&&n instanceof QG?cJ(e,n):!1}else if(!(cq&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?QG.isSelectable(i)?cJ(e,new QG(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):dq?cJ(e,new XG(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else return!1;else if(r instanceof QG&&r.node.isInline)return cJ(e,new XG(t>0?r.$to:r.$from));else{let n=sJ(e.state,t);return n?cJ(e,n):!1}}function uJ(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function dJ(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function fJ(e,t){return t<0?Nrt(e):Prt(e)}function Nrt(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(nq&&n.nodeType==1&&r<uJ(n)&&dJ(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(dJ(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(pJ(n))break;else{let t=n.previousSibling;for(;t&&dJ(t,-1);)i=n.parentNode,a=RK(t),t=t.previousSibling;if(t)n=t,r=uJ(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?mJ(e,n,r):i&&mJ(e,i,a)}function Prt(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=uJ(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(dJ(e,1))a=n,o=++r;else break}else if(pJ(n))break;else{let t=n.nextSibling;for(;t&&dJ(t,1);)a=t.parentNode,o=RK(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=uJ(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&mJ(e,a,o)}function pJ(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Frt(e,t){for(;e&&t==e.childNodes.length&&!GK(e);)t=RK(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function Irt(e,t){for(;e&&!t&&!GK(e);)t=RK(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function mJ(e,t,n){if(t.nodeType!=3){let e,r;(r=Frt(t,n))?(t=r,n=0):(e=Irt(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(KK(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Zq(e)},50)}function hJ(e,t){let n=e.state.doc.resolve(t);if(!(iq||lq)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function gJ(e,t,n){let r=e.state.selection;if(r instanceof XG&&!r.empty||n.indexOf(`s`)>-1||cq&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=sJ(e.state,t);if(n&&n instanceof QG)return cJ(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof $G?KG.near(n,t):KG.findFrom(n,t);return o?cJ(e,o):!1}return!1}function _J(e,t){if(!(e.state.selection instanceof XG))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function vJ(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Lrt(e){if(!oq||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;vJ(e,n,`true`),setTimeout(()=>vJ(e,n,`false`),20)}return!1}function Rrt(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function zrt(e,t){let n=t.keyCode,r=Rrt(t);if(n==8||cq&&n==72&&r==`c`)return _J(e,-1)||fJ(e,-1);if(n==46&&!t.shiftKey||cq&&n==68&&r==`c`)return _J(e,1)||fJ(e,1);if(n==13||n==27)return!0;if(n==37||cq&&n==66&&r==`c`){let t=n==37?hJ(e,e.state.selection.from)==`ltr`?-1:1:-1;return lJ(e,t,r)||fJ(e,t)}else if(n==39||cq&&n==70&&r==`c`){let t=n==39?hJ(e,e.state.selection.from)==`ltr`?1:-1:1;return lJ(e,t,r)||fJ(e,t)}else if(n==38||cq&&n==80&&r==`c`)return gJ(e,-1,r)||fJ(e,-1);else if(n==40||cq&&n==78&&r==`c`)return Lrt(e)||gJ(e,1,r)||fJ(e,1);else if(r==(cq?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function yJ(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||YW.fromSchema(e.state.schema),s=DJ(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=EJ[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,` 638 639`),slice:t}}function bJ(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new lW(rW.from(e.state.schema.text(t.replace(/\r\n?/g,` 640`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=YW.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Wrt(n),dq&&Grt(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||RW.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!Brt.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Krt(TJ(s,+u[1],+u[2]),u[4]);else if(s=lW.maxOpen(Vrt(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=TJ(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var Brt=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Vrt(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&SJ(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=CJ(a[a.length-1],i.length));let n=xJ(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return rW.from(a)}return e}function xJ(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,rW.from(e));return e}function SJ(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=SJ(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(rW.from(xJ(n,e,i+1))))}}function CJ(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,CJ(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(rW.empty,!0);return e.copy(n.append(r))}function wJ(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=wJ(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(rW.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function TJ(e,t,n){return t<e.openStart&&(e=new lW(wJ(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new lW(wJ(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var EJ={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},Hrt=null;function DJ(){return Hrt||=document.implementation.createHTMLDocument(`title`)}var OJ=null;function Urt(e){let t=window.trustedTypes;return t?(OJ||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),OJ.createHTML(e)):e}function Wrt(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=DJ().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&EJ[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=Urt(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function Grt(e){let t=e.querySelectorAll(iq?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function Krt(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=rW.from(t.create(r[e+1],i)),a++,o++}return new lW(i,a,o)}var kJ={},AJ={},qrt={touchstart:!0,touchmove:!0},Jrt=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function Yrt(e){for(let t in kJ){let n=kJ[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Zrt(e,t)&&!NJ(e,t)&&(e.editable||!(t.type in AJ))&&n(e,t)},qrt[t]?{passive:!0}:void 0)}oq&&e.dom.addEventListener(`input`,()=>null),MJ(e)}function jJ(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Xrt(e){for(let t in e.domObserver.stop(),e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function MJ(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>NJ(e,t))})}function NJ(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Zrt(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Qrt(e,t){!NJ(e,t)&&kJ[t.type]&&(e.editable||!(t.type in AJ))&&kJ[t.type](e,t)}AJ.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!zJ(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(uq&&iq&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),sq&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,qK(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||zrt(e,n)?n.preventDefault():jJ(e,`key`)},AJ.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},AJ.keypress=(e,t)=>{let n=t;if(zJ(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||cq&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof XG)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function PJ(e){return{left:e.clientX,top:e.clientY}}function $rt(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function FJ(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function IJ(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function eit(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&QG.isSelectable(r)?(IJ(e,new QG(n),`pointer`),!0):!1}function tit(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof QG&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(QG.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(IJ(e,QG.create(e.state.doc,i),`pointer`),!0)}function nit(e,t,n,r,i){return FJ(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?tit(e,n):eit(e,n))}function rit(e,t,n,r){return FJ(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function iit(e,t,n,r){return FJ(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||ait(e,n,r)}function ait(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(IJ(e,XG.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)IJ(e,XG.create(r,a+1,a+1+n.content.size),`pointer`);else if(QG.isSelectable(n))IJ(e,QG.create(r,a),`pointer`);else continue;return!0}}function LJ(e){return HJ(e)}var RJ=cq?`metaKey`:`ctrlKey`;kJ.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=LJ(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&$rt(n,e.input.lastClick)&&!n[RJ]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(PJ(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new oit(e,o,n,!!r)):(a==`doubleClick`?rit:iit)(e,o.pos,o.inside,n)?n.preventDefault():jJ(e,`pointer`))};var oit=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[RJ],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof QG&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&nq&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),jJ(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Zq(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(PJ(e))),this.updateAllowDefault(e),this.allowDefault||!t?jJ(this.view,`pointer`):nit(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||oq&&this.mightDrag&&!this.mightDrag.node.isAtom||iq&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(IJ(this.view,KG.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):jJ(this.view,`pointer`)}move(e){this.updateAllowDefault(e),jJ(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};kJ.touchstart=e=>{e.input.lastTouch=Date.now(),LJ(e),jJ(e,`pointer`)},kJ.touchmove=e=>{e.input.lastTouch=Date.now(),jJ(e,`pointer`)},kJ.contextmenu=e=>LJ(e);function zJ(e,t){return e.composing?!0:oq&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var sit=uq?5e3:-1;AJ.compositionstart=AJ.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof XG&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||iq&&lq&&cit(e)))e.markCursor=e.state.storedMarks||n.marks(),HJ(e,!0),e.markCursor=null;else if(HJ(e,!t.selection.empty),nq&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}BJ(e,sit)};function cit(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}AJ.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,BJ(e,20))};function BJ(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>HJ(e),t))}function VJ(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=uit());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function lit(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=ert(t.focusNode,t.focusOffset),r=trt(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function uit(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function HJ(e,t=!1){if(!(uq&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),VJ(e),t||e.docView&&e.docView.dirty){let n=Yq(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function dit(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var UJ=eq&&tq<15||sq&&art<604;kJ.copy=AJ.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=UJ?null:n.clipboardData,{dom:o,text:s}=yJ(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):dit(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function fit(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function pit(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?WJ(e,r.value,null,i,t):WJ(e,r.textContent,r.innerHTML,i,t)},50)}function WJ(e,t,n,r,i){let a=bJ(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||lW.empty)))return!0;if(!a)return!1;let o=fit(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function GJ(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}AJ.paste=(e,t)=>{let n=t;if(e.composing&&!uq)return;let r=UJ?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&WJ(e,GJ(r),r.getData(`text/html`),i,n)?n.preventDefault():pit(e,n)};var KJ=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},mit=cq?`altKey`:`ctrlKey`;function qJ(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[mit]:!n}kJ.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(PJ(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof QG?i.to-1:i.to))){if(r&&r.mightDrag)o=QG.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=QG.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=yJ(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!iq||aq>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(UJ?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,UJ||n.dataTransfer.setData(`text/plain`,c),e.dragging=new KJ(l,qJ(e,n),o)},kJ.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},AJ.dragover=AJ.dragenter=(e,t)=>t.preventDefault(),AJ.drop=(e,t)=>{try{hit(e,t,e.dragging)}finally{e.dragging=null}};function hit(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(PJ(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=bJ(e,GJ(t.dataTransfer),UJ?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&qJ(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||lW.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?jG(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&QG.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new QG(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(iJ(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}for(let e in kJ.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Zq(e)},20))},kJ.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},kJ.beforeinput=(e,t)=>{if(iq&&uq&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,qK(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},AJ)kJ[e]=AJ[e];function JJ(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var YJ=class e{constructor(e,t){this.toDOM=e,this.spec=t||$J,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new ZJ(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&JJ(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},XJ=class e{constructor(e,t){this.attrs=e,this.spec=t||$J}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new ZJ(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&JJ(this.attrs,t.attrs)&&JJ(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},git=class e{constructor(e,t){this.attrs=e,this.spec=t||$J}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new ZJ(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&JJ(this.attrs,t.attrs)&&JJ(this.spec,t.spec)}destroy(){}},ZJ=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new YJ(n,r))}static inline(t,n,r,i){return new e(t,n,new XJ(r,i))}static node(t,n,r,i){return new e(t,n,new git(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof XJ}get widget(){return this.type instanceof YJ}},QJ=[],$J={},eY=class e{constructor(e,t){this.local=e.length?e:QJ,this.children=t.length?t:QJ}static create(e,t){return t.length?oY(t,e,0,$J):tY}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==tY||e.maps.length==0?this:this.mapInner(e,t,0,0,n||$J)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?_it(this.children,o||[],t,n,r,i,a):o?new e(o.sort(sY),QJ):tY}add(t,n){return n.length?this==tY?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=iY(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,oY(s,e,o+1,$J)),a+=3}});let o=rY(a?aY(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(sY):this.local,i||this.children)}remove(e){return e.length==0||this==tY?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==tY?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):tY}forChild(t,n){if(this==tY)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof XJ){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(sY),QJ);return r?new nY([t,r]):t}return r||tY}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return cY(this.localsInner(e))}localsInner(e){if(this==tY)return QJ;if(e.inlineContent||!this.local.some(XJ.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof XJ||t.push(this.local[e]);return t}forEachSet(e){e(this)}};eY.empty=new eY([],[]),eY.removeOverlap=cY;var tY=eY.empty,nY=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,$J));return e.from(r)}forChild(t,n){if(n.isLeaf)return eY.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=tY&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?cY(n?t:t.sort(sY)):QJ}static from(t){switch(t.length){case 0:return tY;case 1:return t[0];default:return new e(t.every(e=>e instanceof eY)?t:t.reduce((e,t)=>e.concat(t instanceof eY?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function _it(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==tY?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=oY(vit(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new eY(t.sort(sY),s)}function rY(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new ZJ(i.from+t,i.to+t,i.type))}return n}function vit(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function iY(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function aY(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function oY(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=iY(e,t,o+n);if(s){a=!0;let e=oY(s,t,n+o+1,r);e!=tY&&i.push(o,o+t.nodeSize,e)}});let o=rY(a?aY(e):e,-n).sort(sY);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new eY(o,i):tY}function sY(e,t){return e.from-t.from||e.to-t.to}function cY(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),lY(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),lY(t,i,r.copy(a.from,r.to)));break}}}return t}function lY(e,t,n){for(;t<e.length&&sY(n,e[t])>0;)t++;e.splice(t,0,n)}function uY(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=tY&&t.push(r)}),e.cursorWrapper&&t.push(eY.create(e.state.doc,[e.cursorWrapper.deco])),nY.from(t)}var yit={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},bit=eq&&tq<=11,xit=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},Sit=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new xit,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);eq&&tq<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():oq&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),bit&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,yit)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(aJ(this.view)){if(this.suppressingSelectionUpdates)return Zq(this.view);if(eq&&tq<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&HK(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=zK(n))t.add(n);for(let r=e.anchorNode;r;r=zK(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&aJ(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(nq&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||Tit(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&KK(n)&&(c=Yq(e))&&c.eq(KG.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Zq(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Cit(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Eit(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Zq(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(eq&&tq<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?RK(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?RK(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},dY=new WeakMap,fY=!1;function Cit(e){if(!dY.has(e)&&(dY.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=nq,fY)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),fY=!0}}function pY(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return HK(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function wit(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return pY(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?pY(e,n):null}function Tit(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Eit(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function Dit(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],KK(c)||l.push({node:c.focusNode,offset:c.focusOffset})),iq&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||RW.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:Oit,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function Oit(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(oq&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||oq&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var kit=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Ait(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Yq(e,t);if(n&&!e.state.selection.eq(n)){if(iq&&uq&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,qK(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=Dit(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Nit(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(sq&&e.input.lastIOSEnter>Date.now()-225||uq)&&i.some(e=>e.nodeType==1&&!kit.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,qK(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof XG&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=mY(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof XG&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),eq&&tq<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((sq&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,qK(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Mit(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,qK(8,`Backspace`)))){uq&&iq&&e.domObserver.suppressSelectionUpdates();return}iq&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),uq&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,qK(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=mY(e,n.doc,l.sel);t&&!(iq&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||eq&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){eq&&tq<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Zq(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=jit(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-(g.textOffset?0:1)){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function mY(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:iJ(e,t.resolve(n.anchor),t.resolve(n.head))}function jit(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(rW.from(l).eq(e))return{mark:s,type:o}}function Mit(e,t,n,r,i){if(n-t<=i.pos-r.pos||hY(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(hY(a,!0,!0));return!o.parent.isTextblock||o.pos>n||hY(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function hY(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Nit(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&gY(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&gY(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function gY(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var _Y=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Jrt,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(SY),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=bY(this),yY(this),this.nodeViews=xY(this),this.docView=Lq(this.state.doc,vY(this),uY(this),this.dom,this),this.domObserver=new Sit(this,(e,t,n,r)=>Ait(this,e,t,n,r)),this.domObserver.start(),Yrt(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&MJ(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(SY),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(VJ(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=xY(this);Fit(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&MJ(this),this.editable=bY(this),yY(this);let o=uY(this),s=vY(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&crt(this);if(i){this.domObserver.stop();let t=l&&(eq||iq)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Pit(n.selection,e.selection);if(l){let n=iq?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=lit(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Lq(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Mrt(this))?Zq(this,t):(nJ(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&lrt(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof QG){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&pq(this,t.getBoundingClientRect(),e)}else pq(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new KJ(e.slice,e.move,r<0?void 0:QG.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(eq){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&urt(this.dom),Zq(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return hrt(this,e)}coordsAtPos(e,t=1){return Sq(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return brt(this,t||this.state,e)}pasteHTML(e,t){return WJ(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return WJ(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return yJ(this,e)}destroy(){this.docView&&(Xrt(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],uY(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Qnt())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Qrt(this,e)}domSelectionRange(){let e=this.domSelection();return e?oq&&this.root.nodeType===11&&rrt(this.dom.ownerDocument)==this.dom&&wit(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};_Y.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function vY(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[ZJ.node(0,e.state.doc.content.size,t)]}function yY(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:ZJ.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function bY(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Pit(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function xY(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Fit(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function SY(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var CY={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},wY={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Iit=typeof navigator<`u`&&/Mac/.test(navigator.platform),Lit=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),TY=0;TY<10;TY++)CY[48+TY]=CY[96+TY]=String(TY);for(var TY=1;TY<=24;TY++)CY[TY+111]=`F`+TY;for(var TY=65;TY<=90;TY++)CY[TY]=String.fromCharCode(TY+32),wY[TY]=String.fromCharCode(TY);for(var EY in CY)wY.hasOwnProperty(EY)||(wY[EY]=CY[EY]);function Rit(e){var t=!(Iit&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Lit&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?wY:CY)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var zit=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Bit=typeof navigator<`u`&&/Win/.test(navigator.platform);function Vit(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))zit?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Hit(e){let t=Object.create(null);for(let n in e)t[Vit(n)]=e[n];return t}function DY(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function Uit(e){return new lK({props:{handleKeyDown:OY(e)}})}function OY(e){let t=Hit(e);return function(e,n){let r=Rit(n),i,a=t[DY(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[DY(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Bit&&n.ctrlKey&&n.altKey)&&(i=CY[n.keyCode])&&i!=r){let r=t[DY(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var Wit=Object.defineProperty,kY=(e,t)=>{for(var n in t)Wit(e,n,{get:t[n],enumerable:!0})};function AY(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var jY=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:AY({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},MY={};kY(MY,{blur:()=>Git,clearContent:()=>Kit,clearNodes:()=>qit,command:()=>Jit,createParagraphNear:()=>Yit,cut:()=>Xit,deleteCurrentNode:()=>Zit,deleteNode:()=>Qit,deleteRange:()=>$it,deleteSelection:()=>eat,enter:()=>tat,exitCode:()=>nat,extendMarkRange:()=>rat,first:()=>iat,focus:()=>oat,forEach:()=>sat,insertContent:()=>cat,insertContentAt:()=>dat,joinBackward:()=>mat,joinDown:()=>pat,joinForward:()=>hat,joinItemBackward:()=>gat,joinItemForward:()=>_at,joinTextblockBackward:()=>vat,joinTextblockForward:()=>yat,joinUp:()=>fat,keyboardShortcut:()=>xat,lift:()=>Sat,liftEmptyBlock:()=>Cat,liftListItem:()=>wat,newlineInCode:()=>Tat,resetAttributes:()=>Eat,scrollIntoView:()=>Dat,selectAll:()=>Oat,selectNodeBackward:()=>kat,selectNodeForward:()=>Aat,selectParentNode:()=>jat,selectTextblockEnd:()=>Mat,selectTextblockStart:()=>Nat,setContent:()=>Pat,setMark:()=>eot,setMeta:()=>tot,setNode:()=>not,setNodeSelection:()=>rot,setTextDirection:()=>iot,setTextSelection:()=>aot,sinkListItem:()=>oot,splitBlock:()=>sot,splitListItem:()=>cot,toggleList:()=>uot,toggleMark:()=>dot,toggleNode:()=>fot,toggleWrap:()=>pot,undoInputRule:()=>mot,unsetAllMarks:()=>hot,unsetMark:()=>got,unsetTextDirection:()=>_ot,updateAttributes:()=>vot,wrapIn:()=>yot,wrapInList:()=>bot});var Git=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Kit=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),qit=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=SG(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Jit=e=>t=>e(t),Yit=()=>({state:e,dispatch:t})=>DK(e,t),Xit=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new XG(r.doc.resolve(Math.max(o-1,0)))),!0},Zit=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function NY(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Qit=e=>({tr:t,state:n,dispatch:r})=>{let i=NY(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},$it=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},eat=()=>({state:e,dispatch:t})=>pK(e,t),tat=()=>({commands:e})=>e.keyboardShortcut(`Enter`),nat=()=>({state:e,dispatch:t})=>EK(e,t);function PY(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function FY(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:PY(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function IY(e,t,n={}){return e.find(e=>e.type===t&&FY(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function LY(e,t,n={}){return!!IY(e,t,n)}function RY(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!IY([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&LY([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&LY([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function zY(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var rat=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=zY(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=RY(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=XG.create(o,e.from,e.to);n.setSelection(t)}}return!0},iat=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function BY(e){return e instanceof XG}function VY(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function HY(e,t=null){if(!t)return null;let n=KG.atStart(e),r=KG.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?XG.create(e,VY(0,i,a),VY(e.content.size,i,a)):XG.create(e,VY(t,i,a),VY(t,i,a))}function UY(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function WY(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function aat(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var oat=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(WY()||UY())&&r.dom.focus(),aat()&&!WY()&&!UY()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!BY(n.state.selection))return o(),!0;let s=HY(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},sat=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),cat=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),GY=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&GY(r)}return e};function KY(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return GY(n)}function qY(e,t,n){if(e instanceof CW||e instanceof rW)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return rW.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),qY(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new IW({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?RW.fromSchema(a).parseSlice(KY(e),n.parseOptions):RW.fromSchema(a).parse(KY(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=RW.fromSchema(t);return n.slice?r.parseSlice(KY(e),n.parseOptions).content:r.parse(KY(e),n.parseOptions)}return qY(``,t,n)}function lat(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof vG||i instanceof yG))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(KG.near(e.doc.resolve(o),n))}var uat=e=>!(`type`in e),dat=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{qY(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=qY(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((uat(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof rW){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&lat(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},fat=()=>({state:e,dispatch:t})=>Fnt(e,t),pat=()=>({state:e,dispatch:t})=>Int(e,t),mat=()=>({state:e,dispatch:t})=>hK(e,t),hat=()=>({state:e,dispatch:t})=>xK(e,t),gat=()=>({state:e,dispatch:t,tr:n})=>{try{let r=AG(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},_at=()=>({state:e,dispatch:t,tr:n})=>{try{let r=AG(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},vat=()=>({state:e,dispatch:t})=>Nnt(e,t),yat=()=>({state:e,dispatch:t})=>Pnt(e,t);function JY(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function bat(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))WY()||JY()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var xat=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=bat(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function YY(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?NY(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>FY(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Sat=(e,t={})=>({state:n,dispatch:r})=>YY(n,NY(e,n.schema),t)?Lnt(n,r):!1,Cat=()=>({state:e,dispatch:t})=>OK(e,t),wat=e=>({state:t,dispatch:n})=>Jnt(NY(e,t.schema))(t,n),Tat=()=>({state:e,dispatch:t})=>wK(e,t);function XY(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function ZY(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var Eat=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=XY(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=NY(e,r.schema)),s===`mark`&&(o=zY(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,ZY(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(ZY(a.attrs,t))))})})}),c},Dat=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Oat=()=>({tr:e,dispatch:t})=>{if(t){let t=new $G(e.doc);e.setSelection(t)}return!0},kat=()=>({state:e,dispatch:t})=>vK(e,t),Aat=()=>({state:e,dispatch:t})=>SK(e,t),jat=()=>({state:e,dispatch:t})=>Bnt(e,t),Mat=()=>({state:e,dispatch:t})=>MK(e,t),Nat=()=>({state:e,dispatch:t})=>jK(e,t);function QY(e,t,n={},r={}){return qY(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Pat=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=QY(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function $Y(e,t){let n=zY(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function eX(e,t){let n=new WG(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function Fat(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Iat(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function tX(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function nX(e){return t=>tX(t.$from,e)}function rX(e,t,n){return e.config[t]===void 0&&e.parent?rX(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?rX(e.parent,t,n):null}):e.config[t]}function iX(e){return e.map(e=>{let t=rX(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...iX(t())]:e}).flat(10)}function aX(e,t){let n=YW.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function oX(e){return typeof e==`function`}function sX(e,t=void 0,...n){return oX(e)?t?e.bind(t)(...n):e(...n):e}function Lat(e={}){return Object.keys(e).length===0&&e.constructor===Object}function cX(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function lX(e){let t=[],{nodeExtensions:n,markExtensions:r}=cX(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=rX(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=rX(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function Rat(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function uX(e){let t=[],n=Rat(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function dX(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...uX(n[e]),...uX(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function fX(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>dX(e,t),{})}function zat(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function pX(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):zat(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function mX(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&Lat(t)?!1:t!=null))}function hX(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function Bat(e,t){let n=lX(e),{nodeExtensions:r,markExtensions:i}=cX(e);return new IW({topNode:r.find(e=>rX(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=mX({...e.reduce((e,t)=>{let n=rX(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:sX(rX(r,`content`,a)),marks:sX(rX(r,`marks`,a)),group:sX(rX(r,`group`,a)),inline:sX(rX(r,`inline`,a)),atom:sX(rX(r,`atom`,a)),selectable:sX(rX(r,`selectable`,a)),draggable:sX(rX(r,`draggable`,a)),code:sX(rX(r,`code`,a)),whitespace:sX(rX(r,`whitespace`,a)),linebreakReplacement:sX(rX(r,`linebreakReplacement`,a)),defining:sX(rX(r,`defining`,a)),isolating:sX(rX(r,`isolating`,a)),attrs:Object.fromEntries(i.map(hX))}),s=sX(rX(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>pX(e,i)));let c=rX(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:fX(e,i)}));let l=rX(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=mX({...e.reduce((e,t)=>{let n=rX(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:sX(rX(r,`inclusive`,a)),excludes:sX(rX(r,`excludes`,a)),group:sX(rX(r,`group`,a)),spanning:sX(rX(r,`spanning`,a)),code:sX(rX(r,`code`,a)),attrs:Object.fromEntries(i.map(hX))}),s=sX(rX(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>pX(e,i)));let c=rX(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:fX(e,i)})),[r.name,o]}))})}function Vat(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function gX(e){return e.sort((e,t)=>{let n=rX(e,`priority`)||100,r=rX(t,`priority`)||100;return n>r?-1:n<r?1:0})}function _X(e){let t=gX(iX(e)),n=Vat(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function vX(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=` 641 642`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function Hat(e,t){return vX(e,{from:0,to:e.content.size},t)}function yX(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Uat(e,t){let n=NY(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function bX(e,t){let n=XY(typeof t==`string`?t:t.name,e.schema);return n===`node`?Uat(e,t):n===`mark`?$Y(e,t):{}}function Wat(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Gat(e){let t=Wat(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function xX(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Gat(r)}function SX(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=RY(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Kat=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function CX(e,t){return t.nodes[e]||t.marks[e]||null}function wX(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var qat=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function TX(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?zY(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>FY(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>FY(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Jat(e,t,n={}){if(!t)return YY(e,null,n)||TX(e,null,n);let r=XY(t,e.schema);return r===`node`?YY(e,t,n):r===`mark`?TX(e,t,n):!1}var Yat=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=nX(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Xat=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function EX(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function DX(e,t){let{nodeExtensions:n}=cX(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=sX(rX(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function OX(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(OX(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function kX(e){return e instanceof QG}var AX=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Zat(e,t){let n=t.mapping.mapResult(e.position);return{position:new AX(n.pos),mapResult:n}}function Qat(e){return new AX(e)}function $at(e,t,n){let{selection:r}=t,i=null;if(BY(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var eot=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=zY(e,r.schema);if(i)if(o){let e=$Y(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return $at(r,n,c)},tot=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),not=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=NY(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>NK(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>NK(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},rot=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=VY(e,0,n.content.size),i=QG.create(n,r);t.setSelection(i)}return!0},iot=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},aot=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=XG.atStart(n).from,o=XG.atEnd(n).to,s=VY(r,a,o),c=VY(i,a,o),l=XG.create(n,s,c);t.setSelection(l)}return!0},oot=e=>({state:t,dispatch:n})=>Znt(NY(e,t.schema))(t,n);function jX(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var sot=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=wX(l,s.node().type.name,s.node().attrs);if(a instanceof QG&&a.node.isBlock)return!s.parentOffset||!DG(o,s.pos)?!1:(r&&(e&&jX(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Fat(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=DG(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&DG(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof XG&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&jX(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},cot=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=NY(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=rW.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=rW.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...wX(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(rW.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new lW(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(XG.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...wX(d,u.type.name,u.attrs),...t},m={...wX(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!DG(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},MX=(e,t)=>{let n=nX(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&OG(e.doc,n.pos)&&e.join(n.pos),!0},NX=(e,t)=>{let n=nX(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&OG(e.doc,r)&&e.join(r),!0};function lot(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return XG.between(r,i)}var uot=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=NY(e,o.schema),m=NY(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=nX(e=>DX(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&DX(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,D=!!x&&y.depth>=1&&y.depth-x.depth<=1,O=!!T;if((D||O)&&E){if(E.node.type===p)return S&&O?c().command(({tr:e,dispatch:t})=>{let n=lot(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(DX(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>MX(a,p)).command(()=>NX(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>MX(a,p)).command(()=>NX(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>MX(a,p)).command(()=>NX(a,p)).run()},dot=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=zY(e,r.schema);return TX(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},fot=(e,t,n={})=>({state:r,commands:i})=>{let a=NY(e,r.schema),o=NY(t,r.schema),s=YY(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},pot=(e,t={})=>({state:n,commands:r})=>{let i=NY(e,n.schema);return YY(n,i,t)?r.lift(i):r.wrapIn(i,t)},mot=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;
642for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},hot=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},got=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=zY(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=RY(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},_ot=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},vot=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=XY(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=NY(e,r.schema)),s===`mark`&&(o=zY(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},yot=(e,t={})=>({state:n,dispatch:r})=>Unt(NY(e,n.schema),t)(n,r),bot=(e,t={})=>({state:n,dispatch:r})=>Gnt(NY(e,n.schema),t)(n,r),xot=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},PX=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Sot=(e,t)=>{if(PY(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function FX(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=qat(c)+i;return a.forEach(e=>{if(l)return;let a=Sot(u,e.find);if(!a)return;let c=s.state.tr,d=AY({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new jY({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function Cot(e){let{editor:t,rules:n}=e,r=new lK({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:aX(rW.from(e),a.schema);let{from:i}=s;FX({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return FX({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&FX({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?FX({editor:t,from:a.pos,to:a.pos,text:` 643`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function wot(e){return Object.prototype.toString.call(e).slice(8,-1)}function IX(e){return wot(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function LX(e,t){let n={...e};return IX(e)&&IX(t)&&Object.keys(t).forEach(r=>{IX(t[r])&&IX(e[r])?n[r]=LX(e[r],t[r]):n[r]=t[r]}),n}var RX=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...sX(rX(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...sX(rX(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>LX(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},zX=class e extends RX{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Tot(e){return typeof e==`number`}var Eot=class{constructor(e){this.find=e.find,this.handler=e.handler}}
vendor: 5,660 bytes, line 643
643,Dot=(e,t,n)=>{if(PY(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Oot(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new jY({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||Dot(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var BX=null,kot=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Aot(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!Oot({editor:t,state:AY({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new lK({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(BX=t)},i=()=>{BX&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=BX;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:aX(rW.from(t),r.schema);let{from:n}=d,i=n+t.length,a=kot(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!Tot(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var VX=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=_X(e),this.schema=Bat(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=rX(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:CX(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return gX([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:CX(t.name,this.schema)},r=[],i=rX(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&rX(t,`exitable`,n)&&(a.ArrowRight=()=>zX.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=Uit(a);r.push(o);let s=rX(t,`addInputRules`,n);if(EX(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Cot({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=rX(t,`addPasteRules`,n);if(EX(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Aot({editor:e,rules:t});r.push(...n)}}let l=rX(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return lX(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=cX(this.extensions);return Object.fromEntries(t.filter(e=>!!rX(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=rX(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:NY(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:fX(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return gX([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:CX(n.name,this.schema)},i=rX(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return gX([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:CX(n.name,this.schema)},i=rX(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=cX(this.extensions);return Object.fromEntries(t.filter(e=>!!rX(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=rX(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:zY(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=fX(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{Uot(i,e,t)}})}]:[]}))}
643destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:CX(e.name,this.schema)};e.type===`mark`&&(sX(rX(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=rX(e,`onBeforeCreate`,t),r=rX(e,`onCreate`,t),i=rX(e,`onUpdate`,t),a=rX(e,`onSelectionUpdate`,t),o=rX(e,`onTransaction`,t),s=rX(e,`onFocus`,t),c=rX(e,`onBlur`,t),l=rX(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};VX.resolve=_X,VX.sort=gX,VX.flatten=iX,kY({},{ClipboardTextSerializer:()=>UX,Commands:()=>WX,Delete:()=>GX,Drop:()=>KX,Editable:()=>qX,FocusEvents:()=>YX,Keymap:()=>XX,Paste:()=>ZX,Tabindex:()=>QX,TextDirection:()=>$X,focusEventsPluginKey:()=>JX});var HX=class e extends RX{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},UX=HX.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new lK({key:new fK(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=yX(n);return vX(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator}
vendor: 5,043 bytes, line 643
643,textSerializers:c})}}})]}}),WX=HX.create({name:`commands`,addCommands(){return{...MY}}}),GX=HX.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=eX(e.before,[e,...t]);xX(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof hG){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),KX=HX.create({name:`drop`,addProseMirrorPlugins(){return[new lK({key:new fK(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),qX=HX.create({name:`editable`,addProseMirrorPlugins(){return[new lK({key:new fK(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),JX=new fK(`focusEvents`),YX=HX.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new lK({key:JX,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),XX=HX.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:KG.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return WY()||JY()?i:r},addProseMirrorPlugins(){return[new lK({key:new fK(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=KG.atStart(t.doc).from,l=KG.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!OX(n.doc))return;let u=n.tr,d=AY({state:n,transaction:u}),{commands:f}=new jY({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),ZX=HX.create({name:`paste`,addProseMirrorPlugins(){return[new lK({key:new fK(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),QX=HX.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new lK({key:new fK(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),$X=HX.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=cX(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new lK({key:new fK(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),jot=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}
643get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+(a?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Mot=`.ProseMirror { 644 position: relative; 645} 646 647.ProseMirror { 648 word-wrap: break-word; 649 white-space: pre-wrap; 650 white-space: break-spaces; 651 -webkit-font-variant-ligatures: none; 652 font-variant-ligatures: none; 653 font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ 654} 655 656.ProseMirror [contenteditable="false"] { 657 white-space: normal; 658} 659 660.ProseMirror [contenteditable="false"] [contenteditable="true"] { 661 white-space: pre-wrap; 662} 663 664.ProseMirror pre { 665 white-space: pre-wrap; 666} 667 668img.ProseMirror-separator { 669 display: inline !important; 670 border: none !important; 671 margin: 0 !important; 672 width: 0 !important; 673 height: 0 !important; 674} 675 676.ProseMirror-gapcursor { 677 display: none; 678 pointer-events: none; 679 position: absolute; 680 margin: 0; 681} 682 683.ProseMirror-gapcursor:after { 684 content: ""; 685 display: block; 686 position: absolute; 687 top: -2px; 688 width: 20px; 689 border-top: 1px solid black; 690 animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; 691} 692 693@keyframes ProseMirror-cursor-blink { 694 to { 695 visibility: hidden; 696 } 697} 698 699.ProseMirror-hideselection *::selection { 700 background: transparent; 701} 702 703.ProseMirror-hideselection *::-moz-selection { 704 background: transparent; 705} 706 707.ProseMirror-hideselection * { 708 caret-color: transparent; 709} 710 711.ProseMirror-focused .ProseMirror-gapcursor { 712 display: block; 713}`;function Not(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}var Pot=class extends xot{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Zat,createMappablePosition:Qat},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit
713(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=HY(t,this.options.autofocus);this.editorState=Mnt.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=Not(Mot,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=oX(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){this.extensionManager=new VX([...this.options.enableCoreExtensions?[qX,UX.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),WX,YX,XX,QX.configure({value:this.options.coreExtensionOptions?.tabindex?.value}),KX,ZX,GX,$X.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type)),this)}createCommandManager(){this.commandManager=new jY({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=QY(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;
713this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=QY(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new _Y(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return bX(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Jat(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return aX(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=` 714 715`,textSerializers:n={}}=e||{};return Hat(this.state.doc,{blockSeparator:t,textSerializers:{...yX(this.schema),...n}})}get isEmpty(){return OX(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new jot(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function eZ(e){return new PX({find:e.find,handler:({state:t,range:n,match:r})=>{let i=sX(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(SX(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function tZ(e){return new PX({find:e.find,handler:({state:t,range:n,match:r})=>{let i=sX(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function nZ(e){return new PX({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=sX(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function rZ(e){return new PX({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=sX(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&CG(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>
715i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&OG(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var Fot=e=>`touches`in e,Iot=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type?(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);
715n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,Fot(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function Lot(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof QG){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}kY({},{createAtomBlockMarkdownSpec:()=>Rot,createBlockMarkdownSpec:()=>zot,createInlineMarkdownSpec:()=>Hot,parseAttributes:()=>iZ,parseIndentedBlocks:()=>oZ,renderNestedMarkdownContent:()=>sZ,serializeAttributes:()=>aZ});function iZ(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}
715__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,``).replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function aZ(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function Rot(e){let{nodeName:t,name:n,parseAttributes:r=iZ,serializeAttributes:i=aZ,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function zot(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=iZ,serializeAttributes:a=aZ,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``} 716 717${t.renderChildren(e.content||[],` 718 719`)} 720 721:::`}}}function Bot(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function Vot(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function Hot(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Bot,serializeAttributes:a=Vot,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=s?RegExp(`\\[${d}\\s*[^\\]]*\\]`):RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=s?RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function oZ(e,t,n){let r=e.split(` 722`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e} 723`;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e} 724`;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e} 725`,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e} 726`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(` 727`);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function sZ(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(` 728`).map(e=>e?t.indent(e):t.indent(``)).join(` 729`);s+=e.type===`paragraph`?` 730 731${n}`:` 732${n}`}}),s}function Uot(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;
732if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var cZ=class e extends RX{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function lZ(e){return new Eot({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=sX(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(SX(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var{getOwnPropertyNames:Wot,getOwnPropertySymbols:Got}=Object,{hasOwnProperty:Kot}=Object.prototype;function uZ(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function dZ(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function qot(e){return e?.[Symbol.toStringTag]}function fZ(e){return Wot(e).concat(Got(e))}var Jot=Object.hasOwn||((e,t)=>Kot.call(e,t));function pZ(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Yot=`__v`,Xot=`__o`,Zot=`_owner`,{getOwnPropertyDescriptor:mZ,keys:hZ}=Object;function Qot(e,t){return e.byteLength===t.byteLength&&vZ(new Uint8Array(e),new Uint8Array(t))}function $ot(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function est(e,t){return e.byteLength===t.byteLength&&vZ(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function tst(e,t){return pZ(e.getTime(),t.getTime())}function nst(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function rst(e,t){return e===t}function gZ(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var ist=pZ;function ast(e,t,n){let r=hZ(e),i=r.length;if(hZ(t).length!==i)return!1;for(;i-- >0;)if(!ust(e,t,n,r[i]))return!1;return!0}function _Z(e,t,n){let r=fZ(e),i=r.length;if(fZ(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!ust(e,t,n,a)||(o=mZ(e,a),s=mZ(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function ost(e,t){return pZ(e.valueOf(),t.valueOf())}function sst(e,t){return e.source===t.source&&e.flags===t.flags}function cst(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function vZ(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function lst(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function ust(e,t,n,r){return(r===Zot||r===Xot||r===Yot)&&(e.$$typeof||t.$$typeof)?!0:Jot(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var dst=`[object ArrayBuffer]`,fst=`[object Arguments]`,pst=`[object Boolean]`,mst=`[object DataView]`,hst=`[object Date]`,gst=`[object Error]`,_st=`[object Map]`,vst=`[object Number]`,yst=`[object Object]`,bst=`[object RegExp]`,xst=`[object Set]`,Sst=`[object String]`,Cst={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array
732]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},wst=`[object URL]`,Tst=Object.prototype.toString;function Est({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=Tst.call(h);if(b===hst)return r(h,g,_);if(b===bst)return u(h,g,_);if(b===_st)return o(h,g,_);if(b===xst)return d(h,g,_);if(b===yst)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===wst)return p(h,g,_);if(b===gst)return i(h,g,_);if(b===fst)return c(h,g,_);if(Cst[b])return f(h,g,_);if(b===dst)return e(h,g,_);if(b===mst)return n(h,g,_);if(b===pst||b===vst||b===Sst)return l(h,g,_);if(m){let e=m[b];if(!e){let t=qot(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function Dst({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Qot,areArraysEqual:n?_Z:$ot,areDataViewsEqual:est,areDatesEqual:tst,areErrorsEqual:nst,areFunctionsEqual:rst,areMapsEqual:n?uZ(gZ,_Z):gZ,areNumbersEqual:ist,areObjectsEqual:n?_Z:ast,arePrimitiveWrappersEqual:ost,areRegExpsEqual:sst,areSetsEqual:n?uZ(cst,_Z):cst,areTypedArraysEqual:n?uZ(vZ,_Z):vZ,areUrlsEqual:lst,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=dZ(r.areArraysEqual),t=dZ(r.areMapsEqual),n=dZ(r.areObjectsEqual),i=dZ(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function Ost(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function kst({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var Ast=yZ();yZ({strict:!0}),yZ({circular:!0}),yZ({circular:!0,strict:!0}),yZ({createInternalComparator:()=>pZ}),yZ({strict:!0,createInternalComparator:()=>pZ}),yZ({circular:!0,createInternalComparator:()=>pZ}),yZ({circular:!0,createInternalComparator:()=>pZ,strict:!0});function yZ(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=Est(Dst(e));return kst({circular:t,comparator:a,createState:r,equals:n?n(a):Ost(a),strict:i})}var jst=s((e=>{var t=m(),n=yg();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Mst=s(((e,t)=>{t.exports=jst()})),Nst=u(v(),1),Pst=yg(),Fst=yg(),Ist=Mst();v();var Lst=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},Rst=({contentComponent:e})=>{let t=(0,Pst.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,K.jsx)(K.Fragment,{children:Object.values(t)})};function zst(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t}
732,setRenderer(n,r){t={...t,[n]:Nst.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var Bst=class extends B.Component{constructor(e){super(e),this.editorContentRef=B.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=zst(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{ref:Lst(t,this.editorContentRef),...n}),e?.contentComponent&&(0,K.jsx)(Rst,{contentComponent:e.contentComponent})]})}},Vst=(0,B.forwardRef)((e,t)=>{let n=B.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return B.createElement(Bst,{key:n,innerRef:t,...e})}),Hst=B.memo(Vst),Ust=typeof window<`u`?B.useLayoutEffect:B.useEffect,Wst=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function Gst(e){let[t]=(0,B.useState)(()=>new Wst(e.editor)),n=(0,Ist.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??Ast);return Ust(()=>t.watch(e.editor),[e.editor,t]),(0,B.useDebugValue)(n),n}var Kst=!1,qst=typeof window>`u`,Jst=qst||!!(typeof window<`u`&&window.next),Yst=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender??!0;return e&&(qst||Jst)&&(e=!1,Kst&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches")),e?this.createEditor():null}createEditor(){return new Pot({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length?e.extensions.every((e,n)=>e===t.extensions?.[n]):!1:e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){
732if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Xst(e={},t=[]){let n=(0,B.useRef)(e);n.current=e;let[r]=(0,B.useState)(()=>new Yst(n)),i=(0,Fst.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,B.useDebugValue)(i),(0,B.useEffect)(r.onRender(t)),Gst({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var Zst=(0,B.createContext)({editor:null});Zst.Consumer;var Qst=(0,B.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),$st=()=>(0,B.useContext)(Qst);B.forwardRef((e,t)=>{let{onDragStart:n}=$st();return(0,K.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})}),B.createContext({markViewContentRef:()=>{}});var bZ=(0,B.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});bZ.displayName=`TiptapContext`;var ect=()=>(0,B.useContext)(bZ);function tct({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,B.useMemo)(()=>({editor:r}),[r]),a=(0,B.useMemo)(()=>({editor:r}),[r]);return(0,K.jsx)(Zst.Provider,{value:a,children:(0,K.jsx)(bZ.Provider,{value:i,children:n})})}tct.displayName=`Tiptap`;function nct({...e}){let{editor:t}=ect();return(0,K.jsx)(Hst,{editor:t,...e})}nct.displayName=`Tiptap.Content`,Object.assign(tct,{Content:nct});var xZ=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},rct=/^\s*>\s$/,ict=cZ.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return xZ(`blockquote`,{...dX(this.options.HTMLAttributes,e),children:xZ(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(` 733`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(` 734`))}),n.join(` 735> 736`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[rZ({find:rct,type:this.type})]}}),act=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,oct=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,sct=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,cct=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,lct=zX.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return xZ(`strong`,{...dX(this.options.HTMLAttributes,e),children:xZ(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
vendor: 7,551 bytes, lines 736-757
736,addInputRules(){return[eZ({find:act,type:this.type}),eZ({find:sct,type:this.type})]},addPasteRules(){return[lZ({find:oct,type:this.type}),lZ({find:cct,type:this.type})]}}),uct=/(^|[^`])`([^`]+)`(?!`)$/,dct=/(^|[^`])`([^`]+)`(?!`)/g,fct=zX.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,dX(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[eZ({find:uct,type:this.type})]},addPasteRules(){return[lZ({find:dct,type:this.type})]}}),SZ=4,pct=/^```([a-z]+)?[\s\n]$/,mct=/^~~~([a-z]+)?[\s\n]$/,hct=cZ.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:SZ,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,dX(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(` 737`):`\`\`\`${r} 738 739\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??SZ,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,` 740`,` 741`).split(` 742`).map(e=>o+e).join(` 743`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??SZ,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,` 744`,` 745`).split(` 746`),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(XG.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,` 747`,` 748`).split(` 749`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(` 750`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(` 751 752`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(KG.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[nZ({find:pct,type:this.type,getAttributes:e=>({language:e[1]})}),nZ({find:mct,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new lK({key:new fK(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,` 753`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(XG.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),gct=cZ.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` 754 755`):``}),_ct=cZ.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,dX(this.options.HTMLAttributes,e)]},renderText(){return` 756`},renderMarkdown:()=>` 757`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),vct=cZ.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,dX(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>nZ({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
757)\\s$`),type:this.type,getAttributes:{level:e}}))}}),yct=cZ.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,dX(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Lot(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return kX(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(XG.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(QG.create(t.doc,n.pos)):t.setSelection(XG.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(XG.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[tZ({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
vendor: 4,509 bytes, line 757
757ype})]}}),bct=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,xct=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Sct=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Cct=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,wct=zX.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,dX(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[eZ({find:bct,type:this.type}),eZ({find:Sct,type:this.type})]},addPasteRules(){return[lZ({find:xct,type:this.type}),lZ({find:Cct,type:this.type})]}}),Tct=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
757ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Ect=`ελ1Ï
2бг1ел3деÑи4еÑ2каÑолик6ом3мÐ
757ºÐ´2он1Ñква6онлайн5Ñг3ÑÑÑ2Ñ2ÑайÑ3Ñб3ÑкÑ3Òаз3Õ°Õ¡Õµ3×שר××5×§××3Ø§Ø¨ÙØ¸Ø¨Ù5راÙ
ÙÙ5ÙØ§Ø±Ø¯Ù4Ø¨ØØ±ÙÙ5جزائر5Ø³Ø¹ÙØ¯ÙØ©6عÙÙØ§Ù5Ù
غرب5Ù
ارات5ÛØ±Ø§Ù5بارت2زار4ÙØªÙ3ھارت5تÙÙØ³4Ø³ÙØ¯Ø§Ù3Ø±ÙØ©5Ø´Ø¨ÙØ©4عراÙ2ب2Ù
اÙ4ÙÙØ³Ø·ÙÙ6ÙØ·Ø±3ÙØ§Ø«ÙÙÙÙ6ÙÙ
3Ù
صر2ÙÙØ³Ùا5ÙØ±ÙتاÙÙØ§7ÙØ¹4ÙÙ
راÙ5پاکستاÙ7ÚØ§Ø±Øª4à¤à¥à¤®3नà¥à¤3à¤à¤¾à¤°à¤¤0मà¥3à¥à¤¤5सà¤à¤à¤ न5বাà¦à¦²à¦¾5à¦à¦¾à¦°à¦¤2ৰত4à¨à¨¾à¨°à¨¤4àªàª¾àª°àª¤4à¬à¬¾à¬°à¬¤4à®à®¨à¯à®¤à®¿à®¯à®¾6லà®à¯à®à¯6à®à®¿à®à¯à®à®ªà¯à®ªà¯à®°à¯11à°à°¾à°°à°¤à±5à²à²¾à²°à²¤4à´à´¾à´°à´¤à´5à¶½à¶à¶à·4à¸à¸à¸¡3à¹à¸à¸¢3ລາວ3áá2ã¿ããª3ã¢ãã¾ã³4ã¯ã©ã¦ã4ã°ã¼ã°ã«4ã³ã 2ã¹ãã¢3ã»ã¼ã«3ãã¡ãã·ã§ã³6ãã¤ã³ã4ä¸ç2ä¸ä¿¡1å½1å1æç½3äºé©¬é3ä¼ä¸2ä½å±±2ä¿¡æ¯2å¥åº·2å
«å¦2å
¬å¸1ç2å°æ¹¾1ç£2åå1åº1æ 2åé0大é
åº5å¨çº¿2大æ¿2天主æ3娱ä¹2å®¶é»2广ä¸2å¾®å2æ
å2æç±ä½ 3ææº2æè2æ¿å¡1åº2æ°å å¡2é»2æ¶å°2æ¸ç±2æºæ2淡马é¡3游æ2æ¾³é2ç¹ç2ç§»å¨2ç»ç»æºæ4ç½å1åº1ç«1ç»2èé2è°·æ2è´ç©2é販2éå¢2é»è¨çç§4é£å©æµ¦3é£å2é¤å
2馿 ¼éæ3港2ë·ë·1ì»´2ì¼ì±2íêµ2`,CZ=`numeric`,wZ=`ascii`,TZ=`alpha`,EZ=`asciinumeric`,DZ=`alphanumeric`,OZ=`domain`,Dct=`emoji`,Oct=`scheme`,kct=`slashscheme`,kZ=`whitespace`;function Act(e,t){return e in t||(t[e]=[]),t[e]}function AZ(e,t,n){for(let r in t[CZ]&&(t[EZ]=!0,t[DZ]=!0),t[wZ]&&(t[EZ]=!0,t[TZ]=!0),t[EZ]&&(t[DZ]=!0),t[TZ]&&(t[DZ]=!0),t[DZ]&&(t[OZ]=!0),t[Dct]&&(t[OZ]=!0),t){let t=Act(r,n);t.indexOf(e)<0&&t.push(e)}}function jct(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function jZ(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}jZ.groups={},jZ.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=jZ.groups;let i;return t&&t.j?i=t:(i=new jZ(t),n&&r&&AZ(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=jZ.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new jZ,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new jZ,a&&(r&&(o.t&&typeof o.t==`string`?AZ(a,Object.assign(jct(o.t,r),n),r):n&&AZ(a,n,r)),o.t=a),i.j[e]=o,o}};var MZ=(e,t,n,r,i)=>e.ta(t,n,r,i),NZ=(e,t,n,r,i)=>e.tr(t,n,r,i),Mct=(e,t,n,r,i)=>e.ts(t,n,r,i),PZ=(e,t,n,r,i)=>e.tt(t,n,r,i),FZ=`WORD`,IZ=`UWORD`,Nct=`ASCIINUMERICAL`,Pct=`ALPHANUMERICAL`,LZ=`LOCALHOST`,RZ=`TLD`,zZ=`UTLD`,BZ=`SCHEME`,VZ=`SLASH_SCHEME`,HZ=`NUM`,UZ=`WS`,WZ=`NL`,GZ=`OPENBRACE`,KZ=`CLOSEBRACE`,qZ=`OPENBRACKET`,JZ=`CLOSEBRACKET`,YZ=`OPENPAREN`,XZ=`CLOSEPAREN`,ZZ=`OPENANGLEBRACKET`,QZ=`CLOSEANGLEBRACKET`,$Z=`FULLWIDTHLEFTPAREN`,eQ=`FULLWIDTHRIGHTPAREN`,tQ=`LEFTCORNERBRACKET`,nQ=`RIGHTCORNERBRACKET`,rQ=`LEFTWHITECORNERBRACKET`,iQ=`RIGHTWHITECORNERBRACKET`,aQ=`FULLWIDTHLESSTHAN`,oQ=`FULLWIDTHGREATERTHAN`,sQ=`AMPERSAND`,cQ=`APOSTROPHE`,lQ=`ASTERISK`,uQ=`AT`,dQ=`BACKSLASH`,fQ=`BACKTICK`,pQ=`CARET`,mQ=`COLON`,hQ=`COMMA`,gQ=`DOLLAR`,_Q=`DOT`,vQ=`EQUALS`,yQ=`EXCLAMATION`,bQ=`HYPHEN`,xQ=`PERCENT`,SQ=`PIPE`,CQ=`PLUS`,wQ=`POUND`,TQ=`QUERY`,EQ=`QUOTE`,Fct=`FULLWIDTHMIDDLEDOT`,DQ=`SEMI`,OQ=`SLASH`,kQ=`TILDE`,AQ=`UNDERSCORE`,Ict=`EMOJI`,jQ=`SYM`,Lct=Object.freeze({__proto__:null,ALPHANUMERICAL:Pct,AMPERSAND:sQ,APOSTROPHE:cQ,ASCIINUMERICAL:Nct,ASTERISK:lQ,AT:uQ,BACKSLASH:dQ,BACKTICK:fQ,CARET:pQ,CLOSEANGLEBRACKET:QZ,CLOSEBRACE:KZ,CLOSEBRACKET:JZ,CLOSEPAREN:XZ,COLON:mQ,COMMA:hQ,DOLLAR:gQ,DOT:_Q,EMOJI:Ict,EQUALS:vQ,EXCLAMATION:yQ,FULLWIDTHGREATERTHAN:oQ,FULLWIDTHLEFTPAREN:$Z,FULLWIDTHLESSTHAN:aQ,FULLWIDTHMIDDLEDOT:Fct,FULLWIDTHRIGHTPAREN:eQ,HYPHEN:bQ,LEFTCORNERBRACKET:tQ,LEFTWHITECORNERBRACKET:rQ,LOCALHOST:LZ,NL:WZ,NUM:HZ,OPENANGLEBRACKET:ZZ,OPENBRACE:GZ,OPENBRACKET:qZ,OPENPAREN:YZ,PERCENT:xQ,PIPE:SQ,PLUS:C
vendor: 19,226 bytes, lines 757-762
757Q,POUND:wQ,QUERY:TQ,QUOTE:EQ,RIGHTCORNERBRACKET:nQ,RIGHTWHITECORNERBRACKET:iQ,SCHEME:BZ,SEMI:DQ,SLASH:OQ,SLASH_SCHEME:VZ,SYM:jQ,TILDE:kQ,TLD:RZ,UNDERSCORE:AQ,UTLD:zZ,UWORD:IZ,WORD:FZ,WS:UZ}),MQ=/[a-z]/,NQ=/\p{L}/u,PQ=/\p{Emoji}/u,FQ=/\d/,IQ=/\s/,Rct=`\r`,LQ=` 758`,zct=`ï¸`,Bct=`â`,RQ=``,zQ=null,BQ=null;function Vct(e=[]){let t={};jZ.groups=t;let n=new jZ;zQ??=Wct(Tct),BQ??=Wct(Ect),PZ(n,`'`,cQ),PZ(n,`{`,GZ),PZ(n,`}`,KZ),PZ(n,`[`,qZ),PZ(n,`]`,JZ),PZ(n,`(`,YZ),PZ(n,`)`,XZ),PZ(n,`<`,ZZ),PZ(n,`>`,QZ),PZ(n,`ï¼`,$Z),PZ(n,`ï¼`,eQ),PZ(n,`ã`,tQ),PZ(n,`ã`,nQ),PZ(n,`ã`,rQ),PZ(n,`ã`,iQ),PZ(n,`ï¼`,aQ),PZ(n,`ï¼`,oQ),PZ(n,`&`,sQ),PZ(n,`*`,lQ),PZ(n,`@`,uQ),PZ(n,"`",fQ),PZ(n,`^`,pQ),PZ(n,`:`,mQ),PZ(n,`,`,hQ),PZ(n,`$`,gQ),PZ(n,`.`,_Q),PZ(n,`=`,vQ),PZ(n,`!`,yQ),PZ(n,`-`,bQ),PZ(n,`%`,xQ),PZ(n,`|`,SQ),PZ(n,`+`,CQ),PZ(n,`#`,wQ),PZ(n,`?`,TQ),PZ(n,`"`,EQ),PZ(n,`/`,OQ),PZ(n,`;`,DQ),PZ(n,`~`,kQ),PZ(n,`_`,AQ),PZ(n,`\\`,dQ),PZ(n,`ã»`,Fct);let r=NZ(n,FQ,HZ,{[CZ]:!0});NZ(r,FQ,r);let i=NZ(r,MQ,Nct,{[EZ]:!0}),a=NZ(r,NQ,Pct,{[DZ]:!0}),o=NZ(n,MQ,FZ,{[wZ]:!0});NZ(o,FQ,i),NZ(o,MQ,o),NZ(i,FQ,i),NZ(i,MQ,i);let s=NZ(n,NQ,IZ,{[TZ]:!0});NZ(s,MQ),NZ(s,FQ,a),NZ(s,NQ,s),NZ(a,FQ,a),NZ(a,MQ),NZ(a,NQ,a);let c=PZ(n,LQ,WZ,{[kZ]:!0}),l=PZ(n,Rct,UZ,{[kZ]:!0}),u=NZ(n,IQ,UZ,{[kZ]:!0});PZ(n,RQ,u),PZ(l,LQ,c),PZ(l,RQ,u),NZ(l,IQ,u),PZ(u,Rct),PZ(u,LQ),NZ(u,IQ,u),PZ(u,RQ,u);let d=NZ(n,PQ,Ict,{[Dct]:!0});PZ(d,`#`),NZ(d,PQ,d),PZ(d,zct,d);let f=PZ(d,Bct);PZ(f,`#`),NZ(f,PQ,d);let p=[[MQ,o],[FQ,i]],m=[[MQ,null],[NQ,s],[FQ,a]];for(let e=0;e<zQ.length;e++)VQ(n,zQ[e],RZ,FZ,p);for(let e=0;e<BQ.length;e++)VQ(n,BQ[e],zZ,IZ,m);AZ(RZ,{tld:!0,ascii:!0},t),AZ(zZ,{utld:!0,alpha:!0},t),VQ(n,`file`,BZ,FZ,p),VQ(n,`mailto`,BZ,FZ,p),VQ(n,`http`,VZ,FZ,p),VQ(n,`https`,VZ,FZ,p),VQ(n,`ftp`,VZ,FZ,p),VQ(n,`ftps`,VZ,FZ,p),AZ(BZ,{scheme:!0,ascii:!0},t),AZ(VZ,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[Oct]:!0}:{[kct]:!0};r.indexOf(`-`)>=0?i[OZ]=!0:MQ.test(r)?FQ.test(r)?i[EZ]=!0:i[wZ]=!0:i[CZ]=!0,Mct(n,r,r,i)}return Mct(n,`localhost`,LZ,{ascii:!0}),n.jd=new jZ(jQ),{start:n,tokens:Object.assign({groups:t},Lct)}}function Hct(e,t){let n=Uct(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function Uct(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function VQ(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new jZ(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new jZ(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function Wct(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var HQ={defaultProtocol:`http`,events:null,format:Gct,formatHref:Gct,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function UQ(e,t=null){let n=Object.assign({},HQ);e&&(n=Object.assign(n,e instanceof UQ?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}UQ.prototype={o:HQ,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:HQ[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function Gct(e){return e}function Kct(e,t){this.t=`token`,this.v=e,this.tk=t}Kct.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`â¦`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=HQ.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function WQ(e,t){class n extends Kct{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var qct=WQ(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),Jct=WQ(`text`),Yct=WQ(`nl`),GQ=WQ(`url`,{isLink:!0,toHref(e=HQ.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==LZ&&e[1].t===mQ}}),KQ=e=>new jZ(e);function Xct({groups:e}){let t=e.domain.concat([sQ,lQ,uQ,dQ,fQ,pQ,gQ,vQ,bQ,HZ,xQ,SQ,CQ,wQ,OQ,jQ,kQ,AQ]),n=[cQ,mQ,hQ,_Q,yQ,xQ,TQ,EQ,DQ,ZZ,QZ,GZ,KZ,JZ,qZ,YZ,XZ,$Z,eQ,tQ,nQ,rQ,iQ,aQ,oQ],r=[sQ,cQ,lQ,dQ,fQ,pQ,gQ,vQ,bQ,GZ,KZ,xQ,SQ,CQ,wQ,TQ,OQ,jQ,kQ,AQ],i=KQ(),a=PZ(i,kQ);MZ(a,r,a),MZ(a,e.domain,a);let o=KQ(),s=KQ(),c=KQ();MZ(i,e.domain,o),MZ(i,e.scheme,s),MZ(i,e.slashscheme,c),MZ(o,r,a),MZ(o,e.domain,o);let l=PZ(o,uQ);PZ(a,uQ,l),PZ(s,uQ,l),PZ(c,uQ,l);let u=PZ(a,_Q);MZ(u,r,a),MZ(u,e.domain,a);let d=KQ();MZ(l,e.domain,d),MZ(d,e.domain,d);let f=PZ(d,_Q);MZ(f,e.domain,d);let p=KQ(qct);MZ(f,e.tld,p),MZ(f,e.utld,p),PZ(l,LZ,p);let m=PZ(d,bQ);PZ(m,bQ,m),MZ(m,e.domain,d),MZ(p,e.domain,d),PZ(p,_Q,f),PZ(p,bQ,m);let h=PZ(o,bQ),g=PZ(o,_Q);PZ(h,bQ,h),MZ(h,e.domain,o),MZ(g,r,a),MZ(g,e.domain,o);let _=KQ(GQ);MZ(g,e.tld,_),MZ(g,e.utld,_),MZ(_,e.domain,o),MZ(_,r,a),PZ(_,_Q,g),PZ(_,bQ,h),PZ(_,uQ,l);let v=PZ(_,mQ),y=KQ(GQ);MZ(v,e.numeric,y);let b=KQ(GQ),x=KQ();MZ(b,t,b),MZ(b,n,x),MZ(x,t,b),MZ(x,n,x),PZ(_,OQ,b),PZ(y,OQ,b);let S=PZ(s,mQ),C=PZ(PZ(PZ(c,mQ),OQ),OQ);MZ(s,e.domain,o),PZ(s,_Q,g),PZ(s,bQ,h),MZ(c,e.domain,o),PZ(c,_Q,g),PZ(c,bQ,h),MZ(S,e.domain,b),PZ(S,OQ,b),PZ(S,TQ,b),MZ(C,e.domain,b),MZ(C,t,b),PZ(C,OQ,b);let w=[[GZ,KZ],[qZ,JZ],[YZ,XZ],[ZZ,QZ],[$Z,eQ],[tQ,nQ],[rQ,iQ],[aQ,oQ]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=PZ(b,r);PZ(x,r,a);let o=KQ(GQ);MZ(a,t,o);let s=KQ();MZ(a,n,s),PZ(a,i,b),MZ(o,t,o),MZ(o,n,s),MZ(s,t,o),MZ(s,n,s),PZ(o,i,b),PZ(s,i,b)}return PZ(i,LZ,_),PZ(i,WZ,Yct),{start:i,tokens:Lct}}function Zct(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(qQ(Jct,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(qQ(e,t,r))}}return o.length>0&&a.push(qQ(Jct,t,o)),a}function qQ(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var Qct=typeof console<`u`&&console&&console.warn||(()=>{}),$ct=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,JQ={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function elt(){return jZ.groups={},JQ.scanner=null,JQ.parser=null,JQ.tokenQueue=[],JQ.pluginQueue=[],JQ.customSchemes=[],JQ.initialized=!1,JQ}function tlt(e,t=!1){if(JQ.initialized&&Qct(`linkifyjs: already initialized - will not register custom scheme "${e}" ${$ct}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format. 7591. Must only contain digits, lowercase ASCII letters or "-" 7602. Cannot start or end with "-" 7613. "-" cannot repeat`);JQ.customSchemes.push([e,t])}function nlt(){JQ.scanner=Vct(JQ.customSchemes);for(let e=0;e<JQ.tokenQueue.length;e++)JQ.tokenQueue[e][1]({scanner:JQ.scanner});JQ.parser=Xct(JQ.scanner.tokens);for(let e=0;e<JQ.pluginQueue.length;e++)JQ.pluginQueue[e][1]({scanner:JQ.scanner,parser:JQ.parser});return JQ.initialized=!0,JQ}function YQ(e){return JQ.initialized||nlt(),Zct(JQ.parser.start,e,Hct(JQ.scanner.start,e))}YQ.scan=Hct;function rlt(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new UQ(n),i=YQ(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var XQ=`[\0- \xA0áá â-\u2029âã]`,ilt=new RegExp(XQ),alt=RegExp(`${XQ}$`),olt=new RegExp(XQ,`g`);function slt(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function clt(e){return new lK({key:new fK(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(xX(eX(n.doc,[...t])).forEach(({newRange:t})=>{let n=Iat(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!alt.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(ilt).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=YQ(n).map(t=>t.toObject(e.defaultProtocol));if(!slt(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{SX(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function llt(e){return new lK({key:new fK(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=bX(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function ult(e){return new lK({key:new fK(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=rlt(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function ZQ(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(olt,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var dlt=zX.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){tlt(e);return}tlt(e.scheme,e.optionalSlashes)})},onDestroy(){elt()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!ZQ(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!ZQ(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!ZQ(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,dX(this.options.HTMLAttributes,e),0]:[`a`,dX(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!ZQ(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!ZQ(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[lZ({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=rlt(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!ZQ(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(clt({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!ZQ(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(llt({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(ult({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),flt=Object.defineProperty,plt=(e,t)=>{for(var n in t)flt(e,n,{get:t[n],enumerable:!0})},mlt=`listItem`,hlt=`textStyle`,glt=/^\s*([-+*])\s$/,_lt=cZ.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,dX(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` 762`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(mlt,this.editor.getAttributes(hlt)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=rZ({find:glt,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=rZ({find:glt,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(hlt),editor:this.editor})),[e]}});function vlt(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function ylt(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var blt=cZ.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,dX(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(vlt(e))return{type:`listItem`,content:[{type:`paragraph`,content:ylt(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>sZ(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});plt({},{findListItemPos:()=>QQ,getNextListDepth:()=>$Q,handleBackspace:()=>e$,handleDelete:()=>t$,hasListBefore:()=>xlt,hasListItemAfter:()=>Elt,hasListItemBefore:()=>Slt,listItemHasSubList:()=>Clt,nextListIsDeeper:()=>wlt,nextListIsHigher:()=>Tlt});var QQ=(e,t)=>{let{$from:n}=t.selection,r=NY(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},$Q=(e,t)=>{let n=QQ(e,t);if(!n)return!1;let[,r]=Kat(t,e,n.$pos.pos+4);return r},xlt=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},Slt=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},Clt=(e,t,n)=>{if(!n)return!1;let r=NY(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},e$=(e,t,n)=>{if(e.commands.undoInputRule())return!0;
762if(e.state.selection.from!==e.state.selection.to)return!1;if(!YY(e.state,t)&&xlt(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!YY(e.state,t)||!Xat(e.state))return!1;let r=QQ(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=Clt(t,e.state,i);return Slt(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},wlt=(e,t)=>{let n=$Q(e,t),r=QQ(e,t);return!r||!n?!1:n>r.depth},Tlt=(e,t)=>{let n=$Q(e,t),r=QQ(e,t);return!r||!n?!1:n<r.depth},t$=(e,t)=>{if(!YY(e.state,t)||!Yat(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:wlt(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Tlt(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},Elt=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},Dlt=HX.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&t$(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&t$(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&e$(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&e$(e,n,r)&&(t=!0)}),t}}}}),Olt=/^(\s*)(\d+)\.\s+(.*)$/,klt=/^\s/;function Alt(e){let t=e.trimStart();return/^[-+*]\s+/.test(t)||/^\d+\.\s+/.test(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function jlt(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&Alt(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function Mlt(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(Olt);if(!a)break;let[,o,s,c]=a,l=o.length,u=[c],d=n+1,f=[i],p=!1;for(;d<e.length;){let t=e[d];if(t.match(Olt))break;if(t.trim()===``)f.push(t),u.push(``),p=!0,d+=1;else if(t.match(klt))f.push(t),u.push(t.slice(l+2)),d+=1;else{if(p)break;f.push(t),u.push(t),d+=1}}t.push({indent:l,number:parseInt(s,10),content:u.join(` 763`).trim(),contentLines:u,raw:f.join(` 764`)}),r=d,n=d}return[t,r]}function Nlt(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=jlt(a.contentLines),c=o.join(` 765`).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(` 766`).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=Nlt(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,items:e,raw:f.map(e=>e.raw).join(` 767`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function Plt(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var Flt=`listItem`,Ilt=`textStyle`,Llt=/^(\d+)\.\s$/,Rlt=cZ.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,dX(this.options.HTMLAttributes,n),0]:[`ol`,dX(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?Plt(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` 768`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t}
vendor: 28,523 bytes, lines 768-771
768,tokenize:(e,t,n)=>{let r=e.split(` 769`),[i,a]=Mlt(r);if(i.length===0)return;let o=Nlt(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(` 770`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Flt,this.editor.getAttributes(Ilt)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=rZ({find:Llt,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=rZ({find:Llt,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Ilt)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),zlt=/^\s*(\[([( |x])?\])\s$/,Blt=cZ.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,dX(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>sZ(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=fX(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[rZ({find:zlt,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),Vlt=cZ.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,dX(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` 771`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=oZ(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=oZ(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});HX.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(_lt.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(blt.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Dlt.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Rlt.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Blt.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Vlt.configure(this.options.taskList)),e}});var n$=` `,r$=`\xA0`,Hlt=cZ.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,dX(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===n$||n[0].text===n$||n[0].raw===r$||n[0].text===r$)&&r.length===1&&r[0].type===`text`&&(r[0].text===n$||r[0].text===r$)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?n$:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Ult=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Wlt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Glt=zX.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,dX(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[eZ({find:Ult,type:this.type})]},addPasteRules(){return[lZ({find:Wlt,type:this.type})]}}),Klt=cZ.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),qlt=zX.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,dX(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Jlt(e={}){return new lK({view(t){return new Ylt(t,e)}})}var Ylt=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=jG(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},i$=class e extends KG{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):KG.near(r)}content(){return lW.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Xlt(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Qlt(e)||!$lt(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!QG.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};i$.prototype.visible=!1,i$.findFrom=i$.findGapCursorFrom,KG.jsonID(`gapcursor`,i$);var Xlt=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return i$.valid(t)?new i$(t):KG.near(t)}};function Zlt(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Qlt(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||Zlt(e.type))return!0;if(e.inlineContent)return!1}}return!0}function $lt(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||Zlt(e.type))return!0;if(e.inlineContent)return!1}}return!0}function eut(){return new lK({props:{decorations:iut,createSelectionBetween(e,t,n){return t.pos==n.pos&&i$.valid(n)?new i$(n):null},handleClick:nut,handleKeyDown:tut,handleDOMEvents:{beforeinput:rut}}})}var tut=OY({ArrowLeft:a$(`horiz`,-1),ArrowRight:a$(`horiz`,1),ArrowUp:a$(`vert`,-1),ArrowDown:a$(`vert`,1)});function a$(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof XG){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=i$.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new i$(c))),!0):!1}}function nut(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!i$.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&QG.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new i$(r))),!0)}function rut(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof i$))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=rW.empty;for(let e=r.length-1;e>=0;e--)i=rW.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new lW(i,0,0));return a.setSelection(XG.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function iut(e){if(!(e.selection instanceof i$))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,eY.create(e.doc,[ZJ.widget(e.selection.head,t,{key:`gapcursor`})])}var o$=200,s$=function(){};s$.prototype.append=function(e){return e.length?(e=s$.from(e),!this.length&&e||e.length<o$&&this.leafAppend(e)||this.length<o$&&e.leafPrepend(this)||this.appendInner(e)):this},s$.prototype.prepend=function(e){return e.length?s$.from(e).append(this):this},s$.prototype.appendInner=function(e){return new out(this,e)},s$.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?s$.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},s$.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},s$.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},s$.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},s$.from=function(e){return e instanceof s$?e:e&&e.length?new aut(e):s$.empty};var aut=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=o$)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=o$)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(s$);s$.empty=new aut([]);var out=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(s$),sut=s$,cut=500,c$=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new l$(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new l$(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new l$(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>uut&&(s=lut(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new lG;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new l$(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new l$(i,o,l))}else r.push(new l$(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new l$(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>cut&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new l$(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(sut.from(i.reverse()),a)}};c$.empty=new c$(sut.empty,0);function lut(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var l$=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},u$=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},uut=20;function dut(e,t,n,r){let i=n.getMeta(m$),a;if(i)return i.historyState;n.getMeta(gut)&&(e=new u$(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(m$))return o.getMeta(m$).redo?new u$(e.done.addTransform(n,void 0,r,p$(t)),e.undone,put(n.mapping.maps),e.prevTime,e.prevComposition):new u$(e.done,e.undone.addTransform(n,void 0,r,p$(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!fut(n,e.prevRanges)),s=o?d$(e.prevRanges,n.mapping):put(n.mapping.maps);return new u$(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,p$(t)),c$.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new u$(e.done.rebased(n,a),e.undone.rebased(n,a),d$(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new u$(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),d$(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function fut(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function put(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function d$(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function mut(e,t,n){let r=p$(t),i=m$.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new u$(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(m$,{redo:n,historyState:c})}var f$=!1,hut=null;function p$(e){let t=e.plugins;if(hut!=t){f$=!1,hut=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){f$=!0;break}}return f$}var m$=new fK(`history`),gut=new fK(`closeHistory`);function _ut(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new lK({key:m$,state:{init(){return new u$(c$.empty,c$.empty,null,0,-1)},apply(t,n,r){return dut(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?yut:n==`historyRedo`?but:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function vut(e,t){return(n,r)=>{let i=m$.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=mut(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var yut=vut(!1,!0),but=vut(!0,!0);HX.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new lK({key:new fK(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var xut=HX.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[Jlt(this.options)]}});HX.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new lK({key:new fK(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return eY.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(ZJ.node(t,t+e.nodeSize,{class:this.options.className}))}),eY.create(e,a)}}})]}});var Sut=HX.create({name:`gapCursor`,addProseMirrorPlugins(){return[eut()]},extendNodeSchema(e){return{allowGapCursor:sX(rX(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),Cut=`placeholder`;function wut(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}HX.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:Cut,placeholder:`Write something â¦`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${wut(this.options.dataAttribute)}`:`data-${Cut}`;return[new lK({key:new fK(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;
771return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&OX(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=ZJ.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),eY.create(t,a)}}})]}}),HX.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new lK({key:new fK(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||kX(n.selection)||e.view.dragging?null:eY.create(n.doc,[ZJ.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function Tut({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Eut=HX.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new fK(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new lK({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!Tut({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!Tut({node:r,types:n})}}})]}}),Dut=HX.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>yut(e,t),redo:()=>({state:e,dispatch:t})=>but(e,t)}},addProseMirrorPlugins(){return[_ut(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Ñ":()=>this.editor.commands.undo(),"Shift-Mod-Ñ":()=>this.editor.commands.redo()}}}),Out=HX.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(lct.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(ict.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(_lt.configure(this.options.bulletList)),this.options.code!==!1&&e.push(fct.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(hct.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(gct.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(xut.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Sut.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(_ct.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(vct.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(Dut.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(yct.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(wct.configure(this.options.italic)),this.options.listItem!==!1&&e.push(blt.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Dlt.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(dlt.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(Rlt.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Hlt.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(Glt.configure(this.options.strike)),this.options.text!==!1&&e.push(Klt.configure(this.options.text)),this.options.underline!==!1&&e.push(qlt.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(Eut.configure(this.options?.trailingNode)),e}}),h$,g$;if(typeof WeakMap<`u`){let e=new WeakMap;h$=t=>e.get(t),g$=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;h$=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},g$=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var _$=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e}
771 found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return h$(e)||g$(e,kut(e))}};function kut(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=Aut(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new _$(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&jut(s,o,e),s}function Aut(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function jut(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=Mut(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function Mut(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function v$(e){let t=e.cached.tableNodeTypes;if(!t)for(let n in t=e.cached.tableNodeTypes={},e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}return t}var y$=new fK(`selectingCells`);function b$(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function Nut(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function x$(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function S$(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=b$(t.$head)||Put(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function Put(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function C$(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}
vendor: 37,575 bytes, lines 771-775
771function Fut(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function w$(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Iut(e,t,n){let r=e.node(-1),i=_$.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function T$(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function Lut(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function Rut(e,t,n){let r=v$(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var E$=class e extends KG{constructor(e,t=e){let n=e.node(-1),r=_$.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new qG(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(C$(r)&&C$(i)&&w$(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return XG.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=_$.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=T$(e,0,l)),u>0&&(e=T$(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(rW.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new lW(rW.from(o),1,1)}replace(e,t=lW.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?lW.empty:t)}let i=KG.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new lW(rW.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=_$.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=_$.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=_$.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=_$.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new zut(this.$anchorCell.pos,this.$headCell.pos)}};E$.prototype.visible=!1,KG.jsonID(`cell`,E$);var zut=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&w$(t,n)?new E$(t,n):KG.near(n,1)}};function But(e){if(!(e.selection instanceof E$))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(ZJ.node(n,n+e.nodeSize,{class:`selectedCell`}))}),eY.create(e.doc,t)}function Vut({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Hut({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function Uut(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof QG&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=E$.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=E$.rowSelection(e,e)}else if(!n){let e=_$.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=E$.create(i,t+1,n)}}else r instanceof XG&&Vut(r)?a=XG.create(i,r.from):r instanceof XG&&Hut(r)&&(a=XG.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var Wut=new fK(`fix-tables`);function Gut(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?Gut(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Kut(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=qut(e,t,r,n))};return t?t.doc!=e.doc&&Gut(t.doc,e.doc,0,r):e.doc.descendants(r),n}function qut(e,t,n,r){let i=_$.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,T$(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=v$(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(Wut,{fixTables:!0})}function D$(e){let t=e.selection,n=S$(e),r=n.node(-1),i=n.start(-1),a=_$.get(r);return{...t instanceof E$?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function Jut(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Rut(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,Lut(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?v$(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function Yut(e,t){if(!x$(e))return!1;if(t){let n=D$(e);t(Jut(e.tr,n,n.left))}return!0}function Xut(e,t){if(!x$(e))return!1;if(t){let n=D$(e);t(Jut(e.tr,n,n.right))}return!0}function Zut(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,T$(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function Qut(e,t){if(!x$(e))return!1;if(t){let n=D$(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Zut(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=_$.get(e)}t(r)}return!0}function $ut(e,t,n){let r=v$(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function edt(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;$ut(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?v$(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,v$(r.type.schema).row.create(null,o)),e}function tdt(e,t){if(!x$(e))return!1;if(t){let n=D$(e);t(edt(e.tr,n,n.top))}return!0}function ndt(e,t){if(!x$(e))return!1;if(t){let n=D$(e);t(edt(e.tr,n,n.bottom))}return!0}function rdt(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function idt(e,t){if(!x$(e))return!1;if(t){let n=D$(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;rdt(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=_$.get(n.table)}t(r)}return!0}function adt(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function odt({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function sdt(e,t){let n=e.selection;if(!(n instanceof E$)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=D$(e),{map:i}=r;if(odt(i,r))return!1;if(t){let n=e.tr,a={},o=rW.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{adt(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Lut(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=adt(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new E$(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function cdt(e,t){let n=v$(e.schema);return ldt(({node:e})=>n[e.type.spec.tableRole])(e,t)}function ldt(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof E$){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=Nut(r.$from),!i)return!1;a=b$(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=D$(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof E$&&u.setSelection(new E$(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function udt(e,t){return function(n,r){if(!x$(n))return!1;let i=S$(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof E$?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function ddt(e){return function(t,n){if(!x$(t))return!1;if(n){let r=v$(t.schema),i=D$(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function fdt(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function O$(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?ddt(e):function(t,n){if(!x$(t))return!1;if(n){let r=v$(t.schema),i=D$(t),a=t.tr,o=fdt(`row`,i,r),s=fdt(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}O$(`row`,{useDeprecatedLogic:!0}),O$(`column`,{useDeprecatedLogic:!0});var pdt=O$(`cell`,{useDeprecatedLogic:!0});function mdt(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function hdt(e){return function(t,n){if(!x$(t))return!1;let r=mdt(S$(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(XG.between(e,Fut(e))).scrollIntoView())}return!0}}function gdt(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function k$(e,t){let n=e.selection;if(!(n instanceof E$))return!1;if(t){let r=e.tr,i=v$(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new lW(i,0,0))}),r.docChanged&&t(r)}return!0}function _dt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=A$(v$(o).row,new lW(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?A$(v$(o).row,new lW(t,n,r)).content:t);else return null;return vdt(o,s)}function vdt(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(rW.empty),n[i]<r){let a=v$(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(rW.from(o))}return{height:t.length,width:r,rows:t}}function A$(e,t){let n=e.createAndFill();return new WG(n).replace(0,n.content.size,t).doc}function ydt({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(T$(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(rW.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(rW.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function bdt(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=v$(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,rW.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function xdt(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function Sdt(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,T$(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(T$(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function Cdt(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=_$.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=_$.get(a),f=d.mapping.maps.length}bdt(d,o,a,n,l,u,f)&&p(),xdt(d,o,a,n,c,l,s,f)&&p(),xdt(d,o,a,n,c,l,u,f)&&p(),Sdt(d,o,a,n,s,u,c,f)&&p(),Sdt(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new lW(i.rows[e-s],0,0))}p(),d.setSelection(new E$(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var wdt=OY({ArrowLeft:M$(`horiz`,-1),ArrowRight:M$(`horiz`,1),ArrowUp:M$(`vert`,-1),ArrowDown:M$(`vert`,1),"Shift-ArrowLeft":N$(`horiz`,-1),"Shift-ArrowRight":N$(`horiz`,1),"Shift-ArrowUp":N$(`vert`,-1),"Shift-ArrowDown":N$(`vert`,1),Backspace:k$,"Mod-Backspace":k$,Delete:k$,"Mod-Delete":k$});function j$(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function M$(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof E$)return j$(n,r,KG.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=Odt(i,e,t);if(o==null)return!1;if(e==`horiz`)return j$(n,r,KG.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=Iut(i,e,t),s;return s=a?KG.near(a,1):t<0?KG.near(n.doc.resolve(i.before(-1)),-1):KG.near(n.doc.resolve(i.after(-1)),1),j$(n,r,s)}}}function N$(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof E$)o=a;else{let r=Odt(i,e,t);if(r==null)return!1;o=new E$(n.doc.resolve(r))}let s=Iut(o.$headCell,e,t);return s?j$(n,r,new E$(o.$anchorCell,s)):!1}}function Tdt(e,t){let n=e.state.doc,r=b$(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new E$(r))),!0):!1}function Edt(e,t,n){if(!x$(e.state))return!1;let r=_dt(n),i=e.state.selection;if(i instanceof E$){r||={width:1,height:1,rows:[rW.from(A$(v$(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=_$.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=ydt(r,o.right-o.left,o.bottom-o.top),Cdt(e.state,e.dispatch,a,o,r),!0}else if(r){let t=S$(e.state),n=t.start(-1);return Cdt(e.state,e.dispatch,n,_$.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function Ddt(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=kdt(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof E$)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=b$(e.state.selection.$anchor))!=null&&P$(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=P$(e,n),i=y$.getState(e.state)==null;if(!r||!w$(t,r))if(i)r=t;else return;let a=new E$(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(y$,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),y$.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(y$,-1))}function o(r){let o=r,s=y$.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(kdt(e,o.target)!=n&&(c=P$(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function Odt(e,t,n){if(!(e.state.selection instanceof XG))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function kdt(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function P$(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&b$(e.state.doc.resolve(r))||b$(e.state.doc.resolve(i))}var Adt=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),F$(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,F$(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function F$(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var I$=new fK(`tableColumnResizing`);function jdt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Adt,lastColumnResizable:i=!0}={}){let a=new lK({key:I$,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=v$(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new Mdt(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=I$.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{Ndt(t,n,e,i)},mouseleave:e=>{Pdt(e)},mousedown:(e,r)=>{Fdt(e,r,t,n)}},decorations:e=>{let t=I$.getState(e);if(t&&t.activeHandle>-1)return Wdt(e,t.activeHandle)},nodeViews:{}}});return a}var Mdt=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(I$);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return C$(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function Ndt(e,t,n,r){if(!e.editable)return;let i=I$.getState(e.state);if(i&&!i.dragging){let a=Ldt(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=Rdt(e,t,`left`,n):i-t.clientX<=n&&(o=Rdt(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=_$.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Bdt(e,o)}}}function Pdt(e){if(!e.editable)return;let t=I$.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Bdt(e,-1)}function Fdt(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=I$.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=Idt(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(I$,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=I$.getState(e.state);r?.dragging&&(Vdt(e,r.activeHandle,zdt(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(I$,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=I$.getState(e.state);if(i&&i.dragging){let a=zdt(i.dragging,t,n);Hdt(e,i.activeHandle,a,r)}}return Hdt(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function Idt(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function Ldt(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function Rdt(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=b$(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=_$.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function zdt(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Bdt(e,t){e.dispatch(e.state.tr.setMeta(I$,{setHandle:t}))}function Vdt(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=_$.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():Udt(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function Hdt(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=_$.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&F$(a,c.firstChild,c,r,s,n)}function Udt(e){return Array(e).fill(0)}function Wdt(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return eY.empty;let a=_$.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,I$.getState(e)?.dragging&&n.push(ZJ.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(ZJ.widget(s,c))}}return eY.create(e.doc,n)}function Gdt({allowTableNodeSelection:e=!1}={}){return new lK({key:y$,state:{init(){return null},apply(e,t){let n=e.getMeta(y$);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:But,handleDOMEvents:{mousedown:Ddt},createSelectionBetween(e){return y$.getState(e.state)==null?null:e.state.selection},handleTripleClick:Tdt,handleKeyDown:wdt,handlePaste:Edt},appendTransaction(t,n,r){return Uut(r,Kut(r,n),e)}})}function L$(e){return e===`left`||e===`right`||e===`center`?e:null}function Kdt(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return L$(t||n)}function qdt(e){return L$(e?.align)}function Jdt(){return{default:null,parseHTML:e=>Kdt(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var Ydt=cZ.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}},align:Jdt()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,dX(this.options.HTMLAttributes,e),0]}}),Xdt=cZ.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},align:Jdt()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,dX(this.options.HTMLAttributes,e),0]}}),Zdt=cZ.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,dX(this.options.HTMLAttributes,e),0]}});function R$(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function Qdt(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=R$(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=R$(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var $dt=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),Qdt(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,Qdt(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function eft(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=R$(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function tft(e,t){return t?e.createChecked(null,t):e.createAndFill()}function nft(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function rft(e,t,n,r,i){let a=nft(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=tft(a.cell,i);if(e&&s.push(e),r){let e=tft(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function ift(e){return e instanceof E$}var z$=({editor:e})=>{let{selection:t}=e.state;if(!ift(t))return!1;let n=0;return tX(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1};function aft(e){return(e||``).replace(/\s+/g,` `).trim()}function oft(e,t,n={}){let r=n.cellLineSeparator??`�`;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=aft(i),o=e.type===`tableHeader`,s=qdt(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array(a).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=` 772`,f=Array(a).fill(0).map((e,t)=>l&&c[t]&&c[t].text||``);return d+=`| ${f.map((e,t)=>s(e,o[t])).join(` | `)} | 773`,d+=`| ${o.map((e,t)=>{let n=Math.max(3,e),r=u[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} | 774`,(l?i.slice(1):i).forEach(e=>{d+=`| ${Array(a).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} | 775`}),d}var sft=oft,cft=cZ.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:$dt,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=eft(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,dX(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=L$(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=L$(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>sft(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=rft(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(XG.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>Yut(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>Xut(e,t),deleteColumn:()=>({state:e,dispatch:t})=>Qut(e,t),addRowBefore:()=>({state:e,dispatch:t})=>tdt(e,t),addRowAfter:()=>({state:e,dispatch:t})=>ndt(e,t),deleteRow:()=>({state:e,dispatch:t})=>idt(e,t),deleteTable:()=>({state:e,dispatch:t})=>gdt(e,t),mergeCells:()=>({state:e,dispatch:t})=>sdt(e,t),splitCell:()=>({state:e,dispatch:t})=>cdt(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>O$(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>O$(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>pdt(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>sdt(e,t)?!0:cdt(e,t),setCellAttribute:(e,t)=>
775({state:n,dispatch:r})=>udt(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>hdt(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>hdt(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Kut(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=E$.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:z$,"Mod-Backspace":z$,Delete:z$,"Mod-Delete":z$}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[jdt({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Gdt({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:e,view:n})=>new t(e,this.options.cellMinWidth,n)},extendNodeSchema(e){return{tableRole:sX(rX(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});HX.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(cft.configure(this.options.table)),this.options.tableCell!==!1&&e.push(Ydt.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(Xdt.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(Zdt.configure(this.options.tableRow)),e}});var lft=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,uft=cZ.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,dX(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>
775{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),c.src=o.src;let l=new Iot({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[tZ({find:lft,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}});function dft({editor:e}){if(!e)return null;let t=(e,t,n,r)=>(0,K.jsx)(J,{type:`button`,size:`sm`,variant:e?`default`:`ghost`,onClick:t,"aria-label":r,className:`h-7 w-7 p-0`,children:(0,K.jsx)(n,{className:`h-3.5 w-3.5`})});return(0,K.jsxs)(`div`,{className:`flex items-center gap-0.5 border-b bg-muted/30 px-2 py-1`,children:[t(e.isActive(`heading`,{level:1}),()=>e.chain().focus().toggleHeading({level:1}).run(),Roe,`Heading 1`),t(e.isActive(`heading`,{level:2}),()=>e.chain().focus().toggleHeading({level:2}).run(),zoe,`Heading 2`),t(e.isActive(`heading`,{level:3}),()=>e.chain().focus().toggleHeading({level:3}).run(),Boe,`Heading 3`),(0,K.jsx)(`span`,{className:`mx-1 h-4 w-px bg-border`}),t(e.isActive(`bold`),()=>e.chain().focus().toggleBold().run(),Qae,`Bold`),t(e.isActive(`italic`),()=>e.chain().focus().toggleItalic().run(),Voe,`Italic`),(0,K.jsx)(`span`,{className:`mx-1 h-4 w-px bg-border`}),t(e.isActive(`bulletList`),()=>e.chain().focus().toggleBulletList().run(),Xoe,`Bullet list`),t(e.isActive(`orderedList`),()=>e.chain().focus().toggleOrderedList().run(),Joe,`Ordered list`),t(e.isActive(`blockquote`),()=>e.chain().focus().toggleBlockquote().run(),use,`Blockquote`),(0,K.jsx)(`span`,{className:`mx-1 h-4 w-px bg-border`}),t(!1,()=>e.chain().focus().undo().run(),Ase,`Undo`),t(!1,()=>e.chain().focus().redo().run(),fse,`Redo`)]})}function fft({document:e}){let t=rR(e=>e.updateContent);rR(e=>e.pendingPatches),rR(e=>e.consumePatch);let n=RS()!==`viewer`;(0,B.useRef)(null);let r=(0,B.useRef)(null),i=Xst({extensions:[Out,cft.configure({resizable:!0}),Zdt,Xdt,Ydt,dlt,uft],content:e.content??{type:`doc`,content:[{type:`paragraph`}]},editable:n,immediatelyRender:!1,onUpdate:({editor:i})=>{if(!n)return;r.current&&clearTimeout(r.current);let a=i.getJSON();r.current=setTimeout(()=>{t(e.id,a)},1e3)}});return(0,B.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]),(0,B.useEffect)(()=>{if(i)return window.__applyFinancePatch=e=>{let t=e;try{if(t.op===`tiptap:setContent`&&t.payload)return i.commands.setContent(t.payload),!0;if(t.op===`tiptap:insertAt`&&typeof t.payload?.pos==`number`&&t.payload.content)return i.chain().focus().insertContentAt(t.payload.pos,t.payload.content).run(),!0}catch(e){console.error(`Failed to apply tiptap patch:`,e)}return!1},()=>{window.__applyFinancePatch=void 0}},[i]),i?(0,K.jsxs)(`div`,{className:`flex h-full flex-col`,children:[n&&(0,K.jsx)(dft,{editor:i}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto px-8 py-6`,children:(0,K.jsx)(Hst,{editor:i,className:`prose prose-sm max-w-none focus:outline-none [&_*]:outline-none`})})]}):(0,K.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`Loading editorâ¦`})}var pft=vU(()=>ev(()=>import(`./FinanceSpreadsheetEditor-3rgF2lnV.js`),__vite__mapDeps([4,1,2,3])));function mft({document:e}){return e.doc_type===`text`?(0,K.jsx)(fft,{document:e}):(0,K.jsx)(pft,{document:e})}function hft({task:e}){let[t,n]=(0,B.useState)({phase:`loading`}),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null);if((0,B.useEffect)(()=>{let t=!1;return z0e({email_task_id:e.id,per_page:50}).then(e=>{if(t)return;let r=e.data.items??[];n({phase:`loaded`,docs:r}),r.length>0&&i(r[0].id)}).catch(()=>{t||n({phase:`error`,message:`Failed to load generated documents`})}),()=>{t=!0}},[e.id]),(0,B.useEffect)(()=>
775{if(!r)return;let e=!1,t=r;return V0e(t).then(n=>{e||o({id:t,phase:`loaded`,doc:n.data})}).catch(()=>{e||o({id:t,phase:`error`,message:`Failed to load generated document`})}),()=>{e=!0}},[r]),t.phase===`loading`)return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,K.jsx)(W,{className:`h-4 w-4 animate-spin`}),`Loadingâ¦`]});if(t.phase===`error`)return(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.message});let s=t.docs;return s.length===0?(0,K.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No generated documents yet`})}):(0,K.jsxs)(`div`,{className:`flex flex-col h-full`,children:[s.length>1&&(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mb-3 shrink-0`,children:s.map(e=>(0,K.jsxs)(J,{size:`sm`,variant:e.id===r?`default`:`outline`,onClick:()=>i(e.id),className:`h-7 px-2.5 text-xs`,children:[(0,K.jsx)(`span`,{children:e.title}),(0,K.jsx)(`span`,{className:`ml-1.5 text-[10px] opacity-60`,children:e.doc_type})]},e.id))}),(0,K.jsx)(`div`,{className:`flex-1 min-h-0 overflow-hidden`,children:a&&a.id===r?a.phase===`loaded`?(0,K.jsx)(mft,{document:a.doc}):(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a.message}):(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,K.jsx)(W,{className:`h-4 w-4 animate-spin`}),`Loading documentâ¦`]})})]})}function gft({task:e}){let{t}=V(),n=e.needs_reply===!1,r=n?Qoe:__,i=t(n?`email.thread.no_reply_title`:`email.thread.no_draft_title`),a=n?e.no_reply_reason||t(`email.thread.no_reply_hint`):t(`email.thread.no_draft_hint`);return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-center`,children:[(0,K.jsx)(r,{className:`size-8 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:i}),(0,K.jsx)(`p`,{className:`max-w-xs text-sm text-muted-foreground`,children:a})]}),(0,K.jsx)(lz,{})]})}function _ft({onShowDraft:e}){let{t}=V(),n=Ux(e=>e.thread)?.last_message_from,r=n?(n.name&&n.name!==n.email?n.name:n.email)??null:null;return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-center`,children:[(0,K.jsx)(Qoe,{className:`size-8 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:t(`email.thread.already_responded_title`)}),r&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r}),(0,K.jsx)(`p`,{className:`max-w-xs text-sm text-muted-foreground`,children:t(`email.thread.already_responded_hint`)})]}),(0,K.jsx)(lz,{}),(0,K.jsx)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:e,children:t(`email.thread.view_draft_anyway`)})]})}function vft(){let e=Sv(),{t}=V(),n=Ux(e=>e.selectedDocumentId),r=Ux(e=>e.documents),i=Ux(e=>e.selectedTask),a=(0,B.useMemo)(()=>r.find(e=>e.document_id===n)??null,[r,n]);if(!a||a.is_latest_revision!==!1)return null;let o=a.superseded_by_task_id??null,s=a.superseded_by_document_id??null,c=!!o,l=a.revision_index??void 0,u=a.revision_count??void 0;return(0,K.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-amber-300 bg-amber-50 px-4 py-3 text-amber-900 dark:border-amber-900/40 dark:bg-amber-950/30 dark:text-amber-200`,children:[(0,K.jsx)(c_,{className:`mt-0.5 size-4 shrink-0`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:t(`email.thread.revision_superseded_title`)}),(0,K.jsx)(`p`,{className:`text-xs leading-relaxed`,children:t(`email.thread.revision_superseded_hint`,{index:l??`?`,count:u??`?`})})]}),c&&(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`outline`,className:`shrink-0 border-amber-400 bg-transparent text-amber-900 hover:bg-amber-100 dark:border-amber-700 dark:text-amber-100 dark:hover:bg-amber-900/40`,onClick:()=>{o===i?.id&&s?Ux.getState().selectDocument(s):o&&e(`/email-task?taskId=${o}${s?`&doc=${s}`:``}`)},children:[t(`email.thread.revision_go_to_latest`),(0,K.jsx)(Eg,{className:`ml-1 size-3.5`})]})]})}function yft(e){return e.name?`${e.name} â ${e.role}`:e.role}function bft(e){return e.name?`${e.name} (${e.role})`:e.role}function xft(){let e=Ux(e=>e.documents),t=Ux(e=>e.selectedDocumentId),n=Ux(e=>e.setDocumentSide),r=(0,B.useMemo)(()=>e.find(e=>e.document_id===t)??null,[e,t]);if(!r||r.is_contract!==!0||r.redline_party||!r.document_id)return null;let i=r.detected_parties??[];if(i.length===0)return null;let a=r.document_id,o=r.detected_our_side??null,s=o&&o.role?o.party_name?`${o.party_name} (${o.role})`:o.role:null;return(0,K.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-blue-300 bg-blue-50 px-4 py-3 text-blue-900 dark:border-blue-900/40 dark:bg-blue-950/30 dark:text-blue-200`,children:[(0,K.jsx)(q_,{className:`mt-0.5 size-4 shrink-0`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:o?.role?`We think you represent the ${o.role} side â confirm or change.`:`Which side do you represent?`}),(0,K.jsx)(`p`,{className:`text-xs leading-relaxed`,children:`Confirm your side and we'll re-run the analysis and redlines to argue your position.`})]}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map((e,t)=>{let r=bft(e);return(0,K.jsx)(J,{type:`button`,size:`sm`,variant:s===r?`default`:`outline`,className:`shrink-0`,onClick:()=>n(a,r),children:yft(e)},`side-${t}`)})})]})]})}function Sft(e,t=2e3){let n=(0,B.useRef)(e);(0,B.useEffect)(()=>{n.current=e});let r=e?y_e(e):null;(0,B.useEffect)(()=>
775{if(!r)return;let e=window.setTimeout(()=>{n.current&&Sx(n.current)},t);return()=>window.clearTimeout(e)},[r,t])}function B$(e){return{reasonKey:e,showAnalyzeButton:!1,showRedlineButton:!1,analyzableDocumentId:null}}function V$(e,t,n=!1){let r=t.document_id??null;return{reasonKey:e,showAnalyzeButton:!!r,showRedlineButton:n&&!!r,analyzableDocumentId:r}}function Cft(e,t,n){return n?n.reasonKey===`no_reply`?e.no_reply_reason??null:n.reasonKey===`skipped_by_gate`?t?.redline_gate?.reason??t?.suggestion_outcome_reason??null:null:null}function wft(e,t,n){return e.direction===`outbound`?B$(`outbound`):t?t.status===`pending`||t.status===`processing`?B$(`processing`):t.status===`failed`?B$(`doc_failed`):t.redline_gate?.decision===`skip`&&t.risk_analysis==null?V$(`skipped_by_gate`,t,!0):t.contract_detection?.source===`fallback`&&!t.risk_analysis?V$(`detection_failed`,t):t.risk_analysis===``?V$(`not_contract`,t):e.is_legal?e.intent===`draft`?V$(`draft_intent`,t):V$(`not_analyzed`,t):V$(`nonlegal`,t):n.some(e=>e.status===`pending`||e.status===`processing`)?B$(`processing`):n.length>0&&n.every(e=>e.status===`failed`)?B$(`doc_failed`):e.needs_reply===!1?B$(`no_reply`):e.category===`irrelevant`?B$(`irrelevant`):e.status===`pending`||e.status===`processing`?B$(`processing`):e.is_legal?e.attachments_restricted?B$(`attachments_restricted`):(e.unprocessed_attachments??[]).some(e=>e.can_process)&&e.provider!==`slack`?B$(`attachment_not_processed`):e.has_attachments?B$(`no_processable_attachments`):e.intent===`draft`?B$(`draft_intent`):B$(`no_attachments`):B$(`nonlegal`)}function Tft(e){let t=e?.suggestion_outcome??null;return t===`error`||t===`llm_unparseable`?{reasonKey:`generation_failed`,detail:e?.suggestion_outcome_reason??null,retrySide:e?.redline_party??null}:t===`partial`?{reasonKey:`partial`,detail:e?.suggestion_outcome_reason??null,retrySide:e?.redline_party??null}:t===`skipped`?{reasonKey:`skipped`,detail:e?.redline_gate?.reason??e?.suggestion_outcome_reason??null,retrySide:null}:t===`llm_declined`||t===`empty_document`?{reasonKey:`no_changes`,detail:e?.suggestion_outcome_reason??null,retrySide:null}:{reasonKey:`none`,detail:null,retrySide:null}}function Eft(e){return e.provider===`slack`}function H$(e){return e.category===`finance`}var Dft=[`response`,`analysis`,`redlines`],Oft=[`response`,`generated`],kft={evaluation:`analysis`};function U$(e,t){if(!e)return null;let n=kft[e]??e;return t.includes(n)?n:null}function Aft({task:e,draft:t,suggestions:n,onEnterRedline:r}){let{t:i}=V(),{documents:a,selectedDocumentId:o,thread:s,analyzingDocumentIds:c,analyzeDocument:l,redliningDocumentIds:u,redlineDocument:d}=Ux(),f=a.find(e=>e.document_id===o)??null,[p,m]=(0,B.useState)(!1),h=!!t&&t.status!==`sent`&&s?.last_message_direction===`outbound`;function g(){return t&&h&&!p?(0,K.jsx)(_ft,{onShowDraft:()=>m(!0)}):t?(0,K.jsx)(CU,{}):e.status===`processing`||e.status===`pending`?(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,K.jsx)(RI,{size:`lg`,label:i(`ai.activity.drafting_reply`)})}):(0,K.jsx)(gft,{task:e})}let _=f?f.risk_analysis??null:a.length===0?e.risk_analysis??null:null,v=null;v=f?f.status===`failed`?f.processing_error??null:null:e.status===`failed`?e.processing_error??null:null;let y=o??e.document_id??null,b=!_&&!v?wft(e,f,a):null,x=!!b?.analyzableDocumentId&&c.includes(b.analyzableDocumentId),S=Cft(e,f,b),C=Tft(f),w=a.find(e=>e.document_id===y)??null,T=w&&w.email_task_id===e.id?w:null,E=!w||w.filename.toLowerCase().endsWith(`.docx`)||!!w.has_redline_working_copy,D=f?.document_id??w?.document_id??null,O=!!D&&u.includes(D);function k(){D&&d(D)}let A=!!f&&!!_&&f.suggestion_outcome===`skipped`&&!f.suggestion_batch_id&&!!f.document_id,j=e.status===`processing`||e.status===`pending`||w?.status===`processing`||w?.status===`pending`||O,M=(()=>{let e=n.some(e=>e.status===`pending`);return t?.status===`sent`?`response`:e?`redlines`:t?.status===`ready`||t?.status===`in_drafts`||t?.status===`sent`?`response`:_||v?`analysis`:`response`}
775)(),[N]=Jv(),P=N.get(`tab`),F=H$(e)?Oft:Dft,[I,L]=(0,B.useState)(()=>U$(P,F)||(H$(e)?`generated`:M)),[ee,R]=(0,B.useState)(()=>U$(P,F)?`deeplink`:`landing`);function te(e){L(e),R(`click`)}let ne=`${P??``}::${e.id}`,[re,ie]=(0,B.useState)(ne);if(ne!==re){ie(ne),m(!1);let e=U$(P,F);e&&L(e),R(e?`deeplink`:`landing`)}return Sft(I===`analysis`||I===`redlines`?{event_type:I===`analysis`?`email_analysis_viewed`:`email_redlines_viewed`,surface:`email`,email_task_id:e.id,document_id:y,batch_id:w?.suggestion_batch_id??null,metadata:{trigger:ee}}:null),H$(e)?(0,K.jsxs)(bV,{value:I,onValueChange:L,className:`flex flex-col h-full`,children:[(0,K.jsxs)(xV,{className:`w-full shrink-0 rounded-none border-b justify-start h-auto p-0 bg-transparent`,children:[(0,K.jsx)(SV,{value:`response`,className:`rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2 text-sm`,children:i(`email.tabs.response`)}),(0,K.jsx)(SV,{value:`generated`,className:`rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2 text-sm`,children:i(`email.tabs.generated`)})]}),(0,K.jsx)(CV,{value:`response`,className:`flex-1 overflow-y-auto p-4 mt-0`,children:g()}),(0,K.jsx)(CV,{value:`generated`,className:`flex-1 overflow-hidden p-4 mt-0`,children:(0,K.jsx)(hft,{task:e},e.id)})]}):(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,K.jsx)(vft,{}),(0,K.jsx)(xft,{}),(0,K.jsxs)(bV,{value:I,onValueChange:te,className:`flex min-h-0 flex-1 flex-col`,children:[(0,K.jsxs)(xV,{className:`w-full shrink-0 rounded-none border-b justify-start h-auto p-0 bg-transparent`,children:[(0,K.jsx)(SV,{value:`response`,className:`rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2 text-sm`,children:i(`email.tabs.response`)}),(0,K.jsx)(SV,{value:`analysis`,className:`rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2 text-sm`,children:i(`email.tabs.analysis`)}),(0,K.jsxs)(SV,{value:`redlines`,className:`rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2 text-sm`,children:[i(`email.tabs.redlines`),n.filter(e=>e.status===`pending`).length>0&&(0,K.jsx)(`span`,{className:`ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary`,children:n.filter(e=>e.status===`pending`).length})]}),T&&(I===`analysis`||I===`redlines`)&&(0,K.jsx)(`span`,{className:`ml-auto self-center pr-2`,children:(0,K.jsx)(mO,{subject:{type:`email_task_document`,id:T.id,label:i(`report_issue.email_attachment`,{filename:Ab(T.original_filename)})}})})]}),(0,K.jsx)(CV,{value:`response`,className:`flex-1 overflow-y-auto p-4 mt-0`,children:g()}),(0,K.jsx)(CV,{value:`analysis`,className:`flex-1 overflow-y-auto p-4 mt-0`,children:(0,K.jsx)(rtt,{riskAnalysis:_,emailAnalysis:e.email_analysis??null,processingError:v,reason:b,reasonDetail:S,isAnalyzing:x,onAnalyze:l,showRedlineButton:A||!!b?.showRedlineButton,isRedlining:O,redlineCapable:E,onRedline:k})}),(0,K.jsx)(CV,{value:`redlines`,className:`mt-0 flex min-h-0 flex-1 flex-col overflow-hidden`,children:(0,K.jsx)(Mtt,{documentId:y,reason:C,redlineCapable:E,isGenerating:!!j,hasAnalysis:!!w?.risk_analysis,onEnterRedline:r,onRedline:k})})]})]})}function jft(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Mft({task:e,onBack:t,onDismiss:n}){let r=e.slack_channel_name,i=e.slack_message_source,a=i===`user_dm`||i===`bot_dm`||i===`forwarded`;return(0,K.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 p-3 border-b shrink-0`,children:[(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:t,children:(0,K.jsx)(Tg,{className:`h-4 w-4`})}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[a?(0,K.jsx)(b_,{className:`h-4 w-4 text-muted-foreground shrink-0`}):(0,K.jsx)(Loe,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,K.jsx)(`h3`,{className:`text-sm font-medium truncate`,children:a?`DM from ${e.from_name||e.from_email}`:r?`#${r}`:e.subject||`(Slack message)`})]}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.from_name||e.from_email,e.received_at?` · ${jft(e.received_at)}`:``]})]}),(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>n(e.id),children:[(0,K.jsx)(Gg,{className:`h-4 w-4 mr-1`}),` Dismiss`]})]}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:e.body?(0,K.jsx)(`div`,{className:`rounded-md border bg-muted/30 p-3`,children:(0,K.jsx)(`p`,{className:`text-sm whitespace-pre-wrap break-words`,children:e.body})}):(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground italic`,children:`No message text`})})]})}function Nft({task:e,draft:t,suggestions:n,onEnterRedline:r}){let{t:i}=V();return(e.documents??[]).some(e=>e.status===`completed`)?(0,K.jsx)(Aft,{task:e,draft:t,suggestions:n,onEnterRedline:r}):(0,K.jsx)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:t?(0,K.jsx)(CU,{isSlack:!0}):(0,K.jsx)(`div`,{className:`flex items-center justify-center h-full text-sm text-muted-foreground`,children:e.status===`processing`?(0,K.jsx)(RI,{label:i(`ai.activity.generating_reply`)}):`No draft available`})})})}function Pft({task:e}){let{t}=V(),n=e.needs_reply===!1,r=t(n?`email.thread.no_reply_title`:`email.thread.completed`),i=n?e.no_reply_reason||t(`email.thread.no_reply_hint`):t(`email.thread.completed_hint`);return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,K.jsx)(Ug,{className:`size-9 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:r}),(0,K.jsx)(`p`,{className:`max-w-xs text-sm text-muted-foreground`,children:i})]}),(0,K.jsx)(lz,{})]})}function Fft({task:e,draft:t,suggestions:n,onBack:r,onDismiss:i,onEnterRedline:a}){let o=Eft(e),s=Ux(e=>e.thread?.is_resolved??!1);return(0,K.jsxs)(`div`,{className:`flex h-full overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`w-1/2 flex flex-col border-r overflow-hidden`,children:o?(0,K.jsx)(Mft,{task:e,onBack:r,onDismiss:i}):(0,K.jsx)(Xet,{task:e,onDismiss:i})}),(0,K.jsx)(`div`,{className:`w-1/2 flex flex-col overflow-hidden`,children:s?(0,K.jsx)(Pft,{task:e}):o?(0,K.jsx)(Nft,{task:e,draft:t,suggestions:n,onEnterRedline:a}):(0,K.jsx)(Aft,{task:e,draft:t,suggestions:n,onEnterRedline:a})})]})}function Ift({className:e,...t}){return(0,K.jsx)(W,{role:`status`,"aria-label":`Loading`,className:q(`size-4 animate-spin`,e),...t})}function Lft({...e}){return(0,K.jsx)(GOe,{"data-slot":`hover-card`,...e})}function Rft({...e}){return(0,K.jsx)(KOe,{"data-slot":`hover-card-trigger`,...e})}function zft({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,K.jsx)(qOe,{"data-slot":`hover-card-portal`,children:(0,K.jsx)(JOe,{"data-slot":`hover-card-content`,align:t,sideOffset:n,className:q(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
775de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden`,e),...r})})}function Bft(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`?`:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function Vft({run:e,onAccept:t,onReject:n,hoveredCommentId:r,hoveredChangeId:i,onHoverComment:a,onHoverChange:o,selectedChangeIds:s,myAuthorNames:c,toolChangeIds:l}){let{t:u}=V(),{formatDate:d}=jb(),f=Ex(e=>e.isApplying),p=e.comment_id!=null&&e.comment_id===r,m=e.change_id!=null&&e.change_id===i,h=e.change_id!=null&&(s?.has(e.change_id)??!1),g=m||h;if(e.type===`text`)return e.comment_id==null?(0,K.jsx)(`span`,{children:e.text}):(0,K.jsx)(`span`,{className:`border-b cursor-pointer transition-colors ${p?`bg-amber-200 border-amber-400`:`bg-amber-100 border-amber-300`}`,title:u(`redline.comments`),onMouseEnter:()=>a?.(e.comment_id),onMouseLeave:()=>a?.(null),children:e.text});let _=e.type===`ins`,v=_?`bg-green-100 text-green-800 underline decoration-green-400`:`bg-red-50 text-red-500 line-through decoration-red-400`,y=!!e.author&&(c?.includes(e.author)??!1),b=e.change_id!=null&&(l?.has(e.change_id)??!1),x=u(_?`redline.insertion`:`redline.deletion`),S;if(y)S=u(b?`redline.suggested_by_tool`:`redline.your_change`);else{let t=e.author||u(`redline.unknown_author`);S=e.date?u(`redline.change_meta_with_date`,{type:x,author:t,date:d(e.date)}):u(`redline.change_meta`,{type:x,author:t})}let C=g?`ring-2 ring-yellow-400 bg-yellow-100`:y?`ring-1 ring-violet-300`:``,w=y?(0,K.jsx)(`span`,{className:`mr-0.5 select-none text-violet-500 no-underline`,"aria-hidden":!0,children:`â¦`}):e.author?(0,K.jsx)(`span`,{className:`mr-0.5 inline-flex select-none items-center rounded bg-gray-200 px-1 align-middle text-[9px] font-semibold text-gray-600 no-underline`,title:e.author,children:Bft(e.author)}):null;return e.change_id==null?(0,K.jsxs)(`span`,{className:`${v} rounded-sm px-0.5 ${C}`,title:S,children:[w,e.text]}):(0,K.jsxs)(Lft,{openDelay:100,closeDelay:150,children:[(0,K.jsx)(Rft,{asChild:!0,children:(0,K.jsxs)(`span`,{className:`${v} cursor-pointer rounded-sm px-0.5 ${C}`,title:S,onMouseEnter:()=>o?.(e.change_id),onMouseLeave:()=>o?.(null),children:[w,e.text]})}),(0,K.jsxs)(zft,{side:`top`,align:`start`,sideOffset:2,className:`flex w-auto gap-0.5 rounded border border-gray-200 bg-white p-0.5 shadow-md`,children:[(0,K.jsx)(`button`,{onClick:e=>{e.stopPropagation(),t?.()},disabled:f,className:`rounded p-0.5 text-green-600 hover:bg-green-100 disabled:opacity-50`,title:u(`redline.accept`),children:(0,K.jsx)(Lg,{size:14})}),(0,K.jsx)(`button`,{onClick:e=>{e.stopPropagation(),n?.()},disabled:f,className:`rounded p-0.5 text-red-600 hover:bg-red-50 disabled:opacity-50`,title:u(`redline.reject`),children:(0,K.jsx)(J_,{size:14})})]})]})}function Hft({paragraph:e,onAction:t,onManualEdit:n,isApplying:r,hoveredCommentId:i,hoveredChangeId:a,onHoverComment:o,onHoverChange:s,previewSuggestions:c,previewStruck:l=!1,hoveredSuggestionId:u,onHoverSuggestion:d,isSuggestionTarget:f=!1,isCommentTarget:p=!1,selectedChangeIds:m,myAuthorNames:h,toolChangeIds:g}){let _=e.runs.some(e=>e.type!==`text`),v=e.runs.filter(e=>e.type!==`del`).map(e=>e.text).join(``),[y,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(``),C=c??[],w=!y&&C.length>0?ftt(e.runs,C):null,T=e.style?.startsWith(`Heading`)?e.style===`Heading 1`?`text-xl font-bold mt-4`:e.style===`Heading 2`?`text-lg font-semibold mt-3`:`text-base font-medium mt-2`:``,E=f?`rounded-sm bg-blue-50/60 ring-2 ring-blue-300`:p?`rounded-sm bg-amber-50/60 ring-2 ring-amber-300`:``,D=l&&!y?`line-through decoration-red-400 decoration-2 text-red-500/70 bg-red-50/40 rounded-sm`:``,O=()=>{S(v),b(!0)},k=()=>{b(!1),S(``)},A=async()=>{let t=x.trim();if(!t||t===v){k();return}await n(e.paragraph_index,t),k()};return(0,K.jsx)(`div`,{id:`para-${e.paragraph_index}`,className:`group ${T}`,children:(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex-1 py-1 ${_?`border-l-2 border-blue-300 pl-3`:`pl-4`} ${E} ${D}`,children:[!y&&e.number_source===`numbering`&&e.number&&(0,K.jsx)(`span`,{className:`select-none mr-2 text-muted-foreground`,"aria-hidden":!0,
775children:e.number}),y?(0,K.jsx)(Wft,{value:x,onChange:S,onCancel:k,onSave:A,isSaving:r}):w?(0,K.jsx)(K.Fragment,{children:w.segments.map(e=>e.kind===`run`?(0,K.jsx)(Vft,{run:e.run,hoveredCommentId:i,hoveredChangeId:a,onHoverComment:o,onHoverChange:s,selectedChangeIds:m,myAuthorNames:h,toolChangeIds:g,onAccept:e.run.change_id==null?void 0:()=>t(e.run.change_id,`accept`),onReject:e.run.change_id==null?void 0:()=>t(e.run.change_id,`reject`)},`run-${e.runIndex}`):e.pieces.map((t,n)=>(0,K.jsx)(Uft,{piece:t,hoveredSuggestionId:u,onHoverSuggestion:d},`piece-${e.runIndex}-${n}`)))}):(0,K.jsxs)(K.Fragment,{children:[e.runs.map((e,n)=>(0,K.jsx)(Vft,{run:e,hoveredCommentId:i,hoveredChangeId:a,onHoverComment:o,onHoverChange:s,selectedChangeIds:m,myAuthorNames:h,toolChangeIds:g,onAccept:e.change_id==null?void 0:()=>t(e.change_id,`accept`),onReject:e.change_id==null?void 0:()=>t(e.change_id,`reject`)},n)),e.runs.length===0&&(0,K.jsx)(`span`,{className:`text-gray-300`,children:`\xA0`})]})]}),!y&&(0,K.jsx)(`button`,{type:`button`,onClick:_?void 0:O,disabled:_,title:_?`Accept or reject existing changes first.`:`Edit paragraph`,className:`mt-1 h-6 w-6 shrink-0 rounded text-gray-400 opacity-0 transition-opacity group-hover:opacity-100 ${_?`cursor-not-allowed`:`hover:bg-gray-100 hover:text-gray-700`}`,children:(0,K.jsx)(w_,{size:12,className:`mx-auto`})})]})})}function Uft({piece:e,hoveredSuggestionId:t,onHoverSuggestion:n}){if(e.kind===`text`)return(0,K.jsx)(`span`,{children:e.text});let r=e.suggestionId!=null&&e.suggestionId===t;return(0,K.jsx)(`span`,{className:`rounded-sm px-0.5 ${e.kind===`del`?`text-red-500 line-through decoration-red-400 decoration-dashed bg-red-50/60`:`text-green-700 underline decoration-green-400 decoration-dashed bg-green-50/60`} ${r?`ring-2 ring-yellow-400 bg-yellow-100`:``}`,onMouseEnter:()=>e.suggestionId&&n?.(e.suggestionId),onMouseLeave:()=>n?.(null),children:e.text})}function Wft({value:e,onChange:t,onCancel:n,onSave:r,isSaving:i}){return(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(`textarea`,{value:e,onChange:e=>t(e.target.value),autoFocus:!0,rows:Math.max(3,e.split(` 776`).length+1),className:`w-full rounded border border-blue-300 bg-blue-50/30 px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-400`}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,K.jsx)(`button`,{onClick:n,disabled:i,className:`rounded px-2 py-0.5 text-xs text-muted-foreground hover:bg-muted disabled:opacity-50`,children:`Cancel`}),(0,K.jsx)(`button`,{onClick:r,disabled:i,className:`rounded bg-blue-500 px-2 py-0.5 text-xs text-white hover:bg-blue-600 disabled:opacity-50`,children:i?`Saving...`:`Save`})]})]})}function Gft({paragraphs:e,onAction:t,onBatchAction:n,onHoverChange:r,onScrollToChange:i,hoveredChangeId:a,myAuthorNames:o,toolChangeIds:s}){let{t:c}=V(),l=Nx(e=>NU(e.user)),u=Ex(e=>e.reattributeAuthorAction),d=Ex(e=>e.isApplying),f=[];for(let t of e)for(let e of t.runs)e.type!==`text`&&e.change_id!=null&&f.push({changeId:e.change_id,type:e.type,text:e.text,author:e.author||`Unknown`,paragraphIndex:t.paragraph_index,label:t.label??null});if(f.length===0)return(0,K.jsx)(uz,{className:`rounded-lg py-0 gap-0`,children:(0,K.jsx)(mz,{className:`px-3 py-3 text-center text-sm text-muted-foreground`,children:`No tracked changes`})});let p=new Map;for(let e of f){let t=p.get(e.author)||[];t.push(e),p.set(e.author,t)}return(0,K.jsx)(uz,{className:`rounded-lg py-0 gap-0`,children:(0,K.jsx)(mz,{className:`px-2 py-2`,children:(0,K.jsxs)(PI,{defaultOpen:!0,className:`data-[state=open]:bg-muted/30 rounded-md`,children:[(0,K.jsx)(FI,{asChild:!0,children:(0,K.jsxs)(J,{variant:`ghost`,className:`group w-full justify-between text-sm font-medium h-8 px-2`,children:[`Changes (`,f.length,`)`,(0,K.jsx)(Rg,{size:14,className:`transition-transform group-data-[state=open]:rotate-180`})]})}),(0,K.jsxs)(II,{className:`px-2 pb-2 pt-1`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex gap-2`,children:[(0,K.jsxs)(`button`,{onClick:()=>n(`accept`),disabled:d,className:`flex items-center gap-1 rounded bg-green-100 px-2 py-1 text-xs font-medium text-green-700 hover:bg-green-200 disabled:opacity-50`,children:[(0,K.jsx)(Lg,{size:12}),`Accept All`]}),(0,K.jsxs)(`button`,{onClick:()=>n(`reject`),disabled:d,className:`flex items-center gap-1 rounded bg-red-100 px-2 py-1 text-xs font-medium text-red-700 hover:bg-red-200 disabled:opacity-50`,children:[(0,K.jsx)(J_,{size:12}),`Reject All`]})]}),Array.from(p.entries()).map(([e,n])=>(0,K.jsxs)(`div`,{className:`mb-2`,children:[(0,K.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:[e,` (`,n.length,`)`]}),!!l&&e!==l&&(0,K.jsx)(`button`,{onClick:()=>{window.confirm(c(`redline.reattribute_confirm`,{from:e,to:l}))&&u(e)},disabled:d,title:c(`redline.reattribute_hint`),className:`shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium text-violet-600 hover:bg-violet-50 disabled:opacity-50`,children:c(`redline.reattribute_to`,{name:l})})]}),(0,K.jsx)(`div`,{className:`space-y-1`,children:n.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded px-2 py-1 text-xs cursor-pointer hover:bg-muted ${e.changeId===a?`bg-yellow-100 ring-2 ring-yellow-400`:`bg-muted/50`}`,onMouseEnter:()=>r(e.changeId),onMouseLeave:()=>r(null),onClick:()=>i(e.paragraphIndex),children:[(0,K.jsxs)(`span`,{className:`truncate`,children:[(0,K.jsx)(`span`,{className:e.type===`ins`?`text-green-600`:`text-red-500`,children:e.type===`ins`?`+`:`-`}),` `,(!!e.author&&(o?.includes(e.author)??!1)||(s?.has(e.changeId)??!1))&&(0,K.jsx)(`span`,{className:`mr-0.5 text-violet-500`,title:c(`redline.modinsight_change`),"aria-hidden":!0,
776children:`â¦`}),e.label?`${e.label}: `:``,e.text.slice(0,40),e.text.length>40?`...`:``]}),(0,K.jsxs)(`span`,{className:`flex shrink-0 gap-0.5`,children:[(0,K.jsx)(`button`,{onClick:n=>{n.stopPropagation(),t(e.changeId,`accept`)},disabled:d,className:`rounded p-0.5 text-green-600 hover:bg-green-200 disabled:opacity-50`,children:(0,K.jsx)(Lg,{size:12})}),(0,K.jsx)(`button`,{onClick:n=>{n.stopPropagation(),t(e.changeId,`reject`)},disabled:d,className:`rounded p-0.5 text-red-600 hover:bg-red-100 disabled:opacity-50`,children:(0,K.jsx)(J_,{size:12})})]})]},e.changeId))})]},e))]})]})})})}function Kft({comment:e,locationLabel:t,isHovered:n,isSelected:r=!1,onHover:i,onLeave:a,onNavigate:o}){let{t:s}=V(),{formatDate:c}=jb(),l=e.paragraph_index!=null&&o!=null,u=()=>{l&&o(e)};return(0,K.jsx)(uz,{className:`rounded-lg py-0 gap-0 transition-colors ${r?`border-amber-400 bg-amber-200 ring-1 ring-amber-400`:n?`border-amber-300 bg-amber-100`:`border-amber-200 bg-amber-50`} ${l?`cursor-pointer`:``}`,onMouseEnter:i,onMouseLeave:a,...l?{role:`button`,tabIndex:0,title:s(`redline.go_to_provision`),"aria-label":s(`redline.go_to_provision`),onClick:u,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u())}}:{},children:(0,K.jsxs)(mz,{className:`flex items-start gap-2 px-3 py-2 text-sm`,children:[(0,K.jsx)(b_,{size:14,className:`mt-0.5 shrink-0 text-amber-600`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`font-medium text-amber-800`,children:e.author}),e.date&&(0,K.jsx)(`span`,{className:`ml-2 text-xs text-amber-500`,children:c(e.date)}),t&&(0,K.jsx)(`p`,{className:`mt-0.5 text-xs text-amber-600/80`,children:t}),(0,K.jsx)(`p`,{className:`mt-0.5 text-amber-700`,children:e.text})]})]})})}function qft({comments:e,paragraphs:t,hoveredCommentId:n,onHoverComment:r,onNavigate:i,selectedCommentId:a}){let o=e=>e.paragraph_index==null?null:t.find(t=>t.paragraph_index===e.paragraph_index)?.label??null;return(0,K.jsx)(uz,{className:`rounded-lg py-0 gap-0 mt-3`,children:(0,K.jsx)(mz,{className:`px-3 py-2 text-sm font-medium`,children:(0,K.jsxs)(PI,{children:[(0,K.jsx)(FI,{asChild:!0,children:(0,K.jsxs)(J,{variant:`ghost`,className:`group w-full justify-between text-sm font-medium h-8 px-2`,children:[`Comments (`,e.length,`)`,(0,K.jsx)(Rg,{size:14,className:`transition-transform group-data-[state=open]:rotate-180`})]})}),(0,K.jsx)(II,{className:`space-y-1.5 pt-1`,children:e.map(e=>(0,K.jsx)(Kft,{comment:e,locationLabel:o(e),isHovered:e.comment_id===n,isSelected:e.comment_id===a,onHover:()=>r(e.comment_id),onLeave:()=>r(null),onNavigate:i},e.comment_id))})]})})})}function Jft(){let{t:e}=V(),{formatDateTime:t}=jb(),{versions:n,activeVersionId:r,switchVersion:i,createVersion:a,isCreatingVersion:o,isLoading:s}=Ex(),[c,l]=(0,B.useState)(``),u=async()=>{await a(c||void 0),l(``)},d=t=>{let n=t.label||`v${t.version_number}`;window.confirm(e(`redline.switch_confirm`,{version:n}))&&i(t.id)};return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:e(`redline.save_version_placeholder`),className:`flex-1 rounded border border-gray-200 px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-blue-300`,onKeyDown:e=>e.key===`Enter`&&u()}),(0,K.jsxs)(`button`,{onClick:u,disabled:o,className:`flex items-center gap-1 rounded bg-blue-500 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-600 disabled:opacity-50`,children:[o?(0,K.jsx)(W,{size:12,className:`animate-spin`}):(0,K.jsx)(O_,{size:12}),e(`common.save`)]})]}),n.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center py-6 text-center`,children:[(0,K.jsx)(Poe,{className:`mb-2 h-8 w-8 text-gray-300`}),(0,K.jsx)(`p`,{className:`text-sm text-gray-500`,children:e(`redline.no_versions`)})]}):(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(`div`,{className:`absolute left-3 top-0 bottom-0 w-px bg-gray-200`}),(0,K.jsx)(`div`,{className:`space-y-0`,children:[...n].reverse().map(n=>{let i=n.id===r;return(0,K.jsxs)(`button`,{onClick:()=>d(n),disabled:s||i,className:`relative flex w-full items-start gap-3 rounded px-2 py-2.5 text-left transition-colors ${i?`bg-blue-50`:`hover:bg-gray-50`}`,children:[(0,K.jsx)(`div`,{className:`relative z-10 mt-0.5 h-2.5 w-2.5 shrink-0 rounded-full border-2 ${i?`border-blue-500 bg-blue-500`:`border-gray-300 bg-white`}`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium ${i?`text-blue-700`:`text-gray-700`}`,children:n.label||`v${n.version_number}`}),i&&(0,K.jsx)(`span`,{className:`rounded bg-blue-100 px-1.5 py-0.5 text-[10px] font-medium text-blue-600`,children:e(`org.switcher.current`)})]}),(0,K.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-gray-400`,children:[(0,K.jsx)(`span`,{children:t(n.created_at)}),n.tracked_change_count>0&&(0,K.jsxs)(`span`,{children:[e(`redline.changes`),`: `,n.tracked_change_count]})]}),n.change_summary&&(0,K.jsx)(`p`,{className:`mt-0.5 text-xs text-gray-500 truncate`,children:n.change_summary})]})]},n.id)})})]})]})}function Yft({paragraphs:e,comments:t,onAction:n,onBatchAction:r,onHoverChange:i,onHoverComment:a,hoveredChangeId:o,hoveredCommentId:s,onScrollToChange:c,suggestionController:l,hideChatTab:u=!1,onSelectSuggestion:d,onHoverSuggestion:f,hoveredSuggestionId:p,isDocPreviewOn:m,onToggleDocPreview:h,onNavigateComment:g,selectedCommentId:_,myAuthorNames:v,toolChangeIds:y}){let{t:b}=V(),x=Ex(e=>e.documentId),S=Ex(e=>e.isEmbedded),{rows:C,noSuggestionsReason:w,isSuggesting:T,streamStatus:E,onRequest:D}=l,O=E===`streaming`,k=O||T,A=C.filter(e=>
776e.status===`pending`).length,[j,M]=(0,B.useState)(u?`suggestions`:`changes`),[N,P]=(0,B.useState)(``),[F,I]=(0,B.useState)({}),[L,ee]=(0,B.useState)(A);return L!==A&&(ee(A),L===0&&A>0&&M(`suggestions`)),(0,K.jsxs)(bV,{value:j,onValueChange:e=>M(e),className:`flex h-full flex-col gap-0 overflow-hidden bg-white`,children:[(0,K.jsxs)(xV,{variant:`line`,className:`w-full justify-start border-b border-gray-200 `,children:[(0,K.jsxs)(SV,{value:`changes`,className:`text-xs`,children:[(0,K.jsx)(Yoe,{size:12}),(0,K.jsx)(`span`,{children:`Changes`})]}),(0,K.jsxs)(SV,{value:`comments`,className:`text-xs`,children:[(0,K.jsx)(x_,{size:12}),(0,K.jsx)(`span`,{children:`Comments`}),t.length>0&&(0,K.jsx)(`span`,{className:`ml-0.5 rounded-full bg-gray-100 px-1.5 text-[10px] text-gray-600`,children:t.length})]}),!u&&(0,K.jsxs)(SV,{value:`chat`,className:`text-xs`,children:[(0,K.jsx)(b_,{size:12}),(0,K.jsx)(`span`,{children:`Chat`})]}),(0,K.jsxs)(SV,{value:`suggestions`,className:`text-xs`,children:[(0,K.jsx)(p_,{size:12}),(0,K.jsx)(`span`,{children:`Suggestions`}),A>0&&(0,K.jsx)(`span`,{className:`ml-0.5 rounded-full bg-blue-100 px-1.5 text-[10px] text-blue-600`,children:A})]}),(0,K.jsxs)(SV,{value:`versions`,className:`text-xs`,children:[(0,K.jsx)(c_,{size:12}),(0,K.jsx)(`span`,{children:`Versions`})]})]}),(0,K.jsx)(CV,{value:`changes`,className:`flex-1 overflow-auto p-3`,children:(0,K.jsx)(Gft,{paragraphs:e,onAction:n,onBatchAction:r,onHoverChange:i,hoveredChangeId:o,onScrollToChange:c,myAuthorNames:v,toolChangeIds:y})}),(0,K.jsx)(CV,{value:`comments`,className:`flex-1 overflow-auto p-3`,children:(0,K.jsx)(qft,{comments:t,paragraphs:e,hoveredCommentId:s,onHoverComment:a,onNavigate:g,selectedCommentId:_})}),!u&&(0,K.jsxs)(CV,{value:`chat`,className:`flex flex-1 flex-col overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,K.jsx)(ZI,{className:`h-full`})}),(0,K.jsx)(QI,{className:`mx-2 mb-1 shrink-0`}),(0,K.jsx)(`div`,{className:`shrink-0 border-t border-gray-200 px-2 py-1`,children:(0,K.jsx)(jP,{})})]}),(0,K.jsxs)(CV,{value:`suggestions`,className:`flex flex-1 flex-col overflow-hidden`,children:[D&&(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-3 py-3`,children:[(0,K.jsx)(`input`,{type:`text`,value:N,onChange:e=>P(e.target.value),placeholder:b(`redline.suggest_placeholder`),className:`flex-1 rounded border border-gray-200 px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-blue-300`}),(0,K.jsx)(EU,{value:F,onChange:I,excludeDocumentId:x,disabled:k}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>D?.(N||void 0,F),disabled:k,className:`flex items-center gap-1 rounded bg-purple-500 px-2 py-1 text-xs font-medium text-white hover:bg-purple-600 disabled:opacity-50`,children:[k?(0,K.jsx)(W,{size:12,className:`animate-spin`}):(0,K.jsx)(p_,{size:12}),b(`redline.suggest`)]})]}),k&&C.length===0&&(0,K.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,K.jsx)(RI,{size:`lg`,label:b(`redline.generating_suggestions`)})}),!k&&C.length===0&&w&&D&&(0,K.jsx)(`div`,{className:`overflow-auto px-3 pb-3`,children:(0,K.jsx)(uz,{className:`mt-3 border-l-4 border-l-amber-400 bg-amber-50/30`,children:(0,K.jsxs)(mz,{className:`flex flex-col gap-2 py-3 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-amber-900`,children:[(0,K.jsx)(H_,{className:`h-4 w-4`}),b(`redline.no_suggestions_generated`)]}),(0,K.jsx)(`p`,{className:`text-amber-800`,children:w}),(0,K.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>D?.(),children:b(`redline.try_again`)})]})})}),!k&&C.length===0&&!w&&(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center`,children:[(0,K.jsx)(p_,{className:`mb-2 h-8 w-8 text-gray-300`}),(0,K.jsx)(`p`,{className:`text-sm text-gray-500`,children:b(u?`redline.no_suggestions_yet_embedded`:`redline.no_suggestions_yet_chat`)})]}),C.length>0&&(0,K.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,K.jsx)(YU,{controller:l,isStreaming:O,onSelectRow:d,onHoverRow:f,hoveredRowId:p,onScrollToParagraph:c,isDocPreviewOn:m,onToggleDocPreview:h,surface:S?`email`:`vault`},x??`no-doc`)})]}),(0,K.jsx)(CV,{value:`versions`,className:`flex-1 overflow-auto p-3`,children:(0,K.jsx)(Jft,{})})]})}const Xft=()=>`/api/v1/document-categories`,Zft=async e=>Z(Xft(),{...e,method:`GET`}),Qft=()=>`/api/v1/document-categories`,$ft=async(e,t)=>Z(Qft(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),ept=e=>`/api/v1/document-categories/${e}`,tpt=async(e,t,n)=>Z(ept(e),{...n,method:`PUT`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),npt=e=>`/api/v1/document-categories/${e}`,rpt=async(e,t)=>Z(npt(e),{...t,method:`DELETE`}),W$=[{key:`nda`,Icon:I_},{key:`msa`,Icon:boe},{key:`saas`,Icon:uoe},{key:`sow`,Icon:m_},{key:`employment`,Icon:G_},{key:`lease`,Icon:noe},{key:`license`,Icon:d_},{key:`dpa`,Icon:moe},{key:`purchase`,Icon:vse},{key:`other`,Icon:koe}];new Set(W$.map(e=>e.key));const ipt=z_;
776function apt(e){return e.split(`-`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function G$(e,t=[],n=e=>e){if(!e)return``;if(W$.find(t=>t.key===e))return n(`document_categories.builtin_labels.${e}`);let r=t.find(t=>t.key===e);return r?r.name:apt(e)}function K$(e){let t=e?W$.find(t=>t.key===e):void 0;return t?t.Icon:ipt}const q$=Pb((e,t)=>({categories:[],isLoading:!1,fetchCategories:async()=>{e({isLoading:!0});try{e({categories:(await Zft()).data,isLoading:!1})}catch(t){X(t,{operation:`fetch_document_categories`}),e({isLoading:!1})}},createCategory:async t=>{let n=(await $ft(t)).data;return e(e=>({categories:[...e.categories,n]})),n},updateCategory:async(t,n)=>{let r=(await tpt(t,n)).data;e(e=>({categories:e.categories.map(e=>e.id===t?r:e)}))},deleteCategory:async t=>{await rpt(t),e(e=>({categories:e.categories.filter(e=>e.id!==t)}))},allCategoryOptions:()=>[...W$.map(e=>e.key),...t().categories.map(e=>e.key)]}));function opt({docId:e,categoryKey:t,onDone:n}){let{t:r}=V(),i=q$(e=>e.categories),a=sk(e=>e.setDocumentCategory),[o,s]=(0,B.useState)(null),c=[...W$.map(e=>e.key),...i.map(e=>e.key)],l=async i=>{if(!o){if(i===t){n?.();return}s(i);try{await a(e,i),n?.()}catch(t){Y(t,r(`document_categories.change_failed`),{operation:`set_document_category`,metadata:{docId:e}})}finally{s(null)}}};return(0,K.jsx)(`div`,{className:`flex flex-col`,children:c.map(e=>{let n=K$(e),a=e===t;return(0,K.jsxs)(`button`,{type:`button`,disabled:a||o!==null,onClick:()=>l(e),className:`flex items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs hover:bg-muted disabled:opacity-60 disabled:cursor-not-allowed`,children:[(0,K.jsx)(n,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:G$(e,i,r)}),a&&(0,K.jsx)(Lg,{className:`h-3.5 w-3.5 text-muted-foreground`}),o===e&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`â¦`})]},e)})})}function spt({docId:e,categoryKey:t,canMutate:n=!1,align:r=`end`}){let{t:i}=V(),a=q$(e=>e.categories),[o,s]=(0,B.useState)(!1),c=t?G$(t,a,i):i(`document_categories.none`),l=(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ${t?`bg-muted text-foreground`:`border border-dashed text-muted-foreground`} ${n?`cursor-pointer hover:bg-muted/80`:``}`,children:[(0,B.createElement)(K$(t),{className:`h-3 w-3`}),c]});return n?(0,K.jsxs)(aP,{open:o,onOpenChange:s,children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,onClick:e=>e.stopPropagation(),"aria-label":i(`document_categories.change`),children:l})}),(0,K.jsx)(sP,{className:`w-44 p-1`,align:r,onClick:e=>e.stopPropagation(),children:(0,K.jsx)(opt,{docId:e,categoryKey:t,onDone:()=>s(!1)})})]}):l}function cpt(){let e=Ex(e=>e.documentId),t=Ex(e=>e.persistedSuggestions),n=Ex(e=>e.suggestionStreamStatus),r=Ex(e=>e.applyInFlightById),i=Ex(e=>e.applyFailureById),a=Ex(e=>e.updatePersistedSuggestion),o=Ex(e=>e.applySuggestionsNow),s=Ex(e=>e.batchTriageSuggestions),c=Ex(e=>e.unapplySuggestion),l=Ex(e=>e.appendSuggestions),u=Ex(e=>e.party),[d,f]=(0,B.useState)(`idle`),[p,m]=(0,B.useState)(null),h=(0,B.useRef)(null);(0,B.useEffect)(()=>()=>{h.current?.abort(),h.current=null},[e]);let g=d===`streaming`||n===`streaming`?`streaming`:d===`done`||n===`done`?`done`:`idle`,_=async(t,n)=>{if(!e)return;h.current?.abort();let r=new AbortController;h.current=r,f(`streaming`),m(null);try{await pge(e,{party:u||void 0,question:t,knowledge_base_id:n?.knowledgeBaseId||void 0,grounding_document_ids:n?.groundingDocumentIds?.length?n.groundingDocumentIds:void 0},{onBatch:t=>{l(e,t)},onDone:e=>{m(e.no_suggestions_reason??null),f(`done`)},onError:e=>{f(`done`),Y(Error(e),`Failed to generate suggestions`,{operation:`suggestRedlinesStream`})},onInterrupted:t=>{f(`done`),Y(Error(`redline suggest stream interrupted: ${t}`),H.t(`errors.stream_interrupted`),{operation:`suggestRedlinesStream`,metadata:{documentId:e,reason:t},fingerprint:[`redline-suggest-stream-interrupted`]})}},r.signal)}catch(e){f(`done`),Y(e,`Failed to generate suggestions`,{operation:`suggestRedlinesStream`})}finally{(!h.current||h.current===r)&&f(`done`)}};return{rows:t,isSuggesting:!1,streamStatus:g,noSuggestionsReason:p,onRequest:(e,t)=>
776{_(e,t)},onApply:t=>{e&&o(e,[t])},onApplyMany:t=>{e&&o(e,t)},onRejectMany:t=>{e&&s(e,t,`rejected`)},onUnapply:t=>{e&&c(e,t)},inFlightById:r,failureById:i,onUpdate:async(t,n)=>{e&&await a(e,t,n)}}}function lpt(e){return e.name?`${e.name} â ${e.role}`:e.role}function upt(e){return e.name?`${e.name} (${e.role})`:e.role}function J$(e){return{id:e.id,paragraph_index:e.paragraph_index,original_text:e.original_text,suggested_text:e.edited_text??e.suggested_text,rationale:e.rationale??``,change_type:e.change_type,status:e.status,clause_label:e.clause_label}}function dpt(e){return e.runs.filter(e=>e.type!==`del`).map(e=>e.text).join(``)}var fpt=`redline.right-panel-size`;function ppt(){try{let e=localStorage.getItem(fpt),t=e?Number(e):NaN;if(Number.isFinite(t)&&t>=18&&t<=55)return t}catch{}return 32}function mpt({onExit:e,hideChatTab:t=!1,suggestionController:n}={}){let{paragraphs:r,comments:i,party:a,detectedParties:o,isDetectingParties:s,documentId:c,categoryKey:l,originalFilename:u,isApplying:d,isLoading:f,applyAction:p,applyBatchActions:m,setParty:h,finalizeDocument:g,createVersion:_,isCreatingVersion:v,applyManualEdit:y,persistedSuggestions:b}=Ex(),x=Sv(),S=Nx(e=>e.user),C=(0,B.useMemo)(()=>ptt(S),[S]),w=(0,B.useMemo)(()=>{let e=new Set;for(let t of b)if(!(t.status!==`applied`||!t.revision_ids?.length))for(let n of t.revision_ids)e.add(n.id);return e},[b]),T=cpt(),E=n??T,[D,O]=(0,B.useState)(!1),[k,A]=(0,B.useState)(``),[j,M]=(0,B.useState)(null),[N,P]=(0,B.useState)(null),[F,I]=(0,B.useState)(null),[L,ee]=(0,B.useState)(null),[R,te]=(0,B.useState)(null),[ne,re]=(0,B.useState)(!0),ie=(0,B.useMemo)(()=>{let e=new Map;if(!ne)return e;for(let t of E.rows){if(t.status!==`pending`||t.id!==L?.id&&t.id!==R||jU(t.change_type)!==`replace`)continue;let n=e.get(t.paragraph_index)??[];n.push(J$(t)),e.set(t.paragraph_index,n)}return e},[E.rows,L?.id,R,ne]),z=(0,B.useMemo)(()=>{let e=new Map;if(!ne)return e;let t=r.map(dpt);for(let n of E.rows){if(n.status!==`pending`||n.id!==L?.id&&n.id!==R)continue;let i=jU(n.change_type);if(i!==`insert`&&i!==`delete`)continue;let a=r.findIndex((e,r)=>MU(t[r],n.original_text)!==null);if(a<0)continue;let o=r[a].paragraph_index,s=e.get(o)??{inserts:[],deletes:[]};i===`insert`?s.inserts.push(J$(n)):s.deletes.push(J$(n)),e.set(o,s)}return e},[E.rows,L?.id,R,ne,r]),ae=e=>{document.getElementById(`para-${e}`)?.scrollIntoView({behavior:`smooth`,block:`center`})},oe=(0,B.useMemo)(()=>{let e=L;return!e||e.status!==`applied`||!e.revision_ids?.length?null:new Set(e.revision_ids.map(e=>e.id))},[L]),se=(0,B.useMemo)(()=>F==null?null:i.find(e=>e.comment_id===F)?.paragraph_index??null,[F,i]),ce=e=>{I(e.comment_id),ee(null),e.paragraph_index!=null&&ae(e.paragraph_index)},le=e=>{if(ee(e),I(null),!e)return;let t=e.paragraph_index;if(e.status===`applied`&&e.revision_ids?.length){let n=new Set(e.revision_ids.map(e=>e.id)),i=r.find(e=>e.runs.some(e=>e.change_id!=null&&n.has(e.change_id)));i&&(t=i.paragraph_index)}ae(t)},ue=(e,t)=>{p(e,t)},de=e=>{let t=[];for(let n of r)for(let r of n.runs)r.type!==`text`&&r.change_id!=null&&t.push({change_id:r.change_id,action:e});t.length>0&&m(t)},fe=async()=>{let e=E.rows.filter(e=>e.status===`pending`).length;e>0&&G.warning(H.t(`toasts.redline.finalize_unapplied_warning`,{count:e}));let t=await g();t&&window.open(t,`_blank`)},pe=e=>{let t=e.trim();t&&(h(t),O(!1),A(``))},me=k.trim().toLowerCase(),he=(o??[]).filter(e=>!me||lpt(e).toLowerCase().includes(me));return f?(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,K.jsx)(W,{className:`h-8 w-8 animate-spin text-gray-400`})}):(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-gray-200 bg-white px-4 py-2`,children:[(0,K.jsxs)(`button`,{onClick:()=>e?e():x(`/vault/redline`),className:`flex items-center gap-1 rounded px-2 py-1 text-xs text-gray-600 hover:bg-gray-200`,children:[(0,K.jsx)(Tg,{size:14}),`Exit Redline`]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-gray-700 truncate max-w-[500px]`,children:u}),c&&(0,K.jsx)(spt,{docId:c,categoryKey:l,canMutate:!0}),(0,K.jsxs)(aP,{open:D,onOpenChange:O,children:[(0,K.jsx)(oP,{asChild:!0,children:a?(0,K.jsxs)(`button`,{className:`flex items-center gap-1 rounded bg-blue-100 px-2 py-0.5 text-xs font-medium text-blue-700 hover:bg-blue-200`,children:[a,s&&(0,K.jsx)(Ift,{className:`size-3`})]}):(0,K.jsxs)(`button`,{className:`flex items-center gap-1 rounded border border-dashed border-gray-300 px-2 py-0.5 text-xs text-gray-400 hover:border-gray-400 hover:text-gray-600`,children:[s&&(0,K.jsx)(Ift,{className:`size-3`}),`Pick your side`]})}),(0,K.jsx)(sP,{align:`end`,className:`w-72 p-0`,children:(0,K.jsxs)(XO,{shouldFilter:!1,children:[(0,K.jsx)(ZO,{placeholder:`Search or type a partyâ¦`,value:k,onValueChange:A}),(0,K.jsxs)(QO,{children:[s&&(0,K.jsx)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:(0,K.jsx)(RI,{size:`sm`,label:H.t(`ai.activity.detecting_parties`)})}),!s&&he.length===0&&!me&&(0,K.jsx)($O,{children:`No parties detected. Type your side below.`}),he.length>0&&(0,K.jsx)(ek,{heading:`Detected sides`,children:he.map((e,t)=>{let n=upt(e);return(0,K.jsxs)(nk,{value:`party-${t}`,onSelect:()=>pe(n),children:[(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:lpt(e)}
776),a===n&&(0,K.jsx)(Lg,{className:`size-4`})]},`party-${t}`)})}),me&&(0,K.jsx)(ek,{heading:`Custom`,children:(0,K.jsxs)(nk,{value:`__custom__`,onSelect:()=>pe(k),children:[`Use â`,k.trim(),`â`]})})]})]})})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d&&(0,K.jsx)(W,{size:14,className:`animate-spin text-gray-400`}),(0,K.jsxs)(`button`,{onClick:()=>_(),disabled:v,className:`flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50 disabled:opacity-50`,children:[v?(0,K.jsx)(W,{size:14,className:`animate-spin`}):(0,K.jsx)(O_,{size:14}),`Save Version`]}),(0,K.jsxs)(`button`,{onClick:fe,className:`flex items-center gap-1 rounded bg-blue-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-700`,children:[(0,K.jsx)(Xg,{size:14}),`Download`]})]})]}),(0,K.jsxs)(IH,{orientation:`horizontal`,className:`flex-1`,children:[(0,K.jsx)(LH,{defaultSize:`${100-ppt()}`,minSize:`40`,children:(0,K.jsx)(`div`,{className:`h-full overflow-y-auto px-6 py-4`,children:(0,K.jsx)(`div`,{className:`mx-auto max-w-4xl space-y-0.5`,children:r.map(e=>{let t=z.get(e.paragraph_index);return(0,K.jsxs)(B.Fragment,{children:[(0,K.jsx)(Hft,{paragraph:e,hoveredCommentId:j,hoveredChangeId:N,onHoverComment:M,onHoverChange:P,onAction:ue,onManualEdit:y,isApplying:d,previewSuggestions:ie.get(e.paragraph_index)??[],previewStruck:!!t?.deletes.length,hoveredSuggestionId:R,onHoverSuggestion:te,isSuggestionTarget:L?.paragraph_index===e.paragraph_index&&!oe,isCommentTarget:se===e.paragraph_index,selectedChangeIds:oe,myAuthorNames:C,toolChangeIds:w}),t?.inserts.map(e=>(0,K.jsx)(hpt,{text:e.suggested_text,suggestionId:e.id,hoveredSuggestionId:R,onHoverSuggestion:te},e.id??e.suggested_text))]},e.paragraph_index)})})})}),(0,K.jsx)(RH,{withHandle:!0}),(0,K.jsx)(LH,{defaultSize:`${ppt()}`,minSize:`18`,maxSize:`55`,onResize:e=>{try{localStorage.setItem(fpt,String(e.asPercentage))}catch{}},children:(0,K.jsx)(`div`,{className:`h-full overflow-hidden border-l border-gray-200`,children:(0,K.jsx)(Yft,{paragraphs:r,comments:i,onAction:ue,onBatchAction:de,onHoverChange:P,onHoverComment:M,hoveredChangeId:N,hoveredCommentId:j,onScrollToChange:ae,suggestionController:E,hideChatTab:t,onSelectSuggestion:le,onHoverSuggestion:te,hoveredSuggestionId:R,isDocPreviewOn:ne,onToggleDocPreview:()=>re(e=>!e),onNavigateComment:ce,selectedCommentId:F,myAuthorNames:C,toolChangeIds:w})})})]})]})}function hpt({text:e,suggestionId:t,hoveredSuggestionId:n,onHoverSuggestion:r}){return(0,K.jsxs)(`div`,{className:`ml-4 my-1 rounded-sm border border-dashed border-emerald-400 bg-emerald-50/60 px-3 py-1.5 text-sm ${t!=null&&t===n?`ring-2 ring-yellow-400 bg-yellow-100`:``}`,onMouseEnter:()=>t&&r?.(t),onMouseLeave:()=>r?.(null),children:[(0,K.jsxs)(`span`,{className:`mb-0.5 flex items-center gap-1 text-[10px] font-medium uppercase text-emerald-700`,children:[(0,K.jsx)(T_,{size:10}),H.t(`redline.insert_paragraph_after`)]}),(0,K.jsx)(`span`,{className:`whitespace-pre-wrap text-emerald-800`,children:e})]})}function gpt({documentId:e,onExit:t}){let n=XU(e),r=Ex(e=>e.error),i=Ex(e=>e.clearError);return(0,B.useEffect)(()=>(Ex.getState().enterRedlineMode(e,{embedded:!0}),()=>{Ex.getState().exitRedlineMode(e)}),[e]),(0,K.jsxs)(`div`,{className:`flex h-full flex-col`,children:[r&&(0,K.jsxs)(`div`,{className:`flex items-center justify-between bg-red-50 px-4 py-2 text-sm text-red-700`,children:[(0,K.jsx)(`span`,{children:r}),(0,K.jsx)(`button`,{onClick:i,className:`text-red-400 hover:text-red-600`,children:(0,K.jsx)(J_,{size:14})})]}),(0,K.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,K.jsx)(mpt,{hideChatTab:!0,onExit:t,suggestionController:n})})]})}function _pt({onBack:e}){let{selectedTask:t,selectedDocumentId:n,draft:r,suggestions:i,clearSelection:a,dismiss:o}=Ux(),[s,c]=(0,B.useState)(!1),{open:l,setOpen:u}=sL(),d=(0,B.useRef)(null);if((0,B.useEffect)(()=>{s?(d.current===null&&(d.current=l),u(!1)):d.current!==null&&(u(d.current),d.current=null)},[s]),!t)return(0,K.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground`,children:(0,K.jsx)(`p`,{className:`text-sm`,children:`Select an email task to review`})});let f=n??t.document_id??null;return s&&f?(0,K.jsx)(gpt,{documentId:f,onExit:()=>c(!1)}):(0,K.jsx)(Fft,{task:t,draft:r,suggestions:i,onBack:e??a,onDismiss:o,onEnterRedline:()=>c(!0)})}function vpt(){let[e]=Jv(),t=xv(),n=Sv(),r=Ux(e=>e.selectTask),i=Ux(e=>e.clearSelection),a=e.get(`taskId`),o=e.get(`doc`);return(0,B.useEffect)(()=>{a&&r(a,o??void 0)},[a,o,r]),(0,K.jsx)(`div`,{className:`flex h-full`,children:(0,K.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:(0,K.jsx)(_pt,{onBack:(0,B.useCallback)(()=>{i(),t.key===`default`?n(`/matters`):n(-1)},[i,n,t.key])})})})}function Y$(e){return e?.access===`shared`}function ypt(e){return e?!e.org_id&&!e.is_inbox&&!e.is_personal&&e.access!==`shared`:!1}
776function X$(e,t){return Y$(e)?!1:t!==`viewer`}function bpt(e,t){return X$(e,t)?!0:Y$(e)&&e?.share_role===`editor`}var xpt=[`open`,`active`,`on_hold`,`closed`,`archived`];function Spt({matter:e,open:t,onOpenChange:n}){let{t:r}=V(),{updateMatter:i}=Yx(),[a,o]=(0,B.useState)(e.name),[s,c]=(0,B.useState)(e.description??``),[l,u]=(0,B.useState)(e.notes??``),[d,f]=(0,B.useState)(e.status),[p,m]=(0,B.useState)(e.warn_days??5),[h,g]=(0,B.useState)(e.critical_days??10),[_,v]=(0,B.useState)(e.parties??[]),[y,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(null),C=(e,t)=>v(n=>n.map((n,r)=>r===e?{...n,...t}:n)),w=()=>v(e=>[...e,{name:``}]),T=e=>v(t=>t.filter((t,n)=>n!==e)),E=e=>e.map(e=>({name:(e.name??``).trim(),role:e.role?.trim()||null,email:e.email?.trim()||null})).filter(e=>e.name.length>0);return(0,K.jsx)(HC,{open:t,onOpenChange:n,children:(0,K.jsxs)(WC,{children:[(0,K.jsx)(GC,{children:(0,K.jsx)(qC,{children:`Edit matter`})}),(0,K.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),b(!0),S(null),h<p){S(`Critical days must be greater than or equal to warn days`),b(!1);return}let r=E(_),o=JSON.stringify(r)!==JSON.stringify(E(e.parties??[]));try{await i(e.id,{name:a===e.name?void 0:a,description:(s||null)===e.description?void 0:s||null,notes:(l||null)===e.notes?void 0:l||null,status:d===e.status?void 0:d,warn_days:p===e.warn_days?void 0:p,critical_days:h===e.critical_days?void 0:h,parties:o?r:void 0}),n(!1)}catch(e){S(Kb(e,`Failed to update matter`))}finally{b(!1)}},className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`edit-matter-name`,children:`Name`}),(0,K.jsx)(dP,{id:`edit-matter-name`,value:a,onChange:e=>o(e.target.value),required:!0})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`edit-matter-desc`,children:`Description`}),(0,K.jsx)(`textarea`,{id:`edit-matter-desc`,value:s,onChange:e=>c(e.target.value),rows:3,className:`w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring`})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`edit-matter-notes`,children:`Notes`}),(0,K.jsx)(`textarea`,{id:`edit-matter-notes`,value:l,onChange:e=>u(e.target.value),rows:4,className:`w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring`})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(pP,{children:r(`matters.parties.title`)}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[_.length>0&&(0,K.jsx)(`div`,{className:`flex max-h-48 flex-col gap-2 overflow-y-auto`,children:_.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border p-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(dP,{value:e.name,onChange:e=>C(t,{name:e.target.value}),placeholder:r(`matters.parties.name_placeholder`),"aria-label":r(`matters.parties.name_placeholder`),maxLength:255,className:`flex-1`}),(0,K.jsx)(dP,{value:e.role??``,onChange:e=>C(t,{role:e.target.value}),placeholder:r(`matters.parties.role_placeholder`),"aria-label":r(`matters.parties.role_placeholder`),className:`w-32`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>T(t),"aria-label":r(`matters.parties.remove`),children:(0,K.jsx)(V_,{className:`h-4 w-4 text-destructive`})})]}),(0,K.jsx)(dP,{type:`email`,value:e.email??``,onChange:e=>C(t,{email:e.target.value}),placeholder:r(`matters.parties.email_placeholder`),"aria-label":r(`matters.parties.email_placeholder`)})]},t))}),(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:w,className:`w-fit`,children:[(0,K.jsx)(T_,{className:`mr-1 h-4 w-4`}),r(`matters.parties.add`)]})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(pP,{children:`Status`}),(0,K.jsxs)(vO,{value:d??`open`,onValueChange:e=>f(e),children:[(0,K.jsx)(bO,{children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:xpt.map(e=>(0,K.jsx)(SO,{value:e,className:`capitalize`,children:e.replace(`_`,` `)},e))})]})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`edit-matter-warn`,children:`Warn after (business days)`}),(0,K.jsx)(dP,{id:`edit-matter-warn`,type:`number`,min:1,max:90,value:p,onChange:e=>m(Math.max(1,Number(e.target.value)||0))})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`edit-matter-critical`,children:`Critical after (business days)`}),(0,K.jsx)(dP,{id:`edit-matter-critical`,type:`number`,min:1,max:90,value:h,onChange:e=>g(Math.max(1,Number(e.target.value)||0))})]})]}),x&&(0,K.jsx)(`p`,{className:`text-sm text-destructive`,children:x}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{type:`button`,variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,K.jsx)(J,{type:`submit`,disabled:y,children:y?`Savingâ¦`:`Save`})]})]})]})})}var Cpt=[`overview`,`emails`,`finance`,`resources`],wpt={open:`default`,active:`default`,on_hold:`secondary`,closed:`outline`,archived:`outline`};function Tpt({children:e}){let{t}=V(),{formatDate:n}=jb(),{matterId:r}=Cv(),i=Sv(),a=xv(),o=RS(),{matterDetail:s,isLoadingDetail:c,deleteMatter:l}=Yx(),u={overview:t(`matters.tabs.overview`),emails:t(`matters.tabs.legal`),resources:t(`matters.tabs.resources`)??`Resources`,finance:t(`matters.tabs.finance`)},[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(!1),_=a.pathname.match(/^\/matters\/[^/]+\/([^/]+)/)?.[1]??`overview`,v=Y$(s),y=v?[`overview`,`resources`]:Cpt,b=y.includes(_);if((0,B.useEffect)(()=>{s&&!b&&i(`/matters/${r}`,{replace:!0})},[s,b,r,i]),!s)return c?(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center text-muted-foreground`,children:t(`common.loading`)}):(0,K.jsx)(OV,{message:t(`errors.not_found`),className:`h-full`});let x=s.is_inbox,S=s.is_personal,C=x||S,w=X$(s,o),T=ypt(s),E=(0,K.jsx)(jg,{className:`h-3.5 w-3.5`}),D=t(`matters.title`);x?(E=(0,K.jsx)(l_,{className:`h-3.5 w-3.5`}),D=t(`dashboard.inbox`)):S&&(E=(0,K.jsx)(G_,{className:`h-3.5 w-3.5`}),D=t(`matters.personal`));let O=e=>{i(e===`overview`?`/matters/${r}`:`/matters/${r}/${e}`)},k=async()=>{r&&(await l(r),m(!1),i(`/matters`,{replace:!0}))},A=s.parties??[];return(0,K.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,K.jsx)(`div`,{className:`border-b px-6 py-4`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[E,(0,K.jsx)(`span`,{children:D}),o===`viewer`&&(0,K.jsx)(lR,{variant:`outline`,className:`ml-1 text-[10px]`,children:t(`org.roles.viewer`)}),v&&(0,K.jsx)(lR,{variant:`outline`,className:`ml-1 text-[10px]`,children:t(`matters.detail.shared_with_you`)})]}),(0,K.jsx)(`h1`,{className:`mt-1 truncate text-2xl font-semibold`,children:s.name}),s.description&&(0,K.jsx)(`p`,{className:`mt-1 line-clamp-2 text-sm text-muted-foreground`,children:s.description}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,K.jsx)(lR,{variant:wpt[s.status]??`outline`,className:`capitalize`,children:s.status.replace(`_`,` `)}),(s.parties??[]).length>0&&(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(q_,{className:`h-3 w-3`}),(s.parties??[]).length]}),(0,K.jsxs)(`span`,{children:[`·`,` `,t(`matters.detail.opened_on`,{date:n(s.opened_at)})]}),s.closed_at&&(0,K.jsxs)(`span`,{children:[`·`,` `,t(`matters.detail.closed_on`,{date:n(s.closed_at)})]})]})]}),(0,K.jsxs)(`section`,{className:`w-64 shrink-0 self-stretch border-l pl-4`,children:[(0,K.jsxs)(`h2`,{className:`mb-2 flex items-center gap-1.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:[(0,K.jsx)(q_,{className:`h-3.5 w-3.5`}),t(`matters.parties.title`)]}),A.length===0?w?(0,K.jsx)(`button`,{type:`button`,onClick:()=>f(!0),className:`text-left text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,children:t(`matters.parties.set_cta`)}):(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`matters.parties.empty`)}):(0,K.jsx)(`ul`,{className:`flex max-h-24 flex-col gap-2 overflow-y-auto pr-1`,children:A.map((e,t)=>(0,K.jsxs)(`li`,{className:`text-sm leading-tight`,children:[(0,K.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,K.jsx)(`span`,{className:`truncate font-medium`,children:e.name}),e.role&&(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wide text-muted-foreground`,children:e.role})]}),e.email&&(0,K.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.email})]},t))})]}),(T||w)&&(0,K.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[T&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>g(!0),"aria-label":t(`matters.detail.share_matter`),children:(0,K.jsx)(P_,{className:`h-4 w-4`})}),w&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>f(!0),"aria-label":t(`matters.detail.edit_matter`),children:(0,K.jsx)(w_,{className:`h-4 w-4`})}),w&&!C&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>m(!0),"aria-label":t(`matters.edit_dialog.delete`),children:(0,K.jsx)(V_,{className:`h-4 w-4 text-destructive`})})]})]})}),(0,K.jsx)(bV,{value:_,onValueChange:O,className:`border-b px-6`,children:(0,K.jsx)(xV,{className:`w-fit`,children:y.map(e=>(0,K.jsx)(SV,{value:e,children:u[e]},e))})}),(0,K.jsx)(`div`,{className:`flex-1 overflow-auto p-6`,children:b?e:null}),d&&(0,K.jsx)(Spt,{matter:s,open:d,onOpenChange:f}),h&&(0,K.jsx)(dR,{resourceType:`matter`,resourceId:s.id,resourceName:s.name,open:h,onOpenChange:g}),(0,K.jsx)(HC,{open:p,onOpenChange:m,children:(0,K.jsxs)(WC,{children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:t(`matters.edit_dialog.delete`)}),(0,K.jsx)(JC,{children:t(`matters.edit_dialog.delete_confirm`)})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`outline`,onClick:()=>m(!1),children:t(`common.cancel`)}),(0,K.jsx)(J,{variant:`destructive`,onClick:k,children:t(`common.delete`)})]})]})})]})}function Ept(){let{matterId:e}=Cv(),t=Sv(),{matters:n,selectedMatterId:r,selectMatter:i,fetchMatters:a}=Yx();return(0,B.useEffect)(()=>{a()},[a]),WB(a),(0,B.useEffect)(()=>{e&&e!==r&&i(e)},[e,r,i]),(0,B.useEffect)(()=>{!e&&n.length>0&&t(`/matters/${n[0].id}`,{replace:!0})},[e,n,t]),e?(0,K.jsx)(`div`,{className:`flex h-full`,children:(0,K.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:(0,K.jsx)(Tpt,{children:(0,K.jsx)(Av,{})})})}):(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-muted-foreground`,children:[(0,K.jsx)(jg,{className:`h-10 w-10`}),(0,K.jsx)(`div`,{className:`text-base font-medium`,children:`No matter selected`}),(0,K.jsx)(`div`,{className:`text-sm`,children:`Pick a matter from the sidebar, or create a new one.`})]})}const Dpt=e=>{let t=new URLSearchParams;Object.entries(e||{}
776).forEach(([e,n])=>{n!==void 0&&t.append(e,n===null?`null`:n.toString())});let n=t.toString();return n.length>0?`/api/v1/digest/actions?${n}`:`/api/v1/digest/actions`},Opt=async(e,t)=>Z(Dpt(e),{...t,method:`GET`}),kpt=()=>`/api/v1/digest/actions/snooze`,Apt=async(e,t)=>Z(kpt(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),jpt=()=>`/api/v1/digest/actions/dismiss`,Mpt=async(e,t)=>Z(jpt(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),Npt=()=>`/api/v1/digest/actions/reopen`,Ppt=async(e,t)=>Z(Npt(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)});var Fpt={needsNow:[],comingDue:[],loading:!1,loaded:!1,error:null};function Z$(e){return e??`all`}function Ipt(e,t){return{...e,needsNow:e.needsNow.filter(e=>e.key!==t),comingDue:e.comingDue.filter(e=>e.key!==t)}}const Q$=Pb((e,t)=>{let n=(t,n)=>e(e=>({feeds:{...e.feeds,[t]:{...e.feeds[t]??Fpt,...n}}})),r=(t,n)=>e(e=>{let r=e.feeds[t];return r?{feeds:{...e.feeds,[t]:Ipt(r,n)}}:{}});return{feeds:{},fetchFeed:async e=>{let r=Z$(e);
776if(!t().feeds[r]?.loading){n(r,{loading:!0,error:null});try{let t=(await Opt(e?{matter_id:e}:void 0)).data;n(r,{needsNow:t.needs_now,comingDue:t.coming_due,loading:!1,loaded:!0,error:null})}catch(t){X(t,{operation:`fetch_action_feed`,metadata:{matterId:e}}),n(r,{loading:!1,loaded:!0,error:Kb(t,`Couldn't load actions`)})}}},snooze:async(e,{matterId:n,minutes:i=1440}={})=>{r(Z$(n),e);try{await Apt({key:e,snooze_minutes:i}),Wx(`Snoozed`,()=>{t().reopen(e,n)})}catch(r){Y(r,`Couldn't snooze`,{operation:`snooze_action`,metadata:{key:e}}),t().fetchFeed(n)}},dismiss:async(e,{matterId:n}={})=>{r(Z$(n),e.key);try{await Mpt({key:e.key,state_token:e.state_token??null}),Wx(`Dismissed`,()=>{t().reopen(e.key,n)})}catch(r){Y(r,`Couldn't dismiss`,{operation:`dismiss_action`,metadata:{key:e.key}}),t().fetchFeed(n)}},reopen:async(e,n)=>{try{await Ppt({key:e})}catch(t){Y(t,`Couldn't undo`,{operation:`reopen_action`,metadata:{key:e}})}finally{t().fetchFeed(n)}}}});var $$=B.createContext(null);function Lpt({children:e}){let[t,n]=B.useState({needsNow:0,comingDue:0,meetings:0,nextTime:null}),r=B.useCallback(e=>{n(t=>({...t,...e}))},[]),i=B.useMemo(()=>({stats:t,setStats:r}),[t,r]);return(0,K.jsx)($$.Provider,{value:i,children:e})}function Rpt(){let e=B.useContext($$);if(!e)throw Error(`useDigestStats must be used inside DigestStatsProvider`);return e}function zpt(){return B.useContext($$)}function e1({children:e,className:t}){return(0,K.jsx)(`span`,{className:q(`text-[10px] uppercase tracking-[0.18em] text-muted-foreground font-medium`,t),children:e})}function Bpt({children:e,className:t}){return(0,K.jsx)(`h2`,{className:q(`font-serif tracking-tight`,t),children:e})}function Vpt(e){let t=e.indexOf(` `);return t===-1?{head:e,tail:``}:{head:e.slice(0,t),tail:e.slice(t+1)}}function t1({text:e}){let{head:t,tail:n}=Vpt(e);return(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`span`,{className:`font-mono tabular-nums`,children:t}),` `,(0,K.jsx)(`span`,{children:n})]})}function Hpt(){let{stats:e}=Rpt(),{t}=V(),n=[(0,K.jsx)(t1,{text:t(`dashboard.stat_in_court`,{count:e.needsNow})},`court`),(0,K.jsx)(t1,{text:t(`dashboard.stat_coming_due`,{count:e.comingDue})},`due`),(0,K.jsx)(t1,{text:t(`dashboard.stat_meetings`,{count:e.meetings})},`meetings`)];if(e.nextTime){let{head:r,tail:i}=Vpt(t(`dashboard.stat_next`,{time:e.nextTime}));n.push((0,K.jsxs)(`span`,{children:[(0,K.jsx)(`span`,{children:r}),` `,(0,K.jsx)(`span`,{className:`font-mono tabular-nums`,children:i})]},`next`))}return(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] uppercase tracking-[0.18em] text-muted-foreground`,children:n.map((e,t)=>(0,K.jsxs)(B.Fragment,{children:[t>0&&(0,K.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground/60`,children:`·`}),e]},t))})}var Upt=5,Wpt=[{value:`priority`,label:`Priority`},{value:`oldest`,label:`Oldest first`},{value:`newest`,label:`Newest first`},{value:`matter`,label:`By matter`}];const n1={your_turn_thread:`Replies`,pending_redline:`Redlines`,completed_eval:`Evaluations`,failed_doc:`Failed uploads`,draft_to_send:`Drafts`,meeting_request:`Meetings`,deadline:`Deadlines`,matter_action_item:`Action items`};function Gpt(e){return e===`critical`?`border-destructive`:e===`warn`?`border-amber-500`:`border-transparent`}function Kpt(e){return e===`critical`?`text-destructive`:e===`warn`?`text-amber-600 dark:text-amber-500`:`text-muted-foreground`}function qpt(e){return/^https?:\/\//.test(e)}function Jpt(e,t){if(t===`priority`)return e;let n=[...e];return t===`oldest`?n.sort((e,t)=>(t.age_days??0)-(e.age_days??0)):t===`newest`?n.sort((e,t)=>(e.age_days??0)-(t.age_days??0)):t===`matter`&&n.sort((e,t)=>(e.matter_name??``).localeCompare(t.matter_name??``)),n}var Ypt=`flex items-center gap-1 rounded px-1.5 py-1 text-[11px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`;function Xpt({sortKey:e,onSortChange:t,kinds:n,hiddenKinds:r,onToggleKind:i}){return(0,K.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,K.jsxs)(LD,{children:[(0,K.jsx)(RD,{className:Ypt,"aria-label":`Sort`,children:(0,K.jsx)(Dg,{className:`size-3.5`})}),(0,K.jsx)(zD,{align:`end`,children:(0,K.jsx)(zMe,{value:e,onValueChange:e=>t(e),children:Wpt.map(e=>(0,K.jsx)(BMe,{value:e.value,className:`text-xs`,children:e.label},e.value))})})]}),n.length>1?(0,K.jsxs)(LD,{children:[(0,K.jsxs)(RD,{className:Ypt,"aria-label":`Filter`,children:[(0,K.jsx)(qoe,{className:`size-3.5`}),r.size>0?(0,K.jsx)(`span`,{className:`tabular-nums`,children:n.length-r.size}):null]}),(0,K.jsxs)(zD,{align:`end`,children:[(0,K.jsx)(UD,{className:`text-xs`,children:`Show`}),(0,K.jsx)(WD,{}),n.map(e=>(0,K.jsx)(HD,{checked:!r.has(e),onCheckedChange:()=>i(e),onSelect:e=>e.preventDefault(),className:`text-xs`,children:n1[e]??e},e))]})]}):null]})}function Zpt({item:e,onSnooze:t,onDismiss:n}){let r=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[e.matter_name?(0,K.jsx)(`p`,{className:`truncate font-mono text-[10px] uppercase tracking-wide text-muted-foreground`,children:e.matter_name}):null,(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.title}),(0,K.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.reason})]}),(0,K.jsxs)(`div`,{className:`shrink-0 pt-0.5 text-right`,children:[(0,K.jsx)(`div`,{className:q(`font-serif text-xl leading-none tabular-nums`,Kpt(e.severity)
776),children:e.age_label}),(0,K.jsx)(`div`,{className:`mt-1 font-mono text-[10px] uppercase tracking-wide text-muted-foreground`,children:e.verb})]})]}),i=`flex min-w-0 flex-1 items-start gap-3 py-2.5 pl-3 pr-1`;return(0,K.jsxs)(`div`,{className:q(`group relative flex items-start gap-1 rounded-sm border-l-2 transition-colors hover:bg-muted/40`,Gpt(e.severity)),children:[qpt(e.href)?(0,K.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:i,children:r}):(0,K.jsx)(Gv,{to:e.href,className:i,children:r}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 pr-1 pt-2 opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>t(e),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`Snooze`,title:`Snooze for a day`,children:(0,K.jsx)(Gae,{className:`size-4`})}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`Dismiss`,title:`Dismiss`,children:(0,K.jsx)(J_,{className:`size-4`})})]})]})}function r1({label:e,items:t,onSnooze:n,onDismiss:r,headerRight:i,labelAfter:a,alwaysShow:o=!1,emptyText:s=`Nothing matches the filter.`}){let[c,l]=B.useState(!1);if(t.length===0&&!o)return null;let u=c?t:t.slice(0,Upt),d=t.length-u.length;return(0,K.jsxs)(`section`,{className:`space-y-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(e1,{children:e}),a]}),i]}),t.length===0?(0,K.jsx)(`p`,{className:`py-2 pl-3 font-serif text-xs italic text-muted-foreground`,children:s}):(0,K.jsx)(`div`,{className:`flex flex-col`,children:u.map(e=>(0,K.jsx)(Zpt,{item:e,onSnooze:n,onDismiss:r},e.key))}),d>0?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>l(!0),className:`pl-3 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[`+ `,d,` more`]}):null,c&&t.length>Upt?(0,K.jsx)(`button`,{type:`button`,onClick:()=>l(!1),className:`pl-3 text-xs font-medium text-muted-foreground hover:text-foreground`,children:`Show less`}):null]})}function i1(){return(0,K.jsx)(`div`,{className:`space-y-3`,children:[1,2,3].map(e=>(0,K.jsxs)(`div`,{className:`flex items-start gap-3 pl-3`,children:[(0,K.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,K.jsx)(LI,{className:`h-3 w-24`}),(0,K.jsx)(LI,{className:`h-4 w-3/4`})]}),(0,K.jsx)(LI,{className:`h-6 w-8`})]},e))})}var Qpt=6e4;function a1({matterId:e,view:t=`all`}={}){let n=e??`all`,r=Q$(e=>e.feeds[n]),i=Q$(e=>e.fetchFeed),a=Q$(e=>e.snooze),o=Q$(e=>e.dismiss),s=Q(e=>e.setMasterQueueOpen),[c,l]=B.useState(`priority`),[u,d]=B.useState(()=>new Set),f=B.useCallback(e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);B.useEffect(()=>{i(e);let t=window.setInterval(()=>i(e),Qpt);return()=>window.clearInterval(t)},[i,e]);let p=B.useCallback(t=>a(t.key,{matterId:e}),[a,e]),m=B.useCallback(t=>o(t,{matterId:e}),[o,e]),h=B.useMemo(()=>r?.needsNow??[],[r?.needsNow]),g=B.useMemo(()=>r?.comingDue??[],[r?.comingDue]),_=!r?.loaded&&r?.loading,v=B.useMemo(()=>{let e=[];for(let t of h)e.includes(t.kind)||e.push(t.kind);return e},[h]),y=B.useMemo(()=>Jpt(h.filter(e=>!u.has(e.kind)),c),[h,u,c]),b=zpt()?.setStats;B.useEffect(()=>{t!==`coming_due`&&b?.({needsNow:h.length,comingDue:g.length})},[t,b,h.length,g.length]);let x=(0,K.jsx)(r1,{label:`Needs you now`,items:y,onSnooze:p,onDismiss:m,alwaysShow:!0,headerRight:h.length>0?(0,K.jsx)(Xpt,{sortKey:c,onSortChange:l,kinds:v,hiddenKinds:u,onToggleKind:f}):null,labelAfter:t===`needs_now`?(0,K.jsx)(`button`,{type:`button`,onClick:()=>s(!0),title:`Open the action queue`,"aria-label":`Open the action queue`,className:`hidden cursor-pointer items-center rounded transition-opacity hover:opacity-70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 md:inline-flex`,children:(0,K.jsxs)(`kbd`,{className:`pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium`,children:[(0,K.jsx)(`span`,{className:`text-xs`,children:`â`}),`J`]})}):null,emptyText:h.length===0?`Nothing needs you right now.`:`Nothing matches the filter.`}),S=(0,K.jsx)(r1,{label:`Coming due`,items:g,onSnooze:p,onDismiss:m,alwaysShow:!0,emptyText:`Nothing coming due.`});if(t===`needs_now`)return(0,K.jsx)(`div`,{className:`px-6 py-5`,children:_?(0,K.jsx)(i1,{}):x});if(t===`coming_due`)return(0,K.jsx)(`div`,{className:`px-6 py-5`,children:_?(0,K.jsx)(i1,{}):S});let C=h.length===0&&g.length===0;return(0,K.jsxs)(`div`,{className:`px-6 py-5`,children:[(0,K.jsxs)(`div`,{className:`mb-3 flex items-baseline justify-between gap-2`,children:[(0,K.jsx)(e1,{className:`text-[11px]`,children:`What needs you`}),h.length>0?(0,K.jsx)(`span`,{className:`font-mono text-[11px] tabular-nums text-muted-foreground`,children:h.length}):null]}),_?(0,K.jsx)(i1,{}):null,!_&&C?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-10 text-center`,children:[(0,K.jsx)(foe,{className:`size-5 text-muted-foreground`,"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`font-serif italic text-sm text-muted-foreground`,children:`Nothing in your court. Enjoy the quiet.`})]}):null,!_&&!C?(0,K.jsxs)(`div`,{className:`space-y-5`,children:[h.length>0?x:null,g.length>0?S:null]}):null]})}var $pt={high:`destructive`,medium:`default`,low:`secondary`};function emt(){let{matterId:e}=Cv(),t=RS(),n=X$(Yx(e=>e.matterDetail),t),{matterActionItems:r,loadActionItems:i,createActionItem:a,updateActionItem:o,deleteActionItem:s,isLoadingResources:c}=Yx(),[l,u]=(0,B.useState)(null),[d,f]=(0,B.useState)(``),[p,m]=(0,B.useState)(``),[h,g]=(0,B.useState)(`none`);(0,B.useEffect)(()=>{e&&i(e)},[e,i]);let _=()=>{f(``),m(``),g(`none`)},v=()=>{_(),u(`add`)},y=e=>{f(e.title),m(e.due_date??``),g(e.priority??`none`),u(e.id)},b=()=>{u(null),_()},x=async t=>{if(t.preventDefault(),!e)return;let n={title:d.trim(),due_date:p||null,priority:h===`none`?null:h};try{l===`add`?await a(e,n):l&&await o(e,l,n),b()}catch{}},S=async t=>{if(e)try{await o(e,t.id,{status:t.status===`done`?`open`:`done`})}catch{}},C=async t=>{if(e)try{await s(e,t.id)}catch{}},w=()=>(0,K.jsxs)(`form`,{onSubmit:x,className:`flex flex-col gap-2 rounded-md border bg-muted/30 p-3 sm:flex-row sm:items-center`,children:[(0,K.jsx)(dP,{autoFocus:!0,required:!0,maxLength:500,value:d,onChange:e=>f(e.target.value),placeholder:`What needs doing?`,className:`flex-1`,"aria-label":`Action item title`}),(0,K.jsx)(dP,{type:`date`,value:p,onChange:e=>m(e.target.value),className:`w-auto`,"aria-label":`Due date`}),(0,K.jsxs)(vO,{value:h,onValueChange:e=>g(e),children:[(0,K.jsx)(bO,{className:`w-[140px]`,"aria-label":`Priority`,children:(0,K.jsx)(yO,{})}),(0,K.jsxs)(xO,{children:[(0,K.jsx)(SO,{value:`none`,children:`No priority`}),(0,K.jsx)(SO,{value:`low`,children:`Low`}),(0,K.jsx)(SO,{value:`medium`,children:`Medium`}),(0,K.jsx)(SO,{value:`high`,children:`High`})]})]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(J,{type:`submit`,size:`sm`,disabled:!d.trim(),children:l===`add`?`Add`:`Save`}),(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:b,children:`Cancel`})]})]});return c&&r.length===0?(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Loadingâ¦`}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[n&&l!==`add`&&(0,K.jsx)(`div`,{children:(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`outline`,onClick:v,children:[(0,K.jsx)(T_,{className:`mr-1 h-4 w-4`}),`Add action item`]})}),n&&l===`add`&&w(),r.length===0&&l!==`add`?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center text-muted-foreground`,children:[(0,K.jsx)(m_,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`text-sm`,children:`No action items yet.`})]}):(0,K.jsx)(`ul`,{className:`flex flex-col divide-y rounded-md border`,children:r.map(e=>(0,K.jsx)(`li`,{className:`group`,children:l===e.id?(0,K.jsx)(`div`,{className:`p-3`,children:w()}):(0,K.jsxs)(`div`,{className:`flex items-start gap-3 p-3`,children:[(0,K.jsx)(HB,{checked:e.status===`done`,onCheckedChange:()=>S(e),disabled:!n,"aria-label":e.status===`done`?`Mark open`:`Mark done`,className:`mt-0.5`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:e.status===`done`?`text-sm text-muted-foreground line-through`:`text-sm`,children:e.title}),(e.due_date||e.priority)&&(0,K.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:[e.due_date&&(0,K.jsxs)(lR,{variant:`outline`,className:`text-[10px]`,children:[`Due `,e.due_date]}),e.priority&&(0,K.jsx)(lR,{variant:$pt[e.priority]??`outline`,className:`text-[10px] capitalize`,children:e.priority})]})]}),n&&(0,K.jsxs)(`div`,{className:`flex shrink-0 gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100`,children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":`Edit action item`,onClick:()=>y(e),children:(0,K.jsx)(w_,{className:`h-3.5 w-3.5`})}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":`Delete action item`,onClick:()=>C(e),children:(0,K.jsx)(V_,{className:`h-3.5 w-3.5 text-destructive`})})]})]})},e.id))})]})}function tmt(e){let t=new Date(e),n=Date.now()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return`just now`;if(r<60)return`${r}m`;let i=Math.floor(r/60);if(i<24)return`${i}h`;let a=Math.floor(i/24);return a<7?`${a}d`:t.toLocaleDateString()}function nmt(){let{t:e}=V(),{matterId:t}=Cv(),[n,r]=(0,B.useState)([]),[i,a]=(0,B.useState)(!1);return(0,B.useEffect)(()=>
776{if(!t)return;let e=!1;return(async()=>{a(!0);try{let n=await Sye(t);if(!e){let e=n.data;r(Array.isArray(e)?e:[])}}finally{e||a(!1)}})(),()=>{e=!0}},[t]),i&&n.length===0?(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e(`common.loading`)}):n.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center text-muted-foreground`,children:[(0,K.jsx)(Sg,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`text-sm`,children:e(`matters.activity_tab.empty`)??`No activity yet.`}),(0,K.jsx)(`p`,{className:`text-xs`,children:e(`matters.activity_tab.empty_hint`)??`Events from emails, evaluations, and redlines linked to this matter will appear here.`})]}):(0,K.jsx)(`ul`,{className:`flex flex-col divide-y rounded-md border`,children:n.map(e=>(0,K.jsxs)(`li`,{className:`flex items-start gap-3 p-3`,children:[(0,K.jsx)(`div`,{className:`mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-primary/60`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,K.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,K.jsx)(lR,{variant:`outline`,className:`text-[10px] capitalize`,children:e.type.replace(/_/g,` `)})]}),(0,K.jsx)(`div`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.message})]}),(0,K.jsx)(`div`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:tmt(e.created_at)})]},e.id))})}function rmt({label:e,value:t,icon:n,onClick:r}){return(0,K.jsxs)(`button`,{type:`button`,onClick:r,className:`flex w-full items-center gap-3 rounded-lg border bg-card p-4 text-left transition-colors hover:bg-muted/40 focu
776s-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,K.jsx)(n,{className:`h-5 w-5 text-muted-foreground`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-2xl font-semibold leading-none`,children:t}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e})]})]})}function o1(){let{matterId:e}=Cv(),t=Sv(),n=Yx(e=>e.matterDetail);if(!n||n.id!==e)return null;let r=n=>t(`/matters/${e}/${n}`),i=Y$(n),a=[{key:`emails`,label:`Emails`,value:n.email_task_count??0,icon:__,tab:`emails`,sharedVisible:!1},{key:`documents`,label:`Documents`,value:n.document_count??0,icon:i_,tab:`resources/documents`,sharedVisible:!0},{key:`conversations`,label:`Conversations`,value:n.conversation_count??0,icon:x_,tab:`resources/conversations`,sharedVisible:!0},{key:`evaluations`,label:`Evaluations`,value:n.evaluation_count??0,icon:qg,tab:`resources/evaluations`,sharedVisible:!1},{key:`redlines`,label:`Redline suggestions`,value:n.redline_suggestion_count??0,icon:s_,tab:`resources/redlines`,sharedVisible:!1},{key:`knowledge-bases`,label:`Knowledge bases`,value:n.knowledge_base_count??0,icon:o_,tab:`resources/knowledge-bases`,sharedVisible:!1},{key:`calendar`,label:`Calendar events`,value:n.calendar_event_count??0,icon:Pg,tab:`resources/calendar`,sharedVisible:!1}],o=i?a.filter(e=>e.sharedVisible):a;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[!i&&(0,K.jsxs)(`div`,{className:`grid grid-cols-2`,children:[(0,K.jsx)(a1,{matterId:e}),(0,K.jsxs)(`section`,{children:[(0,K.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-medium uppercase tracking-wide text-muted-foreground`,children:[(0,K.jsx)(m_,{className:`h-4 w-4`}),`Action items`,(n.action_item_count??0)>0&&(0,K.jsx)(lR,{variant:`secondary`,className:`text-[10px]`,children:n.action_item_count})]}),(0,K.jsx)(emt,{})]})]}),n.notes&&(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h2`,{className:`mb-3 text-sm font-medium uppercase tracking-wide text-muted-foreground`,children:`Notes`}),(0,K.jsx)(`div`,{className:`rounded-md border bg-muted/30 p-4 text-sm whitespace-pre-wrap`,children:n.notes})]}),!i&&(0,K.jsxs)(`section`,{children:[(0,K.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-medium uppercase tracking-wide text-muted-foreground`,children:[(0,K.jsx)(Sg,{className:`h-4 w-4`}),`Activity`]}),(0,K.jsx)(nmt,{})]}),(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h2`,{className:`mb-3 text-sm font-medium uppercase tracking-wide text-muted-foreground`,children:`Linked resources`}),(0,K.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4`,children:o.map(e=>(0,K.jsx)(rmt,{label:e.label,value:e.value,icon:e.icon,onClick:()=>r(e.tab)},e.key))})]})]})}function s1({value:e,onChange:t,options:n}){return(0,K.jsxs)(vO,{value:e,onValueChange:e=>t(e),children:[(0,K.jsxs)(bO,{className:`h-7 w-auto gap-1 border-none bg-transparent px-2 text-xs text-muted-foreground shadow-none hover:bg-muted/50`,children:[(0,K.jsx)(Dg,{className:`h-3 w-3`}),(0,K.jsx)(yO,{})]}),(0,K.jsx)(xO,{align:`end`,children:n.map(e=>(0,K.jsx)(SO,{value:e.value,className:`text-xs`,children:e.label},e.value))})]})}function imt({thread:e}){let t=e.messages;return t?.length?(0,K.jsx)(`div`,{className:`space-y-2 border-t bg-muted/20 p-3`,children:t.map((e,n)=>{let r=n>0?t[n-1]:null;return(0,K.jsxs)(`div`,{children:[r&&(0,K.jsx)(z3e,{previous:r,current:e}),(0,K.jsx)(R3e,{message:e,variant:`matter`})]},(e.email_task_id??`msg`)+`:`+n)})}):null}function amt({thread:e,matterId:t}){let{t:n}=V(),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(!1),s=Yx(e=>e.resolveThread),c=Yx(e=>e.unresolveThread),l=Yx(e=>e.deleteThread),{attributes:u,listeners:d,setNodeRef:f,isDragging:p}=i3e({id:`thread:${e.thread_id}`,data:{type:`thread`,thread:e,matterId:t}}),m=e.sla_state??`ok`,h=e.business_days_since_last??0,g=e.warn_days??5,_=e.critical_days??10,v=e.is_resolved??!1,y=q3e(e);return(0,K.jsxs)(`li`,{className:`flex flex-col`,children:[(0,K.jsxs)(`div`,{ref:f,...d,...u,className:q(`flex w-full cursor-grab items-center gap-2 px-3 py-2 hover:bg-muted/40`,r&&`bg-muted/20`,p&&`opacity-40`),children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,K.jsx)(`span`,{className:`shrink-0`,children:r?(0,K.jsx)(Rg,{className:`h-4 w-4 text-muted-foreground`}):(0,K.jsx)(Bg,{className:`h-4 w-4 text-muted-foreground`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:q(`truncate text-sm font-medium`,v&&`text-muted-foreground`),children:e.subject||`(no subject)`}),(0,K.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[`· `,e.message_count??0,` message`,(e.message_count??0)===1?``:`s`]}),(e.messages??[]).some(e=>e.has_attachments)&&(0,K.jsx)(C_,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-label":`Has attachments`})]}),(0,K.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:y})]})]}),v?(0,K.jsx)(B3e,{label:`Completed`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(G3e,{participant:e.whose_turn}),(0,K.jsx)(W3e,{state:m,businessDays:h,lastMessageAt:e.last_message_at,warnDays:g,criticalDays:_})]}),(0,K.jsxs)(LD,{children:[(0,K.jsx)(RD,{asChild:!0,children:(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:e=>e.stopPropagation(),"aria-label":`Thread actions`,children:(0,K.jsx)(Zg,{className:`size-4`})})}),(0,K.jsxs)(zD,{align:`end`,children:[v?(0,K.jsx)(VD,{onClick:()=>void c(t,e.thread_id),children:`Reopen`}):(0,K.jsxs)(VD,{onClick:()=>void s(t,e.thread_id),children:[(0,K.jsx)(Lg,{className:`size-4`}),`Mark as completed`]}),(0,K.jsxs)(VD,{variant:`destructive`,onClick:()=>o(!0),children:[(0,K.jsx)(V_,{className:`size-4`}),n(`matters.threads.delete`)]})]})]})]}
776),r?(0,K.jsx)(imt,{thread:e}):null,(0,K.jsx)(HC,{open:a,onOpenChange:o,children:(0,K.jsxs)(WC,{children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:n(`matters.threads.delete`)}),(0,K.jsx)(JC,{children:n(`matters.threads.delete_confirm`)})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`outline`,onClick:()=>o(!1),children:n(`common.cancel`)}),(0,K.jsx)(J,{variant:`destructive`,onClick:()=>{o(!1),l(t,e.thread_id)},children:n(`common.delete`)})]})]})})]})}const omt=[{value:`recency`,label:`Recent activity`},{value:`due`,label:`Oldest waiting`},{value:`whose_turn`,label:`Your turn first`},{value:`unresolved`,label:`Open first`}];function smt(e,t){let n=[...e];return t===`recency`?(n.sort((e,t)=>new Date(t.last_message_at).getTime()-new Date(e.last_message_at).getTime()),n):t===`due`?(n.sort((e,t)=>{let n=(t.business_days_since_last??0)-(e.business_days_since_last??0);return n===0?new Date(t.last_message_at).getTime()-new Date(e.last_message_at).getTime():n}),n):t===`whose_turn`?(n.sort((e,t)=>{let n=Number(t.whose_turn?.is_self??!1)-Number(e.whose_turn?.is_self??!1);return n===0?(t.business_days_since_last??0)-(e.business_days_since_last??0):n}),n):(n.sort((e,t)=>{let n=Number(e.is_resolved??!1)-Number(t.is_resolved??!1);return n===0?new Date(t.last_message_at).getTime()-new Date(e.last_message_at).getTime():n}),n)}const cmt=[{value:`updated`,label:`Recently updated`},{value:`created`,label:`Date created`},{value:`title`,label:`Title AâZ`}];function lmt(e,t){let n=[...e];return t===`updated`?(n.sort((e,t)=>new Date(t.updated_at).getTime()-new Date(e.updated_at).getTime()),n):t===`created`?(n.sort((e,t)=>new Date(t.created_at).getTime()-new Date(e.created_at).getTime()),n):(n.sort((e,t)=>e.title.localeCompare(t.title)),n)}function umt({threads:e,loading:t,matterId:n,category:r,emptyState:i}){let{threadSortKey:a,setThreadSortKey:o}=Yx(),s=smt(r?e.filter(e=>e.category===r):e,a);return t&&s.length===0?(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Loading threadsâ¦`}):s.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center text-muted-foreground`,children:[i.icon,(0,K.jsx)(`p`,{className:`text-sm`,children:i.title}),i.hint?(0,K.jsx)(`p`,{className:`text-xs`,children:i.hint}):null]}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s.length>1&&(0,K.jsx)(`div`,{className:`flex justify-end`,children:(0,K.jsx)(s1,{value:a,onChange:o,options:omt})}),(0,K.jsx)(`ul`,{className:`flex flex-col divide-y rounded-md border`,children:s.map(e=>(0,K.jsx)(amt,{thread:e,matterId:n},e.thread_id))})]})}function dmt(){let{matterId:e}=Cv(),{matterThreads:t,loadMatterThreads:n,isLoadingThreads:r}=Yx();return(0,B.useEffect)(()=>{e&&n(e)},[e,n]),(0,K.jsx)(umt,{threads:t,loading:r,matterId:e??``,emptyState:{icon:(0,K.jsx)(l_,{className:`h-8 w-8`}),title:`No email threads in this matter`,hint:`Open Inbox in the sidebar and re-file emails into this matter.`}})}function c1({open:e,onOpenChange:t,title:n,description:r,candidates:i,currentlyLinkedIds:a,onLink:o,emptyMessage:s,searchPlaceholder:c}){let{t:l}=V(),[u,d]=(0,B.useState)(null),f=i.filter(e=>!a.has(e.id)),p=async e=>{if(!u){d(e);try{await o(e),t(!1)}finally{d(null)}}};return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsxs)(WC,{className:`gap-3 p-0 sm:max-w-lg`,children:[(0,K.jsxs)(GC,{className:`px-6 pt-5`,children:[(0,K.jsx)(qC,{children:n}),r&&(0,K.jsx)(JC,{children:r})]}),(0,K.jsxs)(XO,{className:`pb-2`,children:[(0,K.jsx)(ZO,{placeholder:c??l(`common.search`)??`Searchâ¦`}),(0,K.jsxs)(QO,{className:`max-h-72`,children:[(0,K.jsx)($O,{children:s??l(`matters.no_candidates_to_link`)??`Nothing to link.`}),(0,K.jsx)(ek,{children:f.map(e=>(0,K.jsxs)(nk,{value:e.search??`${e.label} ${e.sublabel??``}`,disabled:u!==null&&u!==e.id,onSelect:()=>p(e.id),children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-sm`,children:e.label}),e.sublabel&&(0,K.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:e.sublabel})]}),u===e.id&&(0,K.jsx)(`span`,{className:`ml-2 text-[10px] text-muted-foreground`,children:`â¦`})]},e.id))})]})]})]})})}function fmt(){let{t:e}=V(),{matterId:t}=Cv(),n=RS(),r=Yx(e=>e.matterDetail),i=X$(r,n),a=bpt(r,n),{matterDocuments:o,loadDocuments:s,addDocument:c,removeDocument:l,isLoadingResources:u}=Yx(),{documents:d,fetchDocuments:f}=sk(),[p,m]=(0,B.useState)(!1);(0,B.useEffect)(()=>{t&&s(t)},[t,s]),(0,B.useEffect)(()=>{p&&d.length===0&&f()},[p,d.length,f]);let h=(0,B.useMemo)(()=>new Set(o.map(e=>e.id)),[o]),g=(0,B.useMemo)(()=>d.map(e=>
776({id:e.id,label:e.original_filename||e.filename||e.id,sublabel:`${(e.file_type??``).toUpperCase()} · ${e.status}`,search:`${e.original_filename} ${e.filename} ${e.file_type}`})),[d]),_=async e=>{t&&await c(t,e)},v=a?(0,K.jsxs)(J,{size:`sm`,variant:`outline`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>m(!0),children:[(0,K.jsx)(T_,{className:`h-3.5 w-3.5`}),e(`matters.link_document`)??`Link document`]}):null,y=(0,K.jsx)(c1,{open:p,onOpenChange:m,title:e(`matters.link_document`)??`Link a document`,description:e(`matters.link_document_desc`)??`Pick a document from your library to attach to this matter.`,candidates:g,currentlyLinkedIds:h,onLink:_});return u&&o.length===0?(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e(`common.loading`)}):o.length===0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 py-12 text-center text-muted-foreground`,children:[(0,K.jsx)(i_,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`text-sm`,children:e(`matters.documents_tab.no_documents`)??`No documents linked to this matter`}),(0,K.jsx)(`p`,{className:`text-xs`,children:e(`matters.documents_tab.empty_hint`)??`Link documents from your library â they'll show up here for quick reference.`}),v]}),y]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`mb-2 flex items-center justify-end`,children:v}),(0,K.jsx)(`ul`,{className:`flex flex-col divide-y rounded-md border`,children:o.map(n=>(0,K.jsxs)(`li`,{className:`flex items-center gap-3 p-3`,children:[(0,K.jsx)(i_,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-sm font-medium`,children:n.original_filename||n.filename}),(0,K.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[n.file_type?.toUpperCase(),` · `,n.status]})]}),i&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,"aria-label":e(`common.unlink`)??`Unlink document`,onClick:()=>t&&l(t,n.id),children:(0,K.jsx)(J_,{className:`h-3.5 w-3.5`})})]},n.id))}),y]})}function pmt(){let{t:e}=V(),{formatDateTime:t}=jb(),{matterId:n}=Cv(),r=Sv(),i=RS(),a=Yx(e=>e.matterDetail),o=X$(a,i),s=bpt(a,i),{matterConversations:c,loadConversations:l,addConversation:u,removeConversation:d,isLoadingResources:f}=Yx(),p=LS(e=>e.conversations),m=LS(e=>e.loadConversations),h=LS(e=>e.setMatterScope),g=LS(e=>e.startNewConversation),[_,v]=(0,B.useState)(!1),y=s?(0,K.jsxs)(J,{size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>{!n||!a||(g(),h({id:n,name:a.name}),r(`/chat`))},children:[(0,K.jsx)(T_,{className:`h-3.5 w-3.5`}),e(`matters.conversations_tab.new_conversation`)??`New conversation`]}):null;(0,B.useEffect)(()=>{n&&l(n)},[n,l]),(0,B.useEffect)(()=>{_&&p.length===0&&m()},[_,p.length,m]);let b=(0,B.useMemo)(()=>new Set(c.map(e=>e.id)),[c]),x=(0,B.useMemo)(()=>p.map(n=>({id:n.id,label:n.title||e(`common.untitled`)||`Untitled`,sublabel:t(n.updated_at),search:n.title||``})),[p,e,t]),S=async e=>{n&&await u(n,e)},C=o?(0,K.jsxs)(J,{size:`sm`,variant:`outline`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>v(!0),children:[(0,K.jsx)(T_,{className:`h-3.5 w-3.5`}),e(`matters.link_conversation`)??`Link conversation`]}):null,w=(0,K.jsx)(c1,{open:_,onOpenChange:v,title:e(`matters.link_conversation`)??`Link a conversation`,candidates:x,currentlyLinkedIds:b,onLink:S});return f&&c.length===0?(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e(`common.loading`)}):c.length===0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 py-12 text-center text-muted-foreground`,children:[(0,K.jsx)(x_,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`text-sm`,children:e(`matters.conversations_tab.no_conversations`)}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,C]})]}),w]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-end gap-2`,children:[y,C]}),(0,K.jsx)(`ul`,{className:`flex flex-col divide-y rounded-md border`,children:c.map(i=>(0,K.jsxs)(`li`,{role:`button`,tabIndex:0,onClick:()=>r(`/chat/${i.id}`),className:`flex cursor-pointer items-center gap-3 p-3 hover:bg-muted/40`,children:[(0,K.jsx)(x_,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-sm font-medium`,children:i.title||e(`common.untitled`)}),(0,K.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:t(i.updated_at)})]}),o&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,"aria-label":e(`common.remove`),onClick:e=>{e.stopPropagation(),n&&d(n,i.id)},children:(0,K.jsx)(J_,{className:`h-3.5 w-3.5`})})]},i.id))}),w]})}function mmt(){let{t:e}=V(),{matterId:t}=Cv(),n=Sv(),r=RS(),i=X$(Yx(e=>e.matterDetail),r),{matterEvaluations:a,loadEvaluations:o,addEvaluation:s,removeEvaluation:c,isLoadingResources:l}=Yx(),{evaluations:u,fetchEvaluations:d}=qI(),[f,p]=(0,B.useState)(!1);(0,B.useEffect)(()=>{t&&o(t)}
776,[t,o]),(0,B.useEffect)(()=>{f&&u.length===0&&d()},[f,u.length,d]);let m=(0,B.useMemo)(()=>new Set(a.map(e=>e.id)),[a]),h=(0,B.useMemo)(()=>u.map(e=>({id:e.id,label:e.playbook_name||`Evaluation`,sublabel:`${e.status}${e.overall_score==null?``:` · score ${e.overall_score.toFixed(2)}`}`,search:`${e.playbook_name??``} ${e.status}`})),[u]),g=async e=>{t&&await s(t,e)},_=i?(0,K.jsxs)(J,{size:`sm`,variant:`outline`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>p(!0),children:[(0,K.jsx)(T_,{className:`h-3.5 w-3.5`}),e(`matters.link_evaluation`)??`Link evaluation`]}):null,v=(0,K.jsx)(c1,{open:f,onOpenChange:p,title:e(`matters.link_evaluation`)??`Link an evaluation`,candidates:h,currentlyLinkedIds:m,onLink:g});return l&&a.length===0?(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e(`common.loading`)}):a.length===0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 py-12 text-center text-muted-foreground`,children:[(0,K.jsx)(qg,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`text-sm`,children:e(`matters.evaluations_tab.no_evaluations`)??`No evaluations linked yet`}),_]}),v]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`mb-2 flex items-center justify-end`,children:_}),(0,K.jsx)(`ul`,{className:`flex flex-col divide-y rounded-md border`,children:a.map(r=>(0,K.jsxs)(`li`,{role:`button`,tabIndex:0,onClick:()=>n(`/vault/evaluations`),className:`flex cursor-pointer items-center gap-3 p-3 hover:bg-muted/40`,children:[(0,K.jsx)(qg,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-sm font-medium`,children:r.playbook_name||`Evaluation`}),(0,K.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[r.status,r.overall_score!=null&&` · score ${r.overall_score.toFixed(2)}`]})]}),i&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,"aria-label":e(`common.unlink`)??`Unlink evaluation`,onClick:e=>{e.stopPropagation(),t&&c(t,r.id)},children:(0,K.jsx)(J_,{className:`h-3.5 w-3.5`})})]},r.id))}),v]})}function hmt(){let{t:e}=V(),{matterId:t}=Cv(),n=RS(),r=X$(Yx(e=>e.matterDetail),n),{matterRedlines:i,loadRedlines:a,removeRedline:o,isLoadingResources:s}=Yx();return(0,B.useEffect)(()=>{t&&a(t)},[t,a]),s&&i.length===0?(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e(`common.loading`)}):i.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center text-muted-foreground`,children:[(0,K.jsx)(s_,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`text-sm`,children:e(`matters.redlines_tab.no_redlines`)??`No redline suggestions linked yet`})]}):(0,K.jsx)(`ul`,{className:`flex flex-col divide-y rounded-md border`,children:i.map(e=>(0,K.jsxs)(`li`,{className:`flex items-start gap-3 p-3`,children:[(0,K.jsx)(s_,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,K.jsx)(lR,{variant:`outline`,className:`text-[10px] capitalize`,children:e.status}),e.clause_label&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.clause_label})]}),(0,K.jsxs)(`div`,{className:`mt-1 line-clamp-2 text-sm`,children:[(0,K.jsx)(`span`,{className:`line-through text-muted-foreground`,children:e.original_text}),` â `,(0,K.jsx)(`span`,{className:`text-foreground`,children:e.suggested_text})]})]}),r&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,"aria-label":`Unlink suggestion`,onClick:()=>t&&o(t,e.id),children:(0,K.jsx)(J_,{className:`h-3.5 w-3.5`})})]},e.id))})}function gmt(){let{t:e}=V(),{matterId:t}=Cv(),n=Sv(),r=RS(),i=Yx(e=>e.matterDetail),a=X$(i,r),{matterKnowledgeBases:o,loadKnowledgeBases:s,addKnowledgeBase:c,removeKnowledgeBase:l,setDefaultKnowledgeBase:u,isLoadingResources:d}=Yx(),f=i?.default_knowledge_base_id??null,p=Q(e=>e.knowledgeBases),m=Q(e=>e.fetchKnowledgeBases),[h,g]=(0,B.useState)(!1);(0,B.useEffect)(()=>{t&&s(t)},[t,s]),(0,B.useEffect)(()=>{h&&p.length===0&&m()},[h,p.length,m]);let _=(0,B.useMemo)(()=>new Set(o.map(e=>e.id)),[o]),v=(0,B.useMemo)(()=>p.map(t=>({id:t.id,label:t.name,sublabel:`${t.document_count??0} ${e(`matters.knowledge_bases_tab.documents`)??`documents`}`,search:t.name})),[p,e]),y=async e=>{t&&await c(t,e)},b=a?(0,K.jsxs)(J,{size:`sm`,variant:`outline`,className:`h-7 ga
776p-1.5 px-2 text-xs`,onClick:()=>g(!0),children:[(0,K.jsx)(T_,{className:`h-3.5 w-3.5`}),e(`matters.link_knowledge_base`)??`Link knowledge base`]}):null,x=(0,K.jsx)(c1,{open:h,onOpenChange:g,title:e(`matters.link_knowledge_base`)??`Link a knowledge base`,candidates:v,currentlyLinkedIds:_,onLink:y});return d&&o.length===0?(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e(`common.loading`)}):o.length===0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 py-12 text-center text-muted-foreground`,children:[(0,K.jsx)(o_,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`text-sm`,children:e(`matters.knowledge_bases_tab.no_kbs`)??`No knowledge bases linked yet`}),b]}),x]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`mb-2 flex items-center justify-end`,children:b}),(0,K.jsx)(`ul`,{className:`flex flex-col divide-y rounded-md border`,children:o.map(r=>(0,K.jsxs)(`li`,{role:`button`,tabIndex:0,onClick:()=>n(`/chat`),className:`flex cursor-pointer items-center gap-3 p-3 hover:bg-muted/40`,children:[(0,K.jsx)(o_,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`div`,{className:`truncate text-sm font-medium`,children:r.name}),r.id===f&&(0,K.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 rounded-full bg-purple-100 px-1.5 py-0.5 text-[10px] font-medium text-purple-700 dark:bg-purple-950/40 dark:text-purple-300`,children:[(0,K.jsx)(kg,{className:`h-2.5 w-2.5`}),e(`matters.knowledge_bases_tab.default_badge`)]})]}),(0,K.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[r.document_count??0,` `,e(`matters.knowledge_bases_tab.documents`)??`documents`]})]}),a&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,className:`text-xs text-muted-foreground`,onClick:e=>{e.stopPropagation(),t&&u(t,r.id===f?null:r.id).catch(()=>{})},children:r.id===f?e(`matters.knowledge_bases_tab.clear_default`):e(`matters.knowledge_bases_tab.set_default`)}),a&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,"aria-label":e(`common.unlink`)??`Unlink knowledge base`,onClick:e=>{e.stopPropagation(),t&&l(t,r.id)},children:(0,K.jsx)(J_,{className:`h-3.5 w-3.5`})})]},r.id))}),x]})}function _mt(){let{t:e}=V(),{formatDateTime:t}=jb(),{matterId:n}=Cv(),r=RS(),i=X$(Yx(e=>e.matterDetail),r),{matterCalendarEvents:a,loadCalendarEvents:o,addCalendarEvent:s,removeCalendarEvent:c,isLoadingResources:l}=Yx(),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)([]);(0,B.useEffect)(()=>{n&&o(n)},[n,o]);let m=async()=>{let e=new Date,t=new Date(e);t.setDate(t.getDate()-30);let n=new Date(e);n.setDate(n.getDate()+30);let r=(await UB({from:t.toISOString(),to:n.toISOString()})).data;p(Array.isArray(r)?r:[])},[h,g]=(0,B.useState)(u);h!==u&&(g(u),u&&f.length===0&&m());let _=(0,B.useMemo)(()=>new Set(a.map(e=>e.id)),[a]),v=(0,B.useMemo)(()=>f.map(n=>({id:n.id,label:n.title||e(`common.untitled`)||`Untitled`,sublabel:n.start_time?t(n.start_time):n.start_date??``,search:`${n.title??``} ${n.location??``}`})),[f,e,t]),y=async e=>{n&&await s(n,e)},b=i?(0,K.jsxs)(J,{size:`sm`,variant:`outline`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>d(!0),children:[(0,K.jsx)(T_,{className:`h-3.5 w-3.5`}),e(`matters.link_calendar_event`)??`Link event`]}):null,x=(0,K.jsx)(c1,{open:u,onOpenChange:d,title:e(`matters.link_calendar_event`)??`Link a calendar event`,description:e(`matters.link_calendar_event_desc`)??`Pick from events in the next 30 days or the past 30 days.`,candidates:v,currentlyLinkedIds:_,onLink:y});return l&&a.length===0?(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e(`common.loading`)}):a.length===0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 py-12 text-center text-muted-foreground`,children:[(0,K.jsx)(Pg,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`text-sm`,children:e(`matters.calendar_tab.no_events`)}),b]}),x]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`mb-2 flex items-center justify-end`,children:b}),(0,K.jsx)(`ul`,{className:`flex flex-col divide-y rounded-md border`,children:a.map(r=>(0,K.jsxs)(`li`,{className:`flex items-center gap-3 p-3`,children:[(0,K.jsx)(Pg,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-sm font-medium`,children:r.title||e(`common.untitled`)}),(0,K.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:r.start_time?t(r.start_time):r.start_date})]}),i&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,"aria-label":e(`common.remove`),onClick:()=>n&&c(n,r.id),children:(0,K.jsx)(J_,{className:`h-3.5 w-3.5`})})]},r.id))}),x]})}var vmt=[{key:`documents`,labelKey:`matters.tabs.documents`,count:e=>e.document_count,Component:fmt},{key:`conversations`,labelKey:`matters.tabs.conversations`,count:e=>e.conversation_count,Component:pmt},{key:`evaluations`,labelKey:`matters.tabs.evaluations`,count:e=>e.evaluation_count,Component:mmt},{key:`redlines`,labelKey:`matters.tabs.redlines`,count:e=>e.redline_suggestion_count,Component:hmt},{key:`knowledge-bases`,labelKey:`matters.tabs.knowledge_bases`,count:e=>e.knowledge_base_count,Component:gmt},{key:`calendar`,labelKey:`matters.tabs.calendar`,count:e=>e.calendar_event_count,Component:_mt}];function ymt(){let{t:e}=V(),{matterId:t,resourceType:n}=Cv(),r=Sv(),i=Yx(e=>e.matterDetail),a=Y$(i)?vmt.filter(e=>e.key===`documents`||e.key===`conversations`):vmt,o=a.some(e=>e.key===n)?n:a[0].key,s=(a.find(e=>e.key===o)??a[0]).Component;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsx)(bV,{value:o,onValueChange:e=>r(`/matters/${t}/resources/${e}`),className:`w-fit`,children:(0,K.jsx)(xV,{className:`w-fit`,children:a.map(t=>(0,K.jsxs)(SV,{value:t.key,children:[e(t.labelKey),(0,K.jsx)(`span`,{className:`ml-1.5 rounded-full bg-muted px-1.5 text-[10px]`,children:i?t.count(i)??0:0})]},t.key))})}),(0,K.jsx)(s,{})]})}function l1(e,t,n){let r={};return t.length&&(r[0]={},t.forEach((e,t)=>{r[0][String(t)]={v:e,t:1,s:{bl:1}}}
776)),n.forEach((e,t)=>{let n=t+1;r[String(n)]={},r[String(n)][0]={v:e.label,t:1,s:e.isTotal?{bl:1}:{}},e.cells?.forEach((t,i)=>{r[String(n)][String(i+1)]={v:t,t:typeof t==`number`?2:1,s:e.isTotal?{bl:1}:{}}})}),{id:`finance-doc`,name:e,appVersion:`0.1.0`,locale:`enUS`,sheetOrder:[`sheet-01`],styles:{},sheets:{"sheet-01":{id:`sheet-01`,name:e,rowCount:Math.max(n.length+5,50),columnCount:Math.max(t.length,8),cellData:r,mergeData:[],rowData:{},columnData:{},freeze:{startRow:1,startColumn:0,xSplit:0,ySplit:1},showGridlines:1,defaultRowHeight:24,defaultColumnWidth:120}}}}const bmt={pnl:{title:`P&L statement`,content:l1(`P&L`,[`Line item`,`Q1`,`Q2`,`Q3`,`Q4`,`YTD`],[{label:`Revenue`,cells:[0,0,0,0,0]},{label:`Cost of Goods Sold`,cells:[0,0,0,0,0]},{label:`Gross Profit`,cells:[0,0,0,0,0],isTotal:!0},{label:`Operating Expenses`,cells:[0,0,0,0,0]},{label:`Operating Income`,cells:[0,0,0,0,0],isTotal:!0},{label:`Net Income`,cells:[0,0,0,0,0],isTotal:!0}])},balance_sheet:{title:`Balance Sheet`,content:l1(`Balance Sheet`,[`Line item`,`Current period`,`Prior period`],[{label:`Assets`,isTotal:!0},{label:` Cash and equivalents`,cells:[0,0]},{label:` Accounts receivable`,cells:[0,0]},{label:` Inventory`,cells:[0,0]},{label:` Total Assets`,cells:[0,0],isTotal:!0},{label:`Liabilities`,isTotal:!0},{label:` Accounts payable`,cells:[0,0]},{label:` Long-term debt`,cells:[0,0]},{label:` Total Liabilities`,cells:[0,0],isTotal:!0},{label:`Equity`,isTotal:!0},{label:` Retained earnings`,cells:[0,0]},{label:` Total Equity`,cells:[0,0],isTotal:!0}])},income_statement:{title:`Income Statement`,content:l1(`Income Statement`,[`Line item`,`Current period`,`Prior period`],[{label:`Revenue`,cells:[0,0]},{label:`Cost of Revenue`,cells:[0,0]},{label:`Gross Profit`,cells:[0,0],isTotal:!0},{label:`Operating Expenses`,cells:[0,0]},{label:`Operating Income`,cells:[0,0],isTotal:!0},{label:`Other Income / (Expense)`,cells:[0,0]},{label:`Net Income`,cells:[0,0],isTotal:!0}])},text:{title:`Untitled note`,content:{type:`doc`,content:[{type:`heading`,attrs:{level:1},content:[{type:`text`,text:`Untitled note`}]},{type:`paragraph`}]}}};var xmt=[{key:`pnl`,label:`P&L statement`,description:`Quarterly P&L with formulas`,icon:r_},{key:`balance_sheet`,label:`Balance Sheet`,description:`Assets / Liabilities / Equity`,icon:r_},{key:`income_statement`,label:`Income Statement`,description:`Period-over-period income`,icon:r_},{key:`text`,label:`Blank text`,description:`Free-form memo or notes`,icon:i_}];function Smt({matterId:e,open:t,onOpenChange:n,onCreated:r}){let{t:i}=V(),{createDocument:a}=rR(),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(!1),f=async t=>{l(!0);try{let n=bmt[t];r((await a({matter_id:e,title:o.trim()||n.title,doc_type:t,content:n.content})).id)}catch(t){Y(t,i(`toasts.finance.create_failed`),{operation:`finance_create_document`,metadata:{matterId:e}}),l(!1)}},p=async t=>{d(!0);try{let n=(await q0e({file:t,matter_id:e,title_override:o.trim()||void 0})).data;r(n.id)}catch(n){Y(n,i(`errors.upload_failed`),{operation:`finance_upload_document`,metadata:{matterId:e,fileName:t.name}}),d(!1)}},m=c||u;return(0,K.jsx)(HC,{open:t,onOpenChange:e=>!m&&n(e),children:(0,K.jsxs)(WC,{className:`sm:max-w-lg`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:`New finance document`}),(0,K.jsx)(JC,{children:`Pick a template, upload an existing file, or start blank. Complex formatting (charts, themes, custom styles) may not be preserved on upload.`})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium`,htmlFor:`finance-title`,children:`Title (optional)`}),(0,K.jsx)(dP,{id:`finance-title`,value:o,onChange:e=>s(e.target.value),placeholder:`Defaults to the template name or uploaded filename`,disabled:m})]}),(0,K.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:xmt.map(e=>{let t=e.icon;return(0,K.jsxs)(`button`,{onClick:()=>f(e.key),disabled:m,className:`flex items-start gap-3 rounded-md border p-3 text-left transition hover:border-foreground
776/40 hover:bg-muted/50 disabled:opacity-50`,children:[(0,K.jsx)(t,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description})]})]},e.key)})}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-dashed p-3`,children:[(0,K.jsx)(W_,{className:`h-4 w-4 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:`Upload existing`}),(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`.xlsx / .xls / .csv / .docx / .doc`})]}),(0,K.jsxs)(`label`,{className:`ml-auto inline-flex cursor-pointer items-center gap-1 rounded-md border bg-background px-3 py-1.5 text-xs font-medium hover:bg-muted`,children:[`Choose file`,(0,K.jsx)(`input`,{type:`file`,accept:`.xlsx,.xls,.csv,.docx,.doc`,disabled:m,onChange:e=>{let t=e.target.files?.[0];t&&p(t)},className:`hidden`})]})]}),(0,K.jsx)(KC,{children:(0,K.jsx)(J,{variant:`outline`,onClick:()=>n(!1),disabled:m,children:`Cancel`})})]})})}function Cmt(e){if(!e)return``;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}var wmt={pnl:`P&L`,balance_sheet:`Balance Sheet`,income_statement:`Income Statement`,text:`Notes`};function Tmt(){let{matterId:e}=Cv(),t=Sv(),n=RS()!==`viewer`,{matterThreads:r,matterFinanceDocuments:i,loadMatterThreads:a,loadMatterFinanceDocuments:o,isLoadingThreads:s,financeDocSortKey:c,setFinanceDocSortKey:l}=Yx(),u=lmt(i,c),[d,f]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{e&&(a(e),o(e))},[e,a,o]),(0,K.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Finance deliverables and finance-classified emails for this matter.`}),n&&(0,K.jsxs)(J,{size:`sm`,onClick:()=>f(!0),className:`gap-1`,children:[(0,K.jsx)(T_,{className:`h-4 w-4`}),`New finance document`]})]}),(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h3`,{className:`mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Finance emails`}),(0,K.jsx)(umt,{threads:r,loading:s,matterId:e??``,category:`finance`,emptyState:{icon:(0,K.jsx)(__,{className:`h-8 w-8`}),title:`No finance threads yet`,hint:`Send a finance-classified email to populate this section.`}})]}),(0,K.jsxs)(`section`,{children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Finance documents`}),u.length>1&&(0,K.jsx)(s1,{value:c,onChange:l,options:cmt})]}),u.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center text-muted-foreground`,children:[(0,K.jsx)(r_,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`text-sm`,children:`No finance documents yet`}),(0,K.jsx)(`p`,{className:`text-xs`,children:`Create a finance document from a template to populate this section.`})]}):(0,K.jsx)(`ul`,{className:`flex flex-col divide-y rounded-md border`,children:u.map(n=>(0,K.jsx)(`li`,{role:`button`,tabIndex:0,onClick:()=>t(`/matters/${e}/finance/${n.id}`),className:`flex cursor-pointer flex-col gap-1 p-3 hover:bg-muted/40`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n.doc_type===`text`?(0,K.jsx)(i_,{className:`h-3.5 w-3.5 text-muted-foreground`}):(0,K.jsx)(r_,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`truncate text-sm font-medium`,children:n.title}),(0,K.jsx)(lR,{variant:`outline`,className:`ml-auto text-[10px]`,children:wmt[n.doc_type]??n.doc_type}),(0,K.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:Cmt(n.updated_at)})]})},n.id))})]}),d&&e&&(0,K.jsx)(Smt,{matterId:e,open:d,onOpenChange:f,onCreated:n=>{f(!1),t(`/matters/${e}/finance/${n}`)}})]})}function Emt(){let{chatMessages:e,isStreaming:t,pendingPatches:n,sendLlmEdit:r,cancelLlmEdit:i,consumePatch:a,selectedDocument:o}=rR(),s=RS()===`viewer`,[c,l]=(0,B.useState)(``),u=(0,B.useRef)(null);(0,B.useEffect)(()=>{u.current?.scrollIntoView({behavior:`smooth`})},[e,n]);let d=()=>{let e=c.trim();!e||t||s||(l(``),r(e))},f=e=>{let t=n.find(t=>t.seq===e);if(!t)return;let r=o?.doc_type,i=window,s=!1;r===`text`&&i.__applyFinancePatch?s=i.__applyFinancePatch(t):r!==`text`&&i.__applyUniverPatch&&(s=i.__applyUniverPatch(t)),s&&a(e)},p=e=>{a(e)};return(0,K.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,K.jsx)(L_,{className:`h-4 w-4 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:`Assistant`})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-3`,children:[e.length===0&&n.length===0&&(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-1 py-12 text-center text-xs text-muted-foreground`,children:[(0,K.jsx)(L_,{className:`h-6 w-6`}),(0,K.jsx)(`p`,{children:`Ask the assistant to edit this document.`}),(0,K.jsx)(`p`,{className:`text-[10px]`,children:`e.g. "Add a row for Marketing expenses at $5,000"`})]}),e.map((n,r)=>(0,K.jsxs)(`div`,{className:`mb-3 flex flex-col gap-1 ${n.role===`user`?`items-end`:`items-start`}`,children:[(0,K.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:n.role===`user`?`You`:`Assistant`}),(0,K.jsx)(`div`,{className:`max-w-[90%] whitespace-pre-wrap rounded-md px-3 py-2 text-sm ${n.role===`user`?`bg-primary text-primary-foreground`:`bg-muted`}`,children:n.content||(t&&r===e.length-1?`â¦`:``)})]},r)),n.length>0&&(0,K.jsxs)(`div`,{className:`mb-3 flex flex-col gap-2 rounded-md border border-dashed p-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:`Proposed edits`}),n.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md bg-muted/40 p-2 text-xs`,children:[(0,K.jsx)(`code`,{className:`truncate text-[11px]`,children:e.op}),(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`default`,className:`ml-auto h-7 gap-1`,onClick:()=>f(e.seq),disabled:s,children:[(0,K.jsx)(Lg,{className:`h-3 w-3`}),`Apply`]}),(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 w-7 p-0`,onClick:()=>p(e.seq),children:(0,K.jsx)(J_,{className:`h-3 w-3`})})]},e.seq))]}),(0,K.jsx)(`div`,{ref:u})]}),s?(0,K.jsx)(`div`,{className:`border-t p-3 text-center text-xs text-muted-foreground`,children:`You have read-only access to this finance document.`}):(0,K.jsx)(`div`,{className:`border-t p-2`,children:(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),d())},placeholder:`Ask for an editâ¦`,disabled:t,rows:2,className:`min-h-[2.5rem] flex-1 resize-none rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`}),t?(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`outline`,onClick:i,className:`h-auto`,children:(0,K.jsx)(Sse,{className:`h-4 w-4`})}):(0,K.jsx)(J,{type:`button`,size:`sm`,onClick:d,disabled:!c.trim(),className:`h-auto`,children:(0,K.jsx)(Og,{className:`h-4 w-4`})})]})})]})}const Dmt=()=>`/api/v1/email-tasks/meeting-requests`,Omt=async e=>Z(Dmt(),{...e,method:`GET`}),kmt=e=>`/api/v1/email-tasks/${e}/rsvp`,Amt=async(e,t,n)=>Z(kmt(e),{...n,method:`POST`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),jmt=e=>`/api/v1/email-tasks/${e}`,Mmt=async(e,t)=>Z(jmt(e),{...t,method:`GET`});var Nmt={pnl:`P&L statement`,balance_sheet:`Balance Sheet`,income_statement:`Income Statement`,text:`Free-form note`};function Pmt({document:e}){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(!1);return(0,B.useEffect)(()=>
776{if(!e.email_task_id){n(null);return}let t=!1;return i(!0),(async()=>{try{let r=await Mmt(e.email_task_id);if(t)return;n(r.data)}catch{}finally{t||i(!1)}})(),()=>{t=!0}},[e.email_task_id]),e.email_task_id?(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Source email`}),r&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loadingâ¦`}),t&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(__,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`truncate font-medium`,children:t.from_name||t.from_email}),(0,K.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:t.subject||`(no subject)`})]})]}),t.body&&(0,K.jsx)(`pre`,{className:`max-h-96 overflow-y-auto whitespace-pre-wrap break-words rounded-md border bg-muted/30 p-2 text-xs leading-relaxed`,children:t.body.slice(0,4e3)})]}),!r&&!t&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Source email is no longer available (deleted or moved).`})]}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Template info`}),(0,K.jsxs)(`div`,{className:`flex items-start gap-2 text-sm`,children:[(0,K.jsx)(i_,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`font-medium`,children:Nmt[e.doc_type]??e.doc_type}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Created manually from a template. No source email to display.`})]})]})]})}function Fmt(){let{matterId:e,documentId:t}=Cv(),n=Sv(),r=RS()!==`viewer`,{selectedDocument:i,isLoading:a,loadDocument:o,clearSelected:s,deleteDocument:c}=rR();return(0,B.useEffect)(()=>(t&&o(t),()=>{s()}),[t,o,s]),a&&!i?(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Loading finance documentâ¦`}):i?(0,K.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-4 py-2`,children:[(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>n(`/matters/${e}/finance`),children:(0,K.jsx)(Tg,{className:`h-4 w-4`})}),(0,K.jsx)(`span`,{className:`truncate text-sm font-medium`,children:i.title}),(0,K.jsx)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:i.doc_type}),r&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:async()=>{if(t&&confirm(`Delete this finance document? This cannot be undone.`))try{await c(t),G.success(`Finance document deleted`),n(`/matters/${e}/finance`)}catch(e){G.error(e?.message||`Failed to delete`)}},className:`ml-auto text-destructive hover:text-destructive`,children:(0,K.jsx)(V_,{className:`h-4 w-4`})})]}),(0,K.jsxs)(IH,{orientation:`horizontal`,id:`finance-doc-detail`,className:`min-h-0 flex-1`,children:[(0,K.jsx)(LH,{id:`finance-left`,defaultSize:`20%`,minSize:`0%`,maxSize:`40%`,children:(0,K.jsx)(`aside`,{className:`h-full overflow-y-auto`,children:(0,K.jsx)(Pmt,{document:i})})}),(0,K.jsx)(RH,{withHandle:!0}),(0,K.jsx)(LH,{id:`finance-center`,defaultSize:`55%`,minSize:`30%`,children:(0,K.jsx)(`main`,{className:`h-full min-w-0 overflow-hidden`,children:(0,K.jsx)(B.Suspense,{fallback:(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Loading editorâ¦`}),children:(0,K.jsx)(mft,{document:i})})})}),(0,K.jsx)(RH,{withHandle:!0}),(0,K.jsx)(LH,{id:`finance-right`,defaultSize:`25%`,minSize:`0%`,maxSize:`45%`,children:(0,K.jsx)(`aside`,{className:`h-full overflow-hidden`,children:(0,K.jsx)(Emt,{})})})]})]}):(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Finance document not found`})}function u1(){let e=DS(e=>e.compose),t=DS(e=>e.closeCompose),n=DS(e=>e.updateComposePayload),r=DS(e=>e.saveDraft),i=DS(e=>e.sendMessage),a=DS(e=>e.sending),o=DS(e=>e.savingDraft),s=DS(e=>
776e.provider),c=uS(fS()[s]),l=lS[s].supportsDraftSave,[u,d]=(0,B.useState)(!1);if(!e)return null;let{mode:f,payload:p}=e,m=u||!!(p.cc||p.bcc),h=f===`reply`||f===`reply_all`?`Re: ${p.subject||``}`:f===`forward`?`Fwd: ${p.subject||``}`:`New Message`,g=!!(p.to||p.cc||p.bcc||p.subject||p.body);return(0,K.jsx)(nL,{open:e.open,onOpenChange:e=>{e||(g&&!p.draft_id&&c&&l&&r(),t())},children:(0,K.jsxs)(rL,{side:`right`,className:`!w-[640px] sm:!max-w-[640px] rounded-l-2xl p-0 flex flex-col`,children:[(0,K.jsx)(aL,{className:`sr-only`,children:h}),(0,K.jsx)(`div`,{className:`flex items-center justify-between border-b border-border/40 px-5 py-3`,children:(0,K.jsx)(`div`,{className:`text-base font-semibold tracking-tight truncate`,children:h})}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-border/40 px-5 py-3 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`label`,{className:`w-12 shrink-0 text-xs uppercase text-muted-foreground tracking-wider`,children:`To`}),(0,K.jsx)(bU,{value:p.to,onChange:e=>n({to:e}),provider:s,placeholder:`[email protected]`,inputClassName:`border-0 shadow-none focus-visible:ring-0 px-0 h-8`}),!m&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>d(!0),className:`text-xs text-muted-foreground hover:text-foreground`,children:`Cc/Bcc`})]}),m&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`label`,{className:`w-12 shrink-0 text-xs uppercase text-muted-foreground tracking-wider`,children:`Cc`}),(0,K.jsx)(bU,{value:p.cc,onChange:e=>n({cc:e}),provider:s,inputClassName:`border-0 shadow-none focus-visible:ring-0 px-0 h-8`})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`label`,{className:`w-12 shrink-0 text-xs uppercase text-muted-foreground tracking-wider`,children:`Bcc`}),(0,K.jsx)(bU,{value:p.bcc,onChange:e=>n({bcc:e}),provider:s,inputClassName:`border-0 shadow-none focus-visible:ring-0 px-0 h-8`})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`label`,{className:`w-12 shrink-0 text-xs uppercase text-muted-foreground tracking-wider`,children:`Subj`}),(0,K.jsx)(dP,{value:p.subject,onChange:e=>n({subject:e.target.value}),placeholder:`Subject`,className:`border-0 shadow-none focus-visible:ring-0 px-0 h-8`})]})]}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-4`,children:(0,K.jsx)(`textarea`,{value:p.body,onChange:e=>n({body:e.target.value}),placeholder:`Write your messageâ¦`,className:q(`w-full h-full min-h-[12rem] resize-none border-0 bg-transparent`,`text-sm leading-relaxed`,`focus:outline-none placeholder:text-muted-foreground`)})}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/40 px-5 py-3`,children:[(0,K.jsx)(J,{onClick:i,disabled:a||!p.to.trim(),className:`rounded-lg bg-blue-600 hover:bg-blue-700 text-white`,children:a?`Sendingâ¦`:`Send`}),l&&(0,K.jsx)(J,{variant:`outline`,onClick:r,disabled:o||!g,className:`rounded-lg`,children:o?`Savingâ¦`:`Save Draft`}),(0,K.jsx)(`div`,{className:`ml-auto`,children:(0,K.jsxs)(`button`,{type:`button`,onClick:t,className:`flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:[`Discard `,(0,K.jsx)(Rg,{className:`size-3`})]})})]})]})})}function Imt({byFolder:e,messageMap:t,folder:n}){return(e[n]?.ids??[]).filter(e=>t[e])}function d1(e,t){if(!t)return null;let n=e.indexOf(t);return n===-1?null:e[n+1]??e[n-1]??null}function Lmt(){let{t:e}=V(),t=fS();return(0,K.jsx)(`div`,{className:`flex h-full flex-1 items-center justify-center p-12`,children:(0,K.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,K.jsx)(`div`,{className:`mx-auto mb-6 flex size-12 items-center justify-center rounded-full bg-muted/60`,children:(0,K.jsx)(__,{className:`size-6 text-muted-foreground`})}),(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:e(`mail.providers.connect_title`)}),(0,K.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e(`mail.providers.connect_description`)}),(0,K.jsx)(`div`,{className:`mt-6 flex flex-col items-center gap-2`,children:eS.map(n=>{let r=lS[n],i=r.icon;
776return(0,K.jsxs)(J,{variant:`outline`,className:`w-56 justify-center rounded-lg`,onClick:r.startConnect,disabled:t[n].loading,children:[(0,K.jsx)(i,{className:`size-4`}),e(r.connectLabelKey)]},n)})})]})})}function Rmt({provider:e}){let{t}=V(),n=lS[e];return(0,K.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-amber-200 bg-amber-50 px-4 py-2 text-sm text-amber-900`,children:[(0,K.jsx)(H_,{className:`size-4`}),(0,K.jsxs)(`span`,{className:`flex-1`,children:[t(n.labelKey),`: `,t(`settings.integrations.scope_missing`)]}),(0,K.jsx)(`button`,{onClick:n.startConnect,className:`text-xs font-medium underline-offset-2 hover:underline`,children:t(`settings.integrations.reauthorize`)})]})}function zmt(){let{t:e}=V();return(0,K.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-destructive/30 bg-destructive/10 px-4 py-2 text-sm text-destructive`,children:[(0,K.jsx)(rse,{className:`size-4 shrink-0`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`font-medium`,children:e(`errors.gmail_not_available_title`)}),(0,K.jsx)(`div`,{className:`text-xs opacity-90`,children:e(`errors.gmail_not_available_body`)})]}),(0,K.jsx)(Gv,{to:`/settings/integrations`,className:`text-xs font-medium underline-offset-2 hover:underline`,children:e(`errors.gmail_not_available_cta`)})]})}function Bmt(){let{t:e}=V();return(0,K.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center p-12 text-center`,children:[(0,K.jsx)(__,{className:`size-10 text-muted-foreground/40`}),(0,K.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:e(`mail.account_unusable`)})]})}function Vmt({folder:e}){let{t}=V();return(0,K.jsxs)(`div`,{className:`flex h-full flex-1 flex-col items-center justify-center p-12 text-center`,children:[(0,K.jsx)(l_,{className:`size-10 text-muted-foreground/40`}),(0,K.jsx)(`p`,{className:`mt-4 text-base font-medium text-foreground`,children:t(`mail.no_messages`)}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:t(`mail.no_messages_in_folder`)})]})}function Hmt(){let{t:e}=V();return(0,K.jsxs)(`div`,{className:`flex h-full flex-1 flex-col items-center justify-center p-12 text-center`,children:[(0,K.jsx)(__,{className:`size-10 text-muted-foreground/40`}),(0,K.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:e(`mail.no_thread_selected`)})]})}var Umt=`inbox.chat.thread:`,Wmt=80;function Gmt(e,t){return`${e}:${t}`}function f1(e,t){return`${Umt}${e}:${t}`}function Kmt(e,t){try{return localStorage.getItem(f1(e,t))}catch{return null}}function qmt(e,t,n){try{localStorage.setItem(f1(e,t),n)}catch{}}function Jmt(e,t){try{localStorage.removeItem(f1(e,t))}catch{}}function Ymt(e){let t=`Email: ${(e??``).trim()||`(no subject)`}`;return t.length>Wmt?t.slice(0,Wmt).trimEnd():t}function Xmt(){let e=DS(e=>e.selectedMessageId),t=DS(e=>e.messageMap),n=DS(e=>e.provider),r=DS(e=>e.setChatPanelOpen),i=LS(e=>e.conversationId),a=LS(e=>e.isStreaming),o=e?t[e]:null,s=o?.thread_id??null,c=o?.subject??null,l=s?Gmt(n,s):null,[u,d]=(0,B.useState)(`idle`),[f,p]=(0,B.useState)(null),m=(0,B.useRef)(0),h=(0,B.useRef)(null),g=(0,B.useRef)(null),_=(0,B.useCallback)(()=>n===`imap`?null:n,[n]),v=(0,B.useCallback)(async()=>{if(!l||!s)return;let e=++m.current;p(null),d(`starting`);let t=LS.getState();t.startNewConversation();try{let r=await Ehe(s,n);if(e!==m.current)return;g.current=r.document_id,t.attachDocument({id:r.document_id,filename:r.filename}),PS.getState().activate({threadKey:l,emailProvider:_(),freshStart:!0}),d(`ready`)}catch(t){if(e!==m.current)return;p(Gb(t,`Couldn't start a chat for this thread.`,{operation:`mail_thread_snapshot`,metadata:{provider:n,threadId:s}})),d(`error`)}},[l,s,n,_]),y=(0,B.useCallback)(async e=>{if(!l||!s)return;let t=++m.current;if(d(`starting`),await LS.getState().loadConversation(e),t===m.current){if(LS.getState().conversationId!==e){Jmt(n,s),d(`idle`);return}g.current=null,PS.getState().activate({threadKey:l,emailProvider:_()}),d(`ready`)}},[l,s,n,_]),b=(0,B.useCallback)(async()=>{if(!l||!s){d(`idle`);return}let e=PS.getState().pendingAutoStart===l,t=Kmt(n,s);if(e){await v();return}if(t){await y(t);return}d(`idle`)},[l,s,n,v,y]);return(0,B.useEffect)(()=>
776{if(a||l!==null&&h.current===l)return;let e=setTimeout(()=>{h.current=l,b()},0);return()=>clearTimeout(e)},[l,a,b]),(0,B.useEffect)(()=>{if(!l||!s||!i)return;let e=PS.getState();e.freshStartThreadKey===l&&(qmt(n,s,i),LS.getState().renameConversation(i,Ymt(c)),e.clearFreshStart())},[i,l,s,n,c]),(0,B.useEffect)(()=>()=>{PS.getState().deactivate();let e=LS.getState(),t=g.current;e.conversationId===null&&t&&e.attachedDocuments.some(e=>e.id===t)&&e.detachDocument(t)},[]),(0,K.jsxs)(`div`,{className:`flex h-full w-full flex-col bg-background`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/40 px-3 py-2`,children:[(0,K.jsx)(y_,{className:`size-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-sm font-medium`,title:c??void 0,children:c||`(no subject)`}),(0,K.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Chat about this thread`})]}),(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,className:`h-7 gap-1 px-2 text-xs`,onClick:()=>{!l||!s||(Jmt(n,s),v())},disabled:!s||u===`starting`,children:[(0,K.jsx)(v_,{className:`size-3.5`}),`New chat`]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>r(!1),className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,"aria-label":`Close chat panel`,children:(0,K.jsx)(J_,{className:`size-4`})})]}),u===`ready`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,K.jsx)(ZI,{className:`h-full`})}),(0,K.jsx)(QI,{className:`mx-2 mb-1 shrink-0`}),(0,K.jsx)(`div`,{className:`shrink-0 border-t border-border/40 px-2 py-1`,children:(0,K.jsx)(jP,{})})]}):u===`starting`?(0,K.jsxs)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:[(0,K.jsx)(W,{className:`mr-2 size-4 animate-spin`}),`Preparing threadâ¦`]}):u===`error`?(0,K.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f||`Couldn't start a chat for this thread.`}),(0,K.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>void v(),children:`Retry`})]}):(0,K.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,K.jsx)(y_,{className:`size-8 text-muted-foreground/60`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start a chat grounded in this email thread. modInsight will read the messages so you can ask discovery questions.`}),(0,K.jsx)(J,{size:`sm`,onClick:()=>void v(),disabled:!s,children:`Start chat about this thread`})]})]})}var Zmt=new Set([`docx`,`doc`,`rtf`]),Qmt=new Set([`xlsx`,`xls`,`csv`]),$mt=new Set([`pptx`,`ppt`]),eht=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`tiff`,`tif`,`heic`,`heif`,`svg`]),tht=new Set([`txt`,`md`]);function nht(e){let t=(e??``).toLowerCase();return t===`pdf`?i_:Zmt.has(t)?Eoe:Qmt.has(t)?r_:$mt.has(t)?lse:eht.has(t)?yoe:tht.has(t)?i_:koe}function rht(e){return e?e===`application/pdf`||e.startsWith(`image/`):!1}function iht(e){return(0,K.jsx)(nht(e),{className:`size-4 shrink-0 text-muted-foreground`})}function aht({msgId:e,att:t}){let{t:n}=V(),r=DS(e=>e.downloadAttachment),i=DS(e=>e.openAttachment),a=DS(e=>e.saveAttachmentToKb),[o,s]=(0,B.useState)(`idle`),c=yFe(t.filename),l=kb(t.size),u=!t.download_blocked&&rht(t.mime_type),d=t.can_save_to_kb&&!t.download_blocked&&gFe.has(c);async function f(){s(`saving`),s(await a(e,t.attachment_id,t.filename)?`saved`:`idle`)}let p=n(o===`saving`?`mail.message.saving`:o===`saved`?`mail.message.saved_to_kb`:`mail.message.save_to_kb`);return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/50 bg-muted/20 px-3 py-2 text-sm`,children:[iht(c),(0,K.jsx)(`span`,{className:`truncate font-medium`,title:t.filename,children:t.filename}),l&&(0,K.jsx)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:l}),(0,K.jsx)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:t.download_blocked?(0,K.jsx)(`span`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,title:n(`mail.message.attachment_blocked_hint`),children:(0,K.jsx)(g_,{className:`size-3.5`})}):(0,K.jsxs)(K.Fragment,{children:[u&&(0,K.jsxs)(`button`,{type:`button`,onClick:()=>i(e,t.attachment_id,t.filename,t.mime_type),title:n(`mail.message.open`),className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,K.jsx)($g,{className:`size-4`}),(0,K.jsx)(`span`,{className:`sr-only`,children:n(`mail.message.open`)})]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e,t.attachment_id,t.filename),title:n(`mail.message.download`),className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,K.jsx)(Xg,{className:`size-4`}),(0,K.jsx)(`span`,{className:`sr-only`,children:n(`mail.message.download`)})]}),d&&(0,K.jsxs)(`button`,{type:`button`,onClick:f,disabled:o!==`idle`,title:p,className:q(`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-default disabled:opacity-100`,o===`saved`&&`text-emerald-600 hover:text-emerald-600`),children:[o===`saving`?(0,K.jsx)(W,{className:`size-4 animate-spin`}):o===`saved`?(0,K.jsx)(Lg,{className:`size-4`}):(0,K.jsx)(Ag,{className:`size-4`}),(0,K.jsx)(`span`,{className:`sr-only`,children:p})]})]})})]})}function oht({msg:e}){let{t}=V(),n=e.attachments;return n===void 0?null:n.length===0?(0,K.jsx)(`div`,{className:`mt-3 text-xs italic text-muted-foreground`,children:t(`mail.message.attachment_unavailable`)}):(0,K.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,K.jsx)(`div`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:t(`mail.message.attachments`)}),n.map(t=>(0,K.jsx)(aht,{msgId:e.id,att:t},t.attachment_id))]})}function sht(e){if(!e)return`?`;
776let t=e.split(/\s+/).filter(Boolean);return t.length===0?e[0].toUpperCase():t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}function cht(e,t){return e&&e.length>0?e.join(`, `):t??``}function lht({msg:e,defaultOpen:t=!1}){let{t:n}=V(),{formatDate:r}=jb(),[i,a]=(0,B.useState)(t),o=e.from_name||e.from_email,s=cht(e.to_recipients,e.to_email),c=cht(e.cc_recipients,e.cc_email),l=e.bcc_email??``;return(0,K.jsxs)(`div`,{className:`border-b border-border/40`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`flex w-full items-start gap-3 px-1 py-3 text-left hover:bg-muted/30`,children:[(0,K.jsx)(KL,{className:`size-9 shrink-0`,children:(0,K.jsx)(qL,{className:`bg-muted text-xs`,children:sht(o)})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:o}),(0,K.jsx)(`span`,{className:`ml-auto whitespace-nowrap text-xs tabular-nums text-muted-foreground`,children:r(e.received_at,`MMM d, h:mm a`)})]}),(0,K.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.from_email}),s&&(0,K.jsxs)(`div`,{className:`break-words text-xs text-muted-foreground`,children:[n(`mail.message.to`).toLowerCase(),` `,(0,K.jsx)(`span`,{className:`text-foreground/80`,children:s})]}),c&&(0,K.jsxs)(`div`,{className:`break-words text-xs text-muted-foreground`,children:[n(`mail.message.cc`).toLowerCase(),` `,(0,K.jsx)(`span`,{className:`text-foreground/80`,children:c})]}),l&&(0,K.jsxs)(`div`,{className:`break-words text-xs text-muted-foreground`,children:[n(`mail.message.bcc`).toLowerCase(),` `,(0,K.jsx)(`span`,{className:`text-foreground/80`,children:l})]}),!i&&e.body_preview&&(0,K.jsx)(`div`,{className:`mt-1.5 truncate text-sm text-muted-foreground`,children:e.body_preview})]}),(0,K.jsx)(Rg,{className:q(`size-4 text-muted-foreground transition-transform`,i&&`rotate-180`)})]}),i&&(0,K.jsxs)(`div`,{className:`px-12 pb-5 pt-0`,children:[(0,K.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-sans text-sm leading-relaxed text-foreground/90`,children:e.body_full||e.body_preview||``}),e.has_attachments&&(0,K.jsx)(oht,{msg:e})]})]})}function p1({label:e,icon:t,onClick:n,destructive:r,className:i}){return(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,onClick:n,className:q(`rounded-md p-2 text-muted-foreground transition-colors duration-150 hover:bg-muted hover:text-foreground`,r&&`hover:text-rose-600`,i),children:[(0,K.jsx)(t,{className:`size-4`}),(0,K.jsx)(`span`,{className:`sr-only`,children:e})]})}),(0,K.jsx)(GT,{side:`bottom`,children:e})]})}function uht(){let e=Sv(),{folder:t=`inbox`,messageId:n}=Cv(),r=DS(e=>e.messageMap),i=DS(e=>e.byFolder),a=DS(e=>e.threadMap),o=DS(e=>e.selectMessage),s=DS(e=>e.star),c=DS(e=>e.unstar),l=DS(e=>e.archive),u=DS(e=>e.unarchive),d=DS(e=>e.trash),f=DS(e=>e.untrash),p=DS(e=>e.openCompose),m=DS(e=>e.provider),h=DS(e=>e.setChatPanelOpen),g=PS(e=>e.requestAutoStart);(0,B.useEffect)(()=>{n&&o(n)},[n,o]);let _=n?r[n]:null,v=_?.thread_id?a[_.thread_id]??null:null;if(!n||!_)return(0,K.jsx)(Hmt,{});let y=v&&v.length>0?v:[_],b=y[y.length-1],x=e=>{let t=e===`reply`||e===`reply_all`,n=``;_.subject&&(n=t?_.subject.startsWith(`Re:`)?_.subject:`Re: ${_.subject}`:_.subject.startsWith(`Fwd:`)?_.subject:`Fwd: ${_.subject}`);let r=e===`forward`?`\n\n---------- Forwarded message ----------\nFrom: ${_.from_email}\nSubject: ${_.subject??``}\n\n${_.body_full??_.body_preview??``}`:``,i=``;if(e===`reply_all`){let e=e=>(e.match(/<([^>]+)>/)?.[1]??e).trim(),t=lS[m].getStatus().accountEmail?.toLowerCase()??``,n=e(_.from_email).toLowerCase(),r=[..._.to_recipients??[],..._.cc_recipients??[]].map(e);i=[...new Set(r.map(e=>e.trim()))].filter(e=>e.toLowerCase()!==t&&e.toLowerCase()!==n).join(`, `)}p(e,{to:t?_.from_email:``,cc:i,subject:n,body:r,thread_id:_.thread_id,in_reply_to_id:_.id})};return(0,K.jsxs)(`div`,{className:`flex h-full w-full flex-col bg-background`,children:[(0,K.jsxs)(`div`,{className:`border-b border-border/40 px-6 py-5`,children:[(0,K.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:_.subject||`(no subject)`}),(0,K.jsxs)(`div`,{className:`mt-4 flex items-center gap-1`,children:[(0,K.jsx)(p1,{label:`Reply`,icon:D_,onClick:()=>x(`reply`)}),(0,K.jsx)(p1,{label:`Reply all`,icon:pse,onClick:()=>x(`reply_all`)}),(0,K.jsx)(p1,{label:`Forward`,icon:Noe,onClick:()=>x(`forward`)}),(0,K.jsx)(`div`,{className:`mx-2 h-5 w-px bg-border`}),(0,K.jsx)(p1,{label:`Archive`,icon:Cg,onClick:()=>{let n=_.id,r=i[t]?.ids??[],a=r.indexOf(n),o=d1(r,n);l(n),e(o?`/inbox/${t}/${encodeURIComponent(o)}`:`/inbox/${t}`),Wx(`Archived`,()=>u(n,t,a))}}),(0,K.jsx)(p1,{label:`Move to trash`,icon:V_,destructive:!0,onClick:()=>{let n=_.id,r=i[t]?.ids??[],a=r.indexOf(n),o=d1(r,n);d(n),e(o?`/inbox/${t}/${encodeURIComponent(o)}`:`/inbox/${t}`),Wx(`Moved to trash`,()=>f(n,t,a))}}),(0,K.jsx)(p1,{label:_.is_starred?`Unstar`:`Star`,icon:R_,onClick:()=>{_.is_starred?(c(_.id),G.success(`Unstarred`,{duration:1500})):(s(_.id),G.success(`Starred`,{duration:1500}))},className:_.is_starred?`text-amber-500`:void 0}),(0,K.jsx)(p1,{label:`Labels`,icon:z_,onClick:()=>G(`Labels â coming soon`)}),(0,K.jsx)(p1,{label:`More`,icon:Qg,onClick:()=>G(`More actions â coming soon`)})]})]}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto px-6`,children:y.map((e,t)=>(0,K.jsx)(lht,{msg:e,defaultOpen:t===y.length-1},e.id))}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/40 px-6 py-4`,children:[(0,K.jsxs)(J,{variant:`outline`,className:`rounded-lg`,onClick:()=>x(`reply`),children:[(0,K.jsx)(D_,{className:`size-4 mr-2`}),`Reply to `,b.from_name||b.from_email]}),(0,K.jsxs)(J,{className:`rounded-lg`,onClick:()=>
776{_.thread_id&&(g(Gmt(m,_.thread_id)),h(!0))},disabled:!_.thread_id,children:[(0,K.jsx)(L_,{className:`size-4 mr-2`}),`Chat about thread`]})]})]})}function dht({staleWhileHidden:e,sseConnected:t}){return!!(e||!t)}var fht={today:`Today`,yesterday:`Yesterday`,"this-week":`This Week`,"last-week":`Last Week`,"this-month":`This Month`,older:`Older`},pht=[`today`,`yesterday`,`this-week`,`last-week`,`this-month`,`older`];function mht(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return`older`;if($y(n,t))return`today`;if($y(n,gb(t,1)))return`yesterday`;if(Xfe(n,t))return`this-week`;let r=Gy(t);return n>=Gy(gpe(t,1))&&n<r?`last-week`:mb(n,t)?`this-month`:`older`}function hht(e,t=new Date){let n=new Map;for(let r of e){let e=mht(r.received_at,t),i=n.get(e)??[];i.push(r),n.set(e,i)}return pht.filter(e=>n.has(e)).map(e=>({key:e,label:fht[e],messages:n.get(e)}))}function ght({msg:e,isSelected:t,onSelect:n}){let{t:r}=V(),{formatDate:i,formatTime:a}=jb(),o=e=>{if(!e)return``;let t=new Date(e);if(Number.isNaN(t.getTime()))return``;let n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()?a(t):i(t,t.getFullYear()===n.getFullYear()?`MMM d`:`MMM d, yyyy`)},s=DS(e=>e.star),c=DS(e=>e.unstar),l=DS(e=>e.archive),u=DS(e=>e.trash),d=e.is_unread,f=e.is_starred,p=e.from_name||e.from_email,m=e.label_ids.includes(`DRAFT`);return(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,"data-message-id":e.id,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},className:q(`group relative flex items-center gap-3 border-b border-border/40 px-4 py-3 cursor-pointer`,`transition-colors duration-150`,`hover:bg-muted/40 focu
776s-visible:outline-none focus-visible:bg-muted/50`,t&&`bg-muted`),children:[t&&(0,K.jsx)(`span`,{className:`absolute left-0 top-2 bottom-2 w-0.5 rounded-r-full bg-primary`}),(0,K.jsxs)(`div`,{className:`flex w-44 shrink-0 items-center gap-1.5 truncate`,children:[(0,K.jsx)(`span`,{className:q(`truncate text-sm`,d?`font-semibold text-foreground`:`font-normal text-foreground/80`),children:p}),m&&(0,K.jsx)(lR,{className:`bg-rose-50 text-rose-700 hover:bg-rose-50 px-1.5 py-0 text-[10px]`,children:r(`mail.folders.drafts`)})]}),(0,K.jsxs)(`div`,{className:`flex-1 truncate text-sm`,children:[(0,K.jsx)(`span`,{className:q(d?`font-medium text-foreground`:`text-foreground/80`),children:e.subject||r(`mail.message.no_subject`)}),e.body_preview&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`mx-1.5 text-muted-foreground/50`,children:`·`}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e.body_preview})]})]}),e.has_attachments&&(0,K.jsx)(C_,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:o(e.received_at)}),(0,K.jsxs)(LD,{children:[(0,K.jsx)(RD,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,onClick:e=>e.stopPropagation(),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":r(`common.actions`),children:(0,K.jsx)(Qg,{className:`size-3.5`})})}),(0,K.jsxs)(zD,{align:`end`,sideOffset:4,children:[(0,K.jsxs)(VD,{onSelect:()=>{f?c(e.id):s(e.id)},children:[(0,K.jsx)(R_,{className:q(f&&`fill-amber-400 text-amber-500`)}),(0,K.jsx)(`span`,{children:r(`mail.folders.starred`)})]}),(0,K.jsxs)(VD,{onSelect:()=>l(e.id),children:[(0,K.jsx)(Cg,{}),(0,K.jsx)(`span`,{children:r(`mail.message.archive`)})]}),(0,K.jsxs)(VD,{variant:`destructive`,onSelect:()=>u(e.id),children:[(0,K.jsx)(V_,{}),(0,K.jsx)(`span`,{children:r(`mail.folders.trash`)})]}),(0,K.jsxs)(VD,{disabled:!0,children:[(0,K.jsx)(z_,{}),(0,K.jsx)(`span`,{children:r(`mail.labels`)})]})]})]})]})]})}function _ht(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=Math.max(2,e-2),r=Math.min(t-1,e+2),i=[1];n>2&&i.push(`...`);for(let e=n;e<=r;e++)i.push(e);return r<t-1&&i.push(`...`),i.push(t),i}function vht({page:e,totalPages:t,rangeStart:n,rangeEnd:r,totalCount:i,loading:a,hasMore:o,onPage:s}){let c=a||e<=1,l=a||(t===null?!o:e>=t),u=i==null?`${n}â${r}`:`${n}â${r} of ${i.toLocaleString()}`,d=`inline-flex h-7 min-w-[1.75rem] items-center justify-center rounded px-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40`,f=q(d,`hover:bg-muted/60 text-foreground/70`),p=q(d,`bg-primary/10 text-foreground font-semibold`),m=q(d,`hover:bg-muted/60 text-foreground/60`);return(0,K.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border/40 px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-[11px] tabular-nums text-muted-foreground select-none`,children:u}),t===null?(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:c,onClick:()=>s(e-1),className:q(m,`gap-1 px-2`),children:[(0,K.jsx)(zg,{className:`size-3.5`}),(0,K.jsx)(`span`,{children:`Prev`})]}),(0,K.jsxs)(`span`,{className:`text-xs text-muted-foreground select-none`,children:[`Page `,e]}),(0,K.jsxs)(`button`,{type:`button`,disabled:l,onClick:()=>s(e+1),className:q(m,`gap-1 px-2`),children:[(0,K.jsx)(`span`,{children:`Next`}),(0,K.jsx)(Bg,{className:`size-3.5`})]})]}):(0,K.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,K.jsx)(`button`,{type:`button`,disabled:c,onClick:()=>s(e-1),className:m,"aria-label":`Previous page`,children:(0,K.jsx)(zg,{className:`size-3.5`})}),_ht(e,t).map((t,n)=>t===`...`?(0,K.jsx)(`span`,{className:`px-1 text-xs text-muted-foreground select-none`,children:`â¦`},`ellipsis-${n}`):(0,K.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>t!==e&&s(t),className:t===e?p:f,"aria-current":t===e?`page`:void 0,children:t},t)),(0,K.jsx)(`button`,{type:`button`,disabled:l,onClick:()=>s(e+1),className:m,"aria-label":`Next page`,children:(0,K.jsx)(Bg,{className:`size-3.5`})})]})]})}function yht(){return(0,K.jsx)(`div`,{className:`border-b border-border/40 px-4 py-3`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(LI,{className:`size-1.5 rounded-full`}),(0,K.jsx)(LI,{className:`h-4 w-32`}),(0,K.jsx)(LI,{className:`h-4 flex-1 max-w-md`}),(0,K.jsx)(LI,{className:`h-3 w-12`})]})})}function bht({count:e=8}){return(0,K.jsx)(`div`,{children:Array.from({length:e}).map((e,t)=>(0,K.jsx)(yht,{},t))})}
776function xht({searchInputRef:e,showDivider:t=!0}){let{t:n}=V(),r=Sv(),{folder:i=`inbox`,messageId:a}=Cv(),[o,s]=Jv(),c=DS(e=>e.byFolder),l=DS(e=>e.messageMap),u=DS(e=>e.searchQuery),d=DS(e=>e.setSearch),f=DS(e=>e.loadFolder),p=DS(e=>e.goToPage),m=DS(e=>e.provider),h=DS(e=>e.folderCounts),g=DS(e=>e.groupByDate),_=DS(e=>e.setGroupByDate),v=DS(e=>e.refreshActive),y=DS(e=>e.staleWhileHidden),b=c[i];WB((0,B.useCallback)(()=>{dht({staleWhileHidden:DS.getState().staleWhileHidden,sseConnected:FL.getState().isConnected})&&v()},[v]),{throttleMs:3e4});let x=(0,B.useMemo)(()=>Imt({byFolder:c,messageMap:l,folder:i}),[c,l,i]),S=(0,B.useMemo)(()=>x.map(e=>l[e]).filter(Boolean),[x,l]),C=(0,B.useMemo)(()=>hht(S),[S]);(0,B.useEffect)(()=>{let e=parseInt(o.get(`page`)??`1`,10);e>1?p(i,e):f(i)},[i]);let w=e=>{r(`/inbox/${i}/${encodeURIComponent(e)}?${o.toString()}`)},T=e=>{s(e===1?e=>{let t=new URLSearchParams(e);return t.delete(`page`),t}:t=>{let n=new URLSearchParams(t);return n.set(`page`,String(e)),n}),p(i,e)},E=()=>{s(e=>{let t=new URLSearchParams(e);return t.delete(`page`),t})},D=b?.loading&&!b.loaded,O=b?.page??1,k=b?.totalPages??null,A=S.length,j=(O-1)*25+1,M=(O-1)*25+A,N=u?null:Qye(i,m,h),P=A>=25||b?.pageTokens?.[O+1]!=null,F=e=>(0,K.jsx)(ght,{msg:e,isSelected:a===e.id,onSelect:()=>w(e.id)},e.id);return(0,K.jsx)($T,{i18nKey:`tour.mail.list`,side:`bottom`,children:(0,K.jsxs)(`div`,{className:q(`flex h-full w-full flex-col bg-background`,t&&`border-r border-border/40`),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/40 px-4 py-2.5`,children:[(0,K.jsx)(A_,{className:`size-4 text-muted-foreground`}),(0,K.jsx)(`input`,{ref:e,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(E(),f(i,{force:!0})),e.key===`Escape`&&(d(``),E(),f(i,{force:!0}),e.target.blur())},placeholder:`Search mail`,className:`flex-1 bg-transparent text-sm placeholder:text-muted-foreground focus:outline-none`}),(0,K.jsxs)(`button`,{type:`button`,onClick:v,title:n(y?`mail.refresh_stale_hint`:`mail.refresh`),"aria-label":n(`mail.refresh`),className:`relative rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,K.jsx)(E_,{className:`size-3.5 ${b?.refreshing?`animate-spin`:``}`}),y&&(0,K.jsx)(`span`,{className:`absolute right-0.5 top-0.5 size-1.5 rounded-full bg-primary`})]}),(0,K.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer select-none`,children:[(0,K.jsx)(`span`,{className:`hidden sm:inline`,children:`Group`}),(0,K.jsx)(mP,{checked:g,onCheckedChange:_})]}),(0,K.jsx)(`kbd`,{className:`pointer-events-none hidden h-5 select-none items-center rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground/70 sm:inline-flex`,children:`/`})]}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:D?(0,K.jsx)(bht,{}):S.length===0?(0,K.jsx)(Vmt,{folder:i}):g?C.map(e=>(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-center gap-2 border-b border-border/40 bg-background/95 px-4 py-1.5 text-xs font-medium text-muted-foreground backdrop-blur`,children:[(0,K.jsx)(`span`,{children:e.label}),(0,K.jsx)(`span`,{className:`text-muted-foreground/60`,children:e.messages.length})]}),e.messages.map(F)]},e.key)):S.map(F)}),!D&&A>0&&(0,K.jsx)(vht,{page:O,totalPages:k,rangeStart:j,rangeEnd:M,totalCount:N,loading:b?.loading??!1,hasMore:P,onPage:T})]})})}var Sht=[{title:`Navigation`,shortcuts:[{keys:[`j`],description:`Next message`},{keys:[`k`],description:`Previous message`}]},{title:`Actions`,shortcuts:[{keys:[`e`],description:`Archive`},{keys:[`#`],description:`Move to trash`},{keys:[`s`],description:`Toggle star`}]},{title:`Compose`,shortcuts:[{keys:[`c`],description:`New message`}]},{title:`Search`,shortcuts:[{keys:[`/`],description:`Focus search`}]},{title:`Folders`,shortcuts:[{keys:[`g`,`i`],description:`Inbox`},{keys:[`g`,`s`],description:`Sent`},{keys:[`g`,`d`],description:`Drafts`},{keys:[`g`,`t`],description:`Trash`}]},{title:`Help`,shortcuts:[{keys:[`?`],description:`Toggle this dialog`}]}];function Cht({children:e}){return(0,K.jsx)(`kbd`,{className:`border bg-muted/50 px-1.5 py-0.5 rounded text-[11px] font-mono`,children:e})}function m1({open:e,onOpenChange:t}){return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsxs)(WC,{className:`bg-popover/80 backdrop-blur-md supp
776orts-[backdrop-filter]:bg-popover/65 border max-w-lg`,children:[(0,K.jsx)(GC,{children:(0,K.jsx)(qC,{children:`Keyboard shortcuts`})}),(0,K.jsx)(`div`,{className:`flex flex-col gap-4`,children:Sht.map(e=>(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e.title}),(0,K.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.shortcuts.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-foreground`,children:e.description}),(0,K.jsx)(`span`,{className:`flex items-center gap-1`,children:e.keys.map((e,t)=>(0,K.jsx)(Cht,{children:e},t))})]},e.keys.join(`+`)+e.description))})]},e.title))})]})})}var wht=`mail.list-panel-size`,Tht=`mail.chat-panel-size`,Eht=`mail-list`,Dht=`mail-detail`,Oht=`mail-chat`,kht=`20%`,Aht=`30%`,jht=`20%`;function Mht(){try{let e=localStorage.getItem(wht),t=e?Number(e):NaN;if(Number.isFinite(t)&&t>=20&&t<=70)return t}catch{}return 38}function Nht(){try{let e=localStorage.getItem(Tht),t=e?Number(e):NaN;if(Number.isFinite(t)&&t>=20&&t<=50)return t}catch{}return 30}function Pht(){let{folder:e,messageId:t}=Cv(),n=Sv(),r=fS(),i=DS(e=>e.provider),a=DS(e=>e.setProvider),o=r[i],s=o.connected,c=o.notAvailable,l=eS.some(e=>r[e].connected),u=eS.every(e=>r[e].initialized),d=uS(o),f=DS(e=>e.setCurrentFolder),p=DS(e=>e.setSelectedMessageId),m=DS(e=>e.byFolder),h=DS(e=>e.messageMap),g=DS(e=>e.star),_=DS(e=>e.unstar),v=DS(e=>e.archive),y=DS(e=>e.unarchive),b=DS(e=>e.trash),x=DS(e=>e.untrash),S=DS(e=>e.openCompose),C=DS(e=>e.chatPanelOpen),w=(0,B.useRef)(null),[T,E]=(0,B.useState)(!1),[D]=(0,B.useState)(Mht),[O]=(0,B.useState)(Nht);if((0,B.useEffect)(()=>{e&&f(e)},[e,f]),(0,B.useEffect)(()=>{p(t??null)},[t,p]),(0,B.useEffect)(()=>{for(let e of eS)lS[e].fetchStatus()},[]),(0,B.useEffect)(()=>{if(!u||d)return;let e=eS.find(e=>uS(r[e]));e&&a(e)},[u,d,i,r,a]),(0,B.useEffect)(()=>{let r={key:``,ts:0},i=i=>{let a=i.target;if(a&&/^(INPUT|TEXTAREA|SELECT)$/.test(a.tagName)||a?.isContentEditable||i.metaKey||i.ctrlKey||i.altKey)return;let o=e??`inbox`,s=Imt({byFolder:m,messageMap:h,folder:o}),c=t?s.indexOf(t):-1;if(r.key===`g`&&Date.now()-r.ts<800){i.key===`i`?(i.preventDefault(),n(`/inbox/inbox`)):i.key===`s`?(i.preventDefault(),n(`/inbox/sent`)):i.key===`d`?(i.preventDefault(),n(`/inbox/drafts`)):i.key===`t`&&(i.preventDefault(),n(`/inbox/trash`)),r.key=``;return}switch(i.key){case`j`:{if(s.length===0)return;let e=s[Math.min(c+1,s.length-1)];e&&n(`/inbox/${o}/${encodeURIComponent(e)}`);break}case`k`:{if(s.length===0)return;let e=s[Math.max(c-1,0)];e&&n(`/inbox/${o}/${encodeURIComponent(e)}`);break}case`e`:if(t){let e=t,r=s.indexOf(e),i=d1(s,e);v(e),n(i?`/inbox/${o}/${encodeURIComponent(i)}`:`/inbox/${o}`),Wx(`Archived`,()=>y(e,o,r))}break;case`#`:if(t){let e=t,r=s.indexOf(e),i=d1(s,e);b(e),n(i?`/inbox/${o}/${encodeURIComponent(i)}`:`/inbox/${o}`),Wx(`Moved to trash`,()=>x(e,o,r))}break;case`s`:if(t){let e=h[t];e?.is_starred?(_(t),G.success(`Unstarred`,{duration:1500})):e&&(g(t),G.success(`Starred`,{duration:1500}))}break;case`c`:i.preventDefault(),S(`new`);break;case`/`:i.preventDefault(),w.current?.focus();break;case`?`:i.preventDefault(),E(e=>!e);break;case`g`:r.key=`g`,r.ts=Date.now();break}};return window.addEventListener(`keydown`,i),()=>window.removeEventListener(`keydown`,i)},[e,t,m,h,i,v,y,b,x,g,_,S,n]),!u)return(0,K.jsx)(`div`,{className:`flex h-full flex-1`});if(!l)return(0,K.jsxs)(`div`,{className:`flex h-full flex-1`,children:[(0,K.jsx)(Lmt,{}),(0,K.jsx)(u1,{}),(0,K.jsx)(m1,{open:T,onOpenChange:E})]});if(!s)return(0,K.jsx)(`div`,{className:`flex h-full flex-1`});if(!d)return(0,K.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[c?(0,K.jsx)(zmt,{}):(0,K.jsx)(Rmt,{provider:i}),(0,K.jsx)(Bmt,{}),(0,K.jsx)(u1,{}),(0,K.jsx)(m1,{open:T,onOpenChange:E})]});let k=!!t,A=k&&C;return(0,K.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[(0,K.jsxs)(IH,{id:`mail-layout`,orientation:`horizontal`,className:`flex-1`,onLayoutChanged:e=>{let t=e[Eht];
776if(t!==void 0&&e[Dht]!==void 0)try{localStorage.setItem(wht,String(t))}catch{}let n=e[Oht];if(n!==void 0)try{localStorage.setItem(Tht,String(n))}catch{}},children:[(0,K.jsx)(LH,{id:Eht,defaultSize:`${D}%`,minSize:kht,children:(0,K.jsx)(xht,{searchInputRef:w,showDivider:k})}),k&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(RH,{}),(0,K.jsx)(LH,{id:Dht,defaultSize:`${100-D}%`,minSize:Aht,children:(0,K.jsx)($T,{i18nKey:`tour.mail.detail`,side:`left`,children:(0,K.jsx)(`div`,{className:`h-full w-full`,children:(0,K.jsx)(uht,{})})})})]}),A&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(RH,{}),(0,K.jsx)(LH,{id:Oht,defaultSize:`${O}%`,minSize:jht,children:(0,K.jsx)(Xmt,{})})]})]}),(0,K.jsx)(u1,{}),(0,K.jsx)(m1,{open:T,onOpenChange:E})]})}var Fht=new Set([`outOfOffice`,`focusTime`,`workingLocation`]),Iht={accept:`accepted`,tentative:`tentative`,decline:`declined`};function Lht(e){return!(e.status===`cancelled`||e.event_type&&Fht.has(e.event_type))}function Rht({event:e,isNext:t}){let{t:n}=V(),{formatTime:r}=jb(),i=e.provider===`outlook`?`bg-foreground
776/60`:`bg-foreground/30`,a=e.is_all_day?n(`dashboard.all_day`):e.start_time?r(new Date(e.start_time)):`â`,o=e.is_all_day?n(`dashboard.all_day`):e.start_time&&e.end_time?`${r(new Date(e.start_time))} â ${r(new Date(e.end_time))}`:a;return(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsxs)(`div`,{className:`flex items-baseline gap-3 cursor-default py-0.5`,children:[(0,K.jsx)(`span`,{className:`font-mono text-xs tabular-nums w-15 shrink-0`,children:a}),(0,K.jsx)(`span`,{className:`size-1 rounded-full shrink-0 self-center ${i}`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`text-sm truncate flex-1`,children:e.title||n(`dashboard.no_title`)}),t&&(0,K.jsx)(`span`,{className:`font-serif italic text-xs text-muted-foreground shrink-0`,children:n(`dashboard.next_up`)})]})}),(0,K.jsxs)(GT,{side:`left`,align:`start`,className:`max-w-sm space-y-1.5 text-left`,children:[(0,K.jsx)(`div`,{className:`font-medium text-sm`,children:e.title||n(`dashboard.no_title`)}),(0,K.jsx)(`div`,{className:`text-xs opacity-80`,children:o}),e.location&&(0,K.jsxs)(`div`,{className:`text-xs opacity-80`,children:[(0,K.jsx)(`span`,{className:`opacity-60`,children:n(`dashboard.location_label`)}),` `,e.location]}),(0,K.jsx)(`div`,{className:`text-[10px] opacity-60`,children:e.provider===`outlook`?`Outlook`:`Google`})]})]})}var zht=[{response:`accept`,label:`Accept`,icon:Lg},{response:`tentative`,label:`Tentative`,icon:Wg},{response:`decline`,label:`Decline`,icon:J_}];function Bht({status:e}){let t=e===`accepted`?`text-green-700 dark:text-green-400`:e===`declined`?`text-muted-foreground line-through`:`text-amber-600 dark:text-amber-500`,n=e===`accepted`?`Accepted`:e===`declined`?`Declined`:`Tentative`;return(0,K.jsx)(`span`,{className:q(`text-[11px] font-medium uppercase tracking-wide`,t),children:n})}function Vht({req:e,busy:t,onRsvp:n}){let{formatTime:r}=jb(),i=e.start?new Date(e.start):null,a=i?`${Tb(i,`EEE MMM d`)} · ${r(i)}`:``,o=e.provider===`outlook`?`Outlook`:`Google`;return(0,K.jsxs)(`div`,{className:`rounded-sm border-l-2 border-amber-500/60 py-1.5 pl-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.subject||`Meeting request`}),a?(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground`,children:a}):null]}),e.account_email?(0,K.jsxs)(`p`,{className:`truncate text-[10px] text-muted-foreground`,children:[`to `,e.account_email,` · `,o]}):null,(0,K.jsx)(`div`,{className:`mt-1.5`,children:e.status?(0,K.jsx)(Bht,{status:e.status}):(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:zht.map(({response:r,label:i,icon:a})=>(0,K.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>n(e,r),className:`inline-flex items-center gap-1 rounded border px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,children:[(0,K.jsx)(a,{className:`size-3`}),i]},r))})})]})}function Hht(){let{t:e}=V(),{formatTime:t}=jb(),{setStats:n}=Rpt(),[r,i]=B.useState([]),[a,o]=B.useState([]),[s,c]=B.useState(null),[l,u]=B.useState(!0),[d,f]=B.useState(()=>new Date);B.useEffect(()=>{let e=setInterval(()=>f(new Date),6e4);return()=>clearInterval(e)},[]),B.useEffect(()=>{let e=Tb(new Date,`yyyy-MM-dd`);(async()=>{try{i((await UB({date:e})).data??[])}catch{i([])}finally{u(!1)}})(),(async()=>{try{o((await Omt()).data??[])}catch{o([])}})()},[]);let p=r.filter(e=>Lht(e)?e.is_all_day||!e.end_time?!0:new Date(e.end_time)>=d:!1),m=a.filter(e=>e.start?new Date(e.start)>=d:!0),h=p.find(e=>!e.is_all_day&&!!e.start_time&&new Date(e.start_time)>d),g=h?.id??null;B.useEffect(()=>{n({meetings:p.length,nextTime:h&&h.start_time?t(new Date(h.start_time)):null})},[p.length,h?.id,h?.start_time]);let _=B.useCallback(async(e,t)=>{c(e.id);let n=a;o(n=>n.map(n=>n.id===e.id?{...n,status:Iht[t]}:n));try{await Amt(e.id,{response:t})}catch(r){o(n),Y(r,`Couldn't send your RSVP`,{operation:`meeting_rsvp`,metadata:{taskId:e.id,response:t}})}finally{c(null)}},[a]);return(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(e1,{children:e(`dashboard.todays_calendar`)}),(0,K.jsx)(`p`,{className:`font-serif italic text-xs text-muted-foreground`,children:e(`dashboard.items`,{count:p.length})})]}),(0,K.jsx)(IL,{className:`h-[260px]`,children:(0,K.jsxs)(`div`,{className:`space-y-1 pr-4`,children:[l&&(0,K.jsx)(`div`,{className:`space-y-3`,children:[1,2,3].map(e=>(0,K.jsxs)(`div`,{className:`flex items-stretch gap-3`,children:[(0,K.jsx)(LI,{className:`w-14 h-4 rounded`}),(0,K.jsx)(LI,{className:`h-4 flex-1`})]},e))}),!l&&p.length===0&&(0,K.jsx)(`p`,{className:`font-serif italic text-sm text-muted-foreground py-8 text-center`,children:e(`dashboard.empty_meetings`)}),!l&&p.map(e=>(0,K.jsx)(Rht,{event:e,isNext:e.id===g},e.id))]})}),m.length>0&&(0,K.jsxs)(`div`,{className:`space-y-2 border-t border-border pt-3`,children:[(0,K.jsx)(e1,{children:`Meeting requests`}),(0,K.jsx)(`div`,{className:`space-y-1.5`,children:m.map(e=>(0,K.jsx)(Vht,{req:e,busy:s===e.id,onRsvp:_},e.id))})]})]})}var Uht=5,Wht={matter:{icon:jg,label:`Matter`},email_task:{icon:__,label:`Email`},chat:{icon:b_,label:`Conversation`},document:{icon:i_,label:`Document`}},Ght={icon:i_,label:`Item`};function Kht(){let e=Sv(),[t,n]=B.useState([]),[r,i]=B.useState(!0);B.useEffect(()=>{let e=!1;return(async()=>{try{let t=await p_e();e||n(t.data??[])}catch(e){X(e,{operation:`fetch_recent_focus`})}finally{e||i(!1)}})(),()=>{e=!0}},[]);let a=t.slice(0,Uht);return(0,K.jsxs)(`div`,{className:`px-6 py-5 space-y-3`,children:[(0,K.jsx)(`div`,{className:`space-y-1`,children:(0,K.jsx)(e1,{children:`Pick up where you left off`})}),r&&(0,K.jsx)(`div`,{className:`space-y-3`,children:[1,2,3].map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(LI,{className:`size-4 rounded`}),(0,K.jsx)(LI,{className:`h-4 flex-1`}),(0,K.jsx)(LI,{className:`h-3 w-16`})]},e))}),!r&&a.length===0&&(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-10 text-center`,children:[(0,K.jsx)(c_,{className:`size-5 text-muted-foreground`,"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`font-serif italic text-sm text-muted-foreground`,children:`Nothing yet â your recent work will show up here.`})]}),!r&&a.length>0&&(0,K.jsx)(`div`,{className:`flex flex-col`,children:a.map(t=>{let n=Wht[t.resource_type]??Ght,r=n.icon;return(0,K.jsxs)(`button`,{onClick:()=>e(t.route),className:`group flex w-full items-center gap-3 -mx-2 rounded-sm px-2 py-2 text-left transition-colors hover:bg-muted/40`,children:[(0,K.jsx)(r,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`flex-1 truncate text-sm`,children:t.label||n.label}),(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground`,children:Db(t.last_seen_at)})]},`${t.resource_type}:${t.resource_id}`)})})]})}function qht(){let{t:e}=V(),t=new Date;return(0,K.jsx)(uz,{className:`@container/card overflow-hidden gap-0 py-0`,children:(0,K.jsxs)(Lpt,{children:[(0,K.jsxs)(`header`,{className:`px-6 pt-6 pb-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 border-b border-border pb-3`,children:[(0,K.jsx)(Bpt,{className:`text-2xl sm:text-3xl`,children:(0,K.jsx)($T,{i18nKey:`tour.dashboard.digest`,side:`right`,children:(0,K.jsx)(`div`,{children:e(`dashboard.briefing_title`)})})}),(0,K.jsx)(`time`,{dateTime:t.toISOString(),className:`font-mono text-[11px] uppercase tracking-widest text-muted-foreground tabular-nums shrink-0`,children:Tb(t,`EEE · MMM d, yyyy`)})]}),(0,K.jsx)(Hpt,{})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-1 divide-y divide-border lg:grid-cols-4 lg:divide-x lg:divide-y-0`,children:[(0,K.jsx)(a1,{view:`needs_now`}),(0,K.jsx)(a1,{view:`coming_due`}),(0,K.jsx)(`div`,{className:`px-6 py-5`,children:(0,K.jsx)(Hht,{})}),(0,K.jsx)(Kht,{})]})]})})}function h1(e,t){return typeof e==`function`?e(t):e}function g1(e,t){return n=>{t.setState(t=>({...t,[e]:h1(n,t[e])}))}}function _1(e){return e instanceof Function}function Jht(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function Yht(e,t){let n=[],r=e=>
vendor: 46,732 bytes, lines 776-779
776{e.forEach(e=>{n.push(e);let i=t(e);i!=null&&i.length&&r(i)})};return r(e),n}function v1(e,t,n){let r=[],i;return a=>{let o;n.key&&n.debug&&(o=Date.now());let s=e(a);if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%câ± ${i(t,5)} /${i(e,5)} ms`,` 777 font-size: .6rem; 778 font-weight: bold; 779 color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return i}}function y1(e,t,n,r){return{debug:()=>e?.debugAll??e[t],key:!1,onChange:r}}function Xht(e,t,n,r){let i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>i.getValue()??e.options.renderFallbackValue,getContext:v1(()=>[e,n,t,i],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),y1(e.options,`debugCells`,`cell.getContext`))};return e._features.forEach(r=>{r.createCell==null||r.createCell(i,n,t,e)},{}),i}function Zht(e,t,n,r){let i={...e._getDefaultColumnDef(),...t},a=i.accessorKey,o=i.id??(a?typeof String.prototype.replaceAll==`function`?a.replaceAll(`.`,`_`):a.replace(/\./g,`_`):void 0)??(typeof i.header==`string`?i.header:void 0),s;if(i.accessorFn?s=i.accessorFn:a&&(s=a.includes(`.`)?e=>{let t=e;for(let e of a.split(`.`))t=t?.[e];return t}:e=>e[i.accessorKey]),!o)throw Error();let c={id:`${String(o)}`,accessorFn:s,parent:r,depth:n,columnDef:i,columns:[],getFlatColumns:v1(()=>[!0],()=>[c,...c.columns?.flatMap(e=>e.getFlatColumns())],y1(e.options,`debugColumns`,`column.getFlatColumns`)),getLeafColumns:v1(()=>[e._getOrderColumnsFn()],e=>{var t;return(t=c.columns)!=null&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},y1(e.options,`debugColumns`,`column.getLeafColumns`))};for(let t of e._features)t.createColumn==null||t.createColumn(c,e);return c}var b1=`debugHeaders`;function Qht(e,t,n){let r={id:n.id??t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{t.createHeader==null||t.createHeader(r,e)}),r}var $ht={createTable:e=>{e.getHeaderGroups=v1(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{let a=r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],o=i?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],s=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id)));return x1(t,[...a,...s,...o],e)},y1(e.options,b1,`getHeaderGroups`)),e.getCenterHeaderGroups=v1(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id))),x1(t,n,e,`center`)),y1(e.options,b1,`getCenterHeaderGroups`)),e.getLeftHeaderGroups=v1(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>x1(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`left`),y1(e.options,b1,`getLeftHeaderGroups`)),e.getRightHeaderGroups=v1(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>x1(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`right`),y1(e.options,b1,`getRightHeaderGroups`)),e.getFooterGroups=v1(()=>[e.getHeaderGroups()],e=>[...e].reverse(),y1(e.options,b1,`getFooterGroups`)),e.getLeftFooterGroups=v1(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),y1(e.options,b1,`getLeftFooterGroups`)),e.getCenterFooterGroups=v1(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),y1(e.options,b1,`getCenterFooterGroups`)),e.getRightFooterGroups=v1(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),y1(e.options,b1,`getRightFooterGroups`)),e.getFlatHeaders=v1(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),y1(e.options,b1,`getFlatHeaders`)),e.getLeftFlatHeaders=v1(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),y1(e.options,b1,`getLeftFlatHeaders`)),e.getCenterFlatHeaders=v1(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),y1(e.options,b1,`getCenterFlatHeaders`)),e.getRightFlatHeaders=v1(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),y1(e.options,b1,`getRightFlatHeaders`)),e.getCenterLeafHeaders=v1(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),y1(e.options,b1,`getCenterLeafHeaders`)),e.getLeftLeafHeaders=v1(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),y1(e.options,b1,`getLeftLeafHeaders`)),e.getRightLeafHeaders=v1(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),y1(e.options,b1,`getRightLeafHeaders`)),e.getLeafHeaders=v1(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>[...e[0]?.headers??[],...t[0]?.headers??[],...n[0]?.headers??[]].map(e=>e.getLeafHeaders()).flat(),y1(e.options,b1,`getLeafHeaders`))}};function x1(e,t,n,r){let i=0,a=function(e,t){t===void 0&&(t=1),i=Math.max(i,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;(n=e.columns)!=null&&n.length&&a(e.columns,t+1)},0)};a(e);let o=[],s=(e,t)=>{let i={depth:t,id:[r,`${t}`].filter(Boolean).join(`_`),headers:[]},a=[];e.forEach(e=>{let o=[...a].reverse()[0],s=e.column.depth===i.depth,c,l=!1;if(s&&e.column.parent?c=e.column.parent:(c=e.column,l=!0),o&&o?.column===c)o.subHeaders.push(e);else{let i=Qht(n,c,{id:[r,t,c.id,e?.id].filter(Boolean).join(`_`),isPlaceholder:l,placeholderId:l?`${a.filter(e=>e.column===c).length}`:void 0,depth:t,index:a.length});i.subHeaders.push(e),a.push(i)}i.headers.push(e),e.headerGroup=i}),o.push(i),t>0&&s(a,t-1)};s(t.map((e,t)=>Qht(n,e,{depth:i,index:t})),i-1),o.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];e.subHeaders&&e.subHeaders.length?(r=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,r.push(i)})):t=1;let i=Math.min(...r);return n+=i,e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(o[0]?.headers??[]),o}var egt=(e,t,n,r,i,a,o)=>{let s={id:t,index:r,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return s._valuesCache[t]=n.accessorFn(s.original,r),s._valuesCache[t]},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return n.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t])},renderValue:t=>s.getValue(t)??e.options.renderFallbackValue,subRows:a??[],getLeafRows:()=>Yht(s.subRows,e=>e.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:v1(()=>[e.getAllLeafColumns()],t=>t.map(t=>Xht(e,s,t,t.id)),y1(e.options,`debugRows`,`getAllCells`)),_getAllCellsByColumnId:v1(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),y1(e.options,`debugRows`,`getAllCellsByColumnId`))};for(let t=0;t<e._features.length;t++){let n=e._features[t];n==null||n.createRow==null||n.createRow(s,e)}return s},tgt={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},ngt=(e,t,n)=>{var r,i;let a=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(a))};ngt.autoRemove=e=>w1(e);var rgt=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};rgt.autoRemove=e=>w1(e);var igt=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};igt.autoRemove=e=>w1(e);var agt=(e,t,n)=>e.getValue(t)?.includes(n);agt.autoRemove=e=>w1(e);var ogt=(e,t,n)=>!n.some(n=>{var r;return!((r=e.getValue(t))!=null&&r.includes(n))});ogt.autoRemove=e=>w1(e)||!(e!=null&&e.length);var sgt=(e,t,n)=>n.some(n=>e.getValue(t)?.includes(n));sgt.autoRemove=e=>w1(e)||!(e!=null&&e.length);var cgt=(e,t,n)=>e.getValue(t)===n;cgt.autoRemove=e=>w1(e);var lgt=(e,t,n)=>e.getValue(t)==n;lgt.autoRemove=e=>w1(e);var S1=(e,t,n)=>{let[r,i]=n,a=e.getValue(t);return a>=r&&a<=i};S1.resolveFilterValue=e=>{let[t,n]=e,r=typeof t==`number`?t:parseFloat(t),i=typeof n==`number`?n:parseFloat(n),a=t===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(i)?1/0:i;if(a>o){let e=a;a=o,o=e}return[a,o]},S1.autoRemove=e=>w1(e)||w1(e[0])&&w1(e[1]);var C1={includesString:ngt,includesStringSensitive:rgt,equalsString:igt,arrIncludes:agt,arrIncludesAll:ogt,arrIncludesSome:sgt,equals:cgt,weakEquals:lgt,inNumberRange:S1};function w1(e){return e==null||e===``}var ugt={getDefaultColumnDef:()=>({filterFn:`auto`}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:g1(`columnFilters`,e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);return typeof n==`string`?C1.includesString:typeof n==`number`?C1.inNumberRange:typeof n==`boolean`||typeof n==`object`&&n?C1.equals:Array.isArray(n)?C1.arrIncludes:C1.weakEquals},e.getFilterFn=()=>_1(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn===`auto`?e.getAutoFilterFn():t.options.filterFns?.[e.columnDef.filterFn]??C1[e.columnDef.filterFn],e.getCanFilter=()=>(e.columnDef.enableColumnFilter??!0)&&(t.options.enableColumnFilters??!0)&&(t.options.enableFilters??!0)&&!!e.accessorFn,e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(t=>t.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>t.getState().columnFilters?.findIndex(t=>t.id===e.id)??-1,e.setFilterValue=n=>{t.setColumnFilters(t=>{let r=e.getFilterFn(),i=t?.find(t=>t.id===e.id),a=h1(n,i?i.value:void 0);if(dgt(r,a,e))return t?.filter(t=>t.id!==e.id)??[];let o={id:e.id,value:a};return i?t?.map(t=>t.id===e.id?o:t)??[]:t!=null&&t.length?[...t,o]:[o]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(e=>h1(t,e)?.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&dgt(t.getFilterFn(),e.value,t))}))},e.resetColumnFilters=t=>{e.setColumnFilters(t?[]:e.initialState?.columnFilters??[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function dgt(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||t===void 0||typeof t==`string`&&!t}var T1={sum:(e,t,n)=>n.reduce((t,n)=>{let r=n.getValue(e);return t+(typeof r==`number`?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r>n||r===void 0&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r<n||r===void 0&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r===void 0?n>=n&&(r=i=n):(r>n&&(r=n),i<n&&(i=n)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let i=t.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!Jht(n))return;if(n.length===1)return n[0];let r=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2==0?(i[r-1]+i[r])/2:i[r]},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},fgt={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return((t=e.getValue())==null||t.toString==null?void 0:t.toString())??null},aggregationFn:`auto`}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:g1(`grouping`,e),groupedColumnMode:`reorder`}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(t=>t!==e.id):[...t??[],e.id])},e.getCanGroup=()=>(e.columnDef.enableGrouping??!0)&&(t.options.enableGrouping??!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue),e.getIsGrouped=()=>t.getState().grouping?.includes(e.id),e.getGroupedIndex=()=>t.getState().grouping?.indexOf(e.id),e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);if(typeof n==`number`)return T1.sum;if(Object.prototype.toString.call(n)===`[object Date]`)return T1.extent},e.getAggregationFn=()=>{if(!e)throw Error();return _1(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn===`auto`?e.getAutoAggregationFn():t.options.aggregationFns?.[e.columnDef.aggregationFn]??T1[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{e.setGrouping(t?[]:e.initialState?.grouping??[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((t=n.subRows)!=null&&t.length)}}};function pgt(e,t,n){if(!(t!=null&&t.length)||!n)return e;let r=e.filter(e=>!t.includes(e.id));return n===`remove`?r:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...r]}var mgt={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:g1(`columnOrder`,e)}),createColumn:(e,t)=>{e.getIndex=v1(e=>[j1(t,e)],t=>t.findIndex(t=>t.id===e.id),y1(t.options,`debugColumns`,`getIndex`)),e.getIsFirstColumn=n=>j1(t,n)[0]?.id===e.id,e.getIsLastColumn=n=>{let r=j1(t,n);return r[r.length-1]?.id===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},e._getOrderColumnsFn=v1(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let i=[];if(!(e!=null&&e.length))i=r;else{let t=[...e],n=[...r];for(;n.length&&t.length;){let e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&i.push(n.splice(r,1)[0])}i=[...i,...n]}return pgt(i,t,n)},y1(e.options,`debugTable`,`_getOrderColumnsFn`))}},E1=()=>({left:[],right:[]}),hgt={getInitialState:e=>({columnPinning:E1(),...e}),getDefaultOptions:e=>({onColumnPinningChange:g1(`columnPinning`,e)}),createColumn:(e,t)=>{e.pin=n=>{let r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>n===`right`?{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:[...(e?.right??[]).filter(e=>!(r!=null&&r.includes(e))),...r]}:n===`left`?{left:[...(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),...r],right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))}:{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))})},e.getCanPin=()=>e.getLeafColumns().some(e=>(e.columnDef.enablePinning??!0)&&(t.options.enableColumnPinning??t.options.enablePinning??!0)),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:r,right:i}=t.getState().columnPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`left`:o?`right`:!1},e.getPinnedIndex=()=>{var n;let r=e.getIsPinned();return r?((n=t.getState().columnPinning)==null||(n=n[r])==null?void 0:n.indexOf(e.id))??-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=v1(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.column.id))},y1(t.options,`debugRows`,`getCenterVisibleCells`)),e.getLeftVisibleCells=v1(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`left`})),y1(t.options,`debugRows`,`getLeftVisibleCells`)),e.getRightVisibleCells=v1(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`right`})),y1(t.options,`debugRows`,`getRightVisibleCells`))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>e.setColumnPinning(t?E1():e.initialState?.columnPinning??E1()),e.getIsSomeColumnsPinned=t=>{let n=e.getState().columnPinning;return t?!!n[t]?.length:!!(n.left?.length||n.right?.length)},e.getLeftLeafColumns=v1(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),y1(e.options,`debugColumns`,`getLeftLeafColumns`)),e.getRightLeafColumns=v1(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),y1(e.options,`debugColumns`,`getRightLeafColumns`)),e.getCenterLeafColumns=v1(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.id))},y1(e.options,`debugColumns`,`getCenterLeafColumns`))}};function ggt(e){return e||(typeof document<`u`?document:null)}var D1={size:150,minSize:20,maxSize:2**53-1},O1=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),_gt={getDefaultColumnDef:()=>D1,getInitialState:e=>({columnSizing:{},columnSizingInfo:O1(),...e}),getDefaultOptions:e=>({columnResizeMode:`onEnd`,columnResizeDirection:`ltr`,onColumnSizingChange:g1(`columnSizing`,e),onColumnSizingInfoChange:g1(`columnSizingInfo`,e)}),createColumn:(e,t)=>{e.getSize=()=>{let n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??D1.minSize,n??e.columnDef.size??D1.size),e.columnDef.maxSize??D1.maxSize)},e.getStart=v1(e=>[e,j1(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),y1(t.options,`debugColumns`,`getStart`)),e.getAfter=v1(e=>[e,j1(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),y1(t.options,`debugColumns`,`getAfter`)),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let r=t.getColumn(e.column.id),i=r?.getCanResize();return a=>{if(!r||!i||(a.persist==null||a.persist(),A1(a)&&a.touches&&a.touches.length>1))return;let o=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],c=A1(a)?Math.round(a.touches[0].clientX):a.clientX,l={},u=(e,n)=>{typeof n==`number`&&(t.setColumnSizingInfo(e=>{let r=t.options.columnResizeDirection===`rtl`?-1:1,i=(n-(e?.startOffset??0))*r,a=Math.max(i/(e?.startSize??0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;l[t]=Math.round(Math.max(n+n*a,0)*100)/100}),{...e,deltaOffset:i,deltaPercentage:a}}),(t.options.columnResizeMode===`onChange`||e===`end`)&&t.setColumnSizing(e=>({...e,...l})))},d=e=>u(`move`,e),f=e=>{u(`end`,e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=ggt(n),m={moveHandler:e=>d(e.clientX),upHandler:e=>{p?.removeEventListener(`mousemove`,m.moveHandler),p?.removeEventListener(`mouseup`,m.upHandler),f(e.clientX)}},h={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{p?.removeEventListener(`touchmove`,h.moveHandler),p?.removeEventListener(`touchend`,h.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0]?.clientX)}},g=vgt()?{passive:!1}:!1;A1(a)?(p?.addEventListener(`touchmove`,h.moveHandler,g),p?.addEventListener(`touchend`,h.upHandler,g)):(p?.addEventListener(`mousemove`,m.moveHandler,g),p?.addEventListener(`mouseup`,m.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},e.resetHeaderSizeInfo=t=>{e.setColumnSizingInfo(t?O1():e.initialState.columnSizingInfo??O1())},e.getTotalSize=()=>e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getLeftTotalSize=()=>e.getLeftHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getCenterTotalSize=()=>e.getCenterHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getRightTotalSize=()=>e.getRightHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0}},k1=null;function vgt(){if(typeof k1==`boolean`)return k1;let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener(`test`,n,t),window.removeEventListener(`test`,n)}catch{e=!1}return k1=e,k1}function A1(e){return e.type===`touchstart`}var ygt={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:g1(`columnVisibility`,e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{let n=e.columns;return(n.length?n.some(e=>e.getIsVisible()):t.getState().columnVisibility?.[e.id])??!0},e.getCanHide=()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=v1(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),y1(t.options,`debugRows`,`_getAllVisibleCells`)),e.getVisibleCells=v1(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],y1(t.options,`debugRows`,`getVisibleCells`))},createTable:e=>{let t=(t,n)=>v1(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join(`_`)],e=>e.filter(e=>e.getIsVisible==null?void 0:e.getIsVisible()),y1(e.options,`debugColumns`,t));e.getVisibleFlatColumns=t(`getVisibleFlatColumns`,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(`getVisibleLeafColumns`,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(`getLeftVisibleLeafColumns`,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(`getRightVisibleLeafColumns`,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(`getCenterVisibleLeafColumns`,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},e.toggleAllColumnsVisible=t=>{t??=!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(n.getCanHide!=null&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(e.getIsVisible!=null&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>e.getIsVisible==null?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{e.toggleAllColumnsVisible(t.target?.checked)}}};function j1(e,t){return t?t===`center`?e.getCenterVisibleLeafColumns():t===`left`?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}var bgt={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,`__global__`),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,`__global__`),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,`__global__`),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},xgt={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:g1(`globalFilter`,e),globalFilterFn:`auto`,getColumnCanGlobalFilter:t=>{var n;let r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r==`string`||typeof r==`number`}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>(e.columnDef.enableGlobalFilter??!0)&&(t.options.enableGlobalFilter??!0)&&(t.options.enableFilters??!0)&&((t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn},createTable:e=>{e.getGlobalAutoFilterFn=()=>C1.includesString,e.getGlobalFilterFn=()=>{let{globalFilterFn:t}=e.options;return _1(t)?t:t===`auto`?e.getGlobalAutoFilterFn():e.options.filterFns?.[t]??C1[t]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Sgt={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:g1(`expanded`,e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{e.setExpanded(t?{}:e.initialState?.expanded??{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{t.persist==null||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return t===!0||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return typeof t==`boolean`?t===!0:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(`.`);t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{let i=r===!0?!0:!!(r!=null&&r[e.id]),a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=r,n??=!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){let{[e.id]:t,...n}=a;return n}return r})},e.getIsExpanded=()=>{let n=t.getState().expanded;return!!((t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))??(n===!0||n?.[e.id]))},e.getCanExpand=()=>{var n;return(t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!!((n=e.subRows)!=null&&n.length))},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},M1=0,N1=10,P1=()=>({pageIndex:M1,pageSize:N1}),Cgt={getInitialState:e=>({...e,pagination:{...P1(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:g1(`pagination`,e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(e=>h1(t,e)),e.resetPagination=t=>{e.setPagination(t?P1():e.initialState.pagination??P1())},e.setPageIndex=t=>{e.setPagination(n=>{let r=h1(t,n.pageIndex),i=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n;e.setPageIndex(t?M1:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageIndex)??M1)},e.resetPageSize=t=>{var n;e.setPageSize(t?N1:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageSize)??N1)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,h1(t,e.pageSize)),r=e.pageSize*e.pageIndex,i=Math.floor(r/n);return{...e,pageIndex:i,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{let r=h1(t,e.options.pageCount??-1);return typeof r==`number`&&(r=Math.max(-1,r)),{...n,pageCount:r}}),e.getPageOptions=v1(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},y1(e.options,`debugTable`,`getPageOptions`)),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return n===-1?!0:n===0?!1:t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>e.options.pageCount??Math.ceil(e.getRowCount()/e.getState().pagination.pageSize),e.getRowCount=()=>e.options.rowCount??e.getPrePaginationRowModel().rows.length}},F1=()=>({top:[],bottom:[]}),wgt={getInitialState:e=>({rowPinning:F1(),...e}),getDefaultOptions:e=>({onRowPinningChange:g1(`rowPinning`,e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{let a=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],o=i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...o,e.id,...a]);t.setRowPinning(e=>n===`bottom`?{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:[...(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)]}:n===`top`?{top:[...(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)],bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))}:{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))})},e.getCanPin=()=>{let{enableRowPinning:n,enablePinning:r}=t.options;return typeof n==`function`?n(e):n??r??!0},e.getIsPinned=()=>{let n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`top`:o?`bottom`:!1},e.getPinnedIndex=()=>{let n=e.getIsPinned();return n?((n===`top`?t.getTopRows():t.getBottomRows())?.map(e=>{let{id:t}=e;return t}))?.indexOf(e.id)??-1:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>e.setRowPinning(t?F1():e.initialState?.rowPinning??F1()),e.getIsSomeRowsPinned=t=>{let n=e.getState().rowPinning;return t?!!n[t]?.length:!!(n.top?.length||n.bottom?.length)},e._getPinnedRows=(t,n,r)=>(e.options.keepPinnedRows??!0?(n??[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(n??[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r})),e.getTopRows=v1(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,`top`),y1(e.options,`debugRows`,`getTopRows`)),e.getBottomRows=v1(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,`bottom`),y1(e.options,`debugRows`,`getBottomRows`)),e.getCenterRows=v1(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let r=new Set([...t??[],...n??[]]);return e.filter(e=>!r.has(e.id))},y1(e.options,`debugRows`,`getCenterRows`))}},Tgt={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:g1(`rowSelection`,e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=t===void 0?!e.getIsAllRowsSelected():t;let r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):i.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let r=t===void 0?!e.getIsAllPageRowsSelected():t,i={...n};return e.getRowModel().rows.forEach(t=>{I1(i,t.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=v1(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?L1(e,n):{rows:[],flatRows:[],rowsById:{}},y1(e.options,`debugTable`,`getSelectedRowModel`)),e.getFilteredSelectedRowModel=v1(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?L1(e,n):{rows:[],flatRows:[],rowsById:{}},y1(e.options,`debugTable`,`getFilteredSelectedRowModel`)),e.getGroupedSelectedRowModel=v1(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?L1(e,n):{rows:[],flatRows:[],rowsById:{}},y1(e.options,`debugTable`,`getGroupedSelectedRowModel`)),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),r=!!(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{let t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{let i=e.getIsSelected();t.setRowSelection(a=>{if(n=n===void 0?!i:n,e.getCanSelect()&&i===n)return a;let o={...a};return I1(o,e.id,n,r?.selectChildren??!0,t),o})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return R1(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return z1(e,n)===`some`},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return z1(e,n)===`all`},e.getCanSelect=()=>typeof t.options.enableRowSelection==`function`?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,e.getCanSelectSubRows=()=>typeof t.options.enableSubRowSelection==`function`?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,e.getCanMultiSelect=()=>typeof t.options.enableMultiRowSelection==`function`?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{t&&e.toggleSelected(n.target?.checked)}}}},I1=(e,t,n,r,i)=>{var a;let o=i.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(a=o.subRows)!=null&&a.length&&o.getCanSelectSubRows()&&o.subRows.forEach(t=>I1(e,t.id,n,r,i))};function L1(e,t){let n=e.getState().rowSelection,r=[],i={},a=function(e,t){return e.map(e=>{var t;let o=R1(e,n);if(o&&(r.push(e),i[e.id]=e),(t=e.subRows)!=null&&t.length&&(e={...e,subRows:a(e.subRows)}),o)return e}).filter(Boolean)};return{rows:a(t.rows),flatRows:r,rowsById:i}}function R1(e,t){return t[e.id]??!1}function z1(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,a=!1;return e.subRows.forEach(e=>{if(!(a&&!i)&&(e.getCanSelect()&&(R1(e,t)?a=!0:i=!1),e.subRows&&e.subRows.length)){let n=z1(e,t);n===`all`?a=!0:(n===`some`&&(a=!0),i=!1)}}),i?`all`:a?`some`:!1}var B1=/([0-9]+)/gm,Egt=(e,t,n)=>Mgt(H1(e.getValue(n)).toLowerCase(),H1(t.getValue(n)).toLowerCase()),Dgt=(e,t,n)=>Mgt(H1(e.getValue(n)),H1(t.getValue(n))),Ogt=(e,t,n)=>V1(H1(e.getValue(n)).toLowerCase(),H1(t.getValue(n)).toLowerCase()),kgt=(e,t,n)=>V1(H1(e.getValue(n)),H1(t.getValue(n))),Agt=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},jgt=(e,t,n)=>V1(e.getValue(n),t.getValue(n));function V1(e,t){return e===t?0:e>t?1:-1}function H1(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function Mgt(e,t){let n=e.split(B1).filter(Boolean),r=t.split(B1).filter(Boolean);for(;n.length&&r.length;){let e=n.shift(),t=r.shift(),i=parseInt(e,10),a=parseInt(t,10),o=[i,a].sort();if(isNaN(o[0])){if(e>t)return 1;if(t>e)return-1;continue}if(isNaN(o[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}var U1={alphanumeric:Egt,alphanumericCaseSensitive:Dgt,text:Ogt,textCaseSensitive:kgt,datetime:Agt,basic:jgt},Ngt=[$ht,ygt,mgt,hgt,tgt,ugt,bgt,xgt,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:`auto`,sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:g1(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),r=!1;for(let t of n){let n=t?.getValue(e.id);if(Object.prototype.toString.call(n)===`[object Date]`)return U1.datetime;if(typeof n==`string`&&(r=!0,n.split(B1).length>1))return U1.alphanumeric}return r?U1.text:U1.basic},e.getAutoSortDir=()=>typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id)==`string`?`asc`:`desc`,e.getSortingFn=()=>{if(!e)throw Error();return _1(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn===`auto`?e.getAutoSortingFn():t.options.sortingFns?.[e.columnDef.sortingFn]??U1[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{let i=e.getNextSortingOrder(),a=n!=null;t.setSorting(o=>{let s=o?.find(t=>t.id===e.id),c=o?.findIndex(t=>t.id===e.id),l=[],u,d=a?n:i===`desc`;return u=o!=null&&o.length&&e.getCanMultiSort()&&r?s?`toggle`:`add`:o!=null&&o.length&&c!==o.length-1?`replace`:s?`toggle`:`replace`,u===`toggle`&&(a||i||(u=`remove`)),u===`add`?(l=[...o,{id:e.id,desc:d}],l.splice(0,l.length-(t.options.maxMultiSortColCount??2**53-1))):l=u===`toggle`?o.map(t=>t.id===e.id?{...t,desc:d}:t):u===`remove`?o.filter(t=>t.id!==e.id):[{id:e.id,desc:d}],l})},e.getFirstSortDir=()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??e.getAutoSortDir()===`desc`?`desc`:`asc`,e.getNextSortingOrder=n=>{let r=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==r&&(t.options.enableSortingRemoval??!0)&&(!n||(t.options.enableMultiRemove??!0))?!1:i===`desc`?`asc`:`desc`:r},e.getCanSort=()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,e.getCanMultiSort=()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,e.getIsSorted=()=>{let n=t.getState().sorting?.find(t=>t.id===e.id);return n?n.desc?`desc`:`asc`:!1},e.getSortIndex=()=>t.getState().sorting?.findIndex(t=>t.id===e.id)??-1,e.clearSorting=()=>{t.setSorting(t=>t!=null&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{e.setSorting(t?[]:e.initialState?.sorting??[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},fgt,Sgt,Cgt,wgt,Tgt,_gt];function Pgt(e){let t=[...Ngt,...e._features??[]],n={_features:t},r=n._features.reduce((e,t)=>Object.assign(e,t.getDefaultOptions==null?void 0:t.getDefaultOptions(n)),{}),i=e=>n.options.mergeOptions?n.options.mergeOptions(r,e):{...r,...e},a={...e.initialState??{}};n._features.forEach(e=>{a=(e.getInitialState==null?void 0:e.getInitialState(a))??a});let o=[],s=!1,c={_features:t,options:{...r,...e},initialState:a,_queue:e=>{o.push(e),s||(s=!0,Promise.resolve().then(()=>{for(;o.length;)o.shift()();s=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{n.options=i(h1(e,n.options))},getState:()=>n.options.state,setState:e=>{n.options.onStateChange==null||n.options.onStateChange(e)},_getRowId:(e,t,r)=>(n.options.getRowId==null?void 0:n.options.getRowId(e,t,r))??`${r?[r.id,t].join(`.`):t}`,getCoreRowModel:()=>(n._getCoreRowModel||=n.options.getCoreRowModel(n),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?n.getPrePaginationRowModel():n.getRowModel()).rowsById[e];if(!r&&(r=n.getCoreRowModel().rowsById[e],!r))throw Error();return r},_getDefaultColumnDef:v1(()=>[n.options.defaultColumn],e=>(e??={},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return((t=e.renderValue())==null||t.toString==null?void 0:t.toString())??null},...n._features.reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef==null?void 0:t.getDefaultColumnDef()),{}),...e}),y1(e,`debugColumns`,`_getDefaultColumnDef`)),_getColumnDefs:()=>n.options.columns,getAllColumns:v1(()=>[n._getColumnDefs()],e=>{let t=function(e,r,i){return i===void 0&&(i=0),e.map(e=>{let a=Zht(n,e,i,r),o=e;return a.columns=o.columns?t(o.columns,a,i+1):[],a})};return t(e)},y1(e,`debugColumns`,`getAllColumns`)),getAllFlatColumns:v1(()=>[n.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),y1(e,`debugColumns`,`getAllFlatColumns`)),_getAllFlatColumnsById:v1(()=>[n.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),y1(e,`debugColumns`,`getAllFlatColumnsById`)),getAllLeafColumns:v1(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),y1(e,`debugColumns`,`getAllLeafColumns`)),getColumn:e=>n._getAllFlatColumnsById()[e]};Object.assign(n,c);for(let e=0;e<n._features.length;e++){let t=n._features[e];t==null||t.createTable==null||t.createTable(n)}return n}function Fgt(){return e=>v1(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},r=function(t,i,a){i===void 0&&(i=0);let o=[];for(let c=0;c<t.length;c++){let l=egt(e,e._getRowId(t[c],c,a),t[c],c,i,void 0,a?.id);if(n.flatRows.push(l),n.rowsById[l.id]=l,o.push(l),e.options.getSubRows){var s;l.originalSubRows=e.options.getSubRows(t[c],c),(s=l.originalSubRows)!=null&&s.length&&(l.subRows=r(l.originalSubRows,i+1,l))}}return o};return n.rows=r(t),n},y1(e.options,`debugTable`,`getRowModel`,()=>e._autoResetPageIndex()))}function Igt(e){let t=[],n=e=>{var r;t.push(e),(r=e.subRows)!=null&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Lgt(e){return e=>v1(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{if(!n.rows.length)return n;let{pageSize:r,pageIndex:i}=t,{rows:a,flatRows:o,rowsById:s}=n,c=r*i,l=c+r;a=a.slice(c,l);let u;u=e.options.paginateExpandedRows?{rows:a,flatRows:o,rowsById:s}:Igt({rows:a,flatRows:o,rowsById:s}),u.flatRows=[];let d=e=>{u.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return u.rows.forEach(d),u},y1(e.options,`debugTable`,`getPaginationRowModel`))}function Rgt(){return e=>v1(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;let r=e.getState().sorting,i=[],a=r.filter(t=>e.getColumn(t.id)?.getCanSort()),o={};a.forEach(t=>{let n=e.getColumn(t.id);n&&(o[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let s=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let n=0;n<a.length;n+=1){let r=a[n],i=o[r.id],s=i.sortUndefined,c=r?.desc??!1,l=0;if(s){let n=e.getValue(r.id),i=t.getValue(r.id),a=n===void 0,o=i===void 0;if(a||o){if(s===`first`)return a?-1:1;if(s===`last`)return a?1:-1;l=a&&o?0:a?s:-s}}if(l===0&&(l=i.sortingFn(e,t,r.id)),l!==0)return c&&(l*=-1),i.invertSorting&&(l*=-1),l}return e.index-t.index}
779),t.forEach(e=>{var t;i.push(e),(t=e.subRows)!=null&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},y1(e.options,`debugTable`,`getSortedRowModel`,()=>e._autoResetPageIndex()))}function zgt(e,t){return e?Bgt(e)?B.createElement(e,t):e:null}function Bgt(e){return Vgt(e)||typeof e==`function`||Hgt(e)}function Vgt(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Hgt(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function Ugt(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=B.useState(()=>({current:Pgt(t)})),[r,i]=B.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),e.onStateChange==null||e.onStateChange(t)}})),n.current}var Wgt={pending:{label:`Pending`,variant:`outline`,icon:Jg},processing:{label:`Processing`,variant:`secondary`,icon:W},completed:{label:`Completed`,variant:`default`,icon:n_},failed:{label:`Failed`,variant:`destructive`,icon:Hg},classified:{label:`Classified`,variant:`outline`,icon:__},ready_for_review:{label:`Ready for Review`,variant:`default`,icon:n_}};function Ggt(e){let t=[];for(let n of e){let e=n.from_name||n.from_email,r=n.subject||`(no subject)`,i=n.documents??[];if(i.length===0)t.push({key:n.id,taskId:n.id,from:e,subject:r,filename:`â`,fileStatus:n.status??`â`});else for(let a of i)t.push({key:`${n.id}-${a.id}`,taskId:n.id,from:e,subject:r,filename:a.original_filename,fileStatus:a.status})}return t}function Kgt({status:e}){let t=Wgt[e];if(!t)return(0,K.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:e});let n=t.icon;return(0,K.jsxs)(lR,{variant:t.variant,className:`gap-1`,children:[(0,K.jsx)(n,{className:`h-3 w-3`}),t.label]})}var qgt={processing:0,pending:1,failed:2,completed:3,classified:4,ready_for_review:5,"â":6},Jgt=[{accessorKey:`from`,header:`From`,cell:({row:e})=>(0,K.jsx)(`div`,{className:`max-w-[160px] truncate`,children:e.getValue(`from`)})},{accessorKey:`subject`,header:`Subject`,cell:({row:e})=>(0,K.jsx)(`div`,{className:`max-w-[240px] truncate`,children:e.getValue(`subject`)})},{accessorKey:`filename`,header:`File`,cell:({row:e})=>(0,K.jsx)(`div`,{className:`max-w-[200px] truncate`,children:e.getValue(`filename`)})},{accessorKey:`fileStatus`,header:({column:e})=>(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,className:`-ml-3`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Status`,(0,K.jsx)(Dg,{className:`ml-1 h-4 w-4`})]}),cell:({row:e})=>{let t=e.getValue(`fileStatus`);return t===`â`?(0,K.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`â`}):(0,K.jsx)(Kgt,{status:t})},sortingFn:(e,t)=>(qgt[e.getValue(`fileStatus`)]??99)-(qgt[t.getValue(`fileStatus`)]??99)}];function Ygt(){let e=Sv(),{tasks:t,isLoading:n,loadTasks:r}=Ux();(0,B.useEffect)(()=>{r()},[r]);let i=(0,B.useMemo)(()=>Ggt(t),[t]),[a,o]=(0,B.useState)([]),[s,c]=(0,B.useState)({pageIndex:0,pageSize:5}),l=Ugt({data:i,columns:Jgt,state:{sorting:a,pagination:s},onSortingChange:o,onPaginationChange:c,getCoreRowModel:Fgt(),getSortedRowModel:Rgt(),getPaginationRowModel:Lgt(),getRowId:e=>e.key});return n&&t.length===0?(0,K.jsx)(`div`,{className:`px-4 lg:px-6 space-y-2`,children:Array.from({length:4}).map((e,t)=>(0,K.jsx)(LI,{className:`h-10 w-full rounded-md`},t))}):i.length===0?(0,K.jsxs)(`div`,{className:`px-4 lg:px-6 flex flex-col items-center justify-center py-16 text-muted-foreground gap-2`,children:[(0,K.jsx)(__,{className:`h-8 w-8`}),(0,K.jsx)(`span`,{className:`text-sm`,children:`No email tasks yet`})]}):(0,K.jsxs)(`div`,{className:`px-4 lg:px-6`,children:[(0,K.jsx)(`div`,{className:`overflow-hidden rounded-lg border`,children:(0,K.jsxs)(iU,{children:[(0,K.jsx)(aU,{children:l.getHeaderGroups().map(e=>(0,K.jsx)(sU,{children:e.headers.map(e=>(0,K.jsx)(cU,{children:e.isPlaceholder?null:zgt(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,K.jsx)(oU,{children:l.getRowModel().rows.length?l.getRowModel().rows.map(t=>
779(0,K.jsx)(sU,{className:`cursor-pointer`,onClick:()=>e(`/email-task?taskId=${t.original.taskId}`),children:t.getVisibleCells().map(e=>(0,K.jsx)(lU,{children:zgt(e.column.columnDef.cell,e.getContext())},e.id))},t.id)):(0,K.jsx)(sU,{children:(0,K.jsx)(lU,{colSpan:Jgt.length,className:`h-24 text-center`,children:`No results.`})})})]})}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between pt-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Rows per page`}),(0,K.jsxs)(vO,{value:String(l.getState().pagination.pageSize),onValueChange:e=>l.setPageSize(Number(e)),children:[(0,K.jsx)(bO,{className:`h-8 w-16`,children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:[5,10,20].map(e=>(0,K.jsx)(SO,{value:String(e),children:e},e))})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[`Page `,l.getState().pagination.pageIndex+1,` of`,` `,l.getPageCount()]}),(0,K.jsxs)(J,{variant:`outline`,size:`icon-sm`,onClick:()=>l.previousPage(),disabled:!l.getCanPreviousPage(),children:[(0,K.jsx)(zg,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Previous page`})]}),(0,K.jsxs)(J,{variant:`outline`,size:`icon-sm`,onClick:()=>l.nextPage(),disabled:!l.getCanNextPage(),children:[(0,K.jsx)(Bg,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Next page`})]})]})]})]})}function Xgt(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Zgt=B.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:`bottom`,shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),W1=()=>{let e=B.useContext(Zgt);if(!e)throw Error(`useDrawerContext must be used within a Drawer.Root`);return e};Xgt(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not( 780[data-state=closed] 781){opacity:0}
781[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Qgt(){let e=navigator.userAgent;return typeof window<`u`&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function $gt(){return G1(/^Mac/)}function e_t(){return G1(/^iPhone/)}function t_t(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function n_t(){return G1(/^iPad/)||$gt()&&navigator.maxTouchPoints>1}function r_t(){return e_t()||n_t()}function G1(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.platform):void 0}var i_t=24,a_t=typeof window<`u`?B.useLayoutEffect:B.useEffect;function o_t(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}var K1=typeof document<`u`&&window.visualViewport;function s_t(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function c_t(e){for(s_t(e)&&(e=e.parentElement);e&&!s_t(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}var l_t=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]),q1=0,u_t;function d_t(e={}){let{isDisabled:t}=e;a_t(()=>{if(!t)return q1++,q1===1&&r_t()&&(u_t=f_t()),()=>{q1--,q1===0&&u_t?.()}},[t])}function f_t(){let e,t=0,n=n=>{e=c_t(n.target),!(e===document.documentElement&&e===document.body)&&(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body){n.preventDefault();return}let r=n.changedTouches[0].pageY,i=e.scrollTop,a=e.scrollHeight-e.clientHeight;a!==0&&((i<=0&&r>t||i>=a&&r<t)&&n.preventDefault(),t=r)},i=e=>{let t=e.target;Y1(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform=`translateY(-2000px)`,t.focus(),requestAnimationFrame(()=>{t.style.transform=``}))},a=e=>{let t=e.target;Y1(t)&&(t.style.transform=`translateY(-2000px)`,requestAnimationFrame(()=>{t.style.transform=``,K1&&(K1.height<window.innerHeight?requestAnimationFrame(()=>{m_t(t)}):K1.addEventListener(`resize`,()=>m_t(t),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},s=window.pageXOffset,c=window.pageYOffset,l=o_t(p_t(document.documentElement,`paddingRight`,`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=o_t(J1(document,`touchstart`,n,{passive:!1,capture:!0}),J1(document,`touchmove`,r,{passive:!1,capture:!0}),J1(document,`touchend`,i,{passive:!1,capture:!0}),J1(document,`focus`,a,!0),J1(window,`scroll`,o));return()=>{l(),u(),window.scrollTo(s,c)}}function p_t(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function J1(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function m_t(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=c_t(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+i_t&&(t.scrollTop+=r-n)}e=t.parentElement}}function Y1(e){return e instanceof HTMLInputElement&&!l_t.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function h_t(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function g_t(...e){return t=>
781e.forEach(e=>h_t(e,t))}function __t(...e){return B.useCallback(g_t(...e),e)}var v_t=new WeakMap;function X1(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{if(t.startsWith(`--`)){e.style.setProperty(t,n);return}r[t]=e.style[t],e.style[t]=n}),!n&&v_t.set(e,r)}function y_t(e,t){if(!e||!(e instanceof HTMLElement))return;let n=v_t.get(e);n&&(e.style[t]=n[t])}var Z1=e=>{switch(e){case`top`:case`bottom`:return!0;case`left`:case`right`:return!1;default:return e}};function Q1(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,i=r.match(/^matrix3d\((.+)\)$/);return i?parseFloat(i[1].split(`, `)[Z1(t)?13:12]):(i=r.match(/^matrix\((.+)\)$/),i?parseFloat(i[1].split(`, `)[Z1(t)?5:4]):null)}function b_t(e){return 8*(Math.log(e+1)-2)}function $1(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}var e0={DURATION:.5,EASE:[.32,.72,0,1]},x_t=.4,S_t=.25,C_t=100,w_t=8,t0=16,n0=26,r0=`vaul-dragging`;function T_t(e){let t=B.useRef(e);return B.useEffect(()=>{t.current=e}),B.useMemo(()=>(...e)=>t.current==null?void 0:t.current.call(t,...e),[])}function E_t({defaultProp:e,onChange:t}){let n=B.useState(e),[r]=n,i=B.useRef(r),a=T_t(t);return B.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}function D_t({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=E_t({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=T_t(n);return[o,B.useCallback(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function O_t({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:i,fadeFromIndex:a,onSnapPointChange:o,direction:s=`bottom`,container:c,snapToSequentialPoint:l}){let[u,d]=D_t({prop:e,defaultProp:n?.[0],onChange:t}),[f,p]=B.useState(typeof window<`u`?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);B.useEffect(()=>{function e(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let m=B.useMemo(()=>u===n?.[n.length-1]||null,[n,u]),h=B.useMemo(()=>n?.findIndex(e=>e===u)??null,[n,u]),g=n&&n.length>0&&(a||a===0)&&!Number.isNaN(a)&&n[a]===u||!n,_=B.useMemo(()=>{let e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return n?.map(t=>{let n=typeof t==`string`,r=0;if(n&&(r=parseInt(t,10)),Z1(s)){let i=n?r:f?t*e.height:0;return f?s===`bottom`?e.height-i:-e.height+i:i}let i=n?r:f?t*e.width:0;return f?s===`right`?e.width-i:-e.width+i:i})??[]},[n,f,c]),v=B.useMemo(()=>h===null?null:_?.[h],[_,h]),y=B.useCallback(e=>{let t=_?.findIndex(t=>t===e)??null;o(t),X1(r.current,{transition:`transform ${e0.DURATION}s cubic-bezier(${e0.EASE.join(`,`)})`,transform:Z1(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),_&&t!==_.length-1&&a!==void 0&&t!==a&&t<a?X1(i.current,{transition:`opacity ${e0.DURATION}s cubic-bezier(${e0.EASE.join(`,`)})`,opacity:`0`}):X1(i.current,{transition:`opacity ${e0.DURATION}s cubic-bezier(${e0.EASE.join(`,`)})`,opacity:`1`}),d(n?.[Math.max(t,0)])},[r.current,n,_,a,i,d]);B.useEffect(()=>{if(u||e){let t=n?.findIndex(t=>t===e||t===u)??-1;_&&t!==-1&&typeof _[t]==`number`&&y(_[t])}},[u,e,n,_,y]);function b({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:o}){if(a===void 0)return;let c=s===`bottom`||s===`right`?(v??0)-e:(v??0)+e,u=h===a-1,d=h===0,f=e>0;if(u&&X1(i.current,{transition:`opacity ${e0.DURATION}s cubic-bezier(${e0.EASE.join(`,`)})`}),!l&&r>2&&!f){o?t():y(_[0]);return}if(!l&&r>2&&f&&_&&n){y(_[n.length-1]);return}let p=_?.reduce((e,t)=>typeof e!=`number`||typeof t!=`number`?e:Math.abs(t-c)<Math.abs(e-c)?t:e),g=Z1(s)?window.innerHeight:window.innerWidth;if(r>x_t&&Math.abs(e)<g*.4){let e=f?1:-1;if(e>0&&m&&n){y(_[n.length-1]);return}if(d&&e<0&&o&&t(),h===null)return;y(_[h+e]);return}y(p)}function x({draggedDistance:e}){if(v===null)return;let t=s===`bottom`||s===`right`?v-e:v+e;(s===`bottom`||s===`right`)&&t<_[_.length-1]||(s===`top`||s===`left`)&&t>_[_.length-1]||X1(r.current,{transform:Z1(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})}function S(e,t){if(!n||typeof h!=`number`||!_||a===void 0)return null;let r=h===a-1;if(h>=a&&t)return 0;if(r&&!t)return 1;if(!g&&!r)return null;let i=r?h+1:h-1,o=r?_[i]-_[i-1]:_[i+1]-_[i],s=e/Math.abs(o);return r?1-s:s}return{isLastSnapPoint:m,activeSnapPoint:u,shouldFade:g,getPercentageDragged:S,setActiveSnapPoint:d,activeSnapPointIndex:h,onRelease:b,onDrag:x,snapPointsOffset:_}}
781function k_t(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:i}=W1(),a=B.useRef(null),o=(0,B.useMemo)(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-n0)/window.innerWidth}B.useEffect(()=>{if(t&&n){a.current&&clearTimeout(a.current);let t=document.querySelector(`[data-vaul-drawer-wrapper]`)||document.querySelector(`[vaul-drawer-wrapper]`);if(!t)return;r&&!i&&$1(document.body,{background:`black`}),$1(t,{transformOrigin:Z1(e)?`top`:`left`,transitionProperty:`transform, border-radius`,transitionDuration:`${e0.DURATION}s`,transitionTimingFunction:`cubic-bezier(${e0.EASE.join(`,`)})`});let n=$1(t,{borderRadius:`${w_t}px`,overflow:`hidden`,...Z1(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),a.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty(`background`)},e0.DURATION*1e3)}}},[t,n,o])}var i0=null;function A_t({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:i,noBodyStyles:a}){let[o,s]=B.useState(()=>typeof window<`u`?window.location.href:``),c=B.useRef(0),l=B.useCallback(()=>{if(t_t()&&i0===null&&e&&!a){i0={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:`unset`};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty(`position`,`fixed`,`important`),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-e}px`,right:`0px`,height:`auto`}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=`${-(c.current+e)}px`)}),300)}},[e]),u=B.useCallback(()=>{if(t_t()&&i0!==null&&!a){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,i0),window.requestAnimationFrame(()=>{if(i&&o!==window.location.href){s(window.location.href);return}window.scrollTo(t,e)}),i0=null}},[o]);return B.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener(`scroll`,e),()=>{window.removeEventListener(`scroll`,e)}},[]),B.useEffect(()=>{if(t)return()=>{typeof document>`u`||document.querySelector(`[data-vaul-drawer]`)||u()}},[t,u]),B.useEffect(()=>{n||!r||(e?(!window.matchMedia(`(display-mode: standalone)`).matches&&l(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,o,t,n,l,u]),{restorePositionSetting:u}}function j_t({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:i,snapPoints:a,shouldScaleBackground:o=!1,setBackgroundColorOnScale:s=!0,closeThreshold:c=S_t,scrollLockTimeout:l=C_t,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:f=a&&a.length-1,activeSnapPoint:p,setActiveSnapPoint:m,fixed:h,modal:g=!0,onClose:_,nested:v,noBodyStyles:y=!1,direction:b=`bottom`,defaultOpen:x=!1,disablePreventScroll:S=!0,snapToSequentialPoint:C=!1,preventScrollRestoration:w=!1,repositionInputs:T=!0,onAnimationEnd:E,container:D,autoFocus:O=!1}){let[k=!1,A]=D_t({defaultProp:x,prop:e,onChange:e=>{t?.(e),!e&&!v&&be(),setTimeout(()=>{E?.(e)},e0.DURATION*1e3),e&&!g&&typeof window<`u`&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`}),e||(document.body.style.pointerEvents=`auto`)}}),[j,M]=B.useState(!1),[N,P]=B.useState(!1),[F,I]=B.useState(!1),L=B.useRef(null),ee=B.useRef(null),R=B.useRef(null),te=B.useRef(null),ne=B.useRef(null),re=B.useRef(!1),ie=B.useRef(null),z=B.useRef(0),ae=B.useRef(!1),oe=B.useRef(!x),se=B.useRef(0),ce=B.useRef(null),le=B.useRef(ce.current?.getBoundingClientRect().height||0),ue=B.useRef(ce.current?.getBoundingClientRect().width||0),de=B.useRef(0),{activeSnapPoint:fe,activeSnapPointIndex:pe,setActiveSnapPoint:me,onRelease:he,snapPointsOffset:ge,onDrag:_e,shouldFade:ve,getPercentageDragged:ye}=O_t({snapPoints:a,activeSnapPointProp:p,setActiveSnapPointProp:m,drawerRef:ce,fadeFromIndex:f,overlayRef:L,onSnapPointChange:B.useCallback(e=>{a&&e===ge.length-1&&(ee.current=new Date)},[]),direction:b,container:D,snapToSequentialPoint:C});d_t({isDisabled:!k||N||!g||F||!j||!T||!S});let{restorePositionSetting:be}=A_t({isOpen:k,modal:g,nested:v??!1,hasBeenOpened:j,preventScrollRestoration:w,noBodyStyles:y});function xe(){return(window.innerWidth-n0)/window.innerWidth}function Se(e){!u&&!a||ce.current&&!ce.current.contains(e.target)||(le.current=ce.current?.getBoundingClientRect().height||0,ue.current=ce.current?.getBoundingClientRect().width||0,P(!0),R.current=ne
781w Date,r_t()&&window.addEventListener(`touchend`,()=>re.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),z.current=Z1(b)?e.pageY:e.pageX)}function Ce(e,t){let n=e,r=window.getSelection()?.toString(),i=ce.current?Q1(ce.current,b):null,a=new Date;if(n.tagName===`SELECT`||n.hasAttribute(`data-vaul-no-drag`)||n.closest(`[data-vaul-no-drag]`))return!1;if(b===`right`||b===`left`)return!0;if(ee.current&&a.getTime()-ee.current.getTime()<500)return!1;if(i!==null&&(b===`bottom`?i>0:i<0))return!0;if(r&&r.length>0)return!1;if(ne.current&&a.getTime()-ne.current.getTime()<l&&i===0||t)return ne.current=a,!1;for(;n;){if(n.scrollHeight>n.clientHeight){if(n.scrollTop!==0)return ne.current=new Date,!1;if(n.getAttribute(`role`)===`dialog`)return!0}n=n.parentNode}return!0}function we(e){if(ce.current&&N){let t=b===`bottom`||b===`right`?1:-1,n=(z.current-(Z1(b)?e.pageY:e.pageX))*t,i=n>0,s=a&&!u&&!i;if(s&&pe===0)return;let c=Math.abs(n),l=document.querySelector(`[data-vaul-drawer-wrapper]`),d=c/(b===`bottom`||b===`top`?le.current:ue.current),p=ye(c,i);if(p!==null&&(d=p),s&&d>
781=1||!re.current&&!Ce(e.target,i))return;if(ce.current.classList.add(r0),re.current=!0,X1(ce.current,{transition:`none`}),X1(L.current,{transition:`none`}),a&&_e({draggedDistance:n}),i&&!a){let e=b_t(n),r=Math.min(e*-1,0)*t;X1(ce.current,{transform:Z1(b)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`});return}let m=1-d;if((ve||f&&pe===f-1)&&(r?.(e,d),X1(L.current,{opacity:`${m}`,transition:`none`},!0)),l&&L.current&&o){let e=Math.min(xe()+d*(1-xe()),1),t=8-d*8,n=Math.max(0,14-d*14);X1(l,{borderRadius:`${t}px`,transform:Z1(b)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:`none`},!0)}if(!a){let e=c*t;X1(ce.current,{transform:Z1(b)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}}B.useEffect(()=>{window.requestAnimationFrame(()=>{oe.current=!0})},[]),B.useEffect(()=>{var e;function t(){if(!ce.current||!T)return;let e=document.activeElement;if(Y1(e)||ae.current){let e=window.visualViewport?.height||0,t=window.innerHeight,n=t-e,r=ce.current.getBoundingClientRect().height||0,i=r>t*.8;de.current||=r;let o=ce.current.getBoundingClientRect().top;if(Math.abs(se.current-n)>60&&(ae.current=!ae.current),a&&a.length>0&&ge&&pe){let e=ge[pe]||0;n+=e}if(se.current=n,r>e||ae.current){let t=ce.current.getBoundingClientRect().height,r=t;t>e&&(r=e-(i?o:n0)),h?ce.current.style.height=`${t-Math.max(n,0)}px`:ce.current.style.height=`${Math.max(r,e-o)}px`}else Qgt()||(ce.current.style.height=`${de.current}px`);a&&a.length>0&&!ae.current?ce.current.style.bottom=`0px`:ce.current.style.bottom=`${Math.max(n,0)}px`}}return(e=window.visualViewport)==null||e.addEventListener(`resize`,t),()=>window.visualViewport?.removeEventListener(`resize`,t)},[pe,a,ge]);function Te(e){De(),_?.(),e||A(!1),setTimeout(()=>{a&&me(a[0])},e0.DURATION*1e3)}function Ee(){if(!ce.current)return;let e=document.querySelector(`[data-vaul-drawer-wrapper]`),t=Q1(ce.current,b);X1(ce.current,{transform:`translate3d(0, 0, 0)`,transition:`transform ${e0.DURATION}s cubic-bezier(${e0.EASE.join(`,`)})`}),X1(L.current,{transition:`opacity ${e0.DURATION}s cubic-bezier(${e0.EASE.join(`,`)})`,opacity:`1`}),o&&t&&t>0&&k&&X1(e,{borderRadius:`${w_t}px`,overflow:`hidden`,...Z1(b)?{transform:`scale(${xe()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:`top`}:{transform:`scale(${xe()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:`left`},transitionProperty:`transform, border-radius`,transitionDuration:`${e0.DURATION}s`,transitionTimingFunction:`cubic-bezier(${e0.EASE.join(`,`)})`},!0)}function De(){!N||!ce.current||(ce.current.classList.remove(r0),re.current=!1,P(!1),te.current=new Date)}function Oe(e){if(!N||!ce.current)return;ce.current.classList.remove(r0),re.current=!1,P(!1),te.current=new Date;let t=Q1(ce.current,b);
781if(!e||!Ce(e.target,!1)||!t||Number.isNaN(t)||R.current===null)return;let n=te.current.getTime()-R.current.getTime(),r=z.current-(Z1(b)?e.pageY:e.pageX),o=Math.abs(r)/n;if(o>.05&&(I(!0),setTimeout(()=>{I(!1)},200)),a){he({draggedDistance:r*(b===`bottom`||b===`right`?1:-1),closeDrawer:Te,velocity:o,dismissible:u}),i?.(e,!0);return}if(b===`bottom`||b===`right`?r>0:r<0){Ee(),i?.(e,!0);return}if(o>x_t){Te(),i?.(e,!1);return}let s=Math.min(ce.current.getBoundingClientRect().height??0,window.innerHeight),l=Math.min(ce.current.getBoundingClientRect().width??0,window.innerWidth),d=b===`left`||b===`right`;if(Math.abs(t)>=(d?l:s)*c){Te(),i?.(e,!1);return}i?.(e,!0),Ee()}B.useEffect(()=>(k&&(X1(document.documentElement,{scrollBehavior:`auto`}),ee.current=new Date),()=>{y_t(document.documentElement,`scrollBehavior`)}),[k]);function ke(e){let t=e?(window.innerWidth-t0)/window.innerWidth:1,n=e?-t0:0;ie.current&&window.clearTimeout(ie.current),X1(ce.current,{transition:`transform ${e0.DURATION}s cubic-bezier(${e0.EASE.join(`,`)})`,transform:Z1(b)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&ce.current&&(ie.current=setTimeout(()=>{let e=Q1(ce.current,b);X1(ce.current,{transition:`none`,transform:Z1(b)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))}function Ae(e,t){if(t<0)return;let n=(window.innerWidth-t0)/window.innerWidth,r=n+t*(1-n),i=-t0+t*t0;X1(ce.current,{transform:Z1(b)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`,transition:`none`})}function je(e,t){let n=Z1(b)?window.innerHeight:window.innerWidth,r=t?(n-t0)/n:1,i=t?-t0:0;t&&X1(ce.current,{transition:`transform ${e0.DURATION}s cubic-bezier(${e0.EASE.join(`,`)})`,transform:Z1(b)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`})}return B.useEffect(()=>{g||window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`})},[g]),B.createElement(FC,{defaultOpen:x,onOpenChange:e=>{!u&&!e||(e?M(!0):Te(!0),A(e))},open:k},B.createElement(Zgt.Provider,{value:{activeSnapPoint:fe,snapPoints:a,setActiveSnapPoint:me,drawerRef:ce,overlayRef:L,onOpenChange:t,onPress:Se,onRelease:Oe,onDrag:we,dismissible:u,shouldAnimate:oe,handleOnly:d,isOpen:k,isDragging:N,shouldFade:ve,closeDrawer:Te,onNestedDrag:Ae,onNestedOpenChange:ke,onNestedRelease:je,keyboardIsOpen:ae,modal:g,snapPointsOffset:ge,activeSnapPointIndex:pe,direction:b,shouldScaleBackground:o,setBackgroundColorOnScale:s,noBodyStyles:y,container:D,autoFocus:O}},n))}var M_t=B.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:r,onRelease:i,shouldFade:a,isOpen:o,modal:s,shouldAnimate:c}=W1(),l=__t(t,n),u=r&&r.length>0;if(!s)return null;let d=B.useCallback(e=>i(e),[i]);return B.createElement(LC,{onMouseUp:d,ref:l,"data-vaul-overlay":``,"data-vaul-snap-points":o&&u?`true`:`false`,"data-vaul-snap-points-overlay":o&&a?`true`:`false`,"data-vaul-animate":c?.current?`true`:`false`,...e})});M_t.displayName=`Drawer.Overlay`;var N_t=B.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},i){let{drawerRef:a,onPress:o,onRelease:s,onDrag:c,keyboardIsOpen:l,snapPointsOffset:u,activeSnapPointIndex:d,modal:f,isOpen:p,direction:m,snapPoints:h,container:g,handleOnly:_,shouldAnimate:v,autoFocus:y}=W1(),[b,x]=B.useState(!1),S=__t(i,a),C=B.useRef(null),w=B.useRef(null),T=B.useRef(!1),E=h&&h.length>0;k_t();let D=(e,t,n=0)=>
781{if(T.current)return!0;let r=Math.abs(e.y),i=Math.abs(e.x),a=i>r,o=[`bottom`,`right`].includes(t)?1:-1;if(t===`left`||t===`right`){if(!(e.x*o<0)&&i>=0&&i<=n)return a}else if(!(e.y*o<0)&&r>=0&&r<=n)return!a;return T.current=!0,!0};B.useEffect(()=>{E&&window.requestAnimationFrame(()=>{x(!0)})},[]);function O(e){C.current=null,T.current=!1,s(e)}return B.createElement(RC,{"data-vaul-drawer-direction":m,"data-vaul-drawer":``,"data-vaul-delayed-snap-points":b?`true`:`false`,"data-vaul-snap-points":p&&E?`true`:`false`,"data-vaul-custom-container":g?`true`:`false`,"data-vaul-animate":v?.current?`true`:`false`,...r,ref:S,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:e=>{_||(r.onPointerDown==null||r.onPointerDown.call(r,e),C.current={x:e.pageX,y:e.pageY},o(e))},onOpenAutoFocus:e=>{n?.(e),y||e.preventDefault()},onPointerDownOutside:t=>{if(e?.(t),!f||t.defaultPrevented){t.preventDefault();return}l.current&&=!1},onFocusOutside:e=>{if(!f){e.preventDefault();return}},onPointerMove:e=>{if(w.current=e,_||(r.onPointerMove==null||r.onPointerMove.call(r,e),!C.current))return;let t=e.pageY-C.current.y,n=e.pageX-C.current.x,i=e.pointerType===`touch`?10:2;D({x:n,y:t},m,i)?c(e):(Math.abs(n)>i||Math.abs(t)>i)&&(C.current=null)},onPointerUp:e=>{r.onPointerUp==null||r.onPointerUp.call(r,e),C.current=null,T.current=!1,s(e)},onPointerOut:e=>{r.onPointerOut==null||r.onPointerOut.call(r,e),O(w.current)},onContextMenu:e=>{r.onContextMenu==null||r.onContextMenu.call(r,e),w.current&&O(w.current)}})});N_t.displayName=`Drawer.Content`;var P_t=250,F_t=120,I_t=B.forwardRef(function({preventCycle:e=!1,children:t,...n},r){let{closeDrawer:i,isDragging:a,snapPoints:o,activeSnapPoint:s,setActiveSnapPoint:c,dismissible:l,handleOnly:u,isOpen:d,onPress:f,onDrag:p}=W1(),m=B.useRef(null),h=B.useRef(!1);function g(){if(h.current){y();return}window.setTimeout(()=>{_()},F_t)}function _(){if(a||e||h.current){y();return}if(y(),!o||o.length===0){l||i();return}if(s===o[o.length-1]&&l){i();return}let t=o.findIndex(e=>e===s);if(t===-1)return;let n=o[t+1];c(n)}function v(){m.current=window.setTimeout(()=>{h.current=!0},P_t)}function y(){m.current&&window.clearTimeout(m.current),h.current=!1}return B.createElement(`div`,{onClick:g,onPointerCancel:y,onPointerDown:e=>{u&&f(e),v()},onPointerMove:e=>{u&&p(e)},ref:r,"data-vaul-drawer-visible":d?`true`:`false`,"data-vaul-handle":``,"aria-hidden":`true`,...n},B.createElement(`span`,{"data-vaul-handle-hitarea":``,"aria-hidden":`true`},t))});I_t.displayName=`Drawer.Handle`;function L_t({onDrag:e,onOpenChange:t,open:n,...r}){let{onNestedDrag:i,onNestedOpenChange:a,onNestedRelease:o}=W1();if(!i)throw Error(`Drawer.NestedRoot must be placed in another drawer`);return B.createElement(j_t,{nested:!0,open:n,onClose:()=>{a(!1)},onDrag:(t,n)=>{i(t,n),e?.(t,n)},onOpenChange:e=>{e&&a(e),t?.(e)},onRelease:o,...r})}function R_t(e){let t=W1(),{container:n=t.container,...r}=e;return B.createElement(IC,{container:n,...r})}var a0={Root:j_t,NestedRoot:L_t,Content:N_t,Overlay:M_t,Trigger:aCe,Portal:R_t,Handle:I_t,Close:VC,Title:zC,Description:BC};function z_t({...e}){return(0,K.jsx)(a0.Root,{"data-slot":`drawer`,...e})}function B_t({...e}){return(0,K.jsx)(a0.Portal,{"data-slot":`drawer-portal`,...e})}function V_t({className:e,...t}){return(0,K.jsx)(a0.Overlay,{"data-slot":`drawer-overlay`,className:q(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function H_t({className:e,children:t,...n}){return(0,K.jsxs)(B_t,{"data-slot":`drawer-portal`,children:[(0,K.jsx)(V_t,{}),(0,K.jsxs)(a0.Content,{"data-slot":`drawer-content`,className:q(`group/drawer-content fixed z-50 flex h-auto flex-col bg-background`,`data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b`,`data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t`,`data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm`,`data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm`,e),...n,children:[(0,K.jsx)(`div`,{className:`mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block`}),t]})]})}function U_t({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`drawer-header`,className:q(`flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left`,e),...t})}function W_t({className:e,...t}){return(0,K.jsx)(a0.Title,{"data-slot":`drawer-title`,className:q(`font-semibold text-foreground`,e),...t})}function G_t({className:e}
781){return(0,K.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`18`,height:`18`,fill:`currentColor`,className:e,"aria-hidden":`true`,children:[(0,K.jsx)(`path`,{d:`M6 15a2 2 0 1 1 0-4h2v2a2 2 0 0 1-2 2Zm3-2a2 2 0 0 1 2-2 2 2 0 0 1 2 2v5a2 2 0 1 1-4 0v-5Z`}),(0,K.jsx)(`path`,{d:`M11 6a2 2 0 1 1 4 0v2h-2a2 2 0 0 1-2-2Zm2 3a2 2 0 0 1 2-2h5a2 2 0 1 1 0 4h-5a2 2 0 0 1-2-2Z`}),(0,K.jsx)(`path`,{d:`M18 9a2 2 0 1 1 0 4h-2v-2a2 2 0 0 1 2-2Zm-3 2a2 2 0 0 1-2 2 2 2 0 0 1-2-2V6a2 2 0 1 1 4 0v5Z`}),(0,K.jsx)(`path`,{d:`M13 18a2 2 0 1 1-4 0v-2h2a2 2 0 0 1 2 2Zm-2-3a2 2 0 0 1-2 2H4a2 2 0 1 1 0-4h5a2 2 0 0 1 2 2Z`})]})}function K_t(){let e=tR();return{providerFilter:e.providerFilter,setProviderFilter:e.setProviderFilter,messages:e.messages,selectedId:e.selectedId,setSelectedId:e.setSelectedId,replyOpen:e.replyOpen,setReplyOpen:e.setReplyOpen,isLoading:e.isLoading,isBackgroundRefreshing:e.isBackgroundRefreshing,unreadCounts:e.unreadCounts,dismissedMessages:e.dismissedMessages,showHidden:e.showHidden,setShowHidden:e.setShowHidden,undoTarget:e.undoTarget,isArchiving:e.isArchiving,selectedMessage:e.selectedMessage(),getUnreadForFilter:e.getUnreadForFilter,handleArchive:e.handleArchive,handleDelete:e.handleDelete,handleUndo:e.handleUndo,handleRestore:e.handleRestore,loadMessages:e.loadMessages}}function q_t({messages:e,selectedId:t,onSelect:n,isLoading:r,dismissedMessages:i=[],showHidden:a=!1,onRestore:o}){return r?(0,K.jsx)(`div`,{className:`flex flex-col gap-2 p-3`,children:Array.from({length:6}).map((e,t)=>(0,K.jsxs)(QN.div,{className:`flex flex-col gap-1.5 pl-2`,initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:t*.06,duration:.3},children:[(0,K.jsx)(LI,{className:`h-3 w-24`}),(0,K.jsx)(LI,{className:`h-3 w-40`}),(0,K.jsx)(LI,{className:`h-3 w-32`})]},t))}):e.length===0?(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-muted-foreground`,children:[(0,K.jsx)(l_,{className:`h-8 w-8 opacity-30`}),(0,K.jsx)(`span`,{className:`text-xs`,children:`No messages`})]}):(0,K.jsx)(IL,{className:`h-full`,children:(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[e.map(e=>{let r=e.id===t,i=UI[e.provider],a=e.from_name||e.from_email.split(`@`)[0]||e.from_email;return(0,K.jsxs)(`button`,{onClick:()=>n(e.id),className:`relative w-full cursor-pointer border-b px-3 py-2.5 text-left transition-colors hover:bg-accent/60 ${r?`bg-accent`:``}`,children:[(0,K.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-0.5 rounded-sm`,style:{backgroundColor:i}}),(0,K.jsxs)(`div`,{className:`mb-0.5 flex items-baseline justify-between gap-1`,children:[(0,K.jsx)(`span`,{className:`truncate text-xs font-medium`,children:a}),(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:WI(e.received_at)})]}),(0,K.jsx)(`div`,{className:`truncate text-[11px] font-medium text-foreground/80`,children:e.subject||`(no subject)`}),e.body_preview&&(0,K.jsx)(`div`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:HI(e.body_preview)?pXe(e.body_preview):e.body_preview})]},e.id)}),a&&i.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5`,children:[(0,K.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`Hidden`}),(0,K.jsx)(`div`,{className:`h-px flex-1 bg-border`})]}),i.map(e=>{let t=UI[e.provider],n=e.from_name||e.from_email.split(`@`)[0]||e.from_email;return(0,K.jsxs)(`div`,{className:`relative flex w-full items-center border-b px-3 py-2.5 opacity-50`,children:[(0,K.jsx)(`span`,{className:`absolute inset-y-0 left-0 w-0.5 rounded-sm`,style:{backgroundColor:t}}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`mb-0.5 flex items-baseline justify-between gap-1`,children:[(0,K.jsx)(`span`,{className:`truncate text-xs font-medium`,children:n}),(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:WI(e.received_at)})]}),(0,K.jsx)(`div`,{className:`truncate text-[11px] font-medium text-foreground/80`,children:e.subject||`(no subject)`})]}),o&&(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`ml-1 h-5 w-5 shrink-0`,onClick:()=>o(e.id),title:`Restore`,children:(0,K.jsx)(mse,{className:`h-3 w-3`})})]},e.id)})]})]})})}function J_t({html:e}){let t=(0,B.useRef)(null);return(0,B.useEffect)(()=>{let n=t.current;if(!n)return;let r=n.contentDocument;if(!r)return;r.open(),r.write(` 782 <!DOCTYPE html> 783 <html> 784 <head> 785 <style> 786 html, body { 787 margin: 0; 788 padding: 0; 789 font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; 790 font-size: 14px; 791 line-height: 1.6; 792 word-break: break-word; 793 overflow-wrap: break-word; 794 background: transparent; 795 } 796 img { max-width: 100%; height: auto; } 797 a { color: inherit; } 798 table { max-width: 100% !important; } 799 </style> 800 </head> 801 <body>${e}</body> 802 </html> 803 `),r.close();let i=n;function a(){if(!i.contentDocument)return;let e=i.contentDocument.documentElement.scrollHeight;i.style.height=`${e}px`}let o=r.querySelectorAll(`img`);
803o.forEach(e=>e.addEventListener(`load`,a));let s=setTimeout(a,50);return()=>{clearTimeout(s),o.forEach(e=>e.removeEventListener(`load`,a))}},[e]),(0,K.jsx)(`iframe`,{ref:t,sandbox:`allow-same-origin`,className:`w-full border-0`,title:`Email content`,style:{minHeight:100}})}function Y_t({message:e,replyOpen:t,onReplyToggle:n,onArchive:r,onDelete:i,isArchiving:a}){let o=Sv(),s=tR(e=>e.fetchMessageDetail),[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(!1),f=e?`${e.id}|${e.provider}`:null,[p,m]=(0,B.useState)(f);if(p!==f&&(m(f),l(null),d(f!==null)),(0,B.useEffect)(()=>{if(!e)return;let t=!1;return s(e.id,e.provider).then(e=>{t||l(e)}).catch(()=>{t||l(null)}).finally(()=>{t||d(!1)}),()=>{t=!0}},[e,s]),!e)return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-muted-foreground`,children:[(0,K.jsx)(__,{className:`h-8 w-8 opacity-20`}),(0,K.jsx)(`span`,{className:`text-xs`,children:`Select a message`})]});let h=UI[e.provider],g=c?.body_full??e.body_preview,_=g?HI(g):!1;return(0,K.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`shrink-0 border-b px-4 py-3`,children:[(0,K.jsx)(`h3`,{className:`mb-2 text-sm font-semibold leading-snug`,children:e.subject||`(no subject)`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-xs font-semibold text-white`,style:{backgroundColor:h},children:GI(e.from_name,e.from_email)}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-xs font-medium`,children:e.from_name??e.from_email}),e.from_name&&(0,K.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.from_email})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[e.provider!==`slack`&&(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`h-6 w-6`,title:`Open in Mail`,onClick:()=>KI(o,e),children:(0,K.jsx)(__,{className:`h-3 w-3`})}),i&&(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,className:`h-6 gap-1 text-[11px] text-destructive hover:bg-destructive/10`,onClick:i,disabled:a,children:[(0,K.jsx)(V_,{className:`h-3 w-3`}),`Delete`]}),r&&(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,className:`h-6 gap-1 text-[11px]`,onClick:r,disabled:a,children:[(0,K.jsx)(Cg,{className:`h-3 w-3`}),`Archive`]}),(0,K.jsxs)(J,{variant:t?`secondary`:`outline`,size:`sm`,className:`h-6 gap-1 text-[11px]`,onClick:n,children:[(0,K.jsx)(D_,{className:`h-3 w-3`}),`Reply`]})]})]})]}),u&&!e.body_preview?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,K.jsx)(LI,{className:`h-3 w-full`}),(0,K.jsx)(LI,{className:`h-3 w-5/6`}),(0,K.jsx)(LI,{className:`h-3 w-4/6`})]}):(0,K.jsx)(IL,{className:`min-h-0 flex-1 px-4 py-3`,children:g?_?(0,K.jsx)(J_t,{html:g}):(0,K.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/80`,children:g}):(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`(no content)`})})]})}function X_t({message:e,onClose:t}){let{t:n}=V(),[r,i]=(0,B.useState)(e.subject?`Re: ${e.subject}`:``),[a,o]=(0,B.useState)(e.from_email),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(``),[d,f]=(0,B.useState)(!1),p=Iye(),[m,h]=(0,B.useState)(()=>Rye(``,p)),[g,_]=(0,B.useState)(!1),[v,y]=(0,B.useState)(!1),[b,x]=(0,B.useState)(!1),S=(0,B.useRef)(null),C=e.provider!==`slack`;async function w(){if(g){S.current?.abort(),_(!1);return}_(!0),h(``);let t=new AbortController;S.current=t,await Hhe({content:[e.provider===`slack`?`Generate a concise, professional Slack message reply.`:`Generate a concise, professional email reply.`,`From: ${e.from_name??e.from_email}`,e.subject?`Subject: ${e.subject}`:``,e.body_preview?`Message: ${e.body_preview}`:``,``,`Output only the reply body text, no subject line or greeting headers.`].filter(Boolean).join(` 804`),model_tier:`fast`,chat_mode:`chat`},{onStart:()=>{},onDelta:e=>h(t=>t+e),onDone:()=>{h(e=>zye(e,p)),_(!1)},onError:e=>{t.signal.aborted||(X(e,{operation:`inbox_auto_generate`}),G.error(`Could not generate reply. Please try again.`)),_(!1)}},t.signal)}async function T(){if(!m.trim()){G.error(`Reply body is empty`);return}if(C&&!a.trim()){G.error(`Recipient is empty`);return}y(!0);try{await _he({message_id:e.id,thread_id:e.thread_id,to:C?a.trim():e.from_email,...s.trim()?{cc:s.trim()}:{},...l.trim()?{bcc:l.trim()}:{},subject:r,body:m},e.provider),G.success(e.provider===`slack`?`Reply sent via Slack`:`Reply sent`),t()}catch(e){Y(e,`Failed to send reply`,{operation:`inbox_send_reply`})}finally{y(!1),x(!1)}}
804async function E(){if(!m.trim()){G.error(`Reply body is empty`);return}if(e.provider!==`slack`){if(!a.trim()){G.error(`Recipient is empty`);return}y(!0);try{await xhe({message_id:e.id,thread_id:e.thread_id,to:a.trim(),...s.trim()?{cc:s.trim()}:{},...l.trim()?{bcc:l.trim()}:{},subject:r,body:m},e.provider),G.success(`Draft saved`),t()}catch(e){Y(e,`Failed to save draft`,{operation:`inbox_save_draft`})}finally{y(!1)}}}return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b px-4 py-3`,children:[(0,K.jsxs)(`span`,{className:`truncate text-xs font-medium text-muted-foreground`,children:[`Reply to`,` `,(0,K.jsx)(`span`,{className:`text-foreground`,children:e.from_name??e.from_email})]}),(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`ml-2 h-6 w-6 shrink-0`,onClick:t,children:(0,K.jsx)(J_,{className:`h-3 w-3`})})]}),C&&(0,K.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b px-4 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`label`,{className:`w-10 shrink-0 text-[10px] uppercase tracking-wider text-muted-foreground`,children:`To`}),(0,K.jsx)(bU,{inputClassName:`h-7 text-xs`,placeholder:`[email protected]`,value:a,onChange:o,provider:e.provider}),!d&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>f(!0),className:`shrink-0 text-[11px] text-muted-foreground hover:text-foreground`,children:`Cc/Bcc`})]}),d&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`label`,{className:`w-10 shrink-0 text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Cc`}),(0,K.jsx)(bU,{inputClassName:`h-7 text-xs`,value:s,onChange:c,provider:e.provider})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`label`,{className:`w-10 shrink-0 text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Bcc`}),(0,K.jsx)(bU,{inputClassName:`h-7 text-xs`,value:l,onChange:u,provider:e.provider})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`label`,{className:`w-10 shrink-0 text-[10px] uppercase tracking-wider text-muted-foreground`,children:`Subj`}),(0,K.jsx)(dP,{className:`h-7 text-xs`,placeholder:`Subject`,value:r,onChange:e=>i(e.target.value)})]})]}),(0,K.jsx)(`textarea`,{className:`min-h-0 flex-1 resize-none bg-background px-4 py-3 text-xs placeholder:text-muted-foreground focus:outline-none`,placeholder:`Write your replyâ¦`,value:m,onChange:e=>h(e.target.value)}),(0,K.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t px-4 py-3`,children:[(0,K.jsxs)(J,{variant:`outline`,size:`sm`,className:`h-7 gap-1.5 text-xs`,onClick:w,disabled:v,children:[(0,K.jsx)(L_,{className:`h-3 w-3`}),g?`Stop`:`Auto-generate`]}),g&&!m&&(0,K.jsx)(RI,{size:`sm`,label:n(`ai.activity.drafting_reply`)}),(0,K.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[C&&(0,K.jsxs)(J,{variant:`outline`,size:`sm`,className:`h-7 gap-1.5 text-xs`,onClick:E,disabled:v||g,children:[(0,K.jsx)(i_,{className:`h-3 w-3`}),`Save draft`]}),(0,K.jsxs)(J,{size:`sm`,className:`h-7 gap-1.5 text-xs`,onClick:()=>x(!0),disabled:v||g||!m.trim()||C&&!a.trim(),children:[(0,K.jsx)(j_,{className:`h-3 w-3`}),`Send`]})]})]})]}),(0,K.jsx)(HC,{open:b,onOpenChange:x,children:(0,K.jsxs)(WC,{className:`max-w-sm`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:`Send reply?`}),(0,K.jsx)(JC,{asChild:!0,children:(0,K.jsx)(`div`,{className:`space-y-1 text-sm text-muted-foreground`,children:C?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-xs uppercase tracking-wider`,children:`To: `}),(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:a.trim()||e.from_email})]}),s.trim()&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-xs uppercase tracking-wider`,children:`Cc: `}),(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:s.trim()})]}),l.trim()&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-xs uppercase tracking-wider`,children:`Bcc: `}),(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:l.trim()})]})]}):(0,K.jsxs)(`div`,{children:[`This will send your reply to`,` `,(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.from_name??e.from_email}),`.`]})})})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>x(!1),children:`Cancel`}),(0,K.jsx)(J,{size:`sm`,onClick:T,disabled:v,children:v?`Sendingâ¦`:`Send`})]})]})})]})}function Z_t({state:e}){let{messages:t,selectedId:n,setSelectedId:r,replyOpen:i,setReplyOpe
804n:a,isLoading:o,dismissedMessages:s,showHidden:c,handleRestore:l,selectedMessage:u,handleArchive:d,handleDelete:f,isArchiving:p}=e;return(0,K.jsxs)(`div`,{className:`flex h-[500px] overflow-hidden rounded-lg border bg-card shadow-sm`,children:[(0,K.jsx)(`div`,{className:`shrink-0 border-r transition-all duration-200 ${i?`w-[26%]`:`w-2/5`}`,children:(0,K.jsx)(q_t,{messages:t,selectedId:n,onSelect:e=>{r(e),a(!1)},isLoading:o,dismissedMessages:s,showHidden:c,onRestore:l})}),(0,K.jsx)(tL,{orientation:`vertical`,className:`h-auto`}),(0,K.jsx)(`div`,{className:`shrink-0 border-r transition-all duration-200 ${i?`w-[37%]`:`w-3/5`}`,children:(0,K.jsx)(Y_t,{message:u,replyOpen:i,onReplyToggle:()=>a(!i),onArchive:u?()=>d(u):void 0,onDelete:u?()=>f(u):void 0,isArchiving:p})}),i&&u&&(0,K.jsx)(`div`,{className:`w-[37%]`,children:(0,K.jsx)(X_t,{message:u,onClose:()=>a(!1)})})]})}var Q_t=`#4A154B`,$_t=300*1e3;function evt(e){let t=e??`?`,n=0;for(let e=0;e<t.length;e++)n=n*31+t.charCodeAt(e)|0;return`hsl(${Math.abs(n)%360}, 55%, 45%)`}function tvt(e){return e?e.split(/\s+/).slice(0,2).map(e=>e[0]).join(``).toUpperCase():`?`}function nvt(e){return hb(e)?`Today`:Qfe(e)?`Yesterday`:fb(e,`MMM d`)}function rvt(e){try{return pb(e,{addSuffix:!0})}catch{return``}}function ivt({message:e}){let t=vL(e=>e.account?.slack_team_id??null),[n,r]=(0,B.useState)(null),[i,a]=(0,B.useState)(null),o=(0,B.useRef)(null),s=(0,B.useRef)(null),c=e.slack_channel_id,l=(0,B.useMemo)(()=>{let t=e.id.split(`:`);return t.length===2?t[1]:null},[e.id]),u=`${c??``}|${l??``}|${e.thread_id??``}`,[d,f]=(0,B.useState)(u);d!==u&&(f(u),!c||!l?(a(`missing channel context`),r([])):(r(null),a(null))),(0,B.useEffect)(()=>{if(!c||!l)return;s.current?.abort();let t=new AbortController;return s.current=t,ghe(c,l,e.thread_id,15).then(e=>{t.signal.aborted||r(e.messages)}).catch(()=>{t.signal.aborted||(a(`Thread unavailable`),r([]))}),()=>t.abort()},[c,l,e.thread_id]),(0,B.useEffect)(()=>{if(!n?.length)return;let e=setTimeout(()=>{o.current?.scrollIntoView({block:`center`,behavior:`auto`})},0);return()=>clearTimeout(e)},[n]);let p=c?mXe(t,c,e.thread_id):null;return n===null?(0,K.jsx)(`div`,{className:`flex flex-1 flex-col gap-3 p-4`,children:Array.from({length:4}).map((e,t)=>(0,K.jsxs)(QN.div,{className:`flex items-start gap-2`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{delay:t*.06,duration:.25},children:[(0,K.jsx)(LI,{className:`h-6 w-6 shrink-0 rounded-full`}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(LI,{className:`h-2.5 w-20`}),(0,K.jsx)(LI,{className:`h-3 w-48`})]})]},t))}):i||n.length===0?(0,K.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Thread unavailable â open in Slack`}),p&&(0,K.jsx)(J,{variant:`outline`,size:`sm`,className:`h-7 gap-1.5 text-xs`,asChild:!0,children:(0,K.jsxs)(`a`,{href:p,target:`_blank`,rel:`noreferrer`,children:[(0,K.jsx)($g,{className:`h-3.5 w-3.5`}),`Open in Slack`]})})]}):(0,K.jsx)(IL,{className:`min-h-0 flex-1 px-4 py-3`,children:(0,K.jsx)(`div`,{className:`flex flex-col gap-1`,children:n.map((t,r)=>{let i=r>0?n[r-1]:null,a=new Date(t.received_at),s=i?new Date(i.received_at):null,c=t.message_id===e.id,l=!s||s.toDateString()!==a.toDateString(),u=i!==null&&i.from_name===t.from_name&&s!==null&&a.getTime()-s.getTime()<$_t&&!l;return(0,K.jsxs)(`div`,{children:[l&&(0,K.jsxs)(`div`,{className:`my-2 flex items-center gap-2`,children:[(0,K.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,K.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:nvt(a)}),(0,K.jsx)(`div`,{className:`h-px flex-1 bg-border`})]}),(0,K.jsxs)(QN.div,{ref:c?o:void 0,className:`flex gap-2 rounded-md py-1 pl-2 pr-1 ${c?`border-l-2`:``}`,style:c?{borderLeftColor:`${Q_t}99`,backgroundColor:`${Q_t}0d`}:void 0,initial:c?{opacity:.4}:!1,animate:c?{opacity:1}:void 0,transition:c?{duration:.6}:void 0,children:[(0,K.jsx)(`div`,{className:`w-6 shrink-0`,children:!u&&(0,K.jsx)(`span`,{className:`flex h-6 w-6 items-center justify-center rounded-full text-[10px] font-semibold text-white`,style:{backgroundColor:evt(t.from_name)},children:tvt(t.from_name)})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[!u&&(0,K.jsxs)(`div`,{className:`mb-0.5 flex items-baseline gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-xs font-medium`,children:t.from_name??`Unknown`}),(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:rvt(a)})]}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap break-words text-xs leading-relaxed text-foreground
804/80`,children:t.body_full||t.body_preview||``})]})]})]},t.message_id)})})})}function avt({message:e,onArchive:t,onDelete:n,onReply:r,onPrev:i,onNext:a,currentIndex:o,totalCount:s,isArchiving:c}){let l=Sv(),u=tR(e=>e.fetchMessageDetail),d=vL(e=>e.account?.slack_team_id??null),f=vL(e=>e.account?.slack_team_name??null),[p,m]=(0,B.useState)(null),[h,g]=(0,B.useState)(!1),_=(0,B.useRef)(null),v=e.provider===`slack`,y=$N(0),b=tP(y,[-200,0,200],[-8,0,8]),x=tP(y,[-200,-100,0,100,200],[.5,.8,1,.8,.5]),S=tP(y,[0,40,120],[0,.3,1]),C=tP(y,[-120,-40,0],[1,.3,0]),w=`${v}|${e.id}|${e.provider}`,[T,E]=(0,B.useState)(w);T!==w&&(E(w),m(null),g(!v)),(0,B.useEffect)(()=>{if(v)return;_.current?.abort();let t=new AbortController;return _.current=t,u(e.id,e.provider).then(e=>{t.signal.aborted||m(e?.body_full??null)}).catch(()=>{}).finally(()=>{t.signal.aborted||g(!1)}),()=>t.abort()},[v,e.id,e.provider,u]);let D=UI[e.provider],O=p??e.body_preview,k=O?HI(O):!1,A=e.slack_channel_name??e.from_name,j=v?GI(A,A??`?`):GI(e.from_name,e.from_email),M=v&&e.slack_channel_id?mXe(d,e.slack_channel_id,e.thread_id):null;function N(e,r){r.offset.x>120?n():r.offset.x<-120&&t()}return(0,K.jsxs)(`div`,{className:`relative h-full w-full`,children:[(0,K.jsx)(QN.div,{className:`pointer-events-none absolute inset-0 rounded-lg bg-emerald-600`,style:{opacity:C}}),(0,K.jsx)(QN.div,{className:`pointer-events-none absolute inset-0 rounded-lg bg-destructive`,style:{opacity:S}}),(0,K.jsxs)(QN.div,{className:`relative flex h-full flex-col overflow-hidden rounded-lg border bg-card shadow-sm`,style:{x:y,rotate:b,opacity:x},drag:`x`,dragConstraints:{left:0,right:0},dragElastic:.3,onDragEnd:N,whileDrag:{cursor:`grabbing`},children:[(0,K.jsx)(`div`,{className:`shrink-0 px-4 py-3`,children:v?(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-xs font-semibold text-white`,style:{backgroundColor:D},children:j}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 truncate text-sm font-semibold`,children:[e.thread_id?`Thread in`:`DM with`,` `,(0,K.jsx)(`span`,{className:`font-semibold`,children:A??`Unknown`})]}),f&&(0,K.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium text-white`,style:{backgroundColor:D},children:f})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`h3`,{className:`mb-2 text-sm font-semibold leading-snug`,children:e.subject||`(no subject)`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-xs font-semibold text-white`,style:{backgroundColor:D},children:j}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`truncate text-xs font-medium`,children:e.from_name??e.from_email}),e.from_name&&(0,K.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.from_email})]}),(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground`,children:WI(e.received_at)})]})]})}),v?(0,K.jsx)(ivt,{message:e}):h&&!e.body_preview?(0,K.jsxs)(`div`,{className:`flex flex-1 flex-col gap-2 p-4`,children:[(0,K.jsx)(LI,{className:`h-3 w-full`}),(0,K.jsx)(LI,{className:`h-3 w-5/6`}),(0,K.jsx)(LI,{className:`h-3 w-4/6`}),(0,K.jsx)(LI,{className:`h-3 w-3/6`})]}):(0,K.jsx)(IL,{className:`min-h-0 flex-1 px-4 py-3`,children:O?k?(0,K.jsx)(J_t,{html:O}):(0,K.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/80`,children:O}):(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`(no content)`})}),(0,K.jsx)(`div`,{className:`shrink-0 px-4 pb-2 pt-0.5`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:i??void 0,disabled:!i,children:(0,K.jsx)(zg,{className:`h-3.5 w-3.5`})}),(0,K.jsxs)(`span`,{className:`text-[11px] tabular-nums text-muted-foreground`,children:[o+1,`/`,s]}),(0,K.jsx)(J,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:a??void 0,disabled:!a,children:(0,K.jsx)(Bg,{className:`h-3.5 w-3.5`})}),(0,K.jsx)(`div`,{className:`mx-1 h-4 w-px bg-border`}
804),(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 text-xs`,onClick:t,disabled:c,children:[(0,K.jsx)(Cg,{className:`h-3.5 w-3.5`}),`Archive`]}),(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 text-xs text-destructive hover:bg-destructive/10`,onClick:n,disabled:c,children:[(0,K.jsx)(V_,{className:`h-3.5 w-3.5`}),`Delete`]}),v?M&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 text-xs`,asChild:!0,children:(0,K.jsxs)(`a`,{href:M,target:`_blank`,rel:`noreferrer`,children:[(0,K.jsx)($g,{className:`h-3.5 w-3.5`}),`Open in Slack`]})}):(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 text-xs`,onClick:()=>KI(l,e),children:[(0,K.jsx)(__,{className:`h-3.5 w-3.5`}),`Open`]}),(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,className:`ml-auto h-7 gap-1.5 text-xs`,onClick:r,children:[(0,K.jsx)(D_,{className:`h-3.5 w-3.5`}),`Reply`]})]})})]}),(0,K.jsxs)(QN.div,{className:`pointer-events-none absolute inset-y-0 left-0 z-10 flex items-center pl-8 text-white`,style:{opacity:C},children:[(0,K.jsx)(Cg,{className:`h-6 w-6`}),(0,K.jsx)(`span`,{className:`ml-2 font-semibold text-2xl`,children:`Archive`})]}),(0,K.jsxs)(QN.div,{className:`pointer-events-none absolute inset-y-0 right-0 z-10 flex items-center pr-8 text-white`,style:{opacity:S},children:[(0,K.jsx)(`span`,{className:`mr-2 font-semibold text-2xl`,children:`Delete`}),(0,K.jsx)(V_,{className:`h-6 w-6`})]})]})}var ovt={type:`spring`,stiffness:200,damping:25},svt={enter:e=>e===-1?{x:-300,opacity:0,rotate:-5}:{scale:.95,opacity:0,x:0},active:{x:0,opacity:1,scale:1,rotate:0},exit:e=>e===2?{x:400,opacity:0,rotate:12}:e===-2?{x:-400,opacity:0,rotate:-12}:e===-1?{scale:.95,opacity:0,x:0}:{x:-300,opacity:0,rotate:-5}};function cvt({state:e,onReply:t}){let{messages:n,handleArchive:r,handleDelete:i,isArchiving:a,isLoading:o,providerFilter:s,getUnreadForFilter:c}=e,l=tR(e=>e.fetchMessageDetail),u=tR(e=>e.isRefilling),d=tR(e=>e.refillIfLow),f=c(s),[p,m]=(0,B.useState)(0),[h,g]=(0,B.useState)(1),[_,v]=(0,B.useState)(n.length);_!==n.length&&(v(n.length),n.length===0?p!==0&&m(0):p>=n.length&&m(n.length-1)),(0,B.useEffect)(()=>{let e=n[p+1];e&&l(e.id,e.provider)},[p,n,l]),(0,B.useEffect)(()=>{n.length===0&&f>0&&!u&&!o&&d()},[n.length,f,u,o,d]);function y(){p<n.length-1&&(g(1),m(e=>e+1))}function b(){p>0&&(g(-1),m(e=>e-1))}let x=(0,K.jsx)(`div`,{className:`flex h-[420px] items-center justify-center p-2`,children:(0,K.jsxs)(QN.div,{className:`flex h-full w-full max-w-2xl flex-col overflow-hidden rounded-lg border bg-card shadow-sm`,initial:{opacity:0,scale:.97},animate:{opacity:1,scale:1},transition:{duration:.3},children:[(0,K.jsxs)(`div`,{className:`border-b px-4 py-3`,children:[(0,K.jsx)(LI,{className:`mb-2 h-5 w-3/4`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(LI,{className:`h-8 w-8 rounded-full`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(LI,{className:`h-3 w-32`}),(0,K.jsx)(LI,{className:`mt-1 h-2.5 w-40`})]})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 p-4`,children:[(0,K.jsx)(LI,{className:`h-3 w-full`}),(0,K.jsx)(LI,{className:`mt-2 h-3 w-5/6`}),(0,K.jsx)(LI,{className:`mt-2 h-3 w-4/6`})]})]})});if(o)return x;if(n.length===0)return f>0?x:(0,K.jsxs)(`div`,{className:`flex h-[420px] flex-col items-center justify-center gap-3 text-muted-foreground`,children:[(0,K.jsx)(l_,{className:`h-10 w-10 opacity-20`}),(0,K.jsx)(`span`,{className:`text-sm`,children:`All caught up`})]});let S=n[p];return S?(0,K.jsxs)(`div`,{className:`relative flex h-[540px] flex-col items-center p-2`,children:[n.slice(p+1,p+3).map((e,t)=>t).map(e=>{let t=e+1;return(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-x-2 top-2 mx-auto h-[468px] max-w-2xl rounded-lg border bg-card shadow-xl`,style:{transform:`translateY(${t*20}px) scaleX(${1-t*.04})`,zIndex:10-t}},`peek-${e}`)}),(0,K.jsx)(lN,{mode:`popLayout`,custom:h,children:(0,K.jsx)(QN.div,{className:`relative z-20 h-[468px] w-full max-w-2xl`,custom:h,variants:svt,initial:`enter`,animate:`active`,exit:`exit`,transition:ovt,children:(0,K.jsx)(avt,{message:S,onArchive:()=>{g(-2),r(S)},onDelete:()=>{g(2),i(S)},onReply:()=>t(S),onPrev:p>0?b:null,onNext:p<n.length-1?y:null,currentIndex:p,totalCount:Math.max(f,n.length),isArchiving:a})},S.id)})]}):null}var lvt=[`all`,...tx],uvt={all:{Icon:l_,iconClass:`text-muted-foreground`},gmail:{Icon:__,iconClass:`text-[#ea4335]`},outlook:{Icon:__,iconClass:`text-[#0078d4]`},imap:{Icon:M_,iconClass:`text-slate-500`},slack:{Icon:G_t,iconClass:`text-[#611f69]`}};function dvt(){let e=K_t(),t=tR(e=>e.startPolling),n=tR(e=>e.stopPolling),r=tR(e=>e.loadMessages),i=tR(e=>
804e.isBackgroundRefreshing),a=Xx(e=>e.connected),o=$x(e=>e.connected),s=Qx(e=>e.connected),c=vL(e=>e.connected),[l,u]=(0,B.useState)(`card`),[d,f]=(0,B.useState)(null),p={all:!0,gmail:a,outlook:o,imap:s,slack:c};(0,B.useEffect)(()=>{(a||o||s||c)&&r()},[a,o,s,c,r]),(0,B.useEffect)(()=>(t(),()=>n()),[t,n]);let{providerFilter:m,setProviderFilter:h,messages:g,isLoading:_,dismissedMessages:v,showHidden:y,setShowHidden:b,undoTarget:x,handleUndo:S,getUnreadForFilter:C,setSelectedId:w}=e;function T(e){f(e)}return(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-y-2 px-1 pb-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-semibold`,children:`Inbox`}),i&&(0,K.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-primary/60`}),!_&&g.length>0&&(0,K.jsx)(lR,{variant:`secondary`,className:`text-xs`,children:g.length}),v.length>0&&(0,K.jsxs)(`button`,{onClick:()=>b(e=>!e),className:`rounded-full px-2 py-0.5 text-[10px] font-medium transition-colors ${y?`bg-muted-foreground/20 text-foreground`:`bg-muted text-muted-foreground hover:bg-muted-foreground/20`}`,children:[v.length,` hidden`]}),(0,K.jsxs)(wz,{type:`single`,size:`sm`,variant:`outline`,value:l,onValueChange:e=>{e&&u(e)},className:`ml-1`,children:[(0,K.jsx)(Tz,{value:`list`,className:`h-6 w-6 p-0`,children:(0,K.jsx)(Goe,{className:`h-3.5 w-3.5`})}),(0,K.jsx)(Tz,{value:`card`,className:`h-6 w-6 p-0`,children:(0,K.jsx)(Uoe,{className:`h-3.5 w-3.5`})})]})]}),x&&(0,K.jsxs)(`div`,{className:`left-1/2 z-10 flex w-64 -translate-x-1/2 flex-col overflow-hidden rounded-lg border bg-popover shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-xs text-foreground`,children:x.action===`delete`?`Deleted`:`Archived`}),(0,K.jsx)(J,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs font-medium text-primary`,onClick:S,children:`Undo`})]}),(0,K.jsx)(`div`,{className:`h-0.5 w-full bg-muted`,children:(0,K.jsx)(`div`,{className:`h-full bg-primary transition-none`,style:{width:`${x.progress}%`}})})]}),(0,K.jsx)(wz,{type:`single`,size:`sm`,variant:`outline`,value:m,onValueChange:e=>{e&&(h(e),w(null))},children:lvt.map(e=>{let{Icon:t,iconClass:n}=uvt[e],r=C(e),i=!p[e];return(0,K.jsxs)(Tz,{value:e,disabled:i,title:i?`Connect ${v0e[e]} in Settings`:void 0,className:q(`h-6 gap-1.5 px-2 text-xs`,i&&`opacity-40`),children:[(0,K.jsx)(t,{className:q(`h-3 w-3`,n)}),(0,K.jsx)(`span`,{children:v0e[e]}),r>0&&!i&&(0,K.jsx)(`span`,{className:`tabular-nums text-[10px] font-medium text-muted-foreground`,children:r>99?`99+`:r})]},e)})})]}),l===`list`?(0,K.jsx)(Z_t,{state:e}):(0,K.jsx)(cvt,{state:e,onReply:T}),(0,K.jsx)(z_t,{open:!!d,onOpenChange:e=>{e||f(null)},children:(0,K.jsxs)(H_t,{className:`max-h-[70vh]`,children:[(0,K.jsx)(U_t,{className:`pb-0`,children:(0,K.jsx)(W_t,{className:`text-sm`,children:`Reply`})}),d&&(0,K.jsx)(`div`,{className:`h-[50vh]`,children:(0,K.jsx)(X_t,{message:d,onClose:()=>f(null)})})]})})]})}function fvt(){return(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(`div`,{className:`dashboard-container`,children:(0,K.jsx)(`div`,{className:`@container/main gap-2`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 py-4 md:gap-6 md:py-6`,children:[(0,K.jsx)(`div`,{className:`px-4 lg:px-6`,children:(0,K.jsx)(qht,{})}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 lg:px-6 @5xl/main:flex-row`,children:[(0,K.jsx)(`div`,{className:`@5xl/main:w-[40%] @5xl/main:shrink-0`,children:(0,K.jsx)(dvt,{})}),(0,K.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,K.jsx)(XB,{})})]}),(0,K.jsx)(Ygt,{})]})})})})}function pvt(){return xv().pathname.startsWith(`/vault/redline`)?(0,K.jsx)(`div`,{className:`h-full w-full`,children:(0,K.jsx)(`div`,{className:`mx-auto h-full max-w-[2400px]`,children:(0,K.jsx)(Av,{})})}):(0,K.jsx)(`div`,{className:`h-full w-full overflow-y-auto`,children:(0,K.jsx)(`div`,{className:`mx-auto max-w-[2400px]`,children:(0,K.jsx)(Av,{})})})}function mvt(){let{t:e}=V(),t=Sv(),n=Q(e=>e.prompts),r=Q(e=>e.knowledgeBases),i=Q(e=>e.personas),a=Q(e=>e.fetchPrompts),o=Q(e=>e.fetchKnowledgeBases),s=Q(e=>e.fetchPersonas),c=JI(e=>e.playbooks),l=JI(e=>e.fetchPlaybooks),u=qI(e=>e.evaluations),d=qI(e=>e.fetchEvaluations),f=RL(e=>e.categories),p=RL(e=>e.fetchCategories),m=q$(e=>e.categories),h=q$(e=>e.fetchCategories);(0,B.useEffect)(()=>{n.length===0&&a(),o(),i.length===0&&s(),c.length===0&&l(),u.length===0&&d(),f.length===0&&p(),m.length===0&&h()},[]);let g=[{to:`/vault/playbooks`,title:e(`playbook.title`),description:e(`playbook.description`),icon:eoe,count:c.length,countLabel:e=>`${e}`},{to:`/vault/evaluations`,title:e(`evaluation.title`),description:e(`evaluation.create_dialog.description`),icon:qg,count:u.length,countLabel:e=>`${e}`},{to:`/vault/prompts`,title:e(`prompts.title`),description:e(`prompts.saved_prompts`),icon:Y_,count:n.length,countLabel:e=>`${e}`},{to:`/vault/library`,title:e(`knowledge_bases.title`),description:e(`vault.description`),icon:Ag,count:r.reduce((e,t)=>
804e+(t.document_count??0),0),countLabel:t=>e(`knowledge_bases.documents`,{count:t})},{to:`/vault/personas`,title:e(`personas.personas`),description:e(`personas.manage_personas`),icon:k_,count:i.length,countLabel:e=>`${e}`},{to:`/vault/email-categories`,title:`Email categories`,description:`Custom categories for auto-sorting inbound email`,icon:z_,count:f.length,countLabel:e=>`${e}`},{to:`/vault/document-categories`,title:e(`document_categories.title`),description:e(`document_categories.hub_description`),icon:wse,count:m.length,countLabel:e=>`${e}`},{to:`/vault/redline`,title:e(`redline.title`),description:e(`redline.show_changes`),icon:_oe}];return(0,K.jsxs)(`div`,{className:`p-6`,children:[(0,K.jsx)(`header`,{className:`mb-6`,children:(0,K.jsx)($T,{i18nKey:`tour.vault.cards`,side:`right`,children:(0,K.jsxs)(`div`,{className:`w-fit`,children:[(0,K.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:e(`vault.title`)}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`vault.description`)})]})})}),(0,K.jsx)(`div`,{className:`grid gap-5 md:grid-cols-2 lg:grid-cols-3`,children:g.map(e=>{let n=e.icon;return(0,K.jsx)(uz,{role:`button`,tabIndex:0,onClick:()=>t(e.to),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),t(e.to))},className:`cursor-pointer transition-colors hover:bg-accent/40`,children:(0,K.jsxs)(dz,{children:[(0,K.jsx)(`div`,{className:`mb-3 flex h-10 w-10 items-center justify-center rounded-md bg-muted`,children:(0,K.jsx)(n,{className:`h-5 w-5`})}),(0,K.jsx)(fz,{children:e.title}),(0,K.jsx)(pz,{children:e.description}),e.count!=null&&e.countLabel&&(0,K.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:e.countLabel(e.count)})]})},e.to)})})]})}var hvt=8;function gvt({error:e,onDismiss:t}){let[n,r]=(0,B.useState)(!1),i=e.issues,a=i.length>0,o=n?i:i.slice(0,hvt),s=Math.max(0,i.length-hvt);return(0,K.jsxs)(`div`,{className:`border-b border-destructive/30 bg-destructive/10 shrink-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-2`,children:[(0,K.jsx)(H_,{className:`h-3.5 w-3.5 text-destructive shrink-0 mt-0.5`}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsx)(`p`,{className:`text-xs font-medium text-destructive break-words`,children:e.message}),(0,K.jsxs)(`p`,{className:`text-[11px] text-destructive/80 mt-0.5`,children:[`Need the template?`,` `,(0,K.jsx)(`a`,{href:`/contract_scoring_playbook_template.xlsx`,className:`underline hover:opacity-80`,children:`Download it`}),`.`]})]}),(0,K.jsx)(`button`,{onClick:t,className:`text-destructive hover:opacity-70 shrink-0`,"aria-label":`Dismiss`,children:(0,K.jsx)(J_,{className:`h-3.5 w-3.5`})})]}),a&&(0,K.jsxs)(`div`,{className:`px-3 pb-2`,children:[(0,K.jsx)(`ul`,{className:`max-h-40 overflow-y-auto space-y-0.5 text-[11px] leading-tight`,children:o.map((e,t)=>(0,K.jsxs)(`li`,{className:`flex gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-destructive/60 font-mono shrink-0`,children:_vt(e.row,e.column)}),(0,K.jsx)(`span`,{className:`text-destructive/90 break-words`,children:vvt(e.message)})]},t))}),!n&&s>0&&(0,K.jsxs)(J,{variant:`ghost`,size:`xs`,onClick:()=>r(!0),className:`mt-1 h-6 px-2 text-[11px] text-destructive hover:text-destructive hover:bg-destructive/10`,children:[`Show all `,i.length]})]})]})}function _vt(e,t){return e===null&&t===null?`File ·`:e!==null&&t!==null?`Row ${e}, col ${t} ·`:e===null?`Col ${t} ·`:`Row ${e} ·`}function vvt(e){let t=e.indexOf(`:`);if(t===-1)return e;let n=e.slice(0,t);return/^Row\s+\d+/i.test(n)?e.slice(t+1).trim():e}function yvt(){let{t:e}=V(),{formatMonthYear:t}=jb(),{playbooks:n,isLoading:r,selectedPlaybookId:i,selectedPlaybook:a,uploadError:o,fetchPlaybooks:s,selectPlaybook:c,uploadPlaybook:l,uploadGuidanceDocument:u,deletePlaybook:d,renamePlaybook:f,clearUploadError:p,createPlaybook:m}=JI(),[h,g]=(0,B.useState)(null),[_,v]=(0,B.useState)(``),y=(0,B.useRef)(null),b=(0,B.useRef)(null),[x,S]=(0,B.useState)(!1),[C,w]=(0,B.useState)(``),[T,E]=(0,B.useState)(``),[D,O]=(0,B.useState)(!1),[k,A]=(0,B.useState)(new Set),[j,M]=(0,B.useState)(`rubric`);(0,B.useEffect)(()=>{s()},[s]);let N=a?.type??null,[P,F]=(0,B.useState)(void 0);P!==N&&(F(N),N&&N!==j&&M(N));let I=(0,B.useMemo)(()=>{let e=new Map;for(let t of n){if((t.type??`rubric`)!==j)continue;let n=e.get(t.group_id)??[];n.push(t),e.set(t.group_id,n)}for(let[,t]of e)t.sort((e,t)=>
804t.version-e.version);return e},[n,j]),L=`${i??``}:${n.length}`,[ee,R]=(0,B.useState)(null);if(ee!==L&&(R(L),i)){let e=n.find(e=>e.id===i);e&&A(t=>t.has(e.group_id)?t:new Set([...t,e.group_id]))}let te=e=>{A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ne=(e,t)=>{g(e),v(t)},re=async()=>{if(!h||!_.trim())return;let e=n.find(e=>e.group_id===h)?.id;e&&await f(e,_.trim()),g(null)},ie=()=>{g(null),v(``)},z=async t=>{await l(t,t.name.replace(/\.xlsx$/i,``)||e(`playbook.new_playbook`))},ae=e=>{let t=e.target.files?.[0];t&&z(t),e.target.value=``},oe=t=>{let n=t.target.files?.[0];n&&u(n,n.name.replace(/\.[^.]+$/,``)||e(`playbook.new_playbook`)),t.target.value=``},se=async()=>{C.trim()&&(O(!0),j===`guidance`?await m({name:C.trim(),type:`guidance`,content:``}):await m({name:C.trim(),contract_type:T.trim()||`Unknown`,type:`rubric`}),w(``),E(``),S(!1),O(!1))},ce=()=>{w(``),E(``),S(!1)};return(0,K.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b shrink-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Ag,{className:`h-4 w-4 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`text-sm font-semibold`,children:e(`playbook.title`)})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[j===`rubric`&&(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,title:e(`common.download`),asChild:!0,className:`cursor-default`,children:(0,K.jsx)(`a`,{href:`/contract_scoring_playbook_template.xlsx`,children:(0,K.jsx)(goe,{className:`h-3.5 w-3.5`})})})}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>{S(!0),g(null)},title:e(`playbook.new_playbook`),children:(0,K.jsx)(Coe,{className:`h-3.5 w-3.5`})}),j===`rubric`&&(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>y.current?.click(),title:e(`playbook.upload_xlsx`),children:(0,K.jsx)(W_,{className:`h-3.5 w-3.5`})}),j===`guidance`&&(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>b.current?.click(),title:e(`playbook.upload_document`),children:(0,K.jsx)(W_,{className:`h-3.5 w-3.5`})})]}),(0,K.jsx)(`input`,{ref:y,type:`file`,accept:`.xlsx,.csv`,className:`hidden`,onChange:ae}),(0,K.jsx)(`input`,{ref:b,type:`file`,accept:rk.join(`,`),className:`hidden`,onChange:oe})]}),(0,K.jsx)(`div`,{className:`px-2 py-2 border-b shrink-0`,children:(0,K.jsx)(bV,{value:j,onValueChange:e=>{M(e),S(!1)},children:(0,K.jsxs)(xV,{className:`w-full`,children:[(0,K.jsx)(SV,{value:`rubric`,className:`text-xs`,children:e(`playbook.rubric`)}),(0,K.jsx)(SV,{value:`guidance`,className:`text-xs`,children:e(`playbook.guidance`)})]})})}),x&&(0,K.jsxs)(`div`,{className:`px-2 py-2 border-b bg-muted/40 space-y-1.5 shrink-0`,children:[(0,K.jsx)(`input`,{className:`w-full text-xs border rounded px-2 py-1 bg-background focus:outline-none focus:ring-1 focus:ring-primary`,placeholder:e(`common.name`),value:C,onChange:e=>w(e.target.value),onKeyDown:e=>{e.key===`Enter`&&se(),e.key===`Escape`&&ce()},autoFocus:!0}),j===`rubric`&&(0,K.jsx)(`input`,{className:`w-full text-xs border rounded px-2 py-1 bg-background focus:outline-none focus:ring-1 focus:ring-primary`,placeholder:e(`common.type`),value:T,onChange:e=>E(e.target.value),onKeyDown:e=>{e.key===`Enter`&&se(),e.key===`Escape`&&ce()}}),(0,K.jsxs)(`div`,{className:`flex gap-1`,children:[(0,K.jsx)(J,{size:`xs`,onClick:se,disabled:!C.trim()||D,children:e(D?`common.creating`:`common.create`)}),(0,K.jsx)(J,{size:`xs`,variant:`ghost`,onClick:ce,children:e(`common.cancel`)})]})]}),o&&(0,K.jsx)(gvt,{error:o,onDismiss:p}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:r?(0,K.jsx)(`div`,{className:`space-y-1 p-2`,children:[...[,,,]].map((e,t)=>(0,K.jsx)(`div`,{className:`h-8 rounded bg-muted animate-pulse`},t))}):I.size===0?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground text-center mt-6 px-3`,children:e(`playbook.no_playbooks`)}):(0,K.jsx)(`ul`,{className:`p-1 space-y-0.5`,children:[...I.entries()].map(([n,r])=>{let a=r[0],o=k.has(n);return(0,K.jsx)(`li`,{children:(0,K.jsxs)(PI,{open:o,onOpenChange:()=>te(n),children:[h===n?(0,K.jsxs)(`div`,{className:`px-2 py-1 space-y-1`,children:[(0,K.jsx)(`input`,{className:`w-full text-xs border rounded px-2 py-1 bg-background focus:outline-none focus:ring-1 focus:ring-primary`,value:_,onCh
804ange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Enter`&&re(),e.key===`Escape`&&ie()},autoFocus:!0}),(0,K.jsxs)(`div`,{className:`flex gap-1`,children:[(0,K.jsx)(J,{size:`xs`,onClick:re,disabled:!_.trim(),children:e(`common.save`)}),(0,K.jsx)(J,{size:`xs`,variant:`ghost`,onClick:ie,children:e(`common.cancel`)})]})]}):(0,K.jsxs)(`div`,{className:`group flex items-center gap-1 px-1 py-1 rounded hover:bg-muted/60`,children:[(0,K.jsx)(FI,{asChild:!0,children:(0,K.jsxs)(`button`,{className:`flex items-center gap-1 flex-1 min-w-0 text-left`,children:[o?(0,K.jsx)(Rg,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}):(0,K.jsx)(Bg,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,K.jsx)(`span`,{className:`text-xs font-semibold truncate`,children:a.name}),a.contract_type?(0,K.jsx)(`span`,{className:`text-[10px] font-medium bg-muted text-muted-foreground px-1.5 py-0.5 rounded-full shrink-0 ml-1`,children:a.contract_type}):null]})}),(0,K.jsxs)(`div`,{className:`flex items-center gap-0.5 opacity-0 group-hover:opacity-100 shrink-0`,children:[(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:e=>{e.stopPropagation(),ne(n,a.name)},title:e(`common.edit`),children:(0,K.jsx)(w_,{className:`h-3 w-3`})}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:e=>{e.stopPropagation(),r.forEach(e=>d(e.id))},title:e(`common.delete`),className:`text-destructive hover:text-destructive`,children:(0,K.jsx)(V_,{className:`h-3 w-3`})})]})]}),(0,K.jsx)(II,{children:(0,K.jsx)(`ul`,{className:`pl-5 mt-0.5 space-y-0.5`,children:r.map(n=>{let r=i===n.id;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`div`,{className:`group/ver flex items-center gap-1.5 px-2 py-1 rounded cursor-pointer text-xs ${r?`bg-primary/10 text-primary font-medium`:`hover:bg-muted`}`,onClick:()=>c(n.id),children:[(0,K.jsx)(`span`,{className:`shrink-0 w-0.5 h-4 rounded-full ${r?`bg-primary`:`bg-transparent`}`}),(0,K.jsxs)(`span`,{className:`font-mono text-[10px] bg-muted px-1.5 py-0.5 rounded shrink-0`,children:[`v`,n.version]}),(0,K.jsx)(`span`,{className:`text-muted-foreground text-[10px] flex-1 min-w-0 truncate`,children:t(n.created_at)}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,className:`opacity-0 group-hover/ver:opacity-100 text-destructive hover:text-destructive shrink-0`,onClick:e=>{e.stopPropagation(),d(n.id)},title:e(`common.delete`),children:(0,K.jsx)(V_,{className:`h-3 w-3`})})]})},n.id)})})})]})},n)})})})]})}var bvt=[`kb`,`account`,`category`];function xvt({playbook:e,canMutate:t}){let{t:n}=V(),r=JI(e=>e.updatePlaybookScope),i=q$(e=>e.categories),a=q$(e=>e.fetchCategories),[o,s]=(0,B.useState)(!1);(0,B.useEffect)(()=>{i.length===0&&a()},[]);let c=e.scope===`account`?n(`guidance.scope.badge_account`):e.scope===`category`?n(`guidance.scope.badge_category`,{label:G$(e.category_key,i,n)}):n(`guidance.scope.kb`),l=async(t,i)=>{s(!1);try{await r(e.id,t,i)}catch(e){Y(e,n(`document_categories.change_failed`),{operation:`update_playbook_scope`})}};if(!t)return(0,K.jsx)(`span`,{className:`text-[10px] font-medium bg-muted text-muted-foreground px-2 py-0.5 rounded-full shrink-0`,children:c});let u=[...W$.map(e=>e.key),...i.map(e=>e.key)];return(0,K.jsxs)(aP,{open:o,onOpenChange:s,children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-[10px] font-medium bg-muted text-muted-foreground px-2 py-0.5 rounded-full shrink-0 hover:bg-muted/70`,children:[c,(0,K.jsx)(Rg,{size:11})]})}),(0,K.jsxs)(sP,{align:`start`,className:`w-64 p-2 space-y-1`,children:[(0,K.jsx)(`p`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground px-1`,children:n(`guidance.scope.label`)}),bvt.filter(e=>e!==`category`).map(t=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>l(t,null),className:`w-full text-left rounded px-2 py-1.5 text-xs hover:bg-muted ${e.scope===t?`bg-muted`:``}`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e.scope===t&&(0,K.jsx)(Lg,{size:12}),(0,K.jsx)(`span`,{className:`font-medium`,children:n(`guidance.scope.${t}`)})]}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:n(`guidance.scope.${t}_hint`)})]},t)),(0,K.jsxs)(`div`,{className:`border-t pt-1 mt-1`,children:[(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground px-1 mb-1`,children:n(`guidance.scope.pick_category`)}),(0,K.jsx)(`div`,{className:`max-h-40 overflow-y-auto`,children:u.map(t=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>l(`category`,t),className:`flex w-full items-center gap-1.5 rounded px-2 py-1 text-left text-xs hover:bg-muted ${e.scope===`category`&&e.category_key===t?`bg-muted`:``}`,children:[e.scope===`category`&&e.category_key===t&&(0,K.jsx)(Lg,{size:12}),(0,K.jsx)(`span`,{className:`truncate`,children:G$(t,i,n)})]},t))})]})]})]})}function Svt(){let{selectedPlaybook:e,isLoadingDetail:t,saveAsNewVersion:n}=JI(),r=BS(),i=Sv(),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(!1),d=a?s:e,f=()=>{e&&(c(JSON.parse(JSON.stringify(e))),o(!0))},p=()=>{c(null),o(!1)},m=async()=>{s&&(await n(s),o(!1),c(null))};if(t)return(0,K.jsxs)(`div`,{className:`p-6 space-y-3`,children:[(0,K.jsx)(`div`,{className:`h-6 w-48 rounded bg-muted animate-pulse`}),(0,K.jsx)(`div`,{className:`h-4 w-24 rounded bg-muted animate-pulse`}),(0,K.jsx)(`div`,{className:`space-y-2 mt-6`,children:[...[,,,,]].map((e,t)=>(0,K.jsx)(`div`,{className:`h-16 rounded bg-muted animate-pulse`},t))})]});if(!d)return(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center text-muted-foreground`,children:(0,K.jsxs)(`div`,{className:`text-center`,children:[(0,K.jsx)(`p`,{className:`text-sm`,children:`Select a guidance doc from the list`}),(0,K.jsx)(`p`,{className:`text-xs mt-1 opacity-60`,children:`or create one to get started`})]})});let h=d.content??``;return(0,K.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b shrink-0`,children:[(0,K.jsx)(`div`,{className:`flex-1 min-w-0 mr-3`,children:a?(0,K.jsx)(`input`,{className:`text-base font-semibold border-b border-border bg-transparent focus:outline-none focus:border-primary w-full`,value:s?.name??``,onChange:e=>c(t=>t&&{...t,name:e.target.value})}):(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold truncate`,children:d.name}),(0,K.jsx)(`span`,{className:`text-[10px] font-medium bg-muted text-muted-foreground px-2 py-0.5 rounded-full shrink-0`,children:`Guidance`}),(0,K.jsx)(xvt,{playbook:d,canMutate:r})]})}),a?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>u(e=>!e),children:[l?(0,K.jsx)(e_,{className:`h-3.5 w-3.5 mr-1.5`}):(0,K.jsx)(t_,{className:`h-3.5 w-3.5 mr-1.5`}),l?`Editor`:`Preview`]}),(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:p,children:`Cancel`}),(0,K.jsx)(J,{size:`sm`,onClick:m,children:`Save as New Version`})]}):(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:()=>
804i(`/evaluations?playbook_id=${d.id}`),children:[(0,K.jsx)(qg,{className:`h-3.5 w-3.5 mr-1.5`}),`Run Evaluation`]}),(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:f,children:[(0,K.jsx)(w_,{className:`h-3.5 w-3.5 mr-1.5`}),`Edit`]})]})]}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-4`,children:a?l?(0,K.jsx)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none bg-muted/30 rounded-lg p-4 min-h-[24rem]`,children:s?.content?.trim()?(0,K.jsx)(_I,{remarkPlugins:[NI],children:s?.content??``}):(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground italic`,children:`Nothing to preview yet.`})}):(0,K.jsx)(`textarea`,{className:`w-full h-full min-h-[24rem] resize-none rounded-md border bg-background p-3 text-sm font-mono focus:outline-none focus:ring-1 focus:ring-primary`,placeholder:`Paste your contract guidance markdown here. 805 806Examples: 807- Liability cap should not exceed 12 months of fees 808- We require mutual indemnification 809- Auto-renewal must be opt-in`,value:s?.content??``,onChange:e=>c(t=>t&&{...t,content:e.target.value})}):h.trim()?(0,K.jsx)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none`,children:(0,K.jsx)(_I,{remarkPlugins:[NI],children:h})}):(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground italic`,children:`No guidance content yet. Click Edit to add some.`})})]})}function Cvt({score:e,label:t}){return(0,K.jsxs)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium ${e>=.7?`bg-green-100 text-green-800`:e>=.4?`bg-yellow-100 text-yellow-800`:`bg-red-100 text-red-800`}`,children:[t,` `,Math.round(e*100),`%`]})}function wvt(e){return Math.round(Math.max(0,Math.min(1,e))*100)}function Tvt(e){let t=parseInt(e,10);return isNaN(t)?0:Math.max(0,Math.min(100,t))/100}function Evt({answer:e,isEditing:t,onChange:n,onDelete:r}){return t?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 py-1 text-xs group/answer`,children:[(0,K.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:`â¢`}),(0,K.jsx)(`input`,{className:`flex-1 min-w-0 border-b border-border bg-transparent focus:outline-none focus:border-primary text-xs py-0.5`,value:e.text,placeholder:`Answer textâ¦`,onChange:t=>n({...e,text:t.target.value})}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`S`}),(0,K.jsx)(`input`,{type:`number`,min:0,max:100,className:`w-10 text-[10px] border rounded px-1 py-0.5 bg-background focus:outline-none focus:ring-1 focus:ring-primary text-center`,value:wvt(e.seller_score),onChange:t=>n({...e,seller_score:Tvt(t.target.value)})}),(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`%`}),(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground ml-1`,children:`B`}),(0,K.jsx)(`input`,{type:`number`,min:0,max:100,className:`w-10 text-[10px] border rounded px-1 py-0.5 bg-background focus:outline-none focus:ring-1 focus:ring-primary text-center`,value:wvt(e.buyer_score),onChange:t=>n({...e,buyer_score:Tvt(t.target.value)})}),(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`%`}),(0,K.jsxs)(`label`,{className:`flex items-center gap-0.5 text-[10px] text-muted-foreground ml-1 cursor-pointer`,title:`Mark as acceptable default`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.is_benchmark_default,onChange:t=>n({...e,is_benchmark_default:t.target.checked}),className:`h-3 w-3`}),`â`]}),(0,K.jsx)(`button`,{onClick:r,className:`ml-0.5 text-muted-foreground/40 hover:text-destructive transition-colors opacity-0 group-hover/answer:opacity-100`,title:`Delete answer`,children:`Ã`})]})]}):(0,K.jsxs)(`div`,{className:`flex items-start gap-2 py-1.5 text-xs`,children:[(0,K.jsx)(`span`,{className:`mt-0.5 text-muted-foreground shrink-0`,children:`â¢`}),(0,K.jsx)(`span`,{className:`flex-1 text-muted-foreground`,children:e.text}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[e.is_benchmark_default&&(0,K.jsx)(`span`,{className:`text-[10px] text-green-700 font-medium`,children:`â`}),(0,K.jsx)(Cvt,{score:e.seller_score,label:`S`}),(0,K.jsx)(Cvt,{score:e.buyer_score,label:`B`})]})]})}function Dvt({question:e,isEditing:t,onChange:n,onDelete:r}){let[i,a]=(0,B.useState)(!1),o=(t,r)=>{n({...e,answers:e.answers.map(e=>e.id===t?r:e)})},s=t=>{n({...e,answers:e.answers.filter(e=>e.id!==t)})},c=()=>{let t={id:`ans-${Date.now()}`,text:``,seller_score:.5,buyer_score:.5,is_benchmark_default:!1,display_order:e.answers.length+1};n({...e,answers:[...e.answers,t]}),a(!0)},l=t||i;return(0,K.jsx)(`div`,{className:`border rounded-md mb-1.5 overflow-hidden group/question`,children:(0,K.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`div`,{className:`flex-1 min-w-0`,children:t?(0,K.jsx)(`input`,{className:`w-full text-xs text-muted-foreground border-b border-border bg-transparent focus:outline-none focus:border-primary py-0.5 italic`,value:e.text,placeholder:`What question does this evaluate?`,onChange:t=>n({...e,text:t.target.value})}):(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:e.text})}),t&&(0,K.jsx)(`button`,{onClick:r,className:`shrink-0 text-muted-foreground
809/40 hover:text-destructive transition-colors mt-0.5`,title:`Delete question`,children:(0,K.jsx)(V_,{className:`h-3.5 w-3.5`})})]}),(0,K.jsxs)(PI,{open:l,onOpenChange:t?void 0:a,children:[!t&&e.answers.length>0&&(0,K.jsx)(FI,{asChild:!0,children:(0,K.jsxs)(`button`,{className:`flex items-center gap-1 mt-2 text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:[i?(0,K.jsx)(Rg,{className:`h-3 w-3`}):(0,K.jsx)(Bg,{className:`h-3 w-3`}),e.answers.length,` answer`,e.answers.length===1?``:`s`]})}),(0,K.jsx)(II,{children:(0,K.jsxs)(`div`,{className:`mt-1 pl-2 ${t?``:`border-l border-muted`}`,children:[e.answers.map(e=>(0,K.jsx)(Evt,{answer:e,isEditing:t,onChange:t=>o(e.id,t),onDelete:()=>s(e.id)},e.id)),t&&(0,K.jsxs)(`button`,{onClick:c,className:`flex items-center gap-1 mt-1 text-[10px] text-muted-foreground hover:text-primary transition-colors`,children:[(0,K.jsx)(T_,{className:`h-3 w-3`}),`Add answer`]})]})})]}),t&&e.answers.length===0&&(0,K.jsxs)(`button`,{onClick:c,className:`flex items-center gap-1 mt-2 text-[10px] text-muted-foreground hover:text-primary transition-colors`,children:[(0,K.jsx)(T_,{className:`h-3 w-3`}),`Add answer`]})]})})}function Ovt({subcategory:e,isEditing:t,onChange:n,onDelete:r}){let[i,a]=(0,B.useState)(!0),o=(t,r)=>{n({...e,questions:e.questions.map(e=>e.id===t?r:e)})},s=t=>{n({...e,questions:e.questions.filter(e=>e.id!==t)})},c=()=>{let t={id:`q-${Date.now()}`,text:``,display_order:e.questions.length+1,answers:[]};n({...e,questions:[...e.questions,t]})},l=t||i;return(0,K.jsx)(`div`,{className:`border rounded-md mb-1.5 overflow-hidden group/subcat`,children:(0,K.jsxs)(PI,{open:l,onOpenChange:t?void 0:a,children:[(0,K.jsx)(`div`,{className:`px-3 py-2`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(FI,{asChild:!0,children:(0,K.jsxs)(`button`,{className:`flex items-center gap-2 flex-1 text-left`,children:[l?(0,K.jsx)(Rg,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}):(0,K.jsx)(Bg,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),t?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 flex-1`,onClick:e=>e.stopPropagation(),children:[(0,K.jsx)(`input`,{className:`shrink-0 w-12 font-mono text-[10px] border rounded px-1.5 py-0.5 bg-background focus:outline-none focus:ring-1 focus:ring-primary`,value:e.code??``,placeholder:`F1`,onChange:t=>n({...e,code:t.target.value})}),(0,K.jsx)(`input`,{className:`flex-1 text-xs font-semibold border-b border-border bg-transparent focus:outline-none focus:border-primary py-0.5`,value:e.name,placeholder:`Subcategory name`,onChange:t=>n({...e,name:t.target.value})})]}):(0,K.jsxs)(K.Fragment,{children:[e.code&&(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] bg-muted px-1.5 py-0.5 rounded text-muted-foreground`,children:e.code}),(0,K.jsx)(`span`,{className:`text-xs font-semibold`,children:e.name}),(0,K.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:[`(`,e.questions.length,` question`,e.questions.length===1?``:`s`,`)`]})]})]})}),t&&(0,K.jsx)(`button`,{onClick:r,className:`shrink-0 text-muted-foreground/40 hover:text-destructive transition-colors`,title:`Delete subcategory`,children:(0,K.jsx)(V_,{className:`h-3.5 w-3.5`})})]})}),(0,K.jsx)(II,{children:(0,K.jsx)(`div`,{className:`px-3 pb-2`,children:(0,K.jsxs)(`div`,{className:`pl-4 mt-1`,children:[e.questions.sort((e,t)=>(e.display_order??0)-(t.display_order??0)).map(e=>(0,K.jsx)(Dvt,{question:e,isEditing:t,onChange:t=>o(e.id,t),onDelete:()=>s(e.id)},e.id)),t&&(0,K.jsxs)(`button`,{onClick:c,className:`flex items-center gap-1 w-full py-1.5 px-3 border-2 border-dashed border-muted-foreground/20 rounded-md text-[10px] text-muted-foreground hover:border-primary hover:text-primary transition-colors mb-1`,children:[(0,K.jsx)(T_,{className:`h-3 w-3`}),`Add question`]})]})})})]})})}function kvt(){let{selectedPlaybook:e,isLoadingDetail:t,saveAsNewVersion:n}=JI(),r=Sv(),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(null),[c,l]=(0,B.useState)(new Set),u=i?o:e,d=()=>{e&&(s(JSON.parse(JSON.stringify(e))),a(!0))},f=()=>{s(null),a(!1)},p=async()=>{o&&(await n(o),a(!1),s(null))},m=e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},h=(e,t)=>{s(n=>n&&{...n,categories:n.categories.map(n=>n.id===e?t:n)})},g=e=>{s(t=>t&&{...t,categories:t.categories.filter(t=>t.id!==e)})}
809,_=(e,t,n)=>{s(r=>r&&{...r,categories:r.categories.map(r=>r.id===e?{...r,subcategories:r.subcategories.map(e=>e.id===t?n:e)}:r)})},v=(e,t)=>{s(n=>n&&{...n,categories:n.categories.map(n=>n.id===e?{...n,subcategories:n.subcategories.filter(e=>e.id!==t)}:n)})},y=e=>{let t=o?.categories.find(t=>t.id===e),n={id:`sc-${crypto.randomUUID()}`,code:``,name:`New Subcategory`,display_order:(t?.subcategories.length??0)+1,questions:[]};s(t=>t&&{...t,categories:t.categories.map(t=>t.id===e?{...t,subcategories:[...t.subcategories,n]}:t)})};return t?(0,K.jsxs)(`div`,{className:`p-6 space-y-3`,children:[(0,K.jsx)(`div`,{className:`h-6 w-48 rounded bg-muted animate-pulse`}),(0,K.jsx)(`div`,{className:`h-4 w-24 rounded bg-muted animate-pulse`}),(0,K.jsx)(`div`,{className:`space-y-2 mt-6`,children:[...[,,,,]].map((e,t)=>(0,K.jsx)(`div`,{className:`h-16 rounded bg-muted animate-pulse`},t))})]}):u?(0,K.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b shrink-0`,children:[(0,K.jsx)(`div`,{className:`flex-1 min-w-0 mr-3`,children:i?(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(`input`,{className:`text-base font-semibold border-b border-border bg-transparent focus:outline-none focus:border-primary w-full`,value:o?.name??``,onChange:e=>s(t=>t&&{...t,name:e.target.value})}),(0,K.jsx)(`input`,{className:`text-xs text-muted-foreground border-b border-border bg-transparent focus:outline-none focus:border-primary w-40`,value:o?.contract_type??``,placeholder:`Contract type`,onChange:e=>s(t=>t&&{...t,contract_type:e.target.value})})]}):(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold truncate`,children:u.name}),(0,K.jsx)(`span`,{className:`text-[10px] font-medium bg-muted text-muted-foreground px-2 py-0.5 rounded-full shrink-0`,children:u.contract_type})]})})}),i?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:f,children:`Cancel`}),(0,K.jsx)(J,{size:`sm`,onClick:p,children:`Save as New Version`})]}):(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:()=>r(`/evaluations?playbook_id=${u.id}`),children:[(0,K.jsx)(qg,{className:`h-3.5 w-3.5 mr-1.5`}),`Run Evaluation`]}),(0,K.jsxs)(J,{variant:`outline`,size:`sm`,disabled:!0,title:`Download as .xlsx (coming soon)`,children:[(0,K.jsx)(Xg,{className:`h-3.5 w-3.5 mr-1.5`}),`Download`]}),(0,K.jsxs)(J,{variant:`outline`,size:`sm`,onClick:d,children:[(0,K.jsx)(w_,{className:`h-3.5 w-3.5 mr-1.5`}),`Edit`]})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-5 py-4 space-y-3`,children:[u.categories.sort((e,t)=>(e.display_order??0)-(t.display_order??0)).map(e=>{let t=!i&&c.has(e.id);return(0,K.jsxs)(PI,{open:!t,onOpenChange:i?void 0:()=>m(e.id),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 group/cat`,children:[(0,K.jsx)(FI,{asChild:!0,children:(0,K.jsxs)(`button`,{className:`flex items-center gap-2 py-1.5 text-left flex-1`,children:[t?(0,K.jsx)(Bg,{className:`h-4 w-4 text-muted-foreground`}):(0,K.jsx)(Rg,{className:`h-4 w-4 text-muted-foreground`}),i?(0,K.jsx)(`input`,{className:`text-xs font-bold tracking-wider uppercase border-b border-border bg-transparent focus:outline-none focus:border-primary`,value:e.name,onClick:e=>e.stopPropagation(),onChange:t=>h(e.id,{...e,name:t.target.value.toUpperCase()})}):(0,K.jsx)(`span`,{className:`text-xs font-bold tracking-wider text-muted-foreground`,children:e.name}),(0,K.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:[`(`,e.subcategories.length,` subcategor`,e.subcategories.length===1?`y`:`ies`,`)`]})]})}),i&&(0,K.jsx)(`button`,{onClick:()=>g(e.id),className:`text-muted-foreground/40 hover:text-destructive transition-colors opacity-0 group-hover/cat:opacity-100`,title:`Delete category`,children:(0,K.jsx)(V_,{className:`h-3.5 w-3.5`})})]}),(0,K.jsx)(II,{children:(0,K.jsxs)(`div`,{className:`pl-6 mt-1`,children:[e.subcategories.sort((e,t)=>
809(e.display_order??0)-(t.display_order??0)).map(t=>(0,K.jsx)(Ovt,{subcategory:t,isEditing:i,onChange:n=>_(e.id,t.id,n),onDelete:()=>v(e.id,t.id)},t.id)),i&&(0,K.jsxs)(`button`,{onClick:()=>y(e.id),className:`flex items-center gap-1 w-full py-2 px-3 border-2 border-dashed border-muted-foreground/20 rounded-md text-[11px] text-muted-foreground hover:border-primary hover:text-primary transition-colors mb-1.5`,children:[(0,K.jsx)(T_,{className:`h-3 w-3`}),`Add subcategory`]})]})})]},e.id)}),i&&(0,K.jsxs)(`button`,{onClick:()=>{let e={id:`cat-${Date.now()}`,name:`NEW CATEGORY`,display_order:(o?.categories.length??0)+1,subcategories:[]};s(t=>t&&{...t,categories:[...t.categories,e]})},className:`flex items-center gap-2 w-full py-2.5 px-4 border-2 border-dashed border-muted-foreground/20 rounded-md text-xs text-muted-foreground hover:border-primary hover:text-primary transition-colors`,children:[(0,K.jsx)(T_,{className:`h-4 w-4`}),`Add category`]})]})]}):(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center text-muted-foreground`,children:(0,K.jsxs)(`div`,{className:`text-center`,children:[(0,K.jsx)(`p`,{className:`text-sm`,children:`Select a playbook from the list`}),(0,K.jsx)(`p`,{className:`text-xs mt-1 opacity-60`,children:`or create / upload one to get started`})]})})}function Avt(){let{selectedPlaybook:e}=JI();return e?.type===`guidance`?(0,K.jsx)(Svt,{}):(0,K.jsx)(kvt,{})}function jvt(){return(0,K.jsxs)(`div`,{className:`flex h-full overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`w-64 shrink-0 border-r flex flex-col overflow-hidden`,children:(0,K.jsx)(yvt,{})}),(0,K.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:(0,K.jsx)(Avt,{})})]})}function Mvt(){return(0,K.jsx)(jvt,{})}var Nvt={pending:{label:`Pending`,className:`bg-yellow-100 text-yellow-800`},running:{label:`Running`,className:`bg-blue-100 text-blue-800`,spinning:!0},completed:{label:`Completed`,className:`bg-green-100 text-green-800`},failed:{label:`Failed`,className:`bg-red-100 text-red-800`}};function Pvt({status:e}){let t=Nvt[e]??{label:e,className:`bg-muted text-muted-foreground`};return(0,K.jsx)(lR,{className:t.className,children:t.spinning?(0,K.jsx)(RI,{size:`sm`,label:t.label}):t.label})}function Fvt({score:e}){if(e==null)return(0,K.jsx)(lR,{variant:`outline`,children:`â`});let t=Math.round(e*100);return(0,K.jsxs)(lR,{className:t>=70?`bg-green-100 text-green-800`:t>=40?`bg-yellow-100 text-yellow-800`:`bg-red-100 text-red-800`,children:[t,`%`]})}function Ivt(){let{t:e}=V(),{formatDate:t}=jb(),{evaluations:n,isLoading:r,selectedEvaluation:i,fetchEvaluations:a,selectEvaluation:o,deleteEvaluation:s}=qI();return(0,B.useEffect)(()=>{a()},[a]),WB(a),r?(0,K.jsx)(`div`,{className:`space-y-1 p-2`,children:[...[,,,]].map((e,t)=>(0,K.jsx)(`div`,{className:`h-10 rounded bg-muted animate-pulse`},t))}):n.length===0?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground text-center mt-6 px-3`,children:e(`evaluation.no_evaluations`)}):(0,K.jsx)(`ul`,{className:`p-1 space-y-0.5`,children:n.map(n=>{let r=i?.id===n.id;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`div`,{className:`group flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer text-xs ${r?`bg-primary/10 text-primary font-medium`:`hover:bg-muted`}`,onClick:()=>o(n.id),children:[(0,K.jsx)(`span`,{className:`shrink-0 w-0.5 h-5 rounded-full ${r?`bg-primary`:`bg-transparent`}`}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsx)(`p`,{className:`truncate text-xs`,children:n.document_name??e(`common.untitled_document`)}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-0.5`,children:[(0,K.jsx)(Pvt,{status:n.status}),(0,K.jsx)(`span`,{className:`text-[10px] uppercase font-medium text-muted-foreground`,children:n.role}),n.playbook_name&&(0,K.jsxs)(`span`,{className:`text-[10px] text-muted-foreground truncate`,children:[`· `,n.playbook_name]})]}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5 truncate`,children:t(n.created_at,`MMM d, HH:mm`)})]}),(0,K.jsx)(Fvt,{score:n.overall_score}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,className:`opacity-0 group-hover:opacity-100 transition-opacity text-red-500 hover:text-red-700 hover:bg-red-50 shrink-0`,onClick:e=>{e.stopPropagation(),s(n.id)},title:e(`evaluation.detail.delete`),children:(0,K.jsx)(V_,{className:`h-3.5 w-3.5`})})]})},n.id)})})}function Lvt({onCreated:e}){let{t}=V(),{createEvaluation:n,isCreating:r}=qI(),{playbooks:i,fetchPlaybooks:a}=JI(),{documents:o,fetchDocuments:s}
809=sk(),[c]=Jv(),l=c.get(`playbook_id`)??``,[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(l),[m,h]=(0,B.useState)(`buyer`),[g,_]=(0,B.useState)(``),[v,y]=(0,B.useState)([]);(0,B.useEffect)(()=>{a(),s()},[a,s]);let b=o.filter(e=>e.status===`completed`),x=[...i].sort((e,t)=>{let n=e.name.localeCompare(t.name);return n===0?t.version-e.version:n});return(0,K.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault(),!(!u||!f)&&await n({document_id:u,playbook_id:f,role:m,knowledge_base_id:g||null,grounding_document_ids:v.length?v:null})&&e?.()},className:`space-y-3 p-3 bg-muted/30`,children:[(0,K.jsx)(`h3`,{className:`text-xs font-semibold`,children:t(`evaluation.new_evaluation`)}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:t(`evaluation.document`)}),(0,K.jsxs)(`select`,{className:`mt-0.5 w-full text-xs border rounded px-2 py-1.5 bg-background focus:outline-none focus:ring-1 focus:ring-primary`,value:u,onChange:e=>d(e.target.value),required:!0,children:[(0,K.jsx)(`option`,{value:``,children:t(`evaluation.create_dialog.select_document`)}),b.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.original_filename},e.id))]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:t(`evaluation.playbook`)}),(0,K.jsxs)(`select`,{className:`mt-0.5 w-full text-xs border rounded px-2 py-1.5 bg-background focus:outline-none focus:ring-1 focus:ring-primary`,value:f,onChange:e=>p(e.target.value),required:!0,children:[(0,K.jsx)(`option`,{value:``,children:t(`evaluation.create_dialog.select_playbook`)}),x.map(e=>{let n=e.type===`guidance`?t(`playbook.guidance`):t(`playbook.rubric`);return(0,K.jsxs)(`option`,{value:e.id,children:[e.name,` v`,e.version,` · `,n,e.contract_type?` (${e.contract_type})`:``,e.is_current?` â ${t(`org.switcher.current`).toLowerCase()}`:``]},e.id)})]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:t(`evaluation.role`)}),(0,K.jsxs)(`div`,{className:`flex gap-3 mt-1`,children:[(0,K.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs cursor-pointer`,children:[(0,K.jsx)(`input`,{type:`radio`,name:`role`,value:`buyer`,checked:m===`buyer`,onChange:()=>h(`buyer`),className:`h-3 w-3`}),t(`evaluation.role_buyer`)]}),(0,K.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs cursor-pointer`,children:[(0,K.jsx)(`input`,{type:`radio`,name:`role`,value:`seller`,checked:m===`seller`,onChange:()=>h(`seller`),className:`h-3 w-3`}),t(`evaluation.role_seller`)]})]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:t(`evaluation.knowledge_base`)}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:t(`evaluation.knowledge_base_hint`)}),(0,K.jsx)(wU,{value:g||void 0,onChange:e=>_(e??``),noneLabel:t(`evaluation.knowledge_base_none`),className:`mt-1`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:t(`evaluation.exemplar_documents`)}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:t(`evaluation.exemplar_documents_hint`,{max:3})}),(0,K.jsx)(TU,{value:v,onChange:y,excludeDocumentId:u,max:3,className:`mt-1`})]}),(0,K.jsx)(J,{type:`submit`,size:`sm`,className:`w-full`,disabled:r,children:t(r?`evaluation.create_dialog.starting`:`evaluation.create_dialog.start`)})]})}function Rvt({suggestions:e,isLoading:t,inFlightById:n={},failureById:r={},onUpdate:i,onApply:a,onUnapply:o}){let{t:s}=V();return t?(0,K.jsx)(RI,{size:`sm`,label:s(`redline.generating_suggestions`)}):e.length===0?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`No redline suggestions linked to this finding.`}):(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsxs)(`span`,{className:`font-medium text-muted-foreground text-[10px] uppercase tracking-wider`,children:[`Redline Suggestions (`,e.length,`)`]}),(0,K.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,K.jsx)(qU,{suggestion:e,standalone:!0,inFlight:n[e.id]??null,failureReason:r[e.id]??null,onAccept:()=>a(e.id),onReject:()=>i(e.id,{status:`rejected`}),onEditSave:async t=>{await i(e.id,{status:`edited`,edited_text:t}),await a(e.id)},onUndo:()=>e.status===`applied`?o(e.id):i(e.id,{status:`pending`,edited_text:null})},e.id))})]})}var zvt=/\[\[s(\d+)\]\]/g;function Bvt(e,t,n,r,i){let a=[];
809return B.Children.forEach(e,(e,o)=>{if(typeof e!=`string`){if((0,B.isValidElement)(e)){let s=e,c=s.props.children;if(c!==void 0){let e=Bvt(c,t,n,r,i);a.push((0,B.cloneElement)(s,{key:o},e))}else a.push(e)}else a.push(e);return}let s=Array.from(e.matchAll(zvt));if(s.length===0){a.push((0,K.jsx)(B.Fragment,{children:e},`${o}-t`));return}let c=0,l=0;for(let u of s){let s=u.index??0;s>c&&a.push((0,K.jsx)(B.Fragment,{children:e.slice(c,s)},`${o}-t-${l++}`));let d=parseInt(u[1],10),f=t[d-1];if(f){let e=f.id===n;a.push((0,K.jsxs)(`sup`,{"data-suggestion-id":f.id,className:`inline-block mx-0.5 px-1 rounded cursor-pointer text-[14px] font-semibold transition-colors ${e?`ring-2 ring-yellow-400 bg-yellow-200 text-yellow-900`:`bg-blue-100 text-blue-800 hover:bg-blue-200`}`,title:`Suggestion ${d}: ${f.rationale??``}`,onMouseEnter:()=>r(f.id),onMouseLeave:()=>r(null),onClick:()=>i(f.id),children:[`s`,d]},`${o}-m-${l++}`))}else a.push((0,K.jsx)(B.Fragment,{children:u[0]},`${o}-m-${l++}`));c=s+u[0].length}c<e.length&&a.push((0,K.jsx)(B.Fragment,{children:e.slice(c)},`${o}-t-${l++}`))}),a}function Vvt(e){return[...e].sort((e,t)=>e.paragraph_index===t.paragraph_index?e.created_at.localeCompare(t.created_at):e.paragraph_index-t.paragraph_index)}function Hvt({documentId:e,batchId:t,analysis:n}){let{t:r}=V(),{suggestions:i,isLoading:a,error:o,inFlightById:s,failureById:c,updateOne:l,applyOne:u,unapplyOne:d}=a_e(e,t),f=(0,B.useMemo)(()=>Vvt(i),[i]),[p,m]=(0,B.useState)(null),h=(0,B.useRef)(null),g=(0,B.useRef)(null),_=(0,B.useCallback)(e=>{(g.current?.querySelector(`[data-suggestion-card="${e}"]`))?.scrollIntoView({behavior:`smooth`,block:`center`})},[]),v=(0,B.useCallback)(e=>{(h.current?.querySelector(`[data-suggestion-id="${e}"]`))?.scrollIntoView({behavior:`smooth`,block:`center`})},[]),y=(0,B.useMemo)(()=>{let e=e=>function(t){return(0,K.jsx)(e,{...t,children:Bvt(t.children,f,p,m,e=>_(e))})};return{p:e(`p`),li:e(`li`),h1:e(`h1`),h2:e(`h2`),h3:e(`h3`),h4:e(`h4`),h5:e(`h5`),h6:e(`h6`),td:e(`td`),th:e(`th`),blockquote:e(`blockquote`)}},[f,p,_]),b=f.filter(e=>e.status===`applied`).length;return(0,K.jsxs)(`div`,{className:`flex flex-col lg:flex-row gap-4 p-4`,children:[(0,K.jsxs)(`div`,{ref:h,className:`flex-1 min-w-0 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(_se,{className:`h-4 w-4 text-amber-500`}),(0,K.jsx)(`h4`,{className:`text-sm font-medium`,children:`Analysis`})]}),n?(0,K.jsx)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none bg-muted/50 rounded-lg p-3`,children:(0,K.jsx)(_I,{remarkPlugins:[NI],components:y,children:n})}):(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No analysis was produced for this evaluation.`})]}),(0,K.jsxs)(`div`,{ref:g,className:`flex-1 min-w-0 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(i_,{className:`h-4 w-4`}),(0,K.jsxs)(`h4`,{className:`text-sm font-medium`,children:[`Redline Suggestions (`,b,` applied / `,f.length,` `,`total)`]})]}),a&&(0,K.jsx)(RI,{size:`sm`,label:r(`redline.generating_suggestions`)}),o&&(0,K.jsx)(`div`,{className:`text-xs text-destructive`,children:o}),!a&&!o&&f.length===0&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No redline suggestions for this evaluation.`}),(0,K.jsx)(`div`,{className:`space-y-2`,children:f.map((e,t)=>{let n=e.id===p;return(0,K.jsxs)(`div`,{"data-suggestion-card":e.id,onMouseEnter:()=>m(e.id),onMouseLeave:()=>m(null),onClick:()=>v(e.id),className:`rounded transition-shadow cursor-pointer ${n?`ring-2 ring-yellow-400 bg-yellow-50`:``}`,children:[(0,K.jsxs)(`div`,{className:`text-[10px] font-mono text-muted-foreground px-1 pt-1`,children:[`s`,t+1]}),(0,K.jsx)(qU,{suggestion:e,standalone:!0,inFlight:s[e.id]??null,failureReason:c[e.id]??null,onAccept:()=>u(e.id),onReject:()=>l(e.id,{status:`rejected`}),onEditSave:async t=>{await l(e.id,{status:`edited`,edited_text:t}),await u(e.id)},onUndo:()=>e.status===`applied`?d(e.id):l(e.id,{status:`pending`,edited_text:null})})]},e.id)})})]})]})}function Uvt({score:e}){return e==null?(0,K.jsx)(lR,{variant:`secondary`,children:`N/A`}):(0,K.jsxs)(lR,{className:e>=.7?`bg-green-100 text-green-800`:e>=.4?`bg-yellow-100 text-yellow-800`:`bg-red-100 text-red-800`,children:[Math.round(e*100),`%`]})}function Wvt(){let{t:e}=V(),{formatDateTime:t}=jb(),{selectedEvaluation:n,isLoadingDetail:r,pollingId:i,stopPolling:a}=qI(),{selectedPlaybook:o,selectPlaybook:s}=JI(),{viewDocumentInKB:c}=Q();function l(){c(m.document_id,m.document_name??void 0)}
809let u=n?.playbook_type===`guidance`;(0,B.useEffect)(()=>{u||n?.playbook_id&&o?.id!==n.playbook_id&&s(n.playbook_id)},[u,n?.playbook_id,o?.id,s]),(0,B.useEffect)(()=>()=>a(),[a]);let[d,f]=(0,B.useState)(new Set),p=e=>f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});if(r)return(0,K.jsxs)(`div`,{className:`p-6 space-y-3`,children:[(0,K.jsx)(`div`,{className:`h-6 w-48 rounded bg-muted animate-pulse`}),(0,K.jsx)(`div`,{className:`space-y-2 mt-4`,children:[...[,,,]].map((e,t)=>(0,K.jsx)(`div`,{className:`h-20 rounded bg-muted animate-pulse`},t))})]});if(!n)return(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center text-muted-foreground`,children:(0,K.jsxs)(`div`,{className:`text-center`,children:[(0,K.jsx)(`p`,{className:`text-sm`,children:`Select an evaluation from the list`}),(0,K.jsx)(`p`,{className:`text-xs mt-1 opacity-60`,children:`or create a new one to get started`})]})});let m=n,h=m.status===`pending`||m.status===`running`,g=m.status===`failed`,_=g?Ub(m.error_message,{operation:`evaluation.detail.errorMessage`}):null,v=new Map,y=o?.categories;if(y)for(let e of y)for(let t of e.subcategories)for(let n of t.questions)v.set(n.id,{question:n,subcategory:t,category:e});let b=new Map;if(y)for(let e of y)for(let t of e.subcategories)for(let e of t.questions)for(let t of e.answers)b.set(t.id,t);let x=m.answers??[],S=x.map(e=>{let t=v.get(e.question_id);return{answer:e,question:t?.question,subcategory:t?.subcategory,category:t?.category,matchedAnswer:e.answer_id?b.get(e.answer_id):void 0}}).sort((e,t)=>{let n=e.category?.name??`zzz`,r=t.category?.name??`zzz`;if(n!==r)return n.localeCompare(r);let i=e.subcategory?.display_order??999,a=t.subcategory?.display_order??999;return i===a?(e.question?.display_order??999)-(t.question?.display_order??999):i-a}),C=m.overall_score;function w(){let e=[];e.push(`# Evaluation Report 810`),e.push(`**Document:** ${m.document_name??`Untitled document`}`),m.playbook_name&&e.push(`**Playbook:** ${m.playbook_name}`),e.push(`**Role:** ${m.role}`),C!=null&&e.push(`**Overall Score:** ${Math.round(C*100)}%`),e.push(`**Date:** ${t(m.created_at)}`),e.push(` 811--- 812`);let n=``,r=``;for(let{answer:t,question:i,subcategory:a,category:o,matchedAnswer:s}of S){let c=o?.name??`Uncategorized`,l=a?.name??`General`;c!==n&&(n=c,r=``,e.push(`## ${c}\n`)),l!==r&&(r=l,e.push(`### ${l}\n`));let u=t.score,d=t.confidence,f=t.reasoning;e.push(`**Question:** ${i?.text??`Unknown question`}`),e.push(`- **Score:** ${u==null?`N/A`:`${Math.round(u*100)}%`}`),e.push(`- **Confidence:** ${d==null?`N/A`:`${Math.round(d*100)}%`}`),s&&e.push(`- **Matched Answer:** ${s.text}`),f&&e.push(`- **Reasoning:** ${f}`),e.push(``)}let i=e.join(` 813`),a=new Blob([i],{type:`text/markdown`}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=`${m.document_name}_evaluation.md`,s.click(),URL.revokeObjectURL(o)}return(0,K.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[(0,K.jsxs)(`div`,{className:`px-5 py-3 border-b shrink-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium truncate mr-2`,children:m.document_name??`Untitled document`}),(0,K.jsxs)(J,{variant:`outline`,size:`xs`,onClick:l,children:[(0,K.jsx)(t_,{size:14,className:`mr-2`}),`View file`]}),m.status===`completed`&&!u&&(0,K.jsxs)(J,{variant:`outline`,size:`xs`,onClick:w,children:[(0,K.jsx)(Xg,{size:14,className:`mr-2`}),`Export as .md`]}),(0,K.jsx)(`span`,{className:`ml-auto`,children:(0,K.jsx)(mO,{subject:{type:`evaluation`,id:m.id,label:e(`report_issue.evaluation`,{filename:Ab(m.document_name??e(`common.untitled_document`))})}})})]}),(0,K.jsxs)(`div`,{className:`flex flex-col items-left mt-1`,children:[(0,K.jsx)(Pvt,{status:m.status}),(0,K.jsxs)(`span`,{className:`text-[10px] font-medium text-muted-foreground`,children:[`Our side: `,(0,K.jsx)(`span`,{className:`uppercase`,children:m.role})]}),m.playbook_name&&(0,K.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[`Playbook: `,m.playbook_name]}),h&&i&&(0,K.jsx)(RI,{size:`sm`,label:e(`ai.activity.working`)})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between mt-1`,children:[(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:t(m.created_at)}),C!=null&&(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Overall:`}),(0,K.jsx)(Uvt,{score:C})]})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[h&&!u&&S.length===0&&(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-center px-5`,children:[(0,K.jsx)(RI,{size:`lg`,label:`Analyzing contract`}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground mt-3`,children:`Analyzing contract questions against playbook answersâ¦`})]}),h&&u&&(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-center px-5`,children:[(0,K.jsx)(RI,{size:`lg`,label:`Generating guidance`}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground mt-3`,children:`Generating guidance analysis and redline suggestionsâ¦`})]}),h&&!u&&S.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`sticky top-0 z-10 flex items-center gap-2 bg-background/90 backdrop-blur px-5 py-2 border-b`,children:(0,K.jsx)(RI,{size:`sm`,label:`Scoring (${S.length} so far)`})}),(0,K.jsx)(o0,{documentId:m.document_id,batchId:m.suggestion_batch_id??null,flatAnswers:S,expandedRows:d,toggleRow:p})]}),g&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-center px-5`,children:[(0,K.jsx)(Hg,{className:`h-8 w-8 text-destructive mb-3`}),(0,K.jsx)(`p`,{className:`text-sm font-medium text-destructive`,children:`Evaluation Failed`}),_&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 max-w-md`,children:_})]}),!u&&S.length>0&&(0,K.jsx)(o0,{documentId:m.document_id,batchId:m.suggestion_batch_id??null,flatAnswers:S,expandedRows:d,toggleRow:p})]}
813),m.status===`completed`&&u&&m.suggestion_batch_id&&(0,K.jsx)(Hvt,{documentId:m.document_id,batchId:m.suggestion_batch_id,analysis:m.analysis??null}),m.status===`completed`&&u&&!m.suggestion_batch_id&&(0,K.jsx)(`div`,{className:`px-5 py-4 space-y-2`,children:m.analysis?(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground whitespace-pre-wrap`,children:m.analysis}):(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No analysis was produced for this evaluation.`})}),m.status===`completed`&&!u&&x.length===0&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground text-center py-8 px-5`,children:`No answers were generated for this evaluation.`}),m.status===`completed`&&!u&&S.length>0&&(0,K.jsx)(o0,{documentId:m.document_id,batchId:m.suggestion_batch_id??null,flatAnswers:S,expandedRows:d,toggleRow:p})]})]})}function o0({documentId:e,batchId:t,flatAnswers:n,expandedRows:r,toggleRow:i}){let{t:a}=V(),{suggestions:o,isLoading:s,inFlightById:c,failureById:l,updateOne:u,applyOne:d,unapplyOne:f}=a_e(e,t??``),p=t!==null&&t!==``,{byQuestion:m,unlinked:h}=(0,B.useMemo)(()=>{let e=new Map,t=[];if(!p)return{byQuestion:e,unlinked:t};for(let n of o){let r=n.question_ids??[];if(r.length===0){t.push(n);continue}for(let t of r){let r=e.get(t);r?r.push(n):e.set(t,[n])}}return{byQuestion:e,unlinked:t}},[o,p]),[g,_]=(0,B.useState)(!1);return(0,K.jsxs)(`div`,{className:`px-5 py-3 space-y-4`,children:[(0,K.jsxs)(iU,{className:``,children:[(0,K.jsx)(aU,{children:(0,K.jsxs)(sU,{className:`hover:bg-transparent`,children:[(0,K.jsx)(cU,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium w-5 px-1`}),(0,K.jsx)(cU,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:`Issue`}),(0,K.jsx)(cU,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium w-[40%]`,children:`Reference`}),(0,K.jsx)(cU,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium w-16 text-center`,children:`Score`}),(0,K.jsx)(cU,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium w-16 text-center`})]})}),(0,K.jsx)(oU,{children:n.map(({answer:e,question:t,subcategory:n,category:o,matchedAnswer:h})=>{let g=r.has(e.id),_=e.score,v=e.confidence,y=e.reasoning,b=y||t?.text||`â`,x=o?`${o.name} â ${n?.name??`Unknown`}`:`Question ${e.question_id.slice(0,8)}â¦`,S=m.get(e.question_id)??[];return(0,K.jsxs)(B.Fragment,{children:[(0,K.jsxs)(sU,{className:`cursor-pointer`,onClick:()=>i(e.id),children:[(0,K.jsx)(lU,{className:`px-1 py-2.5 text-muted-foreground`,children:(0,K.jsx)(Bg,{className:`h-3 w-3 transition-transform ${g?`rotate-90`:``}`})}),(0,K.jsx)(lU,{className:`py-2.5 text-xs max-w-0 truncate`,title:b,children:b}),(0,K.jsx)(lU,{className:`py-2.5 text-xs text-muted-foreground max-w-0 truncate`,title:x,children:x}),(0,K.jsx)(lU,{className:`py-2.5 text-center`,children:(0,K.jsx)(Uvt,{score:_})}),(0,K.jsx)(lU,{className:`py-2.5 text-center`,onClick:e=>e.stopPropagation(),children:(0,K.jsx)(`div`,{className:`flex items-center justify-center gap-0.5`,children:(0,K.jsx)(mO,{subject:{type:`evaluation_answer`,id:e.id,label:a(`report_issue.evaluation_answer`,{question:Ab(t?.text||x)})}})})})]}),g&&(0,K.jsxs)(sU,{className:`bg-muted/30 hover:bg-muted/30`,children:[(0,K.jsx)(lU,{}),(0,K.jsx)(lU,{colSpan:4,className:`py-3 text-xs whitespace-normal [&_*]:whitespace-normal`,children:(0,K.jsxs)(`div`,{className:`flex flex-col lg:flex-row gap-4`,children:[(0,K.jsxs)(`div`,{className:`lg:w-2/5 lg:shrink-0 min-w-0 space-y-3`,children:[y&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`font-medium text-muted-foreground text-[10px] uppercase tracking-wider`,children:`Reasoning`}),(0,K.jsx)(`p`,{className:`text-muted-foreground leading-relaxed mt-0.5`,children:y})]}),h&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`font-medium text-muted-foreground text-[10px] uppercase tracking-wider`,children:`Matched Answer`}),(0,K.jsx)(`p`,{className:`text-muted-foreground leading-relaxed mt-0.5`,children:h.text})]}),v!=null&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`font-medium text-muted-foreground text-[10px] uppercase tracking-wider`,children:`Confidence`}),(0,K.jsxs)(`span`,{className:`text-muted-foreground ml-1.5`,children:[Math.round(v*100),`%`]})]}),t?.text&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`font-medium text-muted-foreground text-[10px] uppercase tracking-wider`,children:`Question`}),(0,K.jsx)(`p`,{className:`text-muted-foreground italic leading-relaxed mt-0.5`,children:t.text})]})]}),p&&(0,K.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,K.jsx)(Rvt,{suggestions:S,isLoading:s,inFlightById:c,failureById:l,onUpdate:u,onApply:d,onUnapply:f})})]})})]})]},e.id)})})]}),p&&h.length>0&&(0,K.jsxs)(`div`,{className:`border rounded-md`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>_(e=>!e),className:`w-full flex items-center justify-between px-3 py-2 text-xs font-medium hover:bg-muted/50`,children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Bg,{className:`h-3 w-3 transition-transform ${g?`rotate-90`:``}`}),`Unlinked suggestions`,(0,K.jsx)(lR,{variant:`secondary`,className:`h-4 px-1 text-[10px]`,children:h.length})]}),(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`not tied to a specific finding`})]}),g&&(0,K.jsx)(`div`,{className:`p-3 space-y-2`,children:h.map(e=>
813(0,K.jsx)(qU,{suggestion:e,standalone:!0,inFlight:c[e.id]??null,failureReason:l[e.id]??null,onAccept:()=>d(e.id),onReject:()=>u(e.id,{status:`rejected`}),onEditSave:async t=>{await u(e.id,{status:`edited`,edited_text:t}),await d(e.id)},onUndo:()=>e.status===`applied`?f(e.id):u(e.id,{status:`pending`,edited_text:null})},e.id))})]}),!p&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:`Redlines are generated automatically for DOCX contracts. Re-run this evaluation on a .docx to get suggestions.`})]})}function Gvt({isOpen:e,onToggle:t}){return(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:t,title:e?`Hide evaluation list`:`Show evaluation list`,children:(0,K.jsx)(e?S_:ase,{className:`h-4 w-4 text-muted-foreground`})})}function Kvt(){let[e]=Jv(),[t,n]=(0,B.useState)(!!e.get(`playbook_id`)),[r,i]=(0,B.useState)(!0);return(0,K.jsxs)(`div`,{className:`flex h-full`,children:[r?(0,K.jsxs)(`div`,{className:`w-64 shrink-0 border-r border-t flex flex-col h-full`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b shrink-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Gvt,{isOpen:!0,onToggle:()=>i(!1)}),(0,K.jsx)(`span`,{className:`text-sm font-semibold`,children:`Evaluations`})]}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:()=>n(e=>!e),title:`New evaluation`,children:(0,K.jsx)(T_,{className:`h-3.5 w-3.5`})})]}),t&&(0,K.jsx)(`div`,{className:`shrink-0 border-b`,children:(0,K.jsx)(Lvt,{onCreated:()=>n(!1)})}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,K.jsx)(Ivt,{})})]}):(0,K.jsx)(`div`,{className:`w-10 shrink-0 border-r border-t flex flex-col items-center pt-2`,children:(0,K.jsx)(Gvt,{isOpen:!1,onToggle:()=>i(!0)})}),(0,K.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,K.jsx)(Wvt,{})})]})}function qvt(){return(0,K.jsx)(Kvt,{})}var Jvt=`oklch(0.62 0.13 50)`;const Yvt=({prompts:e,selectedId:t,query:n,onQueryChange:r,onSelect:i,onNew:a,isLoading:o,canMutate:s=!0})=>{let c=n.trim().toLowerCase(),l=c?e.filter(e=>e.name.toLowerCase().includes(c)||(e.description??``).toLowerCase().includes(c)):e;return(0,K.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,K.jsxs)(`div`,{className:`px-6 pt-6 pb-4 space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold tracking-tight`,children:`Prompt Library`}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:`Reusable instructions for the assistant`})]}),s&&(0,K.jsxs)(J,{size:`sm`,variant:`outline`,onClick:a,className:`shrink-0 h-8 gap-1.5`,children:[(0,K.jsx)(T_,{size:14}),(0,K.jsx)(`span`,{className:`text-xs`,children:`New`})]})]}),(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(A_,{size:13,className:`absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,K.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:`Search promptsâ¦`,className:`w-full h-8 pl-8 pr-2.5 text-xs bg-muted/40 border border-transparent rounded-md placeholder:text-muted-foreground focus:outline-none focus:bg-background focus:border-input`})]})]}),(0,K.jsx)(`div`,{className:`border-t border-border/60`}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:o?(0,K.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,K.jsx)(W,{className:`h-4 w-4 animate-spin text-muted-foreground`})}):e.length===0?(0,K.jsxs)(`div`,{className:`px-6 py-12 text-center`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No prompts yet`}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground/70 mt-1`,children:`Save reusable instructions to recall later`})]}):l.length===0?(0,K.jsx)(`div`,{className:`px-6 py-12 text-center`,children:(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No prompts match â`,n,`â`]})}):(0,K.jsx)(QN.ul,{initial:`hidden`,animate:`visible`,variants:{visible:{transition:{staggerChildren:.018}}},children:l.map((e,n)=>{let r=e.id===t;return(0,K.jsx)(QN.li,{variants:{hidden:{opacity:0,y:4},visible:{opacity:1,y:0}},transition:{duration:.18,ease:`easeOut`},children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:`group relative w-full text-left px-6 py-3.5 border-b border-border/60 transition-all duration-150 cursor-pointer focus:outline-none focus-visible:bg-muted/40 ${r?`bg-muted/40`:`hover:bg-muted/30 hover:translate-x-[2px]`}
813`,children:[r&&(0,K.jsx)(`span`,{"aria-hidden":!0,className:`absolute left-0 top-2 bottom-2 w-[2px] rounded-r`,style:{background:Jvt}}),(0,K.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,K.jsxs)(`span`,{className:`font-mono text-[10px] tracking-tight text-muted-foreground/70 shrink-0 tabular-nums pt-0.5`,"aria-hidden":!0,children:[`â `,String(n+1).padStart(2,`0`)]}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium leading-tight truncate`,children:e.name}),e.description&&(0,K.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1 truncate`,children:e.description}),e.is_system&&(0,K.jsx)(`div`,{className:`mt-1.5`,children:(0,K.jsx)(`span`,{className:`font-mono text-[9px] uppercase tracking-wider text-muted-foreground/80 border border-border/80 px-1.5 py-0.5 rounded-sm`,children:`system`})})]})]})]})},e.id)})})})]})},Xvt=({promptId:e,summary:t,onAfterDelete:n,onAfterUpdate:r,canMutate:i=!0})=>{let{t:a}=V(),{formatDate:o,formatNumber:s}=jb(),{updatePrompt:c,deletePrompt:l}=Q(),[u,d]=(0,B.useState)(null),[f,p]=(0,B.useState)(!1),[m,h]=(0,B.useState)(!1),[g,_]=(0,B.useState)(``),[v,y]=(0,B.useState)(``),[b,x]=(0,B.useState)(!1),[S,C]=(0,B.useState)(!1);(0,B.useEffect)(()=>{if(!e){d(null);return}let t=!0;return p(!0),h(!1),C(!1),gme(e).then(e=>{t&&d(e.data)}).catch(()=>{t&&d(null)}).finally(()=>{t&&p(!1)}),()=>{t=!1}},[e]);let w=(0,B.useMemo)(()=>{let e=u?.content??``;return{lines:e.length===0?0:e.split(/\r?\n/).length,characters:e.length}},[u?.content]),T=u?.is_system??t?.is_system??!1,E=async()=>{if(u)try{await navigator.clipboard.writeText(u.content),G.success(a(`toasts.common.copied`))}catch{G.error(a(`toasts.common.copy_failed`))}},D=()=>{!u||T||(_(u.name),y(u.content),h(!0),C(!1))},O=()=>{h(!1)},k=async()=>{if(u&&!(!g.trim()||!v.trim())){x(!0);try{await c(u.id,{name:g.trim(),content:v.trim()}),d({...u,name:g.trim(),content:v.trim(),updated_at:new Date().toISOString()}),h(!1),r?.(),G.success(a(`toasts.common.updated`))}catch(t){Y(t,a(`toasts.common.save_failed`),{operation:`save_prompt`,metadata:{promptId:e}})}finally{x(!1)}}},A=async()=>{if(!(!u||T)){if(!S){C(!0);return}try{await l(u.id),n(u.id),G.success(a(`toasts.common.deleted`))}catch(t){Y(t,a(`toasts.common.delete_failed`),{operation:`delete_prompt`,metadata:{promptId:e}}),C(!1)}}};return e?(0,K.jsx)(lN,{mode:`wait`,children:(0,K.jsx)(QN.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.18,ease:`easeOut`},className:`h-full overflow-y-auto`,children:(0,K.jsx)(`div`,{className:`max-w-[860px] py-10 pr-2`,children:f||!u?(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsx)(LI,{className:`h-9 w-2/3`}),(0,K.jsx)(LI,{className:`h-4 w-1/2`}),(0,K.jsx)(LI,{className:`h-px w-full`}),(0,K.jsx)(LI,{className:`h-4 w-full max-w-md`}),(0,K.jsx)(LI,{className:`h-64 w-full`})]}):m?(0,K.jsxs)(`div`,{className:`space-y-5`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,K.jsx)(`input`,{type:`text`,value:g,onChange:e=>_(e.target.value),className:`w-full text-2xl font-semibold tracking-tight bg-transparent border-0 border-b border-border/60 pb-2 focus:outline-none focus:border-foreground
813/40`,placeholder:a(`prompts.prompt_name`),disabled:b})}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:O,disabled:b,className:`h-8 gap-1.5`,children:[(0,K.jsx)(J_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:a(`common.cancel`)})]}),(0,K.jsxs)(J,{size:`sm`,onClick:k,disabled:b||!g.trim()||!v.trim(),className:`h-8 gap-1.5`,children:[(0,K.jsx)(Lg,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:a(b?`common.saving`:`common.save`)})]})]})]}),(0,K.jsx)(`textarea`,{value:v,onChange:e=>y(e.target.value),className:`w-full min-h-[400px] p-5 text-xs font-mono leading-relaxed bg-muted/30 border-0 rounded-lg resize-y focus:outline-none focus:ring-2 focus:ring-ring`,placeholder:a(`prompts.prompt_body`),disabled:b})]}):(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-6`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight leading-tight`,children:u.name}),u.description&&(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground mt-2 leading-relaxed max-w-[60ch]`,children:u.description})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:E,className:`h-8 gap-1.5`,children:[(0,K.jsx)(Yg,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:a(`common.copy`)})]}),!T&&i&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:D,className:`h-8 gap-1.5`,children:[(0,K.jsx)(w_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:a(`common.edit`)})]}),S?(0,K.jsxs)(`div`,{className:`flex items-center gap-1 ml-1 pl-2 border-l border-border/60`,children:[(0,K.jsxs)(`span`,{className:`text-[11px] text-muted-foreground inline-flex items-center gap-1`,children:[(0,K.jsx)(H_,{size:11,className:`text-destructive`}),a(`common.delete`),`?`]}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>C(!1),className:`h-8 px-2`,children:(0,K.jsx)(`span`,{className:`text-xs`,children:a(`common.no`)})}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:A,className:`h-8 px-2 text-destructive hover:text-destructive`,children:(0,K.jsx)(`span`,{className:`text-xs font-medium`,children:a(`common.yes`)})})]}):(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:A,className:`h-8 gap-1.5 text-destructive hover:text-destructive`,children:[(0,K.jsx)(V_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:a(`common.delete`)})]})]})]})]}),(0,K.jsx)(`div`,{className:`border-t border-border/60`}),(0,K.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground tracking-tight flex items-center flex-wrap`,children:[(0,K.jsx)(`span`,{className:`tabular-nums`,children:a(`prompts.lines`,{count:w.lines})}),(0,K.jsx)(`span`,{className:`mx-3 h-3 w-px bg-border`,"aria-hidden":!0}),(0,K.jsxs)(`span`,{className:`tabular-nums`,children:[s(w.characters),` `,a(`prompts.characters`)]}),(0,K.jsx)(`span`,{className:`mx-3 h-3 w-px bg-border`,"aria-hidden":!0}),(0,K.jsxs)(`span`,{children:[a(`common.created`).toLowerCase(),` `,o(u.created_at)]}),u.updated_at&&u.updated_at!==u.created_at&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`mx-3 h-3 w-px bg-border`,"aria-hidden":!0}),(0,K.jsxs)(`span`,{children:[a(`common.updated`).toLowerCase(),` `,o(u.updated_at)]})]})]}),(0,K.jsx)(`div`,{className:`bg-muted/30 rounded-lg p-6`,children:(0,K.jsx)(`pre`,{className:`font-mono text-xs leading-relaxed whitespace-pre-wrap max-w-[72ch] text-foreground/90`,children:u.content})})]})})},e)}):(0,K.jsx)(`div`,{className:`h-full flex items-center justify-center`,children:(0,K.jsxs)(`div`,{className:`max-w-[36ch] text-center space-y-2`,children:[(0,K.jsxs)(`div`,{className:`font-mono text-xs text-muted-foreground/60 tracking-tight`,children:[`â `,a(`prompts.title`).toLowerCase()]}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground/70 leading-relaxed`,children:a(`prompts.no_prompts`)})]})})},Zvt=({open:e,onOpenChange:t,onCreated:n})=>{let{createPrompt:r}=Q(),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{e||(a(``),s(``),l(null),d(!1))},[e]),(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsxs)(WC,{className:`sm:max-w-2xl`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{className:`tracking-tight`,children:`New prompt`}),(0,K.jsx)(JC,{children:`Save reusable instructions you can recall from the chat composer.`})]}),c&&(0,K.jsx)(`div`,{className:`text-xs text-destructive bg-destructive/10 px-3 py-2 rounded-md`,children:c}),(0,K.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!(!i.trim()||!o.trim())){d(!0),l(null);try{let e=await r({name:i.trim(),content:o.trim()});n?.(e),t(!1)}catch(e){l(Kb(e,`Failed to create prompt`))}finally{d(!1)}}},className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground block`,children:`N
813ame`}),(0,K.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),className:`w-full px-3 py-2 text-sm border border-input rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-ring`,placeholder:`e.g. Term sheet review`,disabled:u,required:!0,autoFocus:!0})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground block`,children:`Content`}),(0,K.jsx)(`textarea`,{value:o,onChange:e=>s(e.target.value),className:`w-full px-3 py-2 text-xs border border-input rounded-md bg-background min-h-[200px] font-mono leading-relaxed focus:outline-none focus:ring-2 focus:ring-ring`,placeholder:`The literal text the assistant will seeâ¦`,disabled:u,required:!0})]})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>t(!1),disabled:u,children:`Cancel`}),(0,K.jsx)(J,{type:`submit`,disabled:u||!i.trim()||!o.trim(),children:u?`Savingâ¦`:`Save`})]})]})]})})};function Qvt(){let{prompts:e,isLoadingPrompts:t,fetchPrompts:n}=Q(),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(!1),[l,u]=(0,B.useState)(!1),d=eL(),f=BS();(0,B.useEffect)(()=>{n()},[n]);let[p]=Jv(),m=p.get(`id`),[h,g]=(0,B.useState)(void 0);h!==m&&(g(m),m&&(i(m),d&&u(!0)));let _=r!=null&&(e.some(e=>e.id===r)||r===m),v=d?_?r:null:_?r:e[0]?.id??null,y=e.find(e=>e.id===v)??null,b=e=>{i(e),d&&u(!0)},x=t=>{let n=e.findIndex(e=>e.id===t);i(e[n+1]?.id??e[n-1]?.id??e.find(e=>e.id!==t)?.id??null),d&&u(!1)};return(0,K.jsxs)(`div`,{className:`flex flex-row gap-0 h-[calc(100vh-9rem)] min-h-[560px] border border-border/60 rounded-lg overflow-hidden bg-background`,children:[(0,K.jsx)(`div`,{className:`w-full md:w-[360px] md:shrink-0 md:border-r border-border/60 h-full`,children:(0,K.jsx)(Yvt,{prompts:e,selectedId:v,query:a,onQueryChange:o,onSelect:b,onNew:()=>c(!0),isLoading:t,canMutate:f})}),(0,K.jsx)(`div`,{className:`hidden md:block flex-1 min-w-0 px-10 h-full`,children:(0,K.jsx)(Xvt,{promptId:v,summary:y,onAfterDelete:x,canMutate:f})}),(0,K.jsx)(nL,{open:l,onOpenChange:u,children:(0,K.jsxs)(rL,{side:`right`,className:`w-full sm:max-w-full p-0 px-4 overflow-y-auto`,children:[(0,K.jsx)(aL,{className:`sr-only`,children:`Prompt detail`}),(0,K.jsx)(Xvt,{promptId:v,summary:y,onAfterDelete:x})]})}),(0,K.jsx)(Zvt,{open:s,onOpenChange:c,onCreated:e=>i(e.id)})]})}const $vt=()=>`/api/v1/document-tags`,eyt=async e=>Z($vt(),{...e,method:`GET`}),tyt=()=>`/api/v1/document-tags`,nyt=async(e,t)=>Z(tyt(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),ryt=e=>`/api/v1/document-tags/${e}`,iyt=async(e,t,n)=>Z(ryt(e),{...n,method:`PATCH`,headers:{"Content-Type":`application/json`,...n?.headers},body:JSON.stringify(t)}),ayt=e=>`/api/v1/document-tags/${e}`,oyt=async(e,t)=>Z(ayt(e),{...t,method:`DELETE`}),syt=()=>`/api/v1/document-tags/apply`,cyt=async(e,t)=>Z(syt(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)}),lyt=()=>`/api/v1/document-tags/remove`,uyt=async(e,t)=>Z(lyt(),{...t,method:`POST`,headers:{"Content-Type":`application/json`,...t?.headers},body:JSON.stringify(e)});function s0(e,t){let n=n=>!t||t.has(n.id)?{...n,tags:e(n.tags??[])}:n;sk.setState(e=>({documents:e.documents.map(n)})),Q.setState(e=>{let t={};for(let[r,i]of Object.entries(e.kbDocuments))t[r]=i.map(n);return{kbDocuments:t}})}var dyt=e=>t=>t.some(t=>t.id===e.id)?t:[...t,e],fyt=e=>t=>t.filter(t=>t.id!==e);const c0=Pb((e,t)=>({tags:[],isLoading:!1,fetchTags:async()=>{e({isLoading:!0});try{e({tags:(await eyt()).data,isLoading:!1})}catch(t){X(t,{operation:`fetch_document_tags`}),e({isLoading:!1})}},createTag:async t=>{let n=(await nyt(t)).data;return e(e=>({tags:[...e.tags,n]})),n},renameTag:async(t,n)=>{let r=(await iyt(t,n)).data;e(e=>({tags:e.tags.map(e=>e.id===t?r:e)})),s0(e=>e.map(e=>e.id===t?{id:t,name:r.name,color:r.color}:e))},deleteTag:async t=>{await oyt(t),e(e=>({tags:e.tags.filter(e=>e.id!==t)})),s0(fyt(t))},applyTag:async({document_ids:e,tag_id:n,name:r,color:i})=>{let{tag:a,document_ids:o}=(await cyt({document_ids:e,tag_id:n,name:r,color:i})).data;return s0(dyt(a),new Set(o)),await t().fetchTags(),a},removeTag:async(e,n)=>{let{document_ids:r}=(await uyt({tag_id:e,document_ids:n})).data;s0(fyt(e),new Set(r)),await t().fetchTags()}}));var l0=20,pyt=l0*1024*1024;function myt({onUploadComplete:e,kbId:t}={}){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(!1),c=(0,B.useRef)(null),{uploadDocument:l,uploadDocumentToKB:u,uploadProgress:d,batchUploads:f,isBatchUploading:p,uploadMultipleToKB:m,cancelBatchUpload:h,clearBatchUploads:g,error:_,clearError:v}=sk(),y=e=>ak(e)?e.size>pyt?`File too large. Maximum size: ${l0}MB`:null:`Invalid file type. Allowed: ${ok}`,b=(0,B.useCallback)(async n=>{if(a(null),v(),n.length===0)return;let r=o?`reference`:`index`;if(n.length===1){let i=n[0],o=y(i);if(o){a(o);return}if(t)await u(i,t,r),e?.({id:``,filename:i.name});else{let t=await l(i,r);
813t&&e?.({id:t.id,filename:t.original_filename})}return}t?m(n,t,r):m(n,``,r)},[l,u,m,v,t,e,o]),x=e=>{e.preventDefault(),r(!0)},S=e=>{e.preventDefault(),r(!1)},C=(0,B.useCallback)(e=>{e.preventDefault(),r(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&b(t)},[b]),w=()=>{let e=document.createElement(`input`);e.type=`file`,e.multiple=!0,e.accept=ik,e.onchange=e=>{let t=e.target.files;t&&t.length>0&&b(Array.from(t))},e.click()},T=e=>{e.stopPropagation(),c.current.value=``,c.current.click()},E=(0,B.useCallback)(e=>{let t=e.target.files;t&&t.length>0&&b(Array.from(t))},[b]),D=d!==null,O=D||p,k=i||_,A=f.filter(e=>e.status===`completed`||e.status===`failed`).length,j=f.length,M=f.filter(e=>e.status===`failed`),N=j>0?Math.round(f.reduce((e,t)=>e+t.progress,0)/j):0;return(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`input`,{ref:c,type:`file`,webkitdirectory:``,className:`hidden`,onChange:E}),(0,K.jsxs)(`div`,{className:` 814 border-2 border-dashed rounded-lg p-6 text-center cursor-pointer 815 transition-colors duration-200 816 ${n?`border-primary bg-primary/5`:`border-muted-foreground/25 hover:border-primary/50`} 817 ${O?`pointer-events-none opacity-50`:``} 818 `,onDragOver:x,onDragLeave:S,onDrop:C,onClick:O?void 0:w,children:[(0,K.jsx)(W_,{className:`h-8 w-8 mx-auto mb-2 text-muted-foreground`}),D?(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Uploading... `,d,`%`]}),(0,K.jsx)(`div`,{className:`w-full bg-muted rounded-full h-2`,children:(0,K.jsx)(`div`,{className:`bg-primary h-2 rounded-full transition-all duration-300`,style:{width:`${d}%`}})})]}):p?(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Uploading `,A,`/`,j,` files... `,N,`%`]}),(0,K.jsx)(`div`,{className:`w-full bg-muted rounded-full h-2`,children:(0,K.jsx)(`div`,{className:`bg-primary h-2 rounded-full transition-all duration-300`,style:{width:`${N}%`}})}),(0,K.jsx)(J,{variant:`ghost`,size:`xs`,className:`pointer-events-auto`,onClick:e=>{e.stopPropagation(),h(),g()},children:`Cancel`})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:`Drop files here or click to upload`}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Office, PDF, text & images (max `,l0,`MB)`]}),(0,K.jsxs)(J,{variant:`ghost`,size:`xs`,className:`mt-2 text-xs text-muted-foreground`,onClick:T,children:[(0,K.jsx)(o_,{size:14,className:`mr-1`}),`Upload folder`]})]})]}),!t&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(mP,{id:`reference-only`,size:`sm`,checked:o,onCheckedChange:s,disabled:O}),(0,K.jsx)(pP,{htmlFor:`reference-only`,className:`text-xs font-normal text-muted-foreground`,children:`Reference only`}),(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsx)(u_,{className:`h-3.5 w-3.5 cursor-help text-muted-foreground`})}),(0,K.jsx)(GT,{children:`Stored and downloadable, but not indexed or searchable`})]})]}),!p&&f.length>0&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 p-2 rounded`,children:[(0,K.jsxs)(`span`,{className:`flex-1`,children:[A-M.length,` uploaded`,M.length>0&&(0,K.jsxs)(`span`,{className:`text-destructive`,children:[`, `,M.length,` failed`]})]}),(0,K.jsx)(J,{variant:`ghost`,size:`xs`,onClick:g,children:(0,K.jsx)(J_,{className:`h-3 w-3`})})]}),k&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-red-500 bg-red-50 p-2 rounded`,children:[(0,K.jsx)(`span`,{className:`flex-1`,children:k}),(0,K.jsx)(J,{variant:`ghost`,size:`xs`,onClick:()=>{a(null),v()},children:(0,K.jsx)(J_,{className:`h-4 w-4`})})]})]})}const u0=[`#ef4444`,`#f97316`,`#eab308`,`#22c55e`,`#06b6d4`,`#3b82f6`,`#8b5cf6`,`#ec4899`,`#6b7280`];function hyt(e){let t=new Set(e.filter(Boolean));return u0.find(e=>!t.has(e))??u0[e.length%u0.length]}function gyt({trigger:e,appliedCounts:t,targetCount:n,onApply:r,onRemove:i,align:a=`end`}){let{t:o}=V(),s=c0(e=>e.tags),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(!1),m=u.trim(),h=m?s.filter(e=>e.name.toLowerCase().includes(m.toLowerCase())):s,g=s.some(e=>
818e.name.toLowerCase()===m.toLowerCase()),_=async(e,t)=>{if(!f){p(!0);try{await e()}catch(e){Y(e,o(`document_tags.apply_failed`),{operation:t})}finally{p(!1)}}},v=e=>{let a=n>0&&(t.get(e)??0)===n;_(()=>a?i(e):r({tagId:e}),`toggle_document_tag`)};return(0,K.jsxs)(aP,{open:c,onOpenChange:l,children:[(0,K.jsx)(oP,{asChild:!0,children:e}),(0,K.jsx)(sP,{className:`w-64 p-0`,align:a,onClick:e=>e.stopPropagation(),children:(0,K.jsxs)(XO,{shouldFilter:!1,children:[(0,K.jsx)(ZO,{placeholder:o(`document_tags.search_or_create`),value:u,onValueChange:d}),(0,K.jsxs)(QO,{children:[h.length===0&&!m&&(0,K.jsx)($O,{children:o(`document_tags.none_yet`)}),(0,K.jsxs)(ek,{children:[h.map(e=>{let r=t.get(e.id)??0,i=r===0?`none`:r===n?`all`:`some`;return(0,K.jsxs)(nk,{value:e.id,onSelect:()=>v(e.id),disabled:f,children:[(0,K.jsx)(`span`,{className:`h-2.5 w-2.5 shrink-0 rounded-full`,style:{backgroundColor:e.color??`var(--muted-foreground)`}}),(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:e.name}),i===`all`&&(0,K.jsx)(Lg,{className:`h-4 w-4`}),i===`some`&&(0,K.jsx)(tse,{className:`h-4 w-4 text-muted-foreground`})]},e.id)}),m&&!g&&(0,K.jsxs)(nk,{value:`__create__${m}`,onSelect:()=>{m&&_(async()=>{await r({name:m,color:hyt(s.map(e=>e.color))}),d(``)},`create_document_tag`)},disabled:f,children:[(0,K.jsx)(T_,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`truncate`,children:o(`document_tags.create_named`,{name:m})})]})]})]}),(0,K.jsx)(`p`,{className:`border-t px-3 py-2 text-[11px] leading-snug text-muted-foreground`,children:o(`document_tags.limitation_note`)})]})})]})}function _yt(e){return e.query!==``||e.statuses.size>0||e.types.size>0||e.tagIds.size>0}var vyt={completed:`completed`,pending:`processing`,processing:`processing`,failed:`failed`,failed_twice:`failed`,reference_only:`reference`};const yyt=[`pdf`,`word`,`spreadsheet`,`presentation`,`image`,`text`];var byt={pdf:`pdf`,docx:`word`,doc:`word`,rtf:`word`,xlsx:`spreadsheet`,xls:`spreadsheet`,csv:`spreadsheet`,pptx:`presentation`,ppt:`presentation`,png:`image`,jpg:`image`,jpeg:`image`,gif:`image`,webp:`image`,bmp:`image`,tiff:`image`,tif:`image`,heic:`image`,heif:`image`,svg:`image`,txt:`text`,md:`text`};function d0(e,t){if(t.query!==``&&!e.original_filename.toLowerCase().includes(t.query.toLowerCase()))return!1;if(t.statuses.size>0){let n=vyt[e.status];if(!n||!t.statuses.has(n))return!1}if(t.types.size>0){let n=byt[e.file_type?.toLowerCase()??``];if(!n||!t.types.has(n))return!1}return!(t.tagIds.size>0&&!(e.tags??[]).some(e=>t.tagIds.has(e.id)))}function f0(e,t){return!(t.statuses.size>0||t.types.size>0||t.tagIds.size>0||t.query!==``&&!e.name.toLowerCase().includes(t.query.toLowerCase()))}function xyt(e,t){return t.query!==``&&e.name.toLowerCase().includes(t.query.toLowerCase())}var Syt=new Set([`docx`,`doc`,`rtf`,`pptx`,`ppt`]);function Cyt(e){let t=e.toLowerCase(),n=t.lastIndexOf(`.`);return n===-1?``:t.slice(n+1)}function wyt({documentId:e,filename:t,status:n}){let{t:r}=V(),i=Cyt(t),a=n===`completed`,o=i===`docx`&&a,s=Syt.has(i)&&a,[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(!1),f=async()=>{try{await KH(e)}catch(e){Y(e,r(`errors.download_failed`),{operation:`download_document`})}},p=async()=>{try{GH((await ex(e,{preview:!0,attachment:!0})).data.download_url)}catch(e){Y(e,r(`errors.download_failed`),{operation:`download_document`})}},m=async t=>{try{GH((await Xge(e,t)).download_url)}catch(e){Y(e,r(`errors.download_failed`),{operation:`download_document`})}},h=async()=>{if(!(c!==null||u)){d(!0);try{l((await bx(e)).versions)}catch(e){X(e,{operation:`list_versions`}),l([])}finally{d(!1)}}},g=c?[...c].reverse():[];return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(VD,{onClick:e=>{e.stopPropagation(),f()},children:[(0,K.jsx)(Xg,{size:14,className:`mr-2`}),r(`common.download_original`)]}),o&&(0,K.jsxs)(GD,{onOpenChange:e=>{e&&h()},children:[(0,K.jsxs)(KD,{children:[(0,K.jsx)(c_,{size:14,className:`mr-2`}),r(`common.download_version`)]}),(0,K.jsxs)(qD,{children:[u&&(0,K.jsx)(`div`,{className:`flex justify-center py-2`,children:(0,K.jsx)(W,{className:`h-4 w-4 animate-spin text-muted-foreground`})}),!u&&g.length===0&&(0,K.jsx)(VD,{disabled:!0,children:r(`common.no_versions`)}),!u&&g.map(e=>(0,K.jsx)(VD,{onClick:t=>{t.stopPropagation(),m(e.id)},children:`v${e.version_number}${e.label?` â `+e.label:``}`},e.id))]})]}),s&&(0,K.jsxs)(VD,{onClick:e=>{e.stopPropagation(),p()},children:[(0,K.jsx)(i_,{size:14,className:`mr-2`}),r(`common.download_as_pdf`)]})]})}function Tyt({documentId:e,filename:t,status:n}){let{t:r}=V();return(0,K.jsxs)(LD,{children:[(0,K.jsx)(RD,{asChild:!0,children:(0,K.jsxs)(J,{size:`sm`,variant:`outline`,className:`gap-1.5`,children:[(0,K.jsx)(Xg,{size:14}),(0,K.jsx)(`span`,{className:`text-xs`,children:r(`common.download`)})]})}),(0,K.jsx)(zD,{align:`start`,children:(0,K.jsx)(wyt,{documentId:e,filename:t,status:n})})]})}function Eyt({tag:e,onRemove:t}){return(0,K.jsxs)(`span`,{className:`inline-flex max-w-[10rem] items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-foreground`,title:e.name,children:[(0,K.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full`,style:{backgroundColor:e.color??`var(--muted-foreground)`}}),(0,K.jsx)(`span`,{className:`truncate`,children:e.name}),t&&(0,K.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,className:`-mr-0.5 rounded-full text-muted-foreground hover:text-foreground`,onClick:e=>{e.stopPropagation(),t()},children:(0,K.jsx)(J_,{className:`h-3 w-3`})})]})}var Dyt=new Set([`pending`,`processing`,`completed`,`reference_only`]);function Oyt(e){return e.original_filename.toLowerCase().endsWith(`.docx`)&&Dyt.has(e.status)}
818function kyt(e){return(0,K.jsx)(nht(e),{className:`h-4 w-4 text-muted-foreground shrink-0`})}const Ayt=(0,B.memo)(({doc:e,kbId:t,orderedSiblingIds:n,canMutate:r=!0})=>{let{t:i}=V(),a=Q(e=>e.setDragSource),o=Q(e=>e.setDragOverKbId),s=Q(e=>e.removeDocumentFromKB),c=Q(e=>e.viewDocumentInKB),l=Q(t=>t.selectedDocumentIds.has(e.id)),u=Q(e=>e.toggleDocumentSelection),d=sk(e=>e.deleteDocument),f=c0(e=>e.applyTag),p=c0(e=>e.removeTag),m=LS(e=>e.attachDocument),[h,g]=(0,B.useState)(!1),_=e.tags??[],v=t=>{p(t,[e.id]).catch(t=>Y(t,i(`document_tags.remove_failed`),{operation:`remove_document_tag`,metadata:{docId:e.id}}))},y=n=>{n.dataTransfer.setData(`application/x-document`,JSON.stringify({documentId:e.id,filename:e.original_filename,kbId:t??null})),n.dataTransfer.effectAllowed=`move`,a({type:`document`,documentId:e.id,kbId:t??``})},b=()=>{a(null),o(null)},x=async()=>{await d(e.id)},S=()=>{c(e.id,e.original_filename)},C=t=>{u(e.id,{shiftKey:t.shiftKey,orderedSiblingIds:n})},w=Oyt(e);return(0,K.jsxs)(`div`,{draggable:!0,onDragStart:y,onDragEnd:b,onClick:C,onDoubleClick:S,"data-selected":l,className:`flex items-center gap-1.5 px-2 py-1 rounded text-xs hover:bg-muted group/doc cursor-grab data-[selected=true]:bg-accent data-[selected=true]:ring-1 data-[selected=true]:ring-primary/30`,children:[kyt(e.file_type),(0,K.jsx)(`span`,{className:`truncate flex-1 min-w-0`,title:e.original_filename,children:e.original_filename}),(0,K.jsx)(SU,{status:e.status}),e.source===`email`&&(0,K.jsx)(`span`,{className:`inline-flex items-center shrink-0 text-muted-foreground`,title:i(`documents.from_email`),"aria-label":i(`documents.from_email`),children:(0,K.jsx)(__,{size:12})}),(0,K.jsx)(spt,{docId:e.id,categoryKey:e.category_key,canMutate:r}),_.map(e=>(0,K.jsx)(Eyt,{tag:e,onRemove:r?()=>v(e.id):void 0},e.id)),r&&(0,K.jsx)(gyt,{trigger:(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,className:`opacity-0 group-hover/doc:opacity-100 shrink-0`,title:i(`document_tags.add`),onClick:e=>e.stopPropagation(),children:(0,K.jsx)(z_,{size:12})}),appliedCounts:new Map(_.map(e=>[e.id,1])),targetCount:1,onApply:async t=>{await f({document_ids:[e.id],...t})},onRemove:t=>p(t,[e.id])}),w&&r&&(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,className:`opacity-0 group-hover/doc:opacity-100 shrink-0 text-blue-500 hover:text-blue-700 hover:bg-blue-50`,onClick:t=>{t.stopPropagation(),Ex.getState().enterRedlineMode(e.id)},title:i(`redline.title`),children:(0,K.jsx)(xoe,{size:12})}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,className:`opacity-0 group-hover/doc:opacity-100 shrink-0`,title:i(`chat.attach_documents`),onClick:t=>{t.stopPropagation(),m({id:e.id,filename:e.original_filename})},children:(0,K.jsx)(v_,{size:12})}),(0,K.jsxs)(LD,{children:[(0,K.jsx)(RD,{asChild:!0,children:(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,className:`opacity-0 group-hover/doc:opacity-100 shrink-0`,onClick:e=>e.stopPropagation(),children:(0,K.jsx)(Qg,{size:12})})}),(0,K.jsxs)(zD,{align:`end`,children:[(0,K.jsxs)(VD,{onClick:e=>{e.stopPropagation(),S()},children:[(0,K.jsx)(t_,{size:14,className:`mr-2`}),i(`common.view`)]}),(0,K.jsxs)(GD,{children:[(0,K.jsxs)(KD,{onClick:e=>e.stopPropagation(),children:[(0,K.jsx)(Xg,{size:14,className:`mr-2`}),i(`common.download`)]}),(0,K.jsx)(qD,{children:(0,K.jsx)(wyt,{documentId:e.id,filename:e.original_filename,status:e.status})})]}),r&&(0,K.jsxs)(VD,{onClick:e=>{e.stopPropagation(),g(!0)},children:[(0,K.jsx)(P_,{size:14,className:`mr-2`}),`Share`]}),t&&r&&(0,K.jsxs)(VD,{onClick:n=>{n.stopPropagation(),s(t,e.id)},children:[(0,K.jsx)(joe,{size:14,className:`mr-2`}),i(`knowledge_bases.remove_from_kb`)]}),(0,K.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:(0,K.jsx)(lPe,{subject:{type:`document`,id:e.id,label:i(`report_issue.document`,{filename:Ab(e.original_filename)})}})}),r&&(0,K.jsxs)(VD,{className:`text-destructive`,onClick:e=>{e.stopPropagation(),x()},children:[(0,K.jsx)(V_,{size:14,className:`mr-2`}),i(`common.delete`)]})]})]}),h&&(0,K.jsx)(dR,{resourceType:`document`,resourceId:e.id,resourceName:e.original_filename,open:!0,onOpenChange:g})]})}),jyt=(0,B.memo)(({playbook:e,kbId:t,canMutate:n=!0})=>{let r=Sv(),i=Q(e=>e.setDragSource),a=Q(e=>e.setDragOverKbId),o=Q(e=>e.removePlaybookFromKB),s=Q(e=>e.removePlaybookFromAllKBs),c=JI(e=>e.deletePlaybook),l=JI(e=>e.selectPlaybook),u=n=>{n.dataTransfer.setData(`application/x-playbook`,JSON.stringify({playbookId:e.id,name:e.name,kbId:t??null})),n.dataTransfer.effectAllowed=`move`,i({type:`playbook`,playbookId:e.id,kbId:t??``})},d=()=>{i(null),a(null)},f=()=>{l(e.id),r(`/vault/playbooks`)},p=async()=>{await c(e.id),s(e.id)};return(0,K.jsxs)(`div`,{draggable:!0,onDragStart:u,onDragEnd:d,onDoubleClick:f,className:`flex items-center gap-1.5 px-2 py-1 rounded text-xs hover:bg-muted group/playbook cursor-grab`,children:[(0,K.jsx)(e.type===`guid
818ance`?Ag:k_,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,K.jsx)(`span`,{className:`truncate flex-1 min-w-0`,title:e.name,children:e.name}),(0,K.jsxs)(LD,{children:[(0,K.jsx)(RD,{asChild:!0,children:(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,className:`opacity-0 group-hover/playbook:opacity-100 shrink-0`,onClick:e=>e.stopPropagation(),children:(0,K.jsx)(Qg,{size:12})})}),(0,K.jsxs)(zD,{align:`end`,children:[(0,K.jsxs)(VD,{onClick:e=>{e.stopPropagation(),f()},children:[(0,K.jsx)(t_,{size:14,className:`mr-2`}),`Open playbook`]}),t&&n&&(0,K.jsxs)(VD,{onClick:n=>{n.stopPropagation(),o(t,e.id)},children:[(0,K.jsx)(joe,{size:14,className:`mr-2`}),`Remove from KB`]}),n&&(0,K.jsxs)(VD,{className:`text-destructive`,onClick:e=>{e.stopPropagation(),p()},children:[(0,K.jsx)(V_,{size:14,className:`mr-2`}),`Delete playbook`]})]})]})]})}),Myt=(0,B.memo)(({kb:e,isDragOver:t,uploadingKbId:n,onStartEdit:r,onUploadFiles:i,onUploadFolder:a,filter:o,forceOpen:s})=>{let{t:c}=V(),l=Q(t=>t.expandedKBs.has(e.id)),u=Q(t=>t.kbDocuments[e.id]),d=Q(t=>t.kbDocumentsLoading[e.id]??!1),f=Q(t=>t.kbPlaybooks[e.id]),p=Q(t=>t.kbPlaybooksLoading[e.id]??!1),m=Q(e=>e.toggleExpandKB),h=Q(e=>e.setDragOverKbId),g=Q(e=>e.moveDocumentBetweenKBs),_=Q(e=>e.addDocumentToKB),v=Q(e=>e.movePlaybookBetweenKBs),y=Q(e=>e.addPlaybookToKB),b=Q(e=>e.deleteKnowledgeBase),x=Q(e=>e.selectAllInGroup),S=sk(e=>e.uploadDocumentToKB),C=sk(e=>e.batchUploads),w=sk(e=>e.isBatchUploading),T=sk(e=>e.cancelBatchUpload),E=sk(e=>e.clearBatchUploads),D=sk(e=>e.error),O=(0,B.useRef)(0),k=RS(),A=!e.org_id||zS(k,`member`),j=(u??[]).filter(e=>d0(e,o)),M=(f??[]).filter(e=>f0(e,o)),N=j.map(e=>e.id),P=u==null?e.document_count:u.length,F=C.filter(e=>e.status===`completed`||e.status===`failed`).length,I=C.length,L=C.filter(e=>e.status===`failed`),ee=I>0?Math.round(C.reduce((e,t)=>e+t.progress,0)/I):0,R=t=>{if(t.preventDefault(),O.current+=1,O.current===1){let t=Q.getState().dragSource;t&&t.kbId!==e.id&&h(e.id)}},te=e=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`},ne=()=>{O.current=Math.max(0,O.current-1),O.current===0&&h(null)},re=t=>{t.preventDefault(),O.current=0,h(null);let n=t.dataTransfer.getData(`application/x-document`),r=t.dataTransfer.getData(`application/x-playbook`);try{if(n){let t=JSON.parse(n);t.kbId&&t.kbId!==e.id?g(t.kbId,e.id,t.documentId):t.kbId||_(e.id,t.documentId)}else if(r){let t=JSON.parse(r);t.kbId&&t.kbId!==e.id?v(t.kbId,e.id,t.playbookId):t.kbId||y(e.id,t.playbookId)}}catch{}},ie=async t=>{t.stopPropagation(),await b(e.id)},z=()=>{let t=document.createElement(`input`);t.type=`file`,t.accept=ik,t.onchange=t=>{let n=t.target.files?.[0];n&&S(n,e.id)},t.click()};return(0,K.jsx)(PI,{open:s||l,onOpenChange:()=>m(e.id),children:(0,K.jsxs)(`div`,{className:`rounded transition-colors ${t?`ring-2 ring-primary bg-primary/5`:``}`,onDragEnter:R,onDragOver:te,onDragLeave:ne,onDrop:re,children:[(0,K.jsx)(FI,{asChild:!0,children:(0,K.jsxs)(`div`,{className:`w-full text-left px-2 py-1.5 rounded text-xs hover:bg-muted group/kb flex items-center justify-between cursor-pointer`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0 flex-1`,children:[(0,K.jsx)(Bg,{size:14,className:`shrink-0 transition-transform duration-200 ${l?`rotate-90`:``}`}),(0,K.jsx)(`span`,{className:`truncate`,children:e.name}),e.org_id&&(0,K.jsx)(lP,{label:`Team`}),P!=null&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:c(`knowledge_bases.documents`,{count:P})}),e.playbook_count!=null&&e.playbook_count>0&&(0,K.jsxs)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:[`· `,e.playbook_count]}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,title:c(`common.select_all`),className:`opacity-0 group-hover/kb:opacity-100 shrink-0`,onClick:e=>{e.stopPropagation(),x(N)},children:(0,K.jsx)(m_,{size:12})})]}),A&&(0,K.jsxs)(`div`,{className:`opacity-0 group-hover/kb:opacity-100 shrink-0 ml-1 flex gap-0.5`,children:[(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,title:c(`vault.upload_documents`),disabled:w,onClick:t=>{t.stopPropagation(),i(e.id)},children:(0,K.jsx)(W_,{size:12})}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,title:c(`vault.upload_documents`),disabled:w,onClick:t=>{t.stopPropagation(),a(e.id)},children:(0,K.jsx)(o_,{size:12})}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:t=>{t.stopPropagation(),r(e)},children:(0,K.jsx)(w_,{size:12})}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,className:`text-destructive`,onClick:ie,children:(0,K.jsx)(V_,{size:12})})]})]})}),(0,K.jsxs)(II,{children:[(0,K.jsxs)(`div`,{className:`pl-5 pr-1 pb-1 space-y-0.5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground px-2 pt-1`,children:c(`knowledge_bases.documents`)}),A&&(0,K.jsxs)(`button`,{className:`w-full flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded hover:bg-muted`,onClick:e=>{e.stopPropagation(),z()},children:[(0,K.jsx)(woe,{size:12}),c(`knowledge_bases.add_documents`)]}),d?(0,K.jsx)(`div`,{className:`flex justify-center py-2`,children:(0,K.jsx)(W,{className:`h-3 w-3 animate-spin text-muted-foreground`})}):j.length===0?(0,K.jsx)(`div`,{className:`text-[10px] text-muted-foreground px-2 py-1`,children:c(`knowledge_bases.no_documents`)}):j.map(t=>(0,K.jsx)(Ayt,{doc:t,kbId:e.id,orderedSiblingIds:N,canMutate:A},t.id))]}),(0,K.jsxs)(`div`,{className:`pl-5 pr-1 pb-1 space-y-0.5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground px-2 pt-1`,children:c(`playbook.title`)}),p?(0,K.jsx)(`div`,{className:`flex justify-center py-2`,children:(0,K.jsx)(W,{className:`h-3 w-3 animate-spin text-muted-foreground`})}):M.length===0?(0,K.jsx)(`div`,{className:`text-[10px] text-muted-foreground px-2 py-1`,children:c(`playbook.no_playbooks`)}):M.map(t=>(0,K.jsx)(jyt,{playbook:t,kbId:e.id,canMutate:A},t.id))]})]}),n===e.id&&C.length>0&&(0,K.jsxs)(`div`,{className:`mx-2 mb-1 px-2 py-1.5 rounded border bg-muted/50 space-y-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between text-[10px]`,children:[(0,K.jsxs)(`span`,{className:`text-muted-foreground`,children:[F,`/`,I]}),w&&(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,onClick:e=>{e.stopPropagation(),T(),E()},children:(0,K.jsx)(J_,{size:10})}),!w&&L.length===0&&(0,K.jsx)(`span`,{className:`text-green-600 text-[10px]`,children:c(`common.done`)})]}),(0,K.jsx)(`div`,{className:`h-1 w-full rounded-full bg-muted overflow-hidden`,children:(0,K.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-all duration-200`,style:{width:`${ee}%`}})}),L.length>0&&(0,K.jsxs)(`div`,{className:`text-[10px] text-destructive truncate`,children:[c(`toasts.documents.upload_failed`),`:`,` `,L.map(e=>e.file.name).join(`, `)]}),D&&(0,K.jsx)(`div`,{className:`text-[10px] text-destructive truncate`,children:D})]})]})})}),Nyt=({initialName:e,initialDescription:t,onSave:n,onCancel:r})=>{let{t:i}=V(),[a,o]=(0,B.useState)(e),[s,c]=(0,B.useState)(t);return(0,K.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),a.trim()&&n({name:a,description:s})},className:`px-2 py-1.5 rounded border space-y-1.5`,children:[(0,K.jsx)(`input`,{className:`w-full text-xs px-1.5 py-1 rounded border bg-background`,value:a,onChange:e=>o(e.target.value),placeholder:i(`knowledge_bases.kb_name`),required:!0}),(0,K.jsx)(`textarea`,{className:`w-full text-xs px-1.5 py-1 rounded border bg-background resize-none`,rows:3,value:s,onChange:e=>c(e.target.value),placeholder:i(`knowledge_bases.kb_description`)}),(0,K.jsxs)(`div`,{className:`flex gap-1 justify-end`,children:[(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:r,children:i(`common.cancel`)}),(0,K.jsx)(J,{type:`submit`,size:`sm`,disabled:!a.trim(),children:i(`common.save`)})]})]})},Pyt=({docs:e,playbooks:t,open:n,onOpenChange:r,forceOpen:i=!1})=>{let{t:a}=V(),o=Q(e=>e.selectAllInGroup),s=e.map(e=>e.id),c=e.length+t.length;return(0,K.jsxs)(PI,{open:i||n,onOpenChange:r,children:[(0,K.jsx)(FI,{asChild:!0,children:(0,K.jsx)(`div`,{className:`w-full text-left px-2 py-1.5 rounded text-xs hover:bg-muted group/un
818assigned flex items-center justify-between cursor-pointer mt-2`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0 flex-1`,children:[(0,K.jsx)(Bg,{size:14,className:`shrink-0 transition-transform duration-200 ${n?`rotate-90`:``}`}),(0,K.jsx)(`span`,{className:`truncate`,children:a(`knowledge_bases.unassigned`)}),(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:a(`knowledge_bases.unassigned`,{count:c})}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,title:a(`common.select_all`),className:`opacity-0 group-hover/unassigned:opacity-100 shrink-0`,onClick:e=>{e.stopPropagation(),o(s)},children:(0,K.jsx)(m_,{size:12})})]})})}),(0,K.jsxs)(II,{children:[e.length>0&&(0,K.jsxs)(`div`,{className:`pl-5 pr-1 pb-1 space-y-0.5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground px-2 pt-1`,children:a(`knowledge_bases.documents`)}),e.map(e=>(0,K.jsx)(Ayt,{doc:e,kbId:null,orderedSiblingIds:s},e.id))]}),t.length>0&&(0,K.jsxs)(`div`,{className:`pl-5 pr-1 pb-1 space-y-0.5`,children:[(0,K.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground px-2 pt-1`,children:a(`playbook.title`)}),t.map(e=>(0,K.jsx)(jyt,{playbook:e,kbId:null},e.id))]})]})]})},Fyt=({open:e,count:t,onConfirm:n,onOpenChange:r})=>{let{t:i}=V(),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(null),l=async()=>{o(!0),c(null);try{await n(),r(!1)}catch(e){c(Gb(e,i(`toasts.common.delete_failed`),{operation:`kb.bulkDelete`}))}finally{o(!1)}},u=e=>{a||(e||c(null),r(e))};return(0,K.jsx)(HC,{open:e,onOpenChange:u,children:(0,K.jsxs)(WC,{className:`sm:max-w-md`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:i(`knowledge_bases.bulk_delete.title`,{count:t})}),(0,K.jsx)(JC,{children:i(`knowledge_bases.bulk_delete.description`)})]}),s&&(0,K.jsx)(`div`,{className:`bg-destructive/10 border-destructive/20 rounded-md border p-3`,children:(0,K.jsx)(`p`,{className:`text-destructive text-sm`,children:s})}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`outline`,onClick:()=>u(!1),disabled:a,children:i(`common.cancel`)}),(0,K.jsxs)(J,{variant:`destructive`,onClick:l,disabled:a,children:[a&&(0,K.jsx)(W,{className:`h-4 w-4 animate-spin`}),i(a?`knowledge_bases.bulk_delete.deleting`:`knowledge_bases.bulk_delete.confirm`)]})]})]})})};function Iyt(){let e=Q(e=>e.vaultVisibility),t=Q(e=>e.setVaultVisibility);return Nx(e=>e.user?.current_org_id??null)?(0,K.jsx)($T,{i18nKey:`tour.vault.visibility`,side:`bottom`,children:(0,K.jsxs)(wz,{type:`single`,value:e,onValueChange:e=>{(e===`all`||e===`personal`||e===`team`)&&t(e)},size:`sm`,className:`h-8`,children:[(0,K.jsx)(Tz,{value:`all`,className:`px-3 text-xs`,children:`All`}),(0,K.jsxs)(Tz,{value:`personal`,className:`px-3 text-xs gap-1`,children:[(0,K.jsx)(K_,{className:`size-3`}),`Personal`]}),(0,K.jsxs)(Tz,{value:`team`,className:`px-3 text-xs gap-1`,children:[(0,K.jsx)(Mg,{className:`size-3`}),`Team`]})]})}):null}var Lyt=3e3;const Ryt=({onNewKB:e})=>{let{t}=V(),n=BS(),r=Q(e=>e.knowledgeBases),i=Q(e=>e.vaultVisibility),a=Q(e=>e.isLoadingKnowledgeBases),o=Q(e=>e.expandedKBs),s=Q(e=>e.kbDocuments),c=Q(e=>e.kbPlaybooks),l=Q(e=>e.dragOverKbId),u=Q(e=>e.fetchKnowledgeBases),d=Q(e=>e.updateKnowledgeBase),f=Q(e=>e.fetchKBDocuments),p=Q(e=>e.fetchKBPlaybooks),m=Q(e=>e.addDocumentToKB),h=sk(e=>e.documents),g=sk(e=>e.fetchDocuments),_=JI(e=>e.playbooks),v=JI(e=>e.fetchPlaybooks),y=sk(e=>e.batchUploads),b=sk(e=>e.isBatchUploading),x=sk(e=>e.uploadMultipleToKB),S=sk(e=>e.clearBatchUploads),C=sk(e=>e.deleteDocument),w=Q(e=>e.selectedDocumentIds),T=Q(e=>e.clearDocumentSelection),E=Q(e=>e.selectAllInGroup),D=LS(e=>e.attachDocument),O=c0(e=>e.tags),k=c0(e=>e.fetchTags),A=c0(e=>e.applyTag),j=c0(e=>e.removeTag),[M,N]=(0,B.useState)(``),[P,F]=(0,B.useState)(new Set),[I,L]=(0,B.useState)(new Set),[ee,R]=(0,B.useState)(new Set),te=(0,B.useMemo)(()=>({query:M,statuses:P,types:I,tagIds:ee}),[M,P,I,ee]);(0,B.useEffect)(()=>{k()},[k]);let ne=e=>R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),[re,ie]=(0,B.useState)(null),[z,ae]=(0,B.useState)(null),[oe,se]=(0,B.useState)(!1),[ce,le]=(0,B.useState)(null),[ue,de]=(0,B.useState)(!1),fe=(0,B.useRef)(null),pe=(0,B.useRef)(null),me=(0,B.useRef)(null);(0,B.useEffect)(()=>{u()},[u]),(0,B.useEffect)(()=>{g()},[g]),(0,B.useEffect)(()=>{v()},[v]),(0,B.useEffect)(()=>{for(let e of r)s[e.id]||f(e.id),c[e.id]||p(e.id)},[r,f,p]);let he=new Set(Object.values(s).flat().map(e=>e.id)),ge=h.filter(e=>!he.has(e.id)),_e=new Set(Object.values(c).flat().map(e=>e.id)),ve=_.filter(e=>e.is_current).filter(e=>!_e.has(e.id));(0,B.useEffect)(()=>{let e=Array.from(o).some(e=>(s[e]||[]).some(e=>
818e.status===`pending`||e.status===`processing`)),t=oe&&ge.some(e=>e.status===`pending`||e.status===`processing`);return(e||t)&&(fe.current=window.setInterval(()=>{for(let e of o)(s[e]||[]).some(e=>e.status===`pending`||e.status===`processing`)&&f(e);t&&g()},Lyt)),()=>{fe.current&&=(clearInterval(fe.current),null)}},[o,s,oe,ge,g,f]),(0,B.useEffect)(()=>{if(!b&&ce&&y.length>0){let e=setTimeout(()=>{le(null),S()},3e3);return()=>clearTimeout(e)}},[b,ce,y.length,S]);let ye=async({name:e,description:t})=>{!re||!e.trim()||(await d(re.id,{name:e.trim(),description:t.trim()||void 0}),ie(null))},be=(0,B.useCallback)(e=>{b||(le(e),S(),pe.current.value=``,pe.current.click())},[b,S]),xe=(0,B.useCallback)(e=>{b||(le(e),S(),me.current.value=``,me.current.click())},[b,S]),Se=(0,B.useCallback)(e=>{let t=e.target.files;if(!t||t.length===0||!ce){le(null);return}x(Array.from(t),ce)},[ce,x]),Ce=e=>{e.id&&ae(e)},we=async e=>{z&&(await m(e,z.id),ae(null))},Te=(0,B.useCallback)(()=>{let e=new Map;for(let t of h)e.set(t.id,t.original_filename);for(let t of Object.values(s))for(let n of t)e.has(n.id)||e.set(n.id,n.original_filename);return Array.from(w).filter(t=>e.has(t)).map(t=>({id:t,filename:e.get(t)}))},[h,s,w]),Ee=()=>{for(let e of Te())D(e);T()},De=async()=>{let e=Array.from(w),n=await Promise.all(e.map(e=>C(e)));T(),u(),n.some(e=>!e)&&G.error(t(`errors.document_delete_failed`))},Oe=w.size,ke=(0,B.useMemo)(()=>{let e=new Map;for(let t of h)e.set(t.id,t);for(let t of Object.values(s))for(let n of t)e.has(n.id)||e.set(n.id,n);let t=new Map;for(let n of w)for(let r of e.get(n)?.tags??[])t.set(r.id,(t.get(r.id)??0)+1);return t},[h,s,w]),Ae=i===`personal`?r.filter(e=>!e.org_id):i===`team`?r.filter(e=>!!e.org_id):r,je=_yt(te),Me=je?ge.filter(e=>d0(e,te)):ge,Ne=je?ve.filter(e=>f0(e,te)):ve,Pe=je?Ae.filter(e=>{let t=s[e.id]??[],n=c[e.id]??[];return t.some(e=>d0(e,te))||n.some(e=>f0(e,te))||xyt(e,te)}):Ae,Fe=(0,B.useMemo)(()=>{let e=[];for(let t of Pe){let n=s[t.id]??[];for(let t of n)d0(t,te)&&e.push(t.id)}for(let t of Me)e.push(t.id);return e},[Pe,s,Me,te]),Ie=Fe.length>0&&Fe.every(e=>w.has(e));return(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsx)(Fyt,{open:ue,count:Oe,onConfirm:De,onOpenChange:de}),(0,K.jsx)(`input`,{ref:pe,type:`file`,multiple:!0,accept:ik,className:`hidden`,onChange:Se}),(0,K.jsx)(`input`,{ref:me,type:`file`,webkitdirectory:``,className:`hidden`,onChange:Se}),(0,K.jsx)(myt,{onUploadComplete:Ce}),z&&(0,K.jsxs)(`div`,{className:`border rounded-md p-2 space-y-1.5`,children:[(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Assign`,` `,(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:z.filename}),` `,`to:`]}),(0,K.jsx)(`div`,{className:`space-y-0.5`,children:r.map(e=>(0,K.jsx)(`button`,{className:`w-full text-left text-xs px-2 py-1 rounded hover:bg-muted`,onClick:()=>we(e.id),children:e.name},e.id))}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,className:`w-full text-xs`,onClick:()=>ae(null),children:`Skip`})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold`,children:t(`knowledge_bases.title`)}),Fe.length>0&&(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,title:t(Ie?`common.deselect_all`:`common.select_all`),onClick:()=>E(Fe),children:(0,K.jsx)(m_,{size:14})}),(0,K.jsx)(Iyt,{}),Oe>0&&(0,K.jsxs)(`div`,{className:`flex items-center gap-0.5 ml-auto`,children:[(0,K.jsxs)(`span`,{className:`px-1.5 py-0.5 rounded bg-primary/10 text-primary text-xs font-medium`,children:[Oe,` selected`]}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,title:`Attach to chat`,onClick:Ee,children:(0,K.jsx)(v_,{size:14})}),(0,K.jsx)(gyt,{trigger:(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,title:t(`document_tags.bulk_label`),children:(0,K.jsx)(z_,{size:14})}),appliedCounts:ke,targetCount:Oe,align:`start`,onApply:async e=>{await A({document_ids:Array.from(w),...e})},onRemove:e=>j(e,Array.from(w))}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,className:`text-destructive hover:text-destructive`,title:`Delete`,onClick:()=>de(!0),children:(0,K.jsx)(V_,{size:14})}),(0,K.jsx)(J,{variant:`ghost`,size:`icon-xs`,title:`Clear selection`,onClick:T,children:(0,K.jsx)(J_,{size:14})})]}),n&&(0,K.jsx)(J,{size:`icon`,variant:`ghost`,onClick:e,className:Oe>0?``:`ml-auto`,children:(0,K.jsx)(T_,{size:16})})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(`div`,{className:`relative flex-1 min-w-32`,children:[(0,K.jsx)(A_,{className:`pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,K.jsx)(dP,{className:`pl-8 h-8 text-xs`,placeholder:t(`knowledge_bases.filter_placeholder`),value:M,onChange:e=>N(e.target.value)})]}),(0,K.jsxs)(wz,{type:`multiple`,variant:`outline`,size:`sm`,className:`h-8`,value:Array.from(P),onValueChange:e=>F(new Set(e)),children:[(0,K.jsx)(Tz,{value:`completed`,className:`px-2 text-xs data-[state=on]:bg-primary/15 data-[state=on]:text-primary data-[state=on]:border-primary/40`,children:t(`knowledge_bases.status_completed`)}),(0,K.jsx)(Tz,{value:`processing`,className:`px-2 text-xs data-[state=on]:bg-primary/15 data-[state=on]:text-primary data-[state=on]:border-primary/40`,children:t(`knowledge_bases.status_processing`)}),(0,K.jsx)(Tz,{value:`failed`,className:`px-2 text-xs data-[state=on]:bg-primary/15 data-[state=on]:text-primary data-[state=on]:border-primary/40`,children:t(`knowledge_bases.status_failed`)}),(0,K.jsx)(Tz,{value:`reference`,className:`px-2 text-xs data-[state=on]:bg-primary/15 data-[state=on]:text-primary data-[state=on]:border-primary/40`,children:t(`knowledge_bases.status_reference`)})]}),(0,K.jsx)(wz,{type:`multiple`,variant:`outline`,size:`sm`,className:`h-8`,value:Array.from(I),onValueChange:e=>L(new Set(e)),children:yyt.map(e=>(0,K.jsx)(Tz,{value:e,className:`px-2 text-xs data-[state=on]:bg-primary/15 data-[state=on]:text-primary data-[state=on]:border-primary/40`,children:t(`knowledge_bases.type_${e}`)},e))}),O.length>0&&(0,K.jsxs)(aP,{children:[(0,K.jsx)(oP,{asChild:!0,children:(0,K.jsxs)(J,{variant:`outline`,size:`sm`,className:`h-8 gap-1 px-2 text-xs ${ee.size>0?`border-primary/40 bg-primary/15 text-primary`:``}`,children:[(0,K.jsx)(z_,{size:14}),t(`document_tags.labels`),ee.size>0&&(0,K.jsx)(`span`,{className:`rounded-full bg-primary/20 px-1.5 text-[10px]`,children:ee.size})]})}),(0,K.jsx)(sP,{align:`start`,className:`w-56 p-1`,children:(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[O.map(e=>{let t=ee.has(e.id);return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>ne(e.id),className:`flex items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs hover:bg-muted`,children:[(0,K.jsx)(`span`,{className:`h-2.5 w-2.5 shrink-0 rounded-full`,style:{backgroundColor:e.color??`var(--muted-foreground)`}}),(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:e.name}),(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.document_count}),t&&(0,K.jsx)(Lg,{className:`h-3.5 w-3.5`})]},e.id)}),ee.size>0&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>R(new Set),className:`mt-1 border-t px-2 py-1.5 text-left text-xs text-muted-foreground hover:bg-muted`,children:t(`document_tags.clear_filter`)})]})})]})]}),a?(0,K.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,K.jsx)(W,{className:`h-4 w-4 animate-spin text-muted-foreground`})}):(0,K.jsxs)(`div`,{className:`space-y-0.5`,children:[Pe.map(e=>re?.id===e.id?(0,K.jsx)(Nyt,{initialName:re.name,initialDescription:re.description||``,onSave:ye,onCancel:()=>ie(null)},e.id):(0,K.jsx)(Myt,{kb:e,isDragOver:l===e.id,uploadingKbId:ce,onStartEdit:ie,onUploadFiles:be,onUploadFolder:xe,filter:te,forceOpen:je},e.id)),Pe.length===0&&Me.length===0&&Ne.length===0&&(0,K.jsx)(`div`,{className:`text-center text-muted-foreground text-xs py-4`,children:t(je?`knowledge_bases.no_filter_results`:`knowledge_bases.no_kbs`)}),(Me.length>0||Ne.length>0)&&(0,K.jsx)(Pyt,{docs:Me,playbooks:Ne,open:oe,onOpenChange:se,forceOpen:je})]})]})},zyt=({onBack:e})=>{let{createKnowledgeBase:t}=Q(),[n,r]=(0,B.useState)(``),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(null),[c,l]=(0,B.useState)(!1);return(0,K.jsxs)(`div`,{className:`new-kb-form`,children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:e,className:`mb-4`,children:[(0,K.jsx)(Tg,{size:14,className:`mr-1`}),(0,K.jsx)(`span`,{className:`text-xs`,children:`Knowledge Bases`})]}),(0,K.jsx)(`h2`,{className:`text-sm font-semibold mb-4`,children:`New Knowledge Base`}),(0,K.jsxs)(`form`,{onSubmit:async o=>{if(o.preventDefault(),n.trim()){l(!0),s(null);try{await t({name:n.trim(),description:i.trim()||void 0}),r(``),a(``),e()}catch(e){s(Kb(e,`Failed to create knowledge base`))}finally{l(!1)}}},className:`space-y-3`,children:[o&&(0,K.jsx)(`div`,{className:`text-sm text-red-500 bg-red-50 p-2 rounded-md`,children:o}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-xs text-muted-foreground block mb-1`,children:`N
818ame`}),(0,K.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),className:`w-full px-2 py-1.5 text-xs border rounded-md`,placeholder:`Enter knowledge base name...`,disabled:c,required:!0})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{className:`text-xs text-muted-foreground block mb-1`,children:`Description`}),(0,K.jsx)(`textarea`,{value:i,onChange:e=>a(e.target.value),className:`w-full px-2 py-1.5 text-xs border rounded-md min-h-20`,placeholder:`Enter description (optional)...`,disabled:c})]}),(0,K.jsx)(J,{type:`submit`,size:`sm`,className:`w-full`,disabled:c||!n.trim(),children:c?`Saving...`:`Save`})]})]})};function Byt(){let[e,t]=(0,B.useState)(!1);return e?(0,K.jsx)(zyt,{onBack:()=>t(!1)}):(0,K.jsx)(Ryt,{onNewKB:()=>t(!0)})}const Vyt=({personas:e,selectedId:t,query:n,onQueryChange:r,onSelect:i,onNew:a,isLoading:o,canMutate:s=!0})=>{let{t:c}=V(),l=n.trim().toLowerCase(),u=l?e.filter(e=>e.name.toLowerCase().includes(l)||(e.description??``).toLowerCase().includes(l)):e;return(0,K.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,K.jsxs)(`div`,{className:`px-6 pt-6 pb-4 space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold tracking-tight`,children:c(`personas.personas`)}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:c(`personas.subtitle`)})]}),s&&(0,K.jsxs)(J,{size:`sm`,variant:`outline`,onClick:a,className:`shrink-0 h-8 gap-1.5`,children:[(0,K.jsx)(T_,{size:14}),(0,K.jsx)(`span`,{className:`text-xs`,children:c(`personas.new_persona`)})]})]}),(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(A_,{size:13,className:`absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none`}),(0,K.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:c(`personas.search_placeholder`),className:`w-full h-8 pl-8 pr-2.5 text-xs bg-muted/40 border border-transparent rounded-md placeholder:text-muted-foreground focus:outline-none focus:bg-background focus:border-input`})]})]}),(0,K.jsx)(`div`,{className:`border-t border-border/60`}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:o?(0,K.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,K.jsx)(W,{className:`h-4 w-4 animate-spin text-muted-foreground`})}):e.length===0?(0,K.jsxs)(`div`,{className:`px-6 py-12 text-center`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c(`personas.no_personas`)}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground/70 mt-1`,children:c(`personas.empty_hint`)})]}):u.length===0?(0,K.jsx)(`div`,{className:`px-6 py-12 text-center`,children:(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c(`personas.no_match`,{query:n})})}):(0,K.jsx)(QN.ul,{initial:`hidden`,animate:`visible`,variants:{visible:{transition:{staggerChildren:.018}}},children:u.map((e,n)=>{let r=e.id===t;return(0,K.jsx)(QN.li,{variants:{hidden:{opacity:0,y:4},visible:{opacity:1,y:0}},transition:{duration:.18,ease:`easeOut`},children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:`group relative w-full text-left px-6 py-3.5 border-b border-border/60 transition-all duration-150 cursor-pointer focus:outline-none focus-visible:bg-muted/40 ${r?`bg-muted/40`:`hover:bg-muted/30 hover:translate-x-[2px]`}`,children:[r&&(0,K.jsx)(`span`,{"aria-hidden":!0,className:`absolute left-0 top-2 bottom-2 w-[2px] rounded-r bg-persona`}),(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsxs)(`span`,{className:`font-mono text-[10px] tracking-tight text-muted-foreground/70 shrink-0 tabular-nums pt-1`,"aria-hidden":!0,children:[`â `,String(n+1).padStart(2,`0`)]}),(0,K.jsx)(cP,{id:e.id,name:e.name,size:`sm`,className:`mt-0.5`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium leading-tight truncate`,children:e.name}),e.is_default?(0,K.jsx)(uP,{}):null,e.org_id?(0,K.jsx)(lP,{}):null]}),e.description?(0,K.jsx)(`div`,{className:`text-xs text-muted-foreground truncate mt-0.5`,children:e.description}):null]})]})]})},e.id)})})})]})},Hyt=({personaId:e,summary:t,onAfterDelete:n,onAfterUpdate:r,canMutate:i=!0})=>{let{t:a}=V(),{formatDate:o,formatNumber:s}=jb(),{updatePersona:c,deletePersona:l,setDefaultPersona:u}=Q(),[d,f]=(0,B.useState)(null),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(null),[_,v]=(0,B.useState)(!1),[y,b]=(0,B.useState)(``),[x,S]=(0,B.useState)(``),[C,w]=(0,B.useState)(``),[T,E]=(0,B.useState)(!1),[D,O]=(0,B.useState)(!1),[k,A]=(0,B.useState)(!1),[j,M]=(0,B.useState)(!1);(0,B.useEffect)(()=>
818{if(!e){f(null),g(null);return}let t=!0;return m(!0),g(null),v(!1),A(!1),$me(e).then(e=>{t&&f(e.data)}).catch(e=>{t&&(f(null),g(Gb(e,a(`personas.load_failed`),{operation:`persona.load`})))}).finally(()=>{t&&m(!1)}),()=>{t=!1}},[e,a]);let N=(0,B.useMemo)(()=>{let e=d?.content??``;return{lines:e.length===0?0:e.split(/\r?\n/).length,characters:e.length,tokens:vP(e)}},[d?.content]),P=async()=>{if(d)try{await navigator.clipboard.writeText(d.content),G.success(a(`toasts.common.copied`))}catch{G.error(a(`toasts.common.copy_failed`))}},F=()=>{d&&tHe(eHe(d.name),d.content)},I=async()=>{if(!d)return;let e=!d.is_default;try{await u(d.id,e),f({...d,is_default:e}),r?.()}catch(e){Y(e,a(`toasts.common.save_failed`),{operation:`persona.set_default`})}},L=()=>{d&&(b(d.name),S(d.description??``),w(d.content),E(!!d.is_default),v(!0),A(!1))},ee=()=>v(!1),R=async()=>{if(d&&!(!y.trim()||!C.trim())){O(!0);try{await c(d.id,{name:y.trim(),description:x.trim(),content:C.trim(),is_default:T}),f({...d,name:y.trim(),description:x.trim(),content:C.trim(),is_default:T,updated_at:new Date().toISOString()}),v(!1),r?.(),G.success(a(`toasts.common.updated`))}catch(e){Y(e,a(`toasts.common.save_failed`),{operation:`persona.update`})}finally{O(!1)}}},te=async()=>{if(d){if(!k){A(!0);return}try{await l(d.id),n(d.id),G.success(a(`toasts.common.deleted`))}catch(e){Y(e,a(`toasts.common.delete_failed`),{operation:`persona.delete`}),A(!1)}}};return e?(0,K.jsx)(lN,{mode:`wait`,children:(0,K.jsx)(QN.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.18,ease:`easeOut`},className:`h-full overflow-y-auto`,children:(0,K.jsx)(`div`,{className:`max-w-[860px] py-10 pr-2`,children:p?(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsx)(LI,{className:`h-9 w-2/3`}),(0,K.jsx)(LI,{className:`h-4 w-1/2`}),(0,K.jsx)(LI,{className:`h-px w-full`}),(0,K.jsx)(LI,{className:`h-4 w-full max-w-md`}),(0,K.jsx)(LI,{className:`h-64 w-full`})]}):h?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[(0,K.jsx)(H_,{size:14}),h]}):d?_?(0,K.jsxs)(`div`,{className:`space-y-5`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-3`,children:[(0,K.jsx)(dP,{value:y,onChange:e=>b(e.target.value),className:`font-serif text-2xl h-auto py-1`,placeholder:a(`personas.name_placeholder`),maxLength:255,disabled:D}),(0,K.jsx)(dP,{value:x,onChange:e=>S(e.target.value),placeholder:a(`personas.description_placeholder`),maxLength:500,disabled:D})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:ee,disabled:D,className:`h-8 gap-1.5`,children:[(0,K.jsx)(J_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:a(`common.cancel`)})]}),(0,K.jsxs)(J,{size:`sm`,onClick:R,disabled:D||!y.trim()||!C.trim(),className:`h-8 gap-1.5`,children:[(0,K.jsx)(Lg,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:a(D?`common.saving`:`common.save`)})]})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-border/60 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,K.jsx)(pP,{htmlFor:`edit-default`,className:`text-sm`,children:a(`personas.set_default`)}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`personas.default_hint`)})]}),(0,K.jsx)(mP,{id:`edit-default`,checked:T,onCheckedChange:E,disabled:D})]}),(0,K.jsx)(hP,{value:C,onChange:e=>w(e.target.value.slice(0,_P)),className:`min-h-[400px] font-mono text-xs leading-relaxed resize-y`,placeholder:a(`personas.content_placeholder`),maxLength:_P,disabled:D}),(0,K.jsx)(yP,{content:C})]}):(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-6`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 flex items-start gap-4`,children:[(0,K.jsx)(cP,{id:d.id,name:d.name,size:`lg`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h1`,{className:`font-serif text-3xl tracking-tight leading-tight`,children:d.name}),d.description?(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:d.description}):null,(d.is_default||d.org_id)&&(0,K.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2`,children:[d.is_default?(0,K.jsx)(uP,{}):null,d.org_id?(0,K.jsx)(lP,{}):null]})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:P,className:`h-8 gap-1.5`,children:[(0,K.jsx)(Yg,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:a(`common.copy`)})]}),(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:F,className:`h-8 gap-1.5`,children:[(0,K.jsx)(Xg,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:a(`personas.download_md`)})]}),i&&(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:I,className:`h-8 gap-1.5`,children:[d.is_default?(0,K.jsx)(Cse,{size:13}):(0,K.jsx)(R_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:d.is_default?a(`personas.unset_default`):a(`personas.set_default`)})]}),i&&(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:L,className:`h-8 gap-1.5`,children:[(0,K.jsx)(w_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:a(`common.edit`)})]}),i&&(k?(0,K.jsxs)(`div`,{className:`flex items-center gap-1 ml-1 pl-2 border-l border-border/60`,children:[(0,K.jsxs)(`span`,{className:`text-[11px] text-muted-foreground inline-flex items-center gap-1`,children:[(0,K.jsx)(H_,{size:11,className:`text-destructive`}),a(`common.delete`),`?`]}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>A(!1),className:`h-8 px-2`,children:(0,K.jsx)(`span`,{className:`text-xs`,children:a(`common.no`)})}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:te,className:`h-8 px-2 text-destructive hover:text-destructive`,children:(0,K.jsx)(`span`,{className:`text-xs font-medium`,children:a(`common.yes`)})})]}):(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:te,className:`h-8 gap-1.5 text-destructive hover:text-destructive`,children:[(0,K.jsx)(V_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:a(`common.delete`)})]}))]})]}),(0,K.jsx)(`div`,{className:`border-t border-border/60`}),(0,K.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground tracking-tight flex items-center flex-wrap gap-y-1`,children:[(0,K.jsx)(`span`,{className:`tabular-nums`,children:a(`prompts.lines`,{count:N.lines})}),(0,K.jsx)(`span`,{className:`mx-3 h-3 w-px bg-border`,"aria-hidden":!0}),(0,K.jsxs)(`span`,{className:`tabular-nums`,children:[s(N.characters),` `,a(`prompts.characters`)]}),(0,K.jsx)(`span`,{className:`mx-3 h-3 w-px bg-border`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`tabular-nums`,children:a(`personas.tokens_estimate`,{tokens:N.tokens})}),(0,K.jsx)(`span`,{className:`mx-3 h-3 w-px bg-border`,"aria-hidden":!0}),(0,K.jsxs)(`span`,{children:[a(`common.created`).toLowerCase(),` `,o(d.created_at)]}),d.updated_at&&d.updated_at!==d.created_at&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`mx-3 h-3 w-px bg-border`,"aria-hidden":!0}),(0,K.jsxs)(`span`,{children:[a(`common.updated`).toLowerCase(),` `,o(d.updated_at)]})]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>M(e=>!e),className:`ml-auto inline-flex items-center gap-1 hover:text-foreground transition-colors`,children:[j?(0,K.jsx)(t_,{size:12}):(0,K.jsx)(doe,{size:12}),a(j?`personas.rendered`:`personas.source`)]})]}),(0,K.jsx)(`div`,{className:`bg-muted/30 rounded-lg p-6`,children:j?(0,K.jsx)(`pre`,{className:`font-mono text-xs leading-relaxed whitespace-pre-wrap max-w-[72ch] text-foreground
818/90`,children:d.content}):(0,K.jsx)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none`,children:(0,K.jsx)(_I,{remarkPlugins:[NI],children:d.content})})})]}):null})},e)}):(0,K.jsx)(`div`,{className:`h-full flex items-center justify-center`,children:(0,K.jsxs)(`div`,{className:`max-w-[36ch] text-center space-y-2`,children:[(0,K.jsxs)(`div`,{className:`font-mono text-xs text-muted-foreground/60 tracking-tight`,children:[`â `,a(`personas.personas`).toLowerCase()]}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground/70 leading-relaxed`,children:a(`personas.no_personas`)})]})})};function Uyt(){let{t:e}=V(),{personas:t,isLoadingPersonas:n,fetchPersonas:r}=Q(),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(!1),f=eL(),p=BS();(0,B.useEffect)(()=>{r()},[r]);let[m]=Jv(),h=m.get(`id`),[g,_]=(0,B.useState)(void 0);g!==h&&(_(h),h&&(a(h),f&&d(!0)));let v=i!=null&&(t.some(e=>e.id===i)||i===h),y=f?v?i:null:v?i:t[0]?.id??null,b=t.find(e=>e.id===y)??null,x=e=>{a(e),f&&d(!0)},S=e=>{let n=t.findIndex(t=>t.id===e);a(t[n+1]?.id??t[n-1]?.id??t.find(t=>t.id!==e)?.id??null),f&&d(!1)};return(0,K.jsxs)(`div`,{className:`flex flex-row gap-0 h-[calc(100vh-9rem)] min-h-[560px] border border-border/60 rounded-lg overflow-hidden bg-background`,children:[(0,K.jsx)(`div`,{className:`w-full md:w-[360px] md:shrink-0 md:border-r border-border/60 h-full`,children:(0,K.jsx)(Vyt,{personas:t,selectedId:y,query:o,onQueryChange:s,onSelect:x,onNew:()=>l(!0),isLoading:n,canMutate:p})}),(0,K.jsx)(`div`,{className:`hidden md:block flex-1 min-w-0 px-10 h-full`,children:(0,K.jsx)(Hyt,{personaId:y,summary:b,onAfterDelete:S,canMutate:p})}),(0,K.jsx)(nL,{open:u,onOpenChange:d,children:(0,K.jsxs)(rL,{side:`right`,className:`w-full sm:max-w-full p-0 px-4 overflow-y-auto`,children:[(0,K.jsx)(aL,{className:`sr-only`,children:e(`personas.detail_sr`)}),(0,K.jsx)(Hyt,{personaId:y,summary:b,onAfterDelete:S,canMutate:p})]})}),(0,K.jsx)(xP,{open:c,onOpenChange:l,onCreated:e=>a(e.id)})]})}var Wyt=40,Gyt=280,Kyt=20;function qyt({open:e,onOpenChange:t,onCreated:n}){let r=RL(e=>e.createCategory),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{e||(a(``),s(``),l(null),d(!1))},[e]),(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsxs)(WC,{className:`sm:max-w-lg`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{className:`tracking-tight`,children:`New email category`}),(0,K.jsx)(JC,{children:`New incoming emails are auto-sorted into this category when they match its description. It's processed like âOtherâ â attachments ingested and a short reply drafted.`})]}),c&&(0,K.jsx)(`div`,{className:`text-xs text-destructive bg-destructive/10 px-3 py-2 rounded-md`,children:c}),(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground block`,children:`Name`}),(0,K.jsx)(`input`,{type:`text`,value:i,maxLength:Wyt,onChange:e=>a(e.target.value),className:`w-full px-3 py-2 text-sm border border-input rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-ring`,placeholder:`e.g. HR`,disabled:u,autoFocus:!0})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground block`,children:`Description`}),(0,K.jsx)(`textarea`,{value:o,maxLength:Gyt,onChange:e=>s(e.target.value),className:`w-full px-3 py-2 text-xs border border-input rounded-md bg-background min-h-[120px] leading-relaxed focus:outline-none focus:ring-2 focus:ring-ring`,placeholder:`What kinds of emails belong here? e.g. hiring, offers, onboarding, PTO/benefits questions`,disabled:u}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`The classifier reads this to decide which emails to file here.`})]})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`ghost`,onClick:()=>t(!1),disabled:u,children:`Cancel`}),(0,K.jsx)(J,{onClick:async()=>{if(i.trim()){d(!0),l(null);try{n(await r({name:i.trim(),description:o.trim()})),t(!1)}catch(e){X(e,{operation:`create_email_category`}),l(Kb(e,`Could not create category`))}finally{d(!1)}}},disabled:u||!i.trim(),children:u?`Savingâ¦`:`Save`})]})]})})}function Jyt({category:e,onAfterDelete:t}
818){let{updateCategory:n,deleteCategory:r}=RL(),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(!1);if((0,B.useEffect)(()=>{a(!1),p(!1)},[e?.id]),!e)return(0,K.jsx)(`div`,{className:`h-full flex items-center justify-center`,children:(0,K.jsxs)(`div`,{className:`max-w-[36ch] text-center space-y-2`,children:[(0,K.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground/60 tracking-tight`,children:`â categories`}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground/70 leading-relaxed`,children:`Select a category to view or edit it, or create a new one.`})]})});let m=()=>{s(e.name),l(e.description),a(!0),p(!1)},h=async()=>{if(o.trim()){d(!0);try{await n(e.id,{name:o.trim(),description:c.trim()}),a(!1),G.success(`Category updated`)}catch(e){Y(e,`Could not save category`,{operation:`emailCategories.update`})}finally{d(!1)}}},g=async()=>{if(!f){p(!0);return}try{await r(e.id),t(e.id),G.success(`Category deleted`)}catch(e){Y(e,`Could not delete category`,{operation:`emailCategories.delete`}),p(!1)}};return i?(0,K.jsxs)(`div`,{className:`py-8 max-w-[720px] space-y-5`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsx)(`input`,{type:`text`,value:o,maxLength:Wyt,onChange:e=>s(e.target.value),className:`flex-1 min-w-0 text-2xl font-semibold tracking-tight bg-transparent border-0 border-b border-border/60 pb-2 focus:outline-none focus:border-foreground
818/40`,placeholder:`Category name`,disabled:u}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:()=>a(!1),disabled:u,className:`h-8 gap-1.5`,children:[(0,K.jsx)(J_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:`Cancel`})]}),(0,K.jsxs)(J,{size:`sm`,onClick:h,disabled:u||!o.trim(),className:`h-8 gap-1.5`,children:[(0,K.jsx)(Lg,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:u?`Savingâ¦`:`Save`})]})]})]}),(0,K.jsxs)(`p`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`key: `,e.key,` · the key never changes, so renaming keeps past emails matched`]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground block`,children:`Description`}),(0,K.jsx)(`textarea`,{value:c,maxLength:Gyt,onChange:e=>l(e.target.value),className:`w-full min-h-[220px] p-4 text-xs leading-relaxed bg-muted/30 border-0 rounded-lg resize-y focus:outline-none focus:ring-2 focus:ring-ring`,placeholder:`What kinds of emails belong here?`,disabled:u}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`The classifier reads this to decide which emails to file here.`})]})]}):(0,K.jsxs)(`div`,{className:`py-8 max-w-[720px] space-y-6`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-6`,children:[(0,K.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight leading-tight min-w-0 flex-1 break-words`,children:e.name}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:m,className:`h-8 gap-1.5`,children:[(0,K.jsx)(w_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:`Edit`})]}),f?(0,K.jsxs)(`div`,{className:`flex items-center gap-1 ml-1 pl-2 border-l border-border/60`,children:[(0,K.jsxs)(`span`,{className:`text-[11px] text-muted-foreground inline-flex items-center gap-1`,children:[(0,K.jsx)(H_,{size:11,className:`text-destructive`}),`Delete?`]}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>p(!1),className:`h-8 px-2`,children:(0,K.jsx)(`span`,{className:`text-xs`,children:`No`})}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:g,className:`h-8 px-2 text-destructive hover:text-destructive`,children:(0,K.jsx)(`span`,{className:`text-xs font-medium`,children:`Yes`})})]}):(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:g,className:`h-8 gap-1.5 text-destructive hover:text-destructive`,children:[(0,K.jsx)(V_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:`Delete`})]})]})]}),(0,K.jsx)(`div`,{className:`border-t border-border/60`}),(0,K.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground tracking-tight`,children:[`key: `,e.key]}),(0,K.jsx)(`div`,{className:`bg-muted/30 rounded-lg p-6`,children:e.description?(0,K.jsx)(`p`,{className:`text-sm leading-relaxed whitespace-pre-wrap max-w-[64ch] text-foreground/90`,children:e.description}):(0,K.jsx)(`p`,{className:`text-sm italic text-muted-foreground`,children:`No description yet. Add one so the classifier knows which emails belong here.`})})]})}function Yyt(){let e=RL(e=>e.categories),t=RL(e=>e.isLoading),n=RL(e=>e.fetchCategories),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(!1);(0,B.useEffect)(()=>{n()},[n]);let s=e.find(e=>e.id===r)??null,c=t=>{let n=e.findIndex(e=>e.id===t);i(e[n+1]?.id??e[n-1]?.id??e.find(e=>e.id!==t)?.id??null)},l=e.length>=Kyt;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`header`,{className:`mb-6`,children:[(0,K.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Email categories`}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground max-w-[70ch]`,children:`Define your own categories. New incoming emails are auto-sorted into the best match â your custom categories plus the four built-ins (Contracts, Finance, Other, Irrelevant). Built-ins can't be edited.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-0 h-[calc(100vh-13rem)] min-h-[480px] border border-border/60 rounded-lg overflow-hidden bg-background`,children:[(0,K.jsxs)(`div`,{className:`w-full md:w-[320px] md:shrink-0 md:border-r border-border/60 h-full flex flex-col`,children:[(0,K.jsxs)(`div`,{className:`px-5 pt-5 pb-4 flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold tracking-tight`,children:`Custom`}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-0.5 tabular-nums`,children:[e.length,` of `,Kyt]})]}),(0,K.jsxs)(J,{size:`sm`,variant:`outline`,onClick:()=>o(!0),disabled:l,className:`shrink-0 h-8 gap-1.5`,children:[(0,K.jsx)(T_,{size:14}),(0,K.jsx)(`span`,{className:`text-xs`,children:`New`})]})]}),(0,K.jsx)(`div`,{className:`border-t border-border/60`}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:t?(0,K.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,K.jsx)(W,{className:`h-4 w-4 animate-spin text-muted-foreground`})}):e.length===0?(0,K.jsxs)(`div`,{className:`px-6 py-12 text-center`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No custom categories yet`}
818),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground/70 mt-1`,children:`Create one to auto-sort matching emails`})]}):(0,K.jsx)(`ul`,{children:e.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:`group flex w-full items-center gap-2.5 px-5 py-3 border-b border-border/60 text-left transition-colors ${e.id===r?`bg-muted/50`:`hover:bg-muted/30`}`,children:[(0,K.jsx)(z_,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.name})]})},e.id))})})]}),(0,K.jsx)(`div`,{className:`flex-1 min-w-0 px-6 md:px-10 h-full overflow-y-auto`,children:(0,K.jsx)(Jyt,{category:s,onAfterDelete:c})})]}),(0,K.jsx)(qyt,{open:a,onOpenChange:o,onCreated:e=>i(e.id)})]})}function Xyt({categoryKey:e,label:t,canMutate:n}){let{t:r}=V(),i=JI(e=>e.playbooks),a=JI(e=>e.fetchPlaybooks),o=JI(e=>e.createPlaybook),s=JI(e=>e.saveAsNewVersion),c=JI(e=>e.deletePlaybook),[l,u]=(0,B.useState)(!1),[d,f]=(0,B.useState)(``),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(null),[y,b]=(0,B.useState)(null),[x,S]=(0,B.useState)(!1);(0,B.useEffect)(()=>{i.length===0&&a()},[]),(0,B.useEffect)(()=>{u(!1),f(``),g(!1)},[e]);let C=i.filter(t=>t.is_current&&t.type===`guidance`&&t.scope===`category`&&t.category_key===e),w=C.length===1?C[0]:null,T=w?.id??null;(0,B.useEffect)(()=>{if(!T){v(null),b(null);return}if(_?.id===T)return;let t=!1;return S(!0),b(null),kXe(T).then(e=>{t||v({id:T,content:e.data.data?.content??``})}).catch(n=>{t||b(Gb(n,r(`errors.fetch_failed`),{operation:`fetch_category_rules_content`,metadata:{categoryKey:e}}))}).finally(()=>{t||S(!1)}),()=>{t=!0}},[T]);let E=()=>{f(``),u(!0)},D=()=>{f(_?.content??``),g(!1),u(!0)},O=async()=>{let n=d.trim();if(n){m(!0);try{w?await s({id:w.id,group_id:w.group_id,version:w.version,name:w.name,contract_type:w.contract_type??void 0,type:`guidance`,scope:`category`,category_key:e,is_current:!0,created_at:w.created_at,categories:[],content:n}):await o({name:r(`document_categories.rules.default_name`,{label:t}),type:`guidance`,content:n,scope:`category`,category_key:e}),u(!1),f(``)}finally{m(!1)}}},k=async()=>{if(w){if(!h){g(!0);return}m(!0);try{await c(w.id),g(!1)}catch(t){Y(t,r(`errors.save_failed`),{operation:`delete_category_rules`,metadata:{categoryKey:e}})}finally{m(!1)}}};return(0,K.jsxs)(`section`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold tracking-tight`,children:r(`document_categories.rules.section_title`)}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5 max-w-[64ch]`,children:r(`document_categories.rules.section_hint`,{label:t})})]}),l?(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`textarea`,{value:d,onChange:e=>f(e.target.value),className:`w-full min-h-[180px] p-4 text-sm leading-relaxed bg-muted/30 border-0 rounded-lg resize-y focus:outline-none focus:ring-2 focus:ring-ring font-mono`,placeholder:r(`document_categories.rules.placeholder`),disabled:p,autoFocus:!0}),(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>{u(!1),f(``)},disabled:p,className:`h-8`,children:(0,K.jsx)(`span`,{className:`text-xs`,children:r(`common.cancel`)})}),(0,K.jsx)(J,{size:`sm`,onClick:O,disabled:p||!d.trim(),className:`h-8`,children:(0,K.jsx)(`span`,{className:`text-xs`,children:r(p?w?`common.saving`:`common.creating`:`common.save`)})})]})]}):C.length===0?(0,K.jsxs)(`div`,{className:`bg-muted/30 rounded-lg p-6 flex flex-col items-start gap-3`,children:[(0,K.jsx)(`p`,{className:`text-sm italic text-muted-foreground`,children:r(`document_categories.rules.empty`)}),n&&(0,K.jsxs)(J,{size:`sm`,variant:`outline`,onClick:E,className:`h-8 gap-1.5`,children:[(0,K.jsx)(T_,{size:14}),(0,K.jsx)(`span`,{className:`text-xs`,children:r(`document_categories.rules.add`)})]})]}):w?(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`div`,{className:`bg-muted/30 rounded-lg p-6`,children:x?(0,K.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,K.jsx)(W,{className:`h-4 w-4 animate-spin text-muted-foreground`})}):y?(0,K.jsx)(`p`,{className:`text-sm text-destructive`,children:y}):_?.content.trim()?(0,K.jsx)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none`,children:(0,K.jsx)(_I,{remarkPlugins:[NI],children:_.content})}):(0,K.jsx)(`p`,{className:`text-sm italic text-muted-foreground`,children:r(`document_categories.rules.empty`)})}),n&&(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:D,disabled:x||p,className:`h-8 gap-1.5`,children:[(0,K.jsx)(w_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:r(`common.edit`)})]}),h?(0,K.jsxs)(`div`,{className:`flex items-center gap-1 ml-1 pl-2 border-l border-border/60`,children:[(0,K.jsxs)(`span`,{className:`text-[11px] text-muted-foreground inline-flex items-center gap-1`,children:[(0,K.jsx)(H_,{size:11,className:`text-destructive`}),r(`document_categories.rules.delete_confirm`)]}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>g(!1),disabled:p,className:`h-8 px-2`,children:(0,K.jsx)(`span`,{className:`text-xs`,children:r(`common.no`)})}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:k,disabled:p,className:`h-8 px-2 text-destructive hover:text-destructive`,children:(0,K.jsx)(`span`,{className:`text-xs font-medium`,children:r(`common.yes`)})})]}):(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:k,disabled:p,className:`h-8 gap-1.5 text-destructive hover:text-destructive`,children:(0,K.jsx)(`span`,{className:`text-xs`,children:r(`common.delete`)})})]})]}):(0,K.jsxs)(`div`,{className:`bg-muted/30 rounded-lg p-6 space-y-3`,children:[(0,K.jsx)(`ul`,{className:`space-y-1.5`,children:C.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsxs)(Gv,{to:`/vault/playbooks`,className:`inline-flex items-center gap-2 text-sm text-foreground
818/90 hover:text-foreground hover:underline`,children:[(0,K.jsx)(i_,{size:13,className:`text-muted-foreground shrink-0`}),(0,K.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`document_categories.rules.multiple_hint`)})]}),(0,K.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[r(`document_categories.rules.account_note`),` `,(0,K.jsxs)(Gv,{to:`/vault/playbooks`,className:`inline-flex items-center gap-0.5 underline hover:text-foreground`,children:[r(`document_categories.rules.manage_in_playbooks`),(0,K.jsx)($g,{size:10})]})]})]})}function Zyt({open:e,onOpenChange:t,onCreated:n}){let{t:r}=V(),i=q$(e=>e.createCategory),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(null),[d,f]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{e||(o(``),c(``),u(null),f(!1))},[e]),(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsxs)(WC,{className:`sm:max-w-lg`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{className:`tracking-tight`,children:r(`document_categories.new`)}),(0,K.jsx)(JC,{children:r(`document_categories.description`)})]}),l&&(0,K.jsx)(`div`,{className:`text-xs text-destructive bg-destructive/10 px-3 py-2 rounded-md`,children:l}),(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground block`,children:r(`document_categories.name`)}),(0,K.jsx)(`input`,{type:`text`,value:a,maxLength:40,onChange:e=>o(e.target.value),className:`w-full px-3 py-2 text-sm border border-input rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-ring`,disabled:d,autoFocus:!0})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground block`,children:r(`document_categories.classifier_hint`)}),(0,K.jsx)(`textarea`,{value:s,maxLength:280,onChange:e=>c(e.target.value),className:`w-full px-3 py-2 text-xs border border-input rounded-md bg-background min-h-[120px] leading-relaxed focus:outline-none focus:ring-2 focus:ring-ring`,placeholder:r(`document_categories.classifier_hint_placeholder`),disabled:d})]})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`ghost`,onClick:()=>t(!1),disabled:d,children:r(`common.cancel`)}),(0,K.jsx)(J,{onClick:async()=>{if(a.trim()){f(!0),u(null);try{n(await i({name:a.trim(),description:s.trim()})),G.success(r(`document_categories.created`)),t(!1)}catch(e){X(e,{operation:`create_document_category`}),u(Kb(e,r(`document_categories.change_failed`)))}finally{f(!1)}}},disabled:d||!a.trim(),children:r(d?`common.saving`:`common.save`)})]})]})})}function Qyt({selection:e,onAfterDelete:t}){let{t:n}=V(),{updateCategory:r,deleteCategory:i}=q$(),a=BS(),o=VS(),[s,c]=(0,B.useState)(!1),[l,u]=(0,B.useState)(``),[d,f]=(0,B.useState)(``),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(!1);if((0,B.useEffect)(()=>{c(!1),g(!1)},[e?.type===`custom`?e.row.id:e?.type===`builtin`?e.key:null]),!e)return(0,K.jsx)(`div`,{className:`h-full flex items-center justify-center`,children:(0,K.jsx)(`p`,{className:`max-w-[36ch] text-center text-xs text-muted-foreground/70 leading-relaxed`,children:n(`document_categories.select_hint`)})});if(e.type===`builtin`)return(0,K.jsxs)(`div`,{className:`py-8 max-w-[720px] space-y-6`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(g_,{size:14,className:`text-muted-foreground`}),(0,K.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:n(`document_categories.builtin_labels.${e.key}`)})]}),(0,K.jsx)(`div`,{className:`border-t border-border/60`}),(0,K.jsx)(`p`,{className:`text-sm italic text-muted-foreground`,children:n(`document_categories.builtin_readonly`)}),(0,K.jsx)(Xyt,{categoryKey:e.key,label:n(`document_categories.builtin_labels.${e.key}`),canMutate:a})]});let _=e.row,v=async()=>{if(l.trim()){m(!0);try{await r(_.id,{name:l.trim(),description:d.trim()}),c(!1),G.success(n(`document_categories.updated`))}catch(e){Y(e,n(`document_categories.change_failed`),{operation:`documentCategories.update`})}finally{m(!1)}}},y=async()=>
818{if(!h){g(!0);return}try{await i(_.id),t(_.id),G.success(n(`document_categories.deleted`))}catch(e){Y(e,n(`document_categories.change_failed`),{operation:`documentCategories.delete`}),g(!1)}};return s?(0,K.jsxs)(`div`,{className:`py-8 max-w-[720px] space-y-5`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsx)(`input`,{type:`text`,value:l,maxLength:40,onChange:e=>u(e.target.value),className:`flex-1 min-w-0 text-2xl font-semibold tracking-tight bg-transparent border-0 border-b border-border/60 pb-2 focus:outline-none focus:border-foreground/40`,disabled:p}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:()=>c(!1),disabled:p,className:`h-8 gap-1.5`,children:[(0,K.jsx)(J_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:n(`common.cancel`)})]}),(0,K.jsxs)(J,{size:`sm`,onClick:v,disabled:p||!l.trim(),className:`h-8 gap-1.5`,children:[(0,K.jsx)(Lg,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:n(p?`common.saving`:`common.save`)})]})]})]}),(0,K.jsxs)(`p`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`key: `,_.key,` · `,n(`document_categories.key_immutable`)]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground block`,children:n(`document_categories.classifier_hint`)}),(0,K.jsx)(`textarea`,{value:d,maxLength:280,onChange:e=>f(e.target.value),className:`w-full min-h-[220px] p-4 text-xs leading-relaxed bg-muted/30 border-0 rounded-lg resize-y focus:outline-none focus:ring-2 focus:ring-ring`,disabled:p})]})]}):(0,K.jsxs)(`div`,{className:`py-8 max-w-[720px] space-y-6`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-6`,children:[(0,K.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight leading-tight min-w-0 flex-1 break-words`,children:_.name}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[a&&(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:()=>{u(_.name),f(_.description),c(!0),g(!1)},className:`h-8 gap-1.5`,children:[(0,K.jsx)(w_,{size:13}),(0,K.jsx)(`span`,{className:`text-xs`,children:n(`common.edit`)})]}),o&&(h?(0,K.jsxs)(`div`,{className:`flex items-center gap-1 ml-1 pl-2 border-l border-border/60`,children:[(0,K.jsxs)(`span`,{className:`text-[11px] text-muted-foreground inline-flex items-center gap-1`,children:[(0,K.jsx)(H_,{size:11,className:`text-destructive`}),n(`common.delete`),`?`]}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>g(!1),className:`h-8 px-2`,children:(0,K.jsx)(`span`,{className:`text-xs`,children:n(`common.no`)})}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:y,className:`h-8 px-2 text-destructive hover:text-destructive`,children:(0,K.jsx)(`span`,{className:`text-xs font-medium`,children:n(`common.yes`)})})]}):(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:y,className:`h-8 gap-1.5 text-destructive hover:text-destructive`,children:(0,K.jsx)(`span`,{className:`text-xs`,children:n(`common.delete`)})}))]})]}),(0,K.jsx)(`div`,{className:`border-t border-border/60`}),(0,K.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground tracking-tight`,children:[`key: `,_.key]}),(0,K.jsx)(`div`,{className:`bg-muted/30 rounded-lg p-6`,children:_.description?(0,K.jsx)(`p`,{className:`text-sm leading-relaxed whitespace-pre-wrap max-w-[64ch] text-foreground/90`,children:_.description}):(0,K.jsx)(`p`,{className:`text-sm italic text-muted-foreground`,children:n(`document_categories.classifier_hint`)})}),(0,K.jsx)(Xyt,{categoryKey:_.key,label:_.name,canMutate:a})]})}function $yt(){let{t:e}=V(),t=q$(e=>e.categories),n=q$(e=>e.isLoading),r=q$(e=>e.fetchCategories),i=BS(),[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(!1);(0,B.useEffect)(()=>{r()},[r]);let l=e=>{let n=t.filter(t=>t.id!==e);o(n[0]?{type:`custom`,row:n[0]}:null)},u=t.length>=20,d=a?.type===`builtin`?a.key:a?.type===`custom`?a.row.id:null;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`header`,{className:`mb-6`,children:[(0,K.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:e(`document_categories.title`)}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground max-w-[70ch]`,children:e(`document_categories.description`)})]}),(0,K.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-0 h-[calc(100vh-13rem)] min-h-[480px] border border-border/60 rounded-lg overflow-hidden bg-background`,children:[(0,K.jsxs)(`div`,{className:`w-full md:w-[320px] md:shrink-0 md:border-r border-border/60 h-full flex flex-col overflow-y-auto`,children:[(0,K.jsx)(`div`,{className:`px-5 pt-5 pb-2`,children:(0,K.jsx)(`h2`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:e(`document_categories.builtin`)})}),(0,K.jsx)(`ul`,{children:W$.map(t=>{let n=t.Icon;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>o({type:`builtin`,key:t.key}),className:`flex w-full items-center gap-2.5 px-5 py-2.5 border-b border-border/40 text-left transition-colors ${d===t.key?`bg-muted/50`:`hover:bg-muted/30`}`,children:[(0,K.jsx)(n,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:e(`document_categories.builtin_labels.${t.key}`)}
818),(0,K.jsx)(g_,{className:`h-3 w-3 text-muted-foreground/60 shrink-0`})]})},t.key)})}),(0,K.jsxs)(`div`,{className:`px-5 pt-5 pb-2 flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h2`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:e(`document_categories.custom`)}),(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground mt-0.5 tabular-nums`,children:e(`document_categories.count_of_max`,{count:t.length,max:20})})]}),i&&(0,K.jsxs)(J,{size:`sm`,variant:`outline`,onClick:()=>c(!0),disabled:u,className:`shrink-0 h-8 gap-1.5`,children:[(0,K.jsx)(T_,{size:14}),(0,K.jsx)(`span`,{className:`text-xs`,children:e(`document_categories.new`)})]})]}),(0,K.jsx)(`div`,{className:`flex-1`,children:n?(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(W,{className:`h-4 w-4 animate-spin text-muted-foreground`})}):t.length===0?(0,K.jsxs)(`div`,{className:`px-6 py-8 text-center`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`document_categories.empty`)}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground/70 mt-1`,children:e(`document_categories.empty_hint`)})]}):(0,K.jsx)(`ul`,{children:t.map(n=>{let r=K$(n.key);return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>o({type:`custom`,row:n}),className:`flex w-full items-center gap-2.5 px-5 py-3 border-b border-border/60 text-left transition-colors ${d===n.id?`bg-muted/50`:`hover:bg-muted/30`}`,children:[(0,K.jsx)(r,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:G$(n.key,t,e)})]})},n.id)})})})]}),(0,K.jsx)(`div`,{className:`flex-1 min-w-0 px-6 md:px-10 h-full overflow-y-auto`,children:(0,K.jsx)(Qyt,{selection:a,onAfterDelete:l})})]}),(0,K.jsx)(Zyt,{open:s,onOpenChange:c,onCreated:e=>o({type:`custom`,row:e})})]})}function ebt(){let e=sk(e=>e.documents),t=sk(e=>e.uploadProgress),n=sk(e=>e.fetchDocuments),r=sk(e=>e.uploadDocument),i=Ex(e=>e.error),[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(!1),[l,u]=(0,B.useState)(``);(0,B.useEffect)(()=>{n()},[n]);let d=(0,B.useMemo)(()=>e.filter(e=>Oyt(e)),[e]),f=(0,B.useMemo)(()=>{let e=l.trim().toLowerCase();return e?d.filter(t=>t.original_filename.toLowerCase().includes(e)):d},[d,l]),p=e=>{Ex.getState().enterRedlineMode(e)},m=(0,B.useCallback)(async e=>{if(!e.name.toLowerCase().endsWith(`.docx`)){o(`Only .docx files can be redlined.`);return}o(null);let t=await r(e);t?.id&&Ex.getState().enterRedlineMode(t.id)},[r]),h=()=>{let e=document.createElement(`input`);e.type=`file`,e.accept=`.docx`,e.onchange=e=>{let t=e.target.files?.[0];t&&m(t)},e.click()},g=e=>{e.preventDefault(),c(!0)},_=e=>{e.preventDefault(),c(!1)},v=e=>{e.preventDefault(),c(!1);let t=e.dataTransfer.files?.[0];t&&m(t)},y=t!==null;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-gray-700`,children:`Pick a document to redline`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-xs text-gray-500`,children:`Or drop a new .docx to start.`})]}),(0,K.jsx)(`div`,{role:`button`,tabIndex:0,onClick:y?void 0:h,onKeyDown:e=>{y||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),h())},onDragOver:g,onDragLeave:_,onDrop:v,className:` 819 cursor-pointer rounded-lg border-2 border-dashed p-4 text-center 820 transition-colors duration-200 821 ${s?`border-primary bg-primary/5`:`border-muted-foreground/25 hover:border-primary/50`} 822 ${y?`pointer-events-none opacity-50`:``} 823 `,children:t===null?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W_,{className:`mx-auto mb-1.5 h-6 w-6 text-muted-foreground`}),(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:`Drop a .docx here or click to upload`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:`.docx only`})]}):(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(W_,{className:`mx-auto h-6 w-6 text-muted-foreground`}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Uploading⦠`,t,`%`]}),(0,K.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,K.jsx)(`div`,{className:`h-full bg-primary transition-all duration-300`,style:{width:`${t}%`}})})]})}),(a??i)&&(0,K.jsxs)(`div`,{className:`flex items-start gap-2 rounded border border-red-200 bg-red-50 p-2 text-xs text-red-700`,children:[(0,K.jsx)(Hg,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,K.jsx)(`span`,{className:`flex-1`,children:a??i})]}),d.length>0&&(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(A_,{className:`pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}
823),(0,K.jsx)(dP,{type:`text`,value:l,onChange:e=>u(e.target.value),placeholder:`Filter documentsâ¦`,className:`h-8 pl-7 text-xs`})]}),d.length===0?(0,K.jsx)(`div`,{className:`rounded border border-dashed border-gray-200 py-4 text-center text-xs text-gray-400`,children:`No .docx documents available yet.`}):f.length===0?(0,K.jsxs)(`div`,{className:`py-2 text-center text-xs text-gray-400`,children:[`No matches for â`,l.trim(),`â.`]}):(0,K.jsx)(`ul`,{className:`space-y-0.5`,children:f.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>p(e.id),className:`flex w-full items-center gap-1.5 rounded px-2 py-1 text-left text-xs hover:bg-muted`,children:[(0,K.jsx)(Eoe,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`flex-1 truncate`,title:e.original_filename,children:e.original_filename})]})},e.id))})]})}function tbt(){let{error:e,clearError:t}=Ex();return(0,K.jsxs)(`div`,{className:`flex h-full flex-col`,children:[e&&(0,K.jsxs)(`div`,{className:`flex items-center justify-between bg-red-50 px-4 py-2 text-sm text-red-700`,children:[(0,K.jsx)(`span`,{children:e}),(0,K.jsx)(`button`,{onClick:t,className:`text-red-400 hover:text-red-600`,children:(0,K.jsx)(J_,{size:14})})]}),(0,K.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:(0,K.jsx)(mpt,{})})]})}function nbt(){return Ex(e=>e.isRedlineMode)?(0,K.jsx)(tbt,{}):(0,K.jsx)(ebt,{})}const rbt=(0,B.createContext)(null);function ibt(){return(0,B.useContext)(rbt)??(()=>{})}function abt(){let{t:e}=V(),t=xv(),[n,r]=(0,B.useState)(null),i=P3e(t.pathname),a=e(i?i.labelKey:`settings.title`),o=i?.descriptionKey?e(i.descriptionKey):e(`settings.description`),s=i?.fullBleed??!1;return(0,K.jsx)(rbt.Provider,{value:r,children:(0,K.jsxs)(`div`,{className:s?`flex h-full overflow-hidden flex-col bg-white`:`flex h-full overflow-y-scroll flex-col bg-white`,children:[(0,K.jsxs)(`div`,{className:`border-b border-gray-100 px-8 py-5`,children:[(0,K.jsx)(`h1`,{className:`text-base font-semibold text-gray-900 tracking-tight`,children:a}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-0.5`,children:o})]}),s?(0,K.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,K.jsx)(Av,{})}):(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,K.jsx)(`div`,{className:`mx-auto max-w-3xl px-8 py-7`,children:(0,K.jsx)(Av,{})})}),(0,K.jsxs)(`div`,{className:`border-t border-gray-100 px-8 py-4 flex items-center justify-between gap-4`,children:[(0,K.jsxs)(Gv,{to:`/privacy`,className:`flex items-center gap-1.5 hover:text-gray-600`,children:[(0,K.jsx)(g_,{size:12,className:`text-gray-300`}),(0,K.jsx)(`span`,{className:`text-xs text-gray-400 hover:text-gray-600 hover:underline`,children:e(`settings.footer_privacy`)})]}),n]})]})})}const obt=[{value:`en`,label:`English`,native:`English`},{value:`es`,label:`Spanish`,native:`Español`},{value:`fr`,label:`French`,native:`Français`},{value:`de`,label:`German`,native:`Deutsch`},{value:`it`,label:`Italian`,native:`Italiano`},{value:`pt`,label:`Portuguese`,native:`Português`},{value:`nl`,label:`Dutch`,native:`Nederlands`},{value:`pl`,label:`Polish`,native:`Polski`},{value:`ru`,label:`Russian`,native:`Ð ÑÑÑкий`},{value:`tr`,label:`Turkish`,native:`Türkçe`},{value:`ar`,label:`Arabic`,native:`Ø§ÙØ¹Ø±Ø¨ÙØ©`},{value:`zh`,label:`Chinese (Simplified)`,native:`䏿`},{value:`ja`,label:`Japanese`,native:`æ¥æ¬èª`},{value:`ko`,label:`Korean`,native:`íêµì´`}],sbt=[{code:`en`,name:`English`,native:`English`},{code:`es`,name:`Spanish`,native:`Español`}];function cbt(e){return typeof e==`string`&&Lae.includes(e)}function lbt(){let e=Nx.getState().user?.preferences?.ui_language;return cbt(e)?e:null}function ubt(){let e=Nx(e=>e.user);(0,B.useEffect)(()=>{if(!e)return;let t=lbt()??`en`;H.language!==t&&H.changeLanguage(t)},[e])}async function dbt(e){await H.changeLanguage(e)}function fbt({open:e,onOpenChange:t,email:n,onConfirm:r}){let[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(null),u=i.trim()===n&&n.length>0&&!o,d=async()=>{s(!0),l(null);try{await r()}catch(e){l(Gb(e,`Failed to delete account`,{operation:`account.delete`})),s(!1)}},f=e=>{o||(e||(a(``),l(null)),t(e))};return(0,K.jsx)(HC,{open:e,onOpenChange:f,children:(0,K.jsxs)(WC,{className:`sm:max-w-md`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:`Delete account?`}),(0,K.jsx)(JC,{children:`This is permanent and cannot be undone. All your documents, conversations, and billing data will be removed.`})]}),(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsxs)(pP,{htmlFor:`delete-account-confirm`,className:`text-sm`,children:[`To confirm, type your email below:`,` `,(0,K.jsx)(`code`,{className:`bg-muted rounded px-1 py-0.5 font-mono text-xs`,children:n})]}),(0,K.jsx)(dP,{id:`delete-account-confirm`,type:`email`,autoComplete:`off`,autoF
823ocus:!0,value:i,onChange:e=>a(e.target.value),disabled:o})]}),c&&(0,K.jsx)(`div`,{className:`bg-destructive/10 border-destructive/20 rounded-md border p-3`,children:(0,K.jsx)(`p`,{className:`text-destructive text-sm`,children:c})}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`outline`,onClick:()=>f(!1),disabled:o,children:`Cancel`}),(0,K.jsxs)(J,{variant:`destructive`,onClick:d,disabled:!u,children:[o&&(0,K.jsx)(W,{className:`h-4 w-4 animate-spin`}),`Delete account`]})]})]})})}var pbt=`image/png,image/jpeg,image/webp,image/gif,image/heic,image/heif`;function mbt(e){let{user:t,updateUser:n}=Nx.getState();t&&n({...t,avatar_url:e})}function hbt(){let{user:e,updateUser:t}=Nx(),{t:n}=V(),r=Sv(),i=XT(e=>e.resetForReplay),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(``),[d,f]=(0,B.useState)(``),[p,m]=(0,B.useState)(`en`),[h,g]=(0,B.useState)(`en`),[_,v]=(0,B.useState)(`UTC`),[y,b]=(0,B.useState)(``),[x,S]=(0,B.useState)(``),[C,w]=(0,B.useState)(``),[T,E]=(0,B.useState)(!1),[D,O]=(0,B.useState)(!1),[k,A]=(0,B.useState)(`idle`),[j,M]=(0,B.useState)(null),[N,P]=(0,B.useState)(!1),F=(0,B.useRef)(null),[I,L]=(0,B.useState)(null),ee=e?.id??null,[R,te]=(0,B.useState)(void 0);if(R!==ee&&(te(ee),e)){o(e.first_name),c(e.last_name),u(e.email),f(e.phone_number??``);let t=e.preferences,n=t?.response_language;m(typeof n==`string`?n:`en`);let r=t?.ui_language;g(r===`es`?`es`:`en`);let i=t?.timezone;v(typeof i==`string`&&i?i:jz(Intl.DateTimeFormat().resolvedOptions().timeZone)),b(t?.redline_author_name??``),S(``),w(``),A(`idle`),M(null)}let ne=async r=>{r.preventDefault(),A(`saving`),M(null);let i={},o=a.trim(),c=s.trim();if(!o||!c){M(n(`settings.profile.save_error_blank_name`)),A(`error`);return}if(o!==e?.first_name&&(i.first_name=o),c!==e?.last_name&&(i.last_name=c),l!==e?.email&&(i.email=l),C){if(!x){M(n(`settings.profile.save_error_no_current_password`)),A(`error`);return}i.current_password=x,i.new_password=C}d!==(e?.phone_number??``)&&(i.phone_number=d||null);let u=e?.preferences??{},m=u.response_language??`en`,g=u.ui_language??`en`,v=u.timezone??`UTC`,b=u.redline_author_name??``,T={};if(p!==m&&(T.response_language=p),h!==g&&(T.ui_language=h),_!==v&&(T.timezone=_),y.trim()!==b&&(T.redline_author_name=y.trim()||null),Object.keys(T).length>0&&(i.preferences=T),Object.keys(i).length===0){A(`saved`),setTimeout(()=>A(`idle`),2e3);return}try{let e=(await jx(i)).data;t(e),f(e.phone_number??``),T.ui_language&&await dbt(h),S(``),w(``),A(`saved`),setTimeout(()=>A(`idle`),2e3),G.success(n(`settings.profile.save_success_toast`))}catch(e){M(Kb(e,n(`settings.profile.save_error_generic`))),A(`error`),G.error(n(`settings.profile.save_error_toast`))}};async function re(e){let t=e.target.files?.[0];if(e.target.value=``,t){L(`upload`);try{mbt((await eve({file:t})).data.avatar_url),G.success(n(`settings.profile.photo_updated`))}catch(e){Y(e,n(`settings.profile.photo_error`),{operation:`upload_avatar`})}finally{L(null)}}}async function ie(){L(`remove`);try{await nve(),mbt(null),G.success(n(`settings.profile.photo_removed`))}catch(e){Y(e,n(`settings.profile.photo_error`),{operation:`remove_avatar`})}finally{L(null)}}async function z(){await Z_e().then(()=>{window.location.href=`/login?account_deleted=true`})}let ae=e?`${e.first_name[0]??``}${e.last_name[0]??``}`.toUpperCase():`?`,oe=e?`${e.first_name} ${e.last_name}`:n(`common.settings`);return(0,K.jsxs)(`form`,{onSubmit:ne,className:`space-y-5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsxs)(KL,{className:`size-12`,children:[e?.avatar_url&&(0,K.jsx)(_0e,{src:XI(e.avatar_url),alt:oe}),(0,K.jsx)(qL,{className:`bg-gray-900 text-white text-lg font-semibold`,children:ae})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:oe}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3 mt-0.5`,children:[(0,K.jsx)(J,{type:`button`,variant:`link`,className:`h-auto p-0 text-xs text-gray-400 hover:text-gray-600`,disabled:I!==null,onClick:()=>F.current?.click(),children:n(I===`upload`?`settings.profile.photo_uploading`:`settings.profile.change_photo`)}),e?.avatar_url&&(0,K.jsx)(J,{type:`button`,variant:`link`,className:`h-auto p-0 text-xs text-gray-400 hover:text-gray-600`,disabled:I!==null,onClick:ie,children:n(`settings.profile.remove_photo`)})]}),(0,K.jsx)(`input`,{ref:F,type:`file`,accept:pbt,className:`hidden`,onChange:re})]})]}),(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 mb-1.5 uppercase tracking-wide`,children:n(`settings.profile.first_name`)}),(0,K.jsx)(dP,{type:`text`,required:!0,value:a,onChange:e=>o(e.target.value)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 mb-1.5 uppercase tracking-wide`,children:n(`settings.profile.last_name`)}),(0,K.jsx)(dP,{type:`text`,required:!0,value:s,onChange:e=>c(e.target.value)})]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 mb-1.5 uppercase tracking-wide`,children:n(`settings.profile.redline_author_name`)}),(0,K.jsx)(dP,{type:`text`,maxLength:100,value:y,onChange:e=>b(e.target.value),placeholder:[a,s].map(e=>
823e.trim()).filter(Boolean).join(` `)}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:n(`settings.profile.redline_author_name_help`)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 mb-1.5 uppercase tracking-wide`,children:n(`settings.profile.email`)}),(0,K.jsx)(dP,{type:`email`,autoComplete:`email`,value:l,onChange:e=>u(e.target.value),required:!0}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:n(`settings.profile.email_verification_note`)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,K.jsx)(pP,{htmlFor:`profile-phone`,className:`text-xs text-gray-500 uppercase tracking-wide`,children:n(`settings.profile.phone_number`)}),e?.phone_number&&(0,K.jsx)(lR,{variant:`outline`,className:e.phone_verified?`text-green-600 border-green-200 bg-green-50 text-xs`:`text-yellow-600 border-yellow-200 bg-yellow-50 text-xs`,children:e.phone_verified?n(`settings.profile.phone_verified`):n(`settings.profile.phone_unverified`)})]}),(0,K.jsx)(dP,{id:`profile-phone`,name:`phone`,type:`tel`,autoComplete:`tel`,inputMode:`tel`,pattern:Pz,title:n(`settings.profile.phone_invalid`),value:d,onChange:e=>f(e.target.value),placeholder:n(`settings.profile.phone_placeholder`)}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:n(`settings.profile.phone_help`)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 mb-1.5 uppercase tracking-wide`,children:n(`settings.profile.response_language`)}),(0,K.jsxs)(vO,{value:p,onValueChange:m,children:[(0,K.jsx)(bO,{className:`w-full`,children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:obt.map(e=>(0,K.jsxs)(SO,{value:e.value,children:[e.label,e.native!==e.label&&(0,K.jsx)(`span`,{className:`text-gray-400 ml-2`,children:e.native})]},e.value))})]}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:n(`settings.profile.response_language_help`)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 mb-1.5 uppercase tracking-wide`,children:n(`settings.profile.ui_language`)}),(0,K.jsxs)(vO,{value:h,onValueChange:e=>g(e),children:[(0,K.jsx)(bO,{className:`w-full`,children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:sbt.map(e=>(0,K.jsxs)(SO,{value:e.code,children:[e.name,e.native!==e.name&&(0,K.jsx)(`span`,{className:`text-gray-400 ml-2`,children:e.native})]},e.code))})]}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:n(`settings.profile.ui_language_help`)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 mb-1.5 uppercase tracking-wide`,children:n(`settings.profile.timezone`)}),(0,K.jsx)(Fz,{value:_,onChange:v}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:n(`settings.profile.timezone_help`)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 mb-1.5 uppercase tracking-wide`,children:n(`settings.profile.current_password`)}),(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(dP,{type:T?`text`:`password`,value:x,onChange:e=>S(e.target.value),placeholder:`â¢â¢â¢â¢â¢â¢â¢â¢`,className:`pr-9`}),(0,K.jsx)(`button`,{onClick:()=>E(e=>!e),className:`absolute right-3 top-1/2 -translate-y-1/2 text-gray-300 hover:text-gray-500`,type:`button`,children:T?(0,K.jsx)(t_,{size:16}):(0,K.jsx)(e_,{size:16})})]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 mb-1.5 uppercase tracking-wide`,children:n(`settings.profile.new_password`)}),(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(dP,{type:D?`text`:`password`,value:C,onChange:e=>w(e.target.value),placeholder:n(`settings.profile.new_password_placeholder`),className:`pr-9`,minLength:8}),(0,K.jsx)(`button`,{onClick:()=>O(e=>!e),className:`absolute right-3 top-1/2 -translate-y-1/2 text-gray-300 hover:text-gray-500`,type:`button`,children:D?(0,K.jsx)(t_,{size:16}):(0,K.jsx)(e_,{size:16})})]})]}),k===`error`&&j&&(0,K.jsx)(`p`,{className:`text-xs text-red-500`,children:j}),(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:n(`settings.profile.replay_tour`)}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400`,children:n(`settings.profile.replay_tour_help`)})]}),(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>{i(),r(`/dashboard`)},children:n(`settings.profile.replay_tour_action`)})]}),(0,K.jsxs)(`div`,{className:`flex justify-between pt-1`,children:[(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`destructive`,onClick:()=>P(!0),children:n(`settings.profile.delete_account`)}),(0,K.jsx)(J,{type:`submit`,disabled:k===`saving`,size:`sm`,variant:k===`saved`?`ghost`:`default`,children:n(k===`saved`?`common.saved`:k===`saving`?`common.saving`:`common.save_changes`)})]}),(0,K.jsx)(fbt,{open:N,onOpenChange:P,email:e?.email??``,onConfirm:z})]})}function p0({roles:e,minRole:t,fallback:n=null,requireOrg:r=!1,children:i}){let a=RS();return r&&a===null?(0,K.jsx)(K.Fragment,{children:n}):e?a&&e.includes(a)?(0,K.jsx)(K.Fragment,{children:i}):(0,K.jsx)(K.Fragment,{children:n}):t?zS(a,t)?(0,K.jsx)(K.Fragment,{children:i}):(0,K.jsx)(K.Fragment,{children:n}):(0,K.jsx)(K.Fragment,{children:i})}var gbt=[`admin`,`member`,`viewer`];
823function _bt({value:e,onChange:t,disabled:n}){let{t:r}=V(),i=e=>r(e===`admin`?`org.roles.admin`:e===`member`?`org.roles.member`:`org.roles.viewer`);return(0,K.jsxs)(vO,{value:e,onValueChange:e=>t(e),disabled:n,children:[(0,K.jsx)(bO,{className:`h-8 w-full text-xs`,children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:gbt.map(e=>(0,K.jsx)(SO,{value:e,className:`text-xs`,children:(0,K.jsx)(`span`,{className:`font-medium`,children:i(e)})},e))})]})}function vbt({orgId:e,members:t}){let{t:n}=V(),r=RS(),i=Nx(e=>e.user?.id),a=GL(e=>e.changeRole),o=GL(e=>e.removeMember),[s,c]=(0,B.useState)(null),l=r===`admin`,u=e=>e===`admin`?n(`org.roles.admin`):e===`member`?n(`org.roles.member`):e===`viewer`?n(`org.roles.viewer`):String(e),d=async(t,r)=>{if(t.role!==r){c(t.user_id);try{await a(e,t.user_id,r),G.success(n(`toasts.org.role_updated`))}catch(e){Y(e,n(`toasts.org.role_update_failed`),{operation:`org.changeRole`})}finally{c(null)}}},f=async t=>{c(t.user_id);try{await o(e,t.user_id),G.success(n(`toasts.org.member_removed`))}catch(e){Y(e,n(`toasts.org.member_remove_failed`),{operation:`org.removeMember`})}finally{c(null)}};return(0,K.jsxs)(iU,{children:[(0,K.jsx)(aU,{children:(0,K.jsxs)(sU,{children:[(0,K.jsx)(cU,{children:n(`org.members.name`)}),(0,K.jsx)(cU,{children:n(`org.members.role`)}),(0,K.jsx)(cU,{className:`w-[60px]`})]})}),(0,K.jsx)(oU,{children:t.map(e=>{let t=e.user_id===i;return(0,K.jsxs)(sU,{children:[(0,K.jsx)(lU,{children:(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:[e.user.first_name,e.user.last_name].filter(Boolean).join(` `)||e.user.email}),(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.user.email})]})}),(0,K.jsx)(lU,{children:l&&!t?(0,K.jsx)(_bt,{value:e.role,onChange:t=>d(e,t),disabled:s===e.user_id}):(0,K.jsx)(`span`,{className:`text-xs`,children:u(e.role)})}),(0,K.jsx)(lU,{className:`text-right`,children:(l||t)&&(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>f(e),disabled:s===e.user_id,className:`h-8 px-2 text-destructive hover:text-destructive`,title:n(t?`settings.organization.leave_org`:`org.members.remove`),children:(0,K.jsx)(V_,{className:`size-3.5`})})})]},e.id)})})]})}var ybt=[{value:`admin`,icon:I_},{value:`member`,icon:K_},{value:`viewer`,icon:t_}];function bbt({orgId:e,open:t,onOpenChange:n}){let{t:r}=V(),i=GL(e=>e.inviteMember),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(`member`),[l,u]=(0,B.useState)(!1),d=e=>e===`admin`?r(`org.roles.admin`):e===`member`?r(`org.roles.member`):e===`viewer`?r(`org.roles.viewer`):e;(0,B.useEffect)(()=>{t||(o(``),c(`member`),u(!1))},[t]);let f=a.trim();return(0,K.jsx)(HC,{open:t,onOpenChange:n,children:(0,K.jsx)(WC,{className:`sm:max-w-[460px] gap-0 overflow-hidden p-0`,children:(0,K.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),!l){u(!0);try{await i(e,f,s),G.success(r(`toasts.org.invited`)),n(!1)}catch(e){Y(e,r(`toasts.org.invite_failed`),{operation:`invite_member`})}finally{u(!1)}}},children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3.5 px-6 pt-6 pb-5`,children:[(0,K.jsx)(`div`,{className:`grid size-10 shrink-0 place-items-center rounded-md border border-border/80 bg-muted/40`,children:(0,K.jsx)(jse,{className:`size-[17px] text-foreground/75`,strokeWidth:1.75})}),(0,K.jsxs)(`div`,{className:`flex-1 pt-0.5`,children:[(0,K.jsx)(qC,{className:`text-[15px] font-semibold leading-tight tracking-tight`,children:r(`org.invite_dialog.title`)}),(0,K.jsx)(JC,{className:`mt-1.5 text-xs leading-relaxed text-muted-foreground`,children:r(`org.invite_dialog.description`)})]})]}),(0,K.jsx)(`div`,{className:`border-t border-border/60`}),(0,K.jsxs)(`div`,{className:`space-y-5 px-6 py-5`,children:[(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`label`,{htmlFor:`invite-email`,className:`block text-[10.5px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:r(`org.invite_dialog.email_label`)}),(0,K.jsxs)(`div`,{className:q(`flex h-10 items-center gap-2.5 rounded-md border bg-background px-3 transition-colors`,`focus-within:border-foreground
823/40 focus-within:ring-2 focus-within:ring-ring/30`),children:[(0,K.jsx)(Yae,{className:`size-4 text-muted-foreground`,strokeWidth:1.75}),(0,K.jsx)(`input`,{id:`invite-email`,type:`email`,value:a,onChange:e=>o(e.target.value),placeholder:r(`org.invite_dialog.email_placeholder`),className:`flex-1 bg-transparent text-sm placeholder:text-muted-foreground/55 focus:outline-none disabled:opacity-50`,disabled:l,required:!0,autoFocus:!0,autoComplete:`email`})]})]}),(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`label`,{className:`block text-[10.5px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:r(`org.invite_dialog.role_label`)}),(0,K.jsx)(`div`,{className:`grid grid-cols-3 gap-1.5`,children:ybt.map(e=>{let t=s===e.value,n=e.icon;return(0,K.jsxs)(`button`,{type:`button`,onClick:()=>c(e.value),disabled:l,className:q(`group relative flex flex-col items-start gap-2 rounded-md border p-3 text-left transition-all duration-150`,`hover:border-foreground/30 disabled:cursor-not-allowed disabled:opacity-50`,t?`border-foreground
823/70 bg-accent/40 shadow-[inset_0_0_0_1px_var(--foreground)] shadow-foreground/[0.04]`:`border-border bg-background`),children:[(0,K.jsx)(n,{className:q(`size-3.5 transition-colors`,t?`text-foreground`:`text-muted-foreground`),strokeWidth:1.75}),(0,K.jsx)(`div`,{className:`space-y-1`,children:(0,K.jsx)(`div`,{className:q(`text-[12.5px] font-medium leading-none transition-colors`,t?`text-foreground`:`text-foreground/85`),children:d(e.value)})}),t&&(0,K.jsx)(`span`,{className:`absolute right-2 top-2 size-1.5 rounded-full bg-foreground`,"aria-hidden":!0})]},e.value)})})]}),(0,K.jsx)(`div`,{className:`rounded-md border-l-2 border-foreground/40 bg-muted/30 px-3 py-2 text-[11px] leading-relaxed text-muted-foreground`,children:f?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`font-mono text-foreground/85`,children:f}),` `,`·`,` `,(0,K.jsx)(`span`,{className:`font-medium text-foreground/85`,children:d(s)})]}):(0,K.jsx)(`span`,{className:`italic text-muted-foreground/70`,children:r(`org.invite_dialog.email_placeholder`)})})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t border-border/60 bg-muted/30 px-6 py-3.5`,children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>n(!1),disabled:l,className:`h-8`,children:r(`common.cancel`)}),(0,K.jsx)(J,{type:`submit`,size:`sm`,disabled:l,className:`h-8 gap-1.5`,children:l?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{className:`size-3.5 animate-spin`}),r(`org.invite_dialog.sending`)]}):(0,K.jsxs)(K.Fragment,{children:[r(`org.invite_dialog.send_invite`),(0,K.jsx)(Eg,{className:`size-3.5`,strokeWidth:2})]})})]})]})})})}function xbt({orgId:e,invites:t}){let{t:n}=V(),{formatDate:r}=jb(),i=GL(e=>e.revokeInvite),a=async t=>{try{await i(e,t.id),G.success(n(`toasts.org.invite_revoked`))}catch(e){Y(e,n(`toasts.org.invite_revoke_failed`),{operation:`org.revokeInvite`})}};if(t.length===0)return(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground py-4 text-center`,children:n(`org.pending_invites.no_invites`)});let o=e=>e===`admin`?n(`org.roles.admin`):e===`member`?n(`org.roles.member`):e===`viewer`?n(`org.roles.viewer`):e;return(0,K.jsx)(`ul`,{className:`divide-y divide-border/60`,children:t.map(e=>(0,K.jsxs)(`li`,{className:`flex items-center gap-3 py-2.5`,children:[(0,K.jsx)(__,{className:`size-4 text-muted-foreground shrink-0`}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium truncate`,children:e.email}),(0,K.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[o(e.role),` ·`,` `,n(`org.pending_invites.invited_on`,{date:r(e.expires_at)})]})]}),(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>a(e),className:`h-8 px-2 text-destructive hover:text-destructive`,title:n(`org.pending_invites.revoke`),children:(0,K.jsx)(V_,{className:`size-3.5`})})]},e.id))})}function Sbt(){let{t:e}=V(),t=Nx(e=>e.user?.current_org_id??null),n=RS(),r=t=>t===`admin`?e(`org.roles.admin`):t===`member`?e(`org.roles.member`):t===`viewer`?e(`org.roles.viewer`):`â`,i=GL(e=>e.organizations),a=GL(e=>e.members),o=GL(e=>e.pendingInvites),s=GL(e=>e.fetchMyOrganizations),c=GL(e=>e.fetchMembers),l=GL(e=>e.fetchPendingInvites),u=GL(e=>e.removeMember),d=GL(e=>e.switchActiveOrg),f=GL(e=>e.renameOrganization),p=GL(e=>e.deleteOrganization),[m,h]=(0,B.useState)(!1),[g,_]=(0,B.useState)(!1),[v,y]=(0,B.useState)(``),[b,x]=(0,B.useState)(!1),[S,C]=(0,B.useState)(!1),[w,T]=(0,B.useState)(``),[E,D]=(0,B.useState)(!1),O=i.find(e=>e.id===t)??null,k=Nx(e=>e.user?.id??null);if((0,B.useEffect)(()=>{t&&(c(t),n===`admin`&&l(t))},[t,n,c,l]),(0,B.useEffect)(()=>{i.length===0&&s()},[i.length,s]),!t||!O)return(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground space-y-3`,children:(0,K.jsx)(`p`,{children:e(`settings.organization.no_org_active`)})});let A=async()=>{if(k)try{await u(t,k),G.success(e(`toasts.org.member_removed`)),await d(null),sR({exclude:[`org`,`notification`,`integrationSync`]}),await s()}catch(t){Y(t,e(`toasts.org.member_remove_failed`),{operation:`leave_organization`})}},j=()=>{y(O?.name??``),_(!0)},M=async()=>{let n=v.trim();if(n){x(!0);try{await f(t,n),G.success(e(`toasts.org.saved`,`Organization updated`)),_(!1)}catch{}finally{x(!1)}}},N=async()=>{D(!0);try{await p(t),await d(null),sR({exclude:[`org`,`notification`,`integrationSync`]}),C(!1),T(``)}catch{}finally{D(!1)}}
823,P=a[t]??[],F=o[t]??[];return(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsxs)(`section`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold tracking-tight`,children:e(`settings.organization.title`)}),(0,K.jsx)(p0,{roles:[`admin`],children:(0,K.jsxs)(J,{size:`sm`,variant:`outline`,onClick:j,className:`gap-1.5 h-8`,children:[(0,K.jsx)(w_,{className:`size-3.5`}),(0,K.jsx)(`span`,{className:`text-xs`,children:e(`common.rename`,`Rename`)})]})})]}),(0,K.jsxs)(`div`,{className:`mt-2 grid grid-cols-2 gap-3 text-sm`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e(`settings.organization.org_name_label`)}),(0,K.jsx)(`div`,{className:`font-medium`,children:O.name})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e(`common.type`)}),(0,K.jsx)(`div`,{className:`font-mono text-xs`,children:O.slug??`â`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e(`org.members.role`)}),(0,K.jsx)(`div`,{children:r(n)})]})]})]}),(0,K.jsx)(tL,{}),(0,K.jsxs)(`section`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold tracking-tight`,children:e(`settings.organization.members`)}),(0,K.jsx)(p0,{roles:[`admin`],children:(0,K.jsxs)(J,{size:`sm`,variant:`outline`,onClick:()=>h(!0),className:`gap-1.5 h-8`,children:[(0,K.jsx)(T_,{className:`size-3.5`}),(0,K.jsx)(`span`,{className:`text-xs`,children:e(`settings.organization.invite_member`)})]})})]}),(0,K.jsx)(vbt,{orgId:t,members:P})]}),(0,K.jsxs)(p0,{roles:[`admin`],children:[(0,K.jsx)(tL,{}),(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold tracking-tight mb-2`,children:e(`settings.organization.pending_invites`)}),(0,K.jsx)(xbt,{orgId:t,invites:F})]})]}),(0,K.jsx)(tL,{}),(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold tracking-tight text-destructive`,children:e(`delete_account.title`)}),(0,K.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,K.jsx)(J,{size:`sm`,variant:`outline`,onClick:A,className:`text-destructive hover:text-destructive`,children:e(`settings.organization.leave_org`)}),(0,K.jsx)(p0,{roles:[`admin`],children:(0,K.jsx)(J,{size:`sm`,variant:`destructive`,onClick:()=>{T(``),C(!0)},children:e(`settings.organization.delete_org`,`Delete organization`)})})]})]}),(0,K.jsx)(bbt,{orgId:t,open:m,onOpenChange:h}),(0,K.jsx)(HC,{open:g,onOpenChange:_,children:(0,K.jsxs)(WC,{className:`sm:max-w-md`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:e(`common.rename`,`Rename`)}),(0,K.jsx)(JC,{children:e(`settings.organization.org_name_label`)})]}),(0,K.jsx)(dP,{value:v,onChange:e=>y(e.target.value),autoFocus:!0,disabled:b,onKeyDown:e=>{e.key===`Enter`&&v.trim()&&M()}}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`ghost`,onClick:()=>_(!1),disabled:b,children:e(`common.cancel`)}),(0,K.jsx)(J,{onClick:M,disabled:b||!v.trim(),children:b?e(`common.saving`,`Savingâ¦`):e(`common.save`)})]})]})}),(0,K.jsx)(HC,{open:S,onOpenChange:C,children:(0,K.jsxs)(WC,{className:`sm:max-w-md`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{className:`text-destructive`,children:e(`settings.organization.delete_org`,`Delete organization`)}),(0,K.jsx)(JC,{children:e(`settings.organization.delete_org_warning`,`This permanently deletes this organization and everything it owns â knowledge bases, conversations, evaluations, matters, and more. This cannot be undone.`)})]}),(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:[e(`settings.organization.delete_org_confirm_label`,`Type the organization name to confirm:`),` `,(0,K.jsx)(`span`,{className:`font-mono text-foreground`,children:O.name})]}),(0,K.jsx)(dP,{value:w,onChange:e=>T(e.target.value),disabled:E,autoFocus:!0})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`ghost`,onClick:()=>C(!1),disabled:E,children:e(`common.cancel`)}),(0,K.jsx)(J,{variant:`destructive`,onClick:N,disabled:E||w.trim()!==O.name,children:E?e(`common.deleting`,`Deletingâ¦`):e(`common.delete`)})]})]})})]})}var m0=[.4,0,.2,1];function Cbt({currentPlan:e,plans:t,onPlanChange:n,cancelAtPeriodEnd:r=!1,className:i,title:a}){let[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(e.id),[u,d]=(0,B.useState)(e.id);u!==e.id&&(d(e.id),l(e.id));let f=(0,B.useCallback)(e=>o?`${e.yearlyPrice}`:`${e.monthlyPrice}`,[o]),p=(0,B.useCallback)(e=>{l(t=>t===e?void 0:e)},[]),m,h=!1;return e.id===`free`?(m=c===`pro`?`Upgrade to Pro`:`Current Plan`,h=c===`free`):e.id===`pro`&&r?(m=c===`pro`?`Cancellation Pending`:`Downgrading after peri
823od ends`,h=!0):(m=c===`pro`?`Current Plan`:`Cancel Subscription`,h=c===`pro`),(0,K.jsx)(uz,{className:q(`mx-auto w-full max-w-xl overflow-hidden text-left shadow-lg`,i),children:(0,K.jsx)(mz,{className:`space-y-3`,children:(0,K.jsx)(oz,{value:c,onValueChange:p,children:(0,K.jsx)(`div`,{className:`space-y-2.5 sm:space-y-3`,children:t.map((e,t)=>(0,K.jsxs)(QN.div,{layout:!0,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{layout:{duration:.3,ease:m0},opacity:{delay:t*.05,duration:.3,ease:m0},y:{delay:t*.05,duration:.3,ease:m0}},onClick:()=>p(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),p(e.id))},role:`button`,tabIndex:0,"aria-pressed":c===e.id,className:q(`relative cursor-pointer overflow-hidden rounded-lg border transition-all duration-200 sm:rounded-xl`,`focus-visible:ring-primary touch-manipulation focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none`,c===e.id?`border-primary from-muted/60 to-muted/30 bg-gradient-to-br shadow-sm`:`border-border hover:border-primary/50`),children:[(0,K.jsx)(QN.div,{layout:`position`,className:`p-3 sm:p-4`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-2 sm:gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 gap-2 sm:gap-3`,children:[(0,K.jsx)(sz,{value:e.id,id:e.id,className:`pointer-events-none mt-0.5 flex-shrink-0 sm:mt-1`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 sm:gap-2`,children:[(0,K.jsx)(pP,{htmlFor:e.id,className:`cursor-pointer text-sm leading-tight font-semibold sm:text-base sm:font-medium`,children:e.title}),e.badge&&(0,K.jsx)(lR,{variant:`secondary`,className:`h-5 flex-shrink-0 px-1.5 py-0 text-[10px] sm:h-auto sm:px-2 sm:py-0.5 sm:text-xs`,children:e.badge})]}),(0,K.jsx)(`p`,{className:`text-muted-foreground mt-1 text-[11px] leading-relaxed sm:text-xs`,children:e.description}),e.features.length>0&&(0,K.jsx)(`div`,{className:`pt-2 sm:pt-3`,children:(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5 sm:gap-2`,children:e.features.map((e,t)=>(0,K.jsxs)(`div`,{className:`bg-muted/20 border-border/30 flex flex-shrink-0 items-center gap-1.5 rounded-md border px-2 py-1 sm:gap-2 sm:rounded-lg`,children:[(0,K.jsx)(`div`,{className:`bg-primary h-1 w-1 flex-shrink-0 rounded-full sm:h-1.5 sm:w-1.5`}),(0,K.jsx)(`span`,{className:`text-muted-foreground text-[10px] leading-none whitespace-nowrap sm:text-xs`,children:e.name})]},t))})})]})]}),(0,K.jsxs)(`div`,{className:`min-w-[60px] flex-shrink-0 text-right sm:min-w-[80px]`,children:[(0,K.jsx)(`div`,{className:`text-base leading-tight font-bold sm:text-xl sm:font-semibold`,children:parseFloat(f(e))>=0?`${e.currency}${f(e)}`:f(e)}),(0,K.jsxs)(`div`,{className:`text-muted-foreground mt-0.5 text-[10px] sm:text-xs`,children:[`/`,o?`year`:`month`]})]})]})}),(0,K.jsx)(lN,{initial:!1,children:c===e.id&&(0,K.jsx)(QN.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1,transition:{height:{duration:.3,ease:m0},opacity:{duration:.25,delay:.05,ease:m0}}},exit:{height:0,opacity:0,transition:{height:{duration:.25,ease:m0},opacity:{duration:.15,ease:m0}}},className:`overflow-hidden`,children:(0,K.jsx)(QN.div,{initial:{y:-8},animate:{y:0,transition:{duration:.25,delay:.05,ease:m0}},exit:{y:-8},className:`px-3 pb-3 sm:px-4 sm:pb-4`,children:(0,K.jsx)(J,{className:`h-10 w-full touch-manipulation text-sm font-medium sm:h-11 sm:text-base`,variant:m===`Cancel Subscription`?`destructive`:`default`,disabled:h,onClick:t=>{t.stopPropagation(),n(e.id)},children:m})})})})]},e.id))})})})})}const wbt=()=>`/api/v1/stripe/create-checkout-session`,Tbt=async e=>Z(wbt(),{...e,method:`POST`}),Ebt=()=>`/api/v1/stripe/cancel-subscription`,Dbt=async e=>Z(Ebt(),{...e,method:`POST`});function Obt(){let{t:e}=V(),{formatDate:t}=jb(),{user:n,updateUser:r}=Nx(),i=Ez.find(e=>e.id===(n?.plan??`free`))??Ez[0],a=n?.cancel_at_period_end??!1;(0,B.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get(`checkout`)===`success`?5e3:0;setTimeout(()=>{Ax().then(e=>{r(e.data)})},e)},[]);async function o(t){if(!Ez.find(e=>e.id===t)){console.error(`${t} not found as a plan`);return}if(t===`free`)try{await Dbt(),G.success(e(`toasts.billing.cancelled`)),r((await Ax()).data)}catch(e){console.error(e)}else if(t===`pro`)try{let e=await Tbt();window.location.href=e.data.url}catch(e){console.error(e)}}return(0,K.jsxs)(`div`,{className:`space-y-5`,children:[(0,K.jsx)(Cbt,{currentPlan:i,plans:Ez,onPlanChange:o,cancelAtPeriodEnd:a,title:``}),n?.plan===`pro`&&n.subscription_period_end&&!a&&(0,K.jsx)(`div`,{children:e(`settings.billing.renews_on`,{date:t(n.subscription_period_end,`MMMM d, yyyy`)})}),n?.plan===`pro`&&n.subscription_period_end&&a&&(0,K.jsx)(`div`,{children:e(`settings.billing.subscription_cancels_on`,{date:t(n.subscription_period_end,`MMMM d, yyyy`)})})]})}var kbt=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.onFocusCapture.onBlur.onBlurCapture.onChange.onChangeCapture.onBeforeInput.onBeforeInputCapture.onInput.onInputCapture.onReset.onResetCapture.onSubmit.onSubmitCapture.onInvalid.onInvalidCapture.onLoad.onLoadCapture.onError.onErrorCapture.onKeyDown.onKeyDownCapture.onKeyPress.onKeyPressCapture.onKeyUp.onKeyUpCapture.onAbort.onAbortCapture.onCanPlay.onCanPlayCapture.onCanPlayThrough.onCanPlayThroughCapture.onDurationChange.onDurationChangeCapture.onEmptied.onEmptiedCapture.onEncrypted.onEncryptedCapture.onEnded.onEndedCapture.onLoadedData.onLoadedDataCapture.onLoadedMetadata.onLoadedMetadataCapture.onLoadStart.onLoadStartCapture.onPause.onPauseCapture.onPlay.onPlayCapture.onPlaying.onPlayingCapture.onProgress.onProgressCapture.onRateChange.onRateChangeCapture.onSeeked.onSeekedCapture.onSeeking.onSeekingCapture.onStalled.onStalledCapture.onSuspend.onSuspendCapture.onTimeUpdate.onTimeUpdate
823Capture.onVolumeChange.onVolumeChangeCapture.onWaiting.onWaitingCapture.onAuxClick.onAuxClickCapture.onClick.onClickCapture.onContextMenu.onContextMenuCapture.onDoubleClick.onDoubleClickCapture.onDrag.onDragCapture.onDragEnd.onDragEndCapture.onDragEnter.onDragEnterCapture.onDragExit.onDragExitCapture.onDragLeave.onDragLeaveCapture.onDragOver.onDragOverCapture.onDragStart.onDragStartCapture.onDrop.onDropCapture.onMouseDown.onMouseDownCapture.onMouseEnter.onMouseLeave.onMouseMove.onMouseMoveCapture.onMouseOut.onMouseOutCapture.onMouseOver.onMouseOverCapture.onMouseUp.onMouseUpCapture.onSelect.onSelectCapture.onTouchCancel.onTouchCancelCapture.onTouchEnd.onTouchEndCapture.onTouchMove.onTouchMoveCapture.onTouchStart.onTouchStartCapture.onPointerDown.onPointerDownCapture.onPointerMove.onPointerMoveCapture.onPointerUp.onPointerUpCapture.onPointerCancel.onPointerCancelCapture.onPointerEnter.onPointerEnterCapture.onPointerLeave.onPointerLeaveCapture.onPointerOver.onPointerOverCapture.onPointerOut.onPointerOutCapture.onGotPointerCapture.onGotPointerCaptureCapture.onLostPointerCapture.onLostPointerCaptureCapture.onScroll.onScrollCapture.onWheel.onWheelCapture.onAnimationStart.onAnimationStartCapture.onAnimationEnd.onAnimationEndCapture.onAnimationIteration.onAnimationIterationCapture.onTransitionEnd.onTransitionEndCapture`.split(`.`);function h0(e){return typeof e==`string`?kbt.includes(e):!1}var Abt=new Set(`aria-activedescendant.aria-atomic.aria-autocomplete.aria-busy.aria-checked.aria-colcount.aria-colindex.aria-colspan.aria-controls.aria-current.aria-describedby.aria-details.aria-disabled.aria-errormessage.aria-expanded.aria-flowto.aria-haspopup.aria-hidden.aria-invalid.aria-keyshortcuts.aria-label.aria-labelledby.aria-level.aria-live.aria-modal.aria-multiline.aria-multiselectable.aria-orientation.aria-owns.aria-placeholder.aria-posinset.aria-pressed.aria-readonly.aria-relevant.aria-required.aria-roledescription.aria-rowcount.aria-rowindex.aria-rowspan.aria-selected.aria-setsize.aria-sort.aria-valuemax.aria-valuemin.aria-valuenow.aria-valuetext.className.color.height.id.lang.max.media.method.min.name.style.target.width.role.tabIndex.accentHeight.accumulate.additive.alignmentBaseline.allowReorder.alphabetic.amplitude.arabicForm.ascent.attributeName.attributeType.autoReverse.azimuth.baseFrequency.baselineShift.baseProfile.bbox.begin.bias.by.calcMode.capHeight.clip.clipPath.clipPathUnits.clipRule.colorInterpolation.colorInterpolationFilters.colorProfile.colorRendering.contentScriptType.contentStyleType.cursor.cx.cy.d.decelerate.descent.diffuseConstant.direction.display.divisor.dominantBaseline.dur.dx.dy.edgeMode.elevation.enableBackground.end.exponent.externalResourcesRequired.fill.fillOpacity.fillRule.filter.filterRes.filterUnits.floodColor.floodOpacity.focusable.fontFamily.fontSize.fontSizeAdjust.fontStretch.fontStyle.fontVariant.fontWeight.format.from.fx.fy.g1.g2.glyphName.glyphOrientationHorizontal.glyphOrientationVertical.glyphRef.gradientTransform.gradientUnits.hanging.horizAdvX.horizOriginX.href.ideographic.imageRendering.in2.in.intercept.k1.k2.k3.k4.k.kernelMatrix.kernelUnitLength.kerning.keyPoints.keySplines.keyTimes.lengthAdjust.letterSpacing.lightingColor.limitingConeAngle.local.markerEnd.markerHeight.markerMid.markerStart.markerUnits.markerWidth.mask.maskContentUnits.maskUnits.mathematical.mode.numOctaves.offset.opacity.operator.order.orient.orientation.origin.overflow.overlinePosition.overlineThickness.paintOrder.panose1.pathLength.patternContentUnits.patternTransform.patternUnits.pointerEvents.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.r.radius.refX.refY.renderingIntent.repeatCount.repeatDur.requiredExtensions.requiredFeatures.restart.result.rotate.rx.ry.seed.shapeRendering.slope.spacing.specularConstant.specularExponent.speed.spreadMethod.startOffset.stdDeviation.stemh.stemv.stitchTiles.stopColor.stopOpacity.strikethroughPosition.strikethroughThickness.string.stroke.strokeDasharray.strokeDashoffset.strokeLinecap.strokeLinejoin.strokeMiterlimit.strokeOpacity.strokeWidth.surfaceScale.systemLanguage.tableValues.targetX.targetY.textAnchor.textDecoration.textLength.textRendering.to.transform.u1.u2.underlinePosition.underlineThickness.unicode.unicodeBidi.unicodeRange.unitsPerEm.vAlphabetic.values.vectorEffect.version.vertAdvY.vertOriginX.vertOriginY.vHanging.vIdeographic.viewTarget.visibility.vMathematical.widths.wordSpacing.writingMode.x1.x2.x.xChannelSelector.xHeight.xlinkActuate.xlinkArcrole.xlinkHref.xlinkRole.xlinkShow.xlinkTitle.xlinkType.xmlBase.xmlLang.xmlns.xmlnsXlink.xmlSpace.y1.y2.y.yChannelSelector.z.zoomAndPan.ref.key.angle`.split(`.`));function jbt(e){return typeof e==`string`?Abt.has(e):!1}function Mbt(e){return typeof e==`string`&&e.startsWith(`data-`)}function g0(e){if(typeof e!=`object`||!e)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(jbt(n)||Mbt(n))&&(t[n]=e[n]);return t}function _0(e){if(e==null)return null;if((0,B.isValidElement)(e)&&typeof e.props==`object`&&e.props!==null){var t=e.props;return g0(t)}return typeof e==`object`&&!Array.isArray(e)?g0(e):null}function v0(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(jbt(n)||Mbt(n)||h0(n))&&(t[n]=e[n]);return t}function Nbt(e){return e==null?null:(0,B.isValidElement)(e)?v0(e.props):typeof e==`object`&&!Array.isArray(e)?v0(e):null}var Pbt=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function y0(){return y0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y0.apply(null,arguments)}function Fbt(e,t){if(e==null)return{};var n,r,i=Ibt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ibt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var b0=(0,B.forwardRef)((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:s,title:c,desc:l}=e,u=Fbt(e,Pbt),d=a||{width:r,height:i,x:0,y:0},f=iy(`recharts-surface`,o);return B.createElement(`svg`,y0({},v0(u),{className:f,width:r,height:i,style:s,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`,ref:t}),B.createElement(`title`,null,c),B.createElement(`desc`,null,l),n)}),Lbt=[`children`,`className`];function x0(){return x0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x0.apply(null,arguments)}function Rbt(e,t){if(e==null)return{};var n,r,i=zbt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zbt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var S0=B.forwardRef((e,t)=>
823{var{children:n,className:r}=e,i=Rbt(e,Lbt),a=iy(`recharts-layer`,r);return B.createElement(`g`,x0({className:a},v0(i),{ref:t}),n)}),Bbt=(0,B.createContext)(null),Vbt=()=>(0,B.useContext)(Bbt);function C0(e){return function(){return e}}const Hbt=Math.cos,w0=Math.sin,T0=Math.sqrt,E0=Math.PI;E0/2;const D0=2*E0;var O0=Math.PI,k0=2*O0,A0=1e-6,Ubt=k0-A0;function Wbt(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Gbt(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Wbt;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var j0=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?Wbt:Gbt(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>A0)if(!(Math.abs(u*s-c*l)>A0)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((O0-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>A0&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>A0||Math.abs(this._y1-l)>A0)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%k0+k0),d>Ubt?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>A0&&this._append`A${n},${n},0,${+(d>=O0)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function Kbt(){return new j0}Kbt.prototype=j0.prototype;function M0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new j0(t)}Array.prototype.slice;function N0(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function qbt(e){this._context=e}qbt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function P0(e){return new qbt(e)}function Jbt(e){return e[0]}function Ybt(e){return e[1]}function Xbt(e,t){var n=C0(!0),r=null,i=P0,a=null,o=M0(s);e=typeof e==`function`?e:e===void 0?Jbt:C0(e),t=typeof t==`function`?t:t===void 0?Ybt:C0(t);function s(s){var c,l=(s=N0(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:C0(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:C0(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:C0(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function F0(e,t,n){var r=null,i=C0(!0),a=null,o=P0,s=null,c=M0(l);e=typeof e==`function`?e:e===void 0?Jbt:C0(+e),t=typeof t==`function`?t:C0(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Ybt:C0(+n);function l(l){var u,d,f,p=(l=N0(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Xbt().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:C0(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:C0(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:C0(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:C0(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:C0(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:C0(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:C0(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var Zbt=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function Qbt(e){return new Zbt(e,!0)}function $bt(e){return new Zbt(e,!1)}var I0={draw(e,t){let n=T0(t/E0);e.moveTo(n,0),e.arc(0,0,n,0,D0)}},ext={draw(e,t){let n=T0(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},txt=T0(1/3),nxt=txt*2,rxt={draw(e,t){let n=T0(t/nxt),r=n*txt;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ixt={draw(e,t){let n=T0(t),r=-n/2;e.rect(r,r,n,n)}},axt=.8908130915292852,oxt=w0(E0/10)/w0(7*E0/10),sxt=w0(D0/10)*oxt,cxt=-Hbt(
823D0/10)*oxt,lxt={draw(e,t){let n=T0(t*axt),r=sxt*n,i=cxt*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=D0*t/5,o=Hbt(a),s=w0(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},L0=T0(3),uxt={draw(e,t){let n=-T0(t/(L0*3));e.moveTo(0,n*2),e.lineTo(-L0*n,-n),e.lineTo(L0*n,-n),e.closePath()}},R0=-.5,z0=T0(3)/2,B0=1/T0(12),dxt=(B0/2+1)*3,fxt={draw(e,t){let n=T0(t/dxt),r=n/2,i=n*B0,a=r,o=n*B0+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(R0*r-z0*i,z0*r+R0*i),e.lineTo(R0*a-z0*o,z0*a+R0*o),e.lineTo(R0*s-z0*c,z0*s+R0*c),e.lineTo(R0*r+z0*i,R0*i-z0*r),e.lineTo(R0*a+z0*o,R0*o-z0*a),e.lineTo(R0*s+z0*c,R0*c-z0*s),e.closePath()}};function pxt(e,t){let n=null,r=M0(i);e=typeof e==`function`?e:C0(e||I0),t=typeof t==`function`?t:C0(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:C0(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:C0(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function V0(){}function H0(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function mxt(e){this._context=e}mxt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:H0(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:H0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hxt(e){return new mxt(e)}function gxt(e){this._context=e}gxt.prototype={areaStart:V0,areaEnd:V0,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:H0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _xt(e){return new gxt(e)}function vxt(e){this._context=e}vxt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:H0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yxt(e){return new vxt(e)}function bxt(e){this._context=e}bxt.prototype={areaStart:V0,areaEnd:V0,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function xxt(e){return new bxt(e)}function Sxt(e){return e<0?-1:1}function Cxt(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Sxt(a)+Sxt(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function wxt(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function U0(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function W0(e){this._context=e}W0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:U0(this,this._t0,wxt(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,U0(this,wxt(this,n=Cxt(this,e,t)),n);break;
823default:U0(this,this._t0,n=Cxt(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Txt(e){this._context=new Ext(e)}(Txt.prototype=Object.create(W0.prototype)).point=function(e,t){W0.prototype.point.call(this,t,e)};function Ext(e){this._context=e}Ext.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Dxt(e){return new W0(e)}function Oxt(e){return new Txt(e)}function kxt(e){this._context=e}kxt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Axt(e),i=Axt(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Axt(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function jxt(e){return new kxt(e)}function G0(e,t){this._context=e,this._t=t}G0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function Mxt(e){return new G0(e,.5)}function Nxt(e){return new G0(e,0)}function Pxt(e){return new G0(e,1)}function K0(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function q0(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function Fxt(e,t){return e[t]}function Ixt(e){let t=[];return t.key=e,t}function Lxt(){var e=C0([]),t=q0,n=K0,r=Fxt;function i(i){var a=Array.from(e.apply(this,arguments),Ixt),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=N0(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:C0(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:C0(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?q0:typeof e==`function`?e:C0(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??K0,i):n},i}function Rxt(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}K0(e,t)}}function zxt(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}K0(e,t)}}function Bxt(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,K0(e,t)}}var Vxt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e===`__proto__`}e.isUnsafeProperty=t})),Hxt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}e.isDeepKey=t})),J0=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`
823:String(e)}e.toKey=t})),Uxt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(t).join(`,`);let n=String(e);return n===`0`&&Object.is(Number(e),-0)?`-0`:n}e.toString=t})),Y0=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Uxt(),n=J0();function r(e){if(Array.isArray(e))return e.map(n.toKey);if(typeof e==`symbol`)return[e];e=t.toString(e);let r=[],i=e.length;if(i===0)return r;let a=0,o=``,s=``,c=!1;for(e.charCodeAt(0)===46&&(r.push(``),a++);a<i;){let t=e[a];s?t===`\\`&&a+1<i?(a++,o+=e[a]):t===s?s=``:o+=t:c?t===`"`||t===`'`?s=t:t===`]`?(c=!1,r.push(o),o=``):o+=t:t===`[`?(c=!0,o&&=(r.push(o),``)):t===`.`?o&&=(r.push(o),``):o+=t,a++}return o&&r.push(o),r}e.toPath=r})),X0=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Vxt(),n=Hxt(),r=J0(),i=Y0();function a(e,s,c){if(e==null)return c;switch(typeof s){case`string`:{if(t.isUnsafeProperty(s))return c;let r=e[s];return r===void 0?n.isDeepKey(s)?a(e,i.toPath(s),c):c:r}case`number`:case`symbol`:{typeof s==`number`&&(s=r.toKey(s));let t=e[s];return t===void 0?c:t}default:{if(Array.isArray(s))return o(e,s,c);if(s=Object.is(s?.valueOf(),-0)?`-0`:String(s),t.isUnsafeProperty(s))return c;let n=e[s];return n===void 0?c:n}}}function o(e,n,r){if(n.length===0)return r;let i=e;for(let e=0;e<n.length;e++){if(i==null||t.isUnsafeProperty(n[e]))return r;i=i[n[e]]}return i===void 0?r:i}e.get=a})),Z0=s(((e,t)=>{t.exports=X0().get})),Wxt=4;function Q0(e){var t=10**(arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wxt),n=Math.round(e*t)/t;return Object.is(n,-0)?0:n}function $0(e){var t=[...arguments].slice(1);return e.reduce((e,n,r)=>{var i=t[r-1];return typeof i==`string`?e+i+n:i===void 0?e+n:e+Q0(i)+n},``)}var Gxt=u(Z0()),e2=e=>e===0?0:e>0?1:-1,t2=e=>typeof e==`number`&&e!=+e,n2=e=>typeof e==`string`&&e.indexOf(`%`)===e.length-1,r2=e=>(typeof e==`number`||e instanceof Number)&&!t2(e),i2=e=>r2(e)||typeof e==`string`,Kxt=0,a2=e=>{var t=++Kxt;return`${e||``}${t}`},o2=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!r2(e)&&typeof e!=`string`)return n;var i;if(n2(e)){if(t==null)return n;var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return t2(i)&&(i=n),r&&t!=null&&i>t&&(i=t),i},qxt=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function s2(e,t,n){return r2(e)&&r2(t)?Q0(e+n*(t-e)):t}function Jxt(e,t,n){if(!(!e||!e.length))return e.find(e=>e&&(typeof t==`function`?t(e):(0,Gxt.default)(e,t))===n)}var c2=e=>e==null,l2=e=>c2(e)?e:`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function u2(e){return e!=null}function d2(){}var Yxt=[`type`,`size`,`sizeType`];function f2(){return f2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f2.apply(null,arguments)}function Xxt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Zxt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Xxt(Object(n),!0).forEach(function(t){Qxt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xxt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Qxt(e,t,n){return(t=$xt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $xt(e){var t=eSt(e,`string`);return typeof t==`symbol`?t:t+``}function eSt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function tSt(e,t){if(e==null)return{};var n,r,i=nSt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nSt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rSt={symbolCircle:I0,symbolCross:ext,symbolDiamond:rxt,symbolSquare:ixt,symbolStar:lxt,
823symbolTriangle:uxt,symbolWye:fxt},iSt=Math.PI/180,aSt=e=>rSt[`symbol${l2(e)}`]||I0,oSt=(e,t,n)=>{if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*iSt;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},sSt=(e,t)=>{rSt[`symbol${l2(e)}`]=t},p2=e=>{var{type:t=`circle`,size:n=64,sizeType:r=`area`}=e,i=Zxt(Zxt({},tSt(e,Yxt)),{},{type:t,size:n,sizeType:r}),a=`circle`;typeof t==`string`&&(a=t);var o=()=>{var e=aSt(a),t=pxt().type(e).size(oSt(n,r,a))();if(t!==null)return t},{className:s,cx:c,cy:l}=i,u=v0(i);return r2(c)&&r2(l)&&r2(n)?B.createElement(`path`,f2({},u,{className:iy(`recharts-symbols`,s),transform:`translate(${c}, ${l})`,d:o()})):null};p2.registerSymbol=sSt;var cSt=e=>`radius`in e&&`startAngle`in e&&`endAngle`in e,lSt=(e,t)=>{if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,B.isValidElement)(e)&&(n=e.props),typeof n!=`object`&&typeof n!=`function`)return null;var r={};return Object.keys(n).forEach(e=>{h0(e)&&typeof n[e]==`function`&&(r[e]=t||(t=>n[e](n,t)))}),r}
823,uSt=(e,t,n)=>r=>(e(t,n,r),null),m2=(e,t,n)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];h0(i)&&typeof a==`function`&&(r||={},r[i]=uSt(a,t,n))}),r};function dSt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fSt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dSt(Object(n),!0).forEach(function(t){pSt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dSt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pSt(e,t,n){return(t=mSt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mSt(e){var t=hSt(e,`string`);return typeof t==`symbol`?t:t+``}function hSt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function h2(e,t){var n=fSt({},e),r=t;return Object.keys(t).reduce((e,t)=>(e[t]===void 0&&r[t]!==void 0&&(e[t]=r[t]),e),n)}function g2(){return g2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g2.apply(null,arguments)}function gSt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _St(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gSt(Object(n),!0).forEach(function(t){vSt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gSt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vSt(e,t,n){return(t=ySt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ySt(e){var t=bSt(e,`string`);return typeof t==`symbol`?t:t+``}function bSt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var _2=32,xSt={align:`center`,iconSize:14,inactiveColor:`#ccc`,layout:`horizontal`,verticalAlign:`middle`,labelStyle:{}};function SSt(e){if(typeof e==`object`&&e&&`strokeDasharray`in e)return String(e.strokeDasharray)}function CSt(e){var{data:t,iconType:n,inactiveColor:r}=e,i=_2/2,a=_2/6,o=_2/3,s=t.inactive?r:t.color,c=n??t.type;if(c===`none`)return null;if(c===`plainline`)return B.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:s,strokeDasharray:SSt(t.payload),x1:0,y1:i,x2:_2,y2:i,className:`recharts-legend-icon`});if(c===`line`)return B.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:s,d:`M0,${i}h${o} 824 A${a},${a},0,1,1,${2*o},${i} 825 H${_2}M${2*o},${i} 826 A${a},${a},0,1,1,${o},${i}`,className:`recharts-legend-icon`});if(c===`rect`)return B.createElement(`path`,{stroke:`none`,fill:s,d:`M0,${_2/8}h${_2}v${_2*3/4}h${-_2}z`,className:`recharts-legend-icon`});if(B.isValidElement(t.legendIcon)){var l=_St({},t);return delete l.legendIcon,B.cloneElement(t.legendIcon,l)}return B.createElement(p2,{fill:s,cx:i,cy:i,size:_2,sizeType:`diameter`,type:c})}function wSt(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:s}=e,c={x:0,y:0,width:_2,height:_2},l={display:r===`horizontal`?`inline-block`:`block`,marginRight:10},u={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return t.map((t,r)=>{var d=t.formatter||i,f=iy({"recharts-legend-item":!0,[`legend-item-${r}`]:!0,inactive:t.inactive});if(t.type===`none`)return null;var p=typeof s==`object`?_St({},s):{};p.color=t.inactive?a:p.color||t.color;var m=d?d(t.value,t,r):t.value;return B.createElement(`li`,g2({className:f,style:l,key:`legend-item-${r}`},m2(e,t,r)),B.createElement(b0,{width:n,height:n,viewBox:c,style:u,"aria-label":`${m} legend icon`},B.createElement(CSt,{data:t,iconType:o,inactiveColor:a})),B.createElement(`span`,{className:`recharts-legend-item-text`,style:p},m))})}var TSt=e=>{var t=h2(e,xSt),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r===`horizontal`?i:`left`};return B.createElement(`ul`,{className:`recharts-default-legend`,style:a},B.createElement(wSt,g2({},t,{payload:n})))},ESt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){let n=new Map;for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}e.uniqBy=t})),DSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}e.ary=t})),OSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e}e.identity=t})),kSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Number.isSafeInteger(e)&&e>=0}e.isLength=t})),ASt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=kSt();function n(e){return e!=null&&typeof e!=`function`&&t.isLength(e.length)}e.isArrayLike=n})),jSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`object`&&!!e}e.isObjectLike=t})),MSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=ASt(),n=jSt();function r(e){return n.isObjectLike(e)&&t.isArrayLike(e)}e.isArrayLikeObject=r})),NSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=X0();function n(e){return function(n){return t.get(n,e)}}e.property=n})),PSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}e.isObject=t})),FSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null||typeof e!=`object`&&typeof e!=`function`}e.isPrimitive=t})),ISt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}e.isEqualsSameValueZero=t})),LSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=PSt(),n=FSt(),r=ISt();function i(e,t,n){return typeof n==`function`?a(e,t,function e(t,r,i,o,s,c){let l=n(t,r,i,o,s,c);return l===void 0?a(t,r,e,c):!!l},new Map):i(e,t,()=>void 0)}function a(e,n,i,s){if(n===e)return!0;switch(typeof n){case`object`:return o(e,n,i,s);case`function`:return Object.keys(n).length>0?a(e,{...n},i,s):r.isEqualsSameValueZero(e,n);default:return t.isObject(e)?typeof n==`string`?n===``:!0:r.isEqualsSameValueZero(e,n)}}function o(e,t,r,i){if(t==null)return!0;
826if(Array.isArray(t))return c(e,t,r,i);if(t instanceof Map)return s(e,t,r,i);if(t instanceof Set)return l(e,t,r,i);let a=Object.keys(t);if(e==null||n.isPrimitive(e))return a.length===0;if(a.length===0)return!0;if(i?.has(t))return i.get(t)===e;i?.set(t,e);try{for(let o=0;o<a.length;o++){let s=a[o];if(!n.isPrimitive(e)&&!(s in e)||t[s]===void 0&&e[s]!==void 0||t[s]===null&&e[s]!==null||!r(e[s],t[s],s,e,t,i))return!1}return!0}finally{i?.delete(t)}}function s(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(let[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function c(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;let i=new Set;for(let a=0;a<t.length;a++){let o=t[a],s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;let l=e[c],u=!1;if(n(l,o,a,e,t,r)&&(u=!0),u){i.add(c),s=!0;break}}if(!s)return!1}return!0}function l(e,t,n,r){return t.size===0?!0:e instanceof Set?c([...e],[...t],n,r):!1}e.isMatchWith=i,e.isSetMatch=l})),RSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=LSt();function n(e,n){return t.isMatchWith(e,n,()=>void 0)}e.isMatch=n})),zSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}e.getSymbols=t})),v2=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}e.getTag=t})),BSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),e.argumentsTag=`[object Arguments]`,e.arrayBufferTag=`[object ArrayBuffer]`,e.arrayTag=`[object Array]`,e.bigInt64ArrayTag=`[object BigInt64Array]`,e.bigUint64ArrayTag=`[object BigUint64Array]`,e.booleanTag=`[object Boolean]`,e.dataViewTag=`[object DataView]`,e.dateTag=`[object Date]`,e.errorTag=`[object Error]`,e.float32ArrayTag=`[object Float32Array]`,e.float64ArrayTag=`[object Float64Array]`,e.functionTag=`[object Function]`,e.int16ArrayTag=`[object Int16Array]`,e.int32ArrayTag=`[object Int32Array]`,e.int8ArrayTag=`[object Int8Array]`,e.mapTag=`[object Map]`,e.numberTag=`[object Number]`,e.objectTag=`[object Object]`,e.regexpTag=`[object RegExp]`,e.setTag=`[object Set]`,e.stringTag=`[object String]`,e.symbolTag=`[object Symbol]`,e.uint16ArrayTag=`[object Uint16Array]`,e.uint32ArrayTag=`[object Uint32Array]`,e.uint8ArrayTag=`[object Uint8Array]`,e.uint8ClampedArrayTag=`[object Uint8ClampedArray]`})),VSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}e.isTypedArray=t})),HSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=zSt(),n=v2(),r=BSt(),i=FSt(),a=VSt();function o(e,t){return s(e,void 0,e,new Map,t)}function s(e,t,n,r=new Map,o=void 0){let u=o?.(e,t,n,r);if(u!==void 0)return u;if(i.isPrimitive(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let i=0;i<e.length;i++)t[i]=s(e[i],i,n,r,o);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[i,a]of e)t.set(i,s(a,i,n,r,o));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let i of e)t.add(s(i,void 0,n,r,o));return t}if(typeof Buffer<`u`&&Buffer.isBuffer(e))return e.subarray();if(a.isTypedArray(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let i=0;i<e.length;i++)t[i]=s(e[i],i,n,r,o);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),c(t,e,n,r,o),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),c(t,e,n,r,o),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),c(t,e,n,r,o),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,c(t,e,n,r,o),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),c(t,e,n,r,o),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),c(t,e,n,r,o),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),c(t,e,n,r,o),t}if(typeof e==`object`&&l(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),c(t,e,n,r,o),t}return e}function c(e,n,r=e,i,a){let o=[...Object.keys(n),...t.getSymbols(n)];for(let t=0;t<o.length;t++){let c=o[t],l=Object.getOwnPropertyDescriptor(e,c);(l==null||l.writable)&&(e[c]=s(n[c],c,r,i,a))}}function l(e){switch(n.getTag(e)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=s,e.copyProperties=c})),USt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=HSt();function n(e){return t.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}e.cloneDeep=n})),WSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=RSt(),n=USt();function r(e){return e=n.cloneDeep(e),n=>t.isMatch(n,e)}e.matches=r})),GSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=HSt(),n=v2(),r=BSt();function i(e,i){return t.cloneDeepWith(e,(a,o,s,c)=>{let l=i?.(a,o,s,c);if(l!==void 0)return l;if(typeof e==`object`){if(n.getTag(e)===r.objectTag&&typeof e.constructor!=`function`){let n={};return c.set(e,n),t.copyProperties(n,e,s,c),n}switch(Object.prototype.toString.call(e)){case r.numberTag:case r.stringTag:case r.booleanTag:{let n=new e.constructor(e?.valueOf());return t.copyProperties(n,e),n}case r.argumentsTag:{let n={};return t.copyProperties(n,e),n.length=e.length,n[Symbol.iterator]=e[Symbol.iterator],n}default:return}}})}e.cloneDeepWith=i})),KSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=GSt();function n(e){return t.cloneDeepWith(e)}e.cloneDeep=n})),qSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=/^(?:0|[1-9]\d*)$/;function n(e,n=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<n;case`symbol`:return!1;case`string`:return t.test(e)}}e.isIndex=n})),JSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=v2();function n(e){return typeof e==`object`&&!!e&&t.getTag(e)===`[object Arguments]`}e.isArguments=n})),YSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Hxt(),n=qSt(),r=JSt(),i=Y0();function a(e,a){let o;if(o=Array.isArray(a)?a:typeof a==`string`&&t.isDeepKey(a)&&e?.[a]==null?i.toPath(a):[a],o.length===0)return!1;let s=e;for(let e=0;e<o.length;
826e++){let t=o[e];if((s==null||!Object.hasOwn(s,t))&&!((Array.isArray(s)||r.isArguments(s))&&n.isIndex(t)&&t<s.length))return!1;s=s[t]}return!0}e.has=a})),XSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=RSt(),n=J0(),r=KSt(),i=X0(),a=YSt();function o(e,o){switch(typeof e){case`object`:Object.is(e?.valueOf(),-0)&&(e=`-0`);break;case`number`:e=n.toKey(e);break}return o=r.cloneDeep(o),function(n){let r=i.get(n,e);return r===void 0?a.has(n,e):o===void 0?r===void 0:t.isMatch(r,o)}}e.matchesProperty=o})),ZSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=OSt(),n=NSt(),r=WSt(),i=XSt();function a(e){if(e==null)return t.identity;switch(typeof e){case`function`:return e;case`object`:return Array.isArray(e)&&e.length===2?i.matchesProperty(e[0],e[1]):r.matches(e);case`string`:case`symbol`:case`number`:return n.property(e)}}e.iteratee=a})),QSt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=ESt(),n=DSt(),r=OSt(),i=MSt(),a=ZSt();function o(e,o=r.identity){return i.isArrayLikeObject(e)?t.uniqBy(Array.from(e),n.ary(a.iteratee(o),1)):[]}e.uniqBy=o})),$St=u(s(((e,t)=>{t.exports=QSt().uniqBy}))());function eCt(e,t,n){return t===!0?(0,$St.default)(e,n):typeof t==`function`?(0,$St.default)(e,t):e}var y2=(0,B.createContext)(null),tCt=Mst(),nCt=e=>e,b2=()=>{var e=(0,B.useContext)(y2);return e?e.store.dispatch:nCt},x2=()=>{},rCt=()=>x2,iCt=(e,t)=>e===t;function S2(e){var t=(0,B.useContext)(y2),n=(0,B.useMemo)(()=>t?t=>{if(t!=null)return e(t)}:x2,[t,e]);return(0,tCt.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:rCt,t?t.store.getState:x2,t?t.store.getState:x2,n,iCt)}function aCt(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function oCt(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function sCt(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var cCt=e=>Array.isArray(e)?e:[e];function lCt(e){let t=Array.isArray(e[0])?e[0]:e;return sCt(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function uCt(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var dCt=class{constructor(e){this.value=e}deref(){return this.value}},fCt=typeof WeakRef<`u`?WeakRef:dCt,pCt=0,mCt=1;function C2(){return{s:pCt,v:void 0,o:null,p:null}}function hCt(e,t={}){let n=C2(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=C2(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=C2(),e.set(n,t)):t=r}}let s=t,c;if(t.s===mCt)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new fCt(c):c}return s.s=mCt,s.v=c,c}return o.clearCache=()=>{n=C2(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function gCt(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),aCt(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=hCt,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=cCt(c),p=cCt(u),m=lCt(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=uCt(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var $=gCt(hCt),_Ct=Object.assign((e,t=$)=>
826{oCt(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>_Ct}),vCt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}e.compareValues=(e,n,r)=>{if(e!==n){let i=t(e),a=t(n);if(i===a&&i===0){if(e<n)return r===`desc`?1:-1;if(e>n)return r===`desc`?-1:1}return r===`desc`?a-i:i-a}return 0}})),yCt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){return typeof e==`symbol`||e instanceof Symbol}e.isSymbol=t})),bCt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=yCt(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(e,i){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||t.isSymbol(e)?!0:typeof e==`string`&&(r.test(e)||!n.test(e))||i!=null&&Object.hasOwn(i,e)}e.isKey=i})),xCt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=vCt(),n=bCt(),r=Y0();function i(e,i,a,o){if(e==null)return[];a=o?void 0:a,Array.isArray(e)||(e=Object.values(e)),Array.isArray(i)||(i=i==null?[null]:[i]),i.length===0&&(i=[null]),Array.isArray(a)||(a=a==null?[]:[a]),a=a.map(e=>String(e));let s=(e,t)=>{let n=e;for(let e=0;e<t.length&&n!=null;++e)n=n[t[e]];return n},c=(e,t)=>t==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:s(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?s(t,e):typeof t==`object`?t[e]:t,l=i.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||n.isKey(e)?e:{key:e,path:r.toPath(e)}));return e.map(e=>({original:e,criteria:l.map(t=>c(t,e))})).slice().sort((e,n)=>{for(let r=0;r<l.length;r++){let i=t.compareValues(e.criteria[r],n.criteria[r],a[r]);if(i!==0)return i}return 0}).map(e=>e.original)}e.orderBy=i})),SCt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;a<e.length;a++){let o=e[a];Array.isArray(o)&&t<r?i(o,t+1):n.push(o)}};return i(e,0),n}e.flatten=t})),CCt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=qSt(),n=ASt(),r=PSt(),i=ISt();function a(e,a,o){return r.isObject(o)&&(typeof a==`number`&&n.isArrayLike(o)&&t.isIndex(a)&&a<o.length||typeof a==`string`&&a in o)?i.isEqualsSameValueZero(o[a],e):!1}e.isIterateeCall=a})),wCt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=xCt(),n=SCt(),r=CCt();function i(e,...i){let a=i.length;return a>1&&r.isIterateeCall(e,i[0],i[1])?i=[]:a>2&&r.isIterateeCall(i[0],i[1],i[2])&&(i=[i[0]]),t.orderBy(e,n.flatten(i),[`asc`])}e.sortBy=i})),w2=s(((e,t)=>{t.exports=wCt().sortBy})),TCt=u(w2()),ECt=e=>e.legend.settings,DCt=e=>e.legend.size,OCt=$([e=>e.legend.payload,ECt],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?(0,TCt.default)(r,n):r});function kCt(){return S2(OCt)}var T2=1;function ACt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=(0,B.useState)({height:0,left:0,top:0,width:0});return[t,(0,B.useCallback)(e=>{if(e!=null){var r=e.getBoundingClientRect(),i={height:r.height,left:r.left,top:r.top,width:r.width};(Math.abs(i.height-t.height)>T2||Math.abs(i.left-t.left)>T2||Math.abs(i.top-t.top)>T2||Math.abs(i.width-t.width)>T2)&&n({height:i.height,left:i.left,top:i.top,width:i.width})}},[t.width,t.height,t.top,t.left,...e])]}function E2(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var jCt=(()=>typeof Symbol==`function`&&Symbol.observable||`@@observable`)(),D2=()=>Math.random().toString(36).substring(7).split(``).join(`.`),O2={INIT:`@@redux/INIT${D2()}`,REPLACE:`@@redux/REPLACE${D2()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${D2()}`};function k2(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function MCt(e,t,n){if(typeof e!=`function`)throw Error(E2(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(E2(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(E2(1));return n(MCt)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(E2(3));return i}function d(e){if(typeof e!=`function`)throw Error(E2(4));if(c)throw Error(E2(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(E2(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!k2(e))throw Error(E2(7));if(e.type===void 0)throw Error(E2(8));if(typeof e.type!=`string`)throw Error(E2(17));if(c)throw Error(E2(9));try{c=!0,i=r(i,e)}finally{c=!1}
826return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(E2(10));r=e,f({type:O2.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(E2(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[jCt](){return this}}}return f({type:O2.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[jCt]:m}}function NCt(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:O2.INIT})===void 0)throw Error(E2(12));if(n(void 0,{type:O2.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(E2(13))})}function PCt(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{NCt(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(E2(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function A2(...e){return e.length===0?e=>e:e.length===1?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function FCt(...e){return t=>(n,r)=>{let i=t(n,r),a=()=>{throw Error(E2(15))},o={getState:i.getState,dispatch:(e,...t)=>a(e,...t)};return a=A2(...e.map(e=>e(o)))(i.dispatch),{...i,dispatch:a}}}function ICt(e){return k2(e)&&`type`in e&&typeof e.type==`string`}var LCt=Symbol.for(`immer-nothing`),RCt=Symbol.for(`immer-draftable`),j2=Symbol.for(`immer-state`);function M2(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var N2=Object,P2=N2.getPrototypeOf,F2=`constructor`,I2=`prototype`,L2=`configurable`,R2=`enumerable`,z2=`writable`,B2=`value`,V2=e=>!!e&&!!e[j2];function H2(e){return e?VCt(e)||q2(e)||!!e[RCt]||!!e[F2]?.[RCt]||J2(e)||Y2(e):!1}var zCt=N2[I2][F2].toString(),BCt=new WeakMap;function VCt(e){if(!e||!X2(e))return!1;let t=P2(e);if(t===null||t===N2[I2])return!0;let n=N2.hasOwnProperty.call(t,F2)&&t[F2];if(n===Object)return!0;if(!Z2(n))return!1;let r=BCt.get(n);return r===void 0&&(r=Function.toString.call(n),BCt.set(n,r)),r===zCt}function U2(e,t,n=!0){W2(e)===0?(n?Reflect.ownKeys(e):N2.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function W2(e){let t=e[j2];return t?t.type_:q2(e)?1:J2(e)?2:Y2(e)?3:0}var HCt=(e,t,n=W2(e))=>n===2?e.has(t):N2[I2].hasOwnProperty.call(e,t),G2=(e,t,n=W2(e))=>n===2?e.get(t):e[t],K2=(e,t,n,r=W2(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function UCt(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var q2=Array.isArray,J2=e=>e instanceof Map,Y2=e=>e instanceof Set,X2=e=>typeof e==`object`,Z2=e=>typeof e==`function`,Q2=e=>typeof e==`boolean`;function WCt(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var $2=e=>e.copy_||e.base_,e4=e=>e.modified_?e.copy_:e.base_;function t4(e,t){if(J2(e))return new Map(e);if(Y2(e))return new Set(e);if(q2(e))return Array[I2].slice.call(e);let n=VCt(e);if(t===!0||t===`class_only`&&!n){let t=N2.getOwnPropertyDescriptors(e);delete t[j2];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[z2]===!1&&(a[z2]=!0,a[L2]=!0),(a.get||a.set)&&(t[i]={[L2]:!0,[z2]:!0,[R2]:a[R2],[B2]:e[i]})}return N2.create(P2(e),t)}else{let t=P2(e);if(t!==null&&n)return{...e};let r=N2.create(t);return N2.assign(r,e)}}function n4(e,t=!1){return i4(e)||V2(e)||!H2(e)?e:(W2(e)>1&&N2.defineProperties(e,{set:r4,add:r4,clear:r4,delete:r4}),N2.freeze(e),t&&U2(e,(e,t)=>{n4(t,!0)},!1),e)}function GCt(){M2(2)}var r4={[B2]:GCt};function i4(e){return e===null||!X2(e)?!0:N2.isFrozen(e)}var a4=`MapSet`,o4=`Patches`,KCt=`ArrayMethods`,qCt={};function s4(e){let t=qCt[e];return t||M2(0,e),t}var JCt=e=>!!qCt[e],c4,YCt=()=>c4,XCt=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:JCt(a4)?s4(a4):void 0,arrayMethodsPlugin_:JCt(KCt)?s4(KCt):void 0});function ZCt(e,t){t&&(e.patchPlugin_=s4(o4),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function l4(e){u4(e),e.drafts_.forEach($Ct),e.drafts_=null}function u4(e){e===c4&&(c4=e.parent_)}var QCt=e=>c4=XCt(c4,e);function $Ct(e){let t=e[j2];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ewt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[j2].modified_&&(l4(t),M2(4)),H2(e)&&(e=twt(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[j2].base_,e,t)}else e=twt(t,n);return nwt(t,e,!0),l4(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===LCt?void 0:e}function twt(e,t){if(i4(t))return t;let n=t[j2];if(!n)return f4(t,e.handledSet_,e);if(!d4(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);swt(n,e)}return n.copy_}function nwt(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&n4(t,n)}function rwt(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var d4=(e,t)=>
vendor: 4,676 bytes, line 826
826e.scope_===t,iwt=[];function awt(e,t,n,r){let i=$2(e),a=e.type_;if(r!==void 0&&G2(i,r,a)===t){K2(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;U2(i,(e,n)=>{if(V2(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??iwt;for(let e of o)K2(i,e,n,a)}function owt(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!d4(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=e4(i);awt(e,i.draft_??i,a,n),swt(i,r)})}function swt(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}rwt(e)}}function cwt(e,t,n){let{scope_:r}=e;if(V2(n)){let i=n[j2];d4(i,r)&&i.callbacks_.push(function(){_4(e),awt(e,n,e4(i),t)})}else H2(n)&&e.callbacks_.push(function(){let i=$2(e);e.type_===3?i.has(n)&&f4(n,r.handledSet_,r):G2(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&f4(G2(e.copy_,t,e.type_),r.handledSet_,r)})}function f4(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||V2(e)||t.has(e)||!H2(e)||i4(e)?e:(t.add(e),U2(e,(r,i)=>{if(V2(i)){let t=i[j2];d4(t,n)&&(K2(e,r,e4(t),e.type_),rwt(t))}else H2(i)&&f4(i,t,n)}),e)}function lwt(e,t){let n=q2(e),r={type_:n?1:0,scope_:t?t.scope_:YCt(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=p4;n&&(i=[r],a=m4);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var p4={get(e,t){if(t===j2)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=$2(e);if(!HCt(i,t,e.type_))return uwt(e,i,t);let a=i[t];if(e.finalized_||!H2(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&WCt(t))return a;if(a===h4(e.base_,t)){_4(e);let n=e.type_===1?+t:t,r=v4(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in $2(e)},ownKeys(e){return Reflect.ownKeys($2(e))},set(e,t,n){let r=dwt($2(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=h4($2(e),t),i=r?.[j2];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(UCt(n,r)&&(n!==void 0||HCt(e.base_,t,e.type_)))return!0;_4(e),g4(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),cwt(e,t,n),!0)},deleteProperty(e,t){return _4(e),h4(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),g4(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=$2(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[z2]:!0,[L2]:e.type_!==1||t!==`length`,[R2]:r[R2],[B2]:n[t]}},defineProperty(){M2(11)},getPrototypeOf(e){return P2(e.base_)},setPrototypeOf(){M2(12)}},m4={};for(let e in p4){let t=p4[e];m4[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}m4.deleteProperty=function(e,t){return m4.set.call(this,e,t,void 0)},m4.set=function(e,t,n){return p4.set.call(this,e[0],t,n,e[0])};function h4(e,t){let n=e[j2];return(n?$2(n):e)[t]}function uwt(e,t,n){let r=dwt(t,n);return r?B2 in r?r[B2]:r.get?.call(e.draft_):void 0}function dwt(e,t){if(!(t in e))return;let n=P2(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=P2(n)}}function g4(e){e.modified_||(e.modified_=!0,e.parent_&&g4(e.parent_))}function _4(e){e.copy_||=(e.assigned_=new Map,t4(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var fwt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(Z2(e)&&!Z2(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}Z2(t)||M2(6),n!==void 0&&!Z2(n)&&M2(7);let r;if(H2(e)){let i=QCt(this),a=v4(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?l4(i):u4(i)}return ZCt(i,n),ewt(r,i)}else if(!e||!X2(e)){if(r=t(e),r===void 0&&(r=e),r===LCt&&(r=void 0),this.autoFreeze_&&n4(r,!0),n){let t=[],i=[];s4(o4).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else M2(1,e)},this.produceWithPatches=(e,t)=>{if(Z2(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},Q2(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Q2(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Q2(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){H2(e)||M2(8),V2(e)&&(e=y4(e));let t=QCt(this),n=v4(t,e,void 0);return n[j2].isManual_=!0,u4(t),n}finishDraft(e,t){let n=e&&e[j2];(!n||!n.isManual_)&&M2(9);let{scope_:r}=n;
826return ZCt(r,t),ewt(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=s4(o4).applyPatches_;return V2(e)?r(e,t):this.produce(e,e=>r(e,t))}};function v4(e,t,n,r){let[i,a]=J2(t)?s4(a4).proxyMap_(t,n):Y2(t)?s4(a4).proxySet_(t,n):lwt(t,n);return(n?.scope_??YCt()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?owt(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function y4(e){return V2(e)||M2(10,e),pwt(e)}function pwt(e){if(!H2(e)||i4(e))return e;let t=e[j2],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=t4(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=t4(e,!0);return U2(n,(e,t)=>{K2(n,e,pwt(t))},r),t&&(t.finalized_=!1),n}var mwt=new fwt().produce;function hwt(e){return({dispatch:t,getState:n})=>r=>i=>typeof i==`function`?i(t,n,e):r(i)}var gwt=hwt(),_wt=hwt,vwt=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]==`object`?A2:A2.apply(null,arguments)};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function b4(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw Error(I4(0));return{type:e,payload:r.payload,...`meta`in r&&{meta:r.meta},...`error`in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>ICt(t)&&t.type===e,n}var ywt=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function bwt(e){return H2(e)?mwt(e,()=>{}):e}function x4(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function xwt(e){return typeof e==`boolean`}var Swt=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},a=new ywt;return t&&(xwt(t)?a.push(gwt):a.push(_wt(t.extraArgument))),a},Cwt=`RTK_autoBatch`,S4=()=>e=>({payload:e,meta:{[Cwt]:!0}}),wwt=e=>t=>{setTimeout(t,e)},Twt=(e={type:`raf`})=>t=>(...n)=>{let r=t(...n),i=!0,a=!1,o=!1,s=new Set,c=e.type===`tick`?queueMicrotask:e.type===`raf`?typeof window<`u`&&window.requestAnimationFrame?window.requestAnimationFrame:wwt(10):e.type===`callback`?e.queueNotification:wwt(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return i=!e?.meta?.[Cwt],a=!i,a&&(o||(o=!0,c(l))),r.dispatch(e)}finally{i=!0}}})},Ewt=e=>function(t){let{autoBatch:n=!0}=t??{},r=new ywt(e);return n&&r.push(Twt(typeof n==`object`?n:void 0)),r};function Dwt(e){let t=Swt(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:a=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{},c;if(typeof n==`function`)c=n;else if(k2(n))c=PCt(n);else throw Error(I4(1));let l;l=typeof r==`function`?r(t):t();let u=A2;i&&(u=vwt({trace:!1,...typeof i==`object`&&i}));let d=Ewt(FCt(...l)),f=typeof s==`function`?s(d):d(),p=u(...f);return MCt(c,o,p)}function Owt(e){let t={},n=[],r,i={addCase(e,n){let r=typeof e==`string`?e:e.type;if(!r)throw Error(I4(28));if(r in t)throw Error(I4(29));return t[r]=n,i},addAsyncThunk(e,r){return r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}function kwt(e){return typeof e==`function`}function Awt(e,t){let[n,r,i]=Owt(t),a;if(kwt(e))a=()=>bwt(e());else{let t=bwt(e);a=()=>t}function o(e=a(),t){let o=[n[t.type],...r.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return o.filter(e=>!!e).length===0&&(o=[i]),o.reduce((e,n)=>{if(n)if(V2(e)){let r=n(e,t);return r===void 0?e:r}else if(H2(e))return mwt(e,e=>n(e,t));else{let r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}return e},e)}return o.getInitialState=a,o}var jwt=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,Mwt=(e=21)=>{let t=``,n=e;for(;n--;)t+=jwt[Math.random()*64|0];return t},Nwt=Symbol.for(`rtk-slice-createasyncthunk`);function Pwt(e,t){return`${e}/${t}`}function Fwt({creators:e}={}){let t=e?.asyncThunk?.[Nwt];return function(e){let{name:n,reducerPath:r=n}=e;if(!n)throw Error(I4(11));let i=(typeof e.reducers==`function`?e.reducers(Lwt()):e.reducers)||{},a=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){let n=typeof e==`string`?e:e.type;if(!n)throw Error(I4(12));if(n in o.sliceCaseReducersByType)throw Error(I4(13));return o.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return o.actionCreators[e]=t,s},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,s}};a.forEach(r=>{let a=i[r],o={reducerName:r,type:Pwt(n,r),createNotation:typeof e.reducers==`function`};zwt(a)?Vwt(o,a,s,t):Rwt(o,a,s)});function c(){let[t={},n=[],r=void 0]=typeof e.extraReducers==`function`?Owt(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return Awt(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}let l=e=>e,u=new Map,d=new WeakMap,f;function p(e,t){return f||=c(),f(e,t)}function m(){return f||=c(),f.getInitialState()}function h(t,n=!1){function r(e){let i=e[t];return i===void 0&&n&&(i=x4(d,r,m)),i}function i(t=l){return x4(x4(u,n,()=>new WeakMap),t,()=>{let r={};for(let[i,a]of Object.entries(e.selectors??{}))r[i]=Iwt(a,t,()=>x4(d,t,m),n);return r})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let g={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...h(r),injectInto(e,{reducerPath:t,...n}={}){let i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...g,...h(i,!0)}}};return g}}function Iwt(e,t,n,r){function i(i,...a){let o=t(i);
vendor: 4,306 bytes, line 826
826return o===void 0&&r&&(o=n()),e(o,...a)}return i.unwrapped=e,i}var C4=Fwt();function Lwt(){function e(e,t){return{_reducerDefinitionType:`asyncThunk`,payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:`reducer`})},preparedReducer(e,t){return{_reducerDefinitionType:`reducerWithPrepare`,prepare:e,reducer:t}},asyncThunk:e}}function Rwt({type:e,reducerName:t,createNotation:n},r,i){let a,o;if(`reducer`in r){if(n&&!Bwt(r))throw Error(I4(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?b4(e,o):b4(e))}function zwt(e){return e._reducerDefinitionType===`asyncThunk`}function Bwt(e){return e._reducerDefinitionType===`reducerWithPrepare`}function Vwt({type:e,reducerName:t},n,r,i){if(!i)throw Error(I4(18));let{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,d=i(e,a,u);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:o||w4,pending:s||w4,rejected:c||w4,settled:l||w4})}function w4(){}var Hwt=`task`,Uwt=`listener`,Wwt=`completed`,T4=`cancelled`,Gwt=`task-${T4}`,Kwt=`task-${Wwt}`,E4=`${Uwt}-${T4}`,qwt=`${Uwt}-${Wwt}`,D4=class{constructor(e){this.code=e,this.message=`${Hwt} ${T4} (reason: ${e})`}name=`TaskAbortError`;message},O4=(e,t)=>{if(typeof e!=`function`)throw TypeError(I4(32))},k4=()=>{},Jwt=(e,t=k4)=>(e.catch(t),e),Ywt=(e,t)=>(e.addEventListener(`abort`,t,{once:!0}),()=>e.removeEventListener(`abort`,t)),A4=e=>{if(e.aborted)throw new D4(e.reason)};function Xwt(e,t){let n=k4;return new Promise((r,i)=>{let a=()=>i(new D4(e.reason));if(e.aborted){a();return}n=Ywt(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=k4})}var Zwt=async(e,t)=>{try{return await Promise.resolve(),{status:`ok`,value:await e()}}catch(e){return{status:e instanceof D4?`cancelled`:`rejected`,error:e}}finally{t?.()}},j4=e=>t=>Jwt(Xwt(e,t).then(t=>(A4(e),t))),Qwt=e=>{let t=j4(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:M4}=Object,$wt={},N4=`listenerMiddleware`,eTt=(e,t)=>{let n=t=>Ywt(e,()=>t.abort(e.reason));return(r,i)=>{O4(r,`taskExecutor`);let a=new AbortController;n(a);let o=Zwt(async()=>{A4(e),A4(a.signal);let t=await r({pause:j4(a.signal),delay:Qwt(a.signal),signal:a.signal});return A4(a.signal),t},()=>a.abort(Kwt));return i?.autoJoin&&t.push(o.catch(k4)),{result:j4(e)(o),cancel(){a.abort(Gwt)}}}},tTt=(e,t)=>{let n=async(n,r)=>{A4(t);let i=()=>{},a=[new Promise((t,r)=>{let a=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{a(),r()}})];r!=null&&a.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await Xwt(t,Promise.race(a));return A4(t),e}finally{i()}};return(e,t)=>Jwt(n(e,t))},nTt=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=b4(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw Error(I4(21));return O4(a,`options.listener`),{predicate:i,type:t,effect:a}},rTt=M4(e=>{let{type:t,predicate:n,effect:r}=nTt(e);return{id:Mwt(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(I4(22))}}},{withTypes:()=>rTt}),iTt=(e,t)=>{let{type:n,effect:r,predicate:i}=nTt(t);return Array.from(e.values()).find(e=>(typeof n==`string`?e.type===n:e.predicate===i)&&e.effect===r)},P4=e=>{e.pending.forEach(e=>{e.abort(E4)})},aTt=(e,t)=>()=>{for(let e of t.keys())P4(e);e.clear()},oTt=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},sTt=M4(b4(`${N4}/add`),{withTypes:()=>sTt}),cTt=b4(`${N4}/removeAll`),lTt=M4(b4(`${N4}/remove`),{withTypes:()=>lTt}),uTt=(...e)=>{console.error(`${N4}/error`,...e)},F4=(e={})=>{let t=new Map,n=new Map,r=e=>{let t=n.get(e)??0;n.set(e,t+1)},i=e=>{let t=n.get(e)??1;t===1?n.delete(e):n.set(e,t-1)},{extra:a,onError:o=uTt}=e;O4(o,`onError`);let s=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&P4(e)}),c=e=>s(iTt(t,e)??rTt(e));M4(c,{withTypes:()=>c});let l=e=>{let n=iTt(t,e);return n&&(n.unsubscribe(),e.cancelActive&&P4(n)),!!n};M4(l,{withTypes:()=>l});let u=async(e,n,s,l)=>{let u=new AbortController,d=tTt(c,u.signal),f=[];try{e.pending.add(u),r(e),await Promise.resolve(e.effect(n,M4({},s,{getOriginalState:l,condition:(e,t)=>
826d(e,t).then(Boolean),take:d,delay:Qwt(u.signal),pause:j4(u.signal),extra:a,signal:u.signal,fork:eTt(u.signal,f),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(e.abort(E4),n.delete(e))})},cancel:()=>{u.abort(E4),e.pending.delete(u)},throwIfCancelled:()=>{A4(u.signal)}})))}catch(e){e instanceof D4||oTt(o,e,{raisedBy:`effect`})}finally{await Promise.all(f),u.abort(qwt),i(e),e.pending.delete(u)}},d=aTt(t,n);return{middleware:e=>n=>r=>{if(!ICt(r))return n(r);if(sTt.match(r))return c(r.payload);if(cTt.match(r)){d();return}if(lTt.match(r))return l(r.payload);let i=e.getState(),a=()=>{if(i===$wt)throw Error(I4(23));return i},s;try{if(s=n(r),t.size>0){let n=e.getState(),s=Array.from(t.values());for(let t of s){let s=!1;try{s=t.predicate(r,n,i)}catch(e){s=!1,oTt(o,e,{raisedBy:`predicate`})}s&&u(t,r,e,a)}}}finally{i=$wt}return s},startListening:c,stopListening:l,clearListeners:d}};function I4(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var dTt=C4({name:`chartLayout`,initialState:{layoutType:`horizontal`,width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){e.margin.top=t.payload.top??0,e.margin.right=t.payload.right??0,e.margin.bottom=t.payload.bottom??0,e.margin.left=t.payload.left??0},setScale(e,t){e.scale=t.payload}}}),{setMargin:fTt,setLayout:pTt,setChartSize:mTt,setScale:hTt}=dTt.actions,gTt=dTt.reducer;function _Tt(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function L4(e){return Number.isFinite(e)}function R4(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}var vTt=u(w2()),yTt=u(Z0());function bTt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?bTt(Object(n),!0).forEach(function(t){xTt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bTt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xTt(e,t,n){return(t=STt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function STt(e){var t=CTt(e,`string`);return typeof t==`symbol`?t:t+``}function CTt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function B4(e,t,n){return c2(e)||c2(t)?n:i2(t)?(0,yTt.default)(e,t,n):typeof t==`function`?t(e):n}var wTt=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:s}=t;if((s===`vertical`||s===`horizontal`&&o===`middle`)&&a!==`center`&&r2(e[a]))return z4(z4({},e),{},{[a]:e[a]+(r||0)});if((s===`horizontal`||s===`vertical`&&a===`center`)&&o!==`middle`&&r2(e[o]))return z4(z4({},e),{},{[o]:e[o]+(i||0)})}return e},V4=(e,t)=>e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`,TTt=(e,t,n,r)=>{if(r)return e.map(e=>e.coordinate);var i,a,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate));return i||o.push(t),a||o.push(n),o},ETt=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:s,isCategorical:c,categoricalDomain:l,tickCount:u,ticks:d,niceTicks:f,axisType:p}=e;if(!o)return null;var m=s===`scaleBand`&&o.bandwidth?o.bandwidth()/2:2,h=(t||n)&&i===`category`&&o.bandwidth?o.bandwidth()/m:0;return h=p===`angleAxis`&&a&&a.length>=2?e2(a[0]-a[1])*2*h:h,t&&(d||f)?(d||f||[]).map((e,t)=>{var n=r?r.indexOf(e):e,i=o.map(n);return L4(i)?{coordinate:i+h,value:e,offset:h,index:t}:null}).filter(u2):c&&l?l.map((e,t)=>{var n=o.map(e);return L4(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(u2):o.ticks&&!n&&u!=null?o.ticks(u).map((e,t)=>{var n=o.map(e);return L4(n)?{coordinate:n+h,value:e,index:t,offset:h}:null}).filter(u2):o.domain().map((e,t)=>{var n=o.map(e);return L4(n)?{coordinate:n+h,value:r?r[e]:e,index:t,offset:h}:null}).filter(u2)},DTt=(e,t)=>
826{if(!t||t.length!==2||!r2(t[0])||!r2(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!r2(e[0])||e[0]<n)&&(i[0]=n),(!r2(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},OTt={sign:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0,o=0;o<t;++o){var s=e[o]?.[r];if(s!=null){var c=s[1],l=s[0],u=t2(c)?l:c;u>=0?(s[0]=i,i+=u,s[1]=i):(s[0]=a,a+=u,s[1]=a)}}}},expand:Rxt,none:K0,silhouette:zxt,wiggle:Bxt,positive:e=>{var t=e.length;if(!(t<=0)){var n=e[0]?.length;if(!(n==null||n<=0))for(var r=0;r<n;++r)for(var i=0,a=0;a<t;++a){var o=e[a]?.[r];if(o!=null){var s=t2(o[1])?o[0]:o[1];s>=0?(o[0]=i,i+=s,o[1]=i):(o[0]=0,o[1]=0)}}}}},kTt=(e,t,n)=>{var r=OTt[n]??K0,i=Lxt().keys(t).value((e,t)=>Number(B4(e,t,0))).order(q0).offset(r)(e);return i.forEach((n,r)=>{n.forEach((n,i)=>{var a=B4(e[i],t[r],0);Array.isArray(a)&&a.length===2&&r2(a[0])&&r2(a[1])&&(n[0]=a[0],n[1]=a[1])})}),i};function ATt(e){return e==null?void 0:String(e)}function jTt(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!c2(i[t.dataKey])){var s=Jxt(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=B4(i,c2(o)?t.dataKey:o),l=t.scale.map(c);return r2(l)?l:null}var MTt=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=B4(a,t.dataKey,t.scale.domain()[o]);if(c2(s))return null;var c=t.scale.map(s);return r2(c)?c-i/2+r:null},NTt=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},PTt=e=>{var t=e.flat(2).filter(r2);return[Math.min(...t),Math.max(...t)]},FTt=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],ITt=(e,t,n)=>{if(e!=null)return FTt(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,s=o.reduce((e,r)=>{var i=PTt(_Tt(r,t,n));return!L4(i[0])||!L4(i[1])?e:[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},LTt=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,RTt=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,zTt=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,vTt.default)(t,e=>e.coordinate),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c?.coordinate||0)-(l?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function BTt(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return z4(z4({},t),{},{dataKey:n,payload:r,value:i,name:a})}function H4(e,t){if(e)return String(e);if(typeof t==`string`)return t}var VTt=(e,t)=>{if(t===`horizontal`)return e.relativeX;if(t===`vertical`)return e.relativeY},HTt=(e,t)=>t===`centric`?e.angle:e.radius,U4=e=>e.layout.width,W4=e=>e.layout.height,UTt=e=>e.layout.scale,WTt=e=>e.layout.margin,G4=$(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),K4=$(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),GTt=`data-recharts-item-index`,KTt=`data-recharts-item-id`;function qTt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qTt(Object(n),!0).forEach(function(t){JTt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qTt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JTt(e,t,n){return(t=YTt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YTt(e){var t=XTt(e,`string`);return typeof t==`symbol`?t:t+``}function XTt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ZTt=e=>e.brush.height;function QTt(e){return K4(e).reduce((e,t)=>
826t.orientation===`left`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function $Tt(e){return K4(e).reduce((e,t)=>t.orientation===`right`&&!t.mirror&&!t.hide?e+(typeof t.width==`number`?t.width:60):e,0)}function eEt(e){return G4(e).reduce((e,t)=>t.orientation===`top`&&!t.mirror&&!t.hide?e+t.height:e,0)}function tEt(e){return G4(e).reduce((e,t)=>t.orientation===`bottom`&&!t.mirror&&!t.hide?e+t.height:e,0)}var J4=$([U4,W4,WTt,ZTt,QTt,$Tt,eEt,tEt,ECt,DCt],(e,t,n,r,i,a,o,s,c,l)=>{var u={left:(n.left||0)+i,right:(n.right||0)+a},d=q4(q4({},{top:(n.top||0)+o,bottom:(n.bottom||0)+s}),u),f=d.bottom;d.bottom+=r,d=wTt(d,c,l);var p=e-d.left-d.right,m=t-d.top-d.bottom;return q4(q4({brushBottom:f},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),nEt=$(J4,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),rEt=$(U4,W4,(e,t)=>({x:0,y:0,width:e,height:t})),iEt=(0,B.createContext)(null),Y4=()=>(0,B.useContext)(iEt)!=null,X4=e=>e.brush,Z4=$([X4,J4,WTt],(e,t,n)=>({height:e.height,x:r2(e.x)?e.x:t.left,y:r2(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:r2(e.width)?e.width:t.width})),aEt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}e.debounce=t})),oEt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=aEt();function n(e,n=0,r={}){typeof r!=`object`&&(r={});let{leading:i=!1,trailing:a=!0,maxWait:o}=r,s=[,,];i&&(s[0]=`leading`),a&&(s[1]=`trailing`);let c,l=null,u=t.debounce(function(...t){c=e.apply(this,t),l=null},n,{edges:s}),d=function(...t){return o!=null&&(l===null&&(l=Date.now()),Date.now()-l>=o)?(c=e.apply(this,t),l=Date.now(),u.cancel(),u.schedule(),c):(u.apply(this,t),c)};return d.cancel=u.cancel,d.flush=()=>(u.flush(),c),d}e.debounce=n})),sEt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=oEt();function n(e,n=0,r={}){let{leading:i=!0,trailing:a=!0}=r;return t.debounce(e,n,{leading:i,maxWait:n,trailing:a})}e.throttle=n})),cEt=s(((e,t)=>{t.exports=sEt().throttle})),lEt=!0,Q4=function(e,t){var n=[...arguments].slice(2);if(lEt&&typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}},$4={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},uEt=(e,t,n)=>{var{width:r=$4.width,height:i=$4.height,aspect:a,maxHeight:o}=n,s=n2(r)?e:Number(r),c=n2(i)?t:Number(i);return a&&a>0&&(s?c=s/a:c&&(s=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:s,calculatedHeight:c}},dEt={width:0,height:0,overflow:`visible`},fEt={width:0,overflowX:`visible`},pEt={height:0,overflowY:`visible`},mEt={},hEt=e=>{var{width:t,height:n}=e,r=n2(t),i=n2(n);return r&&i?dEt:r?fEt:i?pEt:mEt};function gEt(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=$4.width,a=$4.height):i===void 0?i=r&&r>0?void 0:$4.width:a===void 0&&(a=r&&r>0?void 0:$4.height),{width:i,height:a}}var _Et=u(cEt());function e3(){return e3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e3.apply(null,arguments)}function vEt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yEt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
826t%2?vEt(Object(n),!0).forEach(function(t){bEt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vEt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bEt(e,t,n){return(t=xEt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xEt(e){var t=SEt(e,`string`);return typeof t==`symbol`?t:t+``}function SEt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var CEt=(0,B.createContext)($4.initialDimension);function wEt(e){return R4(e.width)&&R4(e.height)}function TEt(e){var{children:t,width:n,height:r}=e,i=(0,B.useMemo)(()=>({width:n,height:r}),[n,r]);return wEt(i)?B.createElement(CEt.Provider,{value:i},t):null}var t3=()=>(0,B.useContext)(CEt),EEt=(0,B.forwardRef)((e,t)=>{var{aspect:n,initialDimension:r=$4.initialDimension,width:i,height:a,minWidth:o=$4.minWidth,minHeight:s,maxHeight:c,children:l,debounce:u=$4.debounce,id:d,className:f,onResize:p,style:m={}}=e,h=(0,B.useRef)(null),g=(0,B.useRef)();g.current=p,(0,B.useImperativeHandle)(t,()=>h.current);var[_,v]=(0,B.useState)({containerWidth:r.width,containerHeight:r.height}),y=(0,B.useCallback)((e,t)=>{v(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,B.useEffect)(()=>{if(h.current==null||typeof ResizeObserver>`u`)return d2;var e=e=>{var t,n=e[0];if(n!=null){var{width:r,height:i}=n.contentRect;y(r,i),(t=g.current)==null||t.call(g,r,i)}};u>0&&(e=(0,_Et.default)(e,u,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:n,height:r}=h.current.getBoundingClientRect();return y(n,r),t.observe(h.current),()=>{t.disconnect()}},[y,u]);var{containerWidth:b,containerHeight:x}=_;Q4(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var{calculatedWidth:S,calculatedHeight:C}=uEt(b,x,{width:i,height:a,aspect:n,maxHeight:c});return Q4(S!=null&&S>0||C!=null&&C>0,`The width(%s) and height(%s) of chart should be greater than 0, 827 please check the style of container, or the props width(%s) and height(%s), 828 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 829 height and width.`,S,C,i,a,o,s,n),B.createElement(`div`,{id:d?`${d}`:void 0,className:iy(`recharts-responsive-container`,f),style:yEt(yEt({},m),{},{width:i,height:a,minWidth:o,minHeight:s,maxHeight:c}),ref:h},B.createElement(`div`,{style:hEt({width:i,height:a})},B.createElement(TEt,{width:S,height:C},l)))}),DEt=(0,B.forwardRef)((e,t)=>{var n=t3();if(R4(n.width)&&R4(n.height))return e.children;var{width:r,height:i}=gEt({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=uEt(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return r2(a)&&r2(o)?B.createElement(TEt,{width:a,height:o},e.children):B.createElement(EEt,e3({},e,{width:r,height:i,ref:t}))});function n3(e){if(e)return{x:e.x,y:e.y,upperWidth:`upperWidth`in e?e.upperWidth:e.width,lowerWidth:`lowerWidth`in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var r3=()=>{var e=Y4(),t=S2(nEt),n=S2(Z4),r=S2(X4)?.padding;return!e||!n||!r?t:{width:n.width-r.left-r.right,height:n.height-r.top-r.bottom,x:r.left,y:r.top}},OEt={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},kEt=()=>S2(J4)??OEt,i3=()=>S2(U4),a3=()=>S2(W4),AEt=()=>S2(e=>e.layout.margin),o3=e=>e.layout.layoutType,s3=()=>S2(o3),jEt=()=>{var e=s3();if(e===`horizontal`||e===`vertical`)return e},MEt=e=>{var t=e.layout.layoutType;if(t===`centric`||t===`radial`)return t},NEt=()=>s3()!==void 0,c3=e=>{var t=b2(),n=Y4(),{width:r,height:i}=e,a=t3(),o=r,s=i;return a&&(o=a.width>0?a.width:r,s=a.height>0?a.height:i),(0,B.useEffect)(()=>{!n&&R4(o)&&R4(s)&&t(mTt({width:o,height:s}))},[t,n,o,s]),null},PEt=Symbol.for(`immer-nothing`),FEt=Symbol.for(`immer-draftable`),l3=Symbol.for(`immer-state`);function u3(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var d3=Object.getPrototypeOf;function f3(e){return!!e&&!!e[l3]}function p3(e){return e?REt(e)||Array.isArray(e)||!!e[FEt]||!!e.constructor?.[FEt]||_3(e)||v3(e):!1}var IEt=Object.prototype.constructor.toString(),LEt=new WeakMap;function REt(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;if(n===Object)return!0;
829if(typeof n!=`function`)return!1;let r=LEt.get(n);return r===void 0&&(r=Function.toString.call(n),LEt.set(n,r)),r===IEt}function m3(e,t,n=!0){h3(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function h3(e){let t=e[l3];return t?t.type_:Array.isArray(e)?1:_3(e)?2:v3(e)?3:0}function g3(e,t){return h3(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function zEt(e,t,n){let r=h3(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function BEt(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function _3(e){return e instanceof Map}function v3(e){return e instanceof Set}function y3(e){return e.copy_||e.base_}function b3(e,t){if(_3(e))return new Map(e);if(v3(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=REt(e);if(t===!0||t===`class_only`&&!n){let t=Object.getOwnPropertyDescriptors(e);delete t[l3];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(d3(e),t)}else{let t=d3(e);if(t!==null&&n)return{...e};let r=Object.create(t);return Object.assign(r,e)}}function x3(e,t=!1){return C3(e)||f3(e)||!p3(e)?e:(h3(e)>1&&Object.defineProperties(e,{set:S3,add:S3,clear:S3,delete:S3}),Object.freeze(e),t&&Object.values(e).forEach(e=>x3(e,!0)),e)}function VEt(){u3(2)}var S3={value:VEt};function C3(e){return typeof e!=`object`||!e?!0:Object.isFrozen(e)}var HEt={};function w3(e){let t=HEt[e];return t||u3(0,e),t}var T3;function UEt(){return T3}function WEt(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function GEt(e,t){t&&(w3(`Patches`),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function E3(e){D3(e),e.drafts_.forEach(qEt),e.drafts_=null}function D3(e){e===T3&&(T3=e.parent_)}function KEt(e){return T3=WEt(T3,e)}function qEt(e){let t=e[l3];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function JEt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[l3].modified_&&(E3(t),u3(4)),p3(e)&&(e=O3(t,e),t.parent_||k3(t,e)),t.patches_&&w3(`Patches`).generateReplacementPatches_(n[l3].base_,e,t.patches_,t.inversePatches_)):e=O3(t,n,[]),E3(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===PEt?void 0:e}function O3(e,t,n){if(C3(t))return t;let r=e.immer_.shouldUseStrictIteration(),i=t[l3];if(!i)return m3(t,(r,a)=>YEt(e,i,t,r,a,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return k3(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let t=i.copy_,a=t,o=!1;i.type_===3&&(a=new Set(t),t.clear(),o=!0),m3(a,(r,a)=>YEt(e,i,t,r,a,n,o),r),k3(e,t,!1),n&&e.patches_&&w3(`Patches`).generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function YEt(e,t,n,r,i,a,o){if(i==null||typeof i!=`object`&&!o)return;let s=C3(i);if(!(s&&!o)){if(f3(i)){let o=O3(e,i,a&&t&&t.type_!==3&&!g3(t.assigned_,r)?a.concat(r):void 0);if(zEt(n,r,o),f3(o))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(p3(i)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&s)return;O3(e,i),(!t||!t.scope_.parent_)&&typeof r!=`symbol`&&(_3(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&k3(e,i)}}}function k3(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&x3(t,n)}function XEt(e,t){let n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:UEt(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,a=A3;n&&(i=[r],a=j3);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var A3={get(e,t){if(t===l3)return e;let n=y3(e);if(!g3(n,t))return ZEt(e,n,t);let r=n[t];return e.finalized_||!p3(r)?r:r===M3(e.base_,t)?(P3(e),e.copy_[t]=F3(r,e)):r},has(e,t){return t in y3(e)},ownKeys(e){return Reflect.ownKeys(y3(e))},set(e,t,n){let r=QEt(y3(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=M3(y3(e),t),i=r?.[l3];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(BEt(n,r)&&(n!==void 0||g3(e.base_,t)))return!0;P3(e),N3(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty(e,t){return M3(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,P3(e),N3(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=y3(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty(){u3(11)},getPrototypeOf(e){return d3(e.base_)},setPrototypeOf(){u3(12)}},j3={};m3(A3,(e,t)=>{j3[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),j3.deleteProperty=function(e,t){return j3.set.call(this,e,t,void 0)},j3.set=function(e,t,n){return A3.set.call(this,e[0],t,n,e[0])};function M3(e,t){let n=e[l3];return(n?y3(n):e)[t]}function ZEt(e,t,n){let r=QEt(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}function QEt(e,t){if(!(t in e))return;let n=d3(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=d3(n)}}function N3(e){e.modified_||(e.modified_=!0,e.parent_&&N3(e.parent_))}function P3(e){e.copy_||=b3(e.base_,e.scope_.immer_.useStrictShallowCopy_)}var $Et=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if(typeof e==`function`&&typeof t!=`function`){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}typeof t!=`function`&&u3(6),n!==void 0&&typeof n!=`function`&&u3(7);let r;if(p3(e)){let i=KEt(this),a=F3(e,void 0),o=!0;try{r=t(a),o=!1}finally{o?E3(i):D3(i)}return GEt(i,n),JEt(r,i)}else if(!e||typeof e!=`object`){if(r=t(e),r===void 0&&(r=e),r===PEt&&(r=void 0),this.autoFreeze_&&x3(r,!0),n){let t=[],i=[];w3(`Patches`).generateReplacementPatches_(e,r,t,i),n(t,i)}return r}else u3(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e==`function`)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy==`boolean`&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration==`boolean`&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){p3(e)||u3(8),f3(e)&&(e=eDt(e));let t=KEt(this),n=F3(e,void 0);return n[l3].isManual_=!0,D3(t),n}finishDraft(e,t){let n=e&&e[l3];(!n||!n.isManual_)&&u3(9);let{scope_:r}=n;return GEt(r,t),JEt(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>
829-1&&(t=t.slice(n+1));let r=w3(`Patches`).applyPatches_;return f3(e)?r(e,t):this.produce(e,e=>r(e,t))}};function F3(e,t){let n=_3(e)?w3(`MapSet`).proxyMap_(e,t):v3(e)?w3(`MapSet`).proxySet_(e,t):XEt(e,t);return(t?t.scope_:UEt()).drafts_.push(n),n}function eDt(e){return f3(e)||u3(10,e),tDt(e)}function tDt(e){if(!p3(e)||C3(e))return e;let t=e[l3],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=b3(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=b3(e,!0);return m3(n,(e,t)=>{zEt(n,e,tDt(t))},r),t&&(t.finalized_=!1),n}new $Et().produce;function I3(e){return e}var nDt=C4({name:`legend`,initialState:{settings:{layout:`horizontal`,align:`center`,verticalAlign:`middle`,itemSorter:`value`},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(I3(t.payload))},prepare:S4()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=y4(e).payload.indexOf(I3(n));i>-1&&(e.payload[i]=I3(r))},prepare:S4()},removeLegendPayload:{reducer(e,t){var n=y4(e).payload.indexOf(I3(t.payload));n>-1&&e.payload.splice(n,1)},prepare:S4()}}}),{setLegendSize:rDt,setLegendSettings:iDt,addLegendPayload:aDt,replaceLegendPayload:oDt,removeLegendPayload:sDt}=nDt.actions,cDt=nDt.reducer,lDt=s((e=>{var t=m();typeof Object.is==`function`&&Object.is,t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));s(((e,t)=>{t.exports=lDt()}))();function uDt(e){e()}function dDt(){let e=null,t=null;return{clear(){e=null,t=null},notify(){uDt(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var fDt={notify(){},get:()=>[]};function pDt(e,t){let n,r=fDt,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=dDt())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=fDt)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var mDt=(()=>typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0)(),hDt=(()=>typeof navigator<`u`&&navigator.product===`ReactNative`)(),gDt=(()=>mDt||hDt?B.useLayoutEffect:B.useEffect)();function _Dt(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function vDt(e,t){if(_Dt(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!_Dt(e[n[r]],t[n[r]]))return!1;return!0}Object.prototype;var yDt=Symbol.for(`react-redux-context`),bDt=typeof globalThis<`u`?globalThis:{};function xDt(){if(!B.createContext)return{};let e=bDt[yDt]??=new Map,t=e.get(B.createContext);return t||(t=B.createContext(null),e.set(B.createContext,t)),t}var SDt=xDt();function CDt(e){let{children:t,context:n,serverState:r,store:i}=e,a=B.useMemo(()=>({store:i,subscription:pDt(i),getServerState:r?()=>r:void 0}),[i,r]),o=B.useMemo(()=>i.getState(),[i]);gDt(()=>{let{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),o!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,o]);let s=n||SDt;return B.createElement(s.Provider,{value:a},t)}var wDt=CDt,TDt=new Set([`axisLine`,`tickLine`,`activeBar`,`activeDot`,`activeLabel`,`activeShape`,`allowEscapeViewBox`,`background`,`cursor`,`dot`,`label`,`line`,`margin`,`padding`,`position`,`shape`,`style`,`tick`,`wrapperStyle`,`radius`,`throttledEvents`]);function EDt(e,t){return e==null&&t==null?!0:typeof e==`number`&&typeof t==`number`?e===t||e!==e&&t!==t:e===t}function L3(e,t){for(var n of new Set([...Object.keys(e),...Object.keys(t)]))if(TDt.has(n)){if(e[n]==null&&t[n]==null)continue;if(!vDt(e[n],t[n]))return!1}else if(!EDt(e[n],t[n]))return!1;return!0}var DDt=v(),ODt=[`contextPayload`];function R3(){return R3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R3.apply(null,arguments)}function kDt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
829t%2?kDt(Object(n),!0).forEach(function(t){ADt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kDt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ADt(e,t,n){return(t=jDt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jDt(e){var t=MDt(e,`string`);return typeof t==`symbol`?t:t+``}function MDt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function NDt(e,t){if(e==null)return{};var n,r,i=PDt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function PDt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function FDt(e){return e.value}function IDt(e){var{contextPayload:t}=e,n=NDt(e,ODt),r=eCt(t,e.payloadUniqBy,FDt),i=z3(z3({},n),{},{payload:r});return B.isValidElement(e.content)?B.cloneElement(e.content,i):typeof e.content==`function`?B.createElement(e.content,i):B.createElement(TSt,i)}function LDt(e,t,n,r,i,a){var{layout:o,align:s,verticalAlign:c}=t,l,u;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l=s===`center`&&o===`vertical`?{left:((r||0)-a.width)/2}:s===`right`?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(u=c===`middle`?{top:((i||0)-a.height)/2}:c===`bottom`?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),z3(z3({},l),u)}function RDt(e){var t=b2();return(0,B.useEffect)(()=>{t(iDt(e))},[t,e]),null}function zDt(e){var t=b2();return(0,B.useEffect)(()=>(t(rDt(e)),()=>{t(rDt({width:0,height:0}))}),[t,e]),null}function BDt(e,t,n,r){return e===`vertical`&&t!=null?{height:t}:e===`horizontal`?{width:n||r}:null}var VDt={align:`center`,iconSize:14,inactiveColor:`#ccc`,itemSorter:`value`,layout:`horizontal`,verticalAlign:`bottom`};function HDt(e){var t=h2(e,VDt),n=kCt(),r=Vbt(),i=AEt(),{width:a,height:o,wrapperStyle:s,portal:c}=t,[l,u]=ACt([n]),d=i3(),f=a3();if(d==null||f==null)return null;var p=d-(i?.left||0)-(i?.right||0),m=BDt(t.layout,o,a,p),h=c?s:z3(z3({position:`absolute`,width:m?.width||a||`auto`,height:m?.height||o||`auto`},LDt(s,t,i,d,f,l)),s),g=c??r;return g==null||n==null?null:(0,DDt.createPortal)(B.createElement(`div`,{className:`recharts-legend-wrapper`,style:h,ref:u},B.createElement(RDt,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&B.createElement(zDt,{width:l.width,height:l.height}),B.createElement(IDt,R3({},t,m,{margin:i,chartWidth:d,chartHeight:f,contextPayload:n}))),g)}var UDt=B.memo(HDt,L3);UDt.displayName=`Legend`;var WDt=u(w2());function B3(){return B3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B3.apply(null,arguments)}function GDt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?GDt(Object(n),!0).forEach(function(t){KDt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GDt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KDt(e,t,n){return(t=qDt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qDt(e){var t=JDt(e,`string`);return typeof t==`symbol`?t:t+``}function JDt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function YDt(e){return Array.isArray(e)&&i2(e[0])&&i2(e[1])?e.join(` ~ `):e}var H3={separator:` : `,contentStyle:{margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},itemStyle:{display:`block`,paddingTop:4,paddingBottom:4,color:`#000`},labelStyle:{},accessibilityLayer:!1};function XDt(e,t){return t==null?e:(0,WDt.default)(e,t)}var ZDt=e=>{var{separator:t=H3.separator,contentStyle:n,itemStyle:r,labelStyle:i=H3.labelStyle,payload:a,formatter:o,itemSorter:s,wrapperClassName:c,labelClassName:l,label:u,labelFormatter:d,accessibilityLayer:f=H3.accessibilityLayer}=e,p=()=>
829{if(a&&a.length){var e={padding:0,margin:0},n=XDt(a,s).map((e,n)=>{if(e.type===`none`)return null;var i=e.formatter||o||YDt,{value:s,name:c}=e,l=s,u=c;if(i){var d=i(s,c,e,n,a);if(Array.isArray(d))[l,u]=d;else if(d!=null)l=d;else return null}var f=V3(V3({},H3.itemStyle),{},{color:e.color||H3.itemStyle.color},r);return B.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${n}`,style:f},i2(u)?B.createElement(`span`,{className:`recharts-tooltip-item-name`},u):null,i2(u)?B.createElement(`span`,{className:`recharts-tooltip-item-separator`},t):null,B.createElement(`span`,{className:`recharts-tooltip-item-value`},l),B.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return B.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},n)}return null},m=V3(V3({},H3.contentStyle),n),h=V3({margin:0},i),g=!c2(u),_=g?u:``,v=iy(`recharts-default-tooltip`,c),y=iy(`recharts-tooltip-label`,l);g&&d&&a!=null&&(_=d(u,a));var b=f?{role:`status`,"aria-live":`assertive`}:{};return B.createElement(`div`,B3({className:v,style:m},b),B.createElement(`p`,{className:y,style:h},B.isValidElement(_)?_:`${_}`),p())},U3=`recharts-tooltip-wrapper`,QDt={visibility:`hidden`};function $Dt(e){var{coordinate:t,translateX:n,translateY:r}=e;return iy(U3,{[`${U3}-right`]:r2(n)&&t&&r2(t.x)&&n>=t.x,[`${U3}-left`]:r2(n)&&t&&r2(t.x)&&n<t.x,[`${U3}-bottom`]:r2(r)&&t&&r2(t.y)&&r>=t.y,[`${U3}-top`]:r2(r)&&t&&r2(t.y)&&r<t.y})}function eOt(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:s,viewBox:c,viewBoxDimension:l}=e;if(a&&r2(a[r]))return a[r];var u=n[r]-s-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?u:d;var f=c[r];return f==null?0:o[r]?u<f?Math.max(d,f):Math.max(u,f):l==null?0:d+s>f+l?Math.max(u,f):Math.max(d,f)}function tOt(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function nOt(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:s,useTranslate3d:c,viewBox:l}=e,u,d,f;return s.height>0&&s.width>0&&n?(d=eOt({allowEscapeViewBox:t,coordinate:n,key:`x`,offset:i,position:a,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=eOt({allowEscapeViewBox:t,coordinate:n,key:`y`,offset:r,position:a,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=tOt({translateX:d,translateY:f,useTranslate3d:c})):u=QDt,{cssProperties:u,cssClasses:$Dt({translateX:d,translateY:f,coordinate:n})}}var W3={devToolsEnabled:!0,isSsr:(()=>!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout))()};function rOt(){var[e,t]=(0,B.useState)(()=>W3.isSsr||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);return(0,B.useEffect)(()=>{if(window.matchMedia){var e=window.matchMedia(`(prefers-reduced-motion: reduce)`),n=()=>{t(e.matches)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}}},[]),e}function iOt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function G3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?iOt(Object(n),!0).forEach(function(t){aOt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iOt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function aOt(e,t,n){return(t=oOt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oOt(e){var t=sOt(e,`string`);return typeof t==`symbol`?t:t+``}function sOt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function cOt(e){if(!(e.prefersReducedMotion&&e.isAnimationActive===`auto`)&&e.isAnimationActive&&e.active)return`transform ${e.animationDuration}ms ${e.animationEasing}`}
829function lOt(e){var t=rOt(),[n,r]=B.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));B.useEffect(()=>{var t=t=>{t.key===`Escape`&&r({dismissed:!0,dismissedAtCoordinate:{x:e.coordinate?.x??0,y:e.coordinate?.y??0}})};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e.coordinate?.x,e.coordinate?.y]),n.dismissed&&((e.coordinate?.x??0)!==n.dismissedAtCoordinate.x||(e.coordinate?.y??0)!==n.dismissedAtCoordinate.y)&&r(G3(G3({},n),{},{dismissed:!1}));var{cssClasses:i,cssProperties:a}=nOt({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset==`number`?e.offset:e.offset.x,offsetTop:typeof e.offset==`number`?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),o=G3(G3({},e.hasPortalFromProps?{}:G3(G3({transition:cOt({prefersReducedMotion:t,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},a),{},{pointerEvents:`none`,position:`absolute`,top:0,left:0})),{},{visibility:!n.dismissed&&e.active&&e.hasPayload?`visible`:`hidden`},e.wrapperStyle);return B.createElement(`div`,{xmlns:`http://www.w3.org/1999/xhtml`,tabIndex:-1,className:i,style:o,ref:e.innerRef},e.children)}var uOt=B.memo(lOt),dOt=()=>S2(e=>e.rootProps.accessibilityLayer)??!0;function K3(){return K3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K3.apply(null,arguments)}function fOt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pOt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?fOt(Object(n),!0).forEach(function(t){mOt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fOt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mOt(e,t,n){return(t=hOt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hOt(e){var t=gOt(e,`string`);return typeof t==`symbol`?t:t+``}function gOt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var _Ot={curveBasisClosed:_xt,curveBasisOpen:yxt,curveBasis:hxt,curveBumpX:Qbt,curveBumpY:$bt,curveLinearClosed:xxt,curveLinear:P0,curveMonotoneX:Dxt,curveMonotoneY:Oxt,curveNatural:jxt,curveStep:Mxt,curveStepAfter:Pxt,curveStepBefore:Nxt},q3=e=>L4(e.x)&&L4(e.y),vOt=e=>e.base!=null&&q3(e.base)&&q3(e),J3=e=>e.x,Y3=e=>e.y,yOt=(e,t)=>{if(typeof e==`function`)return e;var n=`curve${l2(e)}`;if((n===`curveMonotone`||n===`curveBump`)&&t){var r=_Ot[`${n}${t===`vertical`?`Y`:`X`}`];if(r)return r}return _Ot[n]||P0},bOt={connectNulls:!1,type:`linear`},xOt=e=>{var{type:t=bOt.type,points:n=[],baseLine:r,layout:i,connectNulls:a=bOt.connectNulls}=e,o=yOt(t,i),s=a?n.filter(q3):n;if(Array.isArray(r)){var c,l=n.map((e,t)=>pOt(pOt({},e),{},{base:r[t]}));return c=i===`vertical`?F0().y(Y3).x1(J3).x0(e=>e.base.x):F0().x(J3).y1(Y3).y0(e=>e.base.y),c.defined(vOt).curve(o)(a?l.filter(vOt):l)}return(i===`vertical`&&r2(r)?F0().y(Y3).x1(J3).x0(r):r2(r)?F0().x(J3).y1(Y3).y0(r):Xbt().x(J3).y(Y3)).defined(q3).curve(o)(s)},X3=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=s3();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?xOt(o):r;return B.createElement(`path`,K3({},g0(e),lSt(e),{className:iy(`recharts-curve`,t),d:s===null?void 0:s,ref:i}))},SOt=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function Z3(){return Z3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z3.apply(null,arguments)}function COt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wOt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
829t%2?COt(Object(n),!0).forEach(function(t){TOt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):COt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TOt(e,t,n){return(t=EOt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EOt(e){var t=DOt(e,`string`);return typeof t==`symbol`?t:t+``}function DOt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function OOt(e,t){if(e==null)return{};var n,r,i=kOt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kOt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var AOt=(e,t,n,r,i,a)=>`M${e},${i}v${r}M${a},${t}h${n}`,jOt=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:s}=e,c=OOt(e,SOt),l=wOt({x:t,y:n,top:r,left:i,width:a,height:o},c);return!r2(t)||!r2(n)||!r2(a)||!r2(o)||!r2(r)||!r2(i)?null:B.createElement(`path`,Z3({},v0(l),{className:iy(`recharts-cross`,s),d:AOt(t,n,a,o,r,i)}))};function MOt(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function NOt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function POt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?NOt(Object(n),!0).forEach(function(t){FOt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NOt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function FOt(e,t,n){return(t=IOt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IOt(e){var t=LOt(e,`string`);return typeof t==`symbol`?t:t+``}function LOt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ROt=e=>e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`),zOt=(e,t,n)=>e.map(e=>`${ROt(e)} ${t}ms ${n}`).join(`,`),BOt=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((e,t)=>e.filter(e=>t.includes(e))),Q3=(e,t)=>Object.keys(t).reduce((n,r)=>POt(POt({},n),{},{[r]:e(r,t[r])}),{});function VOt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?VOt(Object(n),!0).forEach(function(t){HOt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VOt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function HOt(e,t,n){return(t=UOt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UOt(e){var t=WOt(e,`string`);return typeof t==`symbol`?t:t+``}function WOt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var e6=(e,t,n)=>e+(t-e)*n,t6=e=>{var{from:t,to:n}=e;return t!==n},GOt=(e,t,n)=>{var r=Q3((t,n)=>{if(t6(n)){var[r,i]=e(n.from,n.to,n.velocity);return $3($3({},n),{},{from:r,velocity:i})}return n},t);return n<1?Q3((e,t)=>
829t6(t)&&r[e]!=null?$3($3({},t),{},{velocity:e6(t.velocity,r[e].velocity,n),from:e6(t.from,r[e].from,n)}):t,t):GOt(e,r,n-1)};function KOt(e,t,n,r,i,a){var o,s=r.reduce((n,r)=>$3($3({},n),{},{[r]:{from:e[r],velocity:0,to:t[r]}}),{}),c=()=>Q3((e,t)=>t.from,s),l=()=>!Object.values(s).filter(t6).length,u=null,d=r=>{o||=r;var f=(r-o)/n.dt;s=GOt(n,s,f),i($3($3($3({},e),t),c())),o=r,l()||(u=a.setTimeout(d))};return()=>(u=a.setTimeout(d),()=>{var e;(e=u)==null||e()})}function qOt(e,t,n,r,i,a,o){var s=null,c=i.reduce((n,r)=>{var i=e[r],a=t[r];return i==null||a==null?n:$3($3({},n),{},{[r]:[i,a]})},{}),l,u=i=>{l||=i;var d=(i-l)/r,f=Q3((e,t)=>e6(...t,n(d)),c);if(a($3($3($3({},e),t),f)),d<1)s=o.setTimeout(u);else{var p=Q3((e,t)=>e6(...t,n(1)),c);a($3($3($3({},e),t),p))}};return()=>(s=o.setTimeout(u),()=>{var e;(e=s)==null||e()})}var JOt=(e,t,n,r,i,a)=>{var o=BOt(e,t);return n==null?()=>(i($3($3({},e),t)),()=>{}):n.isStepper===!0?KOt(e,t,n,o,i,a):qOt(e,t,n,r,o,i,a)},YOt=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],XOt=(e,t)=>e.map((e,n)=>e*t**n).reduce((e,t)=>e+t),ZOt=(e,t)=>n=>XOt(YOt(e,t),n),QOt=(e,t)=>n=>XOt([...YOt(e,t).map((e,t)=>e*t).slice(1),0],n),$Ot=e=>{var t,n=e.split(`(`);if(n.length!==2||n[0]!==`cubic-bezier`)return null;var r=(t=n[1])==null||(t=t.split(`)`)[0])==null?void 0:t.split(`,`);if(r==null||r.length!==4)return null;var i=r.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]},ekt=function(){var e=[...arguments];if(e.length===1)switch(e[0]){case`linear`:return[0,0,1,1];case`ease`:return[.25,.1,.25,1];case`ease-in`:return[.42,0,1,1];case`ease-out`:return[.42,0,.58,1];case`ease-in-out`:return[0,0,.58,1];default:var t=$Ot(e[0]);if(t)return t}return e.length===4?e:[0,0,1,1]},tkt=(e,t,n,r)=>{var i=ZOt(e,n),a=ZOt(t,r),o=QOt(e,n),s=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,n=t,r=0;r<8;++r){var c=i(n)-t,l=o(n);if(Math.abs(c-t)<1e-4||l<1e-4)return a(n);n=s(n-c/l)}return a(n)};return c.isStepper=!1,c},nkt=function(){return tkt(...ekt(...arguments))},rkt=function(){var{stiff:e=100,damping:t=8,dt:n=17}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=(r,i,a)=>{var o=a+(-(r-i)*e-a*t)*n/1e3,s=a*n/1e3+r;return Math.abs(s-i)<1e-4&&Math.abs(o)<1e-4?[i,0]:[s,o]};return r.isStepper=!0,r.dt=n,r},ikt=e=>{if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return nkt(e);case`spring`:return rkt();default:if(e.split(`(`)[0]===`cubic-bezier`)return nkt(e)}return typeof e==`function`?e:null};function akt(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var[s,...c]=o;if(typeof s==`number`){i=e.setTimeout(a.bind(null,c),s);return}a(s),i=e.setTimeout(a.bind(null,c));return}typeof o==`string`&&(t=o,n(t)),typeof o==`object`&&(t=o,n(t)),typeof o==`function`&&o()}};return{stop:()=>{r=!0},start:e=>{r=!1,i&&=(i(),null),a(e)},subscribe:e=>(n=e,()=>{n=()=>null}),getTimeoutController:()=>e}}var okt=class{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),r=null,i=a=>{a-n>=t?e(a):typeof requestAnimationFrame==`function`&&(r=requestAnimationFrame(i))};return r=requestAnimationFrame(i),()=>{r!=null&&cancelAnimationFrame(r)}}};function skt(){return akt(new okt)}var ckt=(0,B.createContext)(skt);function lkt(e,t){var n=(0,B.useContext)(ckt);return(0,B.useMemo)(()=>t??n(e),[e,t,n])}var ukt={begin:0,duration:1e3,easing:`ease`,isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},dkt={t:0},n6={t:1};function r6(e){var t=h2(e,ukt),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:s,onAnimationStart:c,children:l}=t,u=rOt(),d=n===`auto`?!W3.isSsr&&!u:n,f=lkt(t.animationId,t.animationManager),[p,m]=(0,B.useState)(d?dkt:n6),h=(0,B.useRef)(null);return(0,B.useEffect)(()=>{d||m(n6)},[d]),(0,B.useEffect)(()=>{if(!d||!r)return d2;var e=JOt(dkt,n6,ikt(a),i,m,f.getTimeoutController());return f.start([c,o,()=>{h.current=e()},i,s]),()=>{f.stop(),h.current&&h.current(),s()}},[d,r,i,a,o,c,s,f]),l(p.t)}function i6(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`animation-`,n=(0,B.useRef)(a2(t)),r=(0,B.useRef)(e);return r.current!==e&&(n.current=a2(t),r.current=e),n.current}var fkt=[`radius`],pkt=[`radius`],mkt,hkt,gkt,_kt,vkt,ykt,bkt,xkt,Skt,Ckt;function wkt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tkt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
829t%2?wkt(Object(n),!0).forEach(function(t){Ekt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wkt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ekt(e,t,n){return(t=Dkt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dkt(e){var t=Okt(e,`string`);return typeof t==`symbol`?t:t+``}function Okt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function a6(){return a6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a6.apply(null,arguments)}function kkt(e,t){if(e==null)return{};var n,r,i=Akt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Akt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function o6(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var jkt=(e,t,n,r,i)=>{var a=Q0(n),o=Q0(r),s=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,l=a>=0?1:-1,u=o>=0&&a>=0||o<0&&a<0?1:0,d;if(s>0&&Array.isArray(i)){for(var f=[0,0,0,0],p=0,m=4;p<m;p++){var h=i[p]??0;f[p]=h>s?s:h}d=$0(mkt||=o6([`M`,`,`,``]),e,t+c*f[0]),f[0]>0&&(d+=$0(hkt||=o6([`A `,`,`,`,0,0,`,`,`,`,`,``]),f[0],f[0],u,e+l*f[0],t)),d+=$0(gkt||=o6([`L `,`,`,``]),e+n-l*f[1],t),f[1]>0&&(d+=$0(_kt||=o6([`A `,`,`,`,0,0,`,`, 830 `,`,`,``]),f[1],f[1],u,e+n,t+c*f[1])),d+=$0(vkt||=o6([`L `,`,`,``]),e+n,t+r-c*f[2]),f[2]>0&&(d+=$0(ykt||=o6([`A `,`,`,`,0,0,`,`, 831 `,`,`,``]),f[2],f[2],u,e+n-l*f[2],t+r)),d+=$0(bkt||=o6([`L `,`,`,``]),e+l*f[3],t+r),f[3]>0&&(d+=$0(xkt||=o6([`A `,`,`,`,0,0,`,`, 832 `,`,`,``]),f[3],f[3],u,e,t+r-c*f[3])),d+=`Z`}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);d=$0(Skt||=o6(`M .,. 833 A .,.,0,0,.,.,. 834 L .,. 835 A .,.,0,0,.,.,. 836 L .,. 837 A .,.,0,0,.,.,. 838 L .,. 839 A .,.,0,0,.,.,. Z`.split(`.`)),e,t+c*g,g,g,u,e+l*g,t,e+n-l*g,t,g,g,u,e+n,t+c*g,e+n,t+r-c*g,g,g,u,e+n-l*g,t+r,e+l*g,t+r,g,g,u,e,t+r-c*g)}else d=$0(Ckt||=o6([`M `,`,`,` h `,` v `,` h `,` Z`]),e,t,n,r,-n);return d},Mkt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},Nkt=e=>{var t=h2(e,Mkt),n=(0,B.useRef)(null),[r,i]=(0,B.useState)(-1);(0,B.useEffect)(()=>{if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&i(e)}catch{}},[]);var{x:a,y:o,width:s,height:c,radius:l,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isAnimationActive:m,isUpdateAnimationActive:h}=t,g=(0,B.useRef)(s),_=(0,B.useRef)(c),v=(0,B.useRef)(a),y=(0,B.useRef)(o),b=i6((0,B.useMemo)(()=>({x:a,y:o,width:s,height:c,radius:l}),[a,o,s,c,l]),`rectangle-`);if(a!==+a||o!==+o||s!==+s||c!==+c||s===0||c===0)return null;var x=iy(`recharts-rectangle`,u);if(!h){var S=v0(t),{radius:C}=S,w=kkt(S,fkt);return B.createElement(`path`,a6({},w,{x:Q0(a),y:Q0(o),width:Q0(s),height:Q0(c),radius:typeof l==`number`?l:void 0,className:x,d:jkt(a,o,s,c,l)}))}var T=g.current,E=_.current,D=v.current,O=y.current,k=`0px ${r===-1?1:r}px`,A=`${r}px ${r}px`,j=zOt([`strokeDasharray`],f,typeof d==`string`?d:Mkt.animationEasing);return B.createElement(r6,{animationId:b,key:b,canBegin:r>0,duration:f,easing:d,isActive:h,begin:p},e=>{var r=s2(T,s,e),i=s2(E,c,e),u=s2(D,a,e),d=s2(O,o,e);n.current&&(g.current=r,_.current=i,v.current=u,y.current=d);var f=m?e>0?{transition:j,strokeDasharray:A}:{strokeDasharray:k}:{strokeDasharray:A},p=v0(t),{radius:h}=p,b=kkt(p,pkt);return B.createElement(`path`,a6({},b,{radius:typeof l==`number`?l:void 0,className:x,d:jkt(u,d,r,i,l),ref:n,style:Tkt(Tkt({},f),t.style)}
839))})};function Pkt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Fkt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Pkt(Object(n),!0).forEach(function(t){Ikt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pkt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ikt(e,t,n){return(t=Lkt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lkt(e){var t=Rkt(e,`string`);return typeof t==`symbol`?t:t+``}function Rkt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var s6=Math.PI/180,zkt=e=>e*180/Math.PI,c6=(e,t,n,r)=>({x:e+Math.cos(-s6*r)*n,y:t+Math.sin(-s6*r)*n}),Bkt=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},Vkt=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Hkt=(e,t)=>
839{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Vkt({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:zkt(c),angleInRadian:c}},Ukt=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},Wkt=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},Gkt=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Hkt({x:n,y:r},t),{innerRadius:o,outerRadius:s}=t;if(i<o||i>s||i===0)return null;var{startAngle:c,endAngle:l}=Ukt(t),u=a,d;if(c<=l){for(;u>l;)u-=360;for(;u<c;)u+=360;d=u>=c&&u<=l}else{for(;u>c;)u-=360;for(;u<l;)u+=360;d=u>=l&&u<=c}return d?Fkt(Fkt({},t),{},{radius:i,angle:Wkt(u,t)}):null};function Kkt(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e;return{points:[c6(t,n,r,i),c6(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var qkt,Jkt,Ykt,Xkt,Zkt,Qkt,$kt;function l6(){return l6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l6.apply(null,arguments)}function u6(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var eAt=(e,t)=>e2(t-e)*Math.min(Math.abs(t-e),359.999),d6=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:s,cornerIsExternal:c}=e,l=s*(o?1:-1)+r,u=Math.asin(s/l)/s6,d=c?i:i+a*u,f=c6(t,n,l,d),p=c6(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:c6(t,n,l*Math.cos(u*s6),m),theta:u}},tAt=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,s=eAt(a,o),c=a+s,l=c6(t,n,i,a),u=c6(t,n,i,c),d=$0(qkt||=u6([`M `,`,`,` 840 A `,`,`,`,0, 841 `,`,`,`, 842 `,`,`,` 843 `]),l.x,l.y,i,i,+(Math.abs(s)>180),+(a>c),u.x,u.y);if(r>0){var f=c6(t,n,r,a),p=c6(t,n,r,c);d+=$0(Jkt||=u6([`L `,`,`,` 844 A `,`,`,`,0, 845 `,`,`,`, 846 `,`,`,` Z`]),p.x,p.y,r,r,+(Math.abs(s)>180),+(a<=c),f.x,f.y)}else d+=$0(Ykt||=u6([`L `,`,`,` Z`]),t,n);return d},nAt=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:s,startAngle:c,endAngle:l}=e,u=e2(l-c),{circleTangency:d,lineTangency:f,theta:p}=d6({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),{circleTangency:m,lineTangency:h,theta:g}=d6({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),_=s?Math.abs(c-l):Math.abs(c-l)-p-g;if(_<0)return o?$0(Xkt||=u6([`M `,`,`,` 847 a`,`,`,`,0,0,1,`,`,0 848 a`,`,`,`,0,0,1,`,`,0 849 `]),f.x,f.y,a,a,a*2,a,a,-a*2):tAt({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var v=$0(Zkt||=u6([`M `,`,`,` 850 A`,`,`,`,0,0,`,`,`,`,`,` 851 A`,`,`,`,0,`,`,`,`,`,`,`,` 852 A`,`,`,`,0,0,`,`,`,`,`,` 853 `]),f.x,f.y,a,a,+(u<0),d.x,d.y,i,i,+(_>180),+(u<0),m.x,m.y,a,a,+(u<0),h.x,h.y);if(r>0){var{circleTangency:y,lineTangency:b,theta:x}=d6({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),{circleTangency:S,lineTangency:C,theta:w}=d6({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),T=s?Math.abs(c-l):Math.abs(c-l)-x-w;if(T<0&&a===0)return`${v}L${t},${n}Z`;v+=$0(Qkt||=u6([`L`,`,`,` 854 A`,`,`,`,0,0,`,`,`,`,`,` 855 A`,`,`,`,0,`,`,`,`,`,`,`,` 856 A`,`,`,`,0,0,`,`,`,`,`,`Z`]),C.x,C.y,a,a,+(u<0),S.x,S.y,r,r,+(T>180),+(u>0),y.x,y.y,a,a,+(u<0),b.x,b.y)}else v+=$0($kt||=u6([`L`,`,`,`Z`]),t,n);return v},rAt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},iAt=e=>{var t=h2(e,rAt),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u,className:d}=t;if(a<i||l===u)return null;var f=iy(`recharts-sector`,d),p=a-i,m=o2(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?nAt({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):tAt({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return B.createElement(`path`,l6({},v0(t),{className:f,d:h}))};function aAt(e,t,n){if(e===`horizontal`)return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e===`vertical`)return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(cSt(t)){if(e===`centric`){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:s}=t,c=c6(r,i,a,s),l=c6(r,i,o,s);return[{x:c.x,y:c.y},{x:l.x,y:l.y}]}return Kkt(t)}}var oAt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=yCt();function n(e){return t.isSymbol(e)?NaN:Number(e)}e.toNumber=n})),sAt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=oAt();function n(e){return e?(e=t.toNumber(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}e.toFinite=n})),cAt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=CCt(),n=sAt();function r(e,r,i){i&&typeof i!=`number`&&t.isIterateeCall(e,r,i)&&(r=i=void 0),e=n.toFinite(e),r===void 0?(r=e,e=0):r=n.toFinite(r),i=i===void 0?e<r?1:-1:n.toFinite(i);let a=Math.max(Math.ceil((r-e)/(i||1)),0),o=Array(a);for(let t=0;t<a;t++)o[t]=e,e+=i;return o}e.range=r})),lAt=s(((e,t)=>{t.exports=cAt().range})),f6=e=>e.chartData,p6=$([f6],e=>{var t=e.chartData==null?0:e.chartData.length-1;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),m6=(e,t,n,r)=>r?p6(e):f6(e),uAt=(e,t,n)=>n?p6(e):f6(e);function h6(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(L4(t)&&L4(n))return!0}return!1}function dAt(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function fAt(e,t){if(t&&typeof e!=`function`&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(L4(n))i=n;else if(typeof n==`function`)return;if(L4(r))a=r;else if(typeof r==`function`)return;var o=[i,a];if(h6(o))return o}}function pAt(e,t,n){if(!(!n&&t==null)){if(typeof e==`function`&&t!=null)try{var r=e(t,n);if(h6(r))return dAt(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,s;if(i===`auto`)t!=null&&(o=Math.min(...t));else if(r2(i))o=i;else if(typeof i==`function`)try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i==`string`&<t.test(i)){var c=LTt.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var l=+c[1];o=t[0]-l}}else o=t?.[0];if(a===`auto`)t!=null&&(s=Math.max(...t));else if(r2(a))s=a;else if(typeof a==`function`)try{t!=null&&(s=a(t?.[1]))}catch{}else if(typeof a==`string`&&RTt.test(a)){var u=RTt.exec(a);if(u==null||u[1]==null||t==null)s=void 0;else{var d=+u[1];s=t[1]+d}}else s=t?.[1];var f=[o,s];if(h6(f))return t==null?f:dAt(f,t,n)}}}var mAt=s(((e,t)=>
856{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,l){if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}}else if(s<0)throw Error(a+`NaN`);return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;
vendor: 5,100 bytes, line 856
856)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]<t[n]?1:0,e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(e,t){var n,r,a;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>
8560;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i){t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;return}if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}else if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0)if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i);if((i=e[r=`LN10`])!==void 0)if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i);return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)})),hAt=u(mAt());function gAt(e){return e===0?1:Math.floor(new hAt.default(e).abs().log(10).toNumber())+1}function _At(e,t,n){for(var r=new hAt.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var g6=u(mAt()),vAt=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},_6=(e,t,n)=>{if(e.lte(0))return new g6.default(0);var r=gAt(e.toNumber()),i=new g6.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new g6.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?new g6.default(s.toNumber()):new g6.default(Math.ceil(s.toNumber()))},yAt=(e,t,n)=>{if(e.lte(0))return new g6.default(0);var r=[1,2,2.5,5],i=e.toNumber(),a=Math.floor(new g6.default(i).abs().log(10).toNumber()),o=new g6.default(10).pow(a),s=e.div(o).toNumber(),c=r.findIndex(e=>e>=s-1e-10);if(c===-1&&(o=o.mul(10),c=0),c+=n,c>=r.length){var l=Math.floor(c/r.length);c%=r.length,o=o.mul(new g6.default(10).pow(l))}var u=new g6.default(r[c]??1).mul(o);return t?u:new g6.default(Math.ceil(u.toNumber()))},bAt=(e,t,n)=>{var r=new g6.default(1),i=new g6.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new g6.default(10).pow(gAt(e)-1),i=new g6.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new g6.default(Math.floor(e)))}else e===0?i=new g6.default(Math.floor((t-1)/2)):n||(i=new g6.default(Math.floor(e)));for(var o=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new g6.default(c-o).mul(r)).toNumber());return s},xAt=function(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:_6;if(!Number.isFinite((t-e)/(n-1)))return{step:new g6.default(0),tickMin:new g6.default(0),tickMax:new g6.default(0)};var o=a(new g6.default(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new g6.default(0):(s=new g6.default(e).add(t).div(2),s=s.sub(new g6.default(s).mod(o)));var c=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new g6.default(t).sub(s).div(o).toNumber()),u=c+l+1;return u>n?xAt(e,t,n,r,i+1,a):(u<n&&(l=t>0?l+(n-u):l,c=t>0?c:c+(n-u)),{step:o,tickMin:s.sub(new g6.default(c).mul(o)),tickMax:s.add(new g6.default(l).mul(o))})},SAt=function(e){var[t,n]=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,o=Math.max(r,2),[s,c]=vAt([t,n]);if(s===-1/0||c===1/0){var l=c===1/0?[s,...Array(r-1).fill(1/0)]:[...Array(r-1).fill(-1/0),c];return t>n?l.reverse():l}if(s===c)return bAt(s,r,i);var{step:u,tickMin:d,tickMax:f}=xAt(s,c,o,i,0,a===`snap125`?yAt:_6),p=_At(d,f.add(new g6.default(.1).mul(u)),u);return t>n?p.reverse():p},CAt=function(e,t){var[n,r]=e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`auto`,[o,s]=vAt([n,r]);if(o===-1/0||s===1/0)return[n,r];if(o===s)return[o];var c=a===`snap125`?yAt:_6,l=Math.max(t,2),u=c(new g6.default(s).sub(o).div(l-1),i,0
856),d=[..._At(new g6.default(o),new g6.default(s),u),s];return i===!1&&(d=d.map(e=>Math.round(e))),n>r?d.reverse():d},wAt=e=>e.rootProps.maxBarSize,TAt=e=>e.rootProps.barGap,EAt=e=>e.rootProps.barCategoryGap,DAt=e=>e.rootProps.barSize,v6=e=>e.rootProps.stackOffset,OAt=e=>e.rootProps.reverseStackOrder,y6=e=>e.options.chartName,b6=e=>e.rootProps.syncId,kAt=e=>e.rootProps.syncMethod,x6=e=>e.options.eventEmitter,S6={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},C6={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:`polygon`,cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:`auto`,orientation:`outer`,reversed:!1,scale:`auto`,tick:!0,tickLine:!0,tickSize:8,type:`auto`,zIndex:S6.axis},w6={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:`auto`,label:!1,orientation:`right`,radiusAxisId:0,reversed:!1,scale:`auto`,stroke:`#ccc`,tick:!0,tickCount:5,tickLine:!0,type:`auto`,zIndex:S6.axis},T6=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function E6(e,t,n){if(n!==`auto`)return n;if(e!=null)return V4(e,t)?`category`:`number`}function AAt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function D6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?AAt(Object(n),!0).forEach(function(t){jAt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AAt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jAt(e,t,n){return(t=MAt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MAt(e){var t=NAt(e,`string`);return typeof t==`symbol`?t:t+``}function NAt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var PAt={allowDataOverflow:C6.allowDataOverflow,allowDecimals:C6.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:C6.angleAxisId,includeHidden:!1,name:void 0,reversed:C6.reversed,scale:C6.scale,tick:C6.tick,tickCount:void 0,ticks:void 0,type:C6.type,unit:void 0,niceTicks:`auto`},FAt={allowDataOverflow:w6.allowDataOverflow,allowDecimals:w6.allowDecimals,allowDuplicatedCategory:w6.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:w6.radiusAxisId,includeHidden:w6.includeHidden,name:void 0,reversed:w6.reversed,scale:w6.scale,tick:w6.tick,tickCount:w6.tickCount,ticks:void 0,type:w6.type,unit:void 0,niceTicks:`auto`},O6=$([(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},MEt],(e,t)=>{if(e!=null)return e;var n=E6(t,`angleAxis`,PAt.type)??`category`;return D6(D6({},PAt),{},{type:n})}),k6=$([(e,t)=>e.polarAxis.radiusAxis[t],MEt],(e,t)=>{if(e!=null)return e;var n=E6(t,`radiusAxis`,FAt.type)??`category`;return D6(D6({},FAt),{},{type:n})}),A6=e=>e.polarOptions,j6=$([U4,W4,J4],Bkt),IAt=$([A6,j6],(e,t)=>{if(e!=null)return o2(e.innerRadius,t,0)}),LAt=$([A6,j6],(e,t)=>{if(e!=null)return o2(e.outerRadius,t,t*.8)}),RAt=$([A6],e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]});$([O6,RAt],T6);var zAt=$([j6,IAt,LAt],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});$([k6,zAt],T6);var BAt=$([o3,A6,IAt,LAt,U4,W4],(e,t,n,r,i,a)=>{if(!(e!==`centric`&&e!==`radial`||t==null||n==null||r==null)){var{cx:o,cy:s,startAngle:c,endAngle:l}=t;return{cx:o2(o,i,i/2),cy:o2(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:l,clockWise:!1}}}),M6=(e,t)=>t,N6=(e,t,n)=>n;function P6(e){return e?.id}function VAt(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(e=>{var t=e.data??r;if(!(t==null||t.length===0)){var n=P6(e);t.forEach((t,r)=>{var s=a==null||i?r:String(B4(t,a,null)),c=B4(t,e.dataKey,0),l=o.has(s)?o.get(s):{};Object.assign(l,{[n]:c}),o.set(s,l)})}}),Array.from(o.values())}function F6(e){return`stackId`in e&&e.stackId!=null&&e.dataKey!=null}var I6=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function L6(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function HAt(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var R6=e=>{var t=o3(e);return t===`horizontal`?`xAxis`:t===`vertical`?`yAxis`:t===`centric`?`angleAxis`:`radiu
856sAxis`},z6=e=>e.tooltip.settings.axisId;function B6(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(e){var t=i[0],n=i[1];return t<=n?e>=t&&e<=n:e>=n&&e<=t},bandwidth:n?()=>n.call(e):void 0,ticks:t?n=>t.call(e,n):void 0,map:(t,n)=>{var r=e(t);if(r!=null){if(e.bandwidth&&n!=null&&n.position){var i=e.bandwidth();switch(n.position){case`middle`:r+=i/2;break;case`end`:r+=i;break;default:break}}return r}}}}}var UAt=(e,t)=>{if(t!=null)switch(e){case`linear`:if(!h6(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];L4(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t;default:return t}};function V6(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function WAt(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function H6(e){let t,n,r;e.length===2?(t=e===V6||e===WAt?e:GAt,n=e,r=e):(t=V6,n=(t,n)=>V6(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function GAt(){return 0}function KAt(e){return e===null?NaN:+e}function*qAt(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var JAt=H6(V6);const YAt=JAt.right;JAt.left,H6(KAt).center;var U6=YAt,XAt=class extends Map{constructor(e,t=ejt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(ZAt(this,e))}has(e){return super.has(ZAt(this,e))}set(e,t){return super.set(QAt(this,e),t)}delete(e){return super.delete($At(this,e))}};function ZAt({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function QAt({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function $At({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ejt(e){return typeof e==`object`&&e?e.valueOf():e}function tjt(e=V6){if(e===V6)return njt;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function njt(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var rjt=Math.sqrt(50),ijt=Math.sqrt(10),ajt=Math.sqrt(2);function W6(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=rjt?10:a>=ijt?5:a>=ajt?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?W6(e,t,n*2):[s,c,l]}function G6(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?W6(t,e,n):W6(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}
856function K6(e,t,n){return t=+t,e=+e,n=+n,W6(e,t,n)[2]}function q6(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?K6(t,e,n):K6(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ojt(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function sjt(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function cjt(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?njt:tjt(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));cjt(e,t,u,d,i)}let a=e[t],o=n,s=r;for(J6(e,n,t),i(e[r],a)>0&&J6(e,n,r);o<s;){for(J6(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?J6(e,n,s):(++s,J6(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function J6(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function ljt(e,t,n){if(e=Float64Array.from(qAt(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return sjt(e);if(t>=1)return ojt(e);var r,i=(r-1)*t,a=Math.floor(i),o=ojt(cjt(e,a).subarray(0,a+1));return o+(sjt(e.subarray(a+1))-o)*(i-a)}}function ujt(e,t,n=KAt){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function djt(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function Y6(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function X6(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t);break}return this}const Z6=Symbol(`implicit`);function Q6(){var e=new XAt,t=[],n=[],r=Z6;function i(i){let a=e.get(i);if(a===void 0){if(r!==Z6)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new XAt;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Q6(t,n).unknown(r)},Y6.apply(i,arguments),i}function $6(){var e=Q6().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=djt(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()}
856,e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return $6(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},Y6.apply(d(),arguments)}function fjt(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return fjt(t())},e}function pjt(){return fjt($6.apply(null,arguments).paddingInner(1))}function e8(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mjt(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function t8(){}var n8=.7,r8=1/n8,i8=`\\s*([+-]?\\d+)\\s*`,a8=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,o8=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,hjt=/^#([0-9a-f]{3,8})$/,gjt=RegExp(`^rgb\\(${i8},${i8},${i8}\\)$`),_jt=RegExp(`^rgb\\(${o8},${o8},${o8}\\)$`),vjt=RegExp(`^rgba\\(${i8},${i8},${i8},${a8}\\)$`),yjt=RegExp(`^rgba\\(${o8},${o8},${o8},${a8}\\)$`),bjt=RegExp(`^hsl\\(${a8},${o8},${o8}\\)$`),xjt=RegExp(`^hsla\\(${a8},${o8},${o8},${a8}\\)$`),Sjt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};e8(t8,s8,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Cjt,formatHex:Cjt,formatHex8:wjt,formatHsl:Tjt,formatRgb:Ejt,toString:Ejt});function Cjt(){return this.rgb().formatHex()}function wjt(){return this.rgb().formatHex8()}function Tjt(){return Njt(this).formatHsl()}function Ejt(){return this.rgb().formatRgb()}function s8(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=hjt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Djt(t):n===3?new u8(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?c8(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?c8(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=gjt.exec(e))?new u8(t[1],t[2],t[3],1):(t=_jt.exec(e))?new u8(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=vjt.exec(e))?c8(t[1],t[2],t[3],t[4]):(t=yjt.exec(e))?c8(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bjt.exec(e))?Mjt(t[1],t[2]/100,t[3]/100,1):(t=xjt.exec(e))?Mjt(t[1],t[2]/100,t[3]/100,t[4]):Sjt.hasOwnProperty(e)?Djt(Sjt[e]):e===`transparent`?new u8(NaN,NaN,NaN,0):null}function Djt(e){return new u8(e>>16&255,e>>8&255,e&255,1)}function c8(e,t,n,r){return r<=0&&(e=t=n=NaN),new u8(e,t,n,r)}function Ojt(e){return e instanceof t8||(e=s8(e)),e?(e=e.rgb(),new u8(e.r,e.g,e.b,e.opacity)):new u8}function l8(e,t,n,r){return arguments.length===1?Ojt(e):new u8(e,t,n,r??1)}function u8(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}e8(u8,l8,mjt(t8,{brighter(e){return e=e==null?r8:r8**+e,new u8(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?n8:n8**+e,new u8(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this}
856,clamp(){return new u8(f8(this.r),f8(this.g),f8(this.b),d8(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:kjt,formatHex:kjt,formatHex8:Ajt,formatRgb:jjt,toString:jjt}));function kjt(){return`#${p8(this.r)}${p8(this.g)}${p8(this.b)}`}function Ajt(){return`#${p8(this.r)}${p8(this.g)}${p8(this.b)}${p8((isNaN(this.opacity)?1:this.opacity)*255)}`}function jjt(){let e=d8(this.opacity);return`${e===1?`rgb(`:`rgba(`}${f8(this.r)}, ${f8(this.g)}, ${f8(this.b)}${e===1?`)`:`, ${e})`}`}function d8(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function f8(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function p8(e){return e=f8(e),(e<16?`0`:``)+e.toString(16)}function Mjt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new m8(e,t,n,r)}function Njt(e){if(e instanceof m8)return new m8(e.h,e.s,e.l,e.opacity);if(e instanceof t8||(e=s8(e)),!e)return new m8;if(e instanceof m8)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new m8(o,s,c,e.opacity)}function Pjt(e,t,n,r){return arguments.length===1?Njt(e):new m8(e,t,n,r??1)}function m8(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}e8(m8,Pjt,mjt(t8,{brighter(e){return e=e==null?r8:r8**+e,new m8(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?n8:n8**+e,new m8(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new u8(g8(e>=240?e-240:e+120,i,r),g8(e,i,r),g8(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new m8(Fjt(this.h),h8(this.s),h8(this.l),d8(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=d8(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Fjt(this.h)}, ${h8(this.s)*100}%, ${h8(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Fjt(e){return e=(e||0)%360,e<0?e+360:e}function h8(e){return Math.max(0,Math.min(1,e||0))}function g8(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var _8=e=>()=>e;function Ijt(e,t){return function(n){return e+n*t}}function Ljt(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Rjt(e){return(e=+e)==1?zjt:function(t,n){return n-t?Ljt(t,n,e):_8(isNaN(t)?n:t)}}function zjt(e,t){var n=t-e;return n?Ijt(e,n):_8(isNaN(e)?t:e)}var Bjt=(function e(t){var n=Rjt(t);function r(e,t){var r=n((e=l8(e)).r,(t=l8(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=zjt(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Vjt(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Hjt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ujt(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=x8(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Wjt(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function v8(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Gjt(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=x8(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var y8=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,b8=new RegExp(y8.source,`g`);function Kjt(e){return function(){return e}}function qjt(e){return function(t){return e(t)+``}}function Jjt(e,t){var n=y8.lastIndex=b8.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=y8.exec(e))&&(i=b8.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:v8(r,i)})),n=b8.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?qjt(c[0].x):Kjt(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function x8(e,t){var n=typeof t,r;return t==null||n===`boolean`?_8(t):(n===`number`?v8:n===`string`?(r=s8(t))?(t=r,Bjt):Jjt:t instanceof s8?Bjt:t instanceof Date?Wjt:Hjt(t)?Vjt:Array.isArray(t)?Ujt:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Gjt:v8)(e,t)}function S8(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Yjt(e,t){t===void 0&&(t=e,e=x8);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function Xjt(e){return function(){return e}}function C8(e){return+e}var Zjt=[0,1];function w8(e){return e}function T8(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Xjt(isNaN(t)?NaN:.5)}function Qjt(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function $jt(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=T8(i,r),a=n(o,a)):(r=T8(r,i),a=n(a,o)),function(e){return a(r(e))}}function eMt(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=T8(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=U6(e,t,1,r)-1;return a[n](i[n](t))}}function E8(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function D8(){var e=Zjt,t=Zjt,n=x8,r,i,a,o=w8,s,c,l;function u(){var n=Math.min(e.length,t.length);
vendor: 4,154 bytes, line 856
856return o!==w8&&(o=Qjt(e[0],e[n-1])),s=n>2?eMt:$jt,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),v8))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,C8),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=S8,u()},d.clamp=function(e){return arguments.length?(o=e?!0:w8,u()):o!==w8},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function O8(){return D8()(w8,w8)}function tMt(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function k8(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function A8(e){return e=k8(Math.abs(e)),e?e[1]:NaN}function nMt(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function rMt(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var iMt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function j8(e){if(!(t=iMt.exec(e)))throw Error(`invalid format: `+e);var t;return new M8({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}j8.prototype=M8.prototype;function M8(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}M8.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function aMt(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var N8;function oMt(e,t){var n=k8(e,t);if(!n)return N8=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(N8=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+k8(e,Math.max(0,t+a-1))[0]}function sMt(e,t){var n=k8(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var cMt={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:tMt,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>sMt(e*100,t),r:sMt,s:oMt,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lMt(e){return e}var uMt=Array.prototype.map,dMt=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function fMt(e){var t=e.grouping===void 0||e.thousands===void 0?lMt:nMt(uMt.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?lMt:rMt(uMt.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`â`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=j8(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):cMt[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r
856:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=cMt[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=aMt(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&N8!==void 0?dMt[8+N8/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(A8(t)/3)))*3,r=10**-n,i=l((e=j8(e),e.type=`f`,e),{suffix:dMt[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var P8,F8,pMt;mMt({thousands:`,`,grouping:[3],currency:[`$`,``]});function mMt(e){return P8=fMt(e),F8=P8.format,pMt=P8.formatPrefix,P8}function hMt(e){return Math.max(0,-A8(Math.abs(e)))}function gMt(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(A8(t)/3)))*3-A8(Math.abs(e)))}function _Mt(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,A8(t)-A8(e))+1}function vMt(e,t,n,r){var i=q6(e,t,n),a;switch(r=j8(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=gMt(i,o))&&(r.precision=a),pMt(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=_Mt(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=hMt(i))&&(r.precision=a-(r.type===`%`)*2);break}return F8(r)}function I8(e){var t=e.domain;return e.ticks=function(e){var n=t();return G6(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return vMt(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-- >0;){if(l=K6(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function yMt(){var e=O8();return e.copy=function(){return E8(e,yMt())},Y6.apply(e,arguments),I8(e)}function bMt(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,C8),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return bMt(e).unknown(t)},e=arguments.length?Array.from(e,C8):[0,1],I8(n)}function xMt(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function SMt(e){return Math.log(e)}function CMt(e){return Math.exp(e)}function wMt(e){return-Math.log(-e)}function TMt(e){return-Math.exp(-e)}function EMt(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function DMt(e){return e===10?EMt:e===Math.E?Math.exp:t=>e**+t}function OMt(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function kMt(e){return(t,n)=>-e(-t,n)}function L8(e){let t=e(SMt,CMt),n=t.domain,r=10,i,a;function o(){return i=OMt(r),a=DMt(r),n()[0]<0?(i=kMt(i),a=kMt(a),e(wMt,TMt)):e(SMt,CMt),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=G6(o,s,p))}else m=G6(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=j8(n)).precision==null&&(n.trim=!0),n=F8(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(xMt(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function AMt(){let e=L8(D8()).domain([1,10]);return e.copy=()=>E8(e,AMt()).base(e.base()),Y6.apply(e,arguments),e}
856function jMt(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function MMt(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function R8(e){var t=1,n=e(jMt(t),MMt(t));return n.constant=function(n){return arguments.length?e(jMt(t=+n),MMt(t)):t},I8(n)}function NMt(){var e=R8(D8());return e.copy=function(){return E8(e,NMt()).constant(e.constant())},Y6.apply(e,arguments)}function PMt(e){return function(t){return t<0?-((-t)**+e):t**+e}}function FMt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function IMt(e){return e<0?-e*e:e*e}function z8(e){var t=e(w8,w8),n=1;function r(){return n===1?e(w8,w8):n===.5?e(FMt,IMt):e(PMt(n),PMt(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},I8(t)}function B8(){var e=z8(D8());return e.copy=function(){return E8(e,B8()).exponent(e.exponent())},Y6.apply(e,arguments),e}function LMt(){return B8.apply(null,arguments).exponent(.5)}function RMt(e){return Math.sign(e)*e*e}function zMt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function BMt(){var e=O8(),t=[0,1],n=!1,r;function i(t){var i=zMt(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(RMt(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,C8)).map(RMt)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return BMt(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Y6.apply(i,arguments),I8(i)}function VMt(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=ujt(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[U6(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(V6),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return VMt().domain(e).range(t).unknown(r)},Y6.apply(a,arguments)}function HMt(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[U6(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return HMt().domain([e,t]).range(i).unknown(a)},Y6.apply(I8(o),arguments)}function UMt(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[U6(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return UMt().domain(e).range(t).unknown(n)},Y6.apply(i,arguments)}var V8=new Date,H8=new Date;function U8(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>U8(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(V8.setTime(+t),H8.setTime(+r),e(V8),e(H8),Math.floor(n(V8,H8))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}const W8=U8(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);W8.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?U8(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):W8),W8.range;const G8=1e3,K8=G8*60,q8=K8*60,J8=q8*24,Y8=J8*7,WMt=J8*30,X8=J8*365,Z8=U8(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*G8)},(e,t)=>(t-e)/G8,e=>e.getUTCSeconds());Z8.range;const Q8=U8(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*G8)},(e,t)=>{e.setTime(+e+t*K8)},(e,t)=>(t-e)/K8,e=>e.getMinutes());Q8.range;const $8=U8(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*K8)},(e,t)=>(t-e)/K8,e=>e.getUTCMinutes());$8.range;const e5=U8(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*G8-e.getMinutes()*K8)},(e,t)=>{e.setTime(+e+t*q8)},(e,t)=>(t-e)/q8,e=>e.getHours());e5.range;const t5=U8(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*q8)},(e,t)=>(t-e)/q8,e=>e.getUTCHours());t5.range;const n5=U8(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*K8)/J8,e=>e.getDate()-1);n5.range;const r5=U8(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/J8,e=>e.getUTCDate()-1);r5.range;const GMt=U8(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/J8,e=>Math.floor(e/J8));GMt.range;function i5(e){return U8(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*K8)/Y8)}const a5=i5(0),o5=i5(1),KMt=i5(2),qMt=i5(3),s5=i5(4),JMt=i5(5),YMt=i5(6);a5.range,o5.range,KMt.range,qMt.range,s5.range,JMt.range,YMt.range;function c5(e){return U8(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/Y8)}const l5=c5(0),u5=c5(1),XMt=c5(2),ZMt=c5(3),d5=c5(4),QMt=c5(5),$Mt=c5(6);l5.range,u5.range,XMt.range,ZMt.range,d5.range,QMt.range,$Mt.range;const f5=U8(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());f5.range;const p5=U8(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());p5.range;const m5=U8(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());m5.every=e=>
vendor: 4,304 bytes, line 856
856!isFinite(e=Math.floor(e))||!(e>0)?null:U8(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),m5.range;const h5=U8(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());h5.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:U8(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),h5.range;function eNt(e,t,n,r,i,a){let o=[[Z8,1,G8],[Z8,5,5*G8],[Z8,15,15*G8],[Z8,30,30*G8],[a,1,K8],[a,5,5*K8],[a,15,15*K8],[a,30,30*K8],[i,1,q8],[i,3,3*q8],[i,6,6*q8],[i,12,12*q8],[r,1,J8],[r,2,2*J8],[n,1,Y8],[t,1,WMt],[t,3,3*WMt],[e,1,X8]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=H6(([,,e])=>e).right(o,i);if(a===o.length)return e.every(q6(t/X8,n/X8,r));if(a===0)return W8.every(Math.max(q6(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[tNt,nNt]=eNt(h5,p5,l5,GMt,t5,$8),[rNt,iNt]=eNt(m5,f5,a5,n5,e5,Q8);function g5(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function _5(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function v5(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function aNt(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=x5(i),u=S5(i),d=x5(a),f=S5(a),p=x5(o),m=S5(o),h=x5(s),g=S5(s),_=x5(c),v=S5(c),y={a:N,A:P,b:F,B:I,c:null,d:ANt,e:ANt,f:FNt,g:KNt,G:JNt,H:jNt,I:MNt,j:NNt,L:PNt,m:INt,M:LNt,p:L,q:ee,Q:_Pt,s:vPt,S:RNt,u:zNt,U:BNt,V:HNt,w:UNt,W:WNt,x:null,X:null,y:GNt,Y:qNt,Z:YNt,"%":gPt},b={a:R,A:te,b:ne,B:re,c:null,d:XNt,e:XNt,f:tPt,g:fPt,G:mPt,H:ZNt,I:QNt,j:$Nt,L:ePt,m:nPt,M:rPt,p:ie,q:z,Q:_Pt,s:vPt,S:iPt,u:aPt,U:oPt,V:cPt,w:lPt,W:uPt,x:null,X:null,y:dPt,Y:pPt,Z:hPt,"%":gPt},x={a:E,A:D,b:O,B:k,c:A,d:bNt,e:bNt,f:ENt,g:gNt,G:hNt,H:SNt,I:SNt,j:xNt,L:TNt,m:yNt,M:CNt,p:T,q:vNt,Q:ONt,s:kNt,S:wNt,u:dNt,U:fNt,V:pNt,w:uNt,W:mNt,x:j,X:M,y:gNt,Y:hNt,Z:_Nt,"%":DNt};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=oNt[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=v5(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=_5(v5(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?u5.ceil(a):u5(a),a=r5.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=g5(v5(r.y,0,1)),o=a.getDay(),a=o>4||o===0?o5.ceil(a):o5(a),a=n5.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else (`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:`W`in r?1:0),o=`Z`in r?_5(v5(r.y,0,1)).getUTCDay():g5(v5(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,_5(r)):g5(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in oNt?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}
vendor: 4,988 bytes, line 856
856function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function P(e){return a[e.getDay()]}function F(e){return c[e.getMonth()]}function I(e){return s[e.getMonth()]}function L(e){return i[+(e.getHours()>=12)]}function ee(e){return 1+~~(e.getMonth()/3)}function R(e){return o[e.getUTCDay()]}function te(e){return a[e.getUTCDay()]}function ne(e){return c[e.getUTCMonth()]}function re(e){return s[e.getUTCMonth()]}function ie(e){return i[+(e.getUTCHours()>=12)]}function z(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var oNt={"-":``,_:` `,0:`0`},y5=/^\s*\d+/,sNt=/^%/,cNt=/[\\^$*+?|[\]().{}]/g;function b5(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function lNt(e){return e.replace(cNt,`\\$&`)}function x5(e){return RegExp(`^(?:`+e.map(lNt).join(`|`)+`)`,`i`)}function S5(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function uNt(e,t,n){var r=y5.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function dNt(e,t,n){var r=y5.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function fNt(e,t,n){var r=y5.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function pNt(e,t,n){var r=y5.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function mNt(e,t,n){var r=y5.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function hNt(e,t,n){var r=y5.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function gNt(e,t,n){var r=y5.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function _Nt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function vNt(e,t,n){var r=y5.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function yNt(e,t,n){var r=y5.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function bNt(e,t,n){var r=y5.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function xNt(e,t,n){var r=y5.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function SNt(e,t,n){var r=y5.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function CNt(e,t,n){var r=y5.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function wNt(e,t,n){var r=y5.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function TNt(e,t,n){var r=y5.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ENt(e,t,n){var r=y5.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function DNt(e,t,n){var r=sNt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function ONt(e,t,n){var r=y5.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function kNt(e,t,n){var r=y5.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ANt(e,t){return b5(e.getDate(),t,2)}function jNt(e,t){return b5(e.getHours(),t,2)}function MNt(e,t){return b5(e.getHours()%12||12,t,2)}function NNt(e,t){return b5(1+n5.count(m5(e),e),t,3)}function PNt(e,t){return b5(e.getMilliseconds(),t,3)}function FNt(e,t){return PNt(e,t)+`000`}function INt(e,t){return b5(e.getMonth()+1,t,2)}function LNt(e,t){return b5(e.getMinutes(),t,2)}function RNt(e,t){return b5(e.getSeconds(),t,2)}function zNt(e){var t=e.getDay();return t===0?7:t}function BNt(e,t){return b5(a5.count(m5(e)-1,e),t,2)}function VNt(e){var t=e.getDay();return t>=4||t===0?s5(e):s5.ceil(e)}function HNt(e,t){return e=VNt(e),b5(s5.count(m5(e),e)+(m5(e).getDay()===4),t,2)}function UNt(e){return e.getDay()}function WNt(e,t){return b5(o5.count(m5(e)-1,e),t,2)}function GNt(e,t){return b5(e.getFullYear()%100,t,2)}function KNt(e,t){return e=VNt(e),b5(e.getFullYear()%100,t,2)}function qNt(e,t){return b5(e.getFullYear()%1e4,t,4)}function JNt(e,t){var n=e.getDay();return e=n>=4||n===0?s5(e):s5.ceil(e),b5(e.getFullYear()%1e4,t,4)}function YNt(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+b5(t/60|0,`0`,2)+b5(t%60,`0`,2)}function XNt(e,t){return b5(e.getUTCDate(),t,2)}function ZNt(e,t){return b5(e.getUTCHours(),t,2)}function QNt(e,t){return b5(e.getUTCHours()%12||12,t,2)}function $Nt(e,t){return b5(1+r5.count(h5(e),e),t,3)}function ePt(e,t){return b5(e.getUTCMilliseconds(),t,3)}function tPt(e,t){return ePt(e,t)+`000`}function nPt(e,t){return b5(e.getUTCMonth()+1,t,2)}function rPt(e,t){return b5(e.getUTCMinutes(),t,2)}function iPt(e,t){return b5(e.getUTCSeconds(),t,2)}function aPt(e){var t=e.getUTCDay();return t===0?7:t}function oPt(e,t){return b5(l5.count(h5(e)-1,e),t,2)}function sPt(e){var t=e.getUTCDay();return t>=4||t===0?d5(e):d5.ceil(e)}
856function cPt(e,t){return e=sPt(e),b5(d5.count(h5(e),e)+(h5(e).getUTCDay()===4),t,2)}function lPt(e){return e.getUTCDay()}function uPt(e,t){return b5(u5.count(h5(e)-1,e),t,2)}function dPt(e,t){return b5(e.getUTCFullYear()%100,t,2)}function fPt(e,t){return e=sPt(e),b5(e.getUTCFullYear()%100,t,2)}function pPt(e,t){return b5(e.getUTCFullYear()%1e4,t,4)}function mPt(e,t){var n=e.getUTCDay();return e=n>=4||n===0?d5(e):d5.ceil(e),b5(e.getUTCFullYear()%1e4,t,4)}function hPt(){return`+0000`}function gPt(){return`%`}function _Pt(e){return+e}function vPt(e){return Math.floor(e/1e3)}var C5,yPt,bPt;xPt({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function xPt(e){return C5=aNt(e),yPt=C5.format,C5.parse,bPt=C5.utcFormat,C5.utcParse,C5}function SPt(e){return new Date(e)}function CPt(e){return e instanceof Date?+e:+new Date(+e)}function w5(e,t,n,r,i,a,o,s,c,l){var u=O8(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,CPt)):f().map(SPt)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(xMt(n,e)):u},u.copy=function(){return E8(u,w5(e,t,n,r,i,a,o,s,c,l))},u}function wPt(){return Y6.apply(w5(rNt,iNt,m5,f5,a5,n5,e5,Q8,Z8,yPt).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function TPt(){return Y6.apply(w5(tNt,nNt,h5,p5,l5,r5,t5,$8,Z8,bPt).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function T5(){var e=0,t=1,n,r,i,a,o=w8,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(x8),l.rangeRound=u(S8),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function E5(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function EPt(){var e=I8(T5()(w8));return e.copy=function(){return E5(e,EPt())},X6.apply(e,arguments)}function DPt(){var e=L8(T5()).domain([1,10]);return e.copy=function(){return E5(e,DPt()).base(e.base())},X6.apply(e,arguments)}function OPt(){var e=R8(T5());return e.copy=function(){return E5(e,OPt()).constant(e.constant())},X6.apply(e,arguments)}function D5(){var e=z8(T5());return e.copy=function(){return E5(e,D5()).exponent(e.exponent())},X6.apply(e,arguments)}function kPt(){return D5.apply(null,arguments).exponent(.5)}function APt(){var e=[],t=w8;
856function n(n){if(n!=null&&!isNaN(n=+n))return t((U6(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(V6),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>ljt(e,r/t))},n.copy=function(){return APt(t).domain(e)},X6.apply(n,arguments)}function O5(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=w8,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=Yjt(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(x8),p.rangeRound=m(S8),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function jPt(){var e=I8(O5()(w8));return e.copy=function(){return E5(e,jPt())},X6.apply(e,arguments)}function MPt(){var e=L8(O5()).domain([.1,1,10]);return e.copy=function(){return E5(e,MPt()).base(e.base())},X6.apply(e,arguments)}function NPt(){var e=R8(O5());return e.copy=function(){return E5(e,NPt()).constant(e.constant())},X6.apply(e,arguments)}function k5(){var e=z8(O5());return e.copy=function(){return E5(e,k5()).exponent(e.exponent())},X6.apply(e,arguments)}function PPt(){return k5.apply(null,arguments).exponent(.5)}var A5=c({scaleBand:()=>$6,scaleDiverging:()=>jPt,scaleDivergingLog:()=>MPt,scaleDivergingPow:()=>k5,scaleDivergingSqrt:()=>PPt,scaleDivergingSymlog:()=>NPt,scaleIdentity:()=>bMt,scaleImplicit:()=>Z6,scaleLinear:()=>yMt,scaleLog:()=>AMt,scaleOrdinal:()=>Q6,scalePoint:()=>pjt,scalePow:()=>B8,scaleQuantile:()=>VMt,scaleQuantize:()=>HMt,scaleRadial:()=>BMt,scaleSequential:()=>EPt,scaleSequentialLog:()=>DPt,scaleSequentialPow:()=>D5,scaleSequentialQuantile:()=>APt,scaleSequentialSqrt:()=>kPt,scaleSequentialSymlog:()=>OPt,scaleSqrt:()=>LMt,scaleSymlog:()=>NMt,scaleThreshold:()=>UMt,scaleTime:()=>wPt,scaleUtc:()=>TPt,tickFormat:()=>vMt});function FPt(e){if(e in A5)return A5[e]();var t=`scale${l2(e)}`;if(t in A5)return A5[t]()}function IPt(e,t,n){if(typeof e==`function`)return e.copy().domain(t).range(n);if(e!=null){var r=FPt(e);if(r!=null)return r.domain(t).range(n),r}}function j5(e,t,n,r){if(!(n==null||r==null))return typeof e.scale==`function`?IPt(e.scale,n,r):IPt(t,n,r)}function LPt(e){return`scale${l2(e)}`}function RPt(e){return LPt(e)in A5}var zPt=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r===`auto`)return i===`category`&&n&&(n.indexOf(`LineChart`)>=0||n.indexOf(`AreaChart`)>=0||n.indexOf(`ComposedChart`)>=0&&!t)?`point`:i===`category`?`band`:`linear`;if(typeof r==`string`)return RPt(r)?r:`point`}};function BPt(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function VPt(e,t){if(e){var n=t??e.domain(),r=n.map(t=>e(t)??0),i=e.range();if(!(n.length===0||i.length<2))return e=>{var t=BPt(r,e);if(t<=0)return n[0];if(t>=n.length)return n[n.length-1];var i=r[t-1]??0,a=r[t]??0;return Math.abs(e-i)<=Math.abs(e-a)?n[t-1]:n[t]}}}function HPt(e){if(e!=null)return`invert`in e&&typeof e.invert==`function`?e.invert.bind(e):VPt(e,void 0)}var UPt=u(lAt());function WPt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function M5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WPt(Object(n),!0).forEach(function(t){GPt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WPt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GPt(e,t,n){return(t=KPt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KPt(e){var t=qPt(e,`string`);return typeof t==`symbol`?t:t+``}function qPt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var N5=[0,`auto`],JPt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`bottom`,padding:{left:0,right:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`category`,unit:void 0,niceTicks:`auto`},YPt=(e,t)=>e.cartesianAxis.xAxis[t],P5=(e,t)=>YPt(e,t)??JPt,XPt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:N5,hide:!0,id:0,includeHidden:!1,interval:`preserveEnd`,minTickGap:5,mirror:!1,name:void 0,orientation:`left`,padding:{top:0,bottom:0},reversed:!1,scale:`auto`,tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:`number`,unit:void 0,niceTicks:`auto`,width:60},ZPt=(e,t)=>e.cartesianAxis.yAxis[t],F5=(e,t)=>ZPt(e,t)??XPt,QPt={domain:[0,`auto`],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:``,range:[64,64],scale:`auto`,type:`number`,unit:``},I5=(e,t)=>e.cartesianAxis.zAxis[t]??QPt,L5=(e,t,n)=>{switch(t){case`xAxis`:return P5(e,n);case`yAxis`:return F5(e,n);case`zAxis`:return I5(e,n);case`angleAxis`:return O6(e,n);case`radiusAxis`:return k6(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},$Pt=(e,t,n)=>{switch(t){case`xAxis`:return P5(e,n);case`yAxis`:return F5(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},R5=(e,t,n)=>{switch(t){case`xAxis`:return P5(e,n);case`yAxis`:return F5(e,n);case`angleAxis`:return O6(e,n);case`radiusAxis`:return k6(e,n);default:throw Error(`Unexpected axis type: ${t}`)}},eFt=e=>e.graphicalItems.cartesianItems.some(e=>e.type===`bar`)||e.graphicalItems.polarItems.some(e=>e.type===`radialBar`);function z5(e,t){return n=>{switch(e){case`xAxis`:return`xAxisId`in n&&n.xAxisId===t;case`yAxis`:return`yAxisId`in n&&n.yAxisId===t;case`zAxis`:return`zAxisId`in n&&n.zAxisId===t;case`angleAxis`:return`angleAxisId`in n&&n.angleAxisId===t;
856case`radiusAxis`:return`radiusAxisId`in n&&n.radiusAxisId===t;default:return!1}}}var tFt=e=>e.graphicalItems.cartesianItems,nFt=$([M6,N6],z5),B5=(e,t,n)=>e.filter(n).filter(e=>t?.includeHidden===!0?!0:!e.hide),V5=$([tFt,L5,nFt],B5,{memoizeOptions:{resultEqualityCheck:L6}}),rFt=$([V5],e=>e.filter(e=>e.type===`area`||e.type===`bar`).filter(F6)),iFt=e=>e.filter(e=>!(`stackId`in e)||e.stackId===void 0),aFt=$([V5],iFt),H5=e=>e.map(e=>e.data).filter(Boolean).flat(1),oFt=$([V5],H5,{memoizeOptions:{resultEqualityCheck:L6}}),U5=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},W5=$([oFt,m6],U5),G5=(e,t,n)=>t?.dataKey==null?n.length>0?n.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:B4(e,t)}))):e.map(e=>({value:e})):e.map(e=>({value:B4(e,t.dataKey)})),K5=$([W5,L5,V5],G5);function q5(e){if(i2(e)||e instanceof Date){var t=Number(e);if(L4(t))return t}}function sFt(e){if(Array.isArray(e)){var t=[q5(e[0]),q5(e[1])];return h6(t)?t:void 0}var n=q5(e);if(n!=null)return[n,n]}function J5(e){return e.map(q5).filter(u2)}function cFt(e,t){var n=q5(e),r=q5(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var lFt=$([K5],e=>e?.map(e=>e.value).sort(cFt));function uFt(e,t){switch(e){case`xAxis`:return t.direction===`x`;case`yAxis`:return t.direction===`y`;default:return!1}}function dFt(e,t,n){return!n||typeof t!=`number`||t2(t)||!n.length?[]:J5(n.flatMap(n=>{var r=B4(e,n.dataKey),i,a;if(Array.isArray(r)?[i,a]=r:i=a=r,!(!L4(i)||!L4(a)))return[t-i,t+a]}))}var Y5=e=>R5(e,R6(e),z6(e)),X5=$([Y5],e=>e?.dataKey),fFt=$([rFt,m6,Y5],VAt),pFt=(e,t,n,r)=>{var i=t.reduce((e,t)=>{if(t.stackId==null)return e;var n=e[t.stackId];return n??=[],n.push(t),e[t.stackId]=n,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var[i,a]=t,o=r?[...a].reverse():a;return[i,{stackedData:kTt(e,o.map(P6),n),graphicalItems:o}]}))},mFt=$([fFt,rFt,v6,OAt],pFt),hFt=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!==`zAxis`){var o=ITt(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},gFt=$([L5],e=>e.allowDataOverflow),Z5=e=>{if(e==null||!(`domain`in e))return N5;if(e.domain!=null)return e.domain;if(`ticks`in e&&e.ticks!=null){if(e.type===`number`){var t=J5(e.ticks);return[Math.min(...t),Math.max(...t)]}if(e.type===`category`)return e.ticks.map(String)}return e?.domain??N5},Q5=$([L5],Z5),$5=$([Q5,gFt],fAt),_Ft=$([mFt,f6,M6,$5],hFt,{memoizeOptions:{resultEqualityCheck:I6}}),e7=e=>e.errorBars,vFt=(e,t,n)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>uFt(n,e)),t7=function(){var e=[...arguments].filter(Boolean);if(e.length!==0){var t=e.flat();return[Math.min(...t),Math.max(...t)]}},n7=(e,t,n,r,i)=>{var a,o;if(n.length>0&&e.forEach(e=>{n.forEach(n=>{var s=r[n.id]?.filter(e=>uFt(i,e)),c=B4(e,t.dataKey??n.dataKey),l=dFt(e,c,s);if(l.length>=2){var u=Math.min(...l),d=Math.max(...l);(a==null||u<a)&&(a=u),(o==null||d>o)&&(o=d)}var f=sFt(c);f!=null&&(a=a==null?f[0]:Math.min(a,f[0]),o=o==null?f[1]:Math.max(o,f[1]))})}),t?.dataKey!=null&&e.forEach(e=>{var n=sFt(B4(e,t.dataKey));n!=null&&(a=a==null?n[0]:Math.min(a,n[0]),o=o==null?n[1]:Math.max(o,n[1]))}),L4(a)&&L4(o))return[a,o]},yFt=$([W5,L5,aFt,e7,M6],n7,{memoizeOptions:{resultEqualityCheck:I6}});function bFt(e){var{value:t}=e;if(i2(t)||t instanceof Date)return t}var xFt=(e,t,n)=>{var r=e.map(bFt).filter(e=>e!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&qxt(r))?(0,UPt.default)(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},SFt=e=>e.referenceElements.dots,r7=(e,t,n)=>e.filter(e=>e.ifOverflow===`extendDomain`).filter(e=>t===`xAxis`?e.xAxisId===n:e.yAxisId===n),CFt=$([SFt,M6,N6],r7),wFt=e=>e.referenceElements.areas,TFt=$([wFt,M6,N6],r7),EFt=e=>e.referenceElements.lines,DFt=$([EFt,M6,N6],r7),OFt=(e,t)=>{if(e!=null){var n=J5(e.map(e=>t===`xAxis`?e.x:e.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},kFt=$(CFt,M6,OFt),AFt=(e,t)=>{if(e!=null){var n=J5(e.flatMap(e=>[t===`xAxis`?e.x1:e.y1,t===`xAxis`?e.x2:e.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},jFt=$([TFt,M6],AFt);function MFt(e){if(e.x!=null)return J5([e.x]);var t=e.segment?.map(e=>e.x);return t==null||t.length===0?[]:J5(t)}function NFt(e){if(e.y!=null)return J5([e.y]);var t=e.segment?.map(e=>e.y);return t==null||t.length===0?[]:J5(t)}var PFt=(e,t)=>
856{if(e!=null){var n=e.flatMap(e=>t===`xAxis`?MFt(e):NFt(e));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},FFt=$(kFt,$([DFt,M6],PFt),jFt,(e,t,n)=>t7(e,n,t)),i7=(e,t,n,r,i,a,o,s)=>n??pAt(t,o===`vertical`&&s===`xAxis`||o===`horizontal`&&s===`yAxis`?t7(r,a,i):t7(a,i),e.allowDataOverflow),IFt=$([L5,Q5,$5,_Ft,yFt,FFt,o3,M6],i7,{memoizeOptions:{resultEqualityCheck:I6}}),LFt=[0,1],a7=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:s,type:c}=e,l=V4(t,a);return l&&s==null?(0,UPt.default)(0,n?.length??0):c===`category`?xFt(r,e,l):i===`expand`?LFt:o}},o7=$([L5,o3,W5,K5,v6,M6,IFt],a7),s7=$([L5,eFt,y6],zPt),c7=(e,t,n)=>{var{niceTicks:r}=t;if(r!==`none`){var i=Z5(t),a=Array.isArray(i)&&(i[0]===`auto`||i[1]===`auto`);if((r===`snap125`||r===`adaptive`)&&t!=null&&t.tickCount&&h6(e)){if(a)return SAt(e,t.tickCount,t.allowDecimals,r);if(t.type===`number`)return CAt(e,t.tickCount,t.allowDecimals,r)}if(r===`auto`&&n===`linear`&&t!=null&&t.tickCount){if(a&&h6(e))return SAt(e,t.tickCount,t.allowDecimals,`adaptive`);if(t.type===`number`&&h6(e))return CAt(e,t.tickCount,t.allowDecimals,`adaptive`)}}},l7=$([o7,R5,s7],c7),u7=(e,t,n,r)=>{if(r!==`angleAxis`&&e?.type===`number`&&h6(t)&&Array.isArray(n)&&n.length>
8560){var i=t[0],a=n[0]??0,o=t[1],s=n[n.length-1]??0;return[Math.min(i,a),Math.max(o,s)]}return t},RFt=$([L5,o7,l7,M6],u7),zFt=$($(K5,L5,(e,t)=>{if(!(!t||t.type!==`number`)){var n=1/0,r=Array.from(J5(e.map(e=>e.value))).sort((e,t)=>e-t),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var s=0;s<r.length-1;s++){var c=r[s],l=r[s+1];if(!(c==null||l==null)){var u=l-c;n=Math.min(n,u)}}return n/o}}),o3,EAt,J4,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!L4(e))return 0;var a=t===`vertical`?r.height:r.width;if(i===`gap`)return e*a/2;if(i===`no-gap`){var o=o2(n,e*a),s=e*a/2;return s-o-(s-o)/a*o}return 0}),BFt=(e,t,n)=>{var r=P5(e,t);return r==null||typeof r.padding!=`string`?0:zFt(e,`xAxis`,t,n,r.padding)},VFt=(e,t,n)=>{var r=F5(e,t);return r==null||typeof r.padding!=`string`?0:zFt(e,`yAxis`,t,n,r.padding)},HFt=$(P5,BFt,(e,t)=>{if(e==null)return{left:0,right:0};var{padding:n}=e;return typeof n==`string`?{left:t,right:t}:{left:(n.left??0)+t,right:(n.right??0)+t}}),UFt=$(F5,VFt,(e,t)=>{if(e==null)return{top:0,bottom:0};var{padding:n}=e;return typeof n==`string`?{top:t,bottom:t}:{top:(n.top??0)+t,bottom:(n.bottom??0)+t}}),WFt=$([J4,HFt,Z4,X4,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),GFt=$([J4,o3,UFt,Z4,X4,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t===`horizontal`?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),d7=(e,t,n,r)=>{switch(t){case`xAxis`:return WFt(e,n,r);case`yAxis`:return GFt(e,n,r);case`zAxis`:return I5(e,n)?.range;case`angleAxis`:return RAt(e);case`radiusAxis`:return zAt(e,n);default:return}},KFt=$([L5,d7],T6),f7=$([L5,s7,$([s7,RFt],UAt),KFt],j5),qFt=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n;if(V4(e,r)&&(i===`number`||a!==`auto`))return t.map(e=>e.value)}},p7=$([o3,K5,R5,M6],qFt),m7=$([f7],B6);$([f7],HPt),$([f7,lFt],VPt),$([V5,e7,M6],vFt);function JFt(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var h7=(e,t)=>t,g7=(e,t,n)=>n,YFt=$(G4,h7,g7,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(JFt)),XFt=$(K4,h7,g7,(e,t,n)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===n).sort(JFt)),ZFt=(e,t)=>({width:e.width,height:t.height}),QFt=(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height}),$Ft=$(J4,P5,ZFt),eIt=(e,t,n)=>{switch(t){case`top`:return e.top;case`bottom`:return n-e.bottom;default:return 0}},tIt=(e,t,n)=>{switch(t){case`left`:return e.left;case`right`:return n-e.right;default:return 0}},nIt=$(W4,J4,YFt,h7,g7,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=ZFt(t,n);o??=eIt(t,r,e);var c=r===`top`&&!i||r===`bottom`&&i;a[n.id]=o-Number(c)*s.height,o+=(c?-1:1)*s.height}),a}),rIt=$(U4,J4,XFt,h7,g7,(e,t,n,r,i)=>{var a={},o;return n.forEach(n=>{var s=QFt(t,n);o??=tIt(t,r,e);var c=r===`left`&&!i||r===`right`&&i;a[n.id]=o-Number(c)*s.width,o+=(c?-1:1)*s.width}),a}),iIt=$([J4,P5,(e,t)=>{var n=P5(e,t);if(n!=null)return nIt(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),aIt=$([J4,F5,(e,t)=>{var n=F5(e,t);if(n!=null)return rIt(e,n.orientation,n.mirror)},(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),oIt=$(J4,F5,(e,t)=>({width:typeof t.width==`number`?t.width:60,height:e.height})),sIt=(e,t,n)=>{switch(t){case`xAxis`:return $Ft(e,n).width;case`yAxis`:return oIt(e,n).height;default:return}},cIt=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,s=V4(e,r),c=t.map(e=>e.value);if(o&&s&&a===`category`&&i&&qxt(c))return c}},_7=$([o3,K5,L5,M6],cIt),lIt=$([o3,$Pt,s7,m7,_7,p7,d7,l7,M6],(e,t,n,r,i,a,o,s,c)=>{if(t!=null){var l=V4(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:l,niceTicks:s,range:o,realScaleType:n,scale:r}}}),uIt=$([o3,R5,s7,m7,l7,d7,_7,p7,M6],(e,t,n,r,i,a,o,s,c)=>{if(!(t==null||r==null)){var l=V4(e,c),{type:u,ticks:d,tickCount:f}=t,p=n===`scaleBand`&&typeof r.bandwidth==`function`?r.bandwidth()/2:2,m=u===`category`&&r.bandwidth?r.bandwidth()/p:0;m=c===`angleAxis`&&a!=null&&a.length>=2?e2(a[0]-a[1])*2*m:m;var h=d||i;return h?h.map((e,t)=>{var n=o?o.indexOf(e):e,i=r.map(n);return L4(i)?{index:t,coordinate:i+m,value:e,offset:m}:null}).filter(u2):l&&s?s.map((e,t)=>{var n=r.map(e);return L4(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(u2):r.ticks?r.ticks(f).map((e,t)=>{var n=r.map(e);return L4(n)?{coordinate:n+m,value:e,index:t,offset:m}:null}).filter(u2):r.domain().map((e,t)=>{var n=r.map(e);return L4(n)?{coordinate:n+m,value:o?o[e]:e,index:t,offset:m}:null}).filter(u2)}}),dIt=$([o3,R5,m7,d7,_7,p7,M6],(e,t,n,r,i,a,o)=>
856{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=V4(e,o),{tickCount:c}=t,l=0;return l=o===`angleAxis`&&r?.length>=2?e2(r[0]-r[1])*2*l:l,s&&a?a.map((e,t)=>{var r=n.map(e);return L4(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(u2):n.ticks?n.ticks(c).map((e,t)=>{var r=n.map(e);return L4(r)?{coordinate:r+l,value:e,index:t,offset:l}:null}).filter(u2):n.domain().map((e,t)=>{var r=n.map(e);return L4(r)?{coordinate:r+l,value:i?i[e]:e,index:t,offset:l}:null}).filter(u2)}}),fIt=$(L5,m7,(e,t)=>{if(!(e==null||t==null))return M5(M5({},e),{},{scale:t})});$((e,t,n)=>I5(e,n),$([$([L5,s7,o7,KFt],j5)],B6),(e,t)=>{if(!(e==null||t==null))return M5(M5({},e),{},{scale:t})});var pIt=$([o3,G4,K4],(e,t,n)=>{switch(e){case`horizontal`:return t.some(e=>e.reversed)?`right-to-left`:`left-to-right`;case`vertical`:return n.some(e=>e.reversed)?`bottom-to-top`:`top-to-bottom`;case`centric`:case`radial`:return`left-to-right`;default:return}});$([(e,t,n)=>e.renderedTicks[t]?.[n]],e=>{if(!(!e||e.length===0))return t=>{var n=1/0,r=e[0];for(var i of e){var a=Math.abs(i.coordinate-t);a<n&&(n=a,r=i)}return r?.value}});var mIt=e=>e.options.defaultTooltipEventType,hIt=e=>e.options.validateTooltipEventTypes;function gIt(e,t,n){if(e==null)return t;var r=e?`axis`:`item`;return n==null?t:n.includes(r)?r:t}function v7(e,t){return gIt(t,mIt(e),hIt(e))}function _It(e){return S2(t=>v7(t,e))}var vIt=(e,t)=>
856{var n,r=Number(t);if(!(t2(r)||t==null))return r>=0?e==null||(n=e[r])==null?void 0:n.value:void 0},yIt=e=>e.tooltip.settings,y7={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},bIt=C4({name:`tooltip`,initialState:{itemInteraction:{click:y7,hover:y7},axisInteraction:{click:y7,hover:y7},keyboardInteraction:y7,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:`hover`,axisId:0,active:!1,defaultIndex:void 0}},reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(I3(t.payload))},prepare:S4()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=y4(e).tooltipItemPayloads.indexOf(I3(n));i>-1&&(e.tooltipItemPayloads[i]=I3(r))},prepare:S4()},removeTooltipEntrySettings:{reducer(e,t){var n=y4(e).tooltipItemPayloads.indexOf(I3(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:S4()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:xIt,replaceTooltipEntrySettings:SIt,removeTooltipEntrySettings:CIt,setTooltipSettingsState:wIt,setActiveMouseOverItemIndex:TIt,mouseLeaveItem:EIt,mouseLeaveChart:DIt,setActiveClickItemIndex:OIt,setMouseOverAxisIndex:kIt,setMouseClickAxisIndex:AIt,setSyncInteraction:b7,setKeyboardInteraction:x7}=bIt.actions,jIt=bIt.reducer;function MIt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?MIt(Object(n),!0).forEach(function(t){NIt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MIt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NIt(e,t,n){return(t=PIt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PIt(e){var t=FIt(e,`string`);return typeof t==`symbol`?t:t+``}function FIt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function IIt(e,t,n){return t===`axis`?n===`click`?e.axisInteraction.click:e.axisInteraction.hover:n===`click`?e.itemInteraction.click:e.itemInteraction.hover}function LIt(e){return e.index!=null}var RIt=(e,t,n,r)=>{if(t==null)return y7;var i=IIt(e,t,n);if(i==null)return y7;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;
856if(LIt(i)){if(a)return S7(S7({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return S7(S7({},y7),{},{coordinate:i.coordinate})};function zIt(e){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function BIt(e,t){var n=zIt(e),r=t[0],i=t[1];return n===void 0?!1:n>=Math.min(r,i)&&n<=Math.max(r,i)}function VIt(e,t,n){if(n==null||t==null)return!0;var r=B4(e,t);return r==null||!h6(n)?!0:BIt(r,n)}var C7=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!L4(a))return i;var o=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(o,Math.min(a,s)),l=t[c];return l==null||VIt(l,n,r)?String(c):null},HIt=(e,t,n,r,i,a,o)=>{if(a!=null){var s=o[0]?.getPosition(a);if(s!=null)return s;var c=i?.[Number(a)];if(c)switch(n){case`horizontal`:return{x:c.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:c.coordinate}}}},UIt=(e,t,n,r)=>{if(t===`axis`)return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i=n===`hover`?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId;if(e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&r!=null){var a=e.tooltipItemPayloads[0];return a==null?[]:[a]}return e.tooltipItemPayloads.filter(e=>e.settings?.graphicalItemId===i)},WIt=e=>e.options.tooltipPayloadSearcher,w7=e=>e.tooltip;function GIt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function KIt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?GIt(Object(n),!0).forEach(function(t){qIt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GIt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qIt(e,t,n){return(t=JIt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JIt(e){var t=YIt(e,`string`);return typeof t==`symbol`?t:t+``}function YIt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function XIt(e){if(typeof e==`string`||typeof e==`number`)return e}function ZIt(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e}function QIt(e){if(typeof e==`string`||typeof e==`number`)return e;if(typeof e==`function`)return t=>e(t)}function $It(e){if(typeof e==`string`)return e}function eLt(e){if(!(typeof e!=`object`||!e))return{name:`name`in e?XIt(e.name):void 0,unit:`unit`in e?ZIt(e.unit):void 0,dataKey:`dataKey`in e?QIt(e.dataKey):void 0,payload:`payload`in e?e.payload:void 0,color:`color`in e?$It(e.color):void 0,fill:`fill`in e?$It(e.fill):void 0}}function tLt(e,t){return e??t}var nLt=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:s,computedData:c,dataStartIndex:l,dataEndIndex:u}=n;return e.reduce((e,n)=>{var{dataDefinedOnItem:d,settings:f}=n,p=tLt(d,s),m=Array.isArray(p)?_Tt(p,l,u):p,h=f?.dataKey??r,g=f?.nameKey,_=r&&Array.isArray(m)&&!Array.isArray(m[0])&&o===`axis`?Jxt(m,r,i):a(m,t,c,g);return Array.isArray(_)?_.forEach(t=>{var n=eLt(t),r=n?.name,i=n?.dataKey,a=n?.payload,o=KIt(KIt({},f),{},{name:r,unit:n?.unit,color:n?.color??f?.color,fill:n?.fill??f?.fill});e.push(BTt({tooltipEntrySettings:o,dataKey:i,payload:a,value:B4(a,i),name:r==null?void 0:String(r)}))}):e.push(BTt({tooltipEntrySettings:f,dataKey:h,payload:_,value:B4(_,h),name:B4(_,g)??f?.name})),e},[])}},T7=$([Y5,eFt,y6],zPt),E7=$([$([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Y5,$([R6,z6],z5)],B5,{memoizeOptions:{resultEqualityCheck:L6}}),rLt=$([E7],e=>e.filter(F6)),D7=$([$([E7],H5,{memoizeOptions:{resultEqualityCheck:L6}}),f6],U5),iLt=$([rLt,f6,Y5],VAt),O7=$([D7,Y5,E7],G5),aLt=$([Y5],Z5),oLt=$([aLt,$([Y5],e=>e.allowDataOverflow)],fAt),sLt=$([$([iLt,$([E7],e=>e.filter(F6)),v6,OAt],pFt),f6,R6,oLt],hFt),cLt=$([D7,Y5,$([E7],iFt),e7,R6],n7,{memoizeOptions:{resultEqualityCheck:I6}}),lLt=$([$([SFt,R6,z6],r7),R6],OFt),uLt=$([$([wFt,R6,z6],r7),R6],AFt),k7=$([Y5,o3,D7,O7,v6,R6,$([Y5,aLt,oLt,
856sLt,cLt,$([lLt,$([$([EFt,R6,z6],r7),R6],PFt),uLt],t7),o3,R6],i7)],a7),dLt=$([Y5,k7,$([k7,Y5,T7],c7),R6],u7),fLt=e=>d7(e,R6(e),z6(e),!1),pLt=$([Y5,fLt],T6),mLt=$([$([Y5,T7,dLt,pLt],j5)],B6),A7=$([o3,Y5,T7,mLt,fLt,$([o3,O7,Y5,R6],cIt),$([o3,O7,Y5,R6],qFt),R6],(e,t,n,r,i,a,o,s)=>{if(t){var{type:c}=t,l=V4(e,s);if(r){var u=n===`scaleBand`&&r.bandwidth?r.bandwidth()/2:2,d=c===`category`&&r.bandwidth?r.bandwidth()/u:0;return d=s===`angleAxis`&&i!=null&&i?.length>=2?e2(i[0]-i[1])*2*d:d,l&&o?o.map((e,t)=>{var n=r.map(e);return L4(n)?{coordinate:n+d,value:e,index:t,offset:d}:null}).filter(u2):r.domain().map((e,t)=>{var n=r.map(e);return L4(n)?{coordinate:n+d,value:a?a[e]:e,index:t,offset:d}:null}).filter(u2)}}}),j7=$([mIt,hIt,yIt],(e,t,n)=>gIt(n.shared,e,t)),hLt=e=>e.tooltip.settings.trigger,M7=e=>e.tooltip.settings.defaultIndex,N7=$([w7,j7,hLt,M7],RIt),P7=$([N7,D7,X5,k7],C7),gLt=$([A7,P7],vIt),F7=$([N7],e=>{if(e)return e.dataKey}),_Lt=$([N7],e=>{if(e)return e.graphicalItemId}),vLt=$([w7,j7,hLt,M7],UIt),yLt=$([N7,$([U4,W4,o3,J4,A7,M7,vLt],HIt)],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),bLt=$([N7],e=>e?.active??!1),xLt=$([$([vLt,P7,f6,X5,gLt,WIt,j7],nLt)],e=>{if(e!=null){var t=e.map(e=>e.payload).filter(e=>e!=null);return Array.from(new Set(t))}});function SLt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CLt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?SLt(Object(n),!0).forEach(function(t){wLt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SLt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wLt(e,t,n){return(t=TLt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TLt(e){var t=ELt(e,`string`);return typeof t==`symbol`?t:t+``}function ELt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var DLt=()=>S2(Y5),OLt=()=>{var e=DLt(),t=S2(A7),n=S2(mLt);return zTt(!e||!n?void 0:CLt(CLt({},e),{},{scale:n}),t)};function kLt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function I7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kLt(Object(n),!0).forEach(function(t){ALt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kLt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ALt(e,t,n){return(t=jLt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jLt(e){var t=MLt(e,`string`);return typeof t==`symbol`?t:t+``}function MLt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var NLt=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.relativeY};if(e===`vertical`)return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},PLt=(e,t,n,r)=>{var i=t.find(e=>e&&e.index===n);if(i){if(e===`centric`){var a=i.coordinate,{radius:o}=r;return I7(I7(I7({},r),c6(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,{angle:c}=r;return I7(I7(I7({},r),c6(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function FLt(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>
856=t.top&&r<=t.top+t.height}var ILt=(e,t,n,r,i)=>{var a=t?.length??0;if(a<=1||e==null)return 0;if(r===`angleAxis`&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var o=0;o<a;o++){var s=o>0?n[o-1]?.coordinate:n[a-1]?.coordinate,c=n[o]?.coordinate,l=o>=a-1?n[0]?.coordinate:n[o+1]?.coordinate,u=void 0;if(!(s==null||c==null||l==null))if(e2(c-s)!==e2(l-c)){var d=[];if(e2(l-c)===e2(i[1]-i[0])){u=l;var f=c+i[1]-i[0];d[0]=Math.min(f,(f+s)/2),d[1]=Math.max(f,(f+s)/2)}else{u=s;var p=l+i[1]-i[0];d[0]=Math.min(c,(p+c)/2),d[1]=Math.max(c,(p+c)/2)}var m=[Math.min(c,(u+c)/2),Math.max(c,(u+c)/2)];if(e>m[0]&&e<=m[1]||e>=d[0]&&e<=d[1])return n[o]?.index}else{var h=Math.min(s,l),g=Math.max(s,l);if(e>(h+c)/2&&e<=(g+c)/2)return n[o]?.index}}else if(t)for(var _=0;_<a;_++){var v=t[_];if(v!=null){var y=t[_+1],b=t[_-1];if(_===0&&y!=null&&e<=(v.coordinate+y.coordinate)/2||_===a-1&&b!=null&&e>(v.coordinate+b.coordinate)/2||_>0&&_<a-1&&b!=null&&y!=null&&e>(v.coordinate+b.coordinate)/2&&e<=(v.coordinate+y.coordinate)/2)return v.index}}return-1},LLt=u(w2()),RLt=()=>S2(y6),L7=(e,t)=>t,zLt=(e,t,n)=>n,R7=(e,t,n,r)=>r,BLt=$(A7,e=>(0,LLt.default)(e,e=>e.coordinate)),z7=$([w7,L7,zLt,R7],RIt),B7=$([z7,D7,X5,k7],C7),VLt=(e,t,n)=>{if(t!=null){var r=w7(e);return t===`axis`?n===`hover`?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n===`hover`?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},HLt=$([w7,L7,zLt,R7],UIt),V7=$([U4,W4,o3,J4,A7,R7,HLt],HIt),ULt=$([z7,V7],(e,t)=>e.coordinate??t),WLt=$([A7,B7],vIt),GLt=$([HLt,B7,f6,X5,WLt,WIt,L7],nLt),KLt=$([z7,B7],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),qLt=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&FLt(e,o)){var s=ILt(VTt(e,t),a,i,n,r),c=NLt(t,i,s,e);return{activeIndex:String(s),activeCoordinate:c}}},JLt=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var s=Gkt(e,n);if(s){var c=ILt(HTt(s,t),o,a,r,i),l=PLt(t,a,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},YLt=(e,t,n,r,i,a,o,s)=>{if(!(!e||!t||!r||!i||!a))return t===`horizontal`||t===`vertical`?qLt(e,t,r,i,a,o,s):JLt(e,t,n,r,i,a,o)},XLt=$(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),ZLt=$(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(S6));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:HAt}});function QLt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $Lt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?QLt(Object(n),!0).forEach(function(t){eRt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QLt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eRt(e,t,n){return(t=tRt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tRt(e){var t=nRt(e,`string`);return typeof t==`symbol`?t:t+``}function nRt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rRt={zIndexMap:Object.values(S6).reduce((e,t)=>$Lt($Lt({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},iRt=new Set(Object.values(S6));function aRt(e){return iRt.has(e)}var oRt=C4({name:`zIndex`,initialState:rRt,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:S4()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(--e.zIndexMap[n].consumers,e.zIndexMap[n].consumers<=0&&!aRt(n)&&delete e.zIndexMap[n])},prepare:S4()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=I3(r):e.zIndexMap[n].element=I3(r):e.zIndexMap[n]={consumers:0,element:i?void 0:I3(r),panoramaElement:i?I3(r):void 0}},prepare:S4()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:S4()}}}),{registerZIndexPortal:sRt,unregisterZIndexPortal:cRt,registerZIndexPortalElement:lRt,unregisterZIndexPortalElement:uRt}=oRt.actions,dRt=oRt.reducer,fRt=v();function H7(e){var{zIndex:t,children:n}=e,r=NEt()&&t!==void 0&&t!==0,i=Y4(),a=b2();(0,B.useLayoutEffect)(()=>r?(a(sRt({zIndex:t})),()=>{a(cRt({zIndex:t}))}):d2,[a,t,r]);var o=S2(e=>XLt(e,t,i));return r?o?(0,fRt.createPortal)(n,o):null:n}function U7(){return U7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U7.apply(null,arguments)}function pRt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function W7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
856t%2?pRt(Object(n),!0).forEach(function(t){mRt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pRt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mRt(e,t,n){return(t=hRt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hRt(e){var t=gRt(e,`string`);return typeof t==`symbol`?t:t+``}function gRt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function _Rt(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return(0,B.isValidElement)(t)?(0,B.cloneElement)(t,r):(0,B.createElement)(n,r)}function vRt(e){var{coordinate:t,payload:n,index:r,offset:i,tooltipAxisBandSize:a,layout:o,cursor:s,tooltipEventType:c,chartName:l}=e,u=t,d=n,f=r;if(!s||!u||l!==`ScatterChart`&&c!==`axis`)return null;var p,m,h;if(l===`ScatterChart`)p=u,m=jOt,h=S6.cursorLine;else if(l===`BarChart`)p=MOt(o,u,i,a),m=Nkt,h=S6.cursorRectangle;else if(o===`radial`&&cSt(u)){var{cx:g,cy:_,radius:v,startAngle:y,endAngle:b}=Kkt(u);p={cx:g,cy:_,startAngle:y,endAngle:b,innerRadius:v,outerRadius:v},m=iAt,h=S6.cursorLine}else p={points:aAt(o,u,i)},m=X3,h=S6.cursorLine;var x=typeof s==`object`&&`className`in s?s.className:void 0,S=W7(W7(W7(W7({stroke:`#ccc`,pointerEvents:`none`},i),p),_0(s)),{},{payload:d,payloadIndex:f,className:iy(`recharts-tooltip-cursor`,x)});return B.createElement(H7,{zIndex:e.zIndex??h},B.createElement(_Rt,{cursor:s,cursorComp:m,cursorProps:S}))}function yRt(e){var t=OLt(),n=kEt(),r=s3(),i=RLt();return t==null||n==null||r==null||i==null?null:B.createElement(vRt,U7({}
856,e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var bRt=(0,B.createContext)(null),xRt=()=>(0,B.useContext)(bRt),SRt=u(s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default,G7=new SRt,K7=`recharts.syncEvent.tooltip`,CRt=`recharts.syncEvent.brush`,wRt=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!t2(n))return e[n]}},TRt=C4({name:`options`,initialState:{chartName:``,tooltipPayloadSearcher:()=>void 0,eventEmitter:void 0,defaultTooltipEventType:`axis`},reducers:{createEventEmitter:e=>{e.eventEmitter??=Symbol(`rechartsEventEmitter`)}}}),ERt=TRt.reducer,{createEventEmitter:DRt}=TRt.actions;function ORt(e){return e.tooltip.syncInteraction}var kRt=C4({name:`chartData`,initialState:{chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},reducers:{setChartData(e,t){if(e.chartData=I3(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:ARt,setDataStartEndIndexes:jRt,setComputedData:MRt}=kRt.actions,NRt=kRt.reducer,PRt=[`x`,`y`];function FRt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
856t%2?FRt(Object(n),!0).forEach(function(t){IRt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FRt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function IRt(e,t,n){return(t=LRt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LRt(e){var t=RRt(e,`string`);return typeof t==`symbol`?t:t+``}function RRt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function zRt(e,t){if(e==null)return{};var n,r,i=BRt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function BRt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function VRt(){var e=S2(b6),t=S2(x6),n=b2(),r=S2(kAt),i=S2(A7),a=s3(),o=r3();(0,B.useEffect)(()=>{if(e==null)return d2;var s=(s,c,l)=>{if(t!==l&&e===s){if(r===`index`){var u;if(o&&c!=null&&(u=c.payload)!=null&&u.coordinate&&c.payload.sourceViewBox){var d=c.payload.coordinate,{x:f,y:p}=d,m=zRt(d,PRt),{x:h,y:g,width:_,height:v}=c.payload.sourceViewBox,y=q7(q7({},m),{},{x:o.x+(_?(f-h)/_:0)*o.width,y:o.y+(v?(p-g)/v:0)*o.height});n(q7(q7({},c),{},{payload:q7(q7({},c.payload),{},{coordinate:y})}))}else n(c);return}if(i!=null){var b;typeof r==`function`?b=i[r(i,{activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate})]:r===`value`&&(b=i.find(e=>String(e.value)===c.payload.label));var{coordinate:x}=c.payload;if(b==null||c.payload.active===!1||x==null||o==null){n(b7({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:S,y:C}=x,w=Math.min(S,o.x+o.width),T=Math.min(C,o.y+o.height),E={x:a===`horizontal`?b.coordinate:w,y:a===`horizontal`?T:b.coordinate};n(b7({active:c.payload.active,coordinate:E,dataKey:c.payload.dataKey,index:String(b.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId}))}}};return G7.on(K7,s),()=>{G7.off(K7,s)}},[S2(e=>e.rootProps.className),n,t,e,r,i,a,o])}function HRt(){var e=S2(b6),t=S2(x6),n=b2();(0,B.useEffect)(()=>{if(e==null)return d2;var r=(r,i,a)=>{t!==a&&e===r&&n(jRt(i))};return G7.on(CRt,r),()=>{G7.off(CRt,r)}},[n,t,e])}function URt(){var e=b2();(0,B.useEffect)(()=>{e(DRt())},[e]),VRt(),HRt()}function WRt(e,t,n,r,i,a){var o=S2(n=>VLt(n,e,t)),s=S2(_Lt),c=S2(x6),l=S2(b6),u=S2(kAt),d=S2(ORt)?.active,f=r3();(0,B.useEffect)(()=>{if(!d&&l!=null&&c!=null){var e=b7({active:a,coordinate:n,dataKey:o,index:i,label:typeof r==`number`?String(r):r,sourceViewBox:f,graphicalItemId:s});G7.emit(K7,l,e,c)}},[d,n,o,s,i,r,c,l,u,a,f])}var GRt=v();function KRt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qRt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?KRt(Object(n),!0).forEach(function(t){JRt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KRt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JRt(e,t,n){return(t=YRt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YRt(e){var t=XRt(e,`string`);return typeof t==`symbol`?t:t+``}function XRt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ZRt(e){return e.dataKey}function QRt(e,t){return B.isValidElement(e)?B.cloneElement(e,t):typeof e==`function`?B.createElement(e,t):B.createElement(ZDt,t)}var $Rt=[],ezt={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:`auto`,itemSorter:`name`,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:` : `,trigger:`hover`,useTranslate3d:!1,wrapperStyle:{}};function tzt(e){var t=h2(e,ezt),{active:n,allowEscapeViewBox:r,animationDuration:i,animationEasing:a,content:o,filterNull:s,isAnimationActive:c,offset:l,payloadUniqBy:u,position:d,reverseDirection:f,useTranslate3d:p,wrapperStyle:m,curs
856or:h,shared:g,trigger:_,defaultIndex:v,portal:y,axisId:b}=t,x=b2(),S=typeof v==`number`?String(v):v;(0,B.useEffect)(()=>{x(wIt({shared:g,trigger:_,axisId:b,active:n,defaultIndex:S}))},[x,g,_,b,n,S]);var C=r3(),w=dOt(),T=_It(g),{activeIndex:E,isActive:D}=S2(e=>KLt(e,T,_,S))??{},O=S2(e=>GLt(e,T,_,S)),k=S2(e=>WLt(e,T,_,S)),A=S2(e=>ULt(e,T,_,S)),j=O,M=xRt(),N=n??D??!1,[P,F]=ACt([j,N]),I=T===`axis`?k:void 0;WRt(T,_,A,I,E,N);var L=y??M;if(L==null||C==null||T==null)return null;var ee=j??$Rt;N||(ee=$Rt),s&&ee.length&&(ee=eCt(ee.filter(e=>e.value!=null&&(e.hide!==!0||t.includeHidden)),u,ZRt));var R=ee.length>0,te=qRt(qRt({},t),{},{payload:ee,label:I,active:N,activeIndex:E,coordinate:A,accessibilityLayer:w}),ne=B.createElement(uOt,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:c,active:N,coordinate:A,hasPayload:R,offset:l,position:d,reverseDirection:f,useTranslate3d:p,viewBox:C,wrapperStyle:m,lastBoundingBox:P,innerRef:F,hasPortalFromProps:!!y},QRt(o,te));return B.createElement(B.Fragment,null,(0,GRt.createPortal)(ne,L),N&&B.createElement(yRt,{cursor:h,tooltipEventType:T,coordinate:A,payload:ee,index:E}))}var J7=e=>null;J7.displayName=`Cell`;function nzt(e,t,n){return(t=rzt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rzt(e){var t=izt(e,`string`);return typeof t==`symbol`?t:t+``}function izt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var azt=class{constructor(e){nzt(this,`cache`,new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}};function ozt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function szt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ozt(Object(n),!0).forEach(function(t){czt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ozt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function czt(e,t,n){return(t=lzt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lzt(e){var t=uzt(e,`string`);return typeof t==`symbol`?t:t+``}function uzt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var dzt=szt({},{cacheSize:2e3,enableCache:!0}),fzt=new azt(dzt.cacheSize),pzt={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},mzt=`recharts_measurement_span`;function hzt(e,t){return`${e}|${t.fontSize||``}|${t.fontFamily||``}|${t.fontWeight||``}|${t.fontStyle||``}|${t.letterSpacing||``}|${t.textTransform||``}`}var gzt=(e,t)=>{try{var n=document.getElementById(mzt);n||(n=document.createElement(`span`),n.setAttribute(`id`,mzt),n.setAttribute(`aria-hidden`,`true`),document.body.appendChild(n)),Object.assign(n.style,pzt,t),n.textContent=`${e}`;var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Y7=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||W3.isSsr)return{width:0,height:0};if(!dzt.enableCache)return gzt(e,t);var n=hzt(e,t),r=fzt.get(n);if(r)return r;var i=gzt(e,t);return fzt.set(n,i),i},_zt;function vzt(e,t,n){return(t=yzt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yzt(e){var t=bzt(e,`string`);return typeof t==`symbol`?t:t+``}function bzt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var xzt=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Szt=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Czt=/^(p
856x|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,wzt=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Tzt={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Ezt=[`cm`,`mm`,`pt`,`pc`,`in`,`Q`,`px`];function Dzt(e){return Ezt.includes(e)}var X7=`NaN`;function Ozt(e,t){return e*Tzt[t]}var Z7=class e{static parse(t){var[,n,r]=wzt.exec(t)??[];return n==null?e.NaN:new e(parseFloat(n),r??``)}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,t2(e)&&(this.unit=``),t!==``&&!Czt.test(t)&&(this.num=NaN,this.unit=``),Dzt(t)&&(this.num=Ozt(e,t),this.unit=`px`)}add(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}subtract(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}multiply(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}toString(){return`${this.num}${this.unit}`}isNaN(){return t2(this.num)}};_zt=Z7,vzt(Z7,`NaN`,new _zt(NaN,``));function kzt(e){if(e==null||e.includes(X7))return X7;for(var t=e;t.includes(`*`)||t.includes(`/`);){var[,n,r,i]=xzt.exec(t)??[],a=Z7.parse(n??``),o=Z7.parse(i??``),s=r===`*`?a.multiply(o):a.divide(o);if(s.isNaN())return X7;
856t=t.replace(xzt,s.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var[,c,l,u]=Szt.exec(t)??[],d=Z7.parse(c??``),f=Z7.parse(u??``),p=l===`+`?d.add(f):d.subtract(f);if(p.isNaN())return X7;t=t.replace(Szt,p.toString())}return t}var Azt=/\(([^()]*)\)/;function jzt(e){for(var t=e,n;(n=Azt.exec(t))!=null;){var[,r]=n;t=t.replace(Azt,kzt(r))}return t}function Mzt(e){var t=e.replace(/\s+/g,``);return t=jzt(t),t=kzt(t),t}function Nzt(e){try{return Mzt(e)}catch{return X7}}function Q7(e){var t=Nzt(e.slice(5,-1));return t===X7?``:t}var Pzt=[`x`,`y`,`lineHeight`,`capHeight`,`fill`,`scaleToFit`,`textAnchor`,`verticalAnchor`],Fzt=[`dx`,`dy`,`angle`,`className`,`breakAll`];function $7(){return $7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$7.apply(null,arguments)}function Izt(e,t){if(e==null)return{};var n,r,i=Lzt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lzt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Rzt=/[ \f\n\r\t\v\u2028\u2029]+/,zzt=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];return c2(t)||(i=n?t.toString().split(``):t.toString().split(Rzt)),{wordsWithComputedWidth:i.map(e=>({word:e,width:Y7(e,r).width})),spaceWidth:n?0:Y7(`\xA0`,r).width}}catch{return null}};function Bzt(e){return e===`start`||e===`middle`||e===`end`||e===`inherit`}function Vzt(e){return c2(e)||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}var Hzt=(e,t,n,r)=>e.reduce((e,i)=>{var{word:a,width:o}=i,s=e[e.length-1];if(s&&o!=null&&(t==null||r||s.width+o+n<Number(t)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[]),Uzt=e=>e.reduce((e,t)=>e.width>t.width?e:t),Wzt=`â¦`,Gzt=(e,t,n,r,i,a,o,s)=>{var c=zzt({breakAll:n,style:r,children:e.slice(0,t)+Wzt});if(!c)return[!1,[]];var l=Hzt(c.wordsWithComputedWidth,a,o,s);return[l.length>i||Uzt(l).width>Number(a),l]},Kzt=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:s,breakAll:c}=e,l=r2(a),u=String(o),d=Hzt(t,r,n,i);if(!l||i||!(d.length>a||Uzt(d).width>Number(r)))return d;for(var f=0,p=u.length-1,m=0,h;f<=p&&m<=u.length-1;){var g=Math.floor((f+p)/2),[_,v]=Gzt(u,g-1,c,s,a,r,n,i),[y]=Gzt(u,g,c,s,a,r,n,i);if(!_&&!y&&(f=g+1),_&&y&&(p=g-1),!_&&y){h=v;break}m++}return h||d},qzt=e=>[{words:c2(e)?[]:e.toString().split(Rzt),width:void 0}],Jzt=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!W3.isSsr){var s,c,l=zzt({breakAll:a,children:r,style:i});if(l){var{wordsWithComputedWidth:u,spaceWidth:d}=l;s=u,c=d}else return qzt(r);return Kzt({breakAll:a,children:r,maxLines:o,style:i},s,c,t,!!n)}return qzt(r)},Yzt=`#808080`,Xzt={angle:0,breakAll:!1,capHeight:`0.71em`,fill:Yzt,lineHeight:`1em`,scaleToFit:!1,textAnchor:`start`,verticalAnchor:`end`,x:0,y:0},e9=(0,B.forwardRef)((e,t)=>{var n=h2(e,Xzt),{x:r,y:i,lineHeight:a,capHeight:o,fill:s,scaleToFit:c,textAnchor:l,verticalAnchor:u}=n,d=Izt(n,Pzt),f=(0,B.useMemo)(()=>Jzt({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),{dx:p,dy:m,angle:h,className:g,breakAll:_}=d,v=Izt(d,Fzt);if(!i2(r)||!i2(i)||f.length===0)return null;var y=Number(r)+(r2(p)?p:0),b=Number(i)+(r2(m)?m:0);if(!L4(y)||!L4(b))return null;var x;switch(u){case`start`:x=Q7(`calc(${o})`);break;case`middle`:x=Q7(`calc(${(f.length-1)/2} * -${a} + (${o} / 2))`);break;default:x=Q7(`calc(${f.length-1} * -${a})`);break}var S=[],C=f[0];if(c&&C!=null){var w=C.width,{width:T}=d;S.push(`scale(${r2(T)&&r2(w)?T/w:1})`)}return h&&S.push(`rotate(${h}, ${y}, ${b})`),S.length&&(v.transform=S.join(` `)),B.createElement(`text`,$7({},v0(v),{ref:t,x:y,y:b,className:iy(`recharts-text`,g),textAnchor:l,fill:s.includes(`url`)?Yzt:s}),f.map((e,t)=>{var n=e.words.join(_?``:` `);return B.createElement(`tspan`,{x:y,dy:t===0?x:a,key:`${n}-${t}`},n)}))});e9.displayName=`Text`;function Zzt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
856t%2?Zzt(Object(n),!0).forEach(function(t){Qzt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zzt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Qzt(e,t,n){return(t=$zt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $zt(e){var t=eBt(e,`string`);return typeof t==`symbol`?t:t+``}function eBt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var tBt=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i,clamp:a}=e,{x:o,y:s,height:c,upperWidth:l,lowerWidth:u}=n3(t),d=o,f=o+(l-u)/2,p=(d+f)/2,m=(l+u)/2,h=d+l/2,g=c>=0?1:-1,_=g*r,v=g>0?`end`:`start`,y=g>0?`start`:`end`,b=l>=0?1:-1,x=b*r,S=b>0?`end`:`start`,C=b>0?`start`:`end`,w=i;if(n===`top`){var T={x:d+l/2,y:s-_,horizontalAnchor:`middle`,verticalAnchor:v};return a&&w&&(T.height=Math.max(s-w.y,0),T.width=l),T}if(n===`bottom`){var E={x:f+u/2,y:s+c+_,horizontalAnchor:`middle`,verticalAnchor:y};return a&&w&&(E.height=Math.max(w.y+w.height-(s+c),0),E.width=u),E}if(n===`left`){var D={x:p-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`};return a&&w&&(D.width=Math.max(D.x-w.x,0),D.height=c),D}if(n===`right`){var O={x:p+m+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`};return a&&w&&(O.width=Math.max(w.x+w.width-O.x,0),O.height=c),O}var k=a&&w?{width:m,height:c}:{};return n===`insideLeft`?t9({x:p+x,y:s+c/2,horizontalAnchor:C,verticalAnchor:`middle`},k):n===`insideRight`?t9({x:p+m-x,y:s+c/2,horizontalAnchor:S,verticalAnchor:`middle`},k):n===`insideTop`?t9({x:d+l/2,y:s+_,horizontalAnchor:`middle`,verticalAnchor:y},k):n===`insideBottom`?t9({x:f+u/2,y:s+c-_,horizontalAnchor:`middle`,verticalAnchor:v},k):n===`insideTopLeft`?t9({x:d+x,y:s+_,horizontalAnchor:C,verticalAnchor:y},k):n===`insideTopRight`?t9({x:d+l-x,y:s+_,horizontalAnchor:S,verticalAnchor:y},k):n===`insideBottomLeft`?t9({x:f+x,y:s+c-_,horizontalAnchor:C,verticalAnchor:v},k):n===`insideBottomRight`?t9({x:f+u-x,y:s+c-_,horizontalAnchor:S,verticalAnchor:v},k):n&&typeof n==`object`&&(r2(n.x)||n2(n.x))&&(r2(n.y)||n2(n.y))?t9({x:o+o2(n.x,m),y:s+o2(n.y,c),horizontalAnchor:`end`,verticalAnchor:`end`},k):t9({x:h,y:s+c/2,horizontalAnchor:`middle`,verticalAnchor:`middle`},k)},nBt=[`labelRef`],rBt=[`content`];function iBt(e,t){if(e==null)return{};var n,r,i=aBt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function aBt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function oBt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oBt(Object(n),!0).forEach(function(t){sBt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oBt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sBt(e,t,n){return(t=cBt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cBt(e){var t=lBt(e,`string`);return typeof t==`symbol`?t:t+``}function lBt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function r9(){return r9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}
856,r9.apply(null,arguments)}var uBt=(0,B.createContext)(null),dBt=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:s}=e,c=(0,B.useMemo)(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return B.createElement(uBt.Provider,{value:c},s)},fBt=()=>{var e=(0,B.useContext)(uBt),t=r3();return e||(t?n3(t):void 0)},pBt=(0,B.createContext)(null),mBt=()=>{var e=(0,B.useContext)(pBt),t=S2(BAt);return e||t},hBt=e=>{var{value:t,formatter:n}=e,r=c2(e.children)?t:e.children;return typeof n==`function`?n(r):r},i9=e=>e!=null&&typeof e==`function`,gBt=(e,t)=>e2(t-e)*Math.min(Math.abs(t-e),360),_Bt=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:s,cy:c,innerRadius:l,outerRadius:u,startAngle:d,endAngle:f,clockWise:p}=i,m=(l+u)/2,h=gBt(d,f),g=h>=0?1:-1,_,v;switch(t){case`insideStart`:_=d+g*a,v=p;break;case`insideEnd`:_=f-g*a,v=!p;break;case`end`:_=f+g*a,v=p;break;default:throw Error(`Unsupported position ${t}`)}v=h<=0?v:!v;var y=c6(s,c,m,_),b=c6(s,c,m,_+(v?1:-1)*359),x=`M${y.x},${y.y} 857 A${m},${m},0,1,${v?0:1}, 858 ${b.x},${b.y}`,S=c2(e.id)?a2(`recharts-radial-line-`):e.id;return B.createElement(`text`,r9({},r,{dominantBaseline:`central`,className:iy(`recharts-radial-bar-label`,o)}),B.createElement(`defs`,null,B.createElement(`path`,{id:S,d:x})),B.createElement(`textPath`,{xlinkHref:`#${S}`},n))},vBt=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:s,endAngle:c}=e,l=(s+c)/2;if(n===`outside`){var{x:u,y:d}=c6(r,i,o+t,l);return{x:u,y:d,textAnchor:u>=r?`start`:`end`,verticalAnchor:`middle`}}if(n===`center`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`middle`};if(n===`centerTop`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`start`};if(n===`centerBottom`)return{x:r,y:i,textAnchor:`middle`,verticalAnchor:`end`};var{x:f,y:p}=c6(r,i,(a+o)/2,l);return{x:f,y:p,textAnchor:`middle`,verticalAnchor:`middle`}},a9=e=>e!=null&&`cx`in e&&r2(e.cx),yBt={angle:0,offset:5,zIndex:S6.label,position:`middle`,textBreakAll:!1};function bBt(e){if(!a9(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function o9(e){var t=h2(e,yBt),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:s,className:c=``,textBreakAll:l,labelRef:u}=t,d=mBt(),f=fBt(),p=n==null?i===`center`?f:d??f:a9(n)?n:n3(n),m,h,g=bBt(p);if(!p||c2(a)&&c2(o)&&!(0,B.isValidElement)(s)&&typeof s!=`function`)return null;var _=n9(n9({},t),{},{viewBox:p});if((0,B.isValidElement)(s)){var{labelRef:v}=_;return(0,B.cloneElement)(s,iBt(_,nBt))}if(typeof s==`function`){var{content:y}=_;if(m=(0,B.createElement)(s,iBt(_,rBt)),(0,B.isValidElement)(m))return m}else m=hBt(t);var b=v0(t);if(a9(p)){if(i===`insideStart`||i===`insideEnd`||i===`end`)return _Bt(t,i,m,b,p);h=vBt(p,t.offset,t.position)}else{if(!g)return null;var x=tBt({viewBox:g,position:i,offset:t.offset,parentViewBox:a9(r)?void 0:r,clamp:!0});h=n9(n9({x:x.x,y:x.y,textAnchor:x.horizontalAnchor,verticalAnchor:x.verticalAnchor},x.width===void 0?{}:{width:x.width}),x.height===void 0?{}:{height:x.height})}return B.createElement(H7,{zIndex:t.zIndex},B.createElement(e9,r9({ref:u,className:iy(`recharts-label`,c)},b,h,{textAnchor:Bzt(b.textAnchor)?b.textAnchor:h.textAnchor,breakAll:l}),m))}o9.displayName=`Label`;var xBt=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?B.createElement(o9,r9({key:`label-implicit`},r)):i2(e)?B.createElement(o9,r9({key:`label-implicit`,value:e},r)):(0,B.isValidElement)(e)?e.type===o9?(0,B.cloneElement)(e,n9({key:`label-implicit`},r)):B.createElement(o9,r9({key:`label-implicit`,content:e},r)):i9(e)?B.createElement(o9,r9({key:`label-implicit`,content:e},r)):e&&typeof e==`object`?B.createElement(o9,r9({},e,{key:`label-implicit`},r)):null};function SBt(e){var{label:t,labelRef:n}=e;return xBt(t,fBt(),n)||null}var CBt=[`valueAccessor`],wBt=[`dataKey`,`clockWise`,`id`,`textBreakAll`,`zIndex`];function s9(){return s9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s9.apply(null,arguments)}function TBt(e,t){if(e==null)return{};var n,r,i=EBt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function EBt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var DBt=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Vzt(t))return t},OBt=(0,B.createContext)(void 0),kBt=OBt.Provider,ABt=(0,B.createContext)(void 0),jBt=ABt.Provider;function MBt(){return(0,B.useContext)(OBt)}function NBt(){return(0,B.useContext)(ABt)}function c9(e){var{valueAccessor:t=DBt}=e,n=TBt(e,CBt),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:s}=n,c=TBt(n,wBt),l=MBt(),u=NBt(),d=l||u;
858return!d||!d.length?null:B.createElement(H7,{zIndex:s??S6.label},B.createElement(S0,{className:`recharts-label-list`},d.map((e,i)=>{var s=c2(r)?t(e,i):B4(e.payload,r),l=c2(a)?{}:{id:`${a}-${i}`};return B.createElement(o9,s9({key:`label-${i}`},v0(e),c,l,{fill:n.fill??e.fill,parentViewBox:e.parentViewBox,value:s,textBreakAll:o,viewBox:e.viewBox,index:i,zIndex:0}))})))}c9.displayName=`LabelList`;function PBt(e){var{label:t}=e;return t?t===!0?B.createElement(c9,{key:`labelList-implicit`}):B.isValidElement(t)||i9(t)?B.createElement(c9,{key:`labelList-implicit`,content:t}):typeof t==`object`?B.createElement(c9,s9({key:`labelList-implicit`},t,{type:String(t.type)})):null:null}var FBt=e=>e.graphicalItems.polarItems,l9=$([FBt,L5,$([M6,N6],z5)],B5),u9=$([$([l9],H5),p6],U5),IBt=$([u9,L5,l9],G5);$([u9,L5,l9],(e,t,n)=>n.length>0?e.flatMap(e=>n.flatMap(n=>({value:B4(e,t.dataKey??n.dataKey),errorDomain:[]}))).filter(Boolean):t?.dataKey==null?e.map(e=>({value:e,errorDomain:[]})):e.map(e=>({value:B4(e,t.dataKey),errorDomain:[]})));var LBt=()=>void 0,RBt=$([L5,o3,u9,IBt,v6,M6,$([L5,Q5,$5,LBt,$([u9,L5,l9,e7,M6],n7),LBt,o3,M6],i7)],a7);$([s7,$([L5,RBt,$([RBt,R5,s7],c7),M6],u7)],UAt);var zBt=C4({name:`polarAxis`,initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=I3(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=I3(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:BBt,removeRadiusAxis:VBt,addAngleAxis:HBt,removeAngleAxis:UBt}=zBt.actions,WBt=zBt.reducer;function GBt(e){return e&&typeof e==`object`&&`className`in e&&typeof e.className==`string`?e.className:``}function KBt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qBt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?KBt(Object(n),!0).forEach(function(t){JBt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KBt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JBt(e,t,n){return(t=YBt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YBt(e){var t=XBt(e,`string`);return typeof t==`symbol`?t:t+``}function XBt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var d9=$([FBt,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`pie`).find(e=>e.id===t)),ZBt=[],f9=(e,t,n)=>n?.length===0?ZBt:n,QBt=$([p6,d9,f9],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i=t?.data!=null&&t.data.length>0?t.data:r;if((!i||!i.length)&&n!=null&&(i=n.map(e=>qBt(qBt({},t.presentationProps),e.props))),i!=null)return i}}),$Bt=$([QBt,d9,f9],(e,t,n)=>{if(!(e==null||t==null))return e.map((e,r)=>{var i,a=B4(e,t.nameKey,t.name),o=n!=null&&(i=n[r])!=null&&(i=i.props)!=null&&i.fill?n[r].props.fill:typeof e==`object`&&e&&`fill`in e?e.fill:t.fill;return{value:H4(a,t.dataKey),color:o,payload:e,type:t.legendType}})}),eVt=$([QBt,d9,f9,J4],(e,t,n,r)=>{if(!(t==null||e==null))return THt({offset:r,pieSettings:t,displayedData:e,cells:n})}),tVt=s((e=>{var t=Symbol.for(`react.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.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.server_context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.suspense_list`),f=Symbol.for(`react.memo`),p=Symbol.for(`react.lazy`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case u:case d:return e;default:switch(e&&=e.$$typeof,e){case c:case s:case l:case p:case f:case o:return e;default:return m}}case n:return m}}}e.isFragment=function(e){return m(e)===r}})),nVt=s(((e,t)=>{t.exports=tVt()}
858)),rVt=u(Z0()),iVt=nVt(),aVt=e=>typeof e==`string`?e:e?e.displayName||e.name||`Component`:``,oVt=null,p9=null,sVt=e=>{if(e===oVt&&Array.isArray(p9))return p9;var t=[];return B.Children.forEach(e,e=>{c2(e)||((0,iVt.isFragment)(e)?t=t.concat(sVt(e.props.children)):t.push(e))}),p9=t,oVt=e,t};function m9(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(e=>aVt(e)):[aVt(t)],sVt(e).forEach(e=>{var t=(0,rVt.default)(e,`type.displayName`)||(0,rVt.default)(e,`type.name`);t&&r.indexOf(t)!==-1&&n.push(e)}),n}var cVt=e=>e&&typeof e==`object`&&`clipDot`in e?!!e.clipDot:!0,lVt=s((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}e.isPlainObject=t})),uVt=s(((e,t)=>{t.exports=lVt().isPlainObject})),dVt,fVt,pVt,mVt,hVt;function gVt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _Vt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gVt(Object(n),!0).forEach(function(t){vVt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gVt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vVt(e,t,n){return(t=yVt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yVt(e){var t=bVt(e,`string`);return typeof t==`symbol`?t:t+``}function bVt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function h9(){return h9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h9.apply(null,arguments)}function g9(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var xVt=(e,t,n,r,i)=>{var a=n-r,o=$0(dVt||=g9([`M `,`,`,``]),e,t);return o+=$0(fVt||=g9([`L `,`,`,``]),e+n,t),o+=$0(pVt||=g9([`L `,`,`,``]),e+n-a/2,t+i),o+=$0(mVt||=g9([`L `,`,`,``]),e+n-a/2-r,t+i),o+=$0(hVt||=g9([`L `,`,`,` Z`]),e,t),o},SVt={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},CVt=e=>{var t=h2(e,SVt),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:s}=t,{animationEasing:c,animationDuration:l,animationBegin:u,isUpdateAnimationActive:d}=t,f=(0,B.useRef)(null),[p,m]=(0,B.useState)(-1),h=(0,B.useRef)(i),g=(0,B.useRef)(a),_=(0,B.useRef)(o),v=(0,B.useRef)(n),y=(0,B.useRef)(r),b=i6(e,`trapezoid-`);if((0,B.useEffect)(()=>{if(f.current&&f.current.getTotalLength)try{var e=f.current.getTotalLength();e&&m(e)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var x=iy(`recharts-trapezoid`,s);if(!d)return B.createElement(`g`,null,B.createElement(`path`,h9({},v0(t),{className:x,d:xVt(n,r,i,a,o)})));var S=h.current,C=g.current,w=_.current,T=v.current,E=y.current,D=`0px ${p===-1?1:p}px`,O=`${p}px ${p}px`,k=zOt([`strokeDasharray`],l,c);return B.createElement(r6,{animationId:b,key:b,canBegin:p>0,duration:l,easing:c,isActive:d,begin:u},e=>{var s=s2(S,i,e),c=s2(C,a,e),l=s2(w,o,e),u=s2(T,n,e),d=s2(E,r,e);f.current&&(h.current=s,g.current=c,_.current=l,v.current=u,y.current=d);var p=e>0?{transition:k,strokeDasharray:O}:{strokeDasharray:D};return B.createElement(`path`,h9({},v0(t),{className:x,d:xVt(u,d,s,c,l),ref:f,style:_Vt(_Vt({},p),t.style)}
858))})},wVt=u(uVt()),TVt=[`option`,`shapeType`,`activeClassName`,`inActiveClassName`];function EVt(e,t){if(e==null)return{};var n,r,i=DVt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DVt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function OVt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?OVt(Object(n),!0).forEach(function(t){kVt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OVt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kVt(e,t,n){return(t=AVt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AVt(e){var t=jVt(e,`string`);return typeof t==`symbol`?t:t+``}function jVt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function MVt(e,t){return _9(_9({},t),e)}function NVt(e,t){return e===`symbols`}function PVt(e){var{shapeType:t,elementProps:n}=e;switch(t){case`rectangle`:return B.createElement(Nkt,n);case`trapezoid`:return B.createElement(CVt,n);case`sector`:return B.createElement(iAt,n);case`symbols`:if(NVt(t,n))return B.createElement(p2,n);break;case`curve`:return B.createElement(X3,n);default:return null}}function FVt(e){return(0,B.isValidElement)(e)?e.props:e}function IVt(e){var{option:t,shapeType:n,activeClassName:r=`recharts-active-shape`,inActiveClassName:i=`recharts-shape`}=e,a=EVt(e,TVt),o;if((0,B.isValidElement)(t))o=(0,B.cloneElement)(t,_9(_9({},a),FVt(t)));else if(typeof t==`function`)o=t(a,a.index);else if((0,wVt.default)(t)&&typeof t!=`boolean`){var s=MVt(t,a);o=B.createElement(PVt,{shapeType:n,elementProps:s})}else{var c=a;o=B.createElement(PVt,{shapeType:n,elementProps:c})}return a.isActive?B.createElement(S0,{className:r},o):B.createElement(S0,{className:i},o)}var LVt=(e,t,n)=>{var r=b2();return(i,a)=>o=>{e?.(i,a,o),r(TIt({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},RVt=e=>{var t=b2();return(n,r)=>i=>{e?.(n,r,i),t(EIt())}},zVt=(e,t,n)=>{var r=b2();return(i,a)=>o=>{e?.(i,a,o),r(OIt({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function BVt(e){var{tooltipEntrySettings:t}=e,n=b2(),r=Y4(),i=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{r||(i.current===null?n(xIt(t)):i.current!==t&&n(SIt({prev:i.current,next:t})),i.current=t)},[t,n,r]),(0,B.useLayoutEffect)(()=>()=>{i.current&&=(n(CIt(i.current)),null)},[n]),null}function VVt(e){var{legendPayload:t}=e,n=b2(),r=Y4(),i=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{r||(i.current===null?n(aDt(t)):i.current!==t&&n(oDt({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,B.useLayoutEffect)(()=>()=>{i.current&&=(n(sDt(i.current)),null)},[n]),null}function HVt(e){var{legendPayload:t}=e,n=b2(),r=S2(o3),i=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{r!==`centric`&&r!==`radial`||(i.current===null?n(aDt(t)):i.current!==t&&n(oDt({prev:i.current,next:t})),i.current=t)},[n,r,t]),(0,B.useLayoutEffect)(()=>()=>{i.current&&=(n(sDt(i.current)),null)},[n]),null}var UVt=B.useId??(()=>{var[e]=B.useState(()=>a2(`uid-`));return e});function WVt(e,t){var n=UVt();return t||(e?`${e}-${n}`:n)}var GVt=(0,B.createContext)(void 0),KVt=e=>{var{id:t,type:n,children:r}=e,i=WVt(`recharts-${n}`,t);return B.createElement(GVt.Provider,{value:i},r(i))},qVt=C4({name:`graphicalItems`,initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(I3(t.payload))},prepare:S4()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=y4(e).cartesianItems.indexOf(I3(n));i>-1&&(e.cartesianItems[i]=I3(r))},prepare:S4()},removeCartesianGraphicalItem:{reducer(e,t){var n=y4(e).cartesianItems.indexOf(I3(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:S4()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(I3(t.payload))},prepare:S4()},removePolarGraphicalItem:{reducer(e,t){var n=y4(e).polarItems.indexOf(I3(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:S4()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=y4(e).polarItems.indexOf(I3(n));i>-1&&(e.polarItems[i]=I3(r))},prepare:S4()}}}),{addCartesianGraphicalItem:JVt,replaceCartesianGraphicalItem:YVt,removeCartesianGraphicalItem:XVt,addPolarGraphicalItem:ZVt,removePolarGraphicalItem:QVt,replacePolarGraphicalItem:$Vt}=qVt.actions,eHt=qVt.reducer,tHt=(0,B.memo)(e=>{var t=b2(),n=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{n.current===null?t(JVt(e)):n.current!==e&&t(YVt({prev:n.current,next:e})),n.current=e},[t,e]),(0,B.useLayoutEffect)(()=>()=>{n.current&&=(t(XVt(n.current)),null)},[t]),null}),nHt=(0,B.memo)(e=>{var t=b2(),n=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{n.current===null?t(ZVt(e)):n.current!==e&&t($Vt({prev:n.current,next:e})),n.current=e},[t,e]),(0,B.useLayoutEffect)(()=>()=>{n.current&&=(t(QVt(n.current)),null)},[t]),null}),rHt=u(Z0()),iHt=[`key`],aHt=[`onMouseEnter`,`onClick`,`onMouseLeave`],oHt=[`id`],sHt=[`id`];function v9(){return v9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v9.apply(null,arguments)}function y9(e,t){if(e==null)return{};var n,r,i=cHt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function cHt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function lHt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
858t%2?lHt(Object(n),!0).forEach(function(t){uHt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lHt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uHt(e,t,n){return(t=dHt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dHt(e){var t=fHt(e,`string`);return typeof t==`symbol`?t:t+``}function fHt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function pHt(e){var t=(0,B.useMemo)(()=>m9(e.children,J7),[e.children]),n=S2(n=>$Bt(n,e.id,t));return n==null?null:B.createElement(HVt,{legendPayload:n})}function mHt(e){if(!(e==null||typeof e==`boolean`||typeof e==`function`)){if(B.isValidElement(e)){var t=e.props?.fill;return typeof t==`string`?t:void 0}var{fill:n}=e;return typeof n==`string`?n:void 0}}var hHt=B.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:s,hide:c,tooltipType:l,id:u,activeShape:d}=e,f=mHt(d),p={dataDefinedOnItem:r.map(e=>{var t=e.tooltipPayload;return f==null||t==null?t:t.map(e=>b9(b9({},e),{},{color:f,fill:f}))}),getPosition:e=>r[Number(e)]?.tooltipPosition,settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:H4(s,t),hide:c,type:l,color:o,unit:``,graphicalItemId:u}};return B.createElement(BVt,{tooltipEntrySettings:p})}),gHt=(e,t)=>e>t?`start`:e<t?`end`:`middle`,_Ht=(e,t,n)=>o2(typeof t==`function`?t(e):t,n,n*.8),vHt=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,s=Bkt(a,o);return{cx:i+o2(e.cx,a,a/2),cy:r+o2(e.cy,o,o/2),innerRadius:o2(e.innerRadius,s,0),outerRadius:_Ht(n,e.outerRadius,s),maxRadius:e.maxRadius||Math.sqrt(a*a+o*o)/2}},yHt=(e,t)=>e2(t-e)*Math.min(Math.abs(t-e),360),bHt=(e,t)=>{if(B.isValidElement(e))return B.cloneElement(e,t);if(typeof e==`function`)return e(t);var n=iy(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className),{key:r}=t,i=y9(t,iHt);return B.createElement(X3,v9({},i,{type:`linear`,className:n}))},xHt=(e,t,n)=>{if(B.isValidElement(e))return B.cloneElement(e,t);var r=n;if(typeof e==`function`&&(r=e(t),B.isValidElement(r)))return r;var i=iy(`recharts-pie-label-text`,GBt(e));return B.createElement(e9,v9({},t,{alignmentBaseline:`middle`,className:i}),r)};function SHt(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var s=g0(n),c=_0(i),l=_0(a),u=typeof i==`object`&&`offsetRadius`in i&&typeof i.offsetRadius==`number`&&i.offsetRadius||20,d=t.map((e,t)=>{var n=(e.startAngle+e.endAngle)/2,r=c6(e.cx,e.cy,e.outerRadius+u,n),d=b9(b9(b9(b9({},s),e),{},{stroke:`none`},c),{},{index:t,textAnchor:gHt(r.x,e.cx)},r),f=b9(b9(b9(b9({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:t,points:[c6(e.cx,e.cy,e.outerRadius,n),r],key:`line`});return B.createElement(H7,{zIndex:S6.label,key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${t}`},B.createElement(S0,null,a&&bHt(a,f),xHt(i,d,B4(e,o))))});return B.createElement(S0,{className:`recharts-pie-labels`},d)}function CHt(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i==`object`&&i&&`position`in i?B.createElement(PBt,{label:i}):B.createElement(SHt,{sectors:t,props:n,showLabels:r})}function wHt(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,s=S2(P7),c=S2(F7),l=S2(_Lt),{onMouseEnter:u,onClick:d,onMouseLeave:f}=i,p=y9(i,aHt),m=LVt(u,i.dataKey,o),h=RVt(f),g=zVt(d,i.dataKey,o);return t==null||t.length===0?null:B.createElement(B.Fragment,null,t.map((e,u)=>{if(e?.startAngle===0&&e?.endAngle===0&&t.length!==1)return null;var d=l==null||l===o,f=String(u)===s&&(c==null||i.dataKey===c)&&d,_=n&&f?n:s?r:null,v=b9(b9({},e),{},{stroke:e.stroke,tabIndex:-1,[GTt]:u,[KTt]:o});return B.createElement(S0,v9({key:`sector-${e?.startAngle}-${e?.endAngle}-${e.midAngle}-${u}`,tabIndex:-1,className:`recharts-pie-sector`},m2(p,e,u),{onMouseEnter:m(e,u),onMouseLeave:h(e,u),onClick:g(e,u)}),B.createElement(IVt,v9({option:a??_,index:u,shapeType:`sector`,isActive:f},v)))}))}function THt(e){var{pieSettings:t,displayedData:n,cells:r,offset:i}=e,{cornerRadius:a,startAngle:o,endAngle:s,dataKey:c,nameKey:l,tooltipType:u}=t,d=Math.abs(t.minAngle),f=yHt(o,s),p=Math.abs(f),m=n.length<=1?0:t.paddingAngle??0,h=n.filter(e=>B4(e,c,0)!==0).length,g=(p>
858=360?h:h-1)*m,_=p-h*d-g,v=n.reduce((e,t)=>{var n=B4(t,c,0);return e+(r2(n)?n:0)},0),y;if(v>0){var b;y=n.map((e,n)=>{var s=B4(e,c,0),p=B4(e,l,n),h=vHt(t,i,e),g=(r2(s)?s:0)/v,y,x=b9(b9({},e),r&&r[n]&&r[n].props),S=x!=null&&`fill`in x&&typeof x.fill==`string`?x.fill:t.fill;y=n?b.endAngle+e2(f)*m*(s===0?0:1):o;var C=y+e2(f)*((s===0?0:d)+g*_),w=(y+C)/2,T=(h.innerRadius+h.outerRadius)/2,E=[{name:p,value:s,payload:x,dataKey:c,type:u,color:S,fill:S,graphicalItemId:t.id}],D=c6(h.cx,h.cy,T,w);return b=b9(b9(b9(b9({},t.presentationProps),{},{percent:g,cornerRadius:typeof a==`string`?parseFloat(a):a,name:p,tooltipPayload:E,midAngle:w,middleRadius:T,tooltipPosition:D},x),h),{},{value:s,dataKey:c,startAngle:y,endAngle:C,payload:x,paddingAngle:e2(f)*m}),b})}return y}function EHt(e){var{showLabels:t,sectors:n,children:r}=e,i=(0,B.useMemo)(()=>!t||!n?[]:n.map(e=>({value:e.value,payload:e.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:e.cx,cy:e.cy,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clockWise:!1},fill:e.fill})),[n,t]);return B.createElement(jBt,{value:t?i:void 0},r)}function DHt(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:s,animationEasing:c,activeShape:l,inactiveShape:u,onAnimationStart:d,onAnimationEnd:f}=t,p=i6(t,`recharts-pie-`),m=n.current,[h,g]=(0,B.useState)(!1),_=(0,B.useCallback)(()=>{typeof f==`function`&&f(),g(!1)},[f]),v=(0,B.useCallback)(()=>{typeof d==`function`&&d(),g(!0)},[d]);return B.createElement(EHt,{showLabels:!h,sectors:i},B.createElement(r6,{animationId:p,begin:o,duration:s,isActive:a,easing:c,onAnimationStart:v,onAnimationEnd:_,key:p},e=>{var a=[],o=(i&&i[0])?.startAngle??0;return i?.forEach((t,n)=>{var r=m&&m[n],i=n>0?(0,rHt.default)(t,`paddingAngle`,0):0;if(r){var s=s2(r.endAngle-r.startAngle,t.endAngle-t.startAngle,e),c=b9(b9({},t),{},{startAngle:o+i,endAngle:o+s+i});a.push(c),o=c.endAngle}else{var{endAngle:l,startAngle:u}=t,d=s2(0,l-u,e),f=b9(b9({},t),{},{startAngle:o+i,endAngle:o+d+i});a.push(f),o=f.endAngle}}),n.current=a,B.createElement(S0,null,B.createElement(wHt,{sectors:a,activeShape:l,inactiveShape:u,allOtherPieProps:t,shape:t.shape,id:r}))}),B.createElement(CHt,{showLabels:!h,sectors:i,props:t}),t.children)}var OHt={animationBegin:400,animationDuration:1500,animationEasing:`ease`,cx:`50%`,cy:`50%`,dataKey:`value`,endAngle:360,fill:`#808080`,hide:!1,innerRadius:0,isAnimationActive:`auto`,label:!1,labelLine:!0,legendType:`rect`,minAngle:0,nameKey:`name`,outerRadius:`80%`,paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:`#fff`,zIndex:S6.area};function kHt(e){var{id:t}=e,n=y9(e,oHt),{hide:r,className:i,rootTabIndex:a}=e,o=(0,B.useMemo)(()=>m9(e.children,J7),[e.children]),s=S2(e=>eVt(e,t,o)),c=(0,B.useRef)(null),l=iy(`recharts-pie`,i);return r||s==null?(c.current=null,B.createElement(S0,{tabIndex:a,className:l})):B.createElement(H7,{zIndex:e.zIndex},B.createElement(hHt,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:s,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),B.createElement(S0,{tabIndex:a,className:l},B.createElement(DHt,{props:b9(b9({},n),{},{sectors:s}),previousSectorsRef:c,id:t})))}function AHt(e){var t=h2(e,OHt),{id:n}=t,r=y9(t,sHt),i=g0(r);return B.createElement(KVt,{id:n,type:`pie`},e=>B.createElement(B.Fragment,null,B.createElement(nHt,{type:`pie`,id:e,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),B.createElement(pHt,v9({},r,{id:e})),B.createElement(kHt,v9({},r,{id:e}))))}var jHt=AHt;jHt.displayName=`Pie`;function MHt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NHt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
858t%2?MHt(Object(n),!0).forEach(function(t){PHt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MHt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PHt(e,t,n){return(t=FHt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FHt(e){var t=IHt(e,`string`);return typeof t==`symbol`?t:t+``}function IHt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var LHt=0,RHt=C4({name:`cartesianAxis`,initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=I3(t.payload)},prepare:S4()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=I3(r))},prepare:S4()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:S4()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=I3(t.payload)},prepare:S4()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=I3(r))},prepare:S4()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:S4()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=I3(t.payload)},prepare:S4()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=I3(r))},prepare:S4()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:S4()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a=i.widthHistory||[];if(a.length===3&&a[0]===a[2]&&r===a[1]&&r!==i.width&&Math.abs(r-(a[0]??0))<=1)return;var o=[...a,r].slice(-3);e.yAxis[n]=NHt(NHt({},i),{},{width:r,widthHistory:o})}}}}),{addXAxis:zHt,replaceXAxis:BHt,removeXAxis:VHt,addYAxis:HHt,replaceYAxis:UHt,removeYAxis:WHt,addZAxis:GHt,replaceZAxis:KHt,removeZAxis:qHt,updateYAxisWidth:JHt}=RHt.actions,YHt=RHt.reducer,XHt=$([$([J4],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),U4,W4],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),ZHt=()=>S2(XHt),QHt=()=>S2(xLt),$Ht=e=>{var{chartData:t}=e,n=b2(),r=Y4();return(0,B.useEffect)(()=>r?()=>{}:(n(ARt(t)),()=>{n(ARt(void 0))}),[t,n,r]),null},eUt={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},tUt=C4({name:`brush`,initialState:eUt,reducers:{setBrushSettings(e,t){return t.payload==null?eUt:t.payload}}}),{setBrushSettings:nUt}=tUt.actions,rUt=tUt.reducer,iUt=C4({name:`referenceElements`,initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=y4(e).dots.findIndex(e=>e===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=y4(e).areas.findIndex(e=>e===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(I3(t.payload))},removeLine:(e,t)=>{var n=y4(e).lines.findIndex(e=>e===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:aUt,removeDot:oUt,addArea:sUt,removeArea:cUt,addLine:lUt,removeLine:uUt}=iUt.actions,dUt=iUt.reducer,fUt=(0,B.createContext)(void 0),pUt=e=>{var{children:t}=e,[n]=(0,B.useState)(`${a2(`recharts`)}-clip`),r=ZHt();if(r==null)return null;var{x:i,y:a,width:o,height:s}=r;return B.createElement(fUt.Provider,{value:n},B.createElement(`defs`,null,B.createElement(`clipPath`,{id:n},B.createElement(`rect`,{x:i,y:a,height:s,width:o}))),t)},mUt=()=>(0,B.useContext)(fUt),hUt=C4({name:`renderedTicks`,initialState:{xAxis:{},yAxis:{}},reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=I3(i)},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:gUt,removeRenderedTicks:_Ut}=hUt.actions,vUt=hUt.reducer,yUt=C4({name:`errorBars`,initialState:{},reducers:{addErrorBar:(e,t)=>
858{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(e=>e.dataKey===r.dataKey&&e.direction===r.direction?i:e))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(e=>e.dataKey!==r.dataKey||e.direction!==r.direction))}}}),{addErrorBar:bUt,replaceErrorBar:xUt,removeErrorBar:SUt}=yUt.actions,CUt=yUt.reducer,x9=$([(e,t)=>t,o3,BAt,R6,pLt,A7,BLt,J4],YLt);function wUt(e){return`getBBox`in e.currentTarget&&typeof e.currentTarget.getBBox==`function`}function S9(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(wUt(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(e,i)=>({relativeX:Math.round((e-t.left)/n),relativeY:Math.round((i-t.top)/r)});return`touches`in e?Array.from(e.touches).map(e=>o(e.clientX,e.clientY)):o(e.clientX,e.clientY)}var TUt=b4(`mouseClick`),EUt=F4();EUt.startListening({actionCreator:TUt,effect:(e,t)=>{var n=e.payload,r=x9(t.getState(),S9(n));r?.activeIndex!=null&&t.dispatch(AIt({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var C9=b4(`mouseMove`),DUt=F4(),w9=null,T9=null,E9=null;DUt.startListening({actionCreator:C9,effect:(e,t)=>{var n=e.payload,{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i?.includes(`mousemove`);w9!==null&&(cancelAnimationFrame(w9),w9=null),T9!==null&&(typeof r!=`number`||!a)&&(clearTimeout(T9),T9=null),E9=S9(n);var o=()=>{var e=t.getState(),n=v7(e,e.tooltip.settings.shared);if(!E9){w9=null,T9=null;return}if(n===`axis`){var r=x9(e,E9);r?.activeIndex==null?t.dispatch(DIt()):t.dispatch(kIt({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}w9=null,T9=null};if(!a){o();return}r===`raf`?w9=requestAnimationFrame(o):typeof r==`number`&&T9===null&&(T9=setTimeout(o,r))}});function OUt(e,t){return t instanceof HTMLElement?`HTMLElement <${t.tagName} class="${t.className}">`:t===window?`global.window`:e===`children`&&typeof t==`object`&&t?`<<CHILDREN>>`:t}var kUt={accessibilityLayer:!0,barCategoryGap:`10%`,barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:`none`,syncId:void 0,syncMethod:`index`,baseValue:void 0,reverseStackOrder:!1},AUt=C4({name:`rootProps`,initialState:kUt,reducers:{updateOptions:(e,t)=>{e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=t.payload.barGap??kUt.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),jUt=AUt.reducer,{updateOptions:MUt}=AUt.actions,NUt=C4({name:`polarOptions`,initialState:null,reducers:{updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)}}),{updatePolarOptions:PUt}=NUt.actions,FUt=NUt.reducer,IUt=b4(`keyDown`),LUt=b4(`focus`),RUt=b4(`blur`),D9=F4(),O9=null,k9=null,A9=null;D9.startListening({actionCreator:IUt,effect:(e,t)=>{A9=e.payload,O9!==null&&(cancelAnimationFrame(O9),O9=null);var{throttleDelay:n,throttledEvents:r}=t.getState().eventSettings,i=r===`all`||r.includes(`keydown`);k9!==null&&(typeof n!=`number`||!i)&&(clearTimeout(k9),k9=null);var a=()=>{try{var e=t.getState();if(e.rootProps.accessibilityLayer===!1)return;var{keyboardInteraction:n}=e.tooltip,r=A9;if(r!==`ArrowRight`&&r!==`ArrowLeft`&&r!==`Enter`)return;var i=C7(n,D7(e),X5(e),k7(e)),a=i==null?-1:Number(i);if(!Number.isFinite(a)||a<0)return;var o=A7(e);if(r===`Enter`){var s=V7(e,`axis`,`hover`,String(n.index));t.dispatch(x7({active:!n.active,activeIndex:n.index,activeCoordinate:s}));return}var c=pIt(e)===`left-to-right`?1:-1,l=a+(r===`ArrowRight`?1:-1)*c;if(o==null||l>=o.length||l<0)return;var u=V7(e,`axis`,`hover`,String(l));t.dispatch(x7({active:!0,activeIndex:l.toString(),activeCoordinate:u}))}finally{O9=null,k9=null}};if(!i){a();return}
858n===`raf`?O9=requestAnimationFrame(a):typeof n==`number`&&k9===null&&(a(),A9=null,k9=setTimeout(()=>{A9?a():(k9=null,O9=null)},n))}}),D9.startListening({actionCreator:LUt,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;if(!r.active&&r.index==null){var i=`0`,a=V7(n,`axis`,`hover`,String(i));t.dispatch(x7({active:!0,activeIndex:i,activeCoordinate:a}))}}}}),D9.startListening({actionCreator:RUt,effect:(e,t)=>{var n=t.getState();if(n.rootProps.accessibilityLayer!==!1){var{keyboardInteraction:r}=n.tooltip;r.active&&t.dispatch(x7({active:!1,activeIndex:r.index,activeCoordinate:r.coordinate}))}}});function zUt(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(e,n)=>{if(n===`currentTarget`)return t;var r=Reflect.get(e,n);return typeof r==`function`?r.bind(e):r}})}var j9=b4(`externalEvent`),BUt=F4(),M9=new Map,N9=new Map,P9=new Map;BUt.startListening({actionCreator:j9,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=zUt(r);P9.set(i,{handler:n,reactEvent:a});var o=M9.get(i);o!==void 0&&(cancelAnimationFrame(o),M9.delete(i));var{throttleDelay:s,throttledEvents:c}=t.getState().eventSettings,l=c,u=l===`all`||l?.includes(i),d=N9.get(i);d!==void 0&&(typeof s!=`number`||!u)&&(clearTimeout(d),N9.delete(i));var f=()=>{var e=P9.get(i);try{if(!e)return;var{handler:n,reactEvent:r}=e,a=t.getState(),o={activeCoordinate:yLt(a),activeDataKey:F7(a),activeIndex:P7(a),activeLabel:gLt(a),activeTooltipIndex:P7(a),isTooltipActive:bLt(a)};n&&n(o,r)}finally{M9.delete(i),N9.delete(i),P9.delete(i)}};if(!u){f();return}if(s===`raf`){var p=requestAnimationFrame(f);M9.set(i,p)}else if(typeof s==`number`){if(!N9.has(i)){f();var m=setTimeout(f,s);N9.set(i,m)}}else f()}}});var VUt=$([$([w7],e=>e.tooltipItemPayloads),(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(e=>e.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),HUt=b4(`touchMove`),UUt=F4(),F9=null,I9=null,WUt=null,L9=null;UUt.startListening({actionCreator:HUt,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){L9=zUt(n);var{throttleDelay:r,throttledEvents:i}=t.getState().eventSettings,a=i===`all`||i.includes(`touchmove`);F9!==null&&(cancelAnimationFrame(F9),F9=null),I9!==null&&(typeof r!=`number`||!a)&&(clearTimeout(I9),I9=null),WUt=Array.from(n.touches).map(e=>S9({clientX:e.clientX,clientY:e.clientY,currentTarget:n.currentTarget}));var o=()=>{if(L9!=null){var e=t.getState(),n=v7(e,e.tooltip.settings.shared);if(n===`axis`){var r=WUt?.[0];if(r==null){F9=null,I9=null;return}var i=x9(e,r);i?.activeIndex!=null&&t.dispatch(kIt({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(n===`item`){var a=L9.touches[0];if(document.elementFromPoint==null||a==null)return;var o=document.elementFromPoint(a.clientX,a.clientY);if(!o||!o.getAttribute)return;var s=o.getAttribute(GTt),c=o.getAttribute(`data-recharts-item-id`)??void 0,l=E7(e).find(e=>e.id===c);if(s==null||l==null||c==null)return;var{dataKey:u}=l,d=VUt(e,s,c);t.dispatch(TIt({activeDataKey:u,activeIndex:s,activeCoordinate:d,activeGraphicalItemId:c}))}F9=null,I9=null}};if(!a){o();return}r===`raf`?F9=requestAnimationFrame(o):typeof r==`number`&&I9===null&&(o(),L9=null,I9=setTimeout(()=>{L9?o():(I9=null,F9=null)},r))}}});var R9={throttleDelay:`raf`,throttledEvents:[`mousemove`,`touchmove`,`pointermove`,`scroll`,`wheel`]},GUt=C4({name:`eventSettings`,initialState:R9,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=I3(t.payload.throttledEvents))}}}),{setEventSettings:KUt}=GUt.actions,qUt=GUt.reducer,JUt=PCt({brush:rUt,cartesianAxis:YHt,chartData:NRt,errorBars:CUt,eventSettings:qUt,graphicalItems:eHt,layout:gTt,legend:cDt,options:ERt,polarAxis:WBt,polarOptions:FUt,referenceElements:dUt,renderedTicks:vUt,rootProps:jUt,tooltip:jIt,zIndex:dRt}),YUt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`Chart`;return Dwt({reducer:JUt,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:![`commonjs`,`es6`,`production`].includes(`es6`)}).concat([EUt.middleware,DUt.middleware,D9.middleware,BUt.middleware,UUt.middleware]),enhancers:e=>{var t=e;return typeof e==`function`&&(t=e()),t.concat(Twt({type:`raf`}))},devTools:W3.devToolsEnabled&&{serialize:{replacer:OUt},name:`recharts-${t}`}})};function XUt(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Y4(),a=(0,B.useRef)(null);if(i)return n;a.current??=YUt(t,r);var o=y2;return B.createElement(wDt,{context:o,store:a.current},n)}function ZUt(e){var{layout:t,margin:n}=e,r=b2(),i=Y4();return(0,B.useEffect)(()=>{i||(r(pTt(t)),r(fTt(n)))},[r,i,t,n]),null}var QUt=(0,B.memo)(ZUt,L3);function $Ut(e){var t=b2();return(0,B.useEffect)(()=>{t(MUt(e))},[t,e]),null}var eWt=(0,B.memo)(e=>{var t=b2();return(0,B.useEffect)(()=>{t(KUt(e))},[t,e]),null},L3);function tWt(e){var{zIndex:t,isPanorama:n}=e,r=(0,B.useRef)(null),i=b2();return(0,B.useLayoutEffect)(()=>(r.current&&i(lRt({zIndex:t,element:r.current,isPanorama:n})),()=>{i(uRt({zIndex:t,isPanorama:n}))}),[i,t,n]),B.createElement(`g`,{tabIndex:-1,ref:r,className:`recharts-zIndex-layer_${t}`})}function nWt(e){var{children:t,isPanorama:n}=e,r=S2(ZLt);if(!r||r.length===0)return t;var i=r.filter(e=>e<0),a=r.filter(e=>e>0);return B.createElement(B.Fragment,null,i.map(e=>B.createElement(tWt,{key:e,zIndex:e,isPanorama:n})),t,a.map(e=>B.createElement(tWt,{key:e,zIndex:e,isPanorama:n})))}var rWt=[`children`];function iWt(e,t){if(e==null)return{};var n,r,i=aWt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function aWt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function z9(){return z9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z9.apply(null,arguments)}
858var oWt={width:`100%`,height:`100%`,display:`block`},sWt=(0,B.forwardRef)((e,t)=>{var n=i3(),r=a3(),i=dOt();if(!R4(n)||!R4(r))return null;var{children:a,otherAttributes:o,title:s,desc:c}=e,l,u;return o!=null&&(l=typeof o.tabIndex==`number`?o.tabIndex:i?0:void 0,u=typeof o.role==`string`?o.role:i?`application`:void 0),B.createElement(b0,z9({},o,{title:s,desc:c,role:u,tabIndex:l,width:n,height:r,style:oWt,ref:t}),a)}),cWt=e=>{var{children:t}=e,n=S2(Z4);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return B.createElement(b0,{width:r,height:i,x:o,y:a},t)},lWt=(0,B.forwardRef)((e,t)=>{var{children:n}=e,r=iWt(e,rWt);return Y4()?B.createElement(cWt,null,B.createElement(nWt,{isPanorama:!0},n)):B.createElement(sWt,z9({ref:t},r),B.createElement(nWt,{isPanorama:!1},n))});function uWt(){var e=b2(),[t,n]=(0,B.useState)(null),r=S2(UTt);return(0,B.useEffect)(()=>{if(t!=null){var n=t.getBoundingClientRect().width/t.offsetWidth;L4(n)&&n!==r&&e(hTt(n))}},[t,e,r]),n}function dWt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fWt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dWt(Object(n),!0).forEach(function(t){pWt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dWt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pWt(e,t,n){return(t=mWt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mWt(e){var t=hWt(e,`string`);return typeof t==`symbol`?t:t+``}function hWt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function B9(){return B9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B9.apply(null,arguments)}var gWt=()=>(URt(),null);function V9(e){if(typeof e==`number`)return e;if(typeof e==`string`){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var _Wt=(0,B.forwardRef)((e,t)=>{var n=(0,B.useRef)(null),[r,i]=(0,B.useState)({containerWidth:V9(e.style?.width),containerHeight:V9(e.style?.height)}),a=(0,B.useCallback)((e,t)=>{i(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),o=(0,B.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null&&typeof ResizeObserver<`u`){var{width:r,height:i}=e.getBoundingClientRect();a(r,i);var o=new ResizeObserver(e=>{var t=e[0];if(t!=null){var{width:n,height:r}=t.contentRect;a(n,r)}});o.observe(e),n.current=o}},[t,a]);return(0,B.useEffect)(()=>()=>{n.current?.disconnect()},[a]),B.createElement(B.Fragment,null,B.createElement(c3,{width:r.containerWidth,height:r.containerHeight}),B.createElement(`div`,B9({ref:o},e)))}),vWt=(0,B.forwardRef)((e,t)=>{var{width:n,height:r}=e,[i,a]=(0,B.useState)({containerWidth:V9(n),containerHeight:V9(r)}),o=(0,B.useCallback)((e,t)=>{a(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]),s=(0,B.useCallback)(e=>{if(typeof t==`function`&&t(e),e!=null){var{width:n,height:r}=e.getBoundingClientRect();o(n,r)}},[t,o]);return B.createElement(B.Fragment,null,B.createElement(c3,{width:i.containerWidth,height:i.containerHeight}),B.createElement(`div`,B9({ref:s},e)))}),yWt=(0,B.forwardRef)((e,t)=>{var{width:n,height:r}=e;return B.createElement(B.Fragment,null,B.createElement(c3,{width:n,height:r}),B.createElement(`div`,B9({ref:t},e)))}),bWt=(0,B.forwardRef)((e,t)=>{var{width:n,height:r}=e;return typeof n==`string`||typeof r==`string`?B.createElement(vWt,B9({},e,{ref:t})):typeof n==`number`&&typeof r==`number`?B.createElement(yWt,B9({},e,{width:n,height:r,ref:t})):B.createElement(B.Fragment,null,B.createElement(c3,{width:n,height:r}),B.createElement(`div`,B9({ref:t},e)))});function xWt(e){return e?_Wt:bWt}var SWt=(0,B.forwardRef)((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:c,onMouseEnter:l,onMouseLeave:u,onMouseMove:d,onMouseUp:f,onTouchEnd:p,onTouchMove:m,onTouchStart:h,style:g,width:_,responsive:v,dispatchTouchEvents:y=!0}=e,b=(0,B.useRef)(null),x=b2(),[S,C]=(0,B.useState)(null),[w,T]=(0,B.useState)(null),E=uWt(),D=t3(),O=D?.width>0?D.width:_,k=D?.height>0?D.height:i,A=(0,B.useCallback)(e=>{E(e),typeof t==`function`&&t(e),C(e),T(e),e!=null&&(b.current=e)},[E,t,C,T]),j=(0,B.useCallback)(e=>{x(TUt(e)),x(j9({handler:a,reactEvent:e}))},[x,a]),M=(0,B.useCallback)(e=>{x(C9(e)),x(j9({handler:l,reactEvent:e}))},[x,l]),N=(0,B.useCallback)(e=>{x(DIt()),x(j9({handler:u,reactEvent:e}))},[x,u]),P=(0,B.useCallback)(e=>{x(C9(e)),x(j9({handler:d,reactEvent:e}))},[x,d]),F=(0,B.useCallback)(()=>{x(LUt())},[x]),I=(0,B.useCallback)(()=>{x(RUt())},[x]),L=(0,B.useCallback)(e=>{x(IUt(e.key))},[x]),ee=(0,B.useCallback)(e=>{x(j9({handler:o,reactEvent:e}))},[x,o]),R=(0,B.useCallback)(e=>{x(j9({handler:s,reactEvent:e}))},[x,s]),te=(0,B.useCallback)(e=>{x(j9({handler:c,reactEvent:e}))},[x,c]),ne=(0,B.useCallback)(e=>{x(j9({handler:f,reactEvent:e}))},[x,f]),re=(0,B.useCallback)(e=>{x(j9({handler:h,reactEvent:e}))},[x,h]),ie=(0,B.useCallback)(e=>{y&&x(HUt(e)),x(j9({handler:m,reactEvent:e}))},[x,y,m]),z=(0,B.useCallback)(e=>{x(j9({handler:p,reactEvent:e}))},[x,p]),ae=xWt(v);return B.createElement(bRt.Provider,{value:S},B.createElement(Bbt.Provider,{value:w},B.createElement(ae,{width:O??g?.width,height:k??g?.height,className:iy(`recharts-wrapper`,r),style:fWt({position:`relative`,cursor:`default`,width:O,height:k}
858,g),onClick:j,onContextMenu:ee,onDoubleClick:R,onFocus:F,onBlur:I,onKeyDown:L,onMouseDown:te,onMouseEnter:M,onMouseLeave:N,onMouseMove:P,onMouseUp:ne,onTouchEnd:z,onTouchMove:ie,onTouchStart:re,ref:A},B.createElement(gWt,null),n)))}),CWt=[`width`,`height`,`responsive`,`children`,`className`,`style`,`compact`,`title`,`desc`];function wWt(e,t){if(e==null)return{};var n,r,i=TWt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function TWt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var EWt=(0,B.forwardRef)((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:s,compact:c,title:l,desc:u}=e,d=g0(wWt(e,CWt));return c?B.createElement(B.Fragment,null,B.createElement(c3,{width:n,height:r}),B.createElement(lWt,{otherAttributes:d,title:l,desc:u},a)):B.createElement(SWt,{className:o,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},B.createElement(lWt,{otherAttributes:d,title:l,desc:u,ref:t},B.createElement(pUt,null,a)))});function DWt(e){var t=b2();return(0,B.useEffect)(()=>{t(PUt(e))},[t,e]),null}var OWt=[`layout`];function H9(){return H9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H9.apply(null,arguments)}function kWt(e,t){if(e==null)return{};var n,r,i=AWt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function AWt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function jWt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MWt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jWt(Object(n),!0).forEach(function(t){NWt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jWt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NWt(e,t,n){return(t=PWt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PWt(e){var t=FWt(e,`string`);return typeof t==`symbol`?t:t+``}function FWt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var IWt=MWt({accessibilityLayer:!0,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`,layout:`radial`,responsive:!1,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`},R9),LWt=(0,B.forwardRef)(function(e,t){var n=h2(e.categoricalChartProps,IWt),{layout:r}=n,i=kWt(n,OWt),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:s,tooltipPayloadSearcher:c}=e,l={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:s,tooltipPayloadSearcher:c,eventEmitter:void 0};return B.createElement(XUt,{preloadedState:{options:l},reduxStoreName:n.id??a},B.createElement($Ht,{chartData:n.data}),B.createElement(QUt,{layout:r,margin:n.margin}),B.createElement(eWt,{throttleDelay:n.throttleDelay,throttledEvents:n.throttledEvents}),B.createElement($Ut,{baseValue:void 0,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),B.createElement(DWt,{cx:n.cx,cy:n.cy,startAngle:n.startAngle,endAngle:n.endAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius}),B.createElement(EWt,H9({},i,{ref:t})))});function RWt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zWt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
858t%2?RWt(Object(n),!0).forEach(function(t){BWt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RWt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function BWt(e,t,n){return(t=VWt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VWt(e){var t=HWt(e,`string`);return typeof t==`symbol`?t:t+``}function HWt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var UWt=[`item`],WWt=zWt(zWt({},IWt),{},{layout:`centric`,startAngle:0,endAngle:360}),GWt=(0,B.forwardRef)((e,t)=>{var n=h2(e,WWt);return B.createElement(LWt,{chartName:`PieChart`,defaultTooltipEventType:`item`,validateTooltipEventTypes:UWt,tooltipPayloadSearcher:wRt,categoricalChartProps:n,ref:t})}),KWt={light:``,dark:`.dark`},qWt={width:320,height:200},JWt=B.createContext(null);function YWt(){let e=B.useContext(JWt);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function XWt({id:e,className:t,children:n,config:r,initialDimension:i=qWt,...a}){let o=B.useId(),s=`chart-${e??o.replace(/:/g,``)}`;return(0,K.jsx)(JWt.Provider,{value:{config:r},children:(0,K.jsxs)(`div`,{"data-slot":`chart`,"data-chart":s,className:q(`flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,t),...a,children:[(0,K.jsx)(ZWt,{id:s,config:r}),(0,K.jsx)(DEt,{initialDimension:i,children:n})]})})}var ZWt=({id:e,config:t})=>{let n=Object.entries(t).filter(([,e])=>e.theme??e.color);return n.length?(0,K.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(KWt).map(([t,r])=>` 859${r} [data-chart=${e}] { 860${n.map(([e,n])=>{let r=n.theme?.[t]??n.color;return r?` --color-${e}: ${r};`:null}).join(` 861`)} 862} 863`).join(` 864`)}}):null},QWt=tzt;function $Wt({active:e,payload:t,className:n,indicator:r=`dot`,hideLabel:i=!1,hideIndicator:a=!1,label:o,labelFormatter:s,labelClassName:c,formatter:l,color:u,nameKey:d,labelKey:f}){let{config:p}=YWt(),m=B.useMemo(()=>{if(i||!t?.length)return null;let[e]=t,n=U9(p,e,`${f??e?.dataKey??e?.name??`value`}`),r=!f&&typeof o==`string`?p[o]?.label??o:n?.label;return s?(0,K.jsx)(`div`,{className:q(`font-medium`,c),children:s(r,t)}):r?(0,K.jsx)(`div`,{className:q(`font-medium`,c),children:r}):null},[o,s,t,i,c,p,f]);if(!e||!t?.length)return null;let h=t.length===1&&r!==`dot`;return(0,K.jsxs)(`div`,{className:q(`grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl`,n),children:[h?null:m,(0,K.jsx)(`div`,{className:`grid gap-1.5`,children:t.filter(e=>e.type!==`none`).map((e,t)=>{let n=U9(p,e,`${d??e.name??e.dataKey??`value`}`),i=u??e.payload?.fill??e.color;return(0,K.jsx)(`div`,{className:q(`flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground`,r===`dot`&&`items-center`),children:l&&e?.value!==void 0&&e.name?l(e.value,e.name,e,t,e.payload):(0,K.jsxs)(K.Fragment,{children:[n?.icon?(0,K.jsx)(n.icon,{}):!a&&(0,K.jsx)(`div`,{className:q(`shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)`,{"h-2.5 w-2.5":r===`dot`,"w-1":r===`line`,"w-0 border-[1.5px] border-dashed bg-transparent":r===`dashed`,"my-0.5":h&&r===`dashed`}),style:{"--color-bg":i,"--color-border":i}}),(0,K.jsxs)(`div`,{className:q(`flex flex-1 justify-between leading-none`,h?`items-end`:`items-center`),children:[(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[h?m:null,(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:n?.label??e.name})]}),e.value!=null&&(0,K.jsx)(`span`,{className:`font-mono font-medium text-foreground tabular-nums`,children:typeof e.value==`number`?e.value.toLocaleStr
864ing():String(e.value)})]})]})},t)})})]})}var eGt=UDt;function tGt({className:e,hideIcon:t=!1,payload:n,verticalAlign:r=`bottom`,nameKey:i}){let{config:a}=YWt();return n?.length?(0,K.jsx)(`div`,{className:q(`flex items-center justify-center gap-4`,r===`top`?`pb-3`:`pt-3`,e),children:n.filter(e=>e.type!==`none`).map((e,n)=>{let r=U9(a,e,`${i??e.dataKey??`value`}`);return(0,K.jsxs)(`div`,{className:q(`flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground`),children:[r?.icon&&!t?(0,K.jsx)(r.icon,{}):(0,K.jsx)(`div`,{className:`h-2 w-2 shrink-0 rounded-[2px]`,style:{backgroundColor:e.color}}),r?.label]},n)})}):null}function U9(e,t,n){if(typeof t!=`object`||!t)return;let r=`payload`in t&&typeof t.payload==`object`&&t.payload!==null?t.payload:void 0,i=n;return n in t&&typeof t[n]==`string`?i=t[n]:r&&n in r&&typeof r[n]==`string`&&(i=r[n]),i in e?e[i]:e[n]}var nGt=[{usageType:`Chat`,usageAmount:142,creditsUsed:85,fill:`var(--color-chat)`},{usageType:`Processing`,usageAmount:28,creditsUsed:42,fill:`var(--color-processing)`},{usageType:`Redline`,usageAmount:12,creditsUsed:36,fill:`var(--color-redline)`},{usageType:`Search`,usageAmount:67,creditsUsed:20,fill:`var(--color-search)`},{usageType:`Injection`,usageAmount:8,creditsUsed:17,fill:`var(--color-injection)`}],rGt={creditsUsed:{label:`Credits Used`},chat:{label:`AI Chat Messages`,color:`hsl(221, 83%, 53%)`},processing:{label:`Document Processing`,color:`hsl(221, 73%, 43%)`},redline:{label:`Redline & Track Changes`,color:`hsl(221, 63%, 35%)`},search:{label:`Semantic Search`,color:`hsl(221, 53%, 28%)`},injection:{label:`Document Injection`,color:`hsl(221, 43%, 22%)`}};function iGt(){return(0,K.jsxs)(`div`,{className:`space-y-2 rounded-xl p-4`,children:[(0,K.jsx)(`h4`,{className:`text-sm font-medium`,children:`Usage Breakdown`}),(0,K.jsx)(XWt,{config:rGt,className:`mx-auto aspect-square max-h-[250px] [&_.recharts-text]:fill-background`,children:(0,K.jsxs)(GWt,{children:[(0,K.jsx)(QWt,{content:(0,K.jsx)($Wt,{nameKey:`usageType`,hideLabel:!0,formatter:(e,t,n)=>{let r=n.payload;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:rGt[r.usageType.toLowerCase()]?.label??r.usageType}),(0,K.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[r.creditsUsed,` credits · `,r.usageAmount,` requests`]})]})}})}),(0,K.jsx)(jHt,{data:nGt,dataKey:`creditsUsed`,nameKey:`usageType`,children:(0,K.jsx)(c9,{dataKey:`usageType`,className:`fill-background`,stroke:`none`,fontSize:11})})]})})]})}function aGt({item:e,config:t,radius:n,circumference:r,progressColor:i,getUsageClasses:a,getStatus:o}){let{t:s}=V(),{formatNumber:c}=jb(),l=Math.min(e.usage/e.limit*100,100),u=Math.max(e.limit-e.usage,0),d=$N(0),f=tP(rP(d,{stiffness:100,damping:20}),e=>`${Math.round(e)}%`);return(0,B.useEffect)(()=>{d.set(l)},[l,d]),(0,K.jsxs)(`div`,{className:`bg-muted/20 flex flex-col items-center space-y-3 rounded-xl p-4 text-center`,children:[(0,K.jsx)(`span`,{className:`w-full truncate text-sm font-medium`,children:e.name}),(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsxs)(`svg`,{width:t.circle,height:t.circle,className:`-rotate-90`,children:[(0,K.jsx)(`circle`,{cx:t.circle/2,cy:t.circle/2,r:n,strokeWidth:t.stroke,className:`text-muted stroke-current`,fill:`transparent`}),(0,K.jsx)(QN.circle,{cx:t.circle/2,cy:t.circle/2,r:n,strokeWidth:t.stroke,fill:`transparent`,strokeDasharray:r,strokeLinecap:`round`,className:q(`stroke-current`,i===`usage`?a(l,`circle`):`text-primary`),initial:{strokeDashoffset:r},animate:{strokeDashoffset:r-l/100*r},transition:{duration:.5,ease:`easeOut`}})]}),(0,K.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center`,children:[(0,K.jsx)(QN.span,{className:q(`font-semibold`,t.text),children:f}),(0,K.jsx)(`span`,{className:q(`text-muted-foreground`,t.label),children:s(`settings.usage.used`)})]})]}),(0,K.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:s(`settings.usage.remaining_label`,{remaining:c(u),total:c(e.limit)})}),o(l)]})}function oGt({item:e,config:t,progressColor:n,getUsageClasses:r,getStatus:i}){let{t:a}=V(),{formatNumber:o}=jb(),s=Math.min(e.usage/e.limit*100,100),c=Math.max(e.limit-e.usage,0),l=$N(0),u=tP(rP(l,{stiffness:100,damping:20}),e=>`${Math.round(e)}%`);return(0,B.useEffect)(()=>{l.set(s)},[s,l]),(0,K.jsxs)(`div`,{className:`bg-muted/20 space-y-2 rounded-xl p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.name}),(0,K.jsx)(QN.span,{className:`text-muted-foreground text-xs`,children:u})]}),(0,K.jsx)(`div`,{className:q(`bg-muted w-full overflow-hidden rounded-full`,t.bar),children:(0,K.jsx)(QN.div,{className:q(`rounded-full bg-gradient-to-r`,t.bar,n===`usage`?r(s,`linear`):`from-primary to-primary/70`),initial:{width:0},animate:{width:`${s}%`},transition:{duration:.5,ease:`easeOut`}})}),(0,K.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-between text-xs`,children:[(0,K.jsx)(`span`,{children:a(`settings.usage.remaining_label`,{remaining:o(c),total:o(e.limit)})}),i(s)]})]})}function sGt({usage:e,className:t,variant:n=`linear`,size:r=`md`,title:i,description:a,progressColor:o=`default`}){let{t:s}=V();if(!e?.length)return null;
864let c=e=>e>=90?(0,K.jsx)(lR,{variant:`destructive`,children:s(`evaluation.guidance.severity_high`)}):e>=75?(0,K.jsx)(lR,{variant:`secondary`,children:s(`evaluation.guidance.severity_medium`)}):null,l=(e,t)=>{let n=[{min:90,circle:`text-red-500`,linear:[`from-red-500`,`to-red-400`]},{min:75,circle:`text-yellow-500`,linear:[`from-yellow-500`,`to-yellow-400`]},{min:50,circle:`text-emerald-500`,linear:[`from-emerald-500`,`to-emerald-400`]},{min:25,circle:`text-blue-500`,linear:[`from-blue-500`,`to-blue-400`]},{min:0,circle:`text-gray-500`,linear:[`from-gray-500`,`to-gray-400`]}].find(t=>e>=t.min);return n?t===`circle`?[n.circle]:n.linear:t===`circle`?[`text-gray-500`]:[`from-gray-500`,`to-gray-400`]};if(n===`circle`){let n={sm:{circle:100,stroke:6,text:`text-lg`,label:`text-xs`},md:{circle:140,stroke:10,text:`text-xl`,label:`text-sm`},lg:{circle:180,stroke:12,text:`text-2xl`,label:`text-base`}}[r],s=(n.circle-n.stroke)/2,u=s*2*Math.PI;return(0,K.jsxs)(uz,{className:q(`w-auto`,t),children:[(i||a)&&(0,K.jsxs)(dz,{className:`space-y-1`,children:[i&&(0,K.jsx)(fz,{className:`truncate text-base leading-tight font-medium`,children:i}),a&&(0,K.jsx)(pz,{className:`text-muted-foreground text-sm`,children:a})]}),(0,K.jsx)(mz,{className:`grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3`,children:e.map((e,t)=>(0,K.jsx)(aGt,{item:e,config:n,radius:s,circumference:u,progressColor:o,getUsageClasses:l,getStatus:c},e.name||t))})]})}let u={sm:{bar:`h-2`,text:`text-xs`},md:{bar:`h-3`,text:`text-sm`},lg:{bar:`h-4`,text:`text-base`}}[r];return(0,K.jsxs)(uz,{className:q(`w-full max-w-md`,t),children:[(i||a)&&(0,K.jsxs)(dz,{className:`space-y-1`,children:[i&&(0,K.jsx)(fz,{className:`truncate text-base leading-tight font-medium`,children:i}),a&&(0,K.jsx)(pz,{className:`text-muted-foreground text-sm`,children:a})]}),(0,K.jsxs)(mz,{className:`grid grid-cols-1 gap-4`,children:[e.map((e,t)=>(0,K.jsx)(oGt,{item:e,config:u,progressColor:o,getUsageClasses:l,getStatus:c},e.name||t)),(0,K.jsx)(iGt,{})]})]})}async function cGt(){return(await Z(`/api/v1/usage`,{method:`GET`})).data}async function W9(e){await Z(`/api/v1/usage/settings`,{method:`PUT`,body:JSON.stringify(e)})}async function lGt(){return(await Z(`/api/v1/stripe/create-credit-checkout`,{method:`POST`})).data.url}function uGt(){let[e,t]=(0,B.useState)(null),[n,r]=(0,B.useState)(null);return(0,B.useEffect)(()=>{cGt().then(t).catch(e=>r(e.message))},[]),n?(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Failed to load usage data.`}):e?e.plan===`unlimited`?(0,K.jsxs)(`div`,{className:`space-y-5`,children:[(0,K.jsx)(`div`,{className:`rounded-md border bg-muted/40 px-4 py-3 text-sm`,children:`You're on the Unlimited plan â no limits apply.`}),(0,K.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Billing period: `,e.billing_period_start,` â `,e.billing_period_end]})]}):(0,K.jsxs)(`div`,{className:`space-y-5`,children:[(0,K.jsx)(sGt,{usage:e.plan===`free`?[{name:`Messages`,usage:e.message_count,limit:50}]:[{name:`Credits`,usage:Number(e.credits_used.toFixed(2)),limit:Number((e.credits_included??0).toFixed(2))}],title:``,description:``,variant:`linear`,size:`md`,className:`mx-auto`,progressColor:`usage`}),(0,K.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Billing period: `,e.billing_period_start,` â `,e.billing_period_end]})]}):(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Loading usage...`})}var dGt={sm:{bar:`h-2`,text:`text-xs`},md:{bar:`h-3`,text:`text-sm`},lg:{bar:`h-4`,text:`text-base`}};function fGt(e){let t=[{min:90,linear:[`from-red-500`,`to-red-400`]},{min:75,linear:[`from-yellow-500`,`to-yellow-400`]},{min:50,linear:[`from-emerald-500`,`to-emerald-400`]},{min:25,linear:[`from-blue-500`,`to-blue-400`]},{min:0,linear:[`from-gray-500`,`to-gray-400`]}].find(t=>e>=t.min);return t?t.linear:[`from-gray-500`,`to-gray-400`]}function pGt({percentage:e}){let{t}=V();return e>=90?(0,K.jsx)(lR,{variant:`destructive`,children:t(`evaluation.guidance.severity_high`)}):e>=75?(0,K.jsx)(lR,{variant:`secondary`,children:t(`evaluation.guidance.severity_medium`)}):null}function mGt({item:e,size:t=`md`,progressColor:n=`default`,className:r}){let{t:i}=V(),{formatNumber:a}=jb(),o=dGt[t],s=Math.min(e.usage/e.limit*100,100),c=Math.max(e.limit-e.usage,0),l=$N(0),u=tP(rP(l,{stiffness:100,damping:20}),e=>`${Math.round(e)}%`);return(0,B.useEffect)(()=>{l.set(s)},[s,l]),(0,K.jsxs)(`div`,{className:q(`bg-muted/20 space-y-2 rounded-xl p-4`,r),children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.name}),(0,K.jsx)(QN.span,{className:`text-muted-foreground text-xs`,children:u})]}),(0,K.jsx)(`div`,{className:q(`bg-muted w-full overflow-hidden rounded-full`,o.bar),children:(0,K.jsx)(QN.div,{className:q(`rounded-full bg-gradient-to-r`,o.bar,n===`usage`?fGt(s):`from-primary to-primary/70`),initial:{width:0},animate:{width:`${s}%`},transition:{duration:.5,ease:`easeOut`}})}),(0,K.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-between text-xs`,children:[(0,K.jsx)(`span`,{children:i(`settings.usage.remaining_label`,{remaining:a(c),total:a(e.limit)})}),(0,K.jsx)(pGt,{percentage:s})]})]})}function hGt(){let[e,t]=(0,B.useState)(null),[n,r]=(0,B.useState)(!0),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(!1);if((0,B.useEffect)(()=>{cGt().then(e=>{t(e),a((e.monthly_extra_usage_spend_cap??0).toString())}).catch(()=>{}).finally(()=>r(!1))},[]),n||!e)return(0,K.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Loading...`});if(e.plan===`unlimited`)return(0,K.jsx)(`div`,{className:`rounded-md border bg-muted/40 px-4 py-3 text-sm`,children:`You're on the Unlimited plan â extra usage controls don't apply.`});let f=e.monthly_extra_usage_spend_cap??0,p={name:``,usage:e.overage_used??0,limit:f||100};return(0,K.jsxs)(`div`,{className:`space-y-5`,children:[(0,K.jsxs)(`div`,{className:`flex justify-between`,children:[(0,K.jsx)(`div`,{children:`Turn on extra usage`}),(0,K.jsx)(mP,{checked:e.extra_usage_enabled,onCheckedChange:async e=>{d(!0);try{await W9({extra_usage_enabled:e}),t(t=>t&&{...t,extra_usage_enabled:e})}catch(e){console.error(e)}d(!1)},disabled:u})]}),(0,K.jsx)(mGt,{item:p}),(0,K.jsxs)(`div`,{className:`flex justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{children:f>0?`$${f}`:`Unlimited`}),(0,K.jsx)(`div`,{className:`text-muted-foreground`,children:`Monthly spend limit`})]}),(0,K.jsxs)(HC,{open:o,onOpenChange:s,children:[(0,K.jsx)(UC,{asChild:!0,children:(0,K.jsx)(J,{variant:`outline`,children:`Adjust limit`})}),(0,K.jsxs)(WC,{children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:`Set monthly spend limit`}),(0,K.jsx)(JC,{children:`Set a maximum for extra usage spending per month.`})]}),(0,K.jsx)(dP,{value:`$${i}
864`,onChange:e=>a(e.target.value.replace(/[^0-9.]/g,``))}),(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`This spend limit goes into effect immediately`}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`outline`,onClick:async()=>{try{await W9({monthly_extra_usage_spend_cap:0}),t(e=>e&&{...e,monthly_extra_usage_spend_cap:0}),a(`0`)}catch(e){console.error(e)}s(!1)},children:`Set to unlimited`}),(0,K.jsx)(J,{onClick:async()=>{let e=parseFloat(i)||0;try{await W9({monthly_extra_usage_spend_cap:e}),t(t=>t&&{...t,monthly_extra_usage_spend_cap:e})}catch(e){console.error(e)}s(!1)},children:`Set spend limit`})]})]})]})]}),(0,K.jsxs)(`div`,{className:`flex justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{children:[`$`,(e.extra_usage_credits??0).toFixed(2)]}),(0,K.jsx)(`div`,{className:`text-muted-foreground`,children:`Purchased credits balance`})]}),(0,K.jsxs)(HC,{open:c,onOpenChange:l,children:[(0,K.jsx)(UC,{asChild:!0,children:(0,K.jsx)(J,{variant:`outline`,children:`Buy more`})}),(0,K.jsxs)(WC,{children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:`Buy extra usage credits`}),(0,K.jsx)(JC,{children:`Purchase credits to use when your included allowance runs out.`})]}),(0,K.jsx)(tL,{}),(0,K.jsx)(`div`,{className:`space-y-2`,children:(0,K.jsxs)(`div`,{className:`flex justify-between font-medium`,children:[(0,K.jsx)(`span`,{children:`Credit pack`}),(0,K.jsx)(`span`,{children:`$5.00`})]})}),(0,K.jsx)(J,{className:`w-full`,onClick:async()=>{try{let e=await lGt();window.location.href=e}catch(e){console.error(e),l(!1)}},children:`Purchase`}),(0,K.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`You will be redirected to Stripe to complete your purchase.`})]})]})]}),(0,K.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Resets on `,e.billing_period_end]})]})}function G9(e){return WL(t=>t.integrations[e])}function gGt(){let e=navigator.userAgentData?.platform;return e?e===`macOS`:/Mac/.test(navigator.platform)&&navigator.maxTouchPoints<=1}function _Gt(e,t,n){return e?n?{url:n,label:`Download for Apple silicon`,requirement:`macOS 13 or later on Apple silicon (M1 or newer).`}:null:t?{url:t,label:`Download for Windows`,requirement:`Windows 10 or later.`}:null}var K9=`/api/v1/gmail/admin-guide`;function vGt({open:e,onOpenChange:t,errorCode:n}){let[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null);(0,B.useEffect)(()=>{if(!e||r)return;let t=!1;return(async()=>{try{let e=await fetch(`${K9}?format=json`);if(!e.ok)throw Error(`guide fetch failed: ${e.status}`);let n=await e.json();t||i(n)}catch(e){X(e,{operation:`google_admin_guide_fetch`})}})(),()=>{t=!0}},[e,r]);let s=e=>{o(e),setTimeout(()=>o(null),2e3)},c=async()=>{if(r?.client_id)try{await navigator.clipboard.writeText(r.client_id),s(`id`)}catch(e){Y(e,`Could not copy the client ID.`,{operation:`google_admin_guide_copy_id`})}},l=async()=>{try{let e=await fetch(`${K9}?format=txt`);if(!e.ok)throw Error(`guide fetch failed: ${e.status}`);await navigator.clipboard.writeText(await e.text()),s(`text`)}catch(e){Y(e,`Could not copy the instructions.`,{operation:`google_admin_guide_copy_text`})}},u=r?.admin_console_steps??[],d=r?.google_admin_doc_url??`https://support.google.com/a/answer/7281227`;return(0,K.jsx)(HC,{open:e,onOpenChange:t,children:(0,K.jsxs)(WC,{className:`sm:max-w-lg`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsxs)(qC,{className:`flex items-center gap-2`,children:[(0,K.jsx)(F_,{size:18,className:`text-amber-600`}),`Your organization has to approve modInsight`]}),(0,K.jsx)(JC,{children:`Google showed you âThis app is blockedâ because your Google Workspace administrator hasnât approved modInsight yet. This is a domain-wide setting, so it canât be changed from your own account â your IT team has to allow it once, then the connection works for everyone.`})]}),(0,K.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[r?.client_id&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-medium text-gray-700 mb-1`,children:`The one thing IT needs â our OAuth client ID`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`code`,{className:`flex-1 min-w-0 truncate rounded bg-gray-100 px-2 py-1.5 font-mono text-xs text-gray-800`,children:r.client_id}),(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`outline`,onClick:c,className:`shrink-0`,children:a===`id`?(0,K.jsx)(Lg,{size:14}):(0,K.jsx)(Yg,{size:14})})]})]}),u.length>0&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-medium text-gray-700 mb-1`,children:`What they do (about two minutes)`}),(0,K.jsx)(`ol`,{className:`list-decimal pl-5 space-y-1 text-xs text-gray-600`,children:u.map(e=>(0,K.jsx)(`li`,{children:e},e))})]}),(0,K.jsxs)(`a`,{href:d,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-blue-600 hover:underline`,children:[`Googleâs documentation for this setting`,(0,K.jsx)($g,{size:12})]}),n&&(0,K.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[`Google reported: `,(0,K.jsx)(`code`,{className:`font-mono`,children:n})]})]}),(0,K.jsxs)(KC,{className:`sm:justify-start gap-2`,children:[(0,K.jsx)(J,{type:`button`,asChild:!0,children:(0,K.jsxs)(`a`,{href:`${K9}?format=pdf`,download:!0,children:[(0,K.jsx)(Xg,{size:14}),`Download PDF for IT`]})}),(0,K.jsxs)(J,{type:`button`,variant:`outline`,onClick:l,children:[a===`text`?(0,K.jsx)(Lg,{size:14}):(0,K.jsx)(Yg,{size:14}),`Copy as email text`]})]})]})})}var yGt={gmail:{one:`label`,many:`labels`},outlook:{one:`folder`,many:`folders`},imap:{one:`folder`,many:`folders`}};function bGt({provider:e,accountId:t,active:n,onCancel:r,onSaved:i}){let a=Xx(e=>e.accounts),o=$x(e=>e.accounts),s=Qx(e=>e.accounts),c=Xx(e=>e.saveSyncedFolders),l=$x(e=>e.saveSyncedFolders),u=Qx(e=>e.saveSyncedFolders),d=e===`gmail`?a.find(e=>e.id===t)?.synced_label_ids:e===`outlook`?o.find(e=>e.id===t)?.synced_folder_ids:s.find(e=>e.id===t)?.synced_folders,f=e===`gmail`?c:e===`outlook`?l:u,[p,m]=(0,B.useState)([]),[h,g]=(0,B.useState)([]),[_,v]=(0,B.useState)(new Set),[y,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(!1),[C,w]=(0,B.useState)(!1),T=yGt[e],E=(0,B.useCallback)(async()=>{b(!0);try{if(m(e===`gmail`?(await Dhe(`gmail`,{userOnly:!0,accountId:t})).labels.map(e=>({id:e.id,name:e.name,depth:0})):(await Nhe(e,{accountId:t})).folders.map(e=>({id:e.id,name:e.name,depth:e.depth}))),v(new Set(d??[])),e!==`imap`)try{g((await Ohe(e,{accountId:t})).suggestions)}catch{g([])}S(!0)}catch(t){Y(t,`Couldn't load your ${T.many}.`,{operation:`load_synced_folders`,metadata:{provider:e}}
864)}finally{b(!1)}},[e,t,T.many]);(0,B.useEffect)(()=>{n&&!x&&!y&&E()},[n,x,y,E]);let D=e=>{v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},O=async()=>{w(!0);try{await f(t,[..._]),G.success(`Synced ${T.many} updated.`),i?.()}catch(t){Y(t,`Couldn't update your synced ${T.many}.`,{operation:`save_synced_folders`,metadata:{provider:e}})}finally{w(!1)}},k=new Set(p.map(e=>e.id)),A=h.filter(e=>!_.has(e.id)&&k.has(e.id));return(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[`Choose which `,T.many,` to sync in addition to your inbox. Mail filed into these by a server-side rule will be picked up on the next sync.`]}),A.length>0&&(0,K.jsxs)(`div`,{className:`rounded-md border border-violet-200 bg-violet-50 p-2.5 space-y-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-semibold text-violet-800`,children:[(0,K.jsx)(L_,{size:13}),`We found contract mail in `,A.length,` `,A.length===1?`place`:`places`]}),A.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs`,children:[(0,K.jsxs)(`span`,{className:`text-violet-900 truncate`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:e.name}),` `,(0,K.jsxs)(`span`,{className:`text-violet-500`,children:[`(`,e.hit_count,` recent `,e.hit_count===1?`match`:`matches`,`)`]})]}),(0,K.jsx)(J,{size:`xs`,variant:`outline`,className:`shrink-0 border-violet-300 bg-white text-violet-700 hover:bg-violet-100`,onClick:()=>D(e.id),children:`Sync it`})]},e.id))]}),y?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-6 text-gray-400`,children:(0,K.jsx)(W,{size:16,className:`animate-spin`})}):(0,K.jsxs)(`div`,{className:`max-h-64 overflow-y-auto rounded-md border border-gray-100 divide-y divide-gray-50`,children:[(0,K.jsxs)(`label`,{className:`flex items-center gap-2 px-3 py-2 text-sm text-gray-500`,children:[(0,K.jsx)(HB,{checked:!0,disabled:!0}),(0,K.jsx)(l_,{size:14,className:`text-gray-400`}),(0,K.jsx)(`span`,{children:`Inbox`}),(0,K.jsx)(`span`,{className:`ml-auto text-[11px] text-gray-400`,children:`always synced`})]}),p.length===0&&x&&(0,K.jsxs)(`p`,{className:`px-3 py-4 text-xs text-gray-400`,children:[`No additional `,T.many,` found.`]}),p.map(e=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 px-3 py-2 text-sm text-gray-800 hover:bg-gray-50 cursor-pointer`,style:{paddingLeft:12+e.depth*16},children:[(0,K.jsx)(HB,{checked:_.has(e.id),onCheckedChange:()=>D(e.id)}),(0,K.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))]}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[r&&(0,K.jsx)(J,{variant:`outline`,size:`sm`,onClick:r,disabled:C,children:`Cancel`}),(0,K.jsxs)(J,{size:`sm`,onClick:O,disabled:C||y,children:[C?(0,K.jsx)(W,{size:14,className:`animate-spin mr-1.5`}):null,`Save`]})]})]})}var q9=e=>e?new Date(e).toLocaleString():`â`;function J9({label:e,value:t}){return(0,K.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,K.jsx)(`span`,{className:`text-xs text-gray-500 shrink-0`,children:e}),(0,K.jsx)(`span`,{className:`text-xs font-medium text-gray-900 truncate`,children:t})]})}function xGt(){let{t:e}=V(),t=Qx(e=>e.configAccountId),n=Qx(e=>e.closeConfigDialog),r=Qx(e=>e.accounts),i=Qx(e=>e.disconnectCaldav),a=r.find(e=>e.id===t)??null,o=a?.caldav??null,s=t!==null,[c,l]=(0,B.useState)(!1),u=`settings.integrations.imap_config`;return(0,K.jsx)(HC,{open:s,onOpenChange:e=>!e&&n(),children:(0,K.jsxs)(WC,{className:`sm:max-w-lg`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:e(`${u}.title`)}),(0,K.jsx)(JC,{children:e(`${u}.description`)})]}),a&&(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold text-gray-700 uppercase tracking-wide`,children:e(`${u}.mail_section`)}),(0,K.jsx)(J9,{label:e(`${u}.email`),value:a.email}),(0,K.jsx)(J9,{label:e(`${u}.imap_server`),value:`${a.imap_host}:${a.imap_port}${a.imap_use_ssl?` (SSL)`:``}`}),(0,K.jsx)(J9,{label:e(`${u}.smtp_server`),value:`${a.smtp_host}:${a.smtp_port}${a.smtp_use_ssl?` (SSL)`:``}`}),(0,K.jsx)(J9,{label:e(`${u}.username`),value:a.username}),(0,K.jsx)(J9,{label:e(`${u}.password`),value:`â¢â¢â¢â¢â¢â¢â¢â¢`}),(0,K.jsx)(J9,{label:e(`${u}.last_sync`),value:q9(a.last_sync_at)})]}),(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold text-gray-700 uppercase tracking-wide`,children:`Synced folders`}),(0,K.jsx)(bGt,{provider:`imap`,accountId:a.id,active:s},a.id)]}),(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Pg,{size:14,className:`text-gray-500`}),(0,K.jsx)(`p`,{className:`text-xs font-semibold text-gray-700 uppercase tracking-wide`,children:e(`${u}.caldav_section`)}),o&&(o.is_active?(0,K.jsx)(lR,{variant:`outline`,className:`text-green-600 border-green-200 bg-green-50 text-xs`,children:e(`${u}.caldav_active`)}):(0,K.jsx)(lR,{variant:`outline`,className:`text-amber-600 border-amber-200 bg-amber-50 text-xs`,children:e(`${u}.caldav_disabled`)}))]}),!o&&(0,K.jsx)(`p`,{className:`text-xs text-gray-500`,children:e(`${u}.caldav_not_connected`)}),o&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(J9,{label:e(`${u}.caldav_url`),value:o.caldav_url}),o.username&&(0,K.jsx)(J9,{label:e(`${u}.username`),value:o.has_credentials_override?`${o.username} (${e(`${u}
864.caldav_override`)})`:o.username}),(0,K.jsx)(J9,{label:e(`${u}.password`),value:`â¢â¢â¢â¢â¢â¢â¢â¢`}),(0,K.jsx)(J9,{label:e(`${u}.last_sync`),value:q9(o.last_sync_at)}),o.last_failure_reason&&(0,K.jsx)(J9,{label:e(`${u}.last_failure`),value:`${o.last_failure_reason} (${q9(o.last_failure_at)})`}),o.calendars.length>0&&(0,K.jsxs)(`div`,{className:`pt-1 space-y-1`,children:[(0,K.jsx)(`p`,{className:`text-xs text-gray-500`,children:e(`${u}.caldav_collections`)}),o.calendars.map(t=>(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border border-gray-100 px-2 py-1.5`,children:[(0,K.jsx)(`span`,{className:`text-xs text-gray-900 truncate`,children:t.display_name||t.url}),(0,K.jsx)(`span`,{className:`flex items-center gap-1 shrink-0`,children:t.supported_components.filter(e=>e===`VEVENT`||e===`VTODO`).map(t=>(0,K.jsx)(lR,{variant:`outline`,className:`text-[10px] text-gray-500`,children:e(t===`VEVENT`?`${u}.component_events`:`${u}.component_tasks`)},t))})]},t.id))]}),(0,K.jsx)(`div`,{className:`pt-1`,children:(0,K.jsxs)(J,{size:`sm`,variant:`outline`,onClick:async()=>{if(a){l(!0);try{await i(a.id)}catch(t){Y(t,e(`${u}.caldav_disconnect_failed`),{operation:`caldav_disconnect`})}finally{l(!1)}}},disabled:c,className:`text-red-600 hover:text-red-700 hover:bg-red-50`,children:[c?(0,K.jsx)(W,{size:14,className:`animate-spin mr-1.5`}):(0,K.jsx)(U_,{size:14,className:`mr-1.5`}),e(`${u}.caldav_disconnect`)]})})]})]})]}),(0,K.jsx)(KC,{children:(0,K.jsx)(J,{variant:`outline`,onClick:n,children:e(`common.close`)})})]})})}function SGt({target:e,onClose:t}){let n=e!==null,r=e?.provider===`gmail`?`Gmail`:`Outlook`,i=e?.provider===`gmail`?`labels`:`folders`;return(0,K.jsx)(HC,{open:n,onOpenChange:e=>!e&&t(),children:(0,K.jsxs)(WC,{className:`sm:max-w-lg`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsxs)(qC,{children:[`Synced `,r,` `,i]}),(0,K.jsxs)(JC,{children:[`Sync additional `,i,` beyond your inbox for `,e?.email,` so contract mail filed there by a rule still gets reviewed.`]})]}),e&&(0,K.jsx)(bGt,{provider:e.provider,accountId:e.accountId,active:n,onCancel:t,onSaved:t},e.accountId)]})})}function CGt({name:e,icon:t,iconBg:n,isConnected:r,statusLine:i,needsReauth:a,loading:o,onConnect:s,onDisconnect:c,connectLabel:l,reconnectLabel:u,enabled:d=!0,onConfigure:f,configureLabel:p=`Details`}){return(0,K.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-gray-100 p-3${d?``:` opacity-50`}`,title:d?void 0:`Temporarily unavailable`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,K.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-lg ${n}`,children:t}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:e}),!d&&(0,K.jsx)(lR,{variant:`outline`,className:`text-gray-500 border-gray-200 bg-gray-50 text-xs`,children:`Temporarily unavailable`}),d&&r&&a&&(0,K.jsx)(lR,{variant:`outline`,className:`text-amber-600 border-amber-200 bg-amber-50 text-xs`,children:`Reconnect required`}),d&&r&&!a&&(0,K.jsx)(lR,{variant:`outline`,className:`text-green-600 border-green-200 bg-green-50 text-xs`,children:`Connected`})]}),(0,K.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5 truncate`,children:i})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-col items-end gap-1.5 shrink-0`,children:[r&&f&&(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:f,disabled:!d,"aria-label":`${e} ${p.toLowerCase()}`,children:[(0,K.jsx)(N_,{size:14,className:`mr-1.5`}),p]}),!r&&(0,K.jsxs)(J,{type:`button`,size:`sm`,onClick:s,disabled:o||!d,children:[o?(0,K.jsx)(W,{size:14,className:`animate-spin mr-1.5`}):null,l]}),(0,K.jsxs)(`div`,{className:`flex gap-1`,children:[r&&(0,K.jsxs)(J,{type:`button`,size:`xs`,onClick:s,disabled:o||!d,variant:`outline`,className:`text-amber-700 bg-amber-50 border-amber-200 hover:bg-amber-100`,children:[o?(0,K.jsx)(W,{size:14,className:`animate-spin mr-1.5`}):(0,K.jsx)(H_,{size:14,className:`mr-1.5`}),u]}),r&&(0,K.jsxs)(J,{type:`button`,size:`xs`,variant:`outline`,onClick:c,disabled:o||!d,className:`text-red-600 hover:text-red-700 hover:bg-red-50`,children:[o?(0,K.jsx)(W,{size:14,className:`animate-spin mr-1.5`}):(0,K.jsx)(U_,{size:14,className:`mr-1.5`}),`Disconnect`]})]})]})]})}function Y9({name:e,icon:t,iconBg:n,enabled:r,loading:i,accounts:a,maxAccounts:o,emptyLine:s,connectLabel:c,onAdd:l,onReconnect:u,onMakePrimary:d,onDisconnect:f,onConfigure:p,configureLabel:m=`Details`,reauthMessage:h}){let g=a.some(e=>e.needsReauth),_=a.length>=o,v=a.length>1;return(0,K.jsxs)(`div`,{className:`rounded-lg border border-gray-100${r?``:` opacity-50`}`,title:r?void 0:`Temporarily unavailable`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between p-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,K.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-lg ${n}`,children:t}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:e}),!r&&(0,K.jsx)(lR,{variant:`outline`,className:`text-gray-500 border-gray-200 bg-gray-50 text-xs`,children:`Temporarily unavailable`}),r&&g&&(0,K.jsx)(lR,{variant:`outline`,className:`text-amber-600 border-amber-200 bg-amber-50 text-xs`,children:`Reconnect required`}),r&&!g&&a.length>0&&(0,K.jsx)(lR,{variant:`outline`,className:`text-green-600 border-green-200 bg-green-50 text-xs`,children:`Connected`})]}),a.length===0&&(0,K.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5 truncate`,children:s})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-col items-end gap-1 shrink-0`,children:[(0,K.jsxs)(J,{type:`button`,size:`sm`,onClick:l,disabled:i||!r||_,children:[i?(0,K.jsx)(W,{size:14,className:`animate-spin mr-1.5`}):a.length>0?(0,K.jsx)(T_,{size:14,className:`mr-1.5`}):null,a.length>0?`Add account`:c]}),_&&(0,K.jsxs)(`p`,{className:`text-xs text-gray-400 text-right max-w-[16rem]`,children:[`You can connect at most `,o,` accounts. Disconnect one first.`]})]})]}),a.length>0&&(0,K.jsx)(`div`,{className:`border-t border-gray-100 divide-y divide-gray-100`,children:a.map(t=>(0,K.jsx)(`div`,{className:`px-3 py-2.5`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`p`,{className:`text-sm text-gray-900 truncate`,children:t.email}),t.isPrimary&&v&&(0,K.jsx)(lR,{variant:`outline`,className:`text-gray-600 border-gray-200 bg-gray-50 text-xs`,children:`Primary`}),t.needsReauth&&(0,K.jsx)(lR,{variant:`outline`,className:`text-amber-600 border-amber-200 bg-amber-50 text-xs`,children:`Reconnect`})]}),t.needsReauth&&(0,K.jsx)(`p`,{className:`text-xs text-amber-700 mt-0.5`,children:h(t.failureReason)}),t.notAvailable&&(0,K.jsxs)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:[e,` not available on this account.`]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[!t.isPrimary&&v&&(0,K.jsxs)(J,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>d(t),disabled:i||!r,children:[(0,K.jsx)(R_,{size:13,className:`mr-1`}),`Make primary`]}),p&&(0,K.jsxs)(J,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>p(t),disabled:i||!r,"aria-label":`${t.email} ${m.toLowerCase()}`,children:[(0,K.jsx)(N_,{size:13,className:`mr-1`}),m]}),(0,K.jsxs)(J,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>u(t),disabled:i||!r,className:`text-amber-700 bg-amber-50 border-amber-200 hover:bg-amber-100`,children:[(0,K.jsx)(H_,{size:13,className:`mr-1`}),`Reconnect`]}),(0,K.jsxs)(J,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>f(t),disabled:i||!r,className:`text-red-600 hover:text-red-700 hover:bg-red-50`,children:[(0,K.jsx)(U_,{size:13,className:`mr-1`}),`Disconnect`]})]})]})},t.id))})]})}var X9={gmail:{label:`Gmail`,body:`This will permanently delete all data synced from this Google account: ingested emails, contract documents created from email attachments and their analyses, redlines, calendar events, and Google Tasks. This cannot be undone.`},outlook:{label:`Outlook`,body:`This will permanently delete all data synced from this Microsoft account: ingested emails, contract documents created from email attachments and their analyses, redlines, Outlook calendar events, and Outlook (To Do) tasks. This cannot be undone.`},slack:{label:`Slack`,body:`This will permanently delete all data synced from Slack: ingested messages and contract documents created from message attachments. This cannot be undone.`},imap:{label:`IMAP`,body:`This will permanently delete all data synced from this IMAP mailbox: ingested emails, contract documents created from email attachments and their analyses, and any CalDAV calendar events and tasks. This cannot be undone.`}};function wGt(){let{user:e,updateUser:t}=Nx(),[n,r]=(0,B.useState)(null),{accounts:i,primaryAccountId:a,maxAccounts:o,loading:s,error:c,signatureScopeOk:l,fetchStatus:u,connect:d,deleteSyncedData:f,setPrimary:p}=Xx(),{accounts:m,primaryAccountId:h,maxAccounts:g,loading:_,error:v,fetchStatus:y,connect:b,deleteSyncedData:x,setPrimary:S}=$x(),{connected:C,account:w,loading:T,error:E,needsReauth:D,fetchStatus:O,connect:k,deleteSyncedData:A}=vL(),{accounts:j,primaryAccountId:M,maxAccounts:N,loading:P,error:F,fetchStatus:I,openConnectDialog:L,openConfigDialog:ee,deleteSyncedData:R,setPrimary:te}=Qx(),ne=G9(`google`),re=G9(`outlook`),ie=G9(`slack`),z=G9(`imap`),ae=WL(e=>e.recorderWindowsDownloadUrl),oe=WL(e=>e.recorderMacDownloadUrl),se=_Gt(gGt(),ae,oe),ce=sk(e=>e.fetchDocuments),le=Ux(e=>e.clearProviderData),ue=tR(e=>e.clearProviderData),[de,fe]=(0,B.useState)(null),[pe,me]=(0,B.useState)(!1),[he,ge]=(0,B.useState)(null),_e=(e,t)=>
864t===`encryption_mismatch`?`Your stored ${e} credentials can no longer be read. Please reconnect to restore access.`:`Your ${e} connection has expired. Please reconnect to resume syncing.`,ve=i.map(e=>({id:e.id,email:e.gmail_email,isPrimary:e.id===a,needsReauth:!e.is_active,notAvailable:e.mail_service_enabled===!1,failureReason:e.last_failure_reason??null})),ye=m.map(e=>({id:e.id,email:e.outlook_email,isPrimary:e.id===h,needsReauth:!e.is_active,notAvailable:!1,failureReason:e.last_failure_reason??null})),be=j.map(e=>({id:e.id,email:e.email,isPrimary:e.id===M,needsReauth:!e.is_active,notAvailable:!1,failureReason:e.last_failure_reason??null})),xe=i.length>0,Se=(i.find(e=>e.id===a)??i[0])?.gmail_email??``,Ce=async(e,t,n)=>{try{await t(n.id),G.success(`${n.email} is now your primary account.`)}catch(t){Y(t,`Couldn't change the primary account.`,{operation:`set_primary_account`,metadata:{provider:e}})}},we=async()=>{if(!de)return;me(!0);let{provider:e,accountId:t,email:n}=de,r=X9[e].label;try{e===`gmail`?await f(t):e===`outlook`?await x(t):e===`imap`?await R(t):await A(),G.success(`${n??r} disconnected.`),ce(),le(e),ue(e),fe(null)}catch(t){Y(t,`Failed to disconnect ${n??r}.`,{operation:`disconnect_provider`,metadata:{provider:e}})}finally{me(!1)}},Te=e?.preferences,Ee=typeof Te?.max_email_attachments==`number`?Te.max_email_attachments:5,De=typeof Te?.auto_sync_drafts_to_gmail==`boolean`?Te.auto_sync_drafts_to_gmail:!0,Oe=typeof Te?.email_signature==`string`?Te.email_signature:``,[ke,Ae]=(0,B.useState)(Ee),[je,Me]=(0,B.useState)(De),[Ne,Pe]=(0,B.useState)(Oe),[Fe,Ie]=(0,B.useState)(!1),[Le,Re]=(0,B.useState)(!1),ze=async()=>{if(a){Ie(!0);try{let e=(await Z(`/api/v1/gmail/signature?account_id=${encodeURIComponent(a)}`,{method:`GET`})).data.signature??``;e.trim()?(Pe(e),G.success(`Signature imported from Gmail. Review it and save.`)):G.info(`No signature found in your Gmail settings.`)}catch(e){Y(e,`Couldn't import your Gmail signature.`,{operation:`import_gmail_signature`})}finally{Ie(!1)}}};(0,B.useEffect)(()=>{u(),y(),O(),I()},[u,y,O,I]),(0,B.useEffect)(()=>{let e=new URLSearchParams(window.location.search),t=e.get(`google_blocked`);if(t===null)return;r({code:t||null}),e.delete(`google_blocked`);let n=e.toString();window.history.replaceState({},``,`${window.location.pathname}${n?`?${n}`:``}`)},[]);let Be=async()=>{Re(!0);try{let e=(await jx({preferences:{max_email_attachments:ke,auto_sync_drafts_to_gmail:je,email_signature:Ne}})).data;t(e),G.success(`Email preferences saved.`)}catch(e){Y(e,`Failed to save email preferences.`,{operation:`save_email_preferences`})}finally{Re(!1)}},Ve=(0,B.useRef)(Be);Ve.current=Be;let He=ibt();return(0,B.useEffect)(()=>(He((0,K.jsx)(J,{size:`sm`,onClick:()=>Ve.current(),disabled:Le,children:Le?`Savingâ¦`:`Save changes`})),()=>He(null)),[He,Le]),(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-gray-900`,children:`Email integrations`}),(0,K.jsx)(`p`,{className:`text-xs text-gray-500 mt-1`,children:`Connect accounts to enable monitoring and automated contract responses.`})]}),(0,K.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,K.jsx)(Y9,{name:`Gmail`,icon:(0,K.jsx)(__,{size:18,className:`text-orange-600`}),iconBg:`bg-orange-50`,enabled:ne,loading:s,accounts:ve,maxAccounts:o,emptyLine:`No account connected`,connectLabel:`Connect Gmail`,onAdd:()=>d(),onReconnect:e=>d(e.email),onMakePrimary:e=>Ce(`gmail`,p,e),onDisconnect:e=>fe({provider:`gmail`,accountId:e.id,email:e.email}),onConfigure:e=>ge({provider:`gmail`,accountId:e.id,email:e.email}),configureLabel:`Folders`,reauthMessage:e=>_e(`Gmail`,e)}),c&&(0,K.jsx)(`p`,{className:`text-xs text-red-500`,children:c}),ne&&(0,K.jsxs)(`p`,{className:`text-xs text-gray-500 px-1`,children:[`Work account blocked by Google?`,` `,(0,K.jsx)(`button`,{type:`button`,onClick:()=>r({code:null}),className:`underline hover:text-gray-700`,children:`Get the approval steps for your IT admin`})]}),(0,K.jsx)(Y9,{name:`Outlook`,icon:(0,K.jsx)(__,{size:18,className:`text-blue-600`}),iconBg:`bg-blue-50`,enabled:re,loading:_,accounts:ye,maxAccounts:g,emptyLine:`No account connected`,connectLabel:`Connect Outlook`,onAdd:()=>b(),onReconnect:e=>b(e.email),onMakePrimary:e=>Ce(`outlook`,S,e),onDisconnect:e=>fe({provider:`outlook`,accountId:e.id,email:e.email}),onConfigure:e=>ge({provider:`outlook`,accountId:e.id,email:e.email}),configureLabel:`Folders`,reauthMessage:e=>_e(`Outlook`,e)}),v&&(0,K.jsx)(`p`,{className:`text-xs text-red-500`,children:v}),(0,K.jsx)(CGt,{name:`Slack`,icon:(0,K.jsx)(G_t,{className:`text-violet-600`}),iconBg:`bg-violet-50`,isConnected:C,statusLine:C&&w?w.slack_team_name||w.slack_team_id:`No workspace connected`,needsReauth:D,loading:T,onConnect:k,onDisconnect:()=>fe({provider:`slack`,accountId:null,email:null}),connectLabel:`Connect Slack`,reconnectLabel:`Reconnect Slack`,enabled:ie}),E&&(0,K.jsx)(`p`,{className:`text-xs text-red-500`,children:E}),(0,K.jsx)(Y9,{name:`IMAP / SMTP`,icon:(0,K.jsx)(M_,{size:18,className:`text-slate-600`}),iconBg:`bg-slate-100`,enabled:z,loading:P,accounts:be,maxAccounts:N,emptyLine:`No mailbox connected`,connectLabel:`Connect IMAP`,onAdd:()=>L(j.length?`add`:`connect`),onReconnect:e=>
864L(`reconnect`,e.id),onMakePrimary:e=>Ce(`imap`,te,e),onDisconnect:e=>fe({provider:`imap`,accountId:e.id,email:e.email}),onConfigure:e=>ee(e.id),configureLabel:`Details`,reauthMessage:e=>_e(`IMAP`,e)}),F&&(0,K.jsx)(`p`,{className:`text-xs text-red-500`,children:F})]}),se&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(tL,{}),(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-gray-900`,children:`Desktop app`}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-gray-100 p-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,K.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-lg bg-sky-50`,children:(0,K.jsx)(nse,{size:18,className:`text-sky-600`})}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:`modInsight Recorder`}),(0,K.jsxs)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:[`Records Zoom, Microsoft Teams and Google Meet calls on your computer and adds the transcript to modInsight.`,` `,se.requirement]})]})]}),(0,K.jsx)(J,{asChild:!0,size:`sm`,className:`shrink-0`,children:(0,K.jsxs)(`a`,{href:se.url,children:[(0,K.jsx)(Xg,{size:14,className:`mr-1.5`}),se.label]})})]})]}),(0,K.jsx)(tL,{}),(0,K.jsx)(`div`,{children:(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-gray-900`,children:`Email settings`})}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 pr-4`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:`Max email attachments`}),(0,K.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:`Maximum attachments to process per email (1â20)`})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,K.jsx)(J,{size:`icon`,variant:`outline`,className:`size-7 rounded-md`,onClick:()=>Ae(e=>Math.max(1,e-1)),disabled:ke<=1,"aria-label":`Decrease`,children:(0,K.jsx)(tse,{size:14})}),(0,K.jsx)(`span`,{className:`w-8 text-center text-sm font-medium tabular-nums`,children:ke}),(0,K.jsx)(J,{size:`icon`,variant:`outline`,className:`size-7 rounded-md`,onClick:()=>Ae(e=>Math.min(20,e+1)),disabled:ke>=20,"aria-label":`Increase`,children:(0,K.jsx)(T_,{size:14})})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 pr-4`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:`Auto-sync drafts to Gmail`}),(0,K.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:`Save draft edits to Gmail Drafts as you type`})]}),(0,K.jsx)(mP,{checked:je,onCheckedChange:Me})]}),(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:`Email signature`}),(0,K.jsx)(`p`,{className:`text-xs text-gray-500 mt-0.5`,children:`Added to new emails, replies, and AI-drafted responses. Plain text.`})]}),xe&&(l?(0,K.jsxs)(J,{size:`sm`,variant:`outline`,className:`shrink-0`,onClick:ze,disabled:Fe,children:[Fe?(0,K.jsx)(W,{size:14,className:`animate-spin mr-1.5`}):(0,K.jsx)(__,{size:14,className:`mr-1.5`}),`Import from `,Se||`Gmail`]}):(0,K.jsxs)(J,{size:`sm`,variant:`outline`,className:`shrink-0`,onClick:()=>d(Se||void 0),children:[(0,K.jsx)(__,{size:14,className:`mr-1.5`}),`Reconnect to import`]}))]}),(0,K.jsx)(hP,{value:Ne,onChange:e=>Pe(e.target.value),placeholder:`Jane Doe 865General Counsel, Acme Corp 866[email protected]`,rows:4,className:`text-sm`})]}),(0,K.jsx)(HC,{open:de!==null,onOpenChange:e=>!e&&!pe&&fe(null),children:(0,K.jsxs)(WC,{children:[(0,K.jsxs)(GC,{children:[(0,K.jsxs)(qC,{children:[`Disconnect`,` `,de?de.email??X9[de.provider].label:``,`?`]}),(0,K.jsxs)(JC,{className:`pt-2 text-left`,children:[`Are you sure?`,` `,de?X9[de.provider].body:``]})]}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{variant:`outline`,onClick:()=>fe(null),disabled:pe,children:`Cancel`}),(0,K.jsxs)(J,{variant:`destructive`,onClick:we,disabled:pe,children:[pe?(0,K.jsx)(W,{size:14,className:`animate-spin mr-1.5`}):(0,K.jsx)(U_,{size:14,className:`mr-1.5`}),`Disconnect`]})]})]})}),(0,K.jsx)(vGt,{open:n!==null,onOpenChange:e=>!e&&r(null),errorCode:n?.code}),(0,K.jsx)(xGt,{}),(0,K.jsx)(SGt,{target:he,onClose:()=>ge(null)})]})}var TGt=[{value:`email_task_ready`,label:`Email contract analyzed`},{value:`email_task_draft_ready`,label:`Email draft ready`},{value:`evaluation_completed`,label:`Evaluation completed`}],EGt=[{value:`dm`,label:`Direct message`},{value:`channel`,label:`Channel`},{value:`both`,label:`DM + Channel`}],DGt=[{value:`email_task_ready`,label:`Email contract analyzed`},{value:`email_task_draft_ready`,label:`Email draft ready`},{value:`evaluation_completed`,label:`Evaluation completed`}],OGt=[{value:`15`,label:`15 minutes before`},{value:`30`,label:`30 minutes before`},{value:`60`,label:`1 hour before`},{value:`120`,label:`2 hours before`}
866];function kGt(){let{user:e,updateUser:t}=Nx(),n=Sv(),{connected:r,fetchStatus:i,channels:a,fetchChannels:o}=vL(),s=e?.preferences,[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)([`email_task_ready`]),[f,p]=(0,B.useState)(!1),[m,h]=(0,B.useState)(`15`),[g,_]=(0,B.useState)(!1),[v,y]=(0,B.useState)(`08:00`),[b,x]=(0,B.useState)(!1),[S,C]=(0,B.useState)(!1),[w,T]=(0,B.useState)(`dm`),[E,D]=(0,B.useState)([`email_task_ready`]);(0,B.useEffect)(()=>{i()},[i]),(0,B.useEffect)(()=>{r&&o()},[r,o]),(0,B.useEffect)(()=>{if(!s)return;l(!!s.sms_notifications_enabled),Array.isArray(s.sms_event_types)&&d(s.sms_event_types);let e=s.sms_calendar_reminder_minutes;typeof e==`number`?(p(!0),h(String(e))):p(!1);let t=s.sms_daily_recap_time;typeof t==`string`?(_(!0),y(t)):_(!1),C(!!s.slack_notifications_enabled),typeof s.slack_notification_mode==`string`&&T(s.slack_notification_mode),Array.isArray(s.slack_event_types)&&D(s.slack_event_types)},[e,s]);let O=(e,t)=>{d(n=>t?[...n,e]:n.filter(t=>t!==e))},k=async()=>{x(!0);try{let e=(await jx({preferences:{sms_notifications_enabled:c,sms_event_types:u,sms_calendar_reminder_minutes:f?parseInt(m,10):null,sms_daily_recap_time:g?v:null,slack_notifications_enabled:S,slack_notification_mode:w,slack_event_types:E}})).data;t(e),G.success(`Notification preferences saved.`)}catch(e){Y(e,`Failed to save notification preferences.`,{operation:`save_notification_preferences`})}finally{x(!1)}},A=(e,t)=>{D(n=>t?[...n,e]:n.filter(t=>t!==e))};return(0,K.jsxs)(`div`,{className:`space-y-5`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium text-gray-900`,children:`SMS Notifications`}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`Get text messages for important contract events and calendar reminders.`})]}),!e?.phone_number&&(0,K.jsxs)(`div`,{className:`flex items-start gap-2.5 border border-yellow-200 bg-yellow-50 rounded-lg p-3 cursor-pointer`,onClick:()=>n(`/settings/profile`),children:[(0,K.jsx)(H_,{size:14,className:`text-yellow-500 mt-0.5 shrink-0`}),(0,K.jsxs)(`p`,{className:`text-xs text-yellow-700`,children:[`No phone number on file.`,` `,(0,K.jsx)(`span`,{className:`underline`,children:`Add one in Profile settings`}),` to enable SMS.`]})]}),(0,K.jsx)(`div`,{className:`border border-gray-100 rounded-lg p-4`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 uppercase tracking-wide`,children:`Enable SMS Notifications`}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`Master switch for all SMS alerts`})]}),(0,K.jsx)(mP,{checked:c,onCheckedChange:l,disabled:!e?.phone_number})]})}),(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium text-gray-900`,children:`Notify me about`}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1 mb-3`,children:`Choose which events trigger an SMS.`}),(0,K.jsx)(`div`,{className:`space-y-2.5`,children:DGt.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,K.jsx)(HB,{id:`event-${e.value}`,checked:u.includes(e.value),onCheckedChange:t=>O(e.value,!!t),disabled:!c}),(0,K.jsx)(`label`,{htmlFor:`event-${e.value}`,className:`text-sm ${c?`text-gray-700`:`text-gray-400`}`,children:e.label})]},e.value))})]}),(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 uppercase tracking-wide`,children:`Calendar Reminders`}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`SMS reminder before calendar events`})]}),(0,K.jsx)(mP,{checked:f,onCheckedChange:p,disabled:!c})]}),f&&(0,K.jsxs)(vO,{value:m,onValueChange:h,disabled:!c,children:[(0,K.jsx)(bO,{className:`w-48`,children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:OGt.map(e=>(0,K.jsx)(SO,{value:e.value,children:e.label},e.value))})]})]}),(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 uppercase tracking-wide`,children:`Daily Recap`}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`Morning summary of yesterday's activity and today's events`})]}),(0,K.jsx)(mP,{checked:g,onCheckedChange:_,disabled:!c})]}),g&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 mb-1.5 uppercase tracking-wide`,children:`Send at (your local time)`}
866),(0,K.jsx)(dP,{type:`time`,value:v,onChange:e=>y(e.target.value),disabled:!c,className:`w-36 mt-1.5`})]})]}),(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium text-gray-900`,children:`Slack Notifications`}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`Get Slack messages for important contract events.`})]}),!r&&(0,K.jsxs)(`div`,{className:`flex items-start gap-2.5 border border-yellow-200 bg-yellow-50 rounded-lg p-3 cursor-pointer`,onClick:()=>n(`/settings/integrations`),children:[(0,K.jsx)(H_,{size:14,className:`text-yellow-500 mt-0.5 shrink-0`}),(0,K.jsxs)(`p`,{className:`text-xs text-yellow-700`,children:[`No Slack workspace connected.`,` `,(0,K.jsx)(`span`,{className:`underline`,children:`Connect one in Email settings`}),` to enable Slack notifications.`]})]}),(0,K.jsx)(`div`,{className:`border border-gray-100 rounded-lg p-4`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 uppercase tracking-wide`,children:`Enable Slack Notifications`}),(0,K.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`Master switch for all Slack alerts`})]}),(0,K.jsx)(mP,{checked:S,onCheckedChange:C,disabled:!r})]})}),S&&r&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 uppercase tracking-wide`,children:`Notification Mode`}),(0,K.jsxs)(vO,{value:w,onValueChange:T,children:[(0,K.jsx)(bO,{className:`w-48`,children:(0,K.jsx)(yO,{})}),(0,K.jsx)(xO,{children:EGt.map(e=>(0,K.jsx)(SO,{value:e.value,children:e.label},e.value))})]}),(w===`channel`||w===`both`)&&(0,K.jsxs)(vO,{value:a[0]?.id??``,onValueChange:()=>{},children:[(0,K.jsx)(bO,{className:`w-48`,children:(0,K.jsx)(yO,{placeholder:`Select channel`})}),(0,K.jsx)(xO,{children:a.map(e=>(0,K.jsxs)(SO,{value:e.id,children:[`#`,e.name]},e.id))})]})]}),(0,K.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,K.jsx)(pP,{className:`text-xs text-gray-500 uppercase tracking-wide`,children:`Notify me about`}),TGt.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,K.jsx)(HB,{id:`slack-event-${e.value}`,checked:E.includes(e.value),onCheckedChange:t=>A(e.value,!!t)}),(0,K.jsx)(`label`,{htmlFor:`slack-event-${e.value}`,className:`text-sm text-gray-700`,children:e.label})]},e.value))]})]}),(0,K.jsx)(`div`,{className:`flex justify-end`,children:(0,K.jsx)(J,{size:`sm`,onClick:k,disabled:b,children:b?`Savingâ¦`:`Save changes`})})]})}function AGt(e,t,n){let r=0,i=0;for(let a of e.variable??[]){if(!a.key)continue;if(a.key===`baseUrl`){a.value=t;continue}if(!Object.prototype.hasOwnProperty.call(n,a.key))continue;i+=1;let e=n[a.key];e&&(a.value=e,r+=1)}return{filled:r,total:i}}var jGt=`/postman/automation-public-api.postman_collection.json`;function MGt(){let{t:e}=V(),{formatDate:t}=jb(),[n,r]=(0,B.useState)([]),[i,a]=(0,B.useState)(!0),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(null),[f,p]=(0,B.useState)(!1),m=Nx(e=>e.user?.current_org_id??null),h=GL(e=>e.organizations).find(e=>e.id===m)?.name??null,g=(0,B.useCallback)(async()=>{try{r((await Z(`/api/v1/api-keys`)).data)}catch{G.error(e(`toasts.common.load_failed`))}finally{a(!1)}},[e]);(0,B.useEffect)(()=>{g()},[g]);let _=async()=>{if(o.trim()){l(!0);try{d((await Z(`/api/v1/api-keys`,{method:`POST`,body:JSON.stringify({name:o.trim(),org_id:m})})).data.raw_key),s(``),await g(),G.success(e(`toasts.api_keys.created`))}catch{G.error(e(`toasts.api_keys.create_failed`))}finally{l(!1)}}},v=async t=>{try{await Z(`/api/v1/api-keys/${t}`,{method:`DELETE`}),await g(),G.success(e(`toasts.api_keys.deleted`))}catch{G.error(e(`toasts.api_keys.delete_failed`))}},y=t=>{navigator.clipboard.writeText(t),G.success(e(`toasts.api_keys.copied`))},b=Zb()||window.location.origin,x=async()=>{try{return(await Z(`/api/v1/api-keys/sample-resources`)).data}catch(e){return X(e,{operation:`fetchPostmanSampleResources`}),{}}};return(0,K.jsxs)(`div`,{className:`space-y-5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-gray-100 bg-gray-50 px-3 py-2 text-xs text-gray-600`,children:[m?(0,K.jsx)(Mg,{size:14,className:`text-gray-400 shrink-0`}):(0,K.jsx)(K_,{size:14,className:`text-gray-400 shrink-0`}),(0,K.jsx)(`span`,{className:`font-medium text-gray-800`,children:m?h??`â¦`:e(`org.switcher.personal`)})]}),(0,K.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`label`,{className:`text-xs text-gray-500 mb-1.5 block uppercase tracking-wide`,children:e(`settings.api_keys.key_name`)}),(0,K.jsx)(dP,{value:o,onChange:e=>s(e.target.value),placeholder:e(`settings.api_keys.key_name_placeholder`),onKeyDown:e=>e.key===`Enter`&&_()})]}),(0,K.jsxs)(J,{size:`sm`,onClick:_,disabled:c||!o.trim(),children:[(0,K.jsx)(T_,{size:14,className:`mr-1`}),e(c?`settings.api_keys.creating`:`settings.api_keys.create`)]})]}),u&&(0,K.jsxs)(`div`,{className:`rounded-md border border-amber-200 bg-amber-50 p-3`,children:[(0,K.jsx)(`p`,{className:`text-xs font-medium text-amber-800 mb-1.5`,children:e(`settings.api_keys.save_key_warning`)}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`code`,{className:`flex-1 text-xs bg-white border border-amber-200 rounded px-2 py-1.5 font-mono break-all select-all`,children:u}),(0,K.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>y(u),children:(0,K.jsx)(Yg,{size:14})})]}),(0,K.jsx)(J,{size:`sm`,variant:`ghost`,className:`mt-2 text-xs text-amber-600`,onClick:()=>d(null),children:e(`common.close`)})]}),i?(0,K.jsx)(`p`,{className:`text-xs text-gray-400`,children:e(`common.loading`)}):n.length===0?(0,K.jsxs)(`div`,{className:`text-center py-6 text-gray-400`,children:[(0,K.jsx)(Hoe,{size:24,className:`mx-auto mb-2 opacity-40`}),(0,K.jsx)(`p`,{className:`text-xs`,children:e(`settings.api_keys.no_keys`)})]}):(0,K.jsx)(`div`,{className:`space-y-2`,children:n.map(n=>(0,K.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-gray-100 px-3 py-2.5`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-gray-700 truncate`,children:n.name}),(0,K.jsx)(lR,{variant:`outline`,className:n.is_active?`text-green-600 border-green-200 bg-green-50 text-xs`:`text-gray-400 border-gray-200 bg-gray-50 text-xs`,children:n.is_active?e(`settings.integrations.connected`):e(`settings.api_keys.revoked`)}),(0,K.jsx)(lR,{variant:`outline`,className:n.org_id?`text-blue-600 border-blue-200 bg-blue-50 text-xs gap-1`:`text-gray-500 border-gray-200 bg-gray-50 text-xs gap-1`,children:n.org_id?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Mg,{size:10}),n.org_name??`â`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(K_,{size:10}),e(`org.switcher.personal`)]})})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3 mt-0.5`,children:[(0,K.jsxs)(`code`,{className:`text-xs text-gray-400 font-mono`,children:[n.key_prefix,`...`]}),(0,K.jsxs)(`span`,{className:`text-xs text-gray-300`,children:[e(`settings.api_keys.created_at`),` `,t(n.created_at)]}),n.last_used_at&&(0,K.jsxs)(`span`,{className:`text-xs text-gray-300`,children:[e(`settings.api_keys.last_used`),` `,t(n.last_used_at)]})]})]}),n.is_active&&(0,K.jsx)(J,{size:`sm`,variant:`ghost`,className:`text-gray-400 hover:text-red-500`,onClick:()=>v(n.id),children:(0,K.jsx)(V_,{size:14})})]},n.id))}),(0,K.jsx)(tL,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-1.5`,children:[(0,K.jsx)(`h4`,{className:`text-xs font-medium text-gray-500 uppercase tracking-wide`,children:e(`settings.api_keys.example_request`)}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(J,{asChild:!0,variant:`outline`,size:`xs`,children:(0,K.jsxs)(`a`,{href:`${b}/v1/docs`,target:`_blank`,rel:`noopener noreferrer`,children:[e(`settings.api_keys.view_docs`),(0,K.jsx)($g,{size:12})]})}),(0,K.jsxs)(J,{variant:`outline`,size:`xs`,onClick:async()=>{p(!0);try{let[t,n]=await Promise.all([fetch(jGt),x()]);if(!t.ok)throw Error(`postman collection fetch failed: ${t.status} ${t.statusText}`);let r=await t.json(),{filled:i,total:a}=AGt(r,b,n),o=URL.createObjectURL(new Blob([JSON.stringify(r,null,2)],{type:`application/json`})),s=document.createElement(`a`);s.href=o,s.download=jGt.split(`/`).pop()??``,s.click(),URL.revokeObjectURL(o),i<a?G.success(e(`toasts.api_keys.postman_downloaded_partial`,{filled:i,total:a}
866)):G.success(e(`toasts.api_keys.postman_downloaded`))}catch(t){Y(t,e(`toasts.api_keys.postman_failed`),{operation:`downloadPostmanCollection`})}finally{p(!1)}},disabled:f,children:[(0,K.jsx)(Xg,{size:12}),e(`settings.api_keys.download_postman`)]})]})]}),(0,K.jsx)(`code`,{className:`block text-xs bg-gray-50 border border-gray-100 rounded-md p-3 font-mono text-gray-600 whitespace-pre-wrap break-all`,children:`# POST /v1/chat â send a message through the RAG pipeline 867curl ${b}/v1/chat \\ 868 -H "Authorization: Bearer vk_..." \\ 869 -H "Content-Type: application/json" \\ 870 -d '{ 871 "content": "Summarize the indemnification clause", 872 "knowledge_base_id": "optional-kb-uuid", 873 "document_ids": ["optional-doc-uuid"], 874 "model_tier": "fast", 875 "stream": false 876 }'`})]})]})}function NGt(e){return e.last_message_at??e.created_at}function PGt({ticket:e,selected:t,onClick:n}){let{t:r}=V(),i=tQe(e),a=$Ze(e.status),o=e.feedback_content?.trim().split(` 877`)[0]||r(`support.list.no_text`);return(0,K.jsxs)(`button`,{type:`button`,onClick:n,className:q(`w-full border-b px-4 py-3 text-left transition-colors hover:bg-muted/60`,t&&`bg-muted/60`),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:q(`min-w-0 flex-1 truncate text-sm`,i?`font-semibold`:`font-medium`),children:o}),i&&(0,K.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-primary`,"aria-label":r(`support.list.unread`)})]}),(0,K.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-2`,children:[(0,K.jsx)(lR,{variant:`outline`,className:q(`text-[10px]`,a.badgeClass),children:r(a.labelKey)}),(e.message_count??0)>0&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:r(`support.list.message_count`,{count:e.message_count})}),(0,K.jsx)(`span`,{className:`ml-auto text-[10px] text-muted-foreground`,children:Db(NGt(e))})]})]})}function FGt({selectedId:e,onSelect:t}){let{t:n}=V(),r=yL(e=>e.tickets),i=yL(e=>e.ticketsLoaded),a=yL(e=>e.loadingTickets),o=fO(e=>e.openDialog),[s,c]=(0,B.useState)(``),l=s.trim().toLowerCase(),u=l?r.filter(e=>(e.feedback_content??``).toLowerCase().includes(l)):r;return(0,K.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-4 py-2.5`,children:[(0,K.jsx)(dP,{value:s,onChange:e=>c(e.target.value),placeholder:n(`support.list.search_placeholder`),className:`h-8`}),(0,K.jsxs)(J,{type:`button`,size:`sm`,className:`shrink-0`,onClick:()=>o(),children:[(0,K.jsx)(T_,{className:`size-4`}),n(`support.list.new_ticket`)]})]}),(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[a&&!i&&(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(W,{className:`size-5 animate-spin text-muted-foreground`})}),i&&u.length===0&&(0,K.jsx)(`p`,{className:`px-4 py-8 text-center text-xs text-muted-foreground`,children:n(`support.list.no_search_results`)}),u.map(n=>(0,K.jsx)(PGt,{ticket:n,selected:n.id===e,onClick:()=>t(n.id)},n.id))]})]})}function IGt({attachment:e}){let t=XI(e.url);return e.media_type.startsWith(`image/`)?(0,K.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,children:(0,K.jsx)(`img`,{src:t,alt:e.filename??`attachment`,className:`max-h-56 rounded-md border object-contain`})}):e.media_type.startsWith(`video/`)?(0,K.jsx)(`video`,{controls:!0,src:t,className:`max-h-64 w-full rounded-md border`}):(0,K.jsx)(`audio`,{controls:!0,src:t,className:`w-full`})}function LGt({message:e}){let{t}=V(),n=!e.is_staff;return(0,K.jsx)(`div`,{className:q(`flex`,n?`justify-end`:`justify-start`),children:(0,K.jsxs)(`div`,{className:q(`max-w-[80%] rounded-lg px-4 py-2`,n?`bg-primary text-primary-foreground`:`bg-muted`),children:[!n&&(0,K.jsx)(`div`,{className:`mb-0.5 text-[10px] font-semibold text-muted-foreground`,children:t(`support.thread.staff_name`)}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap text-sm`,children:e.body}),(0,K.jsx)(`div`,{className:q(`mt-1 text-[10px]`,n?`text-primary-foreground/70`:`text-muted-foreground`),children:Db(e.created_at)})]})})}function RGt({onDeleted:e}){let{t}=V(),n=yL(e=>e.selectedId),r=yL(e=>e.detail),i=yL(e=>e.messages),a=yL(e=>e.loadingTicket),o=yL(e=>e.sending),s=yL(e=>e.sendMessage),c=yL(e=>e.deleteTicket),[l,u]=(0,B.useState)(``),d=(0,B.useRef)(null);(0,B.useEffect)(()=>{d.current?.scrollIntoView({block:`end`})},[i.length,n]);let f=async()=>{!l.trim()||o||await s(l)&&u(``)},p=async()=>{n&&window.confirm(t(`support.thread.delete_confirm`))&&await c(n)&&e()};if(n===null)return null;if(a||!r)return(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,K.jsx)(W,{className:`size-6 animate-spin text-muted-foreground`})});let m=$Ze(r.status),h=eQe(r.status);return(0,K.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-2.5`,children:[(0,K.jsx)(lR,{variant:`outline`,className:q(`text-[10px]`,m.badgeClass),children:t(m.labelKey)}),(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`support.thread.created`,{date:Tb(r.created_at)})}),r.resolved_at&&(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`support.thread.resolved`,{date:Tb(r.resolved_at)})}),(0,K.jsxs)(UT,{children:[(0,K.jsx)(WT,{asChild:!0,children:(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,className:`ml-auto size-8 text-muted-foreground hover:text-destructive`,"aria-label":t(`support.thread.delete`),onClick:()=>void p(),children:(0,K.jsx)(V_,{className:`size-4`})})}),(0,K.jsx)(GT,{children:t(`support.thread.delete`)})]})]}),(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:[(0,K.jsxs)(`div`,{className:`rounded-lg border bg-muted/30 p-3`,children:[(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Db(r.created_at)})}),r.subject_label&&(0,K.jsx)(`div`,{className:`mt-2 text-xs font-medium text-muted-foreground`,children:t(`support_dialog.about`,{label:r.subject_label})}),r.feedback_content&&(0,K.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap text-sm`,children:r.feedback_content}),(r.attachments?.length??0)>0&&(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:r.attachments.map((e,t)=>(0,K.jsx)(IGt,{attachment:e},t))})]}),i.map(e=>(0,K.jsx)(LGt,{message:e},e.id)),(0,K.jsx)(`div`,{ref:d})]}),h&&(0,K.jsx)(`div`,{className:`border-t border-amber-200 bg-amber-50 px-4 py-2 text-xs text-amber-800 dark:border-amber-900 dark:bg-amber-950 dar
877k:text-amber-200`,children:t(`support.thread.reopen_banner`)}),(0,K.jsxs)(`div`,{className:`flex items-end gap-2 border-t p-3`,children:[(0,K.jsx)(hP,{value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),f())},placeholder:t(`support.thread.reply_placeholder`),rows:2,className:`max-h-40 min-h-9 flex-1 resize-none`}),(0,K.jsx)(J,{type:`button`,size:`icon`,disabled:o||!l.trim(),onClick:()=>void f(),"aria-label":t(`support.thread.send`),children:o?(0,K.jsx)(W,{className:`size-4 animate-spin`}):(0,K.jsx)(hse,{className:`size-4`})})]})]})}var zGt=`support.list-panel-size`;function BGt(){try{let e=localStorage.getItem(zGt),t=e?Number(e):NaN;if(Number.isFinite(t)&&t>15&&t<70)return t}catch{}return 34}function VGt(){let{t:e}=V(),t=yL(e=>e.tickets),n=yL(e=>e.ticketsLoaded),r=yL(e=>e.loadingTickets),i=yL(e=>e.selectedId),a=yL(e=>e.loadTickets),o=yL(e=>e.openTicket),s=fO(e=>e.openDialog),[c,l]=Jv();(0,B.useEffect)(()=>{a()},[a]);let u=c.get(`ticket`);(0,B.useEffect)(()=>{u&&u!==yL.getState().selectedId&&o(u)},[u,o]);let d=e=>{l(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`ticket`):n.set(`ticket`,e),n},{replace:!0})};return r&&!n?(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,K.jsx)(W,{className:`size-6 animate-spin text-muted-foreground`})}):n&&t.length===0?(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-muted-foreground`,children:[(0,K.jsx)(f_,{className:`size-10`}),(0,K.jsxs)(`div`,{className:`text-center`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:e(`support.list.empty_title`)}),(0,K.jsx)(`p`,{className:`mt-1 max-w-sm text-xs`,children:e(`support.list.empty_body`)})]}),(0,K.jsx)(J,{type:`button`,size:`sm`,onClick:()=>s(),children:e(`support.menu.contact`)})]}):(0,K.jsxs)(IH,{orientation:`horizontal`,className:`h-full`,onLayoutChanged:e=>{if(e[0])try{localStorage.setItem(zGt,String(e[0]))}catch{}},children:[(0,K.jsx)(LH,{defaultSize:BGt(),minSize:20,children:(0,K.jsx)(FGt,{selectedId:i,onSelect:e=>{d(e),o(e)}})}),(0,K.jsx)(RH,{}),(0,K.jsx)(LH,{defaultSize:66,minSize:30,children:i===null?(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-muted-foreground`,children:[(0,K.jsx)(f_,{className:`size-8`}),(0,K.jsx)(`p`,{className:`text-sm`,children:e(`support.thread.select_prompt`)})]}):(0,K.jsx)(RGt,{onDeleted:()=>d(null)},i)})]})}function HGt(){return{path:window.location.pathname+window.location.search,build_id:`4187687326cc3f82f30376dff5c9753d7622de33`,user_agent:navigator.userAgent.
877slice(0,512),viewport:`${window.innerWidth}x${window.innerHeight}`,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,org_id:Nx.getState().user?.current_org_id??null}}var UGt=`image/png,image/jpeg,image/webp,image/gif,video/webm,video/mp4,audio/*`;function WGt({attachment:e,onPreview:t}){let{t:n}=V(),r=fO(e=>e.removeAttachment),i=n(`support_dialog.preview_attachment`,{filename:e.filename}),a=(0,K.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),className:`absolute -top-1.5 -right-1.5 rounded-full bg-background border shadow-sm p-0.5 hover:bg-muted`,"aria-label":`Remove ${e.filename}`,children:(0,K.jsx)(J_,{className:`size-3`})});if(e.mediaType.startsWith(`image/`))return(0,K.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:t,title:i,"aria-label":i,className:`block cursor-pointer rounded-md transition-shadow hover:ring-2 hover:ring-ring/50`,children:(0,K.jsx)(`img`,{src:e.previewUrl,alt:e.filename,className:`h-14 w-14 rounded-md border object-cover`})}),a]});let o=e.mediaType.startsWith(`video/`)?Soe:voe;return(0,K.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:t,title:i,"aria-label":i,className:`flex max-w-44 cursor-pointer items-center gap-2 rounded-md border px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:[(0,K.jsx)(o,{className:`size-4 shrink-0 text-muted-foreground`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`text-xs font-medium truncate`,children:e.filename}),(0,K.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:kb(e.blob.size)})]})]}),a]})}function GGt({attachment:e,onClose:t}){let{t:n}=V(),r=fO(e=>e.removeAttachment);return(0,K.jsx)(HC,{open:e!==null,onOpenChange:e=>!e&&t(),children:(0,K.jsx)(WC,{className:`sm:max-w-2xl`,"aria-describedby":void 0,children:e&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(GC,{children:(0,K.jsx)(qC,{className:`truncate pr-6 text-sm font-medium`,children:e.filename})}),e.mediaType.startsWith(`image/`)&&(0,K.jsx)(`img`,{src:e.previewUrl,alt:e.filename,className:`max-h-[70vh] w-full rounded-md border object-contain`}),e.mediaType.startsWith(`video/`)&&(0,K.jsx)(`video`,{controls:!0,src:e.previewUrl,className:`max-h-[70vh] w-full rounded-md border`}),e.mediaType.startsWith(`audio/`)&&(0,K.jsx)(`audio`,{controls:!0,src:e.previewUrl,className:`w-full`}),(0,K.jsx)(KC,{children:(0,K.jsxs)(J,{type:`button`,variant:`outline`,onClick:()=>{t(),r(e.id)},children:[(0,K.jsx)(V_,{className:`size-4`}),n(`support_dialog.remove`)]})})]})})})}function KGt({disabled:e}){let{t}=V(),n=fO(e=>e.pendingAttachments),r=fO(e=>e.addScreenshotToDialog),i=fO(e=>e.addFiles),a=(0,B.useRef)(null),[o,s]=(0,B.useState)(null),c=n.find(e=>e.id===o)??null;return(0,K.jsxs)(`div`,{className:`space-y-2`,children:[n.length>0&&(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2 pt-1`,children:n.map(e=>(0,K.jsx)(WGt,{attachment:e,onPreview:()=>s(e.id)},e.id))}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,disabled:e,onClick:()=>void r(),children:[(0,K.jsx)(Ig,{className:`size-4`}),t(`support_dialog.screenshot`)]}),(0,K.jsxs)(J,{type:`button`,variant:`outline`,size:`sm`,disabled:e,onClick:()=>a.current?.click(),children:[(0,K.jsx)(C_,{className:`size-4`}),t(`support_dialog.attach_files`)]}),(0,K.jsx)(`input`,{ref:a,type:`file`,accept:UGt,multiple:!0,className:`hidden`,onChange:e=>{e.target.files&&i(e.target.files),e.target.value=``}})]}),(0,K.jsx)(GGt,{attachment:c,onClose:()=>s(null)})]})}function qGt(){let{t:e}=V(),t=Sv(),n=fO(e=>e.dialogOpen),r=fO(e=>e.openDialog),i=fO(e=>e.closeDialog),a=fO(e=>e.submitProgress),o=fO(e=>e.subject),s=fO(e=>e.clearSubject),[c,l]=(0,B.useState)(!1),u=(0,B.useRef)(!1);async function d(n){if(u.current)return;u.current=!0,l(!0);let r=n.get(`feedbackContent`),{pendingAttachments:a,setSubmitProgress:o,subject:s}=fO.getState();try{await dge(r||void 0,a.map(e=>({blob:e.blob,kind:e.kind,filename:e.filename})),a.length>0?e=>o(e):void 0,{subject:s?{type:s.type,id:s.id}:null,clientContext:HGt()}),G.success(e(`support_dialog.success`),{action:{label:e(`support_dialog.success_action`),onClick:()=>t(`/settings/support`)}});let n=yL.getState();n.ticketsLoaded&&n.loadTickets(),i()}catch(t){o(null),Y(t,e(`support_dialog.submit_failed`),{operation:`feedback.submit`})}finally{u.current=!1,l(!1)}}return(0,K.jsx)(HC,{open:n,onOpenChange:e=>{if(e){r();return}c||i()},children:(0,K.jsx)(WC,{className:`sm:max-w-md`,children:(0,K.jsxs)(`form`,{action:d,children:[(0,K.jsxs)(GC,{className:`mb-2`,children:[(0,K.jsx)(qC,{children:e(`support_dialog.title`)}),(0,K.jsx)(JC,{children:e(`support_dialog.description`)})]}),(0,K.jsxs)(_z,{children:[o&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsxs)(`div`,{className:`flex w-fit max-w-full items-center gap-1 rounded-md border bg-muted px-2 py-1 text-sm`,children:[(0,K.jsx)(`span`,{className:`truncate`,children:e(`support_dialog.about`,{label:o.label})}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,className:`size-5 shrink-0`,onClick:s,disabled:c,"aria-label":e(`support_dialog.about_remove`),children:(0,K.jsx)(J_,{className:`size-3`})})]}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`support_dialog.about_helper`)})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(pP,{htmlFor:`userFeedback`,children:e(`support_dialog.message_label`)}),(0,K.jsx)(hP,{id:`userFeedback`,name:`feedbackContent`,placeholder:e(o?`support_dialog.about_placeholder`:`support_dialog.placeholder`),rows:5,required:!0}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`support_dialog.helper`)})]}),(0,K.jsx)(KGt,{disabled:c})]}),c&&a!==null&&(0,K.jsx)(`div`,{className:`mt-3 h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,K.jsx)(`div`,{className:`h-full bg-primary transition-all`,style:{width:`${a}%`}})}),(0,K.jsxs)(KC,{className:`mt-4`,children:[(0,K.jsx)(sCe,{asChild:!0,children:(0,K.jsx)(J,{type:`button`,variant:`outline`,disabled:c,
877children:e(`support_dialog.cancel`)})}),(0,K.jsx)(J,{type:`submit`,disabled:c,children:c?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{className:`animate-spin`}),e(`support_dialog.submitting`)]}):e(`support_dialog.submit`)})]})]})})})}function JGt(){let e=Qx(e=>e.dialogOpen),t=Qx(e=>e.dialogMode),n=Qx(e=>e.editingAccountId);return e?(0,K.jsx)(YGt,{},`${t}:${n??``}`):null}function YGt(){let{t:e}=V(),t=Qx(e=>e.dialogMode),n=Qx(e=>e.editingAccountId),r=Qx(e=>e.accounts),i=Qx(e=>e.connect),a=Qx(e=>e.connectCaldav),o=Qx(e=>e.closeConnectDialog),s=t===`reconnect`?r.find(e=>e.id===n)??null:null,c=s?.caldav??null,l=c?.has_credentials_override?c.username??``:``,[u,d]=(0,B.useState)(s?.email??``),[f,p]=(0,B.useState)(s?.username??``),[m,h]=(0,B.useState)(s?s.username!==s.email:!1),[g,_]=(0,B.useState)(``),[v,y]=(0,B.useState)(s?.imap_host??``),[b,x]=(0,B.useState)(s?.imap_port??993),[S,C]=(0,B.useState)(s?.imap_use_ssl??!0),[w,T]=(0,B.useState)(s?.smtp_host??``),[E,D]=(0,B.useState)(s?.smtp_port??465),[O,k]=(0,B.useState)(s?.smtp_use_ssl??!0),[A,j]=(0,B.useState)(c?.caldav_url??``),[M,N]=(0,B.useState)(!!l),[P,F]=(0,B.useState)(l),[I,L]=(0,B.useState)(``),[ee,R]=(0,B.useState)(!1),[te,ne]=(0,B.useState)(null),re=m?f:u,ie=async t=>{t.preventDefault(),ne(null),R(!0);let n;try{n=await i({email:u,username:re||void 0,password:g,imap_host:v,imap_port:b,imap_use_ssl:S,smtp_host:w,smtp_port:E,smtp_use_ssl:O})}catch(t){ne(Kb(t,e(`settings.integrations.imap_dialog.connect_failed`))),R(!1);return}if(A.trim()){let t=P.trim()&&I?{username:P.trim(),password:I}:{};try{await a(n.id,{caldav_url:A.trim(),...t})}catch(t){ne(Kb(t,e(`settings.integrations.imap_dialog.caldav_connect_failed`))),R(!1);return}}R(!1),o()},z=`settings.integrations.imap_dialog`;return(0,K.jsx)(HC,{open:!0,onOpenChange:e=>{!e&&!ee&&o()},children:(0,K.jsxs)(WC,{className:`flex max-h-[calc(100dvh-2rem)] flex-col sm:max-w-lg`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsx)(qC,{children:e(t===`reconnect`?`${z}.title_reconnect`:t===`add`?`${z}.title_add`:`${z}.title`)}),(0,K.jsx)(JC,{children:e(`${z}.description`)})]}),(0,K.jsxs)(`form`,{onSubmit:ie,className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`-mx-6 min-h-0 flex-1 space-y-5 overflow-y-auto px-6`,children:[(0,K.jsxs)(_z,{children:[te&&(0,K.jsx)(`div`,{role:`alert`,className:`rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/40 dark:text-red-400`,children:te}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`imap-email`,children:e(`${z}.email_label`)}),(0,K.jsx)(dP,{id:`imap-email`,type:`email`,autoComplete:`email`,value:u,onChange:e=>d(e.target.value),required:!0,disabled:ee})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`imap-username`,children:e(`${z}.username_label`)}),(0,K.jsx)(dP,{id:`imap-username`,type:`text`,autoComplete:`username`,value:re,onChange:e=>{p(e.target.value),h(!0)},disabled:ee}),(0,K.jsx)(bz,{children:e(`${z}.username_help`)})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`imap-password`,children:e(`${z}.password_label`)}),(0,K.jsx)(dP,{id:`imap-password`,type:`password`,autoComplete:`current-password`,autoFocus:t===`reconnect`,value:g,onChange:e=>_(e.target.value),required:!0,minLength:1,disabled:ee}),(0,K.jsx)(bz,{children:e(`${z}.password_help`)})]})]}),(0,K.jsxs)(hz,{children:[(0,K.jsx)(gz,{children:e(`${z}.incoming_section`)}),(0,K.jsxs)(_z,{children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] gap-3`,children:[(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`imap-host`,children:e(`${z}.host_label`)}),(0,K.jsx)(dP,{id:`imap-host`,type:`text`,placeholder:e(`${z}.host_placeholder`),value:v,onChange:e=>y(e.target.value),required:!0,disabled:ee})]}),(0,K.jsxs)(vz,{className:`w-24`,children:[(0,K.jsx)(yz,{htmlFor:`imap-port`,children:e(`${z}.port_label`)}),(0,K.jsx)(dP,{id:`imap-port`,type:`number`,min:1,max:65535,value:b,onChange:e=>x(Number(e.target.value)),required:!0,disabled:ee})]})]}),(0,K.jsxs)(vz,{orientation:`horizontal`,children:[(0,K.jsx)(mP,{id:`imap-ssl`,checked:S,onCheckedChange:C,disabled:ee}),(0,K.jsx)(yz,{htmlFor:`imap-ssl`,children:e(`${z}.ssl_label`)})]})]})]}),(0,K.jsxs)(hz,{children:[(0,K.jsx)(gz,{children:e(`${z}.outgoing_section`)}),(0,K.jsxs)(_z,{children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] gap-3`,children:[(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`smtp-host`,children:e(`${z}.host_label`)}),(0,K.jsx)(dP,{id:`smtp-host`,type:`text`,placeholder:e(`${z}.smtp_host_placeholder`),value:w,onChange:e=>T(e.target.value),required:!0,disabled:ee})]}),(0,K.jsxs)(vz,{className:`w-24`,children:[(0,K.jsx)(yz,{htmlFor:`smtp-port`,children:e(`${z}.port_label`)}),(0,K.jsx)(dP,{id:`smtp-port`,type:`number`,min:1,max:65535,value:E,onChange:e=>D(Number(e.target.value)),required:!0,disabled:ee})]})]}),(0,K.jsxs)(vz,{orientation:`horizontal`,children:[(0,K.jsx)(mP,{id:`smtp-ssl`,checked:O,onCheckedChange:k,disabled:ee}),(0,K.jsx)(yz,{htmlFor:`smtp-ssl`,children:e(`${z}.ssl_label`)})]})]})]}),(0,K.jsxs)(hz,{children:[(0,K.jsx)(gz,{children:e(`${z}.caldav_section`)}),(0,K.jsxs)(_z,{children:[(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`caldav-url`,children:e(`${z}.caldav_url_label`)}),(0,K.jsx)(dP,{id:`caldav-url`,type:`text`,placeholder:e(`${z}.caldav_url_placeholder`),value:A,onChange:e=>j(e.target.value),disabled:ee}),(0,K.jsx)(bz,{children:e(`${z}.caldav_url_help`)})]}),A.trim()&&(0,K.jsxs)(PI,{open:M,onOpenChange:N,children:[(0,K.jsx)(FI,{asChild:!0,children:(0,K.jsxs)(J,{type:`button`,variant:`ghost`,size:`sm`,className:`px-1 text-xs text-gray-500`,children:[(0,K.jsx)(Vg,{className:`size-3.5`}),e(`${z}.caldav_advanced`)]})}),(0,K.jsxs)(II,{className:`space-y-3 pt-2`,children:[(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`caldav-username`,children:e(`${z}.caldav_username_label`)}),(0,K.jsx)(dP,{id:`caldav-username`,type:`text`,value:P,onChange:e=>F(e.target.value),disabled:ee})]}),(0,K.jsxs)(vz,{children:[(0,K.jsx)(yz,{htmlFor:`caldav-password`,children:e(`${z}.caldav_password_label`)}),(0,K.jsx)(dP,{id:`caldav-password`,type:`password`,autoComplete:`new-password`,value:I,onChange:e=>L(e.target.value),required:!!P.trim(),disabled:ee}),(0,K.jsx)(bz,{children:e(`${z}.caldav_advanced_help`)})]})]})]})]})]})]}),(0,K.jsx)(KC,{children:(0,K.jsxs)(J,{type:`submit`,disabled:ee,children:[ee&&(0,K.jsx)(W,{className:`size-4 animate-spin`}),e(ee?`${z}.verifying`:`${z}.submit`)]})})]})]})})}var XGt=vU(()=>ev(()=>import(`./DocumentSpreadsheetPreview-BJcChBnu.js`),__vite__mapDeps([0,1,2,3]))),ZGt=/\.(xlsx|xls|csv)$/i;function QGt({documentLink:e,onBack:t,backLabel:n,documentId:r,documentName:i}){let{t:a}=V(),[o,s]=(0,B.useState)(!1),c=ZGt.test(i??``);return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`mb-4 flex items-center gap-2`,children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:t,children:[(0,K.jsx)(Tg,{size:14,className:`mr-1`}),(0,K.jsx)(`span`,{className:`text-xs`,children:n})]}),r&&(0,K.jsxs)(J,{size:`sm`,variant:`outline`,onClick:()=>s(!0),className:`gap-1.5`,children:[(0,K.jsx)(P_,{size:14}),(0,K.jsx)(`span`,{className:`text-xs`,children:`Share`})]}),r&&i&&(0,K.jsx)(Tyt,{documentId:r,filename:i,status:`completed`}),r&&(0,K.jsx)(mO,{subject:{type:`document`,id:r,label:a(`report_issue.document`,{filename:Ab(i??a(`common.untitled_document`))})}})]}),e?c?(0,K.jsx)(`div`,{className:`h-[calc(100vh-8rem)] w-full`,children:(0,K.jsx)(B.Suspense,{fallback:(0,K.jsx)(`div`,{className:`flex justify-center pt-8`,children:(0,K.jsx)(W,{className:`h-5 w-5 animate-spin text-muted-foreground`})}),children:(0,K.jsx)(XGt,{previewUrl:e,filename:i??`spreadsheet.xlsx`})})}):(0,K.jsx)(`iframe`,{src:e,className:`w-full h-[calc(100vh-8rem)]`}):(0,K.jsx)(`div`,{className:`flex justify-center pt-8`,children:(0,K.jsx)(W,{className:`h-5 w-5 animate-spin text-muted-foreground`})}),r&&(0,K.jsx)(dR,{resourceType:`document`,resourceId:r,resourceName:i||`this document`,open:o,onOpenChange:s})]})}var $Gt={calendar_event:Fg,task:h_,message:b_};function Z9(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function eKt(e){return e?HI(e)?pXe(e):e:null}function Q9({label:e,children:t,className:n}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:e}),(0,K.jsx)(`span`,{className:q(`text-sm whitespace-pre-wrap break-words`,n),children:t})]})}function tKt({payload:e,onClose:t}){let{t:n}=V(),{formatDate:r,formatTime:i,formatDateTime:a}=jb(),[o,s]=(0,B.useState)(e.completed??!1),[c,l]=(0,B.useState)(!1),u=$Gt[e.kind],d=e.fromSearch?n(`everything_search.back_to_search`):n(`common.close`);function f(){let t=Z9(e.start);if(!t)return null;let a=r(t,`EEE, MMM d, yyyy`);if(e.isAllDay)return`${a} · ${n(`dashboard.all_day`)}`;let o=Z9(e.end);return o?`${a} · ${i(t)} â ${i(o)}`:`${a} · ${i(t)}`}function p(){if(!e.externalLink)return null;let t=e.provider===`outlook`?n(`item_detail.open_in_outlook`):n(`item_detail.open_in_google`);return(0,K.jsx)(J,{asChild:!0,variant:`outline`,size:`sm`,className:`w-fit`,children:(0,K.jsxs)(`a`,{href:e.externalLink,target:`_blank`,rel:`noopener noreferrer`,children:[(0,K.jsx)($g,{size:14,className:`mr-1.5`}),t]})})}async function m(t){if(!(!e.taskId||e.provider!==`google`&&e.provider!==`outlook`)){s(t),l(!0);try{await fx(e.provider,e.taskId,t),e.onStatusChange?.(t)}catch(r){s(!t),Y(r,n(`errors.save_failed`),{operation:`item_detail_toggle_task`,metadata:{taskId:e.taskId,provider:e.provider}})}finally{l(!1)}}}let h=e.kind===`calendar_event`?f():null,g=Z9(e.dueDate),_=Z9(e.receivedAt),v=eKt(e.description);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(J,{size:`sm`,variant:`ghost`,onClick:t,className:`w-fit -ml-2`,children:[(0,K.jsx)(Tg,{size:14,className:`mr-1`}),(0,K.jsx)(`span`,{className:`text-xs`,children:d})]}),(0,K.jsxs)(qC,{className:`flex items-start gap-2`,children:[(0,K.jsx)(u,{className:`mt-0.5 size-4 shrink-0 opacity-70`}),(0,K.jsx)(`span`,{children:e.title||n(`common.untitled`)})]}),(0,K.jsx)(JC,{className:`sr-only`,children:e.kind}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.kind===`calendar_event`&&(0,K.jsxs)(K.Fragment,{children:[h&&(0,K.jsx)(Q9,{label:n(`item_detail.when`),children:h}),e.location&&(0,K.jsx)(Q9,{label:n(`item_detail.location`),children:e.location}),e.status&&(0,K.jsx)(Q9,{label:n(`item_detail.status`),children:e.status}),v&&(0,K.jsx)(Q9,{label:n(`item_detail.details`),className:`max-h-48 overflow-y-scroll`,children:v}),p()]}),e.kind===`task`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,K.jsx)(HB,{checked:o,onCheckedChange:e=>m(e===!0),disabled:c}),(0,K.jsx)(`span`,{className:o?`text-muted-foreground line-through`:``,children:n(`item_detail.mark_complete`)})]}),(0,K.jsx)(Q9,{label:n(`item_detail.due`),children:g?r(g,`MMM d, yyyy`):n(`dashboard.no_due_date`)}),e.status&&(0,K.jsx)(Q9,{label:n(`item_detail.status`),children:e.status}),v&&(0,K.jsx)(Q9,{label:n(`item_detail.details`),children:v}),p()]}),e.kind===`message`&&(0,K.jsxs)(K.Fragment,{children:[e.from&&(0,K.jsx)(Q9,{label:n(`item_detail.from`),children:e.from}),e.channelName&&(0,K.jsx)(Q9,{label:n(`item_detail.channel`),children:e.channelName}),_&&(0,K.jsx)(Q9,{label:n(`item_detail.when`),children:a(_)}),v&&(0,K.jsx)(Q9,{label:n(`item_detail.details`),children:v})]})]})]})}function nKt(){let e=Q(e=>e.itemDetail),t=Q(e=>e.closeItemDetail),n=Q(e=>e.setEverythingSearchOpen);function r(){let r=e?.fromSearch??!1;t(),r&&n(!0)}return(0,K.jsx)(HC,{open:!!e,onOpenChange:e=>{e||r()},children:(0,K.jsx)(WC,{className:`max-w-lg`,children:e&&(0,K.jsx)(tKt,{payload:e,onClose:r},`${e.kind}:${e.taskId??e.title}`)})})}var rKt=3;function iKt(){let e=Q(e=>e.masterQueueOpen),t=Q(e=>
877e.setMasterQueueOpen),n=Sv(),r=Q$(e=>e.fetchFeed),i=Q$(e=>e.snooze),a=Q$(e=>e.dismiss),o=Q$(e=>e.feeds.all),s=B.useMemo(()=>o?.needsNow??[],[o?.needsNow]),c=B.useMemo(()=>o?.comingDue??[],[o?.comingDue]),l=o?.loading??!1,u=o?.loaded??!1,[d,f]=B.useState(`priority`),[p,m]=B.useState(()=>new Set),h=B.useCallback(e=>{m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),[g,_]=B.useState(null),[v,y]=B.useState(0);B.useEffect(()=>{e&&r()},[e,r]);let b=B.useCallback(e=>i(e.key,{}),[i]),x=B.useCallback(e=>a(e,{}),[a]),S=B.useMemo(()=>g?s.filter(e=>e.kind===g):[],[g,s]);B.useEffect(()=>{g&&S.length===0&&(_(null),y(0))},[g,S]);function C(e){t(e),e||(_(null),y(0))}function w(e){qpt(e.href)?window.open(e.href,`_blank`):n(e.href),C(!1)}function T(e){_(e),y(0)}function E(){_(null),y(0)}let D=B.useMemo(()=>{let e=[];for(let t of s)e.includes(t.kind)||e.push(t.kind);return e},[s]),O=B.useMemo(()=>Jpt(s.filter(e=>!p.has(e.kind)),d),[s,p,d]),k=B.useMemo(()=>{let e=new Map;for(let t of s)e.set(t.kind,(e.get(t.kind)??0)+1);return[...e.entries()].filter(([e,t])=>t>=rKt&&!p.has(e)).map(([e,t])=>({kind:e,count:t}))},[s,p]),A=l&&!u,j=g!==null&&S.length>0,M=Math.min(v,S.length-1),N=j?S[M]:null;return(0,K.jsx)(HC,{open:e,onOpenChange:C,children:(0,K.jsxs)(WC,{className:`sm:max-w-2xl`,children:[(0,K.jsxs)(GC,{className:`sr-only`,children:[(0,K.jsx)(qC,{children:`Action queue`}),(0,K.jsx)(JC,{children:`The full ranked list of actions that need you.`})]}),j&&N?(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2 pr-8`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:E,className:`flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,K.jsx)(Tg,{className:`size-3.5`}),`Back to queue`]}),(0,K.jsxs)(`span`,{className:`font-mono text-xs tabular-nums text-muted-foreground`,children:[M+1,` / `,S.length,` ·`,` `,n1[N.kind]??N.kind]})]}),(0,K.jsxs)(`div`,{className:q(`rounded-md border-l-2 bg-muted/40 p-4`,Gpt(N.severity)),children:[N.matter_name?(0,K.jsx)(`p`,{className:`mb-1 font-mono text-[10px] uppercase tracking-wide text-muted-foreground`,children:N.matter_name}):null,(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsx)(`h3`,{className:`text-base font-semibold leading-snug`,children:N.title}),(0,K.jsx)(`span`,{className:q(`shrink-0 font-serif text-2xl leading-none tabular-nums`,Kpt(N.severity)),children:N.age_label})]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:N.reason})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(J,{type:`button`,onClick:()=>w(N),className:`capitalize`,children:N.verb}),(0,K.jsxs)(J,{type:`button`,variant:`outline`,onClick:()=>b(N),children:[(0,K.jsx)(Gae,{className:`size-4`}),`Snooze`]}),(0,K.jsxs)(J,{type:`button`,variant:`outline`,onClick:()=>x(N),children:[(0,K.jsx)(J_,{className:`size-4`}),`Dismiss`]}),(0,K.jsxs)(J,{type:`button`,variant:`ghost`,className:`ml-auto`,disabled:M>=S.length-1,onClick:()=>y(e=>Math.min(e+1,S.length-1)),children:[`Skip`,(0,K.jsx)(Bg,{className:`size-4`})]})]})]}):(0,K.jsx)(`div`,{className:`max-h-[70vh] overflow-y-auto`,children:(0,K.jsxs)(`div`,{className:`space-y-5 pr-8`,children:[A?(0,K.jsx)(i1,{}):null,A?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`space-y-2`,children:[k.length>0?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.18em] text-muted-foreground`,children:`Focus`}),k.map(({kind:e,count:t})=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>T(e),className:`rounded-full border px-2 py-0.5 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground`,children:[`Start review: `,n1[e]??e,` (`,t,`)`]},e))]}):null,(0,K.jsx)(r1,{label:`Needs you now`,items:O,onSnooze:b,onDismiss:x,alwaysShow:!0,headerRight:s.length>0?(0,K.jsx)(Xpt,{sortKey:d,onSortChange:f,kinds:D,hiddenKinds:p,onToggleKind:h}):null,emptyText:s.length===0?`Nothing needs you right now.`:`Nothing matches the filter.`})]}),(0,K.jsx)(r1,{label:`Coming due`,items:c,onSnooze:b,onDismiss:x,alwaysShow:!0,emptyText:`Nothing coming due.`})]})]})})]})})}var aKt={dashboard:`nav.dashboard`,chat:`nav.chat`,vault:`nav.vault`,matters:`nav.matters`,mail:`nav.mail`,booking:`nav.booking_links`,routines:`nav.routines`};function oKt(){let{t:e}=V(),t=Sv(),n=XT(e=>e.sceneId),r=XT(e=>e.mode),i=XT(e=>e.goToScene),a=XT(e=>e.skip),o=XT(e=>e.finish),s=XT(e=>e.closeHelp);if(!n)return null;if(r===`single`)return(0,K.jsxs)(QN.div,{className:`fixed bottom-6 right-6 z-[9001] flex items-center gap-3 rounded-full border bg-background/95 px-4 py-2 shadow-lg backdrop-blur`,initial:{opacity:0,y:12}
877,animate:{opacity:1,y:0},exit:{opacity:0,y:12},transition:{duration:.2},children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:e(aKt[n])}),(0,K.jsx)(J,{type:`button`,size:`sm`,onClick:()=>s(),children:e(`tour.got_it`)})]});let c=tTe(n),l=KT.length,u=qT(n),d=u==null,f=()=>{if(d){o();return}if(!u)return;let e=eTe(u);i(u),t(e.route)},p=u?e(`tour.continue`,{next:e(aKt[u])}):e(`tour.finish`);return(0,K.jsxs)(QN.div,{className:`fixed bottom-6 right-6 z-[9001] flex items-center gap-3 rounded-full border bg-background/95 px-4 py-2 shadow-lg backdrop-blur`,initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:12},transition:{duration:.2},children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:e(`tour.progress`,{current:c+1,total:l})}),(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>void a(),children:e(`tour.skip`)}),(0,K.jsx)(J,{type:`button`,size:`sm`,onClick:f,children:p})]})}function sKt(){let e=XT(e=>e.status),t=XT(e=>e.sceneId),n=XT(e=>e.mode),r=XT(e=>e.goToScene),i=XT(e=>e.closeHelp),a=xv();return(0,B.useEffect)(()=>{if(e!==`active`||n!==`full`)return;let i=JT(a.pathname);i&&i.id!==t&&r(i.id)},[a.pathname,e,t,n,r]),(0,B.useEffect)(()=>{e!==`active`||n!==`single`||JT(a.pathname)?.id!==t&&i()},[a.pathname,e,n,t,i]),e!==`active`||!t?null:(0,K.jsx)(oKt,{})}var cKt=[`text-sm leading-relaxed`,`[&_h1]:mt-6 [&_h1]:mb-3 [&_h1]:text-lg [&_h1]:font-semibold [&_h1]:first:mt-0`,`[&_h2]:mt-6 [&_h2]:mb-3 [&_h2]:text-base [&_h2]:font-semibold [&_h2]:first:mt-0`,`[&_h3]:mt-5 [&_h3]:mb-2 [&_h3]:text-sm [&_h3]:font-semibold`,`[&_p]:my-3`,`[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-6 [&_ul_li]:my-1.5`,`[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-6 [&_ol_li]:my-1.5`,`[&_a]:underline [&_a]:hover:text-primary`,`[&_strong]:font-semibold`,`[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs`].join(` `);function lKt({note:e}){return(0,K.jsx)(`div`,{className:cKt,children:(0,K.jsx)(_I,{remarkPlugins:[NI],components:{a:({href:e,children:t,...n})=>(0,K.jsx)(`a`,{href:e,target:e?.startsWith(`http`)?`_blank`:void 0,rel:e?.startsWith(`http`)?`noopener noreferrer`:void 0,...n,children:t})},children:e.body})})}function uKt(){let{t:e}=V(),t=_L(e=>e.dialogOpen),n=_L(e=>e.activeReleaseId),r=_L(e=>e.closeDialog),i=_L(e=>e.openReleaseNotes),a=FZe(),o=n?a.find(e=>e.id===n)??null:null,s=o?[o]:a;return(0,K.jsx)(HC,{open:t,onOpenChange:e=>{e||r()},children:(0,K.jsxs)(WC,{className:`sm:max-w-2xl`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsxs)(qC,{className:`flex items-center gap-2`,children:[(0,K.jsx)(L_,{className:`size-4 text-primary`}),e(`notifications.release_note.dialog_title`)]}),(0,K.jsx)(JC,{children:e(`notifications.release_note.dialog_subtitle`)})]}),(0,K.jsx)(IL,{className:`max-h-[60vh] pr-4`,children:(0,K.jsx)(`div`,{className:`space-y-8`,children:s.map(e=>(0,K.jsxs)(`article`,{className:`space-y-2`,children:[(0,K.jsxs)(`header`,{children:[(0,K.jsx)(`h3`,{className:`text-base font-semibold`,children:e.title}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.date})]}),(0,K.jsx)(lKt,{note:e})]},e.id))})}),o&&a.length>1&&(0,K.jsx)(`div`,{children:(0,K.jsx)(J,{variant:`link`,className:`h-auto px-0`,onClick:()=>i(),children:e(`notifications.release_note.see_all`)})})]})})}var dKt=v();function fKt(){let{t:e}=V(),[t,n]=(0,B.useState)(null);return(0,B.useEffect)(()=>{let e=0,t=()=>{let e=document.querySelector(`[data-support-anchor]`);return e?(n(e.getBoundingClientRect()),!0):!1},r=()=>{t()||(e=requestAnimationFrame(r))};return r(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[]),t?(0,dKt.createPortal)((0,K.jsxs)(`div`,{className:`pointer-events-none fixed z-[9999] flex -translate-x-1/2 flex-col items-center gap-1`,style:{top:t.bottom+8,left:t.left+t.width/2},children:[(0,K.jsx)(Og,{className:`size-6 animate-bounce text-red-500 drop-shadow`}),(0,K.jsx)(`span`,{className:`rounded-md border bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md`,children:e(`support.intro.arrow`)})]}),document.body):null}function pKt(){let{t:e}=V(),t=aR(e=>e.open),n=aR(e=>e.dismiss),r=aR(e=>e.openTicket),i=aR(e=>e.captureScreenshot),a=aR(e=>e.recordScreen),o=[{icon:Ig,label:e(`support.intro.cap_screenshot`),onClick:i},{icon:Pse,label:e(`support.intro.cap_record`),onClick:a},{icon:$oe,label:e(`support.intro.cap_reply`),onClick:r}];return(0,K.jsxs)(K.Fragment,{children:[t&&(0,K.jsx)(fKt,{}),(0,K.jsx)(HC,{open:t,onOpenChange:e=>{e||n()},children:(0,K.jsxs)(WC,{className:`sm:max-w-md`,children:[(0,K.jsxs)(GC,{children:[(0,K.jsxs)(qC,{className:`flex items-center gap-2`,children:[(0,K.jsx)(f_,{className:`size-4 text-primary`}),e(`support.intro.title`)]}),(0,K.jsx)(JC,{children:e(`support.intro.lead`)})]}),(0,K.jsx)(`ul`,{className:`my-2 space-y-1`,children:o.map(({icon:e,label:t,onClick:n})=>(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:n,className:`flex w-full cursor-pointer items-center gap-3 rounded-md px-2 py-1.5 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground`,children:[(0,K.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:(0,K.jsx)(e,{className:`size-4`})}),t]})},t))}),(0,K.jsxs)(KC,{children:[(0,K.jsx)(J,{type:`button`,variant:`outline`,onClick:n,children:e(`support.intro.dismiss`)}),(0,K.jsx)(J,{type:`button`,onClick:r,children:e(`support.intro.open_ticket`)})]})]})})]})}var mKt=5e3,hKt=5,gKt=3e4,_Kt=6e4;function vKt(){let e=xv(),t=B.useRef(qB(e.pathname)),n=B.useRef(new Map),r=B.useRef(0);B.useEffect(()=>{t.current=qB(e.pathname)},[e.pathname]),B.useEffect(()=>{let e=iR.getState().flush;r.current=Date.now();function i(){let e={};for(let[t,r]of n.current)r>0&&(e[t]=r);return n.current.clear(),e}function a(t){let r=i();Object.keys(r).length!==0&&e(fb(new Date,`yyyy-MM-dd`),r,t).then(e=>{if(!(e||t?.keepalive))for(let[e,t]of Object.entries(r))n.current.set(e,(n.current.get(e)??0)+t)})}let o=()=>{r.current=Date.now()},s=window.setInterval(()=>{if(document.visibilityState!==`visible`||Date.now()-r.current>=_Kt)return;let e=t.current;n.current.set(e,(n.current.get(e)??0)+hKt)},mKt),c=window.setInterval(()=>a(),gKt),l=()=>{o(),document.visibilityState===`hidden`&&a({keepalive:!0})},u=()=>a({keepalive:!0}),d=[`mousemove`,`keydown`,`click`,`wheel`,`touchstart`,`touchmove`];for(let e of d)window.addEventListener(e,o,{passive:!0});return document.addEventListener(`visibilitychange`,l),window.addEventListener(`pagehide`,u),()=>{window.clearInterval(s),window.clearInterval(c);for(let e of d)window.removeEventListener(e,o);document.removeEventListener(`visibilitychange`,l),window.removeEventListener(`pagehide`,u),a()}},[])}var yKt=3e3;function bKt(e){switch(e.type){case`matter`:{let t=Yx.getState().matterDetail;return t&&t.id===e.id?t.name:null}
877case`chat`:{let t=LS.getState().current_conversation;return t&&t.id===e.id?t.title??null:null}case`email_task`:{let t=Ux.getState().selectedTask;return t&&t.id===e.id?t.subject??null:null}case`document`:{let t=Q.getState();return t.docViewerId===e.id?t.docViewerLabel:null}default:return null}}function xKt(){let e=xv();(0,B.useEffect)(()=>{let t=d5e(e.pathname,e.search);if(!t)return;let n=window.setTimeout(()=>{let e=bKt(t),n={resource_type:t.type,resource_id:t.id,label:e,route:t.route};(async()=>{try{await h_e(n)}catch(e){X(e,{operation:`focus_beacon`})}})()},yKt);return()=>window.clearTimeout(n)},[e.pathname,e.search])}function SKt(){let{conversationId:e}=Cv(),t=Sv(),n=LS(e=>e.conversationId),r=LS(e=>e.loadConversation),i=LS(e=>e.startNewConversation);(0,B.useEffect)(()=>{e&&e!==n?r(e):!e&&n&&i()},[e]),(0,B.useEffect)(()=>{n&&n!==e&&t(`/chat/${n}`,{replace:!0})},[n])}var CKt=vU(()=>ev(()=>import(`./ConsolePage-vnu1Gavk.js`),[])),wKt=`22rem`,TKt=`14rem`,EKt=`3.25rem`;function DKt(){return(0,K.jsx)(`div`,{className:`flex min-h-screen items-center justify-center`,children:(0,K.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent`})})}function OKt(){return SKt(),(0,K.jsx)(cZe,{})}function $9({children:e}){let t=Nx(Px),{isLoading:n}=Nx(),r=xv();return n?(0,K.jsx)(DKt,{}):t?(0,K.jsx)(K.Fragment,{children:e}):(0,K.jsx)(kv,{to:`/login?next=${encodeURIComponent(r.pathname+r.search)}`,replace:!0})}function kKt(){let{t:e}=V(),t=Q(e=>e.showDocViewer),n=Q(e=>e.documentLink),r=Q(e=>e.setShowDocViewer),i=Q(e=>e.docViewerFromSearch),a=Q(e=>e.setDocViewerFromSearch),o=Q(e=>e.setEverythingSearchOpen),s=Q(e=>e.docViewerId),c=Q(e=>e.docViewerLabel),l=Q(e=>e.viewDocumentInKB),u=Q(e=>e.setDocViewerTarget),d=Q(e=>e.navRailCollapsed),{connect:f,close:p}=FL();function m(){r(!1),u(null),g(e=>(e.delete(`doc`),e),{replace:!0}),i&&(a(!1),o(!0))}vKt(),xKt(),WB((0,B.useCallback)(()=>{WL.getState().fetchConfig(),Xx.getState().fetchStatus(),$x.getState().fetchStatus(),vL.getState().fetchStatus(),Qx.getState().fetchStatus(),FL.getState().loadNotifications().catch(e=>X(e,{operation:`focus_refresh_notifications`})),FL.getState().checkForNewBuild()},[])),(0,B.useEffect)(()=>(f(),FL.getState().checkForNewBuild(),_L.getState().checkForNewReleases(),()=>p()),[f,p]);let[h,g]=Jv(),_=Sv(),{updateUser:v}=Nx(),y=h.get(`doc`);(0,B.useEffect)(()=>{y&&y!==s&&l(y)},[y]),(0,B.useEffect)(()=>{t&&s&&s!==y&&g(e=>(e.set(`doc`,s),e),{replace:!0})},[t,s]);let b=xv(),x=sv(`/vault/redline/:docId`,b.pathname)?.params.docId??null,S=Ex(e=>e.documentId),C=Ex(e=>e.isRedlineMode),w=Ex(e=>e.isEmbedded),T=Ex(e=>e.enterRedlineMode),E=Ex(e=>e.exitRedlineMode);(0,B.useEffect)(()=>{x&&x!==S?T(x):!x&&(C||S)&&E()},[x]),(0,B.useEffect)(()=>{w||C&&S&&S!==x&&_(`/vault/redline/${S}`,{replace:!0})},[C,S]);let D=h.get(`redlineDoc`);(0,B.useEffect)(()=>{D&&_(`/vault/redline/${D}`,{replace:!0})},[D]),(0,B.useEffect)(()=>{let t=h.get(`settings`),n=h.get(`checkout`)===`success`;t&&n&&(Ax().then(e=>{v(e.data)}),setTimeout(()=>G.success(e(`toasts.post_payment.success`)),100),_(`/settings/billing`,{replace:!0}))},[]),(0,B.useEffect)(()=>{let e=e=>{e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),Q.getState().toggleEverythingSearch()),e.key===`j`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),Q.getState().toggleMasterQueue())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let O=Nx(e=>e.user),k=XT(e=>e.status),A=XT(e=>e.start),j=eL();(0,B.useEffect)(()=>{if(!O||j||k!==`idle`||O.preferences?.onboarding_completed_at)return;let e=O.created_at;if(!e)return;let t=new Date(e).getTime();Date.now()-t>1440*60*1e3||(A(`auto`),window.location.pathname!==`/dashboard`&&_(`/dashboard`))},[O,k,A,j,_]),(0,B.useEffect)(()=>{aR.getState().maybeShow()},[]);let M=b.pathname.startsWith(`/settings`),N=d&&!M?EKt:TKt;return(0,K.jsx)(TZe,{defaultOpen:!0,style:{"--sidebar-width":`calc(${N} + ${wKt})`,"--sidebar-width-icon":N},children:(0,K.jsxs)(t6e,{children:[(0,K.jsx)($3e,{}),(0,K.jsxs)(DZe,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col h-svh`,children:[(0,K.jsx)(B1e,{}),(0,K.jsx)(V1e,{}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,K.jsxs)(Ule,{children:[(0,K.jsx)(jv,{path:`/`,element:(0,K.jsx)(kv,{to:`/dashboard`,replace:!0})}),(0,K.jsx)(jv,{path:`/dashboard`,element:(0,K.jsx)(fvt,{})}),(0,K.jsx)(jv,{path:`/console/:tab?`,element:(0,K.jsx)(B.Suspense,{fallback:(0,K.jsx)(DKt,{}),children:(0,K.jsx)(CKt,{})})}),(0,K.jsx)(jv,{path:`/admin/*`,element:(0,K.jsx)(kv,{to:`/console`,replace:!0})}),(0,K.jsx)(jv,{path:`/booking`,element:(0,K.jsx)(b5e,{})}),(0,K.jsx)(jv,{path:`/booking/:id`,element:(0,K.jsx)(V5e,{})}),(0,K.jsx)(jv,{path:`/routines`,element:(0,K.jsx)(S7e,{})}
877),(0,K.jsx)(jv,{path:`/customers`,element:(0,K.jsx)(Net,{})}),(0,K.jsx)(jv,{path:`/shared`,element:(0,K.jsx)(w7e,{})}),(0,K.jsx)(jv,{path:`/playbook-library`,element:(0,K.jsx)(kv,{to:`/vault/playbooks`,replace:!0})}),(0,K.jsx)(jv,{path:`/evaluations`,element:(0,K.jsx)(kv,{to:`/vault/evaluations`,replace:!0})}),(0,K.jsxs)(jv,{path:`/vault`,element:(0,K.jsx)(pvt,{}),children:[(0,K.jsx)(jv,{index:!0,element:(0,K.jsx)(mvt,{})}),(0,K.jsx)(jv,{path:`playbooks`,element:(0,K.jsx)(Mvt,{})}),(0,K.jsx)(jv,{path:`evaluations`,element:(0,K.jsx)(qvt,{})}),(0,K.jsx)(jv,{path:`prompts`,element:(0,K.jsx)(Qvt,{})}),(0,K.jsx)(jv,{path:`library`,element:(0,K.jsx)(Byt,{})}),(0,K.jsx)(jv,{path:`personas`,element:(0,K.jsx)(Uyt,{})}),(0,K.jsx)(jv,{path:`profiles`,element:(0,K.jsx)(kv,{to:`/vault/personas`,replace:!0})}),(0,K.jsx)(jv,{path:`email-categories`,element:(0,K.jsx)(Yyt,{})}),(0,K.jsx)(jv,{path:`document-categories`,element:(0,K.jsx)($yt,{})}),(0,K.jsx)(jv,{path:`redline/:docId?`,element:(0,K.jsx)(nbt,{})})]}),(0,K.jsx)(jv,{path:`/email`,element:(0,K.jsx)(kv,{to:`/matters`,replace:!0})}),(0,K.jsx)(jv,{path:`/email/*`,element:(0,K.jsx)(kv,{to:`/matters`,replace:!0})}),(0,K.jsx)(jv,{path:`/matters`,element:(0,K.jsx)(Ept,{}),children:(0,K.jsx)(jv,{index:!0,element:(0,K.jsx)(o1,{})})}),(0,K.jsxs)(jv,{path:`/matters/:matterId`,element:(0,K.jsx)(Ept,{}),children:[(0,K.jsx)(jv,{index:!0,element:(0,K.jsx)(o1,{})}),(0,K.jsx)(jv,{path:`overview`,element:(0,K.jsx)(o1,{})}),(0,K.jsx)(jv,{path:`emails`,element:(0,K.jsx)(dmt,{})}),(0,K.jsx)(jv,{path:`resources`,element:(0,K.jsx)(ymt,{})}),(0,K.jsx)(jv,{path:`resources/:resourceType`,element:(0,K.jsx)(ymt,{})}),(0,K.jsx)(jv,{path:`finance`,element:(0,K.jsx)(Tmt,{})}),(0,K.jsx)(jv,{path:`finance/:documentId`,element:(0,K.jsx)(Fmt,{})})]}),(0,K.jsx)(jv,{path:`/email-task`,element:(0,K.jsx)(vpt,{})}),(0,K.jsxs)(jv,{path:`/inbox`,element:(0,K.jsx)(Pht,{}),children:[(0,K.jsx)(jv,{index:!0,element:(0,K.jsx)(kv,{to:`/inbox/inbox`,replace:!0})}),(0,K.jsx)(jv,{path:`:folder`,element:null}),(0,K.jsx)(jv,{path:`:folder/:messageId`,element:null})]}),(0,K.jsx)(jv,{path:`/chat/:conversationId?`,element:(0,K.jsx)(OKt,{})}),(0,K.jsxs)(jv,{path:`/settings`,element:(0,K.jsx)(abt,{}),children:[(0,K.jsx)(jv,{index:!0,element:(0,K.jsx)(kv,{to:`/settings/profile`,replace:!0})}),(0,K.jsx)(jv,{path:`profile`,element:(0,K.jsx)(hbt,{})}),(0,K.jsx)(jv,{path:`organization`,element:(0,K.jsx)(Sbt,{})}),(0,K.jsx)(jv,{path:`billing`,element:(0,K.jsx)(Obt,{})}),(0,K.jsx)(jv,{path:`usage`,element:(0,K.jsx)(uGt,{})}),(0,K.jsx)(jv,{path:`extra-usage`,element:(0,K.jsx)(hGt,{})}),(0,K.jsx)(jv,{path:`integrations`,element:(0,K.jsx)(wGt,{})}),(0,K.jsx)(jv,{path:`notifications`,element:(0,K.jsx)(kGt,{})}),(0,K.jsx)(jv,{path:`api-keys`,element:(0,K.jsx)(MGt,{})}),(0,K.jsx)(jv,{path:`support`,element:(0,K.jsx)(VGt,{})})]})]})})]}),(0,K.jsx)(HC,{open:t,onOpenChange:e=>{e?r(!0):m()},children:(0,K.jsxs)(WC,{className:`w-[95vw] sm:max-w-[1400px] p-4`,children:[(0,K.jsx)(qC,{className:`sr-only`,children:e(`vault.document_viewer`)}),(0,K.jsx)(JC,{className:`sr-only`,children:e(`vault.document_preview_description`)}),(0,K.jsx)(QGt,{documentLink:n,onBack:m,documentId:s,documentName:c,backLabel:e(i?`everything_search.back_to_search`:`common.close`)})]})}),(0,K.jsx)(qGt,{}),(0,K.jsx)(JGt,{}),(0,K.jsx)(nKt,{}),(0,K.jsx)(iKt,{})]})]})})}function AKt(){let{initialize:e}=Nx(),{fetchConfig:t}=WL();return ubt(),(0,B.useEffect)(()=>{e(),t()},[e,t]),(0,K.jsx)(kT,{children:(0,K.jsxs)(yue,{children:[(0,K.jsxs)(Ule,{children:[(0,K.jsx)(jv,{path:`/login`,element:(0,K.jsx)(a6e,{})}),(0,K.jsx)(jv,{path:`/signup`,element:(0,K.jsx)(p6e,{})}),(0,K.jsx)(jv,{path:`/signup/complete`,element:(0,K.jsx)(m6e,{})}),(0,K.jsx)(jv,{path:`/forgot-password`,element:(0,K.jsx)(g6e,{})}),(0,K.jsx)(jv,{path:`/reset-password`,element:(0,K.jsx)(v6e,{})}),(0,K.jsx)(jv,{path:`/desktop-auth`,element:(0,K.jsx)($9,{children:(0,K.jsx)(b6e,{})})}),(0,K.jsx)(jv,{path:`/invite/accept`,element:(0,K.jsx)(x6e,{})}),(0,K.jsx)(jv,{path:`/share/accept`,element:(0,K.jsx)(S6e,{})}),(0,K.jsx)(jv,{path:`/privacy`,element:(0,K.jsx)(Fet,{})}),(0,K.jsx)(jv,{path:`/terms`,element:(0,K.jsx)(Let,{})}),(0,K.jsx)(jv,{path:`/book/:firstName/:meetingTitle/:slug`,element:(0,K.jsx)(K5e,{})}),(0,K.jsx)(jv,{path:`/book/:firstName/:meetingTitle/:slug/confirmed`,element:(0,K.jsx)(q5e,{})}),(0,K.jsx)(jv,{path:`/gmail/callback`,element:(0,K.jsx)($9,{children:(0,K.jsx)(zet,{})})}),(0,K.jsx)(jv,{path:`/outlook/callback`,element:(0,K.jsx)($9,{children:(0,K.jsx)(Bet,{})})}),(0,K.jsx)(jv,{path:`/slack/callback`,element:(0,K.jsx)($9,{children:(0,K.jsx)(Vet,{})})}),(0,K.jsx)(jv,{path:`/*`,element:(0,K.jsx)($9,{children:(0,K.jsx)(kKt,{})})})]}),(0,K.jsx)(sKt,{}),(0,K.jsx)(uKt,{}),(0,K.jsx)(pKt,{}),(0,K.jsx)(hce,{richColors:!0}),!1]})})}var jKt=AKt;window.addEventListener(`vite:preloadError`,e=>{e.preventDefault(),_U()}),window.addEventListener(`unhandledrejection`,e=>{let t=e.reason instanceof Error?e.reason.message:String(e.reason??``);mU.test(t)&&(e.preventDefault(),_U())}),window.addEventListener(`load`,()=>{window.setTimeout(()=>sessionStorage.removeItem(hU),15e3)}),Cie({dsn:`https://144e2ba4c28c014183a8a8a71b7c41ef@o4511337166995456.ingest.us.sentry.io/4511337957425152`,environment:`production`,tunnel:`https://contract-rag-api.onrender.com/api/v1/event-collector`,integrations:[vie(),Zre({maskAllText:!1,blockAllMedia:!0})],tracesSampleRate:.2,tracePropagationTargets:[/^https:\/\/.*\.onrender\.com\/api/,/^\/api/],replaysSessionSampleRate:0,replaysOnErrorSampleRate:1,beforeSend(e,t){let n=t?.originalException,r=n instanceof Error?n.message:typeof n==`string`?n:e.exception?.values?.[0]?.value??``;return mU.test(r)&&gU===0?null:e}}),(0,kie.createRoot)(document.getElementById(`root`)).render((0,K.jsx)(B.StrictMode,{children:(0,K.jsx)(Oie,{fallback:(0,K.jsx)(`div`,{className:`flex min-h-screen items-center justify-center p-8 text-center`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`mb-2 text-xl font-semibold`,children:`Something went wrong.`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The error has been reported. Please reload the page to continue.`}),(0,K.jsxs)(`div`,{className:`mt-4 flex items-center justify-center gap-3`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground hover:bg-primary/90`,children:`Reload page`}),(0,K.jsx)(`a`,{href:`/settings/support`,className:`inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 text-sm font-medium hover:bg-accent hover:text-accent-foreground`,children:`Contact support`})]})]})}),children:(0,K.jsx)(jKt,{})})}));export{JPt as $,E_ as $i,rL as $n,Sw as $r,R4 as $t,KVt as A,Z as Ai,aU as An,RD as Ar,L3 as At,kBt as B,iy as Bi,uz as Bn,bOe as Br,rEt as Bt,LHt as C,s as Ca,wxe as Ci,zft as Cn,xO as Cr,DAt as Ct,UHt as D,Yx as Di,oU as Dn,LD as Dr,i6 as Dt,BHt as E,u as Ea,RS as Ei,iU as En,yO as Er,m6 as Et,RVt as F,jb as Fi,SV as Fn,JOe as Fr,i3 as Ft,e9 as G,Jv as Gi,sR as Gn,EOe as Gr,jTt as Gt,dBt as H,kv as Hi,dz as Hn,VE as Hr,zTt as Ht,IVt as I,fb as Ii,KB as In,qOe as Ir,kEt as It,J7 as J,fce as Ji,UL as Jn,OOe as Jr,ETt as Jt,Bzt as K,ev as Ki,rR as Kn,_Oe as Kr,TTt as Kt,m9 as L,J as Li,VB as Ln,GOe as Lr,r3 as Lt,BVt as M,X as Mi,bV as Mn,wke as Mr,jEt as Mt,zVt as N,Y as Ni,CV as Nn,Ske as Nr,a3 as Nt,JHt as O,Nx as Oi,lU as On,zD as Or,r6 as Ot,LVt as P,Db as Pi,xV as Pn,Cke as Pr,s3 as Pt,P7 as Q,hse as Qi,nL as Qn,TTe as Qr,DTt as Qt,cVt as R,q as Ri,wz as Rn,KOe as Rr,Q4 as Rt,HHt as S,m as Sa,Cxe as Si,Lft as Sn,vO as Sr,TAt as St,WHt as T,f as Ta,cC as Ti,IU as Tn,bO as Tr,uAt as Tt,SBt as U,Sv as Ui,fz as Un,yOe as Ur,NTt as Ut,PBt as V,ry as Vi,mz as Vn,COe as Vr,J4 as Vt,i9 as W,Cv as Wi,lR as W
877n,TOe as Wr,MTt as Wt,H7 as X,H_ as Xi,F1e as Xn,kOe as Xr,B4 as Xt,wRt as Y,G as Yi,P1e as Yn,AOe as Yr,H4 as Yt,F7 as Z,V_ as Zi,M1e as Zn,vOe as Zr,V4 as Zt,uUt as _,wg as _a,Exe as _i,v0 as _n,$O as _r,F6 as _t,QWt as a,d_ as aa,WC as ai,lSt as an,JI as ar,mFt as at,ZHt as b,b as ba,Sxe as bi,_0 as bn,nk as br,S6 as bt,eWt as c,Xg as ca,GC as ci,s2 as cn,II as cr,tFt as ct,XUt as d,Bg as da,RC as di,i2 as dn,pP as dr,YPt as dt,T_ as ea,Iw as ei,L4 as en,oL as er,XPt as et,R9 as f,Rg as fa,BC as fi,r2 as fn,dP as fr,$Ft as ft,lUt as g,Dg as ga,zC as gi,S0 as gn,XO as gr,oIt as gt,mUt as h,Og as ha,FC as hi,Z0 as hn,oP as hr,ZPt as ht,tGt as i,Hoe as ia,HC as ii,h2 as in,XI as ir,sIt as it,VVt as j,Fb as ji,sU as jn,Tke as jr,o3 as jt,tHt as k,Ex as ki,cU as kn,VD as kr,W3 as kt,$Ut as l,Yg as la,qC as li,t2 as ln,FI as lr,iIt as lt,gUt as m,Pg as ma,IC as mi,d2 as mn,sP as mr,F5 as mt,XWt as n,b_ as na,XC as ni,b2 as nn,aL as nr,m7 as nt,$Wt as o,$g as oa,JC as oi,m2 as on,LI as or,uIt as ot,_Ut as p,Lg as pa,LC as pi,e2 as pn,aP as pr,aIt as pt,Y7 as q,mce as qi,N1e as qn,DOe as qr,ATt as qt,eGt as r,W as ra,YC as ri,S2 as rn,hZe as rr,fIt as rt,EWt as s,Zg as sa,KC as si,o2 as sn,PI as sr,dIt as st,IGt as t,C_ as ta,QC as ti,$ as tn,iL as tr,lIt as tt,QUt as u,Vg as ua,VC as ui,c2 as un,mP as ur,P5 as ut,$Ht as v,U as va,Dxe as vi,Nbt as vn,ek as vr,P6 as vt,VHt as w,c as wa,Txe as wi,Rft as wn,SO as wr,wAt as wt,zHt as x,v as xa,bxe as xi,s1 as xn,QO as xr,EAt as xt,QHt as y,V as ya,lC as yi,g0 as yn,ZO as yr,E6 as yt,GBt as z,ay as zi,Tz as zn,wOe as zr,Y4 as zt}; 878//# sourceMappingURL=index-KuU-NHkM.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.