diff --git a/lightrag/api/webui/assets/index-DSVCuARS.js b/lightrag/api/webui/assets/index-CkwV8nfm.js similarity index 98% rename from lightrag/api/webui/assets/index-DSVCuARS.js rename to lightrag/api/webui/assets/index-CkwV8nfm.js index 12a9f30c..a3d82a72 100644 --- a/lightrag/api/webui/assets/index-DSVCuARS.js +++ b/lightrag/api/webui/assets/index-CkwV8nfm.js @@ -22,7 +22,7 @@ var sq=Object.defineProperty;var lq=(e,t,n)=>t in e?sq(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var o_;function hq(){return o_||(o_=1,function(e){function t(G,H){var F=G.length;G.push(H);e:for(;0>>1,L=G[Y];if(0>>1;Ya(P,F))Za(Q,P)?(G[Y]=Q,G[Z]=F,Y=Z):(G[Y]=P,G[j]=F,Y=j);else if(Za(Q,F))G[Y]=Q,G[Z]=F,Y=Z;else break e}}return H}function a(G,H){var F=G.sortIndex-H.sortIndex;return F!==0?F:G.id-H.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],d=[],p=1,g=null,m=3,b=!1,y=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function R(G){for(var H=n(d);H!==null;){if(H.callback===null)r(d);else if(H.startTime<=G)r(d),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(d)}}function O(G){if(v=!1,R(G),!y)if(n(u)!==null)y=!0,W();else{var H=n(d);H!==null&&K(O,H.startTime-G)}}var N=!1,C=-1,_=5,M=-1;function D(){return!(e.unstable_now()-M<_)}function I(){if(N){var G=e.unstable_now();M=G;var H=!0;try{e:{y=!1,v&&(v=!1,T(C),C=-1),b=!0;var F=m;try{t:{for(R(G),g=n(u);g!==null&&!(g.expirationTime>G&&D());){var Y=g.callback;if(typeof Y=="function"){g.callback=null,m=g.priorityLevel;var L=Y(g.expirationTime<=G);if(G=e.unstable_now(),typeof L=="function"){g.callback=L,R(G),H=!0;break t}g===n(u)&&r(u),R(G)}else r(u);g=n(u)}if(g!==null)H=!0;else{var V=n(d);V!==null&&K(O,V.startTime-G),H=!1}}break e}finally{g=null,m=F,b=!1}H=void 0}}finally{H?U():N=!1}}}var U;if(typeof k=="function")U=function(){k(I)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,B=$.port2;$.port1.onmessage=I,U=function(){B.postMessage(null)}}else U=function(){x(I,0)};function W(){N||(N=!0,U())}function K(G,H){C=x(function(){G(e.unstable_now())},H)}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(G){G.callback=null},e.unstable_continueExecution=function(){y||b||(y=!0,W())},e.unstable_forceFrameRate=function(G){0>G||125Y?(G.sortIndex=F,t(d,G),n(u)===null&&G===n(d)&&(v?(T(C),C=-1):v=!0,K(O,F-Y))):(G.sortIndex=L,t(u,G),y||b||(y=!0,W())),G},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(G){var H=m;return function(){var F=m;m=H;try{return G.apply(this,arguments)}finally{m=F}}}}(Zh)),Zh}var i_;function mq(){return i_||(i_=1,Xh.exports=hq()),Xh.exports}var Qh={exports:{}},wn={};/** + */var o_;function hq(){return o_||(o_=1,function(e){function t(G,H){var F=G.length;G.push(H);e:for(;0>>1,L=G[Y];if(0>>1;Ya(P,F))Za(Q,P)?(G[Y]=Q,G[Z]=F,Y=Z):(G[Y]=P,G[j]=F,Y=j);else if(Za(Q,F))G[Y]=Q,G[Z]=F,Y=Z;else break e}}return H}function a(G,H){var F=G.sortIndex-H.sortIndex;return F!==0?F:G.id-H.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],d=[],p=1,g=null,m=3,b=!1,y=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function R(G){for(var H=n(d);H!==null;){if(H.callback===null)r(d);else if(H.startTime<=G)r(d),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(d)}}function O(G){if(v=!1,R(G),!y)if(n(u)!==null)y=!0,W();else{var H=n(d);H!==null&&K(O,H.startTime-G)}}var N=!1,C=-1,_=5,M=-1;function D(){return!(e.unstable_now()-M<_)}function I(){if(N){var G=e.unstable_now();M=G;var H=!0;try{e:{y=!1,v&&(v=!1,T(C),C=-1),b=!0;var F=m;try{t:{for(R(G),g=n(u);g!==null&&!(g.expirationTime>G&&D());){var Y=g.callback;if(typeof Y=="function"){g.callback=null,m=g.priorityLevel;var L=Y(g.expirationTime<=G);if(G=e.unstable_now(),typeof L=="function"){g.callback=L,R(G),H=!0;break t}g===n(u)&&r(u),R(G)}else r(u);g=n(u)}if(g!==null)H=!0;else{var V=n(d);V!==null&&K(O,V.startTime-G),H=!1}}break e}finally{g=null,m=F,b=!1}H=void 0}}finally{H?U():N=!1}}}var U;if(typeof k=="function")U=function(){k(I)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,B=$.port2;$.port1.onmessage=I,U=function(){B.postMessage(null)}}else U=function(){x(I,0)};function W(){N||(N=!0,U())}function K(G,H){C=x(function(){G(e.unstable_now())},H)}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(G){G.callback=null},e.unstable_continueExecution=function(){y||b||(y=!0,W())},e.unstable_forceFrameRate=function(G){0>G||125Y?(G.sortIndex=F,t(d,G),n(u)===null&&G===n(d)&&(v?(T(C),C=-1):v=!0,K(O,F-Y))):(G.sortIndex=L,t(u,G),y||b||(y=!0,W())),G},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(G){var H=m;return function(){var F=m;m=H;try{return G.apply(this,arguments)}finally{m=F}}}}(Zh)),Zh}var i_;function mq(){return i_||(i_=1,Xh.exports=hq()),Xh.exports}var Qh={exports:{}},xn={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ var sq=Object.defineProperty;var lq=(e,t,n)=>t in e?sq(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var s_;function bq(){if(s_)return wn;s_=1;var e=$f();function t(u){var d="https://react.dev/errors/"+u;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Qh.exports=bq(),Qh.exports}/** + */var s_;function bq(){if(s_)return xn;s_=1;var e=$f();function t(u){var d="https://react.dev/errors/"+u;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Qh.exports=bq(),Qh.exports}/** * @license React * react-dom-client.production.js * @@ -45,8 +45,8 @@ var sq=Object.defineProperty;var lq=(e,t,n)=>t in e?sq(e,t,{enumerable:!0,config `);for(S=h=0;hS||X[h]!==re[S]){var ve=` `+X[h].replace(" at new "," at ");return i.displayName&&ve.includes("")&&(ve=ve.replace("",i.displayName)),ve}while(1<=h&&0<=S);break}}}finally{W=!1,Error.prepareStackTrace=f}return(f=i?i.displayName||i.name:"")?B(f):""}function G(i){switch(i.tag){case 26:case 27:case 5:return B(i.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 15:return i=K(i.type,!1),i;case 11:return i=K(i.type.render,!1),i;case 1:return i=K(i.type,!0),i;default:return""}}function H(i){try{var c="";do c+=G(i),i=i.return;while(i);return c}catch(f){return` Error generating stack: `+f.message+` -`+f.stack}}function F(i){var c=i,f=i;if(i.alternate)for(;c.return;)c=c.return;else{i=c;do c=i,c.flags&4098&&(f=c.return),i=c.return;while(i)}return c.tag===3?f:null}function Y(i){if(i.tag===13){var c=i.memoizedState;if(c===null&&(i=i.alternate,i!==null&&(c=i.memoizedState)),c!==null)return c.dehydrated}return null}function L(i){if(F(i)!==i)throw Error(r(188))}function V(i){var c=i.alternate;if(!c){if(c=F(i),c===null)throw Error(r(188));return c!==i?null:i}for(var f=i,h=c;;){var S=f.return;if(S===null)break;var A=S.alternate;if(A===null){if(h=S.return,h!==null){f=h;continue}break}if(S.child===A.child){for(A=S.child;A;){if(A===f)return L(S),i;if(A===h)return L(S),c;A=A.sibling}throw Error(r(188))}if(f.return!==h.return)f=S,h=A;else{for(var z=!1,q=S.child;q;){if(q===f){z=!0,f=S,h=A;break}if(q===h){z=!0,h=S,f=A;break}q=q.sibling}if(!z){for(q=A.child;q;){if(q===f){z=!0,f=A,h=S;break}if(q===h){z=!0,h=A,f=S;break}q=q.sibling}if(!z)throw Error(r(189))}}if(f.alternate!==h)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?i:c}function j(i){var c=i.tag;if(c===5||c===26||c===27||c===6)return i;for(i=i.child;i!==null;){if(c=j(i),c!==null)return c;i=i.sibling}return null}var P=Array.isArray,Z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},oe=[],ae=-1;function ce(i){return{current:i}}function Re(i){0>ae||(i.current=oe[ae],oe[ae]=null,ae--)}function ie(i,c){ae++,oe[ae]=i.current,i.current=c}var Te=ce(null),ne=ce(null),xe=ce(null),Se=ce(null);function be(i,c){switch(ie(xe,c),ie(ne,i),ie(Te,null),i=c.nodeType,i){case 9:case 11:c=(c=c.documentElement)&&(c=c.namespaceURI)?NC(c):0;break;default:if(i=i===8?c.parentNode:c,c=i.tagName,i=i.namespaceURI)i=NC(i),c=OC(i,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}Re(Te),ie(Te,c)}function J(){Re(Te),Re(ne),Re(xe)}function pe(i){i.memoizedState!==null&&ie(Se,i);var c=Te.current,f=OC(c,i.type);c!==f&&(ie(ne,i),ie(Te,f))}function ke(i){ne.current===i&&(Re(Te),Re(ne)),Se.current===i&&(Re(Se),Vl._currentValue=Q)}var he=Object.prototype.hasOwnProperty,Ee=e.unstable_scheduleCallback,se=e.unstable_cancelCallback,Be=e.unstable_shouldYield,je=e.unstable_requestPaint,ye=e.unstable_now,Oe=e.unstable_getCurrentPriorityLevel,ee=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,ze=e.unstable_LowPriority,We=e.unstable_IdlePriority,St=e.log,Tt=e.unstable_setDisableYieldValue,bt=null,et=null;function At(i){if(et&&typeof et.onCommitFiberRoot=="function")try{et.onCommitFiberRoot(bt,i,void 0,(i.current.flags&128)===128)}catch{}}function st(i){if(typeof St=="function"&&Tt(i),et&&typeof et.setStrictMode=="function")try{et.setStrictMode(bt,i)}catch{}}var wt=Math.clz32?Math.clz32:zt,Ht=Math.log,pn=Math.LN2;function zt(i){return i>>>=0,i===0?32:31-(Ht(i)/pn|0)|0}var sr=128,Vr=4194304;function Jt(i){var c=i&42;if(c!==0)return c;switch(i&-i){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: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 i&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function pa(i,c){var f=i.pendingLanes;if(f===0)return 0;var h=0,S=i.suspendedLanes,A=i.pingedLanes,z=i.warmLanes;i=i.finishedLanes!==0;var q=f&134217727;return q!==0?(f=q&~S,f!==0?h=Jt(f):(A&=q,A!==0?h=Jt(A):i||(z=q&~z,z!==0&&(h=Jt(z))))):(q=f&~S,q!==0?h=Jt(q):A!==0?h=Jt(A):i||(z=f&~z,z!==0&&(h=Jt(z)))),h===0?0:c!==0&&c!==h&&!(c&S)&&(S=h&-h,z=c&-c,S>=z||S===32&&(z&4194176)!==0)?c:h}function Xe(i,c){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&c)===0}function yt(i,c){switch(i){case 1:case 2:case 4:case 8:return c+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+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 Nt(){var i=sr;return sr<<=1,!(sr&4194176)&&(sr=128),i}function Dn(){var i=Vr;return Vr<<=1,!(Vr&62914560)&&(Vr=4194304),i}function _n(i){for(var c=[],f=0;31>f;f++)c.push(i);return c}function Ln(i,c){i.pendingLanes|=c,c!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function ga(i,c,f,h,S,A){var z=i.pendingLanes;i.pendingLanes=f,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=f,i.entangledLanes&=f,i.errorRecoveryDisabledLanes&=f,i.shellSuspendCounter=0;var q=i.entanglements,X=i.expirationTimes,re=i.hiddenUpdates;for(f=z&~f;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),e$=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]*$"),OA={},IA={};function t$(i){return he.call(IA,i)?!0:he.call(OA,i)?!1:e$.test(i)?IA[i]=!0:(OA[i]=!0,!1)}function cu(i,c,f){if(t$(c))if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":i.removeAttribute(c);return;case"boolean":var h=c.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(c);return}}i.setAttribute(c,""+f)}}function uu(i,c,f){if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttribute(c,""+f)}}function ma(i,c,f,h){if(h===null)i.removeAttribute(f);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(f);return}i.setAttributeNS(c,f,""+h)}}function lr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function DA(i){var c=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function n$(i){var c=DA(i)?"checked":"value",f=Object.getOwnPropertyDescriptor(i.constructor.prototype,c),h=""+i[c];if(!i.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var S=f.get,A=f.set;return Object.defineProperty(i,c,{configurable:!0,get:function(){return S.call(this)},set:function(z){h=""+z,A.call(this,z)}}),Object.defineProperty(i,c,{enumerable:f.enumerable}),{getValue:function(){return h},setValue:function(z){h=""+z},stopTracking:function(){i._valueTracker=null,delete i[c]}}}}function du(i){i._valueTracker||(i._valueTracker=n$(i))}function LA(i){if(!i)return!1;var c=i._valueTracker;if(!c)return!0;var f=c.getValue(),h="";return i&&(h=DA(i)?i.checked?"true":"false":i.value),i=h,i!==f?(c.setValue(i),!0):!1}function fu(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var r$=/[\n"\\]/g;function cr(i){return i.replace(r$,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function qp(i,c,f,h,S,A,z,q){i.name="",z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?i.type=z:i.removeAttribute("type"),c!=null?z==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+lr(c)):i.value!==""+lr(c)&&(i.value=""+lr(c)):z!=="submit"&&z!=="reset"||i.removeAttribute("value"),c!=null?Vp(i,z,lr(c)):f!=null?Vp(i,z,lr(f)):h!=null&&i.removeAttribute("value"),S==null&&A!=null&&(i.defaultChecked=!!A),S!=null&&(i.checked=S&&typeof S!="function"&&typeof S!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?i.name=""+lr(q):i.removeAttribute("name")}function MA(i,c,f,h,S,A,z,q){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.type=A),c!=null||f!=null){if(!(A!=="submit"&&A!=="reset"||c!=null))return;f=f!=null?""+lr(f):"",c=c!=null?""+lr(c):f,q||c===i.value||(i.value=c),i.defaultValue=c}h=h??S,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=q?i.checked:!!h,i.defaultChecked=!!h,z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"&&(i.name=z)}function Vp(i,c,f){c==="number"&&fu(i.ownerDocument)===i||i.defaultValue===""+f||(i.defaultValue=""+f)}function Di(i,c,f,h){if(i=i.options,c){c={};for(var S=0;S=ul),YA=" ",KA=!1;function XA(i,c){switch(i){case"keyup":return O$.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ZA(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Fi=!1;function D$(i,c){switch(i){case"compositionend":return ZA(c);case"keypress":return c.which!==32?null:(KA=!0,YA);case"textInput":return i=c.data,i===YA&&KA?null:i;default:return null}}function L$(i,c){if(Fi)return i==="compositionend"||!rg&&XA(i,c)?(i=GA(),gu=Qp=Ya=null,Fi=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:f,offset:c-i};i=h}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=o1(f)}}function s1(i,c){return i&&c?i===c?!0:i&&i.nodeType===3?!1:c&&c.nodeType===3?s1(i,c.parentNode):"contains"in i?i.contains(c):i.compareDocumentPosition?!!(i.compareDocumentPosition(c)&16):!1:!1}function l1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var c=fu(i.document);c instanceof i.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)i=c.contentWindow;else break;c=fu(i.document)}return c}function ig(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c&&(c==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||c==="textarea"||i.contentEditable==="true")}function G$(i,c){var f=l1(c);c=i.focusedElem;var h=i.selectionRange;if(f!==c&&c&&c.ownerDocument&&s1(c.ownerDocument.documentElement,c)){if(h!==null&&ig(c)){if(i=h.start,f=h.end,f===void 0&&(f=i),"selectionStart"in c)c.selectionStart=i,c.selectionEnd=Math.min(f,c.value.length);else if(f=(i=c.ownerDocument||document)&&i.defaultView||window,f.getSelection){f=f.getSelection();var S=c.textContent.length,A=Math.min(h.start,S);h=h.end===void 0?A:Math.min(h.end,S),!f.extend&&A>h&&(S=h,h=A,A=S),S=i1(c,A);var z=i1(c,h);S&&z&&(f.rangeCount!==1||f.anchorNode!==S.node||f.anchorOffset!==S.offset||f.focusNode!==z.node||f.focusOffset!==z.offset)&&(i=i.createRange(),i.setStart(S.node,S.offset),f.removeAllRanges(),A>h?(f.addRange(i),f.extend(z.node,z.offset)):(i.setEnd(z.node,z.offset),f.addRange(i)))}}for(i=[],f=c;f=f.parentNode;)f.nodeType===1&&i.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c=document.documentMode,zi=null,sg=null,gl=null,lg=!1;function c1(i,c,f){var h=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;lg||zi==null||zi!==fu(h)||(h=zi,"selectionStart"in h&&ig(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),gl&&pl(gl,h)||(gl=h,h=td(sg,"onSelect"),0>=z,S-=z,ba=1<<32-wt(c)+S|f<Qe?(ln=Ye,Ye=null):ln=Ye.sibling;var kt=fe(le,Ye,ue[Qe],Ae);if(kt===null){Ye===null&&(Ye=ln);break}i&&Ye&&kt.alternate===null&&c(le,Ye),te=A(kt,te,Qe),ut===null?Ge=kt:ut.sibling=kt,ut=kt,Ye=ln}if(Qe===ue.length)return f(le,Ye),xt&&Ho(le,Qe),Ge;if(Ye===null){for(;QeQe?(ln=Ye,Ye=null):ln=Ye.sibling;var ho=fe(le,Ye,kt.value,Ae);if(ho===null){Ye===null&&(Ye=ln);break}i&&Ye&&ho.alternate===null&&c(le,Ye),te=A(ho,te,Qe),ut===null?Ge=ho:ut.sibling=ho,ut=ho,Ye=ln}if(kt.done)return f(le,Ye),xt&&Ho(le,Qe),Ge;if(Ye===null){for(;!kt.done;Qe++,kt=ue.next())kt=Ce(le,kt.value,Ae),kt!==null&&(te=A(kt,te,Qe),ut===null?Ge=kt:ut.sibling=kt,ut=kt);return xt&&Ho(le,Qe),Ge}for(Ye=h(Ye);!kt.done;Qe++,kt=ue.next())kt=me(Ye,le,Qe,kt.value,Ae),kt!==null&&(i&&kt.alternate!==null&&Ye.delete(kt.key===null?Qe:kt.key),te=A(kt,te,Qe),ut===null?Ge=kt:ut.sibling=kt,ut=kt);return i&&Ye.forEach(function(iq){return c(le,iq)}),xt&&Ho(le,Qe),Ge}function Vt(le,te,ue,Ae){if(typeof ue=="object"&&ue!==null&&ue.type===u&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case s:e:{for(var Ge=ue.key;te!==null;){if(te.key===Ge){if(Ge=ue.type,Ge===u){if(te.tag===7){f(le,te.sibling),Ae=S(te,ue.props.children),Ae.return=le,le=Ae;break e}}else if(te.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===k&&A1(Ge)===te.type){f(le,te.sibling),Ae=S(te,ue.props),El(Ae,ue),Ae.return=le,le=Ae;break e}f(le,te);break}else c(le,te);te=te.sibling}ue.type===u?(Ae=ei(ue.props.children,le.mode,Ae,ue.key),Ae.return=le,le=Ae):(Ae=qu(ue.type,ue.key,ue.props,null,le.mode,Ae),El(Ae,ue),Ae.return=le,le=Ae)}return z(le);case l:e:{for(Ge=ue.key;te!==null;){if(te.key===Ge)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){f(le,te.sibling),Ae=S(te,ue.children||[]),Ae.return=le,le=Ae;break e}else{f(le,te);break}else c(le,te);te=te.sibling}Ae=uh(ue,le.mode,Ae),Ae.return=le,le=Ae}return z(le);case k:return Ge=ue._init,ue=Ge(ue._payload),Vt(le,te,ue,Ae)}if(P(ue))return qe(le,te,ue,Ae);if(C(ue)){if(Ge=C(ue),typeof Ge!="function")throw Error(r(150));return ue=Ge.call(ue),rt(le,te,ue,Ae)}if(typeof ue.then=="function")return Vt(le,te,Au(ue),Ae);if(ue.$$typeof===b)return Vt(le,te,Gu(le,ue),Ae);Ru(le,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(f(le,te.sibling),Ae=S(te,ue),Ae.return=le,le=Ae):(f(le,te),Ae=ch(ue,le.mode,Ae),Ae.return=le,le=Ae),z(le)):f(le,te)}return function(le,te,ue,Ae){try{Sl=0;var Ge=Vt(le,te,ue,Ae);return $i=null,Ge}catch(Ye){if(Ye===yl)throw Ye;var ut=br(29,Ye,null,le.mode);return ut.lanes=Ae,ut.return=le,ut}finally{}}}var qo=R1(!0),C1=R1(!1),qi=ce(null),Cu=ce(0);function _1(i,c){i=_a,ie(Cu,i),ie(qi,c),_a=i|c.baseLanes}function mg(){ie(Cu,_a),ie(qi,qi.current)}function bg(){_a=Cu.current,Re(qi),Re(Cu)}var gr=ce(null),Yr=null;function Xa(i){var c=i.alternate;ie(en,en.current&1),ie(gr,i),Yr===null&&(c===null||qi.current!==null||c.memoizedState!==null)&&(Yr=i)}function N1(i){if(i.tag===22){if(ie(en,en.current),ie(gr,i),Yr===null){var c=i.alternate;c!==null&&c.memoizedState!==null&&(Yr=i)}}else Za()}function Za(){ie(en,en.current),ie(gr,gr.current)}function va(i){Re(gr),Yr===i&&(Yr=null),Re(en)}var en=ce(0);function _u(i){for(var c=i;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===i)break;for(;c.sibling===null;){if(c.return===null||c.return===i)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var W$=typeof AbortController<"u"?AbortController:function(){var i=[],c=this.signal={aborted:!1,addEventListener:function(f,h){i.push(h)}};this.abort=function(){c.aborted=!0,i.forEach(function(f){return f()})}},Y$=e.unstable_scheduleCallback,K$=e.unstable_NormalPriority,tn={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yg(){return{controller:new W$,data:new Map,refCount:0}}function wl(i){i.refCount--,i.refCount===0&&Y$(K$,function(){i.controller.abort()})}var xl=null,vg=0,Vi=0,Wi=null;function X$(i,c){if(xl===null){var f=xl=[];vg=0,Vi=Th(),Wi={status:"pending",value:void 0,then:function(h){f.push(h)}}}return vg++,c.then(O1,O1),c}function O1(){if(--vg===0&&xl!==null){Wi!==null&&(Wi.status="fulfilled");var i=xl;xl=null,Vi=0,Wi=null;for(var c=0;cA?A:8;var z=D.T,q={};D.T=q,Pg(i,!1,c,f);try{var X=S(),re=D.S;if(re!==null&&re(q,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ve=Z$(X,h);Al(i,c,ve,Zn(i))}else Al(i,c,h,Zn(i))}catch(Ce){Al(i,c,{then:function(){},status:"rejected",reason:Ce},Zn())}finally{Z.p=A,D.T=z}}function n6(){}function Lg(i,c,f,h){if(i.tag!==5)throw Error(r(476));var S=lR(i).queue;sR(i,S,c,Q,f===null?n6:function(){return cR(i),f(h)})}function lR(i){var c=i.memoizedState;if(c!==null)return c;c={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:Q},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:f},next:null},i.memoizedState=c,i=i.alternate,i!==null&&(i.memoizedState=c),c}function cR(i){var c=lR(i).next.queue;Al(i,c,{},Zn())}function Mg(){return En(Vl)}function uR(){return Xt().memoizedState}function dR(){return Xt().memoizedState}function r6(i){for(var c=i.return;c!==null;){switch(c.tag){case 24:case 3:var f=Zn();i=no(f);var h=ro(c,i,f);h!==null&&(On(h,c,f),_l(h,c,f)),c={cache:yg()},i.payload=c;return}c=c.return}}function a6(i,c,f){var h=Zn();f={lane:h,revertLane:0,action:f,hasEagerState:!1,eagerState:null,next:null},zu(i)?pR(c,f):(f=dg(i,c,f,h),f!==null&&(On(f,i,h),gR(f,c,h)))}function fR(i,c,f){var h=Zn();Al(i,c,f,h)}function Al(i,c,f,h){var S={lane:h,revertLane:0,action:f,hasEagerState:!1,eagerState:null,next:null};if(zu(i))pR(c,S);else{var A=i.alternate;if(i.lanes===0&&(A===null||A.lanes===0)&&(A=c.lastRenderedReducer,A!==null))try{var z=c.lastRenderedState,q=A(z,f);if(S.hasEagerState=!0,S.eagerState=q,Wn(q,z))return Eu(i,c,S,0),Lt===null&&Su(),!1}catch{}finally{}if(f=dg(i,c,S,h),f!==null)return On(f,i,h),gR(f,c,h),!0}return!1}function Pg(i,c,f,h){if(h={lane:2,revertLane:Th(),action:h,hasEagerState:!1,eagerState:null,next:null},zu(i)){if(c)throw Error(r(479))}else c=dg(i,f,h,2),c!==null&&On(c,i,2)}function zu(i){var c=i.alternate;return i===ct||c!==null&&c===ct}function pR(i,c){Yi=Ou=!0;var f=i.pending;f===null?c.next=c:(c.next=f.next,f.next=c),i.pending=c}function gR(i,c,f){if(f&4194176){var h=c.lanes;h&=i.pendingLanes,f|=h,c.lanes=f,_r(i,f)}}var Kr={readContext:En,use:Lu,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useLayoutEffect:Wt,useInsertionEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useSyncExternalStore:Wt,useId:Wt};Kr.useCacheRefresh=Wt,Kr.useMemoCache=Wt,Kr.useHostTransitionStatus=Wt,Kr.useFormState=Wt,Kr.useActionState=Wt,Kr.useOptimistic=Wt;var Yo={readContext:En,use:Lu,useCallback:function(i,c){return zn().memoizedState=[i,c===void 0?null:c],i},useContext:En,useEffect:J1,useImperativeHandle:function(i,c,f){f=f!=null?f.concat([i]):null,Pu(4194308,4,nR.bind(null,c,i),f)},useLayoutEffect:function(i,c){return Pu(4194308,4,i,c)},useInsertionEffect:function(i,c){Pu(4,2,i,c)},useMemo:function(i,c){var f=zn();c=c===void 0?null:c;var h=i();if(Wo){st(!0);try{i()}finally{st(!1)}}return f.memoizedState=[h,c],h},useReducer:function(i,c,f){var h=zn();if(f!==void 0){var S=f(c);if(Wo){st(!0);try{f(c)}finally{st(!1)}}}else S=c;return h.memoizedState=h.baseState=S,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:S},h.queue=i,i=i.dispatch=a6.bind(null,ct,i),[h.memoizedState,i]},useRef:function(i){var c=zn();return i={current:i},c.memoizedState=i},useState:function(i){i=_g(i);var c=i.queue,f=fR.bind(null,ct,c);return c.dispatch=f,[i.memoizedState,f]},useDebugValue:Ig,useDeferredValue:function(i,c){var f=zn();return Dg(f,i,c)},useTransition:function(){var i=_g(!1);return i=sR.bind(null,ct,i.queue,!0,!1),zn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,c,f){var h=ct,S=zn();if(xt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=c(),Lt===null)throw Error(r(349));vt&60||F1(h,c,f)}S.memoizedState=f;var A={value:f,getSnapshot:c};return S.queue=A,J1(B1.bind(null,h,A,i),[i]),h.flags|=2048,Xi(9,z1.bind(null,h,A,f,c),{destroy:void 0},null),f},useId:function(){var i=zn(),c=Lt.identifierPrefix;if(xt){var f=ya,h=ba;f=(h&~(1<<32-wt(h)-1)).toString(32)+f,c=":"+c+"R"+f,f=Iu++,0 title"))),mn(A,h,f),A[Sn]=i,an(A),h=A;break e;case"link":var z=UC("link","href",S).get(h+(f.href||""));if(z){for(var q=0;q<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof h.is=="string"?S.createElement("select",{is:h.is}):S.createElement("select"),h.multiple?i.multiple=!0:h.size&&(i.size=h.size);break;default:i=typeof h.is=="string"?S.createElement(f,{is:h.is}):S.createElement(f)}}i[Sn]=c,i[Pn]=h;e:for(S=c.child;S!==null;){if(S.tag===5||S.tag===6)i.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===c)break e;for(;S.sibling===null;){if(S.return===null||S.return===c)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}c.stateNode=i;e:switch(mn(i,f,h),f){case"button":case"input":case"select":case"textarea":i=!!h.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ra(c)}}return Bt(c),c.flags&=-16777217,null;case 6:if(i&&c.stateNode!=null)i.memoizedProps!==h&&Ra(c);else{if(typeof h!="string"&&c.stateNode===null)throw Error(r(166));if(i=xe.current,hl(c)){if(i=c.stateNode,f=c.memoizedProps,h=null,S=Nn,S!==null)switch(S.tag){case 27:case 5:h=S.memoizedProps}i[Sn]=c,i=!!(i.nodeValue===f||h!==null&&h.suppressHydrationWarning===!0||_C(i.nodeValue,f)),i||$o(c)}else i=rd(i).createTextNode(h),i[Sn]=c,c.stateNode=i}return Bt(c),null;case 13:if(h=c.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(S=hl(c),h!==null&&h.dehydrated!==null){if(i===null){if(!S)throw Error(r(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[Sn]=c}else ml(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Bt(c),S=!1}else Or!==null&&(yh(Or),Or=null),S=!0;if(!S)return c.flags&256?(va(c),c):(va(c),null)}if(va(c),c.flags&128)return c.lanes=f,c;if(f=h!==null,i=i!==null&&i.memoizedState!==null,f){h=c.child,S=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(S=h.alternate.memoizedState.cachePool.pool);var A=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(A=h.memoizedState.cachePool.pool),A!==S&&(h.flags|=2048)}return f!==i&&f&&(c.child.flags|=8192),Vu(c,c.updateQueue),Bt(c),null;case 4:return J(),i===null&&_h(c.stateNode.containerInfo),Bt(c),null;case 10:return xa(c.type),Bt(c),null;case 19:if(Re(en),S=c.memoizedState,S===null)return Bt(c),null;if(h=(c.flags&128)!==0,A=S.rendering,A===null)if(h)Pl(S,!1);else{if(qt!==0||i!==null&&i.flags&128)for(i=c.child;i!==null;){if(A=_u(i),A!==null){for(c.flags|=128,Pl(S,!1),i=A.updateQueue,c.updateQueue=i,Vu(c,i),c.subtreeFlags=0,i=f,f=c.child;f!==null;)rC(f,i),f=f.sibling;return ie(en,en.current&1|2),c.child}i=i.sibling}S.tail!==null&&ye()>Wu&&(c.flags|=128,h=!0,Pl(S,!1),c.lanes=4194304)}else{if(!h)if(i=_u(A),i!==null){if(c.flags|=128,h=!0,i=i.updateQueue,c.updateQueue=i,Vu(c,i),Pl(S,!0),S.tail===null&&S.tailMode==="hidden"&&!A.alternate&&!xt)return Bt(c),null}else 2*ye()-S.renderingStartTime>Wu&&f!==536870912&&(c.flags|=128,h=!0,Pl(S,!1),c.lanes=4194304);S.isBackwards?(A.sibling=c.child,c.child=A):(i=S.last,i!==null?i.sibling=A:c.child=A,S.last=A)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=ye(),c.sibling=null,i=en.current,ie(en,h?i&1|2:i&1),c):(Bt(c),null);case 22:case 23:return va(c),bg(),h=c.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(c.flags|=8192):h&&(c.flags|=8192),h?f&536870912&&!(c.flags&128)&&(Bt(c),c.subtreeFlags&6&&(c.flags|=8192)):Bt(c),f=c.updateQueue,f!==null&&Vu(c,f.retryQueue),f=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),h=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(h=c.memoizedState.cachePool.pool),h!==f&&(c.flags|=2048),i!==null&&Re(Vo),null;case 24:return f=null,i!==null&&(f=i.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),xa(tn),Bt(c),null;case 25:return null}throw Error(r(156,c.tag))}function d6(i,c){switch(pg(c),c.tag){case 1:return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 3:return xa(tn),J(),i=c.flags,i&65536&&!(i&128)?(c.flags=i&-65537|128,c):null;case 26:case 27:case 5:return ke(c),null;case 13:if(va(c),i=c.memoizedState,i!==null&&i.dehydrated!==null){if(c.alternate===null)throw Error(r(340));ml()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 19:return Re(en),null;case 4:return J(),null;case 10:return xa(c.type),null;case 22:case 23:return va(c),bg(),i!==null&&Re(Vo),i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 24:return xa(tn),null;case 25:return null;default:return null}}function iC(i,c){switch(pg(c),c.tag){case 3:xa(tn),J();break;case 26:case 27:case 5:ke(c);break;case 4:J();break;case 13:va(c);break;case 19:Re(en);break;case 10:xa(c.type);break;case 22:case 23:va(c),bg(),i!==null&&Re(Vo);break;case 24:xa(tn)}}var f6={getCacheForType:function(i){var c=En(tn),f=c.data.get(i);return f===void 0&&(f=i(),c.data.set(i,f)),f}},p6=typeof WeakMap=="function"?WeakMap:Map,jt=0,Lt=null,ft=null,vt=0,Mt=0,Xn=null,Ca=!1,es=!1,dh=!1,_a=0,qt=0,lo=0,ti=0,fh=0,yr=0,ts=0,Fl=null,Xr=null,ph=!1,gh=0,Wu=1/0,Yu=null,co=null,Ku=!1,ni=null,zl=0,hh=0,mh=null,Bl=0,bh=null;function Zn(){if(jt&2&&vt!==0)return vt&-vt;if(D.T!==null){var i=Vi;return i!==0?i:Th()}return RA()}function sC(){yr===0&&(yr=!(vt&536870912)||xt?Nt():536870912);var i=gr.current;return i!==null&&(i.flags|=32),yr}function On(i,c,f){(i===Lt&&Mt===2||i.cancelPendingCommit!==null)&&(ns(i,0),Na(i,vt,yr,!1)),Ln(i,f),(!(jt&2)||i!==Lt)&&(i===Lt&&(!(jt&2)&&(ti|=f),qt===4&&Na(i,vt,yr,!1)),Zr(i))}function lC(i,c,f){if(jt&6)throw Error(r(327));var h=!f&&(c&60)===0&&(c&i.expiredLanes)===0||Xe(i,c),S=h?m6(i,c):Eh(i,c,!0),A=h;do{if(S===0){es&&!h&&Na(i,c,0,!1);break}else if(S===6)Na(i,c,0,!Ca);else{if(f=i.current.alternate,A&&!g6(f)){S=Eh(i,c,!1),A=!1;continue}if(S===2){if(A=c,i.errorRecoveryDisabledLanes&A)var z=0;else z=i.pendingLanes&-536870913,z=z!==0?z:z&536870912?536870912:0;if(z!==0){c=z;e:{var q=i;S=Fl;var X=q.current.memoizedState.isDehydrated;if(X&&(ns(q,z).flags|=256),z=Eh(q,z,!1),z!==2){if(dh&&!X){q.errorRecoveryDisabledLanes|=A,ti|=A,S=4;break e}A=Xr,Xr=S,A!==null&&yh(A)}S=z}if(A=!1,S!==2)continue}}if(S===1){ns(i,0),Na(i,c,0,!0);break}e:{switch(h=i,S){case 0:case 1:throw Error(r(345));case 4:if((c&4194176)===c){Na(h,c,yr,!Ca);break e}break;case 2:Xr=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=f,h.finishedLanes=c,(c&62914560)===c&&(A=gh+300-ye(),10f?32:f,D.T=null,ni===null)var A=!1;else{f=mh,mh=null;var z=ni,q=zl;if(ni=null,zl=0,jt&6)throw Error(r(331));var X=jt;if(jt|=4,tC(z.current),QR(z,z.current,q,f),jt=X,jl(0,!1),et&&typeof et.onPostCommitFiberRoot=="function")try{et.onPostCommitFiberRoot(bt,z)}catch{}A=!0}return A}finally{Z.p=S,D.T=h,bC(i,c)}}return!1}function yC(i,c,f){c=dr(f,c),c=Bg(i.stateNode,c,2),i=ro(i,c,2),i!==null&&(Ln(i,2),Zr(i))}function Ot(i,c,f){if(i.tag===3)yC(i,i,f);else for(;c!==null;){if(c.tag===3){yC(c,i,f);break}else if(c.tag===1){var h=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(co===null||!co.has(h))){i=dr(f,i),f=ER(2),h=ro(c,f,2),h!==null&&(wR(f,h,c,i),Ln(h,2),Zr(h));break}}c=c.return}}function wh(i,c,f){var h=i.pingCache;if(h===null){h=i.pingCache=new p6;var S=new Set;h.set(c,S)}else S=h.get(c),S===void 0&&(S=new Set,h.set(c,S));S.has(f)||(dh=!0,S.add(f),i=v6.bind(null,i,c,f),c.then(i,i))}function v6(i,c,f){var h=i.pingCache;h!==null&&h.delete(c),i.pingedLanes|=i.suspendedLanes&f,i.warmLanes&=~f,Lt===i&&(vt&f)===f&&(qt===4||qt===3&&(vt&62914560)===vt&&300>ye()-gh?!(jt&2)&&ns(i,0):fh|=f,ts===vt&&(ts=0)),Zr(i)}function vC(i,c){c===0&&(c=Dn()),i=Ka(i,c),i!==null&&(Ln(i,c),Zr(i))}function S6(i){var c=i.memoizedState,f=0;c!==null&&(f=c.retryLane),vC(i,f)}function E6(i,c){var f=0;switch(i.tag){case 13:var h=i.stateNode,S=i.memoizedState;S!==null&&(f=S.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(c),vC(i,f)}function w6(i,c){return Ee(i,c)}var Qu=null,os=null,xh=!1,Ju=!1,kh=!1,ri=0;function Zr(i){i!==os&&i.next===null&&(os===null?Qu=os=i:os=os.next=i),Ju=!0,xh||(xh=!0,k6(x6))}function jl(i,c){if(!kh&&Ju){kh=!0;do for(var f=!1,h=Qu;h!==null;){if(i!==0){var S=h.pendingLanes;if(S===0)var A=0;else{var z=h.suspendedLanes,q=h.pingedLanes;A=(1<<31-wt(42|i)+1)-1,A&=S&~(z&~q),A=A&201326677?A&201326677|1:A?A|2:0}A!==0&&(f=!0,wC(h,A))}else A=vt,A=pa(h,h===Lt?A:0),!(A&3)||Xe(h,A)||(f=!0,wC(h,A));h=h.next}while(f);kh=!1}}function x6(){Ju=xh=!1;var i=0;ri!==0&&(I6()&&(i=ri),ri=0);for(var c=ye(),f=null,h=Qu;h!==null;){var S=h.next,A=SC(h,c);A===0?(h.next=null,f===null?Qu=S:f.next=S,S===null&&(os=f)):(f=h,(i!==0||A&3)&&(Ju=!0)),h=S}jl(i)}function SC(i,c){for(var f=i.suspendedLanes,h=i.pingedLanes,S=i.expirationTimes,A=i.pendingLanes&-62914561;0"u"?null:document;function FC(i,c,f){var h=ss;if(h&&typeof c=="string"&&c){var S=cr(c);S='link[rel="'+i+'"][href="'+S+'"]',typeof f=="string"&&(S+='[crossorigin="'+f+'"]'),PC.has(S)||(PC.add(S),i={rel:i,crossOrigin:f,href:c},h.querySelector(S)===null&&(c=h.createElement("link"),mn(c,"link",i),an(c),h.head.appendChild(c)))}}function j6(i){Oa.D(i),FC("dns-prefetch",i,null)}function U6(i,c){Oa.C(i,c),FC("preconnect",i,c)}function G6(i,c,f){Oa.L(i,c,f);var h=ss;if(h&&i&&c){var S='link[rel="preload"][as="'+cr(c)+'"]';c==="image"&&f&&f.imageSrcSet?(S+='[imagesrcset="'+cr(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(S+='[imagesizes="'+cr(f.imageSizes)+'"]')):S+='[href="'+cr(i)+'"]';var A=S;switch(c){case"style":A=ls(i);break;case"script":A=cs(i)}vr.has(A)||(i=I({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:i,as:c},f),vr.set(A,i),h.querySelector(S)!==null||c==="style"&&h.querySelector(Hl(A))||c==="script"&&h.querySelector($l(A))||(c=h.createElement("link"),mn(c,"link",i),an(c),h.head.appendChild(c)))}}function H6(i,c){Oa.m(i,c);var f=ss;if(f&&i){var h=c&&typeof c.as=="string"?c.as:"script",S='link[rel="modulepreload"][as="'+cr(h)+'"][href="'+cr(i)+'"]',A=S;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=cs(i)}if(!vr.has(A)&&(i=I({rel:"modulepreload",href:i},c),vr.set(A,i),f.querySelector(S)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector($l(A)))return}h=f.createElement("link"),mn(h,"link",i),an(h),f.head.appendChild(h)}}}function $6(i,c,f){Oa.S(i,c,f);var h=ss;if(h&&i){var S=Oi(h).hoistableStyles,A=ls(i);c=c||"default";var z=S.get(A);if(!z){var q={loading:0,preload:null};if(z=h.querySelector(Hl(A)))q.loading=5;else{i=I({rel:"stylesheet",href:i,"data-precedence":c},f),(f=vr.get(A))&&zh(i,f);var X=z=h.createElement("link");an(X),mn(X,"link",i),X._p=new Promise(function(re,ve){X.onload=re,X.onerror=ve}),X.addEventListener("load",function(){q.loading|=1}),X.addEventListener("error",function(){q.loading|=2}),q.loading|=4,od(z,c,h)}z={type:"stylesheet",instance:z,count:1,state:q},S.set(A,z)}}}function q6(i,c){Oa.X(i,c);var f=ss;if(f&&i){var h=Oi(f).hoistableScripts,S=cs(i),A=h.get(S);A||(A=f.querySelector($l(S)),A||(i=I({src:i,async:!0},c),(c=vr.get(S))&&Bh(i,c),A=f.createElement("script"),an(A),mn(A,"link",i),f.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},h.set(S,A))}}function V6(i,c){Oa.M(i,c);var f=ss;if(f&&i){var h=Oi(f).hoistableScripts,S=cs(i),A=h.get(S);A||(A=f.querySelector($l(S)),A||(i=I({src:i,async:!0,type:"module"},c),(c=vr.get(S))&&Bh(i,c),A=f.createElement("script"),an(A),mn(A,"link",i),f.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},h.set(S,A))}}function zC(i,c,f,h){var S=(S=xe.current)?ad(S):null;if(!S)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=ls(f.href),f=Oi(S).hoistableStyles,h=f.get(c),h||(h={type:"style",instance:null,count:0,state:null},f.set(c,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){i=ls(f.href);var A=Oi(S).hoistableStyles,z=A.get(i);if(z||(S=S.ownerDocument||S,z={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(i,z),(A=S.querySelector(Hl(i)))&&!A._p&&(z.instance=A,z.state.loading=5),vr.has(i)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},vr.set(i,f),A||W6(S,i,f,z.state))),c&&h===null)throw Error(r(528,""));return z}if(c&&h!==null)throw Error(r(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=cs(f),f=Oi(S).hoistableScripts,h=f.get(c),h||(h={type:"script",instance:null,count:0,state:null},f.set(c,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ls(i){return'href="'+cr(i)+'"'}function Hl(i){return'link[rel="stylesheet"]['+i+"]"}function BC(i){return I({},i,{"data-precedence":i.precedence,precedence:null})}function W6(i,c,f,h){i.querySelector('link[rel="preload"][as="style"]['+c+"]")?h.loading=1:(c=i.createElement("link"),h.preload=c,c.addEventListener("load",function(){return h.loading|=1}),c.addEventListener("error",function(){return h.loading|=2}),mn(c,"link",f),an(c),i.head.appendChild(c))}function cs(i){return'[src="'+cr(i)+'"]'}function $l(i){return"script[async]"+i}function jC(i,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var h=i.querySelector('style[data-href~="'+cr(f.href)+'"]');if(h)return c.instance=h,an(h),h;var S=I({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),an(h),mn(h,"style",S),od(h,f.precedence,i),c.instance=h;case"stylesheet":S=ls(f.href);var A=i.querySelector(Hl(S));if(A)return c.state.loading|=4,c.instance=A,an(A),A;h=BC(f),(S=vr.get(S))&&zh(h,S),A=(i.ownerDocument||i).createElement("link"),an(A);var z=A;return z._p=new Promise(function(q,X){z.onload=q,z.onerror=X}),mn(A,"link",h),c.state.loading|=4,od(A,f.precedence,i),c.instance=A;case"script":return A=cs(f.src),(S=i.querySelector($l(A)))?(c.instance=S,an(S),S):(h=f,(S=vr.get(A))&&(h=I({},f),Bh(h,S)),i=i.ownerDocument||i,S=i.createElement("script"),an(S),mn(S,"link",h),i.head.appendChild(S),c.instance=S);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&!(c.state.loading&4)&&(h=c.instance,c.state.loading|=4,od(h,f.precedence,i));return c.instance}function od(i,c,f){for(var h=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=h.length?h[h.length-1]:null,A=S,z=0;z title"):null)}function Y6(i,c,f){if(f===1||c.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return i=c.disabled,typeof c.precedence=="string"&&i==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function HC(i){return!(i.type==="stylesheet"&&!(i.state.loading&3))}var ql=null;function K6(){}function X6(i,c,f){if(ql===null)throw Error(r(475));var h=ql;if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&!(c.state.loading&4)){if(c.instance===null){var S=ls(f.href),A=i.querySelector(Hl(S));if(A){i=A._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(h.count++,h=sd.bind(h),i.then(h,h)),c.state.loading|=4,c.instance=A,an(A);return}A=i.ownerDocument||i,f=BC(f),(S=vr.get(S))&&zh(f,S),A=A.createElement("link"),an(A);var z=A;z._p=new Promise(function(q,X){z.onload=q,z.onerror=X}),mn(A,"link",f),c.instance=A}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(c,i),(i=c.state.preload)&&!(c.state.loading&3)&&(h.count++,c=sd.bind(h),i.addEventListener("load",c),i.addEventListener("error",c))}}function Z6(){if(ql===null)throw Error(r(475));var i=ql;return i.stylesheets&&i.count===0&&jh(i,i.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Kh.exports=yq(),Kh.exports}var Sq=vq(),Jl={},d_;function Eq(){if(d_)return Jl;d_=1,Object.defineProperty(Jl,"__esModule",{value:!0}),Jl.parse=s,Jl.serialize=d;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,a=Object.prototype.toString,o=(()=>{const m=function(){};return m.prototype=Object.create(null),m})();function s(m,b){const y=new o,v=m.length;if(v<2)return y;const x=(b==null?void 0:b.decode)||p;let T=0;do{const k=m.indexOf("=",T);if(k===-1)break;const R=m.indexOf(";",T),O=R===-1?v:R;if(k>O){T=m.lastIndexOf(";",k-1)+1;continue}const N=l(m,T,k),C=u(m,k,N),_=m.slice(N,C);if(y[_]===void 0){let M=l(m,k+1,O),D=u(m,O,M);const I=x(m.slice(M,D));y[_]=I}T=O+1}while(Ty;){const v=m.charCodeAt(--b);if(v!==32&&v!==9)return b+1}return y}function d(m,b,y){const v=(y==null?void 0:y.encode)||encodeURIComponent;if(!e.test(m))throw new TypeError(`argument name is invalid: ${m}`);const x=v(b);if(!t.test(x))throw new TypeError(`argument val is invalid: ${b}`);let T=m+"="+x;if(!y)return T;if(y.maxAge!==void 0){if(!Number.isInteger(y.maxAge))throw new TypeError(`option maxAge is invalid: ${y.maxAge}`);T+="; Max-Age="+y.maxAge}if(y.domain){if(!n.test(y.domain))throw new TypeError(`option domain is invalid: ${y.domain}`);T+="; Domain="+y.domain}if(y.path){if(!r.test(y.path))throw new TypeError(`option path is invalid: ${y.path}`);T+="; Path="+y.path}if(y.expires){if(!g(y.expires)||!Number.isFinite(y.expires.valueOf()))throw new TypeError(`option expires is invalid: ${y.expires}`);T+="; Expires="+y.expires.toUTCString()}if(y.httpOnly&&(T+="; HttpOnly"),y.secure&&(T+="; Secure"),y.partitioned&&(T+="; Partitioned"),y.priority)switch(typeof y.priority=="string"?y.priority.toLowerCase():void 0){case"low":T+="; Priority=Low";break;case"medium":T+="; Priority=Medium";break;case"high":T+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${y.priority}`)}if(y.sameSite)switch(typeof y.sameSite=="string"?y.sameSite.toLowerCase():y.sameSite){case!0:case"strict":T+="; SameSite=Strict";break;case"lax":T+="; SameSite=Lax";break;case"none":T+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${y.sameSite}`)}return T}function p(m){if(m.indexOf("%")===-1)return m;try{return decodeURIComponent(m)}catch{return m}}function g(m){return a.call(m)==="[object Date]"}return Jl}Eq();/** +`+f.stack}}function F(i){var c=i,f=i;if(i.alternate)for(;c.return;)c=c.return;else{i=c;do c=i,c.flags&4098&&(f=c.return),i=c.return;while(i)}return c.tag===3?f:null}function Y(i){if(i.tag===13){var c=i.memoizedState;if(c===null&&(i=i.alternate,i!==null&&(c=i.memoizedState)),c!==null)return c.dehydrated}return null}function L(i){if(F(i)!==i)throw Error(r(188))}function V(i){var c=i.alternate;if(!c){if(c=F(i),c===null)throw Error(r(188));return c!==i?null:i}for(var f=i,h=c;;){var S=f.return;if(S===null)break;var A=S.alternate;if(A===null){if(h=S.return,h!==null){f=h;continue}break}if(S.child===A.child){for(A=S.child;A;){if(A===f)return L(S),i;if(A===h)return L(S),c;A=A.sibling}throw Error(r(188))}if(f.return!==h.return)f=S,h=A;else{for(var z=!1,q=S.child;q;){if(q===f){z=!0,f=S,h=A;break}if(q===h){z=!0,h=S,f=A;break}q=q.sibling}if(!z){for(q=A.child;q;){if(q===f){z=!0,f=A,h=S;break}if(q===h){z=!0,h=A,f=S;break}q=q.sibling}if(!z)throw Error(r(189))}}if(f.alternate!==h)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?i:c}function j(i){var c=i.tag;if(c===5||c===26||c===27||c===6)return i;for(i=i.child;i!==null;){if(c=j(i),c!==null)return c;i=i.sibling}return null}var P=Array.isArray,Z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},oe=[],ae=-1;function ce(i){return{current:i}}function Re(i){0>ae||(i.current=oe[ae],oe[ae]=null,ae--)}function ie(i,c){ae++,oe[ae]=i.current,i.current=c}var Te=ce(null),ne=ce(null),xe=ce(null),Se=ce(null);function be(i,c){switch(ie(xe,c),ie(ne,i),ie(Te,null),i=c.nodeType,i){case 9:case 11:c=(c=c.documentElement)&&(c=c.namespaceURI)?NC(c):0;break;default:if(i=i===8?c.parentNode:c,c=i.tagName,i=i.namespaceURI)i=NC(i),c=OC(i,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}Re(Te),ie(Te,c)}function J(){Re(Te),Re(ne),Re(xe)}function pe(i){i.memoizedState!==null&&ie(Se,i);var c=Te.current,f=OC(c,i.type);c!==f&&(ie(ne,i),ie(Te,f))}function ke(i){ne.current===i&&(Re(Te),Re(ne)),Se.current===i&&(Re(Se),Vl._currentValue=Q)}var he=Object.prototype.hasOwnProperty,Ee=e.unstable_scheduleCallback,se=e.unstable_cancelCallback,Be=e.unstable_shouldYield,je=e.unstable_requestPaint,ye=e.unstable_now,Oe=e.unstable_getCurrentPriorityLevel,ee=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,ze=e.unstable_LowPriority,We=e.unstable_IdlePriority,St=e.log,Tt=e.unstable_setDisableYieldValue,bt=null,et=null;function At(i){if(et&&typeof et.onCommitFiberRoot=="function")try{et.onCommitFiberRoot(bt,i,void 0,(i.current.flags&128)===128)}catch{}}function st(i){if(typeof St=="function"&&Tt(i),et&&typeof et.setStrictMode=="function")try{et.setStrictMode(bt,i)}catch{}}var wt=Math.clz32?Math.clz32:zt,Ht=Math.log,pn=Math.LN2;function zt(i){return i>>>=0,i===0?32:31-(Ht(i)/pn|0)|0}var sr=128,Vr=4194304;function Jt(i){var c=i&42;if(c!==0)return c;switch(i&-i){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: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 i&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function pa(i,c){var f=i.pendingLanes;if(f===0)return 0;var h=0,S=i.suspendedLanes,A=i.pingedLanes,z=i.warmLanes;i=i.finishedLanes!==0;var q=f&134217727;return q!==0?(f=q&~S,f!==0?h=Jt(f):(A&=q,A!==0?h=Jt(A):i||(z=q&~z,z!==0&&(h=Jt(z))))):(q=f&~S,q!==0?h=Jt(q):A!==0?h=Jt(A):i||(z=f&~z,z!==0&&(h=Jt(z)))),h===0?0:c!==0&&c!==h&&!(c&S)&&(S=h&-h,z=c&-c,S>=z||S===32&&(z&4194176)!==0)?c:h}function Xe(i,c){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&c)===0}function yt(i,c){switch(i){case 1:case 2:case 4:case 8:return c+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+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 Nt(){var i=sr;return sr<<=1,!(sr&4194176)&&(sr=128),i}function Dn(){var i=Vr;return Vr<<=1,!(Vr&62914560)&&(Vr=4194304),i}function _n(i){for(var c=[],f=0;31>f;f++)c.push(i);return c}function Ln(i,c){i.pendingLanes|=c,c!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function ga(i,c,f,h,S,A){var z=i.pendingLanes;i.pendingLanes=f,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=f,i.entangledLanes&=f,i.errorRecoveryDisabledLanes&=f,i.shellSuspendCounter=0;var q=i.entanglements,X=i.expirationTimes,re=i.hiddenUpdates;for(f=z&~f;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),e$=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]*$"),OA={},IA={};function t$(i){return he.call(IA,i)?!0:he.call(OA,i)?!1:e$.test(i)?IA[i]=!0:(OA[i]=!0,!1)}function cu(i,c,f){if(t$(c))if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":i.removeAttribute(c);return;case"boolean":var h=c.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(c);return}}i.setAttribute(c,""+f)}}function uu(i,c,f){if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttribute(c,""+f)}}function ma(i,c,f,h){if(h===null)i.removeAttribute(f);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(f);return}i.setAttributeNS(c,f,""+h)}}function lr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function DA(i){var c=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function n$(i){var c=DA(i)?"checked":"value",f=Object.getOwnPropertyDescriptor(i.constructor.prototype,c),h=""+i[c];if(!i.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var S=f.get,A=f.set;return Object.defineProperty(i,c,{configurable:!0,get:function(){return S.call(this)},set:function(z){h=""+z,A.call(this,z)}}),Object.defineProperty(i,c,{enumerable:f.enumerable}),{getValue:function(){return h},setValue:function(z){h=""+z},stopTracking:function(){i._valueTracker=null,delete i[c]}}}}function du(i){i._valueTracker||(i._valueTracker=n$(i))}function LA(i){if(!i)return!1;var c=i._valueTracker;if(!c)return!0;var f=c.getValue(),h="";return i&&(h=DA(i)?i.checked?"true":"false":i.value),i=h,i!==f?(c.setValue(i),!0):!1}function fu(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var r$=/[\n"\\]/g;function cr(i){return i.replace(r$,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function qp(i,c,f,h,S,A,z,q){i.name="",z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?i.type=z:i.removeAttribute("type"),c!=null?z==="number"?(c===0&&i.value===""||i.value!=c)&&(i.value=""+lr(c)):i.value!==""+lr(c)&&(i.value=""+lr(c)):z!=="submit"&&z!=="reset"||i.removeAttribute("value"),c!=null?Vp(i,z,lr(c)):f!=null?Vp(i,z,lr(f)):h!=null&&i.removeAttribute("value"),S==null&&A!=null&&(i.defaultChecked=!!A),S!=null&&(i.checked=S&&typeof S!="function"&&typeof S!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?i.name=""+lr(q):i.removeAttribute("name")}function MA(i,c,f,h,S,A,z,q){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.type=A),c!=null||f!=null){if(!(A!=="submit"&&A!=="reset"||c!=null))return;f=f!=null?""+lr(f):"",c=c!=null?""+lr(c):f,q||c===i.value||(i.value=c),i.defaultValue=c}h=h??S,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=q?i.checked:!!h,i.defaultChecked=!!h,z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"&&(i.name=z)}function Vp(i,c,f){c==="number"&&fu(i.ownerDocument)===i||i.defaultValue===""+f||(i.defaultValue=""+f)}function Di(i,c,f,h){if(i=i.options,c){c={};for(var S=0;S=ul),YA=" ",KA=!1;function XA(i,c){switch(i){case"keyup":return O$.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ZA(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Fi=!1;function D$(i,c){switch(i){case"compositionend":return ZA(c);case"keypress":return c.which!==32?null:(KA=!0,YA);case"textInput":return i=c.data,i===YA&&KA?null:i;default:return null}}function L$(i,c){if(Fi)return i==="compositionend"||!rg&&XA(i,c)?(i=GA(),gu=Qp=Ya=null,Fi=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:f,offset:c-i};i=h}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=o1(f)}}function s1(i,c){return i&&c?i===c?!0:i&&i.nodeType===3?!1:c&&c.nodeType===3?s1(i,c.parentNode):"contains"in i?i.contains(c):i.compareDocumentPosition?!!(i.compareDocumentPosition(c)&16):!1:!1}function l1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var c=fu(i.document);c instanceof i.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)i=c.contentWindow;else break;c=fu(i.document)}return c}function ig(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c&&(c==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||c==="textarea"||i.contentEditable==="true")}function G$(i,c){var f=l1(c);c=i.focusedElem;var h=i.selectionRange;if(f!==c&&c&&c.ownerDocument&&s1(c.ownerDocument.documentElement,c)){if(h!==null&&ig(c)){if(i=h.start,f=h.end,f===void 0&&(f=i),"selectionStart"in c)c.selectionStart=i,c.selectionEnd=Math.min(f,c.value.length);else if(f=(i=c.ownerDocument||document)&&i.defaultView||window,f.getSelection){f=f.getSelection();var S=c.textContent.length,A=Math.min(h.start,S);h=h.end===void 0?A:Math.min(h.end,S),!f.extend&&A>h&&(S=h,h=A,A=S),S=i1(c,A);var z=i1(c,h);S&&z&&(f.rangeCount!==1||f.anchorNode!==S.node||f.anchorOffset!==S.offset||f.focusNode!==z.node||f.focusOffset!==z.offset)&&(i=i.createRange(),i.setStart(S.node,S.offset),f.removeAllRanges(),A>h?(f.addRange(i),f.extend(z.node,z.offset)):(i.setEnd(z.node,z.offset),f.addRange(i)))}}for(i=[],f=c;f=f.parentNode;)f.nodeType===1&&i.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c=document.documentMode,zi=null,sg=null,gl=null,lg=!1;function c1(i,c,f){var h=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;lg||zi==null||zi!==fu(h)||(h=zi,"selectionStart"in h&&ig(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),gl&&pl(gl,h)||(gl=h,h=td(sg,"onSelect"),0>=z,S-=z,ba=1<<32-wt(c)+S|f<Qe?(ln=Ye,Ye=null):ln=Ye.sibling;var kt=fe(le,Ye,ue[Qe],Ae);if(kt===null){Ye===null&&(Ye=ln);break}i&&Ye&&kt.alternate===null&&c(le,Ye),te=A(kt,te,Qe),ut===null?Ge=kt:ut.sibling=kt,ut=kt,Ye=ln}if(Qe===ue.length)return f(le,Ye),xt&&Ho(le,Qe),Ge;if(Ye===null){for(;QeQe?(ln=Ye,Ye=null):ln=Ye.sibling;var ho=fe(le,Ye,kt.value,Ae);if(ho===null){Ye===null&&(Ye=ln);break}i&&Ye&&ho.alternate===null&&c(le,Ye),te=A(ho,te,Qe),ut===null?Ge=ho:ut.sibling=ho,ut=ho,Ye=ln}if(kt.done)return f(le,Ye),xt&&Ho(le,Qe),Ge;if(Ye===null){for(;!kt.done;Qe++,kt=ue.next())kt=Ce(le,kt.value,Ae),kt!==null&&(te=A(kt,te,Qe),ut===null?Ge=kt:ut.sibling=kt,ut=kt);return xt&&Ho(le,Qe),Ge}for(Ye=h(Ye);!kt.done;Qe++,kt=ue.next())kt=me(Ye,le,Qe,kt.value,Ae),kt!==null&&(i&&kt.alternate!==null&&Ye.delete(kt.key===null?Qe:kt.key),te=A(kt,te,Qe),ut===null?Ge=kt:ut.sibling=kt,ut=kt);return i&&Ye.forEach(function(iq){return c(le,iq)}),xt&&Ho(le,Qe),Ge}function Vt(le,te,ue,Ae){if(typeof ue=="object"&&ue!==null&&ue.type===u&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case s:e:{for(var Ge=ue.key;te!==null;){if(te.key===Ge){if(Ge=ue.type,Ge===u){if(te.tag===7){f(le,te.sibling),Ae=S(te,ue.props.children),Ae.return=le,le=Ae;break e}}else if(te.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===k&&A1(Ge)===te.type){f(le,te.sibling),Ae=S(te,ue.props),El(Ae,ue),Ae.return=le,le=Ae;break e}f(le,te);break}else c(le,te);te=te.sibling}ue.type===u?(Ae=ei(ue.props.children,le.mode,Ae,ue.key),Ae.return=le,le=Ae):(Ae=qu(ue.type,ue.key,ue.props,null,le.mode,Ae),El(Ae,ue),Ae.return=le,le=Ae)}return z(le);case l:e:{for(Ge=ue.key;te!==null;){if(te.key===Ge)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){f(le,te.sibling),Ae=S(te,ue.children||[]),Ae.return=le,le=Ae;break e}else{f(le,te);break}else c(le,te);te=te.sibling}Ae=uh(ue,le.mode,Ae),Ae.return=le,le=Ae}return z(le);case k:return Ge=ue._init,ue=Ge(ue._payload),Vt(le,te,ue,Ae)}if(P(ue))return qe(le,te,ue,Ae);if(C(ue)){if(Ge=C(ue),typeof Ge!="function")throw Error(r(150));return ue=Ge.call(ue),rt(le,te,ue,Ae)}if(typeof ue.then=="function")return Vt(le,te,Au(ue),Ae);if(ue.$$typeof===b)return Vt(le,te,Gu(le,ue),Ae);Ru(le,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(f(le,te.sibling),Ae=S(te,ue),Ae.return=le,le=Ae):(f(le,te),Ae=ch(ue,le.mode,Ae),Ae.return=le,le=Ae),z(le)):f(le,te)}return function(le,te,ue,Ae){try{Sl=0;var Ge=Vt(le,te,ue,Ae);return $i=null,Ge}catch(Ye){if(Ye===yl)throw Ye;var ut=br(29,Ye,null,le.mode);return ut.lanes=Ae,ut.return=le,ut}finally{}}}var qo=R1(!0),C1=R1(!1),qi=ce(null),Cu=ce(0);function _1(i,c){i=_a,ie(Cu,i),ie(qi,c),_a=i|c.baseLanes}function mg(){ie(Cu,_a),ie(qi,qi.current)}function bg(){_a=Cu.current,Re(qi),Re(Cu)}var gr=ce(null),Yr=null;function Xa(i){var c=i.alternate;ie(en,en.current&1),ie(gr,i),Yr===null&&(c===null||qi.current!==null||c.memoizedState!==null)&&(Yr=i)}function N1(i){if(i.tag===22){if(ie(en,en.current),ie(gr,i),Yr===null){var c=i.alternate;c!==null&&c.memoizedState!==null&&(Yr=i)}}else Za()}function Za(){ie(en,en.current),ie(gr,gr.current)}function va(i){Re(gr),Yr===i&&(Yr=null),Re(en)}var en=ce(0);function _u(i){for(var c=i;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===i)break;for(;c.sibling===null;){if(c.return===null||c.return===i)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var W$=typeof AbortController<"u"?AbortController:function(){var i=[],c=this.signal={aborted:!1,addEventListener:function(f,h){i.push(h)}};this.abort=function(){c.aborted=!0,i.forEach(function(f){return f()})}},Y$=e.unstable_scheduleCallback,K$=e.unstable_NormalPriority,tn={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yg(){return{controller:new W$,data:new Map,refCount:0}}function wl(i){i.refCount--,i.refCount===0&&Y$(K$,function(){i.controller.abort()})}var xl=null,vg=0,Vi=0,Wi=null;function X$(i,c){if(xl===null){var f=xl=[];vg=0,Vi=Th(),Wi={status:"pending",value:void 0,then:function(h){f.push(h)}}}return vg++,c.then(O1,O1),c}function O1(){if(--vg===0&&xl!==null){Wi!==null&&(Wi.status="fulfilled");var i=xl;xl=null,Vi=0,Wi=null;for(var c=0;cA?A:8;var z=D.T,q={};D.T=q,Pg(i,!1,c,f);try{var X=S(),re=D.S;if(re!==null&&re(q,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ve=Z$(X,h);Al(i,c,ve,Zn(i))}else Al(i,c,h,Zn(i))}catch(Ce){Al(i,c,{then:function(){},status:"rejected",reason:Ce},Zn())}finally{Z.p=A,D.T=z}}function n6(){}function Lg(i,c,f,h){if(i.tag!==5)throw Error(r(476));var S=lR(i).queue;sR(i,S,c,Q,f===null?n6:function(){return cR(i),f(h)})}function lR(i){var c=i.memoizedState;if(c!==null)return c;c={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:Q},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sa,lastRenderedState:f},next:null},i.memoizedState=c,i=i.alternate,i!==null&&(i.memoizedState=c),c}function cR(i){var c=lR(i).next.queue;Al(i,c,{},Zn())}function Mg(){return wn(Vl)}function uR(){return Xt().memoizedState}function dR(){return Xt().memoizedState}function r6(i){for(var c=i.return;c!==null;){switch(c.tag){case 24:case 3:var f=Zn();i=no(f);var h=ro(c,i,f);h!==null&&(On(h,c,f),_l(h,c,f)),c={cache:yg()},i.payload=c;return}c=c.return}}function a6(i,c,f){var h=Zn();f={lane:h,revertLane:0,action:f,hasEagerState:!1,eagerState:null,next:null},zu(i)?pR(c,f):(f=dg(i,c,f,h),f!==null&&(On(f,i,h),gR(f,c,h)))}function fR(i,c,f){var h=Zn();Al(i,c,f,h)}function Al(i,c,f,h){var S={lane:h,revertLane:0,action:f,hasEagerState:!1,eagerState:null,next:null};if(zu(i))pR(c,S);else{var A=i.alternate;if(i.lanes===0&&(A===null||A.lanes===0)&&(A=c.lastRenderedReducer,A!==null))try{var z=c.lastRenderedState,q=A(z,f);if(S.hasEagerState=!0,S.eagerState=q,Wn(q,z))return Eu(i,c,S,0),Lt===null&&Su(),!1}catch{}finally{}if(f=dg(i,c,S,h),f!==null)return On(f,i,h),gR(f,c,h),!0}return!1}function Pg(i,c,f,h){if(h={lane:2,revertLane:Th(),action:h,hasEagerState:!1,eagerState:null,next:null},zu(i)){if(c)throw Error(r(479))}else c=dg(i,f,h,2),c!==null&&On(c,i,2)}function zu(i){var c=i.alternate;return i===ct||c!==null&&c===ct}function pR(i,c){Yi=Ou=!0;var f=i.pending;f===null?c.next=c:(c.next=f.next,f.next=c),i.pending=c}function gR(i,c,f){if(f&4194176){var h=c.lanes;h&=i.pendingLanes,f|=h,c.lanes=f,_r(i,f)}}var Kr={readContext:wn,use:Lu,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useLayoutEffect:Wt,useInsertionEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useSyncExternalStore:Wt,useId:Wt};Kr.useCacheRefresh=Wt,Kr.useMemoCache=Wt,Kr.useHostTransitionStatus=Wt,Kr.useFormState=Wt,Kr.useActionState=Wt,Kr.useOptimistic=Wt;var Yo={readContext:wn,use:Lu,useCallback:function(i,c){return zn().memoizedState=[i,c===void 0?null:c],i},useContext:wn,useEffect:J1,useImperativeHandle:function(i,c,f){f=f!=null?f.concat([i]):null,Pu(4194308,4,nR.bind(null,c,i),f)},useLayoutEffect:function(i,c){return Pu(4194308,4,i,c)},useInsertionEffect:function(i,c){Pu(4,2,i,c)},useMemo:function(i,c){var f=zn();c=c===void 0?null:c;var h=i();if(Wo){st(!0);try{i()}finally{st(!1)}}return f.memoizedState=[h,c],h},useReducer:function(i,c,f){var h=zn();if(f!==void 0){var S=f(c);if(Wo){st(!0);try{f(c)}finally{st(!1)}}}else S=c;return h.memoizedState=h.baseState=S,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:S},h.queue=i,i=i.dispatch=a6.bind(null,ct,i),[h.memoizedState,i]},useRef:function(i){var c=zn();return i={current:i},c.memoizedState=i},useState:function(i){i=_g(i);var c=i.queue,f=fR.bind(null,ct,c);return c.dispatch=f,[i.memoizedState,f]},useDebugValue:Ig,useDeferredValue:function(i,c){var f=zn();return Dg(f,i,c)},useTransition:function(){var i=_g(!1);return i=sR.bind(null,ct,i.queue,!0,!1),zn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,c,f){var h=ct,S=zn();if(xt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=c(),Lt===null)throw Error(r(349));vt&60||F1(h,c,f)}S.memoizedState=f;var A={value:f,getSnapshot:c};return S.queue=A,J1(B1.bind(null,h,A,i),[i]),h.flags|=2048,Xi(9,z1.bind(null,h,A,f,c),{destroy:void 0},null),f},useId:function(){var i=zn(),c=Lt.identifierPrefix;if(xt){var f=ya,h=ba;f=(h&~(1<<32-wt(h)-1)).toString(32)+f,c=":"+c+"R"+f,f=Iu++,0 title"))),mn(A,h,f),A[En]=i,an(A),h=A;break e;case"link":var z=UC("link","href",S).get(h+(f.href||""));if(z){for(var q=0;q<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof h.is=="string"?S.createElement("select",{is:h.is}):S.createElement("select"),h.multiple?i.multiple=!0:h.size&&(i.size=h.size);break;default:i=typeof h.is=="string"?S.createElement(f,{is:h.is}):S.createElement(f)}}i[En]=c,i[Pn]=h;e:for(S=c.child;S!==null;){if(S.tag===5||S.tag===6)i.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===c)break e;for(;S.sibling===null;){if(S.return===null||S.return===c)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}c.stateNode=i;e:switch(mn(i,f,h),f){case"button":case"input":case"select":case"textarea":i=!!h.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ra(c)}}return Bt(c),c.flags&=-16777217,null;case 6:if(i&&c.stateNode!=null)i.memoizedProps!==h&&Ra(c);else{if(typeof h!="string"&&c.stateNode===null)throw Error(r(166));if(i=xe.current,hl(c)){if(i=c.stateNode,f=c.memoizedProps,h=null,S=Nn,S!==null)switch(S.tag){case 27:case 5:h=S.memoizedProps}i[En]=c,i=!!(i.nodeValue===f||h!==null&&h.suppressHydrationWarning===!0||_C(i.nodeValue,f)),i||$o(c)}else i=rd(i).createTextNode(h),i[En]=c,c.stateNode=i}return Bt(c),null;case 13:if(h=c.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(S=hl(c),h!==null&&h.dehydrated!==null){if(i===null){if(!S)throw Error(r(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[En]=c}else ml(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Bt(c),S=!1}else Or!==null&&(yh(Or),Or=null),S=!0;if(!S)return c.flags&256?(va(c),c):(va(c),null)}if(va(c),c.flags&128)return c.lanes=f,c;if(f=h!==null,i=i!==null&&i.memoizedState!==null,f){h=c.child,S=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(S=h.alternate.memoizedState.cachePool.pool);var A=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(A=h.memoizedState.cachePool.pool),A!==S&&(h.flags|=2048)}return f!==i&&f&&(c.child.flags|=8192),Vu(c,c.updateQueue),Bt(c),null;case 4:return J(),i===null&&_h(c.stateNode.containerInfo),Bt(c),null;case 10:return xa(c.type),Bt(c),null;case 19:if(Re(en),S=c.memoizedState,S===null)return Bt(c),null;if(h=(c.flags&128)!==0,A=S.rendering,A===null)if(h)Pl(S,!1);else{if(qt!==0||i!==null&&i.flags&128)for(i=c.child;i!==null;){if(A=_u(i),A!==null){for(c.flags|=128,Pl(S,!1),i=A.updateQueue,c.updateQueue=i,Vu(c,i),c.subtreeFlags=0,i=f,f=c.child;f!==null;)rC(f,i),f=f.sibling;return ie(en,en.current&1|2),c.child}i=i.sibling}S.tail!==null&&ye()>Wu&&(c.flags|=128,h=!0,Pl(S,!1),c.lanes=4194304)}else{if(!h)if(i=_u(A),i!==null){if(c.flags|=128,h=!0,i=i.updateQueue,c.updateQueue=i,Vu(c,i),Pl(S,!0),S.tail===null&&S.tailMode==="hidden"&&!A.alternate&&!xt)return Bt(c),null}else 2*ye()-S.renderingStartTime>Wu&&f!==536870912&&(c.flags|=128,h=!0,Pl(S,!1),c.lanes=4194304);S.isBackwards?(A.sibling=c.child,c.child=A):(i=S.last,i!==null?i.sibling=A:c.child=A,S.last=A)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=ye(),c.sibling=null,i=en.current,ie(en,h?i&1|2:i&1),c):(Bt(c),null);case 22:case 23:return va(c),bg(),h=c.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(c.flags|=8192):h&&(c.flags|=8192),h?f&536870912&&!(c.flags&128)&&(Bt(c),c.subtreeFlags&6&&(c.flags|=8192)):Bt(c),f=c.updateQueue,f!==null&&Vu(c,f.retryQueue),f=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),h=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(h=c.memoizedState.cachePool.pool),h!==f&&(c.flags|=2048),i!==null&&Re(Vo),null;case 24:return f=null,i!==null&&(f=i.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),xa(tn),Bt(c),null;case 25:return null}throw Error(r(156,c.tag))}function d6(i,c){switch(pg(c),c.tag){case 1:return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 3:return xa(tn),J(),i=c.flags,i&65536&&!(i&128)?(c.flags=i&-65537|128,c):null;case 26:case 27:case 5:return ke(c),null;case 13:if(va(c),i=c.memoizedState,i!==null&&i.dehydrated!==null){if(c.alternate===null)throw Error(r(340));ml()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 19:return Re(en),null;case 4:return J(),null;case 10:return xa(c.type),null;case 22:case 23:return va(c),bg(),i!==null&&Re(Vo),i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 24:return xa(tn),null;case 25:return null;default:return null}}function iC(i,c){switch(pg(c),c.tag){case 3:xa(tn),J();break;case 26:case 27:case 5:ke(c);break;case 4:J();break;case 13:va(c);break;case 19:Re(en);break;case 10:xa(c.type);break;case 22:case 23:va(c),bg(),i!==null&&Re(Vo);break;case 24:xa(tn)}}var f6={getCacheForType:function(i){var c=wn(tn),f=c.data.get(i);return f===void 0&&(f=i(),c.data.set(i,f)),f}},p6=typeof WeakMap=="function"?WeakMap:Map,jt=0,Lt=null,ft=null,vt=0,Mt=0,Xn=null,Ca=!1,es=!1,dh=!1,_a=0,qt=0,lo=0,ti=0,fh=0,yr=0,ts=0,Fl=null,Xr=null,ph=!1,gh=0,Wu=1/0,Yu=null,co=null,Ku=!1,ni=null,zl=0,hh=0,mh=null,Bl=0,bh=null;function Zn(){if(jt&2&&vt!==0)return vt&-vt;if(D.T!==null){var i=Vi;return i!==0?i:Th()}return RA()}function sC(){yr===0&&(yr=!(vt&536870912)||xt?Nt():536870912);var i=gr.current;return i!==null&&(i.flags|=32),yr}function On(i,c,f){(i===Lt&&Mt===2||i.cancelPendingCommit!==null)&&(ns(i,0),Na(i,vt,yr,!1)),Ln(i,f),(!(jt&2)||i!==Lt)&&(i===Lt&&(!(jt&2)&&(ti|=f),qt===4&&Na(i,vt,yr,!1)),Zr(i))}function lC(i,c,f){if(jt&6)throw Error(r(327));var h=!f&&(c&60)===0&&(c&i.expiredLanes)===0||Xe(i,c),S=h?m6(i,c):Eh(i,c,!0),A=h;do{if(S===0){es&&!h&&Na(i,c,0,!1);break}else if(S===6)Na(i,c,0,!Ca);else{if(f=i.current.alternate,A&&!g6(f)){S=Eh(i,c,!1),A=!1;continue}if(S===2){if(A=c,i.errorRecoveryDisabledLanes&A)var z=0;else z=i.pendingLanes&-536870913,z=z!==0?z:z&536870912?536870912:0;if(z!==0){c=z;e:{var q=i;S=Fl;var X=q.current.memoizedState.isDehydrated;if(X&&(ns(q,z).flags|=256),z=Eh(q,z,!1),z!==2){if(dh&&!X){q.errorRecoveryDisabledLanes|=A,ti|=A,S=4;break e}A=Xr,Xr=S,A!==null&&yh(A)}S=z}if(A=!1,S!==2)continue}}if(S===1){ns(i,0),Na(i,c,0,!0);break}e:{switch(h=i,S){case 0:case 1:throw Error(r(345));case 4:if((c&4194176)===c){Na(h,c,yr,!Ca);break e}break;case 2:Xr=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=f,h.finishedLanes=c,(c&62914560)===c&&(A=gh+300-ye(),10f?32:f,D.T=null,ni===null)var A=!1;else{f=mh,mh=null;var z=ni,q=zl;if(ni=null,zl=0,jt&6)throw Error(r(331));var X=jt;if(jt|=4,tC(z.current),QR(z,z.current,q,f),jt=X,jl(0,!1),et&&typeof et.onPostCommitFiberRoot=="function")try{et.onPostCommitFiberRoot(bt,z)}catch{}A=!0}return A}finally{Z.p=S,D.T=h,bC(i,c)}}return!1}function yC(i,c,f){c=dr(f,c),c=Bg(i.stateNode,c,2),i=ro(i,c,2),i!==null&&(Ln(i,2),Zr(i))}function Ot(i,c,f){if(i.tag===3)yC(i,i,f);else for(;c!==null;){if(c.tag===3){yC(c,i,f);break}else if(c.tag===1){var h=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(co===null||!co.has(h))){i=dr(f,i),f=ER(2),h=ro(c,f,2),h!==null&&(wR(f,h,c,i),Ln(h,2),Zr(h));break}}c=c.return}}function wh(i,c,f){var h=i.pingCache;if(h===null){h=i.pingCache=new p6;var S=new Set;h.set(c,S)}else S=h.get(c),S===void 0&&(S=new Set,h.set(c,S));S.has(f)||(dh=!0,S.add(f),i=v6.bind(null,i,c,f),c.then(i,i))}function v6(i,c,f){var h=i.pingCache;h!==null&&h.delete(c),i.pingedLanes|=i.suspendedLanes&f,i.warmLanes&=~f,Lt===i&&(vt&f)===f&&(qt===4||qt===3&&(vt&62914560)===vt&&300>ye()-gh?!(jt&2)&&ns(i,0):fh|=f,ts===vt&&(ts=0)),Zr(i)}function vC(i,c){c===0&&(c=Dn()),i=Ka(i,c),i!==null&&(Ln(i,c),Zr(i))}function S6(i){var c=i.memoizedState,f=0;c!==null&&(f=c.retryLane),vC(i,f)}function E6(i,c){var f=0;switch(i.tag){case 13:var h=i.stateNode,S=i.memoizedState;S!==null&&(f=S.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(c),vC(i,f)}function w6(i,c){return Ee(i,c)}var Qu=null,os=null,xh=!1,Ju=!1,kh=!1,ri=0;function Zr(i){i!==os&&i.next===null&&(os===null?Qu=os=i:os=os.next=i),Ju=!0,xh||(xh=!0,k6(x6))}function jl(i,c){if(!kh&&Ju){kh=!0;do for(var f=!1,h=Qu;h!==null;){if(i!==0){var S=h.pendingLanes;if(S===0)var A=0;else{var z=h.suspendedLanes,q=h.pingedLanes;A=(1<<31-wt(42|i)+1)-1,A&=S&~(z&~q),A=A&201326677?A&201326677|1:A?A|2:0}A!==0&&(f=!0,wC(h,A))}else A=vt,A=pa(h,h===Lt?A:0),!(A&3)||Xe(h,A)||(f=!0,wC(h,A));h=h.next}while(f);kh=!1}}function x6(){Ju=xh=!1;var i=0;ri!==0&&(I6()&&(i=ri),ri=0);for(var c=ye(),f=null,h=Qu;h!==null;){var S=h.next,A=SC(h,c);A===0?(h.next=null,f===null?Qu=S:f.next=S,S===null&&(os=f)):(f=h,(i!==0||A&3)&&(Ju=!0)),h=S}jl(i)}function SC(i,c){for(var f=i.suspendedLanes,h=i.pingedLanes,S=i.expirationTimes,A=i.pendingLanes&-62914561;0"u"?null:document;function FC(i,c,f){var h=ss;if(h&&typeof c=="string"&&c){var S=cr(c);S='link[rel="'+i+'"][href="'+S+'"]',typeof f=="string"&&(S+='[crossorigin="'+f+'"]'),PC.has(S)||(PC.add(S),i={rel:i,crossOrigin:f,href:c},h.querySelector(S)===null&&(c=h.createElement("link"),mn(c,"link",i),an(c),h.head.appendChild(c)))}}function j6(i){Oa.D(i),FC("dns-prefetch",i,null)}function U6(i,c){Oa.C(i,c),FC("preconnect",i,c)}function G6(i,c,f){Oa.L(i,c,f);var h=ss;if(h&&i&&c){var S='link[rel="preload"][as="'+cr(c)+'"]';c==="image"&&f&&f.imageSrcSet?(S+='[imagesrcset="'+cr(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(S+='[imagesizes="'+cr(f.imageSizes)+'"]')):S+='[href="'+cr(i)+'"]';var A=S;switch(c){case"style":A=ls(i);break;case"script":A=cs(i)}vr.has(A)||(i=I({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:i,as:c},f),vr.set(A,i),h.querySelector(S)!==null||c==="style"&&h.querySelector(Hl(A))||c==="script"&&h.querySelector($l(A))||(c=h.createElement("link"),mn(c,"link",i),an(c),h.head.appendChild(c)))}}function H6(i,c){Oa.m(i,c);var f=ss;if(f&&i){var h=c&&typeof c.as=="string"?c.as:"script",S='link[rel="modulepreload"][as="'+cr(h)+'"][href="'+cr(i)+'"]',A=S;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=cs(i)}if(!vr.has(A)&&(i=I({rel:"modulepreload",href:i},c),vr.set(A,i),f.querySelector(S)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector($l(A)))return}h=f.createElement("link"),mn(h,"link",i),an(h),f.head.appendChild(h)}}}function $6(i,c,f){Oa.S(i,c,f);var h=ss;if(h&&i){var S=Oi(h).hoistableStyles,A=ls(i);c=c||"default";var z=S.get(A);if(!z){var q={loading:0,preload:null};if(z=h.querySelector(Hl(A)))q.loading=5;else{i=I({rel:"stylesheet",href:i,"data-precedence":c},f),(f=vr.get(A))&&zh(i,f);var X=z=h.createElement("link");an(X),mn(X,"link",i),X._p=new Promise(function(re,ve){X.onload=re,X.onerror=ve}),X.addEventListener("load",function(){q.loading|=1}),X.addEventListener("error",function(){q.loading|=2}),q.loading|=4,od(z,c,h)}z={type:"stylesheet",instance:z,count:1,state:q},S.set(A,z)}}}function q6(i,c){Oa.X(i,c);var f=ss;if(f&&i){var h=Oi(f).hoistableScripts,S=cs(i),A=h.get(S);A||(A=f.querySelector($l(S)),A||(i=I({src:i,async:!0},c),(c=vr.get(S))&&Bh(i,c),A=f.createElement("script"),an(A),mn(A,"link",i),f.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},h.set(S,A))}}function V6(i,c){Oa.M(i,c);var f=ss;if(f&&i){var h=Oi(f).hoistableScripts,S=cs(i),A=h.get(S);A||(A=f.querySelector($l(S)),A||(i=I({src:i,async:!0,type:"module"},c),(c=vr.get(S))&&Bh(i,c),A=f.createElement("script"),an(A),mn(A,"link",i),f.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},h.set(S,A))}}function zC(i,c,f,h){var S=(S=xe.current)?ad(S):null;if(!S)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=ls(f.href),f=Oi(S).hoistableStyles,h=f.get(c),h||(h={type:"style",instance:null,count:0,state:null},f.set(c,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){i=ls(f.href);var A=Oi(S).hoistableStyles,z=A.get(i);if(z||(S=S.ownerDocument||S,z={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(i,z),(A=S.querySelector(Hl(i)))&&!A._p&&(z.instance=A,z.state.loading=5),vr.has(i)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},vr.set(i,f),A||W6(S,i,f,z.state))),c&&h===null)throw Error(r(528,""));return z}if(c&&h!==null)throw Error(r(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=cs(f),f=Oi(S).hoistableScripts,h=f.get(c),h||(h={type:"script",instance:null,count:0,state:null},f.set(c,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ls(i){return'href="'+cr(i)+'"'}function Hl(i){return'link[rel="stylesheet"]['+i+"]"}function BC(i){return I({},i,{"data-precedence":i.precedence,precedence:null})}function W6(i,c,f,h){i.querySelector('link[rel="preload"][as="style"]['+c+"]")?h.loading=1:(c=i.createElement("link"),h.preload=c,c.addEventListener("load",function(){return h.loading|=1}),c.addEventListener("error",function(){return h.loading|=2}),mn(c,"link",f),an(c),i.head.appendChild(c))}function cs(i){return'[src="'+cr(i)+'"]'}function $l(i){return"script[async]"+i}function jC(i,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var h=i.querySelector('style[data-href~="'+cr(f.href)+'"]');if(h)return c.instance=h,an(h),h;var S=I({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),an(h),mn(h,"style",S),od(h,f.precedence,i),c.instance=h;case"stylesheet":S=ls(f.href);var A=i.querySelector(Hl(S));if(A)return c.state.loading|=4,c.instance=A,an(A),A;h=BC(f),(S=vr.get(S))&&zh(h,S),A=(i.ownerDocument||i).createElement("link"),an(A);var z=A;return z._p=new Promise(function(q,X){z.onload=q,z.onerror=X}),mn(A,"link",h),c.state.loading|=4,od(A,f.precedence,i),c.instance=A;case"script":return A=cs(f.src),(S=i.querySelector($l(A)))?(c.instance=S,an(S),S):(h=f,(S=vr.get(A))&&(h=I({},f),Bh(h,S)),i=i.ownerDocument||i,S=i.createElement("script"),an(S),mn(S,"link",h),i.head.appendChild(S),c.instance=S);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&!(c.state.loading&4)&&(h=c.instance,c.state.loading|=4,od(h,f.precedence,i));return c.instance}function od(i,c,f){for(var h=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=h.length?h[h.length-1]:null,A=S,z=0;z title"):null)}function Y6(i,c,f){if(f===1||c.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return i=c.disabled,typeof c.precedence=="string"&&i==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function HC(i){return!(i.type==="stylesheet"&&!(i.state.loading&3))}var ql=null;function K6(){}function X6(i,c,f){if(ql===null)throw Error(r(475));var h=ql;if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&!(c.state.loading&4)){if(c.instance===null){var S=ls(f.href),A=i.querySelector(Hl(S));if(A){i=A._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(h.count++,h=sd.bind(h),i.then(h,h)),c.state.loading|=4,c.instance=A,an(A);return}A=i.ownerDocument||i,f=BC(f),(S=vr.get(S))&&zh(f,S),A=A.createElement("link"),an(A);var z=A;z._p=new Promise(function(q,X){z.onload=q,z.onerror=X}),mn(A,"link",f),c.instance=A}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(c,i),(i=c.state.preload)&&!(c.state.loading&3)&&(h.count++,c=sd.bind(h),i.addEventListener("load",c),i.addEventListener("error",c))}}function Z6(){if(ql===null)throw Error(r(475));var i=ql;return i.stylesheets&&i.count===0&&jh(i,i.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Kh.exports=yq(),Kh.exports}var Sq=vq(),Jl={},d_;function Eq(){if(d_)return Jl;d_=1,Object.defineProperty(Jl,"__esModule",{value:!0}),Jl.parse=s,Jl.serialize=d;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,a=Object.prototype.toString,o=(()=>{const m=function(){};return m.prototype=Object.create(null),m})();function s(m,b){const y=new o,v=m.length;if(v<2)return y;const x=(b==null?void 0:b.decode)||p;let T=0;do{const k=m.indexOf("=",T);if(k===-1)break;const R=m.indexOf(";",T),O=R===-1?v:R;if(k>O){T=m.lastIndexOf(";",k-1)+1;continue}const N=l(m,T,k),C=u(m,k,N),_=m.slice(N,C);if(y[_]===void 0){let M=l(m,k+1,O),D=u(m,O,M);const I=x(m.slice(M,D));y[_]=I}T=O+1}while(Ty;){const v=m.charCodeAt(--b);if(v!==32&&v!==9)return b+1}return y}function d(m,b,y){const v=(y==null?void 0:y.encode)||encodeURIComponent;if(!e.test(m))throw new TypeError(`argument name is invalid: ${m}`);const x=v(b);if(!t.test(x))throw new TypeError(`argument val is invalid: ${b}`);let T=m+"="+x;if(!y)return T;if(y.maxAge!==void 0){if(!Number.isInteger(y.maxAge))throw new TypeError(`option maxAge is invalid: ${y.maxAge}`);T+="; Max-Age="+y.maxAge}if(y.domain){if(!n.test(y.domain))throw new TypeError(`option domain is invalid: ${y.domain}`);T+="; Domain="+y.domain}if(y.path){if(!r.test(y.path))throw new TypeError(`option path is invalid: ${y.path}`);T+="; Path="+y.path}if(y.expires){if(!g(y.expires)||!Number.isFinite(y.expires.valueOf()))throw new TypeError(`option expires is invalid: ${y.expires}`);T+="; Expires="+y.expires.toUTCString()}if(y.httpOnly&&(T+="; HttpOnly"),y.secure&&(T+="; Secure"),y.partitioned&&(T+="; Partitioned"),y.priority)switch(typeof y.priority=="string"?y.priority.toLowerCase():void 0){case"low":T+="; Priority=Low";break;case"medium":T+="; Priority=Medium";break;case"high":T+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${y.priority}`)}if(y.sameSite)switch(typeof y.sameSite=="string"?y.sameSite.toLowerCase():y.sameSite){case!0:case"strict":T+="; SameSite=Strict";break;case"lax":T+="; SameSite=Lax";break;case"none":T+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${y.sameSite}`)}return T}function p(m){if(m.indexOf("%")===-1)return m;try{return decodeURIComponent(m)}catch{return m}}function g(m){return a.call(m)==="[object Date]"}return Jl}Eq();/** * react-router v7.3.0 * * Copyright (c) Remix Software Inc. @@ -67,7 +67,7 @@ ${JSON.stringify(e.response.data)} ${(a=e.config)==null?void 0:a.url}`)}throw e});const QB=async(e,t,n)=>(await Gn.get(`/graphs?label=${encodeURIComponent(e)}&max_depth=${t}&max_nodes=${n}`)).data,AV=async()=>(await Gn.get("/graph/label/list")).data,RV=async()=>{try{return(await Gn.get("/health")).data}catch(e){return{status:"error",message:tr(e)}}},CV=async()=>(await Gn.get("/documents")).data,_V=async()=>(await Gn.post("/documents/scan")).data,NV=async e=>(await Gn.post("/query",e)).data,OV=async(e,t,n)=>{const r=Ie.getState().apiKey,a=localStorage.getItem("LIGHTRAG-API-TOKEN"),o={"Content-Type":"application/json",Accept:"application/x-ndjson"};a&&(o.Authorization=`Bearer ${a}`),r&&(o["X-API-Key"]=r);try{const s=await fetch(`${Uk}/query/stream`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){let p="Unknown error";try{p=await s.text()}catch{}throw new Error(`HTTP error ${s.status}: ${s.statusText} ${p}`)}if(!s.body)throw new Error("Response body is null");const l=s.body.getReader(),u=new TextDecoder;let d="";for(;;){const{done:p,value:g}=await l.read();if(p)break;d+=u.decode(g,{stream:!0});const m=d.split(` `);d=m.pop()||"";for(const b of m)if(b.trim())try{const y=JSON.parse(b);y.response?(console.log("Received chunk:",y.response),t(y.response)):y.error&&n&&n(y.error)}catch(y){console.error("Error parsing stream chunk:",b,y),n&&n(`Error parsing server response: ${b}`)}}if(d.trim())try{const p=JSON.parse(d);p.response?t(p.response):p.error&&n&&n(p.error)}catch(p){console.error("Error parsing final chunk:",d,p),n&&n(`Error parsing final server response: ${d}`)}}catch(s){const l=tr(s);console.error("Stream request failed:",l),n?n(l):console.error("Unhandled stream error:",l)}},IV=async(e,t)=>{const n=new FormData;return n.append("file",e),(await Gn.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?a=>{const o=Math.round(a.loaded*100/a.total);t(o)}:void 0})).data},DV=async()=>(await Gn.delete("/documents")).data,LV=async e=>(await Gn.post("/documents/clear_cache",{modes:e})).data,JB=async()=>{try{const e=await Gn.get("/auth-status",{timeout:5e3,headers:{Accept:"application/json"}});if((e.headers["content-type"]||"").includes("text/html"))return console.warn("Received HTML response instead of JSON for auth-status endpoint"),{auth_configured:!0,auth_mode:"enabled"};if(e.data&&typeof e.data=="object"&&"auth_configured"in e.data&&typeof e.data.auth_configured=="boolean"){if(e.data.auth_configured)return e.data;if(e.data.access_token&&typeof e.data.access_token=="string")return e.data;console.warn("Auth not configured but no valid access token provided")}return console.warn("Received invalid auth status response:",e.data),{auth_configured:!0,auth_mode:"enabled"}}catch(e){return console.error("Failed to get auth status:",tr(e)),{auth_configured:!0,auth_mode:"enabled"}}},MV=async()=>(await Gn.get("/documents/pipeline_status")).data,PV=async(e,t)=>{const n=new FormData;return n.append("username",e),n.append("password",t),(await Gn.post("/login",n,{headers:{"Content-Type":"multipart/form-data"}})).data},FV=Wf()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,pipelineBusy:!1,check:async()=>{const t=await RV();return t.status==="healthy"?((t.core_version||t.api_version)&&xr.getState().setVersion(t.core_version||null,t.api_version||null),("webui_title"in t||"webui_description"in t)&&xr.getState().setCustomTitle("webui_title"in t?t.webui_title??null:null,"webui_description"in t?t.webui_description??null:null),e({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:t,pipelineBusy:t.pipeline_busy}),!0):(e({health:!1,message:t.message,messageTitle:"Backend Health Check Error!",lastCheckTime:Date.now(),status:null}),!1)},clear:()=>{e({health:!0,message:null,messageTitle:null})},setErrorMessage:(t,n)=>{e({health:!1,message:t,messageTitle:n})},setPipelineBusy:t=>{e({pipelineBusy:t})}})),rr=Fk(FV),ej=e=>{try{const t=e.split(".");return t.length!==3?{}:JSON.parse(atob(t[1]))}catch(t){return console.error("Error parsing token payload:",t),{}}},tj=e=>ej(e).sub||null,zV=e=>ej(e).role==="guest",BV=()=>{const e=localStorage.getItem("LIGHTRAG-API-TOKEN"),t=localStorage.getItem("LIGHTRAG-CORE-VERSION"),n=localStorage.getItem("LIGHTRAG-API-VERSION"),r=localStorage.getItem("LIGHTRAG-WEBUI-TITLE"),a=localStorage.getItem("LIGHTRAG-WEBUI-DESCRIPTION"),o=e?tj(e):null;return e?{isAuthenticated:!0,isGuestMode:zV(e),coreVersion:t,apiVersion:n,username:o,webuiTitle:r,webuiDescription:a}:{isAuthenticated:!1,isGuestMode:!1,coreVersion:t,apiVersion:n,username:null,webuiTitle:r,webuiDescription:a}},xr=Wf(e=>{const t=BV();return{isAuthenticated:t.isAuthenticated,isGuestMode:t.isGuestMode,coreVersion:t.coreVersion,apiVersion:t.apiVersion,username:t.username,webuiTitle:t.webuiTitle,webuiDescription:t.webuiDescription,login:(n,r=!1,a=null,o=null,s=null,l=null)=>{localStorage.setItem("LIGHTRAG-API-TOKEN",n),a&&localStorage.setItem("LIGHTRAG-CORE-VERSION",a),o&&localStorage.setItem("LIGHTRAG-API-VERSION",o),s?localStorage.setItem("LIGHTRAG-WEBUI-TITLE",s):localStorage.removeItem("LIGHTRAG-WEBUI-TITLE"),l?localStorage.setItem("LIGHTRAG-WEBUI-DESCRIPTION",l):localStorage.removeItem("LIGHTRAG-WEBUI-DESCRIPTION");const u=tj(n);e({isAuthenticated:!0,isGuestMode:r,username:u,coreVersion:a,apiVersion:o,webuiTitle:s,webuiDescription:l})},logout:()=>{localStorage.removeItem("LIGHTRAG-API-TOKEN");const n=localStorage.getItem("LIGHTRAG-CORE-VERSION"),r=localStorage.getItem("LIGHTRAG-API-VERSION"),a=localStorage.getItem("LIGHTRAG-WEBUI-TITLE"),o=localStorage.getItem("LIGHTRAG-WEBUI-DESCRIPTION");e({isAuthenticated:!1,isGuestMode:!1,username:null,coreVersion:n,apiVersion:r,webuiTitle:a,webuiDescription:o})},setVersion:(n,r)=>{n&&localStorage.setItem("LIGHTRAG-CORE-VERSION",n),r&&localStorage.setItem("LIGHTRAG-API-VERSION",r),e({coreVersion:n,apiVersion:r})},setCustomTitle:(n,r)=>{n?localStorage.setItem("LIGHTRAG-WEBUI-TITLE",n):localStorage.removeItem("LIGHTRAG-WEBUI-TITLE"),r?localStorage.setItem("LIGHTRAG-WEBUI-DESCRIPTION",r):localStorage.removeItem("LIGHTRAG-WEBUI-DESCRIPTION"),e({webuiTitle:n,webuiDescription:r})}}});var jV=e=>{switch(e){case"success":return HV;case"info":return qV;case"warning":return $V;case"error":return VV;default:return null}},UV=Array(12).fill(0),GV=({visible:e,className:t})=>we.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},we.createElement("div",{className:"sonner-spinner"},UV.map((n,r)=>we.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),HV=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},we.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"})),$V=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},we.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"})),qV=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},we.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"})),VV=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},we.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"})),WV=we.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"},we.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),we.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),YV=()=>{let[e,t]=we.useState(document.hidden);return we.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},T0=1,KV=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=>{var t;let{message:n,...r}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:T0++,o=this.toasts.find(l=>l.id===a),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...e,id:a,title:n}),{...l,...e,id:a,dismissible:s,title:n}):l):this.addToast({title:n,...r,dismissible:s,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,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)=>this.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"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,o,s=r.then(async u=>{if(o=["resolve",u],we.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(ZV(u)&&!u.ok){a=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description;this.create({id:n,type:"error",message:d,description:p})}else if(t.success!==void 0){a=!1;let d=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"success",message:d,description:p})}}).catch(async u=>{if(o=["reject",u],t.error!==void 0){a=!1;let d=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"error",message:d,description:p})}}).finally(()=>{var u;a&&(this.dismiss(n),n=void 0),(u=t.finally)==null||u.call(t)}),l=()=>new Promise((u,d)=>s.then(()=>o[0]==="reject"?d(o[1]):u(o[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||T0++;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}},jn=new KV,XV=(e,t)=>{let n=(t==null?void 0:t.id)||T0++;return jn.addToast({title:e,...t,id:n}),n},ZV=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",QV=XV,JV=()=>jn.toasts,eW=()=>jn.getActiveToasts(),Ft=Object.assign(QV,{success:jn.success,info:jn.info,warning:jn.warning,error:jn.error,custom:jn.custom,message:jn.message,promise:jn.promise,dismiss:jn.dismiss,loading:jn.loading},{getHistory:JV,getToasts:eW});function tW(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}tW(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));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{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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%)} -`);function vd(e){return e.label!==void 0}var nW=3,rW="32px",aW="16px",j_=4e3,oW=356,iW=14,sW=20,lW=200;function Lr(...e){return e.filter(Boolean).join(" ")}function cW(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var uW=e=>{var t,n,r,a,o,s,l,u,d,p,g;let{invert:m,toast:b,unstyled:y,interacting:v,setHeights:x,visibleToasts:T,heights:k,index:R,toasts:O,expanded:N,removeToast:C,defaultRichColors:_,closeButton:M,style:D,cancelButtonStyle:I,actionButtonStyle:U,className:$="",descriptionClassName:B="",duration:W,position:K,gap:G,loadingIcon:H,expandByDefault:F,classNames:Y,icons:L,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:j}=e,[P,Z]=we.useState(null),[Q,oe]=we.useState(null),[ae,ce]=we.useState(!1),[Re,ie]=we.useState(!1),[Te,ne]=we.useState(!1),[xe,Se]=we.useState(!1),[be,J]=we.useState(!1),[pe,ke]=we.useState(0),[he,Ee]=we.useState(0),se=we.useRef(b.duration||W||j_),Be=we.useRef(null),je=we.useRef(null),ye=R===0,Oe=R+1<=T,ee=b.type,de=b.dismissible!==!1,Ne=b.className||"",ze=b.descriptionClassName||"",We=we.useMemo(()=>k.findIndex(Xe=>Xe.toastId===b.id)||0,[k,b.id]),St=we.useMemo(()=>{var Xe;return(Xe=b.closeButton)!=null?Xe:M},[b.closeButton,M]),Tt=we.useMemo(()=>b.duration||W||j_,[b.duration,W]),bt=we.useRef(0),et=we.useRef(0),At=we.useRef(0),st=we.useRef(null),[wt,Ht]=K.split("-"),pn=we.useMemo(()=>k.reduce((Xe,yt,Nt)=>Nt>=We?Xe:Xe+yt.height,0),[k,We]),zt=YV(),sr=b.invert||m,Vr=ee==="loading";et.current=we.useMemo(()=>We*G+pn,[We,pn]),we.useEffect(()=>{se.current=Tt},[Tt]),we.useEffect(()=>{ce(!0)},[]),we.useEffect(()=>{let Xe=je.current;if(Xe){let yt=Xe.getBoundingClientRect().height;return Ee(yt),x(Nt=>[{toastId:b.id,height:yt,position:b.position},...Nt]),()=>x(Nt=>Nt.filter(Dn=>Dn.toastId!==b.id))}},[x,b.id]),we.useLayoutEffect(()=>{if(!ae)return;let Xe=je.current,yt=Xe.style.height;Xe.style.height="auto";let Nt=Xe.getBoundingClientRect().height;Xe.style.height=yt,Ee(Nt),x(Dn=>Dn.find(_n=>_n.toastId===b.id)?Dn.map(_n=>_n.toastId===b.id?{..._n,height:Nt}:_n):[{toastId:b.id,height:Nt,position:b.position},...Dn])},[ae,b.title,b.description,x,b.id]);let Jt=we.useCallback(()=>{ie(!0),ke(et.current),x(Xe=>Xe.filter(yt=>yt.toastId!==b.id)),setTimeout(()=>{C(b)},lW)},[b,C,x,et]);we.useEffect(()=>{if(b.promise&&ee==="loading"||b.duration===1/0||b.type==="loading")return;let Xe;return N||v||j&&zt?(()=>{if(At.current{var yt;(yt=b.onAutoClose)==null||yt.call(b,b),Jt()},se.current)),()=>clearTimeout(Xe)},[N,v,b,ee,j,zt,Jt]),we.useEffect(()=>{b.delete&&Jt()},[Jt,b.delete]);function pa(){var Xe,yt,Nt;return L!=null&&L.loading?we.createElement("div",{className:Lr(Y==null?void 0:Y.loader,(Xe=b==null?void 0:b.classNames)==null?void 0:Xe.loader,"sonner-loader"),"data-visible":ee==="loading"},L.loading):H?we.createElement("div",{className:Lr(Y==null?void 0:Y.loader,(yt=b==null?void 0:b.classNames)==null?void 0:yt.loader,"sonner-loader"),"data-visible":ee==="loading"},H):we.createElement(GV,{className:Lr(Y==null?void 0:Y.loader,(Nt=b==null?void 0:b.classNames)==null?void 0:Nt.loader),visible:ee==="loading"})}return we.createElement("li",{tabIndex:0,ref:je,className:Lr($,Ne,Y==null?void 0:Y.toast,(t=b==null?void 0:b.classNames)==null?void 0:t.toast,Y==null?void 0:Y.default,Y==null?void 0:Y[ee],(n=b==null?void 0:b.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":(r=b.richColors)!=null?r:_,"data-styled":!(b.jsx||b.unstyled||y),"data-mounted":ae,"data-promise":!!b.promise,"data-swiped":be,"data-removed":Re,"data-visible":Oe,"data-y-position":wt,"data-x-position":Ht,"data-index":R,"data-front":ye,"data-swiping":Te,"data-dismissible":de,"data-type":ee,"data-invert":sr,"data-swipe-out":xe,"data-swipe-direction":Q,"data-expanded":!!(N||F&&ae),style:{"--index":R,"--toasts-before":R,"--z-index":O.length-R,"--offset":`${Re?pe:et.current}px`,"--initial-height":F?"auto":`${he}px`,...D,...b.style},onDragEnd:()=>{ne(!1),Z(null),st.current=null},onPointerDown:Xe=>{Vr||!de||(Be.current=new Date,ke(et.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(ne(!0),st.current={x:Xe.clientX,y:Xe.clientY}))},onPointerUp:()=>{var Xe,yt,Nt,Dn;if(xe||!de)return;st.current=null;let _n=Number(((Xe=je.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ln=Number(((yt=je.current)==null?void 0:yt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ga=new Date().getTime()-((Nt=Be.current)==null?void 0:Nt.getTime()),Mn=P==="x"?_n:Ln,_r=Math.abs(Mn)/ga;if(Math.abs(Mn)>=sW||_r>.11){ke(et.current),(Dn=b.onDismiss)==null||Dn.call(b,b),oe(P==="x"?_n>0?"right":"left":Ln>0?"down":"up"),Jt(),Se(!0),J(!1);return}ne(!1),Z(null)},onPointerMove:Xe=>{var yt,Nt,Dn,_n;if(!st.current||!de||((yt=window.getSelection())==null?void 0:yt.toString().length)>0)return;let Ln=Xe.clientY-st.current.y,ga=Xe.clientX-st.current.x,Mn=(Nt=e.swipeDirections)!=null?Nt:cW(K);!P&&(Math.abs(ga)>1||Math.abs(Ln)>1)&&Z(Math.abs(ga)>Math.abs(Ln)?"x":"y");let _r={x:0,y:0};P==="y"?(Mn.includes("top")||Mn.includes("bottom"))&&(Mn.includes("top")&&Ln<0||Mn.includes("bottom")&&Ln>0)&&(_r.y=Ln):P==="x"&&(Mn.includes("left")||Mn.includes("right"))&&(Mn.includes("left")&&ga<0||Mn.includes("right")&&ga>0)&&(_r.x=ga),(Math.abs(_r.x)>0||Math.abs(_r.y)>0)&&J(!0),(Dn=je.current)==null||Dn.style.setProperty("--swipe-amount-x",`${_r.x}px`),(_n=je.current)==null||_n.style.setProperty("--swipe-amount-y",`${_r.y}px`)}},St&&!b.jsx?we.createElement("button",{"aria-label":V,"data-disabled":Vr,"data-close-button":!0,onClick:Vr||!de?()=>{}:()=>{var Xe;Jt(),(Xe=b.onDismiss)==null||Xe.call(b,b)},className:Lr(Y==null?void 0:Y.closeButton,(a=b==null?void 0:b.classNames)==null?void 0:a.closeButton)},(o=L==null?void 0:L.close)!=null?o:WV):null,b.jsx||w.isValidElement(b.title)?b.jsx?b.jsx:typeof b.title=="function"?b.title():b.title:we.createElement(we.Fragment,null,ee||b.icon||b.promise?we.createElement("div",{"data-icon":"",className:Lr(Y==null?void 0:Y.icon,(s=b==null?void 0:b.classNames)==null?void 0:s.icon)},b.promise||b.type==="loading"&&!b.icon?b.icon||pa():null,b.type!=="loading"?b.icon||(L==null?void 0:L[ee])||jV(ee):null):null,we.createElement("div",{"data-content":"",className:Lr(Y==null?void 0:Y.content,(l=b==null?void 0:b.classNames)==null?void 0:l.content)},we.createElement("div",{"data-title":"",className:Lr(Y==null?void 0:Y.title,(u=b==null?void 0:b.classNames)==null?void 0:u.title)},typeof b.title=="function"?b.title():b.title),b.description?we.createElement("div",{"data-description":"",className:Lr(B,ze,Y==null?void 0:Y.description,(d=b==null?void 0:b.classNames)==null?void 0:d.description)},typeof b.description=="function"?b.description():b.description):null),w.isValidElement(b.cancel)?b.cancel:b.cancel&&vd(b.cancel)?we.createElement("button",{"data-button":!0,"data-cancel":!0,style:b.cancelButtonStyle||I,onClick:Xe=>{var yt,Nt;vd(b.cancel)&&de&&((Nt=(yt=b.cancel).onClick)==null||Nt.call(yt,Xe),Jt())},className:Lr(Y==null?void 0:Y.cancelButton,(p=b==null?void 0:b.classNames)==null?void 0:p.cancelButton)},b.cancel.label):null,w.isValidElement(b.action)?b.action:b.action&&vd(b.action)?we.createElement("button",{"data-button":!0,"data-action":!0,style:b.actionButtonStyle||U,onClick:Xe=>{var yt,Nt;vd(b.action)&&((Nt=(yt=b.action).onClick)==null||Nt.call(yt,Xe),!Xe.defaultPrevented&&Jt())},className:Lr(Y==null?void 0:Y.actionButton,(g=b==null?void 0:b.classNames)==null?void 0:g.actionButton)},b.action.label):null))};function U_(){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 dW(e,t){let n={};return[e,t].forEach((r,a)=>{let o=a===1,s=o?"--mobile-offset":"--offset",l=o?aW:rW;function u(d){["top","right","bottom","left"].forEach(p=>{n[`${s}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${s}-${d}`]=l:n[`${s}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(l)}),n}var fW=w.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:s,className:l,offset:u,mobileOffset:d,theme:p="light",richColors:g,duration:m,style:b,visibleToasts:y=nW,toastOptions:v,dir:x=U_(),gap:T=iW,loadingIcon:k,icons:R,containerAriaLabel:O="Notifications",pauseWhenPageIsHidden:N}=e,[C,_]=we.useState([]),M=we.useMemo(()=>Array.from(new Set([r].concat(C.filter(j=>j.position).map(j=>j.position)))),[C,r]),[D,I]=we.useState([]),[U,$]=we.useState(!1),[B,W]=we.useState(!1),[K,G]=we.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=we.useRef(null),F=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),Y=we.useRef(null),L=we.useRef(!1),V=we.useCallback(j=>{_(P=>{var Z;return(Z=P.find(Q=>Q.id===j.id))!=null&&Z.delete||jn.dismiss(j.id),P.filter(({id:Q})=>Q!==j.id)})},[]);return we.useEffect(()=>jn.subscribe(j=>{if(j.dismiss){_(P=>P.map(Z=>Z.id===j.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{fB.flushSync(()=>{_(P=>{let Z=P.findIndex(Q=>Q.id===j.id);return Z!==-1?[...P.slice(0,Z),{...P[Z],...j},...P.slice(Z+1)]:[j,...P]})})})}),[]),we.useEffect(()=>{if(p!=="system"){G(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let j=window.matchMedia("(prefers-color-scheme: dark)");try{j.addEventListener("change",({matches:P})=>{G(P?"dark":"light")})}catch{j.addListener(({matches:Z})=>{try{G(Z?"dark":"light")}catch(Q){console.error(Q)}})}},[p]),we.useEffect(()=>{C.length<=1&&$(!1)},[C]),we.useEffect(()=>{let j=P=>{var Z,Q;a.every(oe=>P[oe]||P.code===oe)&&($(!0),(Z=H.current)==null||Z.focus()),P.code==="Escape"&&(document.activeElement===H.current||(Q=H.current)!=null&&Q.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[a]),we.useEffect(()=>{if(H.current)return()=>{Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null,L.current=!1)}},[H.current]),we.createElement("section",{ref:t,"aria-label":`${O} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((j,P)=>{var Z;let[Q,oe]=j.split("-");return C.length?we.createElement("ol",{key:j,dir:x==="auto"?U_():x,tabIndex:-1,ref:H,className:l,"data-sonner-toaster":!0,"data-theme":K,"data-y-position":Q,"data-lifted":U&&C.length>1&&!o,"data-x-position":oe,style:{"--front-toast-height":`${((Z=D[0])==null?void 0:Z.height)||0}px`,"--width":`${oW}px`,"--gap":`${T}px`,...b,...dW(u,d)},onBlur:ae=>{L.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(L.current=!1,Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||L.current||(L.current=!0,Y.current=ae.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{B||$(!1)},onDragEnd:()=>$(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},C.filter(ae=>!ae.position&&P===0||ae.position===j).map((ae,ce)=>{var Re,ie;return we.createElement(uW,{key:ae.id,icons:R,index:ce,toast:ae,defaultRichColors:g,duration:(Re=v==null?void 0:v.duration)!=null?Re:m,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:y,closeButton:(ie=v==null?void 0:v.closeButton)!=null?ie:s,interacting:B,position:j,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:V,toasts:C.filter(Te=>Te.position==ae.position),heights:D.filter(Te=>Te.position==ae.position),setHeights:I,expandByDefault:o,gap:T,loadingIcon:k,expanded:U,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const pW={theme:"system",setTheme:()=>null},nj=w.createContext(pW);function rj({children:e,...t}){const n=Ie.use.theme(),r=Ie.use.setTheme();w.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),n==="system"){const s=window.matchMedia("(prefers-color-scheme: dark)"),l=u=>{o.classList.remove("light","dark"),o.classList.add(u.matches?"dark":"light")};return o.classList.add(s.matches?"dark":"light"),s.addEventListener("change",l),()=>s.removeEventListener("change",l)}else o.classList.add(n)},[n]);const a={theme:n,setTheme:r};return E.jsx(nj.Provider,{...t,value:a,children:e})}const gW={visibleTabs:{},setTabVisibility:()=>{},isTabVisible:()=>!1},aj=w.createContext(gW),hW=({children:e})=>{const t=Ie.use.currentTab(),[n,r]=w.useState(()=>({documents:!0,"knowledge-graph":!0,retrieval:!0,api:!0}));w.useEffect(()=>{r(o=>({...o,documents:!0,"knowledge-graph":!0,retrieval:!0,api:!0}))},[t]);const a=w.useMemo(()=>({visibleTabs:n,setTabVisibility:(o,s)=>{r(l=>({...l,[o]:s}))},isTabVisible:o=>!!n[o]}),[n]);return E.jsx(aj.Provider,{value:a,children:e})},mW=(e,t,n,r)=>{var o,s,l,u;const a=[n,{code:t,...r||{}}];if((s=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&s.forward)return e.services.logger.forward(a,"warn","react-i18next::",!0);hi(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(u=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&u.warn?e.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},G_={},A0=(e,t,n,r)=>{hi(n)&&G_[n]||(hi(n)&&(G_[n]=new Date),mW(e,t,n,r))},oj=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},R0=(e,t,n)=>{e.loadNamespaces(t,oj(e,n))},H_=(e,t,n,r)=>{if(hi(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return R0(e,n,r);n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,oj(e,r))},bW=(e,t,n={})=>!t.languages||!t.languages.length?(A0(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,a)=>{var o;if(((o=n.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,e))return!1}}),hi=e=>typeof e=="string",yW=e=>typeof e=="object"&&e!==null,vW=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,SW={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},EW=e=>SW[e],wW=e=>e.replace(vW,EW);let C0={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:wW};const xW=(e={})=>{C0={...C0,...e}},kW=()=>C0;let ij;const TW=e=>{ij=e},AW=()=>ij,RW={type:"3rdParty",init(e){xW(e.options.react),TW(e)}},CW=w.createContext();class _W{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const NW=(e,t)=>{const n=w.useRef();return w.useEffect(()=>{n.current=e},[e,t]),n.current},sj=(e,t,n,r)=>e.getFixedT(t,n,r),OW=(e,t,n,r)=>w.useCallback(sj(e,t,n,r),[e,t,n,r]),Et=(e,t={})=>{var O,N,C,_;const{i18n:n}=t,{i18n:r,defaultNS:a}=w.useContext(CW)||{},o=n||r||AW();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new _W),!o){A0(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const M=(I,U)=>hi(U)?U:yW(U)&&hi(U.defaultValue)?U.defaultValue:Array.isArray(I)?I[I.length-1]:I,D=[M,{},!1];return D.t=M,D.i18n={},D.ready=!1,D}(O=o.options.react)!=null&&O.wait&&A0(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...kW(),...o.options.react,...t},{useSuspense:l,keyPrefix:u}=s;let d=a||((N=o.options)==null?void 0:N.defaultNS);d=hi(d)?[d]:d||["translation"],(_=(C=o.reportNamespaces).addUsedNamespaces)==null||_.call(C,d);const p=(o.isInitialized||o.initializedStoreOnce)&&d.every(M=>bW(M,o,s)),g=OW(o,t.lng||null,s.nsMode==="fallback"?d:d[0],u),m=()=>g,b=()=>sj(o,t.lng||null,s.nsMode==="fallback"?d:d[0],u),[y,v]=w.useState(m);let x=d.join();t.lng&&(x=`${t.lng}${x}`);const T=NW(x),k=w.useRef(!0);w.useEffect(()=>{const{bindI18n:M,bindI18nStore:D}=s;k.current=!0,!p&&!l&&(t.lng?H_(o,t.lng,d,()=>{k.current&&v(b)}):R0(o,d,()=>{k.current&&v(b)})),p&&T&&T!==x&&k.current&&v(b);const I=()=>{k.current&&v(b)};return M&&(o==null||o.on(M,I)),D&&(o==null||o.store.on(D,I)),()=>{k.current=!1,o&&(M==null||M.split(" ").forEach(U=>o.off(U,I))),D&&o&&D.split(" ").forEach(U=>o.store.off(U,I))}},[o,x]),w.useEffect(()=>{k.current&&p&&v(m)},[o,u,p]);const R=[y,o,p];if(R.t=y,R.i18n=o,R.ready=p,p||!p&&!l)return R;throw new Promise(M=>{t.lng?H_(o,t.lng,d,()=>M()):R0(o,d,()=>M())})};function IW(e,t){const n=w.createContext(t),r=o=>{const{children:s,...l}=o,u=w.useMemo(()=>l,Object.values(l));return E.jsx(n.Provider,{value:u,children:s})};r.displayName=e+"Provider";function a(o){const s=w.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,a]}function $r(e,t=[]){let n=[];function r(o,s){const l=w.createContext(s),u=n.length;n=[...n,s];const d=g=>{var T;const{scope:m,children:b,...y}=g,v=((T=m==null?void 0:m[e])==null?void 0:T[u])||l,x=w.useMemo(()=>y,Object.values(y));return E.jsx(v.Provider,{value:x,children:b})};d.displayName=o+"Provider";function p(g,m){var v;const b=((v=m==null?void 0:m[e])==null?void 0:v[u])||l,y=w.useContext(b);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[d,p]}const a=()=>{const o=n.map(s=>w.createContext(s));return function(l){const u=(l==null?void 0:l[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return a.scopeName=e,[r,DW(a,...t)]}function DW(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const s=r.reduce((l,{useScope:u,scopeName:d})=>{const g=u(o)[`__scope${d}`];return{...l,...g}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function $_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lj(...e){return t=>{let n=!1;const r=e.map(a=>{const o=$_(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a{},LW=gq.useId||(()=>{}),MW=0;function An(e){const[t,n]=w.useState(LW());return Rn(()=>{n(r=>r??String(MW++))},[e]),t?`radix-${t}`:""}function yn(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ja({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=PW({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,l=yn(n),u=w.useCallback(d=>{if(o){const g=typeof d=="function"?d(e):d;g!==e&&l(g)}else a(d)},[o,e,a,l]);return[s,u]}function PW({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,a=w.useRef(r),o=yn(t);return w.useEffect(()=>{a.current!==r&&(o(r),a.current=r)},[r,a,o]),n}var _o=w.forwardRef((e,t)=>{const{children:n,...r}=e,a=w.Children.toArray(n),o=a.find(FW);if(o){const s=o.props.children,l=a.map(u=>u===o?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:u);return E.jsx(_0,{...r,ref:t,children:w.isValidElement(s)?w.cloneElement(s,void 0,l):null})}return E.jsx(_0,{...r,ref:t,children:n})});_o.displayName="Slot";var _0=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const a=BW(n),o=zW(r,n.props);return n.type!==w.Fragment&&(o.ref=t?lj(t,a):a),w.cloneElement(n,o)}return w.Children.count(n)>1?w.Children.only(null):null});_0.displayName="SlotClone";var Hk=({children:e})=>E.jsx(E.Fragment,{children:e});function FW(e){return w.isValidElement(e)&&e.type===Hk}function zW(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...l)=>{o(...l),a(...l)}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function BW(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jW=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Je=jW.reduce((e,t)=>{const n=w.forwardRef((r,a)=>{const{asChild:o,...s}=r,l=o?_o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(l,{...s,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function UW(e,t){e&&Uc.flushSync(()=>e.dispatchEvent(t))}function GW(e,t=globalThis==null?void 0:globalThis.document){const n=yn(e);w.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var HW="DismissableLayer",N0="dismissableLayer.update",$W="dismissableLayer.pointerDownOutside",qW="dismissableLayer.focusOutside",q_,cj=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$c=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...u}=e,d=w.useContext(cj),[p,g]=w.useState(null),m=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=w.useState({}),y=mt(t,_=>g(_)),v=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),T=v.indexOf(x),k=p?v.indexOf(p):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,O=k>=T,N=YW(_=>{const M=_.target,D=[...d.branches].some(I=>I.contains(M));!O||D||(a==null||a(_),s==null||s(_),_.defaultPrevented||l==null||l())},m),C=KW(_=>{const M=_.target;[...d.branches].some(I=>I.contains(M))||(o==null||o(_),s==null||s(_),_.defaultPrevented||l==null||l())},m);return GW(_=>{k===d.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&l&&(_.preventDefault(),l()))},m),w.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(q_=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),V_(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=q_)}},[p,m,n,d]),w.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),V_())},[p,d]),w.useEffect(()=>{const _=()=>b({});return document.addEventListener(N0,_),()=>document.removeEventListener(N0,_)},[]),E.jsx(Je.div,{...u,ref:y,style:{pointerEvents:R?O?"auto":"none":void 0,...e.style},onFocusCapture:Ke(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ke(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ke(e.onPointerDownCapture,N.onPointerDownCapture)})});$c.displayName=HW;var VW="DismissableLayerBranch",WW=w.forwardRef((e,t)=>{const n=w.useContext(cj),r=w.useRef(null),a=mt(t,r);return w.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),E.jsx(Je.div,{...e,ref:a})});WW.displayName=VW;function YW(e,t=globalThis==null?void 0:globalThis.document){const n=yn(e),r=w.useRef(!1),a=w.useRef(()=>{});return w.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let u=function(){uj($W,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=u,t.addEventListener("click",a.current,{once:!0})):u()}else t.removeEventListener("click",a.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function KW(e,t=globalThis==null?void 0:globalThis.document){const n=yn(e),r=w.useRef(!1);return w.useEffect(()=>{const a=o=>{o.target&&!r.current&&uj(qW,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function V_(){const e=new CustomEvent(N0);document.dispatchEvent(e)}function uj(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?UW(a,o):a.dispatchEvent(o)}var im="focusScope.autoFocusOnMount",sm="focusScope.autoFocusOnUnmount",W_={bubbles:!1,cancelable:!0},XW="FocusScope",ep=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[l,u]=w.useState(null),d=yn(a),p=yn(o),g=w.useRef(null),m=mt(t,v=>u(v)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let v=function(R){if(b.paused||!l)return;const O=R.target;l.contains(O)?g.current=O:Eo(g.current,{select:!0})},x=function(R){if(b.paused||!l)return;const O=R.relatedTarget;O!==null&&(l.contains(O)||Eo(g.current,{select:!0}))},T=function(R){if(document.activeElement===document.body)for(const N of R)N.removedNodes.length>0&&Eo(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",x);const k=new MutationObserver(T);return l&&k.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),k.disconnect()}}},[r,l,b.paused]),w.useEffect(()=>{if(l){K_.add(b);const v=document.activeElement;if(!l.contains(v)){const T=new CustomEvent(im,W_);l.addEventListener(im,d),l.dispatchEvent(T),T.defaultPrevented||(ZW(nY(dj(l)),{select:!0}),document.activeElement===v&&Eo(l))}return()=>{l.removeEventListener(im,d),setTimeout(()=>{const T=new CustomEvent(sm,W_);l.addEventListener(sm,p),l.dispatchEvent(T),T.defaultPrevented||Eo(v??document.body,{select:!0}),l.removeEventListener(sm,p),K_.remove(b)},0)}}},[l,d,p,b]);const y=w.useCallback(v=>{if(!n&&!r||b.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,T=document.activeElement;if(x&&T){const k=v.currentTarget,[R,O]=QW(k);R&&O?!v.shiftKey&&T===O?(v.preventDefault(),n&&Eo(R,{select:!0})):v.shiftKey&&T===R&&(v.preventDefault(),n&&Eo(O,{select:!0})):T===k&&v.preventDefault()}},[n,r,b.paused]);return E.jsx(Je.div,{tabIndex:-1,...s,ref:m,onKeyDown:y})});ep.displayName=XW;function ZW(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Eo(r,{select:t}),document.activeElement!==n)return}function QW(e){const t=dj(e),n=Y_(t,e),r=Y_(t.reverse(),e);return[n,r]}function dj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Y_(e,t){for(const n of e)if(!JW(n,{upTo:t}))return n}function JW(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 eY(e){return e instanceof HTMLInputElement&&"select"in e}function Eo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&eY(e)&&t&&e.select()}}var K_=tY();function tY(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=X_(e,t),e.unshift(t)},remove(t){var n;e=X_(e,t),(n=e[0])==null||n.resume()}}}function X_(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function nY(e){return e.filter(t=>t.tagName!=="A")}var rY="Portal",tp=w.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,o]=w.useState(!1);Rn(()=>o(!0),[]);const s=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?fB.createPortal(E.jsx(Je.div,{...r,ref:t}),s):null});tp.displayName=rY;function aY(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var ir=e=>{const{present:t,children:n}=e,r=oY(t),a=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=mt(r.ref,iY(a));return typeof n=="function"||r.isPresent?w.cloneElement(a,{ref:o}):null};ir.displayName="Presence";function oY(e){const[t,n]=w.useState(),r=w.useRef({}),a=w.useRef(e),o=w.useRef("none"),s=e?"mounted":"unmounted",[l,u]=aY(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const d=Sd(r.current);o.current=l==="mounted"?d:"none"},[l]),Rn(()=>{const d=r.current,p=a.current;if(p!==e){const m=o.current,b=Sd(d);e?u("MOUNT"):b==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(p&&m!==b?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,u]),Rn(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,g=b=>{const v=Sd(r.current).includes(b.animationName);if(b.target===t&&v&&(u("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=b=>{b.target===t&&(o.current=Sd(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function Sd(e){return(e==null?void 0:e.animationName)||"none"}function iY(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lm=0;function $k(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Z_()),document.body.insertAdjacentElement("beforeend",e[1]??Z_()),lm++,()=>{lm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lm--}},[])}function Z_(){const 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 na=function(){return na=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return xY;var t=kY(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])}},AY=hj(),As="data-scroll-locked",RY=function(e,t,n,r){var a=e.left,o=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),` +`);function vd(e){return e.label!==void 0}var nW=3,rW="32px",aW="16px",j_=4e3,oW=356,iW=14,sW=20,lW=200;function Lr(...e){return e.filter(Boolean).join(" ")}function cW(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var uW=e=>{var t,n,r,a,o,s,l,u,d,p,g;let{invert:m,toast:b,unstyled:y,interacting:v,setHeights:x,visibleToasts:T,heights:k,index:R,toasts:O,expanded:N,removeToast:C,defaultRichColors:_,closeButton:M,style:D,cancelButtonStyle:I,actionButtonStyle:U,className:$="",descriptionClassName:B="",duration:W,position:K,gap:G,loadingIcon:H,expandByDefault:F,classNames:Y,icons:L,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:j}=e,[P,Z]=we.useState(null),[Q,oe]=we.useState(null),[ae,ce]=we.useState(!1),[Re,ie]=we.useState(!1),[Te,ne]=we.useState(!1),[xe,Se]=we.useState(!1),[be,J]=we.useState(!1),[pe,ke]=we.useState(0),[he,Ee]=we.useState(0),se=we.useRef(b.duration||W||j_),Be=we.useRef(null),je=we.useRef(null),ye=R===0,Oe=R+1<=T,ee=b.type,de=b.dismissible!==!1,Ne=b.className||"",ze=b.descriptionClassName||"",We=we.useMemo(()=>k.findIndex(Xe=>Xe.toastId===b.id)||0,[k,b.id]),St=we.useMemo(()=>{var Xe;return(Xe=b.closeButton)!=null?Xe:M},[b.closeButton,M]),Tt=we.useMemo(()=>b.duration||W||j_,[b.duration,W]),bt=we.useRef(0),et=we.useRef(0),At=we.useRef(0),st=we.useRef(null),[wt,Ht]=K.split("-"),pn=we.useMemo(()=>k.reduce((Xe,yt,Nt)=>Nt>=We?Xe:Xe+yt.height,0),[k,We]),zt=YV(),sr=b.invert||m,Vr=ee==="loading";et.current=we.useMemo(()=>We*G+pn,[We,pn]),we.useEffect(()=>{se.current=Tt},[Tt]),we.useEffect(()=>{ce(!0)},[]),we.useEffect(()=>{let Xe=je.current;if(Xe){let yt=Xe.getBoundingClientRect().height;return Ee(yt),x(Nt=>[{toastId:b.id,height:yt,position:b.position},...Nt]),()=>x(Nt=>Nt.filter(Dn=>Dn.toastId!==b.id))}},[x,b.id]),we.useLayoutEffect(()=>{if(!ae)return;let Xe=je.current,yt=Xe.style.height;Xe.style.height="auto";let Nt=Xe.getBoundingClientRect().height;Xe.style.height=yt,Ee(Nt),x(Dn=>Dn.find(_n=>_n.toastId===b.id)?Dn.map(_n=>_n.toastId===b.id?{..._n,height:Nt}:_n):[{toastId:b.id,height:Nt,position:b.position},...Dn])},[ae,b.title,b.description,x,b.id]);let Jt=we.useCallback(()=>{ie(!0),ke(et.current),x(Xe=>Xe.filter(yt=>yt.toastId!==b.id)),setTimeout(()=>{C(b)},lW)},[b,C,x,et]);we.useEffect(()=>{if(b.promise&&ee==="loading"||b.duration===1/0||b.type==="loading")return;let Xe;return N||v||j&&zt?(()=>{if(At.current{var yt;(yt=b.onAutoClose)==null||yt.call(b,b),Jt()},se.current)),()=>clearTimeout(Xe)},[N,v,b,ee,j,zt,Jt]),we.useEffect(()=>{b.delete&&Jt()},[Jt,b.delete]);function pa(){var Xe,yt,Nt;return L!=null&&L.loading?we.createElement("div",{className:Lr(Y==null?void 0:Y.loader,(Xe=b==null?void 0:b.classNames)==null?void 0:Xe.loader,"sonner-loader"),"data-visible":ee==="loading"},L.loading):H?we.createElement("div",{className:Lr(Y==null?void 0:Y.loader,(yt=b==null?void 0:b.classNames)==null?void 0:yt.loader,"sonner-loader"),"data-visible":ee==="loading"},H):we.createElement(GV,{className:Lr(Y==null?void 0:Y.loader,(Nt=b==null?void 0:b.classNames)==null?void 0:Nt.loader),visible:ee==="loading"})}return we.createElement("li",{tabIndex:0,ref:je,className:Lr($,Ne,Y==null?void 0:Y.toast,(t=b==null?void 0:b.classNames)==null?void 0:t.toast,Y==null?void 0:Y.default,Y==null?void 0:Y[ee],(n=b==null?void 0:b.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":(r=b.richColors)!=null?r:_,"data-styled":!(b.jsx||b.unstyled||y),"data-mounted":ae,"data-promise":!!b.promise,"data-swiped":be,"data-removed":Re,"data-visible":Oe,"data-y-position":wt,"data-x-position":Ht,"data-index":R,"data-front":ye,"data-swiping":Te,"data-dismissible":de,"data-type":ee,"data-invert":sr,"data-swipe-out":xe,"data-swipe-direction":Q,"data-expanded":!!(N||F&&ae),style:{"--index":R,"--toasts-before":R,"--z-index":O.length-R,"--offset":`${Re?pe:et.current}px`,"--initial-height":F?"auto":`${he}px`,...D,...b.style},onDragEnd:()=>{ne(!1),Z(null),st.current=null},onPointerDown:Xe=>{Vr||!de||(Be.current=new Date,ke(et.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(ne(!0),st.current={x:Xe.clientX,y:Xe.clientY}))},onPointerUp:()=>{var Xe,yt,Nt,Dn;if(xe||!de)return;st.current=null;let _n=Number(((Xe=je.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ln=Number(((yt=je.current)==null?void 0:yt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ga=new Date().getTime()-((Nt=Be.current)==null?void 0:Nt.getTime()),Mn=P==="x"?_n:Ln,_r=Math.abs(Mn)/ga;if(Math.abs(Mn)>=sW||_r>.11){ke(et.current),(Dn=b.onDismiss)==null||Dn.call(b,b),oe(P==="x"?_n>0?"right":"left":Ln>0?"down":"up"),Jt(),Se(!0),J(!1);return}ne(!1),Z(null)},onPointerMove:Xe=>{var yt,Nt,Dn,_n;if(!st.current||!de||((yt=window.getSelection())==null?void 0:yt.toString().length)>0)return;let Ln=Xe.clientY-st.current.y,ga=Xe.clientX-st.current.x,Mn=(Nt=e.swipeDirections)!=null?Nt:cW(K);!P&&(Math.abs(ga)>1||Math.abs(Ln)>1)&&Z(Math.abs(ga)>Math.abs(Ln)?"x":"y");let _r={x:0,y:0};P==="y"?(Mn.includes("top")||Mn.includes("bottom"))&&(Mn.includes("top")&&Ln<0||Mn.includes("bottom")&&Ln>0)&&(_r.y=Ln):P==="x"&&(Mn.includes("left")||Mn.includes("right"))&&(Mn.includes("left")&&ga<0||Mn.includes("right")&&ga>0)&&(_r.x=ga),(Math.abs(_r.x)>0||Math.abs(_r.y)>0)&&J(!0),(Dn=je.current)==null||Dn.style.setProperty("--swipe-amount-x",`${_r.x}px`),(_n=je.current)==null||_n.style.setProperty("--swipe-amount-y",`${_r.y}px`)}},St&&!b.jsx?we.createElement("button",{"aria-label":V,"data-disabled":Vr,"data-close-button":!0,onClick:Vr||!de?()=>{}:()=>{var Xe;Jt(),(Xe=b.onDismiss)==null||Xe.call(b,b)},className:Lr(Y==null?void 0:Y.closeButton,(a=b==null?void 0:b.classNames)==null?void 0:a.closeButton)},(o=L==null?void 0:L.close)!=null?o:WV):null,b.jsx||w.isValidElement(b.title)?b.jsx?b.jsx:typeof b.title=="function"?b.title():b.title:we.createElement(we.Fragment,null,ee||b.icon||b.promise?we.createElement("div",{"data-icon":"",className:Lr(Y==null?void 0:Y.icon,(s=b==null?void 0:b.classNames)==null?void 0:s.icon)},b.promise||b.type==="loading"&&!b.icon?b.icon||pa():null,b.type!=="loading"?b.icon||(L==null?void 0:L[ee])||jV(ee):null):null,we.createElement("div",{"data-content":"",className:Lr(Y==null?void 0:Y.content,(l=b==null?void 0:b.classNames)==null?void 0:l.content)},we.createElement("div",{"data-title":"",className:Lr(Y==null?void 0:Y.title,(u=b==null?void 0:b.classNames)==null?void 0:u.title)},typeof b.title=="function"?b.title():b.title),b.description?we.createElement("div",{"data-description":"",className:Lr(B,ze,Y==null?void 0:Y.description,(d=b==null?void 0:b.classNames)==null?void 0:d.description)},typeof b.description=="function"?b.description():b.description):null),w.isValidElement(b.cancel)?b.cancel:b.cancel&&vd(b.cancel)?we.createElement("button",{"data-button":!0,"data-cancel":!0,style:b.cancelButtonStyle||I,onClick:Xe=>{var yt,Nt;vd(b.cancel)&&de&&((Nt=(yt=b.cancel).onClick)==null||Nt.call(yt,Xe),Jt())},className:Lr(Y==null?void 0:Y.cancelButton,(p=b==null?void 0:b.classNames)==null?void 0:p.cancelButton)},b.cancel.label):null,w.isValidElement(b.action)?b.action:b.action&&vd(b.action)?we.createElement("button",{"data-button":!0,"data-action":!0,style:b.actionButtonStyle||U,onClick:Xe=>{var yt,Nt;vd(b.action)&&((Nt=(yt=b.action).onClick)==null||Nt.call(yt,Xe),!Xe.defaultPrevented&&Jt())},className:Lr(Y==null?void 0:Y.actionButton,(g=b==null?void 0:b.classNames)==null?void 0:g.actionButton)},b.action.label):null))};function U_(){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 dW(e,t){let n={};return[e,t].forEach((r,a)=>{let o=a===1,s=o?"--mobile-offset":"--offset",l=o?aW:rW;function u(d){["top","right","bottom","left"].forEach(p=>{n[`${s}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${s}-${d}`]=l:n[`${s}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(l)}),n}var fW=w.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:s,className:l,offset:u,mobileOffset:d,theme:p="light",richColors:g,duration:m,style:b,visibleToasts:y=nW,toastOptions:v,dir:x=U_(),gap:T=iW,loadingIcon:k,icons:R,containerAriaLabel:O="Notifications",pauseWhenPageIsHidden:N}=e,[C,_]=we.useState([]),M=we.useMemo(()=>Array.from(new Set([r].concat(C.filter(j=>j.position).map(j=>j.position)))),[C,r]),[D,I]=we.useState([]),[U,$]=we.useState(!1),[B,W]=we.useState(!1),[K,G]=we.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=we.useRef(null),F=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),Y=we.useRef(null),L=we.useRef(!1),V=we.useCallback(j=>{_(P=>{var Z;return(Z=P.find(Q=>Q.id===j.id))!=null&&Z.delete||jn.dismiss(j.id),P.filter(({id:Q})=>Q!==j.id)})},[]);return we.useEffect(()=>jn.subscribe(j=>{if(j.dismiss){_(P=>P.map(Z=>Z.id===j.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{fB.flushSync(()=>{_(P=>{let Z=P.findIndex(Q=>Q.id===j.id);return Z!==-1?[...P.slice(0,Z),{...P[Z],...j},...P.slice(Z+1)]:[j,...P]})})})}),[]),we.useEffect(()=>{if(p!=="system"){G(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let j=window.matchMedia("(prefers-color-scheme: dark)");try{j.addEventListener("change",({matches:P})=>{G(P?"dark":"light")})}catch{j.addListener(({matches:Z})=>{try{G(Z?"dark":"light")}catch(Q){console.error(Q)}})}},[p]),we.useEffect(()=>{C.length<=1&&$(!1)},[C]),we.useEffect(()=>{let j=P=>{var Z,Q;a.every(oe=>P[oe]||P.code===oe)&&($(!0),(Z=H.current)==null||Z.focus()),P.code==="Escape"&&(document.activeElement===H.current||(Q=H.current)!=null&&Q.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[a]),we.useEffect(()=>{if(H.current)return()=>{Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null,L.current=!1)}},[H.current]),we.createElement("section",{ref:t,"aria-label":`${O} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((j,P)=>{var Z;let[Q,oe]=j.split("-");return C.length?we.createElement("ol",{key:j,dir:x==="auto"?U_():x,tabIndex:-1,ref:H,className:l,"data-sonner-toaster":!0,"data-theme":K,"data-y-position":Q,"data-lifted":U&&C.length>1&&!o,"data-x-position":oe,style:{"--front-toast-height":`${((Z=D[0])==null?void 0:Z.height)||0}px`,"--width":`${oW}px`,"--gap":`${T}px`,...b,...dW(u,d)},onBlur:ae=>{L.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(L.current=!1,Y.current&&(Y.current.focus({preventScroll:!0}),Y.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||L.current||(L.current=!0,Y.current=ae.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{B||$(!1)},onDragEnd:()=>$(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},C.filter(ae=>!ae.position&&P===0||ae.position===j).map((ae,ce)=>{var Re,ie;return we.createElement(uW,{key:ae.id,icons:R,index:ce,toast:ae,defaultRichColors:g,duration:(Re=v==null?void 0:v.duration)!=null?Re:m,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:y,closeButton:(ie=v==null?void 0:v.closeButton)!=null?ie:s,interacting:B,position:j,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:V,toasts:C.filter(Te=>Te.position==ae.position),heights:D.filter(Te=>Te.position==ae.position),setHeights:I,expandByDefault:o,gap:T,loadingIcon:k,expanded:U,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const pW={theme:"system",setTheme:()=>null},nj=w.createContext(pW);function rj({children:e,...t}){const n=Ie.use.theme(),r=Ie.use.setTheme();w.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),n==="system"){const s=window.matchMedia("(prefers-color-scheme: dark)"),l=u=>{o.classList.remove("light","dark"),o.classList.add(u.matches?"dark":"light")};return o.classList.add(s.matches?"dark":"light"),s.addEventListener("change",l),()=>s.removeEventListener("change",l)}else o.classList.add(n)},[n]);const a={theme:n,setTheme:r};return E.jsx(nj.Provider,{...t,value:a,children:e})}const gW={visibleTabs:{},setTabVisibility:()=>{},isTabVisible:()=>!1},aj=w.createContext(gW),hW=({children:e})=>{const t=Ie.use.currentTab(),[n,r]=w.useState(()=>({documents:!0,"knowledge-graph":!0,retrieval:!0,api:!0}));w.useEffect(()=>{r(o=>({...o,documents:!0,"knowledge-graph":!0,retrieval:!0,api:!0}))},[t]);const a=w.useMemo(()=>({visibleTabs:n,setTabVisibility:(o,s)=>{r(l=>({...l,[o]:s}))},isTabVisible:o=>!!n[o]}),[n]);return E.jsx(aj.Provider,{value:a,children:e})},mW=(e,t,n,r)=>{var o,s,l,u;const a=[n,{code:t,...r||{}}];if((s=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&s.forward)return e.services.logger.forward(a,"warn","react-i18next::",!0);hi(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(u=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&u.warn?e.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},G_={},A0=(e,t,n,r)=>{hi(n)&&G_[n]||(hi(n)&&(G_[n]=new Date),mW(e,t,n,r))},oj=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},R0=(e,t,n)=>{e.loadNamespaces(t,oj(e,n))},H_=(e,t,n,r)=>{if(hi(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return R0(e,n,r);n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,oj(e,r))},bW=(e,t,n={})=>!t.languages||!t.languages.length?(A0(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,a)=>{var o;if(((o=n.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,e))return!1}}),hi=e=>typeof e=="string",yW=e=>typeof e=="object"&&e!==null,vW=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,SW={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},EW=e=>SW[e],wW=e=>e.replace(vW,EW);let C0={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:wW};const xW=(e={})=>{C0={...C0,...e}},kW=()=>C0;let ij;const TW=e=>{ij=e},AW=()=>ij,RW={type:"3rdParty",init(e){xW(e.options.react),TW(e)}},CW=w.createContext();class _W{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const NW=(e,t)=>{const n=w.useRef();return w.useEffect(()=>{n.current=e},[e,t]),n.current},sj=(e,t,n,r)=>e.getFixedT(t,n,r),OW=(e,t,n,r)=>w.useCallback(sj(e,t,n,r),[e,t,n,r]),Et=(e,t={})=>{var O,N,C,_;const{i18n:n}=t,{i18n:r,defaultNS:a}=w.useContext(CW)||{},o=n||r||AW();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new _W),!o){A0(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const M=(I,U)=>hi(U)?U:yW(U)&&hi(U.defaultValue)?U.defaultValue:Array.isArray(I)?I[I.length-1]:I,D=[M,{},!1];return D.t=M,D.i18n={},D.ready=!1,D}(O=o.options.react)!=null&&O.wait&&A0(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...kW(),...o.options.react,...t},{useSuspense:l,keyPrefix:u}=s;let d=a||((N=o.options)==null?void 0:N.defaultNS);d=hi(d)?[d]:d||["translation"],(_=(C=o.reportNamespaces).addUsedNamespaces)==null||_.call(C,d);const p=(o.isInitialized||o.initializedStoreOnce)&&d.every(M=>bW(M,o,s)),g=OW(o,t.lng||null,s.nsMode==="fallback"?d:d[0],u),m=()=>g,b=()=>sj(o,t.lng||null,s.nsMode==="fallback"?d:d[0],u),[y,v]=w.useState(m);let x=d.join();t.lng&&(x=`${t.lng}${x}`);const T=NW(x),k=w.useRef(!0);w.useEffect(()=>{const{bindI18n:M,bindI18nStore:D}=s;k.current=!0,!p&&!l&&(t.lng?H_(o,t.lng,d,()=>{k.current&&v(b)}):R0(o,d,()=>{k.current&&v(b)})),p&&T&&T!==x&&k.current&&v(b);const I=()=>{k.current&&v(b)};return M&&(o==null||o.on(M,I)),D&&(o==null||o.store.on(D,I)),()=>{k.current=!1,o&&(M==null||M.split(" ").forEach(U=>o.off(U,I))),D&&o&&D.split(" ").forEach(U=>o.store.off(U,I))}},[o,x]),w.useEffect(()=>{k.current&&p&&v(m)},[o,u,p]);const R=[y,o,p];if(R.t=y,R.i18n=o,R.ready=p,p||!p&&!l)return R;throw new Promise(M=>{t.lng?H_(o,t.lng,d,()=>M()):R0(o,d,()=>M())})};function IW(e,t){const n=w.createContext(t),r=o=>{const{children:s,...l}=o,u=w.useMemo(()=>l,Object.values(l));return E.jsx(n.Provider,{value:u,children:s})};r.displayName=e+"Provider";function a(o){const s=w.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,a]}function $r(e,t=[]){let n=[];function r(o,s){const l=w.createContext(s),u=n.length;n=[...n,s];const d=g=>{var T;const{scope:m,children:b,...y}=g,v=((T=m==null?void 0:m[e])==null?void 0:T[u])||l,x=w.useMemo(()=>y,Object.values(y));return E.jsx(v.Provider,{value:x,children:b})};d.displayName=o+"Provider";function p(g,m){var v;const b=((v=m==null?void 0:m[e])==null?void 0:v[u])||l,y=w.useContext(b);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[d,p]}const a=()=>{const o=n.map(s=>w.createContext(s));return function(l){const u=(l==null?void 0:l[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return a.scopeName=e,[r,DW(a,...t)]}function DW(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const s=r.reduce((l,{useScope:u,scopeName:d})=>{const g=u(o)[`__scope${d}`];return{...l,...g}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function $_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lj(...e){return t=>{let n=!1;const r=e.map(a=>{const o=$_(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a{},LW=gq.useId||(()=>{}),MW=0;function An(e){const[t,n]=w.useState(LW());return Rn(()=>{n(r=>r??String(MW++))},[e]),t?`radix-${t}`:""}function vn(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ja({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=PW({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,l=vn(n),u=w.useCallback(d=>{if(o){const g=typeof d=="function"?d(e):d;g!==e&&l(g)}else a(d)},[o,e,a,l]);return[s,u]}function PW({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,a=w.useRef(r),o=vn(t);return w.useEffect(()=>{a.current!==r&&(o(r),a.current=r)},[r,a,o]),n}var _o=w.forwardRef((e,t)=>{const{children:n,...r}=e,a=w.Children.toArray(n),o=a.find(FW);if(o){const s=o.props.children,l=a.map(u=>u===o?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:u);return E.jsx(_0,{...r,ref:t,children:w.isValidElement(s)?w.cloneElement(s,void 0,l):null})}return E.jsx(_0,{...r,ref:t,children:n})});_o.displayName="Slot";var _0=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const a=BW(n),o=zW(r,n.props);return n.type!==w.Fragment&&(o.ref=t?lj(t,a):a),w.cloneElement(n,o)}return w.Children.count(n)>1?w.Children.only(null):null});_0.displayName="SlotClone";var Hk=({children:e})=>E.jsx(E.Fragment,{children:e});function FW(e){return w.isValidElement(e)&&e.type===Hk}function zW(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...l)=>{o(...l),a(...l)}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function BW(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jW=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Je=jW.reduce((e,t)=>{const n=w.forwardRef((r,a)=>{const{asChild:o,...s}=r,l=o?_o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(l,{...s,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function UW(e,t){e&&Uc.flushSync(()=>e.dispatchEvent(t))}function GW(e,t=globalThis==null?void 0:globalThis.document){const n=vn(e);w.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var HW="DismissableLayer",N0="dismissableLayer.update",$W="dismissableLayer.pointerDownOutside",qW="dismissableLayer.focusOutside",q_,cj=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$c=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...u}=e,d=w.useContext(cj),[p,g]=w.useState(null),m=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=w.useState({}),y=mt(t,_=>g(_)),v=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),T=v.indexOf(x),k=p?v.indexOf(p):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,O=k>=T,N=YW(_=>{const M=_.target,D=[...d.branches].some(I=>I.contains(M));!O||D||(a==null||a(_),s==null||s(_),_.defaultPrevented||l==null||l())},m),C=KW(_=>{const M=_.target;[...d.branches].some(I=>I.contains(M))||(o==null||o(_),s==null||s(_),_.defaultPrevented||l==null||l())},m);return GW(_=>{k===d.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&l&&(_.preventDefault(),l()))},m),w.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(q_=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),V_(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=q_)}},[p,m,n,d]),w.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),V_())},[p,d]),w.useEffect(()=>{const _=()=>b({});return document.addEventListener(N0,_),()=>document.removeEventListener(N0,_)},[]),E.jsx(Je.div,{...u,ref:y,style:{pointerEvents:R?O?"auto":"none":void 0,...e.style},onFocusCapture:Ke(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ke(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ke(e.onPointerDownCapture,N.onPointerDownCapture)})});$c.displayName=HW;var VW="DismissableLayerBranch",WW=w.forwardRef((e,t)=>{const n=w.useContext(cj),r=w.useRef(null),a=mt(t,r);return w.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),E.jsx(Je.div,{...e,ref:a})});WW.displayName=VW;function YW(e,t=globalThis==null?void 0:globalThis.document){const n=vn(e),r=w.useRef(!1),a=w.useRef(()=>{});return w.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let u=function(){uj($W,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=u,t.addEventListener("click",a.current,{once:!0})):u()}else t.removeEventListener("click",a.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function KW(e,t=globalThis==null?void 0:globalThis.document){const n=vn(e),r=w.useRef(!1);return w.useEffect(()=>{const a=o=>{o.target&&!r.current&&uj(qW,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function V_(){const e=new CustomEvent(N0);document.dispatchEvent(e)}function uj(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?UW(a,o):a.dispatchEvent(o)}var im="focusScope.autoFocusOnMount",sm="focusScope.autoFocusOnUnmount",W_={bubbles:!1,cancelable:!0},XW="FocusScope",ep=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[l,u]=w.useState(null),d=vn(a),p=vn(o),g=w.useRef(null),m=mt(t,v=>u(v)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let v=function(R){if(b.paused||!l)return;const O=R.target;l.contains(O)?g.current=O:Eo(g.current,{select:!0})},x=function(R){if(b.paused||!l)return;const O=R.relatedTarget;O!==null&&(l.contains(O)||Eo(g.current,{select:!0}))},T=function(R){if(document.activeElement===document.body)for(const N of R)N.removedNodes.length>0&&Eo(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",x);const k=new MutationObserver(T);return l&&k.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),k.disconnect()}}},[r,l,b.paused]),w.useEffect(()=>{if(l){K_.add(b);const v=document.activeElement;if(!l.contains(v)){const T=new CustomEvent(im,W_);l.addEventListener(im,d),l.dispatchEvent(T),T.defaultPrevented||(ZW(nY(dj(l)),{select:!0}),document.activeElement===v&&Eo(l))}return()=>{l.removeEventListener(im,d),setTimeout(()=>{const T=new CustomEvent(sm,W_);l.addEventListener(sm,p),l.dispatchEvent(T),T.defaultPrevented||Eo(v??document.body,{select:!0}),l.removeEventListener(sm,p),K_.remove(b)},0)}}},[l,d,p,b]);const y=w.useCallback(v=>{if(!n&&!r||b.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,T=document.activeElement;if(x&&T){const k=v.currentTarget,[R,O]=QW(k);R&&O?!v.shiftKey&&T===O?(v.preventDefault(),n&&Eo(R,{select:!0})):v.shiftKey&&T===R&&(v.preventDefault(),n&&Eo(O,{select:!0})):T===k&&v.preventDefault()}},[n,r,b.paused]);return E.jsx(Je.div,{tabIndex:-1,...s,ref:m,onKeyDown:y})});ep.displayName=XW;function ZW(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Eo(r,{select:t}),document.activeElement!==n)return}function QW(e){const t=dj(e),n=Y_(t,e),r=Y_(t.reverse(),e);return[n,r]}function dj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Y_(e,t){for(const n of e)if(!JW(n,{upTo:t}))return n}function JW(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 eY(e){return e instanceof HTMLInputElement&&"select"in e}function Eo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&eY(e)&&t&&e.select()}}var K_=tY();function tY(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=X_(e,t),e.unshift(t)},remove(t){var n;e=X_(e,t),(n=e[0])==null||n.resume()}}}function X_(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function nY(e){return e.filter(t=>t.tagName!=="A")}var rY="Portal",tp=w.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,o]=w.useState(!1);Rn(()=>o(!0),[]);const s=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?fB.createPortal(E.jsx(Je.div,{...r,ref:t}),s):null});tp.displayName=rY;function aY(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var ir=e=>{const{present:t,children:n}=e,r=oY(t),a=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=mt(r.ref,iY(a));return typeof n=="function"||r.isPresent?w.cloneElement(a,{ref:o}):null};ir.displayName="Presence";function oY(e){const[t,n]=w.useState(),r=w.useRef({}),a=w.useRef(e),o=w.useRef("none"),s=e?"mounted":"unmounted",[l,u]=aY(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const d=Sd(r.current);o.current=l==="mounted"?d:"none"},[l]),Rn(()=>{const d=r.current,p=a.current;if(p!==e){const m=o.current,b=Sd(d);e?u("MOUNT"):b==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(p&&m!==b?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,u]),Rn(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,g=b=>{const v=Sd(r.current).includes(b.animationName);if(b.target===t&&v&&(u("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=b=>{b.target===t&&(o.current=Sd(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function Sd(e){return(e==null?void 0:e.animationName)||"none"}function iY(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lm=0;function $k(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Z_()),document.body.insertAdjacentElement("beforeend",e[1]??Z_()),lm++,()=>{lm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lm--}},[])}function Z_(){const 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 na=function(){return na=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return xY;var t=kY(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])}},AY=hj(),As="data-scroll-locked",RY=function(e,t,n,r){var a=e.left,o=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),` .`.concat(lY,` { overflow: hidden `).concat(r,`; padding-right: `).concat(l,"px ").concat(r,`; @@ -117,7 +117,7 @@ You can add a description to the \`${Rs}\` by passing a \`${qj}\` component as a Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Rs}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},uK=Bj,dK=jj,Xj=Uj,Zj=Gj,Qj=Wj,Jj=Kj,eU=$j,tU=Vj;const rN=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,aN=gB,fK=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return aN(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:o}=t,s=Object.keys(a).map(d=>{const p=n==null?void 0:n[d],g=o==null?void 0:o[d];if(p===null)return null;const m=rN(p)||rN(g);return a[d][m]}),l=n&&Object.entries(n).reduce((d,p)=>{let[g,m]=p;return m===void 0||(d[g]=m),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:g,className:m,...b}=p;return Object.entries(b).every(y=>{let[v,x]=y;return Array.isArray(x)?x.includes({...o,...l}[v]):{...o,...l}[v]===x})?[...d,g,m]:d},[]);return aN(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},pK=["top","right","bottom","left"],No=Math.min,er=Math.max,yf=Math.round,Td=Math.floor,oa=e=>({x:e,y:e}),gK={left:"right",right:"left",bottom:"top",top:"bottom"},hK={start:"end",end:"start"};function I0(e,t,n){return er(e,No(t,n))}function Ua(e,t){return typeof e=="function"?e(t):e}function Ga(e){return e.split("-")[0]}function Vs(e){return e.split("-")[1]}function tT(e){return e==="x"?"y":"x"}function nT(e){return e==="y"?"height":"width"}function Oo(e){return["top","bottom"].includes(Ga(e))?"y":"x"}function rT(e){return tT(Oo(e))}function mK(e,t,n){n===void 0&&(n=!1);const r=Vs(e),a=rT(e),o=nT(a);let s=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=vf(s)),[s,vf(s)]}function bK(e){const t=vf(e);return[D0(e),t,D0(t)]}function D0(e){return e.replace(/start|end/g,t=>hK[t])}function yK(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:s;default:return[]}}function vK(e,t,n,r){const a=Vs(e);let o=yK(Ga(e),n==="start",r);return a&&(o=o.map(s=>s+"-"+a),t&&(o=o.concat(o.map(D0)))),o}function vf(e){return e.replace(/left|right|bottom|top/g,t=>gK[t])}function SK(e){return{top:0,right:0,bottom:0,left:0,...e}}function nU(e){return typeof e!="number"?SK(e):{top:e,right:e,bottom:e,left:e}}function Sf(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function oN(e,t,n){let{reference:r,floating:a}=e;const o=Oo(t),s=rT(t),l=nT(s),u=Ga(t),d=o==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,m=r[l]/2-a[l]/2;let b;switch(u){case"top":b={x:p,y:r.y-a.height};break;case"bottom":b={x:p,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-a.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Vs(t)){case"start":b[s]-=m*(n&&d?-1:1);break;case"end":b[s]+=m*(n&&d?-1:1);break}return b}const EK=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=oN(d,r,u),m=r,b={},y=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:s,elements:l,middlewareData:u}=t,{element:d,padding:p=0}=Ua(e,t)||{};if(d==null)return{};const g=nU(p),m={x:n,y:r},b=rT(a),y=nT(b),v=await s.getDimensions(d),x=b==="y",T=x?"top":"left",k=x?"bottom":"right",R=x?"clientHeight":"clientWidth",O=o.reference[y]+o.reference[b]-m[b]-o.floating[y],N=m[b]-o.reference[b],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let _=C?C[R]:0;(!_||!await(s.isElement==null?void 0:s.isElement(C)))&&(_=l.floating[R]||o.floating[y]);const M=O/2-N/2,D=_/2-v[y]/2-1,I=No(g[T],D),U=No(g[k],D),$=I,B=_-v[y]-U,W=_/2-v[y]/2+M,K=I0($,W,B),G=!u.arrow&&Vs(a)!=null&&W!==K&&o.reference[y]/2-(W<$?I:U)-v[y]/2<0,H=G?W<$?W-$:W-B:0;return{[b]:m[b]+H,data:{[b]:K,centerOffset:W-K-H,...G&&{alignmentOffset:H}},reset:G}}}),xK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:s,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...x}=Ua(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const T=Ga(a),k=Oo(l),R=Ga(l)===l,O=await(u.isRTL==null?void 0:u.isRTL(d.floating)),N=m||(R||!v?[vf(l)]:bK(l)),C=y!=="none";!m&&C&&N.push(...vK(l,v,y,O));const _=[l,...N],M=await wc(t,x),D=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&D.push(M[T]),g){const W=mK(a,s,O);D.push(M[W[0]],M[W[1]])}if(I=[...I,{placement:a,overflows:D}],!D.every(W=>W<=0)){var U,$;const W=(((U=o.flip)==null?void 0:U.index)||0)+1,K=_[W];if(K)return{data:{index:W,overflows:I},reset:{placement:K}};let G=($=I.filter(H=>H.overflows[0]<=0).sort((H,F)=>H.overflows[1]-F.overflows[1])[0])==null?void 0:$.placement;if(!G)switch(b){case"bestFit":{var B;const H=(B=I.filter(F=>{if(C){const Y=Oo(F.placement);return Y===k||Y==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(Y=>Y>0).reduce((Y,L)=>Y+L,0)]).sort((F,Y)=>F[1]-Y[1])[0])==null?void 0:B[0];H&&(G=H);break}case"initialPlacement":G=l;break}if(a!==G)return{reset:{placement:G}}}return{}}}};function iN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sN(e){return pK.some(t=>e[t]>=0)}const kK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Ua(e,t);switch(r){case"referenceHidden":{const o=await wc(t,{...a,elementContext:"reference"}),s=iN(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:sN(s)}}}case"escaped":{const o=await wc(t,{...a,altBoundary:!0}),s=iN(o,n.floating);return{data:{escapedOffsets:s,escaped:sN(s)}}}default:return{}}}}};async function TK(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),s=Ga(n),l=Vs(n),u=Oo(n)==="y",d=["left","top"].includes(s)?-1:1,p=o&&u?-1:1,g=Ua(t,e);let{mainAxis:m,crossAxis:b,alignmentAxis:y}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof y=="number"&&(b=l==="end"?y*-1:y),u?{x:b*p,y:m*d}:{x:m*d,y:b*p}}const AK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:s,middlewareData:l}=t,u=await TK(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+u.x,y:o+u.y,data:{...u,placement:s}}}}},RK=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:x=>{let{x:T,y:k}=x;return{x:T,y:k}}},...u}=Ua(e,t),d={x:n,y:r},p=await wc(t,u),g=Oo(Ga(a)),m=tT(g);let b=d[m],y=d[g];if(o){const x=m==="y"?"top":"left",T=m==="y"?"bottom":"right",k=b+p[x],R=b-p[T];b=I0(k,b,R)}if(s){const x=g==="y"?"top":"left",T=g==="y"?"bottom":"right",k=y+p[x],R=y-p[T];y=I0(k,y,R)}const v=l.fn({...t,[m]:b,[g]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:o,[g]:s}}}}}},CK=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:s}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Ua(e,t),p={x:n,y:r},g=Oo(a),m=tT(g);let b=p[m],y=p[g];const v=Ua(l,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const R=m==="y"?"height":"width",O=o.reference[m]-o.floating[R]+x.mainAxis,N=o.reference[m]+o.reference[R]-x.mainAxis;bN&&(b=N)}if(d){var T,k;const R=m==="y"?"width":"height",O=["top","left"].includes(Ga(a)),N=o.reference[g]-o.floating[R]+(O&&((T=s.offset)==null?void 0:T[g])||0)+(O?0:x.crossAxis),C=o.reference[g]+o.reference[R]+(O?0:((k=s.offset)==null?void 0:k[g])||0)-(O?x.crossAxis:0);yC&&(y=C)}return{[m]:b,[g]:y}}}},_K=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:s,elements:l}=t,{apply:u=()=>{},...d}=Ua(e,t),p=await wc(t,d),g=Ga(a),m=Vs(a),b=Oo(a)==="y",{width:y,height:v}=o.floating;let x,T;g==="top"||g==="bottom"?(x=g,T=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(T=g,x=m==="end"?"top":"bottom");const k=v-p.top-p.bottom,R=y-p.left-p.right,O=No(v-p[x],k),N=No(y-p[T],R),C=!t.middlewareData.shift;let _=O,M=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=k),C&&!m){const I=er(p.left,0),U=er(p.right,0),$=er(p.top,0),B=er(p.bottom,0);b?M=y-2*(I!==0||U!==0?I+U:er(p.left,p.right)):_=v-2*($!==0||B!==0?$+B:er(p.top,p.bottom))}await u({...t,availableWidth:M,availableHeight:_});const D=await s.getDimensions(l.floating);return y!==D.width||v!==D.height?{reset:{rects:!0}}:{}}}};function ip(){return typeof window<"u"}function Ws(e){return rU(e)?(e.nodeName||"").toLowerCase():"#document"}function ar(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function la(e){var t;return(t=(rU(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function rU(e){return ip()?e instanceof Node||e instanceof ar(e).Node:!1}function Ur(e){return ip()?e instanceof Element||e instanceof ar(e).Element:!1}function ia(e){return ip()?e instanceof HTMLElement||e instanceof ar(e).HTMLElement:!1}function lN(e){return!ip()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ar(e).ShadowRoot}function qc(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Gr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function NK(e){return["table","td","th"].includes(Ws(e))}function sp(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function aT(e){const t=oT(),n=Ur(e)?Gr(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function OK(e){let t=Io(e);for(;ia(t)&&!Ds(t);){if(aT(t))return t;if(sp(t))return null;t=Io(t)}return null}function oT(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ds(e){return["html","body","#document"].includes(Ws(e))}function Gr(e){return ar(e).getComputedStyle(e)}function lp(e){return Ur(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Io(e){if(Ws(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lN(e)&&e.host||la(e);return lN(t)?t.host:t}function aU(e){const t=Io(e);return Ds(t)?e.ownerDocument?e.ownerDocument.body:e.body:ia(t)&&qc(t)?t:aU(t)}function xc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=aU(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),s=ar(a);if(o){const l=L0(s);return t.concat(s,s.visualViewport||[],qc(a)?a:[],l&&n?xc(l):[])}return t.concat(a,xc(a,[],n))}function L0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oU(e){const t=Gr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ia(e),o=a?e.offsetWidth:n,s=a?e.offsetHeight:r,l=yf(n)!==o||yf(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function iT(e){return Ur(e)?e:e.contextElement}function Cs(e){const t=iT(e);if(!ia(t))return oa(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=oU(t);let s=(o?yf(n.width):n.width)/r,l=(o?yf(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const IK=oa(0);function iU(e){const t=ar(e);return!oT()||!t.visualViewport?IK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DK(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ar(e)?!1:t}function yi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=iT(e);let s=oa(1);t&&(r?Ur(r)&&(s=Cs(r)):s=Cs(e));const l=DK(o,n,r)?iU(o):oa(0);let u=(a.left+l.x)/s.x,d=(a.top+l.y)/s.y,p=a.width/s.x,g=a.height/s.y;if(o){const m=ar(o),b=r&&Ur(r)?ar(r):r;let y=m,v=L0(y);for(;v&&r&&b!==y;){const x=Cs(v),T=v.getBoundingClientRect(),k=Gr(v),R=T.left+(v.clientLeft+parseFloat(k.paddingLeft))*x.x,O=T.top+(v.clientTop+parseFloat(k.paddingTop))*x.y;u*=x.x,d*=x.y,p*=x.x,g*=x.y,u+=R,d+=O,y=ar(v),v=L0(y)}}return Sf({width:p,height:g,x:u,y:d})}function sT(e,t){const n=lp(e).scrollLeft;return t?t.left+n:yi(la(e)).left+n}function sU(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:sT(e,r)),o=r.top+t.scrollTop;return{x:a,y:o}}function LK(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",s=la(r),l=t?sp(t.floating):!1;if(r===s||l&&o)return n;let u={scrollLeft:0,scrollTop:0},d=oa(1);const p=oa(0),g=ia(r);if((g||!g&&!o)&&((Ws(r)!=="body"||qc(s))&&(u=lp(r)),ia(r))){const b=yi(r);d=Cs(r),p.x=b.x+r.clientLeft,p.y=b.y+r.clientTop}const m=s&&!g&&!o?sU(s,u,!0):oa(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+p.x+m.x,y:n.y*d.y-u.scrollTop*d.y+p.y+m.y}}function MK(e){return Array.from(e.getClientRects())}function PK(e){const t=la(e),n=lp(e),r=e.ownerDocument.body,a=er(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=er(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+sT(e);const l=-n.scrollTop;return Gr(r).direction==="rtl"&&(s+=er(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:s,y:l}}function FK(e,t){const n=ar(e),r=la(e),a=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(a){o=a.width,s=a.height;const d=oT();(!d||d&&t==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}return{width:o,height:s,x:l,y:u}}function zK(e,t){const n=yi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=ia(e)?Cs(e):oa(1),s=e.clientWidth*o.x,l=e.clientHeight*o.y,u=a*o.x,d=r*o.y;return{width:s,height:l,x:u,y:d}}function cN(e,t,n){let r;if(t==="viewport")r=FK(e,n);else if(t==="document")r=PK(la(e));else if(Ur(t))r=zK(t,n);else{const a=iU(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Sf(r)}function lU(e,t){const n=Io(e);return n===t||!Ur(n)||Ds(n)?!1:Gr(n).position==="fixed"||lU(n,t)}function BK(e,t){const n=t.get(e);if(n)return n;let r=xc(e,[],!1).filter(l=>Ur(l)&&Ws(l)!=="body"),a=null;const o=Gr(e).position==="fixed";let s=o?Io(e):e;for(;Ur(s)&&!Ds(s);){const l=Gr(s),u=aT(s);!u&&l.position==="fixed"&&(a=null),(o?!u&&!a:!u&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||qc(s)&&!u&&lU(e,s))?r=r.filter(p=>p!==s):a=l,s=Io(s)}return t.set(e,r),r}function jK(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const s=[...n==="clippingAncestors"?sp(t)?[]:BK(t,this._c):[].concat(n),r],l=s[0],u=s.reduce((d,p)=>{const g=cN(t,p,a);return d.top=er(g.top,d.top),d.right=No(g.right,d.right),d.bottom=No(g.bottom,d.bottom),d.left=er(g.left,d.left),d},cN(t,l,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function UK(e){const{width:t,height:n}=oU(e);return{width:t,height:n}}function GK(e,t,n){const r=ia(t),a=la(t),o=n==="fixed",s=yi(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const u=oa(0);if(r||!r&&!o)if((Ws(t)!=="body"||qc(a))&&(l=lp(t)),r){const m=yi(t,!0,o,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else a&&(u.x=sT(a));const d=a&&!r&&!o?sU(a,l):oa(0),p=s.left+l.scrollLeft-u.x-d.x,g=s.top+l.scrollTop-u.y-d.y;return{x:p,y:g,width:s.width,height:s.height}}function pm(e){return Gr(e).position==="static"}function uN(e,t){if(!ia(e)||Gr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return la(e)===n&&(n=n.ownerDocument.body),n}function cU(e,t){const n=ar(e);if(sp(e))return n;if(!ia(e)){let a=Io(e);for(;a&&!Ds(a);){if(Ur(a)&&!pm(a))return a;a=Io(a)}return n}let r=uN(e,t);for(;r&&NK(r)&&pm(r);)r=uN(r,t);return r&&Ds(r)&&pm(r)&&!aT(r)?n:r||OK(e)||n}const HK=async function(e){const t=this.getOffsetParent||cU,n=this.getDimensions,r=await n(e.floating);return{reference:GK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $K(e){return Gr(e).direction==="rtl"}const qK={convertOffsetParentRelativeRectToViewportRelativeRect:LK,getDocumentElement:la,getClippingRect:jK,getOffsetParent:cU,getElementRects:HK,getClientRects:MK,getDimensions:UK,getScale:Cs,isElement:Ur,isRTL:$K};function uU(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function VK(e,t){let n=null,r;const a=la(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),o();const d=e.getBoundingClientRect(),{left:p,top:g,width:m,height:b}=d;if(l||t(),!m||!b)return;const y=Td(g),v=Td(a.clientWidth-(p+m)),x=Td(a.clientHeight-(g+b)),T=Td(p),R={rootMargin:-y+"px "+-v+"px "+-x+"px "+-T+"px",threshold:er(0,No(1,u))||1};let O=!0;function N(C){const _=C[0].intersectionRatio;if(_!==u){if(!O)return s();_?s(!1,_):r=setTimeout(()=>{s(!1,1e-7)},1e3)}_===1&&!uU(d,e.getBoundingClientRect())&&s(),O=!1}try{n=new IntersectionObserver(N,{...R,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,R)}n.observe(e)}return s(!0),o}function WK(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=iT(e),p=a||o?[...d?xc(d):[],...xc(t)]:[];p.forEach(T=>{a&&T.addEventListener("scroll",n,{passive:!0}),o&&T.addEventListener("resize",n)});const g=d&&l?VK(d,n):null;let m=-1,b=null;s&&(b=new ResizeObserver(T=>{let[k]=T;k&&k.target===d&&b&&(b.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var R;(R=b)==null||R.observe(t)})),n()}),d&&!u&&b.observe(d),b.observe(t));let y,v=u?yi(e):null;u&&x();function x(){const T=yi(e);v&&!uU(v,T)&&n(),v=T,y=requestAnimationFrame(x)}return n(),()=>{var T;p.forEach(k=>{a&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),g==null||g(),(T=b)==null||T.disconnect(),b=null,u&&cancelAnimationFrame(y)}}const YK=AK,KK=RK,XK=xK,ZK=_K,QK=kK,dN=wK,JK=CK,eX=(e,t,n)=>{const r=new Map,a={platform:qK,...n},o={...a.platform,_c:r};return EK(e,t,{...a,platform:o})};var ef=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Ef(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,a;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(!Ef(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!Ef(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function dU(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fN(e,t){const n=dU(e);return Math.round(t*n)/n}function gm(e){const t=w.useRef(e);return ef(()=>{t.current=e}),t}function tX(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:s}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[p,g]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,b]=w.useState(r);Ef(m,r)||b(r);const[y,v]=w.useState(null),[x,T]=w.useState(null),k=w.useCallback(F=>{F!==C.current&&(C.current=F,v(F))},[]),R=w.useCallback(F=>{F!==_.current&&(_.current=F,T(F))},[]),O=o||y,N=s||x,C=w.useRef(null),_=w.useRef(null),M=w.useRef(p),D=u!=null,I=gm(u),U=gm(a),$=gm(d),B=w.useCallback(()=>{if(!C.current||!_.current)return;const F={placement:t,strategy:n,middleware:m};U.current&&(F.platform=U.current),eX(C.current,_.current,F).then(Y=>{const L={...Y,isPositioned:$.current!==!1};W.current&&!Ef(M.current,L)&&(M.current=L,Uc.flushSync(()=>{g(L)}))})},[m,t,n,U,$]);ef(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,g(F=>({...F,isPositioned:!1})))},[d]);const W=w.useRef(!1);ef(()=>(W.current=!0,()=>{W.current=!1}),[]),ef(()=>{if(O&&(C.current=O),N&&(_.current=N),O&&N){if(I.current)return I.current(O,N,B);B()}},[O,N,B,I,D]);const K=w.useMemo(()=>({reference:C,floating:_,setReference:k,setFloating:R}),[k,R]),G=w.useMemo(()=>({reference:O,floating:N}),[O,N]),H=w.useMemo(()=>{const F={position:n,left:0,top:0};if(!G.floating)return F;const Y=fN(G.floating,p.x),L=fN(G.floating,p.y);return l?{...F,transform:"translate("+Y+"px, "+L+"px)",...dU(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:L}},[n,l,G.floating,p.x,p.y]);return w.useMemo(()=>({...p,update:B,refs:K,elements:G,floatingStyles:H}),[p,B,K,G,H])}const nX=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dN({element:r.current,padding:a}).fn(n):{}:r?dN({element:r,padding:a}).fn(n):{}}}},rX=(e,t)=>({...YK(e),options:[e,t]}),aX=(e,t)=>({...KK(e),options:[e,t]}),oX=(e,t)=>({...JK(e),options:[e,t]}),iX=(e,t)=>({...XK(e),options:[e,t]}),sX=(e,t)=>({...ZK(e),options:[e,t]}),lX=(e,t)=>({...QK(e),options:[e,t]}),cX=(e,t)=>({...nX(e),options:[e,t]});var uX="Arrow",fU=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return E.jsx(Je.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E.jsx("polygon",{points:"0,0 30,0 15,10"})})});fU.displayName=uX;var dX=fU;function pU(e){const[t,n]=w.useState(void 0);return Rn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let s,l;if("borderBoxSize"in o){const u=o.borderBoxSize,d=Array.isArray(u)?u[0]:u;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var lT="Popper",[gU,Ys]=$r(lT),[fX,hU]=gU(lT),mU=e=>{const{__scopePopper:t,children:n}=e,[r,a]=w.useState(null);return E.jsx(fX,{scope:t,anchor:r,onAnchorChange:a,children:n})};mU.displayName=lT;var bU="PopperAnchor",yU=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=hU(bU,n),s=w.useRef(null),l=mt(t,s);return w.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:E.jsx(Je.div,{...a,ref:l})});yU.displayName=bU;var cT="PopperContent",[pX,gX]=gU(cT),vU=w.forwardRef((e,t)=>{var ae,ce,Re,ie,Te,ne;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:m=!1,updatePositionStrategy:b="optimized",onPlaced:y,...v}=e,x=hU(cT,n),[T,k]=w.useState(null),R=mt(t,xe=>k(xe)),[O,N]=w.useState(null),C=pU(O),_=(C==null?void 0:C.width)??0,M=(C==null?void 0:C.height)??0,D=r+(o!=="center"?"-"+o:""),I=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},U=Array.isArray(d)?d:[d],$=U.length>0,B={padding:I,boundary:U.filter(mX),altBoundary:$},{refs:W,floatingStyles:K,placement:G,isPositioned:H,middlewareData:F}=tX({strategy:"fixed",placement:D,whileElementsMounted:(...xe)=>WK(...xe,{animationFrame:b==="always"}),elements:{reference:x.anchor},middleware:[rX({mainAxis:a+M,alignmentAxis:s}),u&&aX({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?oX():void 0,...B}),u&&iX({...B}),sX({...B,apply:({elements:xe,rects:Se,availableWidth:be,availableHeight:J})=>{const{width:pe,height:ke}=Se.reference,he=xe.floating.style;he.setProperty("--radix-popper-available-width",`${be}px`),he.setProperty("--radix-popper-available-height",`${J}px`),he.setProperty("--radix-popper-anchor-width",`${pe}px`),he.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),O&&cX({element:O,padding:l}),bX({arrowWidth:_,arrowHeight:M}),m&&lX({strategy:"referenceHidden",...B})]}),[Y,L]=wU(G),V=yn(y);Rn(()=>{H&&(V==null||V())},[H,V]);const j=(ae=F.arrow)==null?void 0:ae.x,P=(ce=F.arrow)==null?void 0:ce.y,Z=((Re=F.arrow)==null?void 0:Re.centerOffset)!==0,[Q,oe]=w.useState();return Rn(()=>{T&&oe(window.getComputedStyle(T).zIndex)},[T]),E.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:H?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ie=F.transformOrigin)==null?void 0:ie.x,(Te=F.transformOrigin)==null?void 0:Te.y].join(" "),...((ne=F.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:E.jsx(pX,{scope:n,placedSide:Y,onArrowChange:N,arrowX:j,arrowY:P,shouldHideArrow:Z,children:E.jsx(Je.div,{"data-side":Y,"data-align":L,...v,ref:R,style:{...v.style,animation:H?void 0:"none"}})})})});vU.displayName=cT;var SU="PopperArrow",hX={top:"bottom",right:"left",bottom:"top",left:"right"},EU=w.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=gX(SU,r),s=hX[o.placedSide];return E.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:E.jsx(dX,{...a,ref:n,style:{...a.style,display:"block"}})})});EU.displayName=SU;function mX(e){return e!==null}var bX=e=>({name:"transformOrigin",options:e,fn(t){var x,T,k;const{placement:n,rects:r,middlewareData:a}=t,s=((x=a.arrow)==null?void 0:x.centerOffset)!==0,l=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[d,p]=wU(n),g={start:"0%",center:"50%",end:"100%"}[p],m=(((T=a.arrow)==null?void 0:T.x)??0)+l/2,b=(((k=a.arrow)==null?void 0:k.y)??0)+u/2;let y="",v="";return d==="bottom"?(y=s?g:`${m}px`,v=`${-u}px`):d==="top"?(y=s?g:`${m}px`,v=`${r.floating.height+u}px`):d==="right"?(y=`${-u}px`,v=s?g:`${b}px`):d==="left"&&(y=`${r.floating.width+u}px`,v=s?g:`${b}px`),{data:{x:y,y:v}}}});function wU(e){const[t,n="center"]=e.split("-");return[t,n]}var uT=mU,cp=yU,dT=vU,fT=EU,yX="VisuallyHidden",pT=w.forwardRef((e,t)=>E.jsx(Je.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));pT.displayName=yX;var vX=pT,[up,p0e]=$r("Tooltip",[Ys]),dp=Ys(),xU="TooltipProvider",SX=700,M0="tooltip.open",[EX,gT]=up(xU),kU=e=>{const{__scopeTooltip:t,delayDuration:n=SX,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=e,[s,l]=w.useState(!0),u=w.useRef(!1),d=w.useRef(0);return w.useEffect(()=>{const p=d.current;return()=>window.clearTimeout(p)},[]),E.jsx(EX,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:w.useCallback(p=>{u.current=p},[]),disableHoverableContent:a,children:o})};kU.displayName=xU;var fp="Tooltip",[wX,pp]=up(fp),TU=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:l}=e,u=gT(fp,e.__scopeTooltip),d=dp(t),[p,g]=w.useState(null),m=An(),b=w.useRef(0),y=s??u.disableHoverableContent,v=l??u.delayDuration,x=w.useRef(!1),[T=!1,k]=ja({prop:r,defaultProp:a,onChange:_=>{_?(u.onOpen(),document.dispatchEvent(new CustomEvent(M0))):u.onClose(),o==null||o(_)}}),R=w.useMemo(()=>T?x.current?"delayed-open":"instant-open":"closed",[T]),O=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,x.current=!1,k(!0)},[k]),N=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,k(!1)},[k]),C=w.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{x.current=!0,k(!0),b.current=0},v)},[v,k]);return w.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),E.jsx(uT,{...d,children:E.jsx(wX,{scope:t,contentId:m,open:T,stateAttribute:R,trigger:p,onTriggerChange:g,onTriggerEnter:w.useCallback(()=>{u.isOpenDelayed?C():O()},[u.isOpenDelayed,C,O]),onTriggerLeave:w.useCallback(()=>{y?N():(window.clearTimeout(b.current),b.current=0)},[N,y]),onOpen:O,onClose:N,disableHoverableContent:y,children:n})})};TU.displayName=fp;var P0="TooltipTrigger",AU=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=pp(P0,n),o=gT(P0,n),s=dp(n),l=w.useRef(null),u=mt(t,l,a.onTriggerChange),d=w.useRef(!1),p=w.useRef(!1),g=w.useCallback(()=>d.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),E.jsx(cp,{asChild:!0,...s,children:E.jsx(Je.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:u,onPointerMove:Ke(e.onPointerMove,m=>{m.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ke(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:Ke(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ke(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:Ke(e.onBlur,a.onClose),onClick:Ke(e.onClick,a.onClose)})})});AU.displayName=P0;var xX="TooltipPortal",[g0e,kX]=up(xX,{forceMount:void 0}),Ls="TooltipContent",RU=w.forwardRef((e,t)=>{const n=kX(Ls,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...o}=e,s=pp(Ls,e.__scopeTooltip);return E.jsx(ir,{present:r||s.open,children:s.disableHoverableContent?E.jsx(CU,{side:a,...o,ref:t}):E.jsx(TX,{side:a,...o,ref:t})})}),TX=w.forwardRef((e,t)=>{const n=pp(Ls,e.__scopeTooltip),r=gT(Ls,e.__scopeTooltip),a=w.useRef(null),o=mt(t,a),[s,l]=w.useState(null),{trigger:u,onClose:d}=n,p=a.current,{onPointerInTransitChange:g}=r,m=w.useCallback(()=>{l(null),g(!1)},[g]),b=w.useCallback((y,v)=>{const x=y.currentTarget,T={x:y.clientX,y:y.clientY},k=_X(T,x.getBoundingClientRect()),R=NX(T,k),O=OX(v.getBoundingClientRect()),N=DX([...R,...O]);l(N),g(!0)},[g]);return w.useEffect(()=>()=>m(),[m]),w.useEffect(()=>{if(u&&p){const y=x=>b(x,p),v=x=>b(x,u);return u.addEventListener("pointerleave",y),p.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",y),p.removeEventListener("pointerleave",v)}}},[u,p,b,m]),w.useEffect(()=>{if(s){const y=v=>{const x=v.target,T={x:v.clientX,y:v.clientY},k=(u==null?void 0:u.contains(x))||(p==null?void 0:p.contains(x)),R=!IX(T,s);k?m():R&&(m(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,p,s,d,m]),E.jsx(CU,{...e,ref:o})}),[AX,RX]=up(fp,{isInside:!1}),CU=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:s,...l}=e,u=pp(Ls,n),d=dp(n),{onClose:p}=u;return w.useEffect(()=>(document.addEventListener(M0,p),()=>document.removeEventListener(M0,p)),[p]),w.useEffect(()=>{if(u.trigger){const g=m=>{const b=m.target;b!=null&&b.contains(u.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,p]),E.jsx($c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:E.jsxs(dT,{"data-state":u.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[E.jsx(Hk,{children:r}),E.jsx(AX,{scope:n,isInside:!0,children:E.jsx(vX,{id:u.contentId,role:"tooltip",children:a||r})})]})})});RU.displayName=Ls;var _U="TooltipArrow",CX=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=dp(n);return RX(_U,n).isInside?null:E.jsx(fT,{...a,...r,ref:t})});CX.displayName=_U;function _X(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,a,o)){case o:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function NX(e,t,n=5){const 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 OX(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function IX(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,s=t.length-1;or!=p>r&&n<(d-l)*(r-u)/(p-u)+l&&(a=!a)}return a}function DX(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),LX(t)}function LX(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(a.y-s.y)>=(o.y-s.y)*(a.x-s.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(a.y-s.y)>=(o.y-s.y)*(a.x-s.x))n.pop();else break}n.push(a)}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 MX=kU,PX=TU,FX=AU,NU=RU;const hT=MX,mT=PX,bT=FX,zX=e=>typeof e!="string"?e:E.jsx("div",{className:"relative top-0 pt-1 whitespace-pre-wrap break-words",children:e}),gp=w.forwardRef(({className:e,side:t="left",align:n="start",children:r,...a},o)=>{const s=w.useRef(null);return w.useEffect(()=>{s.current&&(s.current.scrollTop=0)},[r]),E.jsx(NU,{ref:o,side:t,align:n,className:Me("bg-popover text-popover-foreground 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 max-h-[60vh] overflow-y-auto whitespace-pre-wrap break-words rounded-md border px-3 py-2 text-sm shadow-md z-60",e),...a,children:typeof r=="string"?zX(r):r})});gp.displayName=NU.displayName;const wf=fK("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-8"}},defaultVariants:{variant:"default",size:"default"}}),nt=w.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:a="right",asChild:o=!1,...s},l)=>{const u=o?_o:"button";return n?E.jsx(hT,{children:E.jsxs(mT,{children:[E.jsx(bT,{asChild:!0,children:E.jsx(u,{className:Me(wf({variant:t,size:r,className:e}),"cursor-pointer"),ref:l,...s})}),E.jsx(gp,{side:a,children:n})]})}):E.jsx(u,{className:Me(wf({variant:t,size:r,className:e}),"cursor-pointer"),ref:l,...s})});nt.displayName="Button";const BX=uK,jX=dK,OU=w.forwardRef(({className:e,...t},n)=>E.jsx(Xj,{className:Me("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,ref:n}));OU.displayName=Xj.displayName;const IU=w.forwardRef(({className:e,...t},n)=>E.jsxs(jX,{children:[E.jsx(OU,{}),E.jsx(Zj,{ref:n,className:Me("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 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));IU.displayName=Zj.displayName;const DU=({className:e,...t})=>E.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});DU.displayName="AlertDialogHeader";const LU=w.forwardRef(({className:e,...t},n)=>E.jsx(eU,{ref:n,className:Me("text-lg font-semibold",e),...t}));LU.displayName=eU.displayName;const MU=w.forwardRef(({className:e,...t},n)=>E.jsx(tU,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));MU.displayName=tU.displayName;const UX=w.forwardRef(({className:e,...t},n)=>E.jsx(Qj,{ref:n,className:Me(wf(),e),...t}));UX.displayName=Qj.displayName;const GX=w.forwardRef(({className:e,...t},n)=>E.jsx(Jj,{ref:n,className:Me(wf({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));GX.displayName=Jj.displayName;const Tr=w.forwardRef(({className:e,type:t,...n},r)=>E.jsx("input",{type:t,className:Me("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm [&::-webkit-inner-spin-button]:opacity-50 [&::-webkit-outer-spin-button]:opacity-50",e),ref:r,...n}));Tr.displayName="Input";const HX=({open:e,onOpenChange:t})=>{const{t:n}=Et(),r=Ie.use.apiKey(),[a,o]=w.useState(""),s=rr.use.message();w.useEffect(()=>{o(r||"")},[r,e]),w.useEffect(()=>{s&&(s.includes(XB)||s.includes(ZB))&&t(!0)},[s,t]);const l=w.useCallback(()=>{Ie.setState({apiKey:a||null}),t(!1)},[a,t]),u=w.useCallback(d=>{o(d.target.value)},[o]);return E.jsx(BX,{open:e,onOpenChange:t,children:E.jsxs(IU,{children:[E.jsxs(DU,{children:[E.jsx(LU,{children:n("apiKeyAlert.title")}),E.jsx(MU,{children:n("apiKeyAlert.description")})]}),E.jsxs("div",{className:"flex flex-col gap-4",children:[E.jsxs("form",{className:"flex gap-2",onSubmit:d=>d.preventDefault(),children:[E.jsx(Tr,{type:"password",value:a,onChange:u,placeholder:n("apiKeyAlert.placeholder"),className:"max-h-full w-full min-w-0",autoComplete:"off"}),E.jsx(nt,{onClick:l,variant:"outline",size:"sm",children:n("apiKeyAlert.save")})]}),s&&E.jsx("div",{className:"text-sm text-red-500",children:s})]})]})})};/** +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},uK=Bj,dK=jj,Xj=Uj,Zj=Gj,Qj=Wj,Jj=Kj,eU=$j,tU=Vj;const rN=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,aN=gB,fK=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return aN(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:o}=t,s=Object.keys(a).map(d=>{const p=n==null?void 0:n[d],g=o==null?void 0:o[d];if(p===null)return null;const m=rN(p)||rN(g);return a[d][m]}),l=n&&Object.entries(n).reduce((d,p)=>{let[g,m]=p;return m===void 0||(d[g]=m),d},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:g,className:m,...b}=p;return Object.entries(b).every(y=>{let[v,x]=y;return Array.isArray(x)?x.includes({...o,...l}[v]):{...o,...l}[v]===x})?[...d,g,m]:d},[]);return aN(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},pK=["top","right","bottom","left"],No=Math.min,er=Math.max,yf=Math.round,Td=Math.floor,oa=e=>({x:e,y:e}),gK={left:"right",right:"left",bottom:"top",top:"bottom"},hK={start:"end",end:"start"};function I0(e,t,n){return er(e,No(t,n))}function Ua(e,t){return typeof e=="function"?e(t):e}function Ga(e){return e.split("-")[0]}function Vs(e){return e.split("-")[1]}function tT(e){return e==="x"?"y":"x"}function nT(e){return e==="y"?"height":"width"}function Oo(e){return["top","bottom"].includes(Ga(e))?"y":"x"}function rT(e){return tT(Oo(e))}function mK(e,t,n){n===void 0&&(n=!1);const r=Vs(e),a=rT(e),o=nT(a);let s=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=vf(s)),[s,vf(s)]}function bK(e){const t=vf(e);return[D0(e),t,D0(t)]}function D0(e){return e.replace(/start|end/g,t=>hK[t])}function yK(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:s;default:return[]}}function vK(e,t,n,r){const a=Vs(e);let o=yK(Ga(e),n==="start",r);return a&&(o=o.map(s=>s+"-"+a),t&&(o=o.concat(o.map(D0)))),o}function vf(e){return e.replace(/left|right|bottom|top/g,t=>gK[t])}function SK(e){return{top:0,right:0,bottom:0,left:0,...e}}function nU(e){return typeof e!="number"?SK(e):{top:e,right:e,bottom:e,left:e}}function Sf(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function oN(e,t,n){let{reference:r,floating:a}=e;const o=Oo(t),s=rT(t),l=nT(s),u=Ga(t),d=o==="y",p=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,m=r[l]/2-a[l]/2;let b;switch(u){case"top":b={x:p,y:r.y-a.height};break;case"bottom":b={x:p,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-a.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Vs(t)){case"start":b[s]-=m*(n&&d?-1:1);break;case"end":b[s]+=m*(n&&d?-1:1);break}return b}const EK=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=oN(d,r,u),m=r,b={},y=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:s,elements:l,middlewareData:u}=t,{element:d,padding:p=0}=Ua(e,t)||{};if(d==null)return{};const g=nU(p),m={x:n,y:r},b=rT(a),y=nT(b),v=await s.getDimensions(d),x=b==="y",T=x?"top":"left",k=x?"bottom":"right",R=x?"clientHeight":"clientWidth",O=o.reference[y]+o.reference[b]-m[b]-o.floating[y],N=m[b]-o.reference[b],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let _=C?C[R]:0;(!_||!await(s.isElement==null?void 0:s.isElement(C)))&&(_=l.floating[R]||o.floating[y]);const M=O/2-N/2,D=_/2-v[y]/2-1,I=No(g[T],D),U=No(g[k],D),$=I,B=_-v[y]-U,W=_/2-v[y]/2+M,K=I0($,W,B),G=!u.arrow&&Vs(a)!=null&&W!==K&&o.reference[y]/2-(W<$?I:U)-v[y]/2<0,H=G?W<$?W-$:W-B:0;return{[b]:m[b]+H,data:{[b]:K,centerOffset:W-K-H,...G&&{alignmentOffset:H}},reset:G}}}),xK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:s,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...x}=Ua(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const T=Ga(a),k=Oo(l),R=Ga(l)===l,O=await(u.isRTL==null?void 0:u.isRTL(d.floating)),N=m||(R||!v?[vf(l)]:bK(l)),C=y!=="none";!m&&C&&N.push(...vK(l,v,y,O));const _=[l,...N],M=await wc(t,x),D=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&D.push(M[T]),g){const W=mK(a,s,O);D.push(M[W[0]],M[W[1]])}if(I=[...I,{placement:a,overflows:D}],!D.every(W=>W<=0)){var U,$;const W=(((U=o.flip)==null?void 0:U.index)||0)+1,K=_[W];if(K)return{data:{index:W,overflows:I},reset:{placement:K}};let G=($=I.filter(H=>H.overflows[0]<=0).sort((H,F)=>H.overflows[1]-F.overflows[1])[0])==null?void 0:$.placement;if(!G)switch(b){case"bestFit":{var B;const H=(B=I.filter(F=>{if(C){const Y=Oo(F.placement);return Y===k||Y==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(Y=>Y>0).reduce((Y,L)=>Y+L,0)]).sort((F,Y)=>F[1]-Y[1])[0])==null?void 0:B[0];H&&(G=H);break}case"initialPlacement":G=l;break}if(a!==G)return{reset:{placement:G}}}return{}}}};function iN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sN(e){return pK.some(t=>e[t]>=0)}const kK=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Ua(e,t);switch(r){case"referenceHidden":{const o=await wc(t,{...a,elementContext:"reference"}),s=iN(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:sN(s)}}}case"escaped":{const o=await wc(t,{...a,altBoundary:!0}),s=iN(o,n.floating);return{data:{escapedOffsets:s,escaped:sN(s)}}}default:return{}}}}};async function TK(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),s=Ga(n),l=Vs(n),u=Oo(n)==="y",d=["left","top"].includes(s)?-1:1,p=o&&u?-1:1,g=Ua(t,e);let{mainAxis:m,crossAxis:b,alignmentAxis:y}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof y=="number"&&(b=l==="end"?y*-1:y),u?{x:b*p,y:m*d}:{x:m*d,y:b*p}}const AK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:s,middlewareData:l}=t,u=await TK(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+u.x,y:o+u.y,data:{...u,placement:s}}}}},RK=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:x=>{let{x:T,y:k}=x;return{x:T,y:k}}},...u}=Ua(e,t),d={x:n,y:r},p=await wc(t,u),g=Oo(Ga(a)),m=tT(g);let b=d[m],y=d[g];if(o){const x=m==="y"?"top":"left",T=m==="y"?"bottom":"right",k=b+p[x],R=b-p[T];b=I0(k,b,R)}if(s){const x=g==="y"?"top":"left",T=g==="y"?"bottom":"right",k=y+p[x],R=y-p[T];y=I0(k,y,R)}const v=l.fn({...t,[m]:b,[g]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:o,[g]:s}}}}}},CK=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:s}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Ua(e,t),p={x:n,y:r},g=Oo(a),m=tT(g);let b=p[m],y=p[g];const v=Ua(l,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const R=m==="y"?"height":"width",O=o.reference[m]-o.floating[R]+x.mainAxis,N=o.reference[m]+o.reference[R]-x.mainAxis;bN&&(b=N)}if(d){var T,k;const R=m==="y"?"width":"height",O=["top","left"].includes(Ga(a)),N=o.reference[g]-o.floating[R]+(O&&((T=s.offset)==null?void 0:T[g])||0)+(O?0:x.crossAxis),C=o.reference[g]+o.reference[R]+(O?0:((k=s.offset)==null?void 0:k[g])||0)-(O?x.crossAxis:0);yC&&(y=C)}return{[m]:b,[g]:y}}}},_K=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:s,elements:l}=t,{apply:u=()=>{},...d}=Ua(e,t),p=await wc(t,d),g=Ga(a),m=Vs(a),b=Oo(a)==="y",{width:y,height:v}=o.floating;let x,T;g==="top"||g==="bottom"?(x=g,T=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(T=g,x=m==="end"?"top":"bottom");const k=v-p.top-p.bottom,R=y-p.left-p.right,O=No(v-p[x],k),N=No(y-p[T],R),C=!t.middlewareData.shift;let _=O,M=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=k),C&&!m){const I=er(p.left,0),U=er(p.right,0),$=er(p.top,0),B=er(p.bottom,0);b?M=y-2*(I!==0||U!==0?I+U:er(p.left,p.right)):_=v-2*($!==0||B!==0?$+B:er(p.top,p.bottom))}await u({...t,availableWidth:M,availableHeight:_});const D=await s.getDimensions(l.floating);return y!==D.width||v!==D.height?{reset:{rects:!0}}:{}}}};function ip(){return typeof window<"u"}function Ws(e){return rU(e)?(e.nodeName||"").toLowerCase():"#document"}function ar(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function la(e){var t;return(t=(rU(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function rU(e){return ip()?e instanceof Node||e instanceof ar(e).Node:!1}function Ur(e){return ip()?e instanceof Element||e instanceof ar(e).Element:!1}function ia(e){return ip()?e instanceof HTMLElement||e instanceof ar(e).HTMLElement:!1}function lN(e){return!ip()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ar(e).ShadowRoot}function qc(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Gr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function NK(e){return["table","td","th"].includes(Ws(e))}function sp(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function aT(e){const t=oT(),n=Ur(e)?Gr(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function OK(e){let t=Io(e);for(;ia(t)&&!Ds(t);){if(aT(t))return t;if(sp(t))return null;t=Io(t)}return null}function oT(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ds(e){return["html","body","#document"].includes(Ws(e))}function Gr(e){return ar(e).getComputedStyle(e)}function lp(e){return Ur(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Io(e){if(Ws(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lN(e)&&e.host||la(e);return lN(t)?t.host:t}function aU(e){const t=Io(e);return Ds(t)?e.ownerDocument?e.ownerDocument.body:e.body:ia(t)&&qc(t)?t:aU(t)}function xc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=aU(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),s=ar(a);if(o){const l=L0(s);return t.concat(s,s.visualViewport||[],qc(a)?a:[],l&&n?xc(l):[])}return t.concat(a,xc(a,[],n))}function L0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oU(e){const t=Gr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ia(e),o=a?e.offsetWidth:n,s=a?e.offsetHeight:r,l=yf(n)!==o||yf(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function iT(e){return Ur(e)?e:e.contextElement}function Cs(e){const t=iT(e);if(!ia(t))return oa(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=oU(t);let s=(o?yf(n.width):n.width)/r,l=(o?yf(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const IK=oa(0);function iU(e){const t=ar(e);return!oT()||!t.visualViewport?IK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DK(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ar(e)?!1:t}function yi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=iT(e);let s=oa(1);t&&(r?Ur(r)&&(s=Cs(r)):s=Cs(e));const l=DK(o,n,r)?iU(o):oa(0);let u=(a.left+l.x)/s.x,d=(a.top+l.y)/s.y,p=a.width/s.x,g=a.height/s.y;if(o){const m=ar(o),b=r&&Ur(r)?ar(r):r;let y=m,v=L0(y);for(;v&&r&&b!==y;){const x=Cs(v),T=v.getBoundingClientRect(),k=Gr(v),R=T.left+(v.clientLeft+parseFloat(k.paddingLeft))*x.x,O=T.top+(v.clientTop+parseFloat(k.paddingTop))*x.y;u*=x.x,d*=x.y,p*=x.x,g*=x.y,u+=R,d+=O,y=ar(v),v=L0(y)}}return Sf({width:p,height:g,x:u,y:d})}function sT(e,t){const n=lp(e).scrollLeft;return t?t.left+n:yi(la(e)).left+n}function sU(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:sT(e,r)),o=r.top+t.scrollTop;return{x:a,y:o}}function LK(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",s=la(r),l=t?sp(t.floating):!1;if(r===s||l&&o)return n;let u={scrollLeft:0,scrollTop:0},d=oa(1);const p=oa(0),g=ia(r);if((g||!g&&!o)&&((Ws(r)!=="body"||qc(s))&&(u=lp(r)),ia(r))){const b=yi(r);d=Cs(r),p.x=b.x+r.clientLeft,p.y=b.y+r.clientTop}const m=s&&!g&&!o?sU(s,u,!0):oa(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+p.x+m.x,y:n.y*d.y-u.scrollTop*d.y+p.y+m.y}}function MK(e){return Array.from(e.getClientRects())}function PK(e){const t=la(e),n=lp(e),r=e.ownerDocument.body,a=er(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=er(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+sT(e);const l=-n.scrollTop;return Gr(r).direction==="rtl"&&(s+=er(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:s,y:l}}function FK(e,t){const n=ar(e),r=la(e),a=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(a){o=a.width,s=a.height;const d=oT();(!d||d&&t==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}return{width:o,height:s,x:l,y:u}}function zK(e,t){const n=yi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=ia(e)?Cs(e):oa(1),s=e.clientWidth*o.x,l=e.clientHeight*o.y,u=a*o.x,d=r*o.y;return{width:s,height:l,x:u,y:d}}function cN(e,t,n){let r;if(t==="viewport")r=FK(e,n);else if(t==="document")r=PK(la(e));else if(Ur(t))r=zK(t,n);else{const a=iU(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Sf(r)}function lU(e,t){const n=Io(e);return n===t||!Ur(n)||Ds(n)?!1:Gr(n).position==="fixed"||lU(n,t)}function BK(e,t){const n=t.get(e);if(n)return n;let r=xc(e,[],!1).filter(l=>Ur(l)&&Ws(l)!=="body"),a=null;const o=Gr(e).position==="fixed";let s=o?Io(e):e;for(;Ur(s)&&!Ds(s);){const l=Gr(s),u=aT(s);!u&&l.position==="fixed"&&(a=null),(o?!u&&!a:!u&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||qc(s)&&!u&&lU(e,s))?r=r.filter(p=>p!==s):a=l,s=Io(s)}return t.set(e,r),r}function jK(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const s=[...n==="clippingAncestors"?sp(t)?[]:BK(t,this._c):[].concat(n),r],l=s[0],u=s.reduce((d,p)=>{const g=cN(t,p,a);return d.top=er(g.top,d.top),d.right=No(g.right,d.right),d.bottom=No(g.bottom,d.bottom),d.left=er(g.left,d.left),d},cN(t,l,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function UK(e){const{width:t,height:n}=oU(e);return{width:t,height:n}}function GK(e,t,n){const r=ia(t),a=la(t),o=n==="fixed",s=yi(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const u=oa(0);if(r||!r&&!o)if((Ws(t)!=="body"||qc(a))&&(l=lp(t)),r){const m=yi(t,!0,o,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else a&&(u.x=sT(a));const d=a&&!r&&!o?sU(a,l):oa(0),p=s.left+l.scrollLeft-u.x-d.x,g=s.top+l.scrollTop-u.y-d.y;return{x:p,y:g,width:s.width,height:s.height}}function pm(e){return Gr(e).position==="static"}function uN(e,t){if(!ia(e)||Gr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return la(e)===n&&(n=n.ownerDocument.body),n}function cU(e,t){const n=ar(e);if(sp(e))return n;if(!ia(e)){let a=Io(e);for(;a&&!Ds(a);){if(Ur(a)&&!pm(a))return a;a=Io(a)}return n}let r=uN(e,t);for(;r&&NK(r)&&pm(r);)r=uN(r,t);return r&&Ds(r)&&pm(r)&&!aT(r)?n:r||OK(e)||n}const HK=async function(e){const t=this.getOffsetParent||cU,n=this.getDimensions,r=await n(e.floating);return{reference:GK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $K(e){return Gr(e).direction==="rtl"}const qK={convertOffsetParentRelativeRectToViewportRelativeRect:LK,getDocumentElement:la,getClippingRect:jK,getOffsetParent:cU,getElementRects:HK,getClientRects:MK,getDimensions:UK,getScale:Cs,isElement:Ur,isRTL:$K};function uU(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function VK(e,t){let n=null,r;const a=la(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),o();const d=e.getBoundingClientRect(),{left:p,top:g,width:m,height:b}=d;if(l||t(),!m||!b)return;const y=Td(g),v=Td(a.clientWidth-(p+m)),x=Td(a.clientHeight-(g+b)),T=Td(p),R={rootMargin:-y+"px "+-v+"px "+-x+"px "+-T+"px",threshold:er(0,No(1,u))||1};let O=!0;function N(C){const _=C[0].intersectionRatio;if(_!==u){if(!O)return s();_?s(!1,_):r=setTimeout(()=>{s(!1,1e-7)},1e3)}_===1&&!uU(d,e.getBoundingClientRect())&&s(),O=!1}try{n=new IntersectionObserver(N,{...R,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,R)}n.observe(e)}return s(!0),o}function WK(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=iT(e),p=a||o?[...d?xc(d):[],...xc(t)]:[];p.forEach(T=>{a&&T.addEventListener("scroll",n,{passive:!0}),o&&T.addEventListener("resize",n)});const g=d&&l?VK(d,n):null;let m=-1,b=null;s&&(b=new ResizeObserver(T=>{let[k]=T;k&&k.target===d&&b&&(b.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var R;(R=b)==null||R.observe(t)})),n()}),d&&!u&&b.observe(d),b.observe(t));let y,v=u?yi(e):null;u&&x();function x(){const T=yi(e);v&&!uU(v,T)&&n(),v=T,y=requestAnimationFrame(x)}return n(),()=>{var T;p.forEach(k=>{a&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),g==null||g(),(T=b)==null||T.disconnect(),b=null,u&&cancelAnimationFrame(y)}}const YK=AK,KK=RK,XK=xK,ZK=_K,QK=kK,dN=wK,JK=CK,eX=(e,t,n)=>{const r=new Map,a={platform:qK,...n},o={...a.platform,_c:r};return EK(e,t,{...a,platform:o})};var ef=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Ef(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,a;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(!Ef(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!Ef(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function dU(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fN(e,t){const n=dU(e);return Math.round(t*n)/n}function gm(e){const t=w.useRef(e);return ef(()=>{t.current=e}),t}function tX(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:s}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[p,g]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,b]=w.useState(r);Ef(m,r)||b(r);const[y,v]=w.useState(null),[x,T]=w.useState(null),k=w.useCallback(F=>{F!==C.current&&(C.current=F,v(F))},[]),R=w.useCallback(F=>{F!==_.current&&(_.current=F,T(F))},[]),O=o||y,N=s||x,C=w.useRef(null),_=w.useRef(null),M=w.useRef(p),D=u!=null,I=gm(u),U=gm(a),$=gm(d),B=w.useCallback(()=>{if(!C.current||!_.current)return;const F={placement:t,strategy:n,middleware:m};U.current&&(F.platform=U.current),eX(C.current,_.current,F).then(Y=>{const L={...Y,isPositioned:$.current!==!1};W.current&&!Ef(M.current,L)&&(M.current=L,Uc.flushSync(()=>{g(L)}))})},[m,t,n,U,$]);ef(()=>{d===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,g(F=>({...F,isPositioned:!1})))},[d]);const W=w.useRef(!1);ef(()=>(W.current=!0,()=>{W.current=!1}),[]),ef(()=>{if(O&&(C.current=O),N&&(_.current=N),O&&N){if(I.current)return I.current(O,N,B);B()}},[O,N,B,I,D]);const K=w.useMemo(()=>({reference:C,floating:_,setReference:k,setFloating:R}),[k,R]),G=w.useMemo(()=>({reference:O,floating:N}),[O,N]),H=w.useMemo(()=>{const F={position:n,left:0,top:0};if(!G.floating)return F;const Y=fN(G.floating,p.x),L=fN(G.floating,p.y);return l?{...F,transform:"translate("+Y+"px, "+L+"px)",...dU(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:L}},[n,l,G.floating,p.x,p.y]);return w.useMemo(()=>({...p,update:B,refs:K,elements:G,floatingStyles:H}),[p,B,K,G,H])}const nX=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dN({element:r.current,padding:a}).fn(n):{}:r?dN({element:r,padding:a}).fn(n):{}}}},rX=(e,t)=>({...YK(e),options:[e,t]}),aX=(e,t)=>({...KK(e),options:[e,t]}),oX=(e,t)=>({...JK(e),options:[e,t]}),iX=(e,t)=>({...XK(e),options:[e,t]}),sX=(e,t)=>({...ZK(e),options:[e,t]}),lX=(e,t)=>({...QK(e),options:[e,t]}),cX=(e,t)=>({...nX(e),options:[e,t]});var uX="Arrow",fU=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return E.jsx(Je.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:E.jsx("polygon",{points:"0,0 30,0 15,10"})})});fU.displayName=uX;var dX=fU;function pU(e){const[t,n]=w.useState(void 0);return Rn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let s,l;if("borderBoxSize"in o){const u=o.borderBoxSize,d=Array.isArray(u)?u[0]:u;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var lT="Popper",[gU,Ys]=$r(lT),[fX,hU]=gU(lT),mU=e=>{const{__scopePopper:t,children:n}=e,[r,a]=w.useState(null);return E.jsx(fX,{scope:t,anchor:r,onAnchorChange:a,children:n})};mU.displayName=lT;var bU="PopperAnchor",yU=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=hU(bU,n),s=w.useRef(null),l=mt(t,s);return w.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:E.jsx(Je.div,{...a,ref:l})});yU.displayName=bU;var cT="PopperContent",[pX,gX]=gU(cT),vU=w.forwardRef((e,t)=>{var ae,ce,Re,ie,Te,ne;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:m=!1,updatePositionStrategy:b="optimized",onPlaced:y,...v}=e,x=hU(cT,n),[T,k]=w.useState(null),R=mt(t,xe=>k(xe)),[O,N]=w.useState(null),C=pU(O),_=(C==null?void 0:C.width)??0,M=(C==null?void 0:C.height)??0,D=r+(o!=="center"?"-"+o:""),I=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},U=Array.isArray(d)?d:[d],$=U.length>0,B={padding:I,boundary:U.filter(mX),altBoundary:$},{refs:W,floatingStyles:K,placement:G,isPositioned:H,middlewareData:F}=tX({strategy:"fixed",placement:D,whileElementsMounted:(...xe)=>WK(...xe,{animationFrame:b==="always"}),elements:{reference:x.anchor},middleware:[rX({mainAxis:a+M,alignmentAxis:s}),u&&aX({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?oX():void 0,...B}),u&&iX({...B}),sX({...B,apply:({elements:xe,rects:Se,availableWidth:be,availableHeight:J})=>{const{width:pe,height:ke}=Se.reference,he=xe.floating.style;he.setProperty("--radix-popper-available-width",`${be}px`),he.setProperty("--radix-popper-available-height",`${J}px`),he.setProperty("--radix-popper-anchor-width",`${pe}px`),he.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),O&&cX({element:O,padding:l}),bX({arrowWidth:_,arrowHeight:M}),m&&lX({strategy:"referenceHidden",...B})]}),[Y,L]=wU(G),V=vn(y);Rn(()=>{H&&(V==null||V())},[H,V]);const j=(ae=F.arrow)==null?void 0:ae.x,P=(ce=F.arrow)==null?void 0:ce.y,Z=((Re=F.arrow)==null?void 0:Re.centerOffset)!==0,[Q,oe]=w.useState();return Rn(()=>{T&&oe(window.getComputedStyle(T).zIndex)},[T]),E.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:H?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ie=F.transformOrigin)==null?void 0:ie.x,(Te=F.transformOrigin)==null?void 0:Te.y].join(" "),...((ne=F.hide)==null?void 0:ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:E.jsx(pX,{scope:n,placedSide:Y,onArrowChange:N,arrowX:j,arrowY:P,shouldHideArrow:Z,children:E.jsx(Je.div,{"data-side":Y,"data-align":L,...v,ref:R,style:{...v.style,animation:H?void 0:"none"}})})})});vU.displayName=cT;var SU="PopperArrow",hX={top:"bottom",right:"left",bottom:"top",left:"right"},EU=w.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=gX(SU,r),s=hX[o.placedSide];return E.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:E.jsx(dX,{...a,ref:n,style:{...a.style,display:"block"}})})});EU.displayName=SU;function mX(e){return e!==null}var bX=e=>({name:"transformOrigin",options:e,fn(t){var x,T,k;const{placement:n,rects:r,middlewareData:a}=t,s=((x=a.arrow)==null?void 0:x.centerOffset)!==0,l=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[d,p]=wU(n),g={start:"0%",center:"50%",end:"100%"}[p],m=(((T=a.arrow)==null?void 0:T.x)??0)+l/2,b=(((k=a.arrow)==null?void 0:k.y)??0)+u/2;let y="",v="";return d==="bottom"?(y=s?g:`${m}px`,v=`${-u}px`):d==="top"?(y=s?g:`${m}px`,v=`${r.floating.height+u}px`):d==="right"?(y=`${-u}px`,v=s?g:`${b}px`):d==="left"&&(y=`${r.floating.width+u}px`,v=s?g:`${b}px`),{data:{x:y,y:v}}}});function wU(e){const[t,n="center"]=e.split("-");return[t,n]}var uT=mU,cp=yU,dT=vU,fT=EU,yX="VisuallyHidden",pT=w.forwardRef((e,t)=>E.jsx(Je.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));pT.displayName=yX;var vX=pT,[up,p0e]=$r("Tooltip",[Ys]),dp=Ys(),xU="TooltipProvider",SX=700,M0="tooltip.open",[EX,gT]=up(xU),kU=e=>{const{__scopeTooltip:t,delayDuration:n=SX,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=e,[s,l]=w.useState(!0),u=w.useRef(!1),d=w.useRef(0);return w.useEffect(()=>{const p=d.current;return()=>window.clearTimeout(p)},[]),E.jsx(EX,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:w.useCallback(p=>{u.current=p},[]),disableHoverableContent:a,children:o})};kU.displayName=xU;var fp="Tooltip",[wX,pp]=up(fp),TU=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:l}=e,u=gT(fp,e.__scopeTooltip),d=dp(t),[p,g]=w.useState(null),m=An(),b=w.useRef(0),y=s??u.disableHoverableContent,v=l??u.delayDuration,x=w.useRef(!1),[T=!1,k]=ja({prop:r,defaultProp:a,onChange:_=>{_?(u.onOpen(),document.dispatchEvent(new CustomEvent(M0))):u.onClose(),o==null||o(_)}}),R=w.useMemo(()=>T?x.current?"delayed-open":"instant-open":"closed",[T]),O=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,x.current=!1,k(!0)},[k]),N=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,k(!1)},[k]),C=w.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{x.current=!0,k(!0),b.current=0},v)},[v,k]);return w.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),E.jsx(uT,{...d,children:E.jsx(wX,{scope:t,contentId:m,open:T,stateAttribute:R,trigger:p,onTriggerChange:g,onTriggerEnter:w.useCallback(()=>{u.isOpenDelayed?C():O()},[u.isOpenDelayed,C,O]),onTriggerLeave:w.useCallback(()=>{y?N():(window.clearTimeout(b.current),b.current=0)},[N,y]),onOpen:O,onClose:N,disableHoverableContent:y,children:n})})};TU.displayName=fp;var P0="TooltipTrigger",AU=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=pp(P0,n),o=gT(P0,n),s=dp(n),l=w.useRef(null),u=mt(t,l,a.onTriggerChange),d=w.useRef(!1),p=w.useRef(!1),g=w.useCallback(()=>d.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),E.jsx(cp,{asChild:!0,...s,children:E.jsx(Je.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:u,onPointerMove:Ke(e.onPointerMove,m=>{m.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ke(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:Ke(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ke(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:Ke(e.onBlur,a.onClose),onClick:Ke(e.onClick,a.onClose)})})});AU.displayName=P0;var xX="TooltipPortal",[g0e,kX]=up(xX,{forceMount:void 0}),Ls="TooltipContent",RU=w.forwardRef((e,t)=>{const n=kX(Ls,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...o}=e,s=pp(Ls,e.__scopeTooltip);return E.jsx(ir,{present:r||s.open,children:s.disableHoverableContent?E.jsx(CU,{side:a,...o,ref:t}):E.jsx(TX,{side:a,...o,ref:t})})}),TX=w.forwardRef((e,t)=>{const n=pp(Ls,e.__scopeTooltip),r=gT(Ls,e.__scopeTooltip),a=w.useRef(null),o=mt(t,a),[s,l]=w.useState(null),{trigger:u,onClose:d}=n,p=a.current,{onPointerInTransitChange:g}=r,m=w.useCallback(()=>{l(null),g(!1)},[g]),b=w.useCallback((y,v)=>{const x=y.currentTarget,T={x:y.clientX,y:y.clientY},k=_X(T,x.getBoundingClientRect()),R=NX(T,k),O=OX(v.getBoundingClientRect()),N=DX([...R,...O]);l(N),g(!0)},[g]);return w.useEffect(()=>()=>m(),[m]),w.useEffect(()=>{if(u&&p){const y=x=>b(x,p),v=x=>b(x,u);return u.addEventListener("pointerleave",y),p.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",y),p.removeEventListener("pointerleave",v)}}},[u,p,b,m]),w.useEffect(()=>{if(s){const y=v=>{const x=v.target,T={x:v.clientX,y:v.clientY},k=(u==null?void 0:u.contains(x))||(p==null?void 0:p.contains(x)),R=!IX(T,s);k?m():R&&(m(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,p,s,d,m]),E.jsx(CU,{...e,ref:o})}),[AX,RX]=up(fp,{isInside:!1}),CU=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:s,...l}=e,u=pp(Ls,n),d=dp(n),{onClose:p}=u;return w.useEffect(()=>(document.addEventListener(M0,p),()=>document.removeEventListener(M0,p)),[p]),w.useEffect(()=>{if(u.trigger){const g=m=>{const b=m.target;b!=null&&b.contains(u.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,p]),E.jsx($c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:E.jsxs(dT,{"data-state":u.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[E.jsx(Hk,{children:r}),E.jsx(AX,{scope:n,isInside:!0,children:E.jsx(vX,{id:u.contentId,role:"tooltip",children:a||r})})]})})});RU.displayName=Ls;var _U="TooltipArrow",CX=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=dp(n);return RX(_U,n).isInside?null:E.jsx(fT,{...a,...r,ref:t})});CX.displayName=_U;function _X(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,a,o)){case o:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function NX(e,t,n=5){const 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 OX(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function IX(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,s=t.length-1;or!=p>r&&n<(d-l)*(r-u)/(p-u)+l&&(a=!a)}return a}function DX(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),LX(t)}function LX(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(a.y-s.y)>=(o.y-s.y)*(a.x-s.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(a.y-s.y)>=(o.y-s.y)*(a.x-s.x))n.pop();else break}n.push(a)}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 MX=kU,PX=TU,FX=AU,NU=RU;const hT=MX,mT=PX,bT=FX,zX=e=>typeof e!="string"?e:E.jsx("div",{className:"relative top-0 pt-1 whitespace-pre-wrap break-words",children:e}),gp=w.forwardRef(({className:e,side:t="left",align:n="start",children:r,...a},o)=>{const s=w.useRef(null);return w.useEffect(()=>{s.current&&(s.current.scrollTop=0)},[r]),E.jsx(NU,{ref:o,side:t,align:n,className:Me("bg-popover text-popover-foreground 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 max-h-[60vh] overflow-y-auto whitespace-pre-wrap break-words rounded-md border px-3 py-2 text-sm shadow-md z-60",e),...a,children:typeof r=="string"?zX(r):r})});gp.displayName=NU.displayName;const wf=fK("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-8"}},defaultVariants:{variant:"default",size:"default"}}),nt=w.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:a="right",asChild:o=!1,...s},l)=>{const u=o?_o:"button";return n?E.jsx(hT,{children:E.jsxs(mT,{children:[E.jsx(bT,{asChild:!0,children:E.jsx(u,{className:Me(wf({variant:t,size:r,className:e}),"cursor-pointer"),ref:l,...s})}),E.jsx(gp,{side:a,children:n})]})}):E.jsx(u,{className:Me(wf({variant:t,size:r,className:e}),"cursor-pointer"),ref:l,...s})});nt.displayName="Button";const BX=uK,jX=dK,OU=w.forwardRef(({className:e,...t},n)=>E.jsx(Xj,{className:Me("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,ref:n}));OU.displayName=Xj.displayName;const IU=w.forwardRef(({className:e,...t},n)=>E.jsxs(jX,{children:[E.jsx(OU,{}),E.jsx(Zj,{ref:n,className:Me("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 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));IU.displayName=Zj.displayName;const DU=({className:e,...t})=>E.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});DU.displayName="AlertDialogHeader";const LU=w.forwardRef(({className:e,...t},n)=>E.jsx(eU,{ref:n,className:Me("text-lg font-semibold",e),...t}));LU.displayName=eU.displayName;const MU=w.forwardRef(({className:e,...t},n)=>E.jsx(tU,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));MU.displayName=tU.displayName;const UX=w.forwardRef(({className:e,...t},n)=>E.jsx(Qj,{ref:n,className:Me(wf(),e),...t}));UX.displayName=Qj.displayName;const GX=w.forwardRef(({className:e,...t},n)=>E.jsx(Jj,{ref:n,className:Me(wf({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));GX.displayName=Jj.displayName;const Tr=w.forwardRef(({className:e,type:t,...n},r)=>E.jsx("input",{type:t,className:Me("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm [&::-webkit-inner-spin-button]:opacity-50 [&::-webkit-outer-spin-button]:opacity-50",e),ref:r,...n}));Tr.displayName="Input";const HX=({open:e,onOpenChange:t})=>{const{t:n}=Et(),r=Ie.use.apiKey(),[a,o]=w.useState(""),s=rr.use.message();w.useEffect(()=>{o(r||"")},[r,e]),w.useEffect(()=>{s&&(s.includes(XB)||s.includes(ZB))&&t(!0)},[s,t]);const l=w.useCallback(()=>{Ie.setState({apiKey:a||null}),t(!1)},[a,t]),u=w.useCallback(d=>{o(d.target.value)},[o]);return E.jsx(BX,{open:e,onOpenChange:t,children:E.jsxs(IU,{children:[E.jsxs(DU,{children:[E.jsx(LU,{children:n("apiKeyAlert.title")}),E.jsx(MU,{children:n("apiKeyAlert.description")})]}),E.jsxs("div",{className:"flex flex-col gap-4",children:[E.jsxs("form",{className:"flex gap-2",onSubmit:d=>d.preventDefault(),children:[E.jsx(Tr,{type:"password",value:a,onChange:u,placeholder:n("apiKeyAlert.placeholder"),className:"max-h-full w-full min-w-0",autoComplete:"off"}),E.jsx(nt,{onClick:l,variant:"outline",size:"sm",children:n("apiKeyAlert.save")})]}),s&&E.jsx("div",{className:"text-sm text-red-500",children:s})]})]})})};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. @@ -347,7 +347,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert- * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lQ=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],cQ=it("ZoomOut",lQ),hp=Xk,$U=Fj,uQ=Zk,qU=w.forwardRef(({className:e,...t},n)=>E.jsx(ap,{ref:n,className:Me("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/30",e),...t}));qU.displayName=ap.displayName;const Vc=w.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(uQ,{children:[E.jsx(qU,{}),E.jsxs(op,{ref:r,className:Me("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 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,E.jsxs(eT,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[E.jsx(HU,{className:"h-4 w-4"}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Vc.displayName=op.displayName;const Wc=({className:e,...t})=>E.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Wc.displayName="DialogHeader";const VU=({className:e,...t})=>E.jsx("div",{className:Me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});VU.displayName="DialogFooter";const Yc=w.forwardRef(({className:e,...t},n)=>E.jsx(Qk,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));Yc.displayName=Qk.displayName;const Kc=w.forwardRef(({className:e,...t},n)=>E.jsx(Jk,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Kc.displayName=Jk.displayName;const dQ=({status:e})=>{const{t}=Et();return e?E.jsxs("div",{className:"min-w-[300px] space-y-2 text-xs",children:[E.jsxs("div",{className:"space-y-1",children:[E.jsx("h4",{className:"font-medium",children:t("graphPanel.statusCard.storageInfo")}),E.jsxs("div",{className:"text-foreground grid grid-cols-[120px_1fr] gap-1",children:[E.jsxs("span",{children:[t("graphPanel.statusCard.workingDirectory"),":"]}),E.jsx("span",{className:"truncate",children:e.working_directory}),E.jsxs("span",{children:[t("graphPanel.statusCard.inputDirectory"),":"]}),E.jsx("span",{className:"truncate",children:e.input_directory})]})]}),E.jsxs("div",{className:"space-y-1",children:[E.jsx("h4",{className:"font-medium",children:t("graphPanel.statusCard.llmConfig")}),E.jsxs("div",{className:"text-foreground grid grid-cols-[120px_1fr] gap-1",children:[E.jsxs("span",{children:[t("graphPanel.statusCard.llmBinding"),":"]}),E.jsx("span",{children:e.configuration.llm_binding}),E.jsxs("span",{children:[t("graphPanel.statusCard.llmBindingHost"),":"]}),E.jsx("span",{children:e.configuration.llm_binding_host}),E.jsxs("span",{children:[t("graphPanel.statusCard.llmModel"),":"]}),E.jsx("span",{children:e.configuration.llm_model}),E.jsxs("span",{children:[t("graphPanel.statusCard.maxTokens"),":"]}),E.jsx("span",{children:e.configuration.max_tokens})]})]}),E.jsxs("div",{className:"space-y-1",children:[E.jsx("h4",{className:"font-medium",children:t("graphPanel.statusCard.embeddingConfig")}),E.jsxs("div",{className:"text-foreground grid grid-cols-[120px_1fr] gap-1",children:[E.jsxs("span",{children:[t("graphPanel.statusCard.embeddingBinding"),":"]}),E.jsx("span",{children:e.configuration.embedding_binding}),E.jsxs("span",{children:[t("graphPanel.statusCard.embeddingBindingHost"),":"]}),E.jsx("span",{children:e.configuration.embedding_binding_host}),E.jsxs("span",{children:[t("graphPanel.statusCard.embeddingModel"),":"]}),E.jsx("span",{children:e.configuration.embedding_model})]})]}),E.jsxs("div",{className:"space-y-1",children:[E.jsx("h4",{className:"font-medium",children:t("graphPanel.statusCard.storageConfig")}),E.jsxs("div",{className:"text-foreground grid grid-cols-[120px_1fr] gap-1",children:[E.jsxs("span",{children:[t("graphPanel.statusCard.kvStorage"),":"]}),E.jsx("span",{children:e.configuration.kv_storage}),E.jsxs("span",{children:[t("graphPanel.statusCard.docStatusStorage"),":"]}),E.jsx("span",{children:e.configuration.doc_status_storage}),E.jsxs("span",{children:[t("graphPanel.statusCard.graphStorage"),":"]}),E.jsx("span",{children:e.configuration.graph_storage}),E.jsxs("span",{children:[t("graphPanel.statusCard.vectorStorage"),":"]}),E.jsx("span",{children:e.configuration.vector_storage})]})]})]}):E.jsx("div",{className:"text-foreground text-xs",children:t("graphPanel.statusCard.unavailable")})},fQ=({open:e,onOpenChange:t,status:n})=>{const{t:r}=Et();return E.jsx(hp,{open:e,onOpenChange:t,children:E.jsxs(Vc,{className:"sm:max-w-[500px]",children:[E.jsxs(Wc,{children:[E.jsx(Yc,{children:r("graphPanel.statusDialog.title")}),E.jsx(Kc,{children:r("graphPanel.statusDialog.description")})]}),E.jsx(dQ,{status:n})]})})},pQ=()=>{const{t:e}=Et(),t=rr.use.health(),n=rr.use.lastCheckTime(),r=rr.use.status(),[a,o]=w.useState(!1),[s,l]=w.useState(!1);return w.useEffect(()=>{o(!0);const u=setTimeout(()=>o(!1),300);return()=>clearTimeout(u)},[n]),E.jsxs("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:[E.jsxs("div",{className:"flex cursor-pointer items-center gap-2",onClick:()=>l(!0),children:[E.jsx("div",{className:Me("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",t?"bg-green-500":"bg-red-500",a&&"scale-125",a&&t&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",a&&!t&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),E.jsx("span",{className:"text-muted-foreground text-xs",children:e(t?"graphPanel.statusIndicator.connected":"graphPanel.statusIndicator.disconnected")})]}),E.jsx(fQ,{open:s,onOpenChange:l,status:r})]})};var ET="Popover",[WU,h0e]=$r(ET,[Ys]),Xc=Ys(),[gQ,Do]=WU(ET),YU=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!1}=e,l=Xc(t),u=w.useRef(null),[d,p]=w.useState(!1),[g=!1,m]=ja({prop:r,defaultProp:a,onChange:o});return E.jsx(uT,{...l,children:E.jsx(gQ,{scope:t,contentId:An(),triggerRef:u,open:g,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(b=>!b),[m]),hasCustomAnchor:d,onCustomAnchorAdd:w.useCallback(()=>p(!0),[]),onCustomAnchorRemove:w.useCallback(()=>p(!1),[]),modal:s,children:n})})};YU.displayName=ET;var KU="PopoverAnchor",hQ=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Do(KU,n),o=Xc(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=a;return w.useEffect(()=>(s(),()=>l()),[s,l]),E.jsx(cp,{...o,...r,ref:t})});hQ.displayName=KU;var XU="PopoverTrigger",ZU=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Do(XU,n),o=Xc(n),s=mt(t,a.triggerRef),l=E.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":n3(a.open),...r,ref:s,onClick:Ke(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:E.jsx(cp,{asChild:!0,...o,children:l})});ZU.displayName=XU;var wT="PopoverPortal",[mQ,bQ]=WU(wT,{forceMount:void 0}),QU=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,o=Do(wT,t);return E.jsx(mQ,{scope:t,forceMount:n,children:E.jsx(ir,{present:n||o.open,children:E.jsx(tp,{asChild:!0,container:a,children:r})})})};QU.displayName=wT;var Ms="PopoverContent",JU=w.forwardRef((e,t)=>{const n=bQ(Ms,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,o=Do(Ms,e.__scopePopover);return E.jsx(ir,{present:r||o.open,children:o.modal?E.jsx(yQ,{...a,ref:t}):E.jsx(vQ,{...a,ref:t})})});JU.displayName=Ms;var yQ=w.forwardRef((e,t)=>{const n=Do(Ms,e.__scopePopover),r=w.useRef(null),a=mt(t,r),o=w.useRef(!1);return w.useEffect(()=>{const s=r.current;if(s)return qk(s)},[]),E.jsx(rp,{as:_o,allowPinchZoom:!0,children:E.jsx(e3,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ke(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),o.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Ke(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Ke(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),vQ=w.forwardRef((e,t)=>{const n=Do(Ms,e.__scopePopover),r=w.useRef(!1),a=w.useRef(!1);return E.jsx(e3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const s=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),e3=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,...g}=e,m=Do(Ms,n),b=Xc(n);return $k(),E.jsx(ep,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:E.jsx($c,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:p,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:E.jsx(dT,{"data-state":n3(m.open),role:"dialog",id:m.contentId,...b,...g,ref:t,style:{...g.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)"}})})})}),t3="PopoverClose",SQ=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Do(t3,n);return E.jsx(Je.button,{type:"button",...r,ref:t,onClick:Ke(e.onClick,()=>a.onOpenChange(!1))})});SQ.displayName=t3;var EQ="PopoverArrow",wQ=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xc(n);return E.jsx(fT,{...a,...r,ref:t})});wQ.displayName=EQ;function n3(e){return e?"open":"closed"}var xQ=YU,kQ=ZU,TQ=QU,r3=JU;const mp=xQ,bp=kQ,Zc=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,collisionPadding:r,sticky:a,avoidCollisions:o=!1,...s},l)=>E.jsx(TQ,{children:E.jsx(r3,{ref:l,align:t,sideOffset:n,collisionPadding:r,sticky:a,avoidCollisions:o,className:Me("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",e),...s})}));Zc.displayName=r3.displayName;function z0(e,[t,n]){return Math.min(n,Math.max(t,e))}function a3(e){const t=e+"CollectionProvider",[n,r]=$r(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=b=>{const{scope:y,children:v}=b,x=we.useRef(null),T=we.useRef(new Map).current;return E.jsx(a,{scope:y,itemMap:T,collectionRef:x,children:v})};s.displayName=t;const l=e+"CollectionSlot",u=we.forwardRef((b,y)=>{const{scope:v,children:x}=b,T=o(l,v),k=mt(y,T.collectionRef);return E.jsx(_o,{ref:k,children:x})});u.displayName=l;const d=e+"CollectionItemSlot",p="data-radix-collection-item",g=we.forwardRef((b,y)=>{const{scope:v,children:x,...T}=b,k=we.useRef(null),R=mt(y,k),O=o(d,v);return we.useEffect(()=>(O.itemMap.set(k,{ref:k,...T}),()=>void O.itemMap.delete(k))),E.jsx(_o,{[p]:"",ref:R,children:x})});g.displayName=d;function m(b){const y=o(e+"CollectionConsumer",b);return we.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const T=Array.from(x.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((O,N)=>T.indexOf(O.ref.current)-T.indexOf(N.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:u,ItemSlot:g},m,r]}var AQ=w.createContext(void 0);function yp(e){const t=w.useContext(AQ);return e||t||"ltr"}function o3(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var RQ=[" ","Enter","ArrowUp","ArrowDown"],CQ=[" ","Enter"],Qc="Select",[vp,Sp,_Q]=a3(Qc),[Ks,m0e]=$r(Qc,[_Q,Ys]),Ep=Ys(),[NQ,Lo]=Ks(Qc),[OQ,IQ]=Ks(Qc),i3=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:s,defaultValue:l,onValueChange:u,dir:d,name:p,autoComplete:g,disabled:m,required:b,form:y}=e,v=Ep(t),[x,T]=w.useState(null),[k,R]=w.useState(null),[O,N]=w.useState(!1),C=yp(d),[_=!1,M]=ja({prop:r,defaultProp:a,onChange:o}),[D,I]=ja({prop:s,defaultProp:l,onChange:u}),U=w.useRef(null),$=x?y||!!x.closest("form"):!0,[B,W]=w.useState(new Set),K=Array.from(B).map(G=>G.props.value).join(";");return E.jsx(uT,{...v,children:E.jsxs(NQ,{required:b,scope:t,trigger:x,onTriggerChange:T,valueNode:k,onValueNodeChange:R,valueNodeHasChildren:O,onValueNodeHasChildrenChange:N,contentId:An(),value:D,onValueChange:I,open:_,onOpenChange:M,dir:C,triggerPointerDownPosRef:U,disabled:m,children:[E.jsx(vp.Provider,{scope:t,children:E.jsx(OQ,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(G=>{W(H=>new Set(H).add(G))},[]),onNativeOptionRemove:w.useCallback(G=>{W(H=>{const F=new Set(H);return F.delete(G),F})},[]),children:n})}),$?E.jsxs(I3,{"aria-hidden":!0,required:b,tabIndex:-1,name:p,autoComplete:g,value:D,onChange:G=>I(G.target.value),disabled:m,form:y,children:[D===void 0?E.jsx("option",{value:""}):null,Array.from(B)]},K):null]})})};i3.displayName=Qc;var s3="SelectTrigger",l3=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=Ep(n),s=Lo(s3,n),l=s.disabled||r,u=mt(t,s.onTriggerChange),d=Sp(n),p=w.useRef("touch"),[g,m,b]=D3(v=>{const x=d().filter(R=>!R.disabled),T=x.find(R=>R.value===s.value),k=L3(x,v,T);k!==void 0&&s.onValueChange(k.value)}),y=v=>{l||(s.onOpenChange(!0),b()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return E.jsx(cp,{asChild:!0,...o,children:E.jsx(Je.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":O3(s.value)?"":void 0,...a,ref:u,onClick:Ke(a.onClick,v=>{v.currentTarget.focus(),p.current!=="mouse"&&y(v)}),onPointerDown:Ke(a.onPointerDown,v=>{p.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:Ke(a.onKeyDown,v=>{const x=g.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(x&&v.key===" ")&&RQ.includes(v.key)&&(y(),v.preventDefault())})})})});l3.displayName=s3;var c3="SelectValue",u3=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:s="",...l}=e,u=Lo(c3,n),{onValueNodeHasChildrenChange:d}=u,p=o!==void 0,g=mt(t,u.onValueNodeChange);return Rn(()=>{d(p)},[d,p]),E.jsx(Je.span,{...l,ref:g,style:{pointerEvents:"none"},children:O3(u.value)?E.jsx(E.Fragment,{children:s}):o})});u3.displayName=c3;var DQ="SelectIcon",d3=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return E.jsx(Je.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});d3.displayName=DQ;var LQ="SelectPortal",f3=e=>E.jsx(tp,{asChild:!0,...e});f3.displayName=LQ;var vi="SelectContent",p3=w.forwardRef((e,t)=>{const n=Lo(vi,e.__scopeSelect),[r,a]=w.useState();if(Rn(()=>{a(new DocumentFragment)},[]),!n.open){const o=r;return o?Uc.createPortal(E.jsx(g3,{scope:e.__scopeSelect,children:E.jsx(vp.Slot,{scope:e.__scopeSelect,children:E.jsx("div",{children:e.children})})}),o):null}return E.jsx(h3,{...e,ref:t})});p3.displayName=vi;var Pr=10,[g3,Mo]=Ks(vi),MQ="SelectContentImpl",h3=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:g,collisionBoundary:m,collisionPadding:b,sticky:y,hideWhenDetached:v,avoidCollisions:x,...T}=e,k=Lo(vi,n),[R,O]=w.useState(null),[N,C]=w.useState(null),_=mt(t,ae=>O(ae)),[M,D]=w.useState(null),[I,U]=w.useState(null),$=Sp(n),[B,W]=w.useState(!1),K=w.useRef(!1);w.useEffect(()=>{if(R)return qk(R)},[R]),$k();const G=w.useCallback(ae=>{const[ce,...Re]=$().map(ne=>ne.ref.current),[ie]=Re.slice(-1),Te=document.activeElement;for(const ne of ae)if(ne===Te||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===ce&&N&&(N.scrollTop=0),ne===ie&&N&&(N.scrollTop=N.scrollHeight),ne==null||ne.focus(),document.activeElement!==Te))return},[$,N]),H=w.useCallback(()=>G([M,R]),[G,M,R]);w.useEffect(()=>{B&&H()},[B,H]);const{onOpenChange:F,triggerPointerDownPosRef:Y}=k;w.useEffect(()=>{if(R){let ae={x:0,y:0};const ce=ie=>{var Te,ne;ae={x:Math.abs(Math.round(ie.pageX)-(((Te=Y.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((ne=Y.current)==null?void 0:ne.y)??0))}},Re=ie=>{ae.x<=10&&ae.y<=10?ie.preventDefault():R.contains(ie.target)||F(!1),document.removeEventListener("pointermove",ce),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",Re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",Re,{capture:!0})}}},[R,F,Y]),w.useEffect(()=>{const ae=()=>F(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[F]);const[L,V]=D3(ae=>{const ce=$().filter(Te=>!Te.disabled),Re=ce.find(Te=>Te.ref.current===document.activeElement),ie=L3(ce,ae,Re);ie&&setTimeout(()=>ie.ref.current.focus())}),j=w.useCallback((ae,ce,Re)=>{const ie=!K.current&&!Re;(k.value!==void 0&&k.value===ce||ie)&&(D(ae),ie&&(K.current=!0))},[k.value]),P=w.useCallback(()=>R==null?void 0:R.focus(),[R]),Z=w.useCallback((ae,ce,Re)=>{const ie=!K.current&&!Re;(k.value!==void 0&&k.value===ce||ie)&&U(ae)},[k.value]),Q=r==="popper"?B0:m3,oe=Q===B0?{side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:g,collisionBoundary:m,collisionPadding:b,sticky:y,hideWhenDetached:v,avoidCollisions:x}:{};return E.jsx(g3,{scope:n,content:R,viewport:N,onViewportChange:C,itemRefCallback:j,selectedItem:M,onItemLeave:P,itemTextRefCallback:Z,focusSelectedItem:H,selectedItemText:I,position:r,isPositioned:B,searchRef:L,children:E.jsx(rp,{as:_o,allowPinchZoom:!0,children:E.jsx(ep,{asChild:!0,trapped:k.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Ke(a,ae=>{var ce;(ce=k.trigger)==null||ce.focus({preventScroll:!0}),ae.preventDefault()}),children:E.jsx($c,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:E.jsx(Q,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:ae=>ae.preventDefault(),...T,...oe,onPlaced:()=>W(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:Ke(T.onKeyDown,ae=>{const ce=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!ce&&ae.key.length===1&&V(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let ie=$().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Te=ae.target,ne=ie.indexOf(Te);ie=ie.slice(ne+1)}setTimeout(()=>G(ie)),ae.preventDefault()}})})})})})})});h3.displayName=MQ;var PQ="SelectItemAlignedPosition",m3=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=Lo(vi,n),s=Mo(vi,n),[l,u]=w.useState(null),[d,p]=w.useState(null),g=mt(t,_=>p(_)),m=Sp(n),b=w.useRef(!1),y=w.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:T,focusSelectedItem:k}=s,R=w.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&v&&x&&T){const _=o.trigger.getBoundingClientRect(),M=d.getBoundingClientRect(),D=o.valueNode.getBoundingClientRect(),I=T.getBoundingClientRect();if(o.dir!=="rtl"){const Te=I.left-M.left,ne=D.left-Te,xe=_.left-ne,Se=_.width+xe,be=Math.max(Se,M.width),J=window.innerWidth-Pr,pe=z0(ne,[Pr,Math.max(Pr,J-be)]);l.style.minWidth=Se+"px",l.style.left=pe+"px"}else{const Te=M.right-I.right,ne=window.innerWidth-D.right-Te,xe=window.innerWidth-_.right-ne,Se=_.width+xe,be=Math.max(Se,M.width),J=window.innerWidth-Pr,pe=z0(ne,[Pr,Math.max(Pr,J-be)]);l.style.minWidth=Se+"px",l.style.right=pe+"px"}const U=m(),$=window.innerHeight-Pr*2,B=v.scrollHeight,W=window.getComputedStyle(d),K=parseInt(W.borderTopWidth,10),G=parseInt(W.paddingTop,10),H=parseInt(W.borderBottomWidth,10),F=parseInt(W.paddingBottom,10),Y=K+G+B+F+H,L=Math.min(x.offsetHeight*5,Y),V=window.getComputedStyle(v),j=parseInt(V.paddingTop,10),P=parseInt(V.paddingBottom,10),Z=_.top+_.height/2-Pr,Q=$-Z,oe=x.offsetHeight/2,ae=x.offsetTop+oe,ce=K+G+ae,Re=Y-ce;if(ce<=Z){const Te=U.length>0&&x===U[U.length-1].ref.current;l.style.bottom="0px";const ne=d.clientHeight-v.offsetTop-v.offsetHeight,xe=Math.max(Q,oe+(Te?P:0)+ne+H),Se=ce+xe;l.style.height=Se+"px"}else{const Te=U.length>0&&x===U[0].ref.current;l.style.top="0px";const xe=Math.max(Z,K+v.offsetTop+(Te?j:0)+oe)+Re;l.style.height=xe+"px",v.scrollTop=ce-Z+v.offsetTop}l.style.margin=`${Pr}px 0`,l.style.minHeight=L+"px",l.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[m,o.trigger,o.valueNode,l,d,v,x,T,o.dir,r]);Rn(()=>R(),[R]);const[O,N]=w.useState();Rn(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const C=w.useCallback(_=>{_&&y.current===!0&&(R(),k==null||k(),y.current=!1)},[R,k]);return E.jsx(zQ,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:b,onScrollButtonChange:C,children:E.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:E.jsx(Je.div,{...a,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});m3.displayName=PQ;var FQ="SelectPopperPosition",B0=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Pr,...o}=e,s=Ep(n);return E.jsx(dT,{...s,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.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)"}})});B0.displayName=FQ;var[zQ,xT]=Ks(vi,{}),j0="SelectViewport",b3=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=Mo(j0,n),s=xT(j0,n),l=mt(t,o.onViewportChange),u=w.useRef(0);return E.jsxs(E.Fragment,{children:[E.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}),E.jsx(vp.Slot,{scope:n,children:E.jsx(Je.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ke(a.onScroll,d=>{const p=d.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:m}=s;if(m!=null&&m.current&&g){const b=Math.abs(u.current-p.scrollTop);if(b>0){const y=window.innerHeight-Pr*2,v=parseFloat(g.style.minHeight),x=parseFloat(g.style.height),T=Math.max(v,x);if(T0?O:0,g.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});b3.displayName=j0;var y3="SelectGroup",[BQ,jQ]=Ks(y3),v3=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=An();return E.jsx(BQ,{scope:n,id:a,children:E.jsx(Je.div,{role:"group","aria-labelledby":a,...r,ref:t})})});v3.displayName=y3;var S3="SelectLabel",E3=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=jQ(S3,n);return E.jsx(Je.div,{id:a.id,...r,ref:t})});E3.displayName=S3;var xf="SelectItem",[UQ,w3]=Ks(xf),x3=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...s}=e,l=Lo(xf,n),u=Mo(xf,n),d=l.value===r,[p,g]=w.useState(o??""),[m,b]=w.useState(!1),y=mt(t,k=>{var R;return(R=u.itemRefCallback)==null?void 0:R.call(u,k,r,a)}),v=An(),x=w.useRef("touch"),T=()=>{a||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A 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 E.jsx(UQ,{scope:n,value:r,disabled:a,textId:v,isSelected:d,onItemTextChange:w.useCallback(k=>{g(R=>R||((k==null?void 0:k.textContent)??"").trim())},[]),children:E.jsx(vp.ItemSlot,{scope:n,value:r,disabled:a,textValue:p,children:E.jsx(Je.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:y,onFocus:Ke(s.onFocus,()=>b(!0)),onBlur:Ke(s.onBlur,()=>b(!1)),onClick:Ke(s.onClick,()=>{x.current!=="mouse"&&T()}),onPointerUp:Ke(s.onPointerUp,()=>{x.current==="mouse"&&T()}),onPointerDown:Ke(s.onPointerDown,k=>{x.current=k.pointerType}),onPointerMove:Ke(s.onPointerMove,k=>{var R;x.current=k.pointerType,a?(R=u.onItemLeave)==null||R.call(u):x.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ke(s.onPointerLeave,k=>{var R;k.currentTarget===document.activeElement&&((R=u.onItemLeave)==null||R.call(u))}),onKeyDown:Ke(s.onKeyDown,k=>{var O;((O=u.searchRef)==null?void 0:O.current)!==""&&k.key===" "||(CQ.includes(k.key)&&T(),k.key===" "&&k.preventDefault())})})})})});x3.displayName=xf;var pc="SelectItemText",k3=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,s=Lo(pc,n),l=Mo(pc,n),u=w3(pc,n),d=IQ(pc,n),[p,g]=w.useState(null),m=mt(t,T=>g(T),u.onItemTextChange,T=>{var k;return(k=l.itemTextRefCallback)==null?void 0:k.call(l,T,u.value,u.disabled)}),b=p==null?void 0:p.textContent,y=w.useMemo(()=>E.jsx("option",{value:u.value,disabled:u.disabled,children:b},u.value),[u.disabled,u.value,b]),{onNativeOptionAdd:v,onNativeOptionRemove:x}=d;return Rn(()=>(v(y),()=>x(y)),[v,x,y]),E.jsxs(E.Fragment,{children:[E.jsx(Je.span,{id:u.textId,...o,ref:m}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Uc.createPortal(o.children,s.valueNode):null]})});k3.displayName=pc;var T3="SelectItemIndicator",A3=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return w3(T3,n).isSelected?E.jsx(Je.span,{"aria-hidden":!0,...r,ref:t}):null});A3.displayName=T3;var U0="SelectScrollUpButton",R3=w.forwardRef((e,t)=>{const n=Mo(U0,e.__scopeSelect),r=xT(U0,e.__scopeSelect),[a,o]=w.useState(!1),s=mt(t,r.onScrollButtonChange);return Rn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollTop>0;o(d)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?E.jsx(_3,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});R3.displayName=U0;var G0="SelectScrollDownButton",C3=w.forwardRef((e,t)=>{const n=Mo(G0,e.__scopeSelect),r=xT(G0,e.__scopeSelect),[a,o]=w.useState(!1),s=mt(t,r.onScrollButtonChange);return Rn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?E.jsx(_3,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});C3.displayName=G0;var _3=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=Mo("SelectScrollButton",n),s=w.useRef(null),l=Sp(n),u=w.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return w.useEffect(()=>()=>u(),[u]),Rn(()=>{var p;const d=l().find(g=>g.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[l]),E.jsx(Je.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ke(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ke(a.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ke(a.onPointerLeave,()=>{u()})})}),GQ="SelectSeparator",N3=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return E.jsx(Je.div,{"aria-hidden":!0,...r,ref:t})});N3.displayName=GQ;var H0="SelectArrow",HQ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Ep(n),o=Lo(H0,n),s=Mo(H0,n);return o.open&&s.position==="popper"?E.jsx(fT,{...a,...r,ref:t}):null});HQ.displayName=H0;function O3(e){return e===""||e===void 0}var I3=w.forwardRef((e,t)=>{const{value:n,...r}=e,a=w.useRef(null),o=mt(t,a),s=o3(n);return w.useEffect(()=>{const l=a.current,u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==n&&p){const g=new Event("change",{bubbles:!0});p.call(l,n),l.dispatchEvent(g)}},[s,n]),E.jsx(pT,{asChild:!0,children:E.jsx("select",{...r,ref:o,defaultValue:n})})});I3.displayName="BubbleSelect";function D3(e){const t=yn(e),n=w.useRef(""),r=w.useRef(0),a=w.useCallback(s=>{const l=n.current+s;t(l),function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[t]),o=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function L3(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=$Q(e,Math.max(o,0));a.length===1&&(s=s.filter(d=>d!==n));const u=s.find(d=>d.textValue.toLowerCase().startsWith(a.toLowerCase()));return u!==n?u:void 0}function $Q(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var qQ=i3,M3=l3,VQ=u3,WQ=d3,YQ=f3,P3=p3,KQ=b3,XQ=v3,F3=E3,z3=x3,ZQ=k3,QQ=A3,B3=R3,j3=C3,U3=N3;const kf=qQ,pN=XQ,Tf=VQ,kc=w.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(M3,{ref:r,className:Me("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,E.jsx(WQ,{asChild:!0,children:E.jsx(vT,{className:"h-4 w-4 opacity-50"})})]}));kc.displayName=M3.displayName;const G3=w.forwardRef(({className:e,...t},n)=>E.jsx(B3,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx(FU,{className:"h-4 w-4"})}));G3.displayName=B3.displayName;const H3=w.forwardRef(({className:e,...t},n)=>E.jsx(j3,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx(vT,{className:"h-4 w-4"})}));H3.displayName=j3.displayName;const Tc=w.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>E.jsx(YQ,{children:E.jsxs(P3,{ref:a,className:Me("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",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,...r,children:[E.jsx(G3,{}),E.jsx(KQ,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),E.jsx(H3,{})]})}));Tc.displayName=P3.displayName;const JQ=w.forwardRef(({className:e,...t},n)=>E.jsx(F3,{ref:n,className:Me("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));JQ.displayName=F3.displayName;const xn=w.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(z3,{ref:r,className:Me("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[E.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:E.jsx(QQ,{children:E.jsx(yT,{className:"h-4 w-4"})})}),E.jsx(ZQ,{children:t})]}));xn.displayName=z3.displayName;const eJ=w.forwardRef(({className:e,...t},n)=>E.jsx(U3,{ref:n,className:Me("bg-muted -mx-1 my-1 h-px",e),...t}));eJ.displayName=U3.displayName;function $3({className:e}){const[t,n]=w.useState(!1),{t:r}=Et(),a=Ie.use.language(),o=Ie.use.setLanguage(),s=Ie.use.theme(),l=Ie.use.setTheme(),u=w.useCallback(p=>{o(p)},[o]),d=w.useCallback(p=>{l(p)},[l]);return E.jsxs(mp,{open:t,onOpenChange:n,children:[E.jsx(bp,{asChild:!0,children:E.jsx(nt,{variant:"ghost",size:"icon",className:Me("h-9 w-9",e),children:E.jsx(PZ,{className:"h-5 w-5"})})}),E.jsx(Zc,{side:"bottom",align:"end",className:"w-56",children:E.jsxs("div",{className:"flex flex-col gap-4",children:[E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{className:"text-sm font-medium",children:r("settings.language")}),E.jsxs(kf,{value:a,onValueChange:u,children:[E.jsx(kc,{children:E.jsx(Tf,{})}),E.jsxs(Tc,{children:[E.jsx(xn,{value:"en",children:"English"}),E.jsx(xn,{value:"zh",children:"中文"}),E.jsx(xn,{value:"fr",children:"Français"}),E.jsx(xn,{value:"ar",children:"العربية"})]})]})]}),E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{className:"text-sm font-medium",children:r("settings.theme")}),E.jsxs(kf,{value:s,onValueChange:d,children:[E.jsx(kc,{children:E.jsx(Tf,{})}),E.jsxs(Tc,{children:[E.jsx(xn,{value:"light",children:r("settings.light")}),E.jsx(xn,{value:"dark",children:r("settings.dark")}),E.jsx(xn,{value:"system",children:r("settings.system")})]})]})]})]})})]})}var bm="rovingFocusGroup.onEntryFocus",tJ={bubbles:!1,cancelable:!0},wp="RovingFocusGroup",[$0,q3,nJ]=a3(wp),[rJ,V3]=$r(wp,[nJ]),[aJ,oJ]=rJ(wp),W3=w.forwardRef((e,t)=>E.jsx($0.Provider,{scope:e.__scopeRovingFocusGroup,children:E.jsx($0.Slot,{scope:e.__scopeRovingFocusGroup,children:E.jsx(iJ,{...e,ref:t})})}));W3.displayName=wp;var iJ=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...g}=e,m=w.useRef(null),b=mt(t,m),y=yp(o),[v=null,x]=ja({prop:s,defaultProp:l,onChange:u}),[T,k]=w.useState(!1),R=yn(d),O=q3(n),N=w.useRef(!1),[C,_]=w.useState(0);return w.useEffect(()=>{const M=m.current;if(M)return M.addEventListener(bm,R),()=>M.removeEventListener(bm,R)},[R]),E.jsx(aJ,{scope:n,orientation:r,dir:y,loop:a,currentTabStopId:v,onItemFocus:w.useCallback(M=>x(M),[x]),onItemShiftTab:w.useCallback(()=>k(!0),[]),onFocusableItemAdd:w.useCallback(()=>_(M=>M+1),[]),onFocusableItemRemove:w.useCallback(()=>_(M=>M-1),[]),children:E.jsx(Je.div,{tabIndex:T||C===0?-1:0,"data-orientation":r,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:Ke(e.onMouseDown,()=>{N.current=!0}),onFocus:Ke(e.onFocus,M=>{const D=!N.current;if(M.target===M.currentTarget&&D&&!T){const I=new CustomEvent(bm,tJ);if(M.currentTarget.dispatchEvent(I),!I.defaultPrevented){const U=O().filter(G=>G.focusable),$=U.find(G=>G.active),B=U.find(G=>G.id===v),K=[$,B,...U].filter(Boolean).map(G=>G.ref.current);X3(K,p)}}N.current=!1}),onBlur:Ke(e.onBlur,()=>k(!1))})})}),Y3="RovingFocusGroupItem",K3=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,...s}=e,l=An(),u=o||l,d=oJ(Y3,n),p=d.currentTabStopId===u,g=q3(n),{onFocusableItemAdd:m,onFocusableItemRemove:b}=d;return w.useEffect(()=>{if(r)return m(),()=>b()},[r,m,b]),E.jsx($0.ItemSlot,{scope:n,id:u,focusable:r,active:a,children:E.jsx(Je.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:Ke(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:Ke(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Ke(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=cJ(y,d.orientation,d.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let T=g().filter(k=>k.focusable).map(k=>k.ref.current);if(v==="last")T.reverse();else if(v==="prev"||v==="next"){v==="prev"&&T.reverse();const k=T.indexOf(y.currentTarget);T=d.loop?uJ(T,k+1):T.slice(k+1)}setTimeout(()=>X3(T))}})})})});K3.displayName=Y3;var sJ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lJ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cJ(e,t,n){const r=lJ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sJ[r]}function X3(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function uJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dJ=W3,fJ=K3,kT="Tabs",[pJ,b0e]=$r(kT,[V3]),Z3=V3(),[gJ,TT]=pJ(kT),Q3=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s="horizontal",dir:l,activationMode:u="automatic",...d}=e,p=yp(l),[g,m]=ja({prop:r,onChange:a,defaultProp:o});return E.jsx(gJ,{scope:n,baseId:An(),value:g,onValueChange:m,orientation:s,dir:p,activationMode:u,children:E.jsx(Je.div,{dir:p,"data-orientation":s,...d,ref:t})})});Q3.displayName=kT;var J3="TabsList",e4=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,o=TT(J3,n),s=Z3(n);return E.jsx(dJ,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:E.jsx(Je.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});e4.displayName=J3;var t4="TabsTrigger",n4=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,s=TT(t4,n),l=Z3(n),u=o4(s.baseId,r),d=i4(s.baseId,r),p=r===s.value;return E.jsx(fJ,{asChild:!0,...l,focusable:!a,active:p,children:E.jsx(Je.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:u,...o,ref:t,onMouseDown:Ke(e.onMouseDown,g=>{!a&&g.button===0&&g.ctrlKey===!1?s.onValueChange(r):g.preventDefault()}),onKeyDown:Ke(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&s.onValueChange(r)}),onFocus:Ke(e.onFocus,()=>{const g=s.activationMode!=="manual";!p&&!a&&g&&s.onValueChange(r)})})})});n4.displayName=t4;var r4="TabsContent",a4=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:o,...s}=e,l=TT(r4,n),u=o4(l.baseId,r),d=i4(l.baseId,r),p=r===l.value,g=w.useRef(p);return w.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),E.jsx(ir,{present:a||p,children:({present:m})=>E.jsx(Je.div,{"data-state":p?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:m&&o})})});a4.displayName=r4;function o4(e,t){return`${e}-trigger-${t}`}function i4(e,t){return`${e}-content-${t}`}var hJ=Q3,s4=e4,l4=n4,c4=a4;const mJ=hJ,u4=w.forwardRef(({className:e,...t},n)=>E.jsx(s4,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));u4.displayName=s4.displayName;const d4=w.forwardRef(({className:e,...t},n)=>E.jsx(l4,{ref:n,className:Me("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-sm px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm",e),...t}));d4.displayName=l4.displayName;const gc=w.forwardRef(({className:e,...t},n)=>E.jsx(c4,{ref:n,className:Me("ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none","data-[state=inactive]:invisible data-[state=active]:visible","h-full w-full",e),forceMount:!0,...t}));gc.displayName=c4.displayName;function Ad({value:e,currentTab:t,children:n}){return E.jsx(d4,{value:e,className:Me("cursor-pointer px-2 py-1 transition-all",t===e?"!bg-emerald-400 !text-zinc-50":"hover:bg-background/60"),children:n})}function bJ(){const e=Ie.use.currentTab(),{t}=Et();return E.jsx("div",{className:"flex h-8 self-center",children:E.jsxs(u4,{className:"h-full gap-2",children:[E.jsx(Ad,{value:"documents",currentTab:e,children:t("header.documents")}),E.jsx(Ad,{value:"knowledge-graph",currentTab:e,children:t("header.knowledgeGraph")}),E.jsx(Ad,{value:"retrieval",currentTab:e,children:t("header.retrieval")}),E.jsx(Ad,{value:"api",currentTab:e,children:t("header.api")})]})})}function yJ(){const{t:e}=Et(),{isGuestMode:t,coreVersion:n,apiVersion:r,username:a,webuiTitle:o,webuiDescription:s}=xr(),l=n&&r?`${n}/${r}`:null,u=()=>{Gk.navigateToLogin()};return E.jsxs("header",{className:"border-border/40 bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50 flex h-10 w-full border-b px-4 backdrop-blur",children:[E.jsxs("div",{className:"min-w-[200px] w-auto flex items-center",children:[E.jsxs("a",{href:YB,className:"flex items-center gap-2",children:[E.jsx(ST,{className:"size-4 text-emerald-400","aria-hidden":"true"}),E.jsx("span",{className:"font-bold md:inline-block",children:x0.name})]}),o&&E.jsxs("div",{className:"flex items-center",children:[E.jsx("span",{className:"mx-1 text-xs text-gray-500 dark:text-gray-400",children:"|"}),E.jsx(hT,{children:E.jsxs(mT,{children:[E.jsx(bT,{asChild:!0,children:E.jsx("span",{className:"font-medium text-sm cursor-default",children:o})}),s&&E.jsx(gp,{side:"bottom",children:s})]})})]})]}),E.jsxs("div",{className:"flex h-10 flex-1 items-center justify-center",children:[E.jsx(bJ,{}),t&&E.jsx("div",{className:"ml-2 self-center px-2 py-1 text-xs bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200 rounded-md",children:e("login.guestMode","Guest Mode")})]}),E.jsx("nav",{className:"w-[200px] flex items-center justify-end",children:E.jsxs("div",{className:"flex items-center gap-2",children:[l&&E.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400 mr-1",children:["v",l]}),E.jsx(nt,{variant:"ghost",size:"icon",side:"bottom",tooltip:e("header.projectRepository"),children:E.jsx("a",{href:x0.github,target:"_blank",rel:"noopener noreferrer",children:E.jsx(xZ,{className:"size-4","aria-hidden":"true"})})}),E.jsx($3,{}),!t&&E.jsx(nt,{variant:"ghost",size:"icon",side:"bottom",tooltip:`${e("header.logout")} (${a})`,onClick:u,children:E.jsx(NZ,{className:"size-4","aria-hidden":"true"})})]})})]})}var Rd={exports:{}},gN;function vJ(){if(gN)return Rd.exports;gN=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(N,C,_){return Function.prototype.apply.call(N,C,_)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:n=function(N){return Object.getOwnPropertyNames(N)};function r(O){console&&console.warn&&console.warn(O)}var a=Number.isNaN||function(N){return N!==N};function o(){o.init.call(this)}Rd.exports=o,Rd.exports.once=T,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(O){if(typeof O!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof O)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(O){if(typeof O!="number"||O<0||a(O))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+O+".");s=O}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||a(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function u(O){return O._maxListeners===void 0?o.defaultMaxListeners:O._maxListeners}o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(N){for(var C=[],_=1;_0&&(I=C[0]),I instanceof Error)throw I;var U=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw U.context=I,U}var $=D[N];if($===void 0)return!1;if(typeof $=="function")t($,this,C);else for(var B=$.length,W=y($,B),_=0;_0&&I.length>M&&!I.warned){I.warned=!0;var U=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");U.name="MaxListenersExceededWarning",U.emitter=O,U.type=N,U.count=I.length,r(U)}return O}o.prototype.addListener=function(N,C){return d(this,N,C,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(N,C){return d(this,N,C,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(O,N,C){var _={fired:!1,wrapFn:void 0,target:O,type:N,listener:C},M=p.bind(_);return M.listener=C,_.wrapFn=M,M}o.prototype.once=function(N,C){return l(C),this.on(N,g(this,N,C)),this},o.prototype.prependOnceListener=function(N,C){return l(C),this.prependListener(N,g(this,N,C)),this},o.prototype.removeListener=function(N,C){var _,M,D,I,U;if(l(C),M=this._events,M===void 0)return this;if(_=M[N],_===void 0)return this;if(_===C||_.listener===C)--this._eventsCount===0?this._events=Object.create(null):(delete M[N],M.removeListener&&this.emit("removeListener",N,_.listener||C));else if(typeof _!="function"){for(D=-1,I=_.length-1;I>=0;I--)if(_[I]===C||_[I].listener===C){U=_[I].listener,D=I;break}if(D<0)return this;D===0?_.shift():v(_,D),_.length===1&&(M[N]=_[0]),M.removeListener!==void 0&&this.emit("removeListener",N,U||C)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(N){var C,_,M;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[N]),this;if(arguments.length===0){var D=Object.keys(_),I;for(M=0;M=0;M--)this.removeListener(N,C[M]);return this};function m(O,N,C){var _=O._events;if(_===void 0)return[];var M=_[N];return M===void 0?[]:typeof M=="function"?C?[M.listener||M]:[M]:C?x(M):y(M,M.length)}o.prototype.listeners=function(N){return m(this,N,!0)},o.prototype.rawListeners=function(N){return m(this,N,!1)},o.listenerCount=function(O,N){return typeof O.listenerCount=="function"?O.listenerCount(N):b.call(O,N)},o.prototype.listenerCount=b;function b(O){var N=this._events;if(N!==void 0){var C=N[O];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function y(O,N){for(var C=new Array(N),_=0;_e++}function za(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Xs(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class AT extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class Pe extends AT{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Pe.prototype.constructor)}}class Le extends AT{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Le.prototype.constructor)}}class Ze extends AT{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ze.prototype.constructor)}}function g4(e,t){this.key=e,this.attributes=t,this.clear()}g4.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function h4(e,t){this.key=e,this.attributes=t,this.clear()}h4.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function m4(e,t){this.key=e,this.attributes=t,this.clear()}m4.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Zs(e,t,n,r,a){this.key=t,this.attributes=a,this.undirected=e,this.source=n,this.target=r}Zs.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};Zs.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const a=this.source[e],o=a[r];if(typeof o>"u"){a[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}o.previous=this,this.next=o,a[r]=this,this.target[t][n]=this};Zs.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};Zs.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const b4=0,y4=1,wJ=2,v4=3;function qa(e,t,n,r,a,o,s){let l,u,d,p;if(r=""+r,n===b4){if(l=e._nodes.get(r),!l)throw new Le(`Graph.${t}: could not find the "${r}" node in the graph.`);d=a,p=o}else if(n===v4){if(a=""+a,u=e._edges.get(a),!u)throw new Le(`Graph.${t}: could not find the "${a}" edge in the graph.`);const g=u.source.key,m=u.target.key;if(r===g)l=u.target;else if(r===m)l=u.source;else throw new Le(`Graph.${t}: the "${r}" node is not attached to the "${a}" edge (${g}, ${m}).`);d=o,p=s}else{if(u=e._edges.get(r),!u)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===y4?l=u.source:l=u.target,d=a,p=o}return[l,d,p]}function xJ(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);return s.attributes[l]}}function kJ(e,t,n){e.prototype[t]=function(r,a){const[o]=qa(this,t,n,r,a);return o.attributes}}function TJ(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);return s.attributes.hasOwnProperty(l)}}function AJ(e,t,n){e.prototype[t]=function(r,a,o,s){const[l,u,d]=qa(this,t,n,r,a,o,s);return l.attributes[u]=d,this.emit("nodeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:u}),this}}function RJ(e,t,n){e.prototype[t]=function(r,a,o,s){const[l,u,d]=qa(this,t,n,r,a,o,s);if(typeof d!="function")throw new Pe(`Graph.${t}: updater should be a function.`);const p=l.attributes,g=d(p[u]);return p[u]=g,this.emit("nodeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:u}),this}}function CJ(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);return delete s.attributes[l],this.emit("nodeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:l}),this}}function _J(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);if(!vn(l))throw new Pe(`Graph.${t}: provided attributes are not a plain object.`);return s.attributes=l,this.emit("nodeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function NJ(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);if(!vn(l))throw new Pe(`Graph.${t}: provided attributes are not a plain object.`);return nn(s.attributes,l),this.emit("nodeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:l}),this}}function OJ(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);if(typeof l!="function")throw new Pe(`Graph.${t}: provided updater is not a function.`);return s.attributes=l(s.attributes),this.emit("nodeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const IJ=[{name:e=>`get${e}Attribute`,attacher:xJ},{name:e=>`get${e}Attributes`,attacher:kJ},{name:e=>`has${e}Attribute`,attacher:TJ},{name:e=>`set${e}Attribute`,attacher:AJ},{name:e=>`update${e}Attribute`,attacher:RJ},{name:e=>`remove${e}Attribute`,attacher:CJ},{name:e=>`replace${e}Attributes`,attacher:_J},{name:e=>`merge${e}Attributes`,attacher:NJ},{name:e=>`update${e}Attributes`,attacher:OJ}];function DJ(e){IJ.forEach(function({name:t,attacher:n}){n(e,t("Node"),b4),n(e,t("Source"),y4),n(e,t("Target"),wJ),n(e,t("Opposite"),v4)})}function LJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes[a]}}function MJ(e,t,n){e.prototype[t]=function(r){let a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,s=""+arguments[1];if(a=kr(this,o,s,n),!a)throw new Le(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return a.attributes}}function PJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes.hasOwnProperty(a)}}function FJ(e,t,n){e.prototype[t]=function(r,a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],o=arguments[3],s=kr(this,l,u,n),!s)throw new Le(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return s.attributes[a]=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:a}),this}}function zJ(e,t,n){e.prototype[t]=function(r,a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],o=arguments[3],s=kr(this,l,u,n),!s)throw new Le(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof o!="function")throw new Pe(`Graph.${t}: updater should be a function.`);return s.attributes[a]=o(s.attributes[a]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:a}),this}}function BJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete o.attributes[a],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:a}),this}}function jJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!vn(a))throw new Pe(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=a,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function UJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!vn(a))throw new Pe(`Graph.${t}: provided attributes are not a plain object.`);return nn(o.attributes,a),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:a}),this}}function GJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof a!="function")throw new Pe(`Graph.${t}: provided updater is not a function.`);return o.attributes=a(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const HJ=[{name:e=>`get${e}Attribute`,attacher:LJ},{name:e=>`get${e}Attributes`,attacher:MJ},{name:e=>`has${e}Attribute`,attacher:PJ},{name:e=>`set${e}Attribute`,attacher:FJ},{name:e=>`update${e}Attribute`,attacher:zJ},{name:e=>`remove${e}Attribute`,attacher:BJ},{name:e=>`replace${e}Attributes`,attacher:jJ},{name:e=>`merge${e}Attributes`,attacher:UJ},{name:e=>`update${e}Attributes`,attacher:GJ}];function $J(e){HJ.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const qJ=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function VJ(e,t,n,r){let a=!1;for(const o in t){if(o===r)continue;const s=t[o];if(a=n(s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected),e&&a)return s.key}}function WJ(e,t,n,r){let a,o,s,l=!1;for(const u in t)if(u!==r){a=t[u];do{if(o=a.source,s=a.target,l=n(a.key,a.attributes,o.key,s.key,o.attributes,s.attributes,a.undirected),e&&l)return a.key;a=a.next}while(a!==void 0)}}function ym(e,t){const n=Object.keys(e),r=n.length;let a,o=0;return{[Symbol.iterator](){return this},next(){do if(a)a=a.next;else{if(o>=r)return{done:!0};const s=n[o++];if(s===t){a=void 0;continue}a=e[s]}while(!a);return{done:!1,value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected}}}}}function YJ(e,t,n,r){const a=t[n];if(!a)return;const o=a.source,s=a.target;if(r(a.key,a.attributes,o.key,s.key,o.attributes,s.attributes,a.undirected)&&e)return a.key}function KJ(e,t,n,r){let a=t[n];if(!a)return;let o=!1;do{if(o=r(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),e&&o)return a.key;a=a.next}while(a!==void 0)}function vm(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const a={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:a}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function XJ(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),a=t==="undirected",o=e._edges.values();let s=0,l,u;for(;l=o.next(),l.done!==!0;)u=l.value,u.undirected===a&&(r[s++]=u.key);return r}function S4(e,t,n,r){if(t.size===0)return;const a=n!=="mixed"&&n!==t.type,o=n==="undirected";let s,l,u=!1;const d=t._edges.values();for(;s=d.next(),s.done!==!0;){if(l=s.value,a&&l.undirected!==o)continue;const{key:p,attributes:g,source:m,target:b}=l;if(u=r(p,g,m.key,b.key,m.attributes,b.attributes,l.undirected),e&&u)return p}}function ZJ(e,t){if(e.size===0)return Xs();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",a=e._edges.values();return{[Symbol.iterator](){return this},next(){let o,s;for(;;){if(o=a.next(),o.done)return o;if(s=o.value,!(n&&s.undirected!==r))break}return{value:{edge:s.key,attributes:s.attributes,source:s.source.key,target:s.target.key,sourceAttributes:s.source.attributes,targetAttributes:s.target.attributes,undirected:s.undirected},done:!1}}}}function RT(e,t,n,r,a,o){const s=t?WJ:VJ;let l;if(n!=="undirected"&&(r!=="out"&&(l=s(e,a.in,o),e&&l)||r!=="in"&&(l=s(e,a.out,o,r?void 0:a.key),e&&l))||n!=="directed"&&(l=s(e,a.undirected,o),e&&l))return l}function QJ(e,t,n,r){const a=[];return RT(!1,e,t,n,r,function(o){a.push(o)}),a}function JJ(e,t,n){let r=Xs();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=za(r,ym(n.in))),t!=="in"&&typeof n.out<"u"&&(r=za(r,ym(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=za(r,ym(n.undirected))),r}function CT(e,t,n,r,a,o,s){const l=n?KJ:YJ;let u;if(t!=="undirected"&&(typeof a.in<"u"&&r!=="out"&&(u=l(e,a.in,o,s),e&&u)||typeof a.out<"u"&&r!=="in"&&(r||a.key!==o)&&(u=l(e,a.out,o,s),e&&u))||t!=="directed"&&typeof a.undirected<"u"&&(u=l(e,a.undirected,o,s),e&&u))return u}function eee(e,t,n,r,a){const o=[];return CT(!1,e,t,n,r,a,function(s){o.push(s)}),o}function tee(e,t,n,r){let a=Xs();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(a=za(a,vm(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(a=za(a,vm(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(a=za(a,vm(n.undirected,r))),a}function nee(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(o,s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return XJ(this,r);if(arguments.length===1){o=""+o;const l=this._nodes.get(o);if(typeof l>"u")throw new Le(`Graph.${n}: could not find the "${o}" node in the graph.`);return QJ(this.multi,r==="mixed"?this.type:r,a,l)}if(arguments.length===2){o=""+o,s=""+s;const l=this._nodes.get(o);if(!l)throw new Le(`Graph.${n}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(s))throw new Le(`Graph.${n}: could not find the "${s}" target node in the graph.`);return eee(r,this.multi,a,l,s)}throw new Pe(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function ree(e,t){const{name:n,type:r,direction:a}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p,g){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return g=d,S4(!1,this,r,g);if(arguments.length===2){d=""+d,g=p;const m=this._nodes.get(d);if(typeof m>"u")throw new Le(`Graph.${o}: could not find the "${d}" node in the graph.`);return RT(!1,this.multi,r==="mixed"?this.type:r,a,m,g)}if(arguments.length===3){d=""+d,p=""+p;const m=this._nodes.get(d);if(!m)throw new Le(`Graph.${o}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(p))throw new Le(`Graph.${o}: could not find the "${p}" target node in the graph.`);return CT(!1,r,this.multi,a,m,p,g)}throw new Pe(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const s="map"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop();let g;if(d.length===0){let m=0;r!=="directed"&&(m+=this.undirectedSize),r!=="undirected"&&(m+=this.directedSize),g=new Array(m);let b=0;d.push((y,v,x,T,k,R,O)=>{g[b++]=p(y,v,x,T,k,R,O)})}else g=[],d.push((m,b,y,v,x,T,k)=>{g.push(p(m,b,y,v,x,T,k))});return this[o].apply(this,d),g};const l="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop(),g=[];return d.push((m,b,y,v,x,T,k)=>{p(m,b,y,v,x,T,k)&&g.push(m)}),this[o].apply(this,d),g};const u="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){let d=Array.prototype.slice.call(arguments);if(d.length<2||d.length>4)throw new Pe(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${d.length}).`);if(typeof d[d.length-1]=="function"&&typeof d[d.length-2]!="function")throw new Pe(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p,g;d.length===2?(p=d[0],g=d[1],d=[]):d.length===3?(p=d[1],g=d[2],d=[d[0]]):d.length===4&&(p=d[2],g=d[3],d=[d[0],d[1]]);let m=g;return d.push((b,y,v,x,T,k,R)=>{m=p(m,b,y,v,x,T,k,R)}),this[o].apply(this,d),m}}function aee(e,t){const{name:n,type:r,direction:a}=t,o="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(u,d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=u,S4(!0,this,r,p);if(arguments.length===2){u=""+u,p=d;const g=this._nodes.get(u);if(typeof g>"u")throw new Le(`Graph.${o}: could not find the "${u}" node in the graph.`);return RT(!0,this.multi,r==="mixed"?this.type:r,a,g,p)}if(arguments.length===3){u=""+u,d=""+d;const g=this._nodes.get(u);if(!g)throw new Le(`Graph.${o}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(d))throw new Le(`Graph.${o}: could not find the "${d}" target node in the graph.`);return CT(!0,r,this.multi,a,g,d,p)}throw new Pe(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const s="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){const u=Array.prototype.slice.call(arguments),d=u.pop();return u.push((g,m,b,y,v,x,T)=>d(g,m,b,y,v,x,T)),!!this[o].apply(this,u)};const l="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[l]=function(){const u=Array.prototype.slice.call(arguments),d=u.pop();return u.push((g,m,b,y,v,x,T)=>!d(g,m,b,y,v,x,T)),!this[o].apply(this,u)}}function oee(e,t){const{name:n,type:r,direction:a}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(s,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Xs();if(!arguments.length)return ZJ(this,r);if(arguments.length===1){s=""+s;const u=this._nodes.get(s);if(!u)throw new Le(`Graph.${o}: could not find the "${s}" node in the graph.`);return JJ(r,a,u)}if(arguments.length===2){s=""+s,l=""+l;const u=this._nodes.get(s);if(!u)throw new Le(`Graph.${o}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(l))throw new Le(`Graph.${o}: could not find the "${l}" target node in the graph.`);return tee(r,a,u,l)}throw new Pe(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function iee(e){qJ.forEach(t=>{nee(e,t),ree(e,t),aee(e,t),oee(e,t)})}const see=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function xp(){this.A=null,this.B=null}xp.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};xp.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function nc(e,t,n,r,a){for(const o in r){const s=r[o],l=s.source,u=s.target,d=l===n?u:l;if(t&&t.has(d.key))continue;const p=a(d.key,d.attributes);if(e&&p)return d.key}}function _T(e,t,n,r,a){if(t!=="mixed"){if(t==="undirected")return nc(e,null,r,r.undirected,a);if(typeof n=="string")return nc(e,null,r,r[n],a)}const o=new xp;let s;if(t!=="undirected"){if(n!=="out"){if(s=nc(e,null,r,r.in,a),e&&s)return s;o.wrap(r.in)}if(n!=="in"){if(s=nc(e,o,r,r.out,a),e&&s)return s;o.wrap(r.out)}}if(t!=="directed"&&(s=nc(e,o,r,r.undirected,a),e&&s))return s}function lee(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return _T(!1,e,t,n,function(a){r.push(a)}),r}function rc(e,t,n){const r=Object.keys(n),a=r.length;let o=0;return{[Symbol.iterator](){return this},next(){let s=null;do{if(o>=a)return e&&e.wrap(n),{done:!0};const l=n[r[o++]],u=l.source,d=l.target;if(s=u===t?d:u,e&&e.has(s.key)){s=null;continue}}while(s===null);return{done:!1,value:{neighbor:s.key,attributes:s.attributes}}}}}function cee(e,t,n){if(e!=="mixed"){if(e==="undirected")return rc(null,n,n.undirected);if(typeof t=="string")return rc(null,n,n[t])}let r=Xs();const a=new xp;return e!=="undirected"&&(t!=="out"&&(r=za(r,rc(a,n,n.in))),t!=="in"&&(r=za(r,rc(a,n,n.out)))),e!=="directed"&&(r=za(r,rc(a,n,n.undirected))),r}function uee(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new Le(`Graph.${n}: could not find the "${o}" node in the graph.`);return lee(r==="mixed"?this.type:r,a,s)}}function dee(e,t){const{name:n,type:r,direction:a}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const g=this._nodes.get(d);if(typeof g>"u")throw new Le(`Graph.${o}: could not find the "${d}" node in the graph.`);_T(!1,r==="mixed"?this.type:r,a,g,p)};const s="map"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(d,p){const g=[];return this[o](d,(m,b)=>{g.push(p(m,b))}),g};const l="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(d,p){const g=[];return this[o](d,(m,b)=>{p(m,b)&&g.push(m)}),g};const u="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(d,p,g){if(arguments.length<3)throw new Pe(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let m=g;return this[o](d,(b,y)=>{m=p(m,b,y)}),m}}function fee(e,t){const{name:n,type:r,direction:a}=t,o=n[0].toUpperCase()+n.slice(1,-1),s="find"+o;e.prototype[s]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const g=this._nodes.get(d);if(typeof g>"u")throw new Le(`Graph.${s}: could not find the "${d}" node in the graph.`);return _T(!0,r==="mixed"?this.type:r,a,g,p)};const l="some"+o;e.prototype[l]=function(d,p){return!!this[s](d,p)};const u="every"+o;e.prototype[u]=function(d,p){return!this[s](d,(m,b)=>!p(m,b))}}function pee(e,t){const{name:n,type:r,direction:a}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Xs();s=""+s;const l=this._nodes.get(s);if(typeof l>"u")throw new Le(`Graph.${o}: could not find the "${s}" node in the graph.`);return cee(r==="mixed"?this.type:r,a,l)}}function gee(e){see.forEach(t=>{uee(e,t),dee(e,t),fee(e,t),pee(e,t)})}function Cd(e,t,n,r,a){const o=r._nodes.values(),s=r.type;let l,u,d,p,g,m;for(;l=o.next(),l.done!==!0;){let b=!1;if(u=l.value,s!=="undirected"){p=u.out;for(d in p){g=p[d];do m=g.target,b=!0,a(u.key,m.key,u.attributes,m.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(s!=="directed"){p=u.undirected;for(d in p)if(!(t&&u.key>d)){g=p[d];do m=g.target,m.key!==d&&(m=g.source),b=!0,a(u.key,m.key,u.attributes,m.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!b&&a(u.key,null,u.attributes,null,null,null,null)}}function hee(e,t){const n={key:e};return p4(t.attributes)||(n.attributes=nn({},t.attributes)),n}function mee(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return p4(n.attributes)||(r.attributes=nn({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function bee(e){if(!vn(e))throw new Pe('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in e))throw new Pe("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!vn(e.attributes)||e.attributes===null))throw new Pe("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function yee(e){if(!vn(e))throw new Pe('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in e))throw new Pe("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new Pe("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!vn(e.attributes)||e.attributes===null))throw new Pe("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new Pe("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const vee=EJ(),See=new Set(["directed","undirected","mixed"]),mN=new Set(["domain","_events","_eventsCount","_maxListeners"]),Eee=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:"directed"},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:"directed"},{name:e=>`${e}UndirectedEdgeWithKey`,type:"undirected"}],wee={allowSelfLoops:!0,multi:!1,type:"mixed"};function xee(e,t,n){if(n&&!vn(n))throw new Pe(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Ze(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function bN(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function E4(e,t,n,r,a,o,s,l){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(l&&!vn(l))throw new Pe(`Graph.${t}: invalid attributes. Expecting an object but got "${l}"`);if(o=""+o,s=""+s,l=l||{},!e.allowSelfLoops&&o===s)throw new Ze(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const u=e._nodes.get(o),d=e._nodes.get(s);if(!u)throw new Le(`Graph.${t}: source node "${o}" not found.`);if(!d)throw new Le(`Graph.${t}: target node "${s}" not found.`);const p={key:null,undirected:r,source:o,target:s,attributes:l};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);if(!e.multi&&(r?typeof u.undirected[s]<"u":typeof u.out[s]<"u"))throw new Ze(`Graph.${t}: an edge linking "${o}" to "${s}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const g=new Zs(r,a,u,d,l);e._edges.set(a,g);const m=o===s;return r?(u.undirectedDegree++,d.undirectedDegree++,m&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,m&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),r?e._undirectedSize++:e._directedSize++,p.key=a,e.emit("edgeAdded",p),a}function kee(e,t,n,r,a,o,s,l,u){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(l){if(u){if(typeof l!="function")throw new Pe(`Graph.${t}: invalid updater function. Expecting a function but got "${l}"`)}else if(!vn(l))throw new Pe(`Graph.${t}: invalid attributes. Expecting an object but got "${l}"`)}o=""+o,s=""+s;let d;if(u&&(d=l,l=void 0),!e.allowSelfLoops&&o===s)throw new Ze(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(o),g=e._nodes.get(s),m,b;if(!n&&(m=e._edges.get(a),m)){if((m.source.key!==o||m.target.key!==s)&&(!r||m.source.key!==s||m.target.key!==o))throw new Ze(`Graph.${t}: inconsistency detected when attempting to merge the "${a}" edge with "${o}" source & "${s}" target vs. ("${m.source.key}", "${m.target.key}").`);b=m}if(!b&&!e.multi&&p&&(b=r?p.undirected[s]:p.out[s]),b){const k=[b.key,!1,!1,!1];if(u?!d:!l)return k;if(u){const R=b.attributes;b.attributes=d(R),e.emit("edgeAttributesUpdated",{type:"replace",key:b.key,attributes:b.attributes})}else nn(b.attributes,l),e.emit("edgeAttributesUpdated",{type:"merge",key:b.key,attributes:b.attributes,data:l});return k}l=l||{},u&&d&&(l=d(l));const y={key:null,undirected:r,source:o,target:s,attributes:l};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);let v=!1,x=!1;p||(p=bN(e,o,{}),v=!0,o===s&&(g=p,x=!0)),g||(g=bN(e,s,{}),x=!0),m=new Zs(r,a,p,g,l),e._edges.set(a,m);const T=o===s;return r?(p.undirectedDegree++,g.undirectedDegree++,T&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,g.inDegree++,T&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?m.attachMulti():m.attach(),r?e._undirectedSize++:e._directedSize++,y.key=a,e.emit("edgeAdded",y),[a,!0,v,x]}function gs(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:a}=t,o=t.undirected,s=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,s&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,s&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),o?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:a,source:n.key,target:r.key,undirected:o})}class _t extends f4.EventEmitter{constructor(t){if(super(),t=nn({},wee,t),typeof t.multi!="boolean")throw new Pe(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!See.has(t.type))throw new Pe(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new Pe(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?g4:t.type==="directed"?h4:m4;Sr(this,"NodeDataClass",n);const r="geid_"+vee()+"_";let a=0;const o=()=>{let s;do s=r+a++;while(this._edges.has(s));return s};Sr(this,"_attributes",{}),Sr(this,"_nodes",new Map),Sr(this,"_edges",new Map),Sr(this,"_directedSize",0),Sr(this,"_undirectedSize",0),Sr(this,"_directedSelfLoopCount",0),Sr(this,"_undirectedSelfLoopCount",0),Sr(this,"_edgeKeyGenerator",o),Sr(this,"_options",t),mN.forEach(s=>Sr(this,s,this[s])),Mr(this,"order",()=>this._nodes.size),Mr(this,"size",()=>this._edges.size),Mr(this,"directedSize",()=>this._directedSize),Mr(this,"undirectedSize",()=>this._undirectedSize),Mr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Mr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Mr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Mr(this,"multi",this._options.multi),Mr(this,"type",this._options.type),Mr(this,"allowSelfLoops",this._options.allowSelfLoops),Mr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&!a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new Pe(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new Pe(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){const r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new Pe(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(t,n){if(this.type==="undirected")return;if(t=""+t,n=""+n,this.multi)throw new Ze("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new Le(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Le(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||void 0;if(a)return a.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Ze("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new Le(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Le(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const a=r.undirected&&r.undirected[n]||void 0;if(a)return a.key}edge(t,n){if(this.multi)throw new Ze("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Le(`Graph.edge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(a)return a.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,a+=n.directedLoops),r-a}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,a+=n.directedLoops),r-a}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,a+=n.directedLoops*2),r-a}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const r=this._edges.get(n);if(!r)throw new Le(`Graph.opposite: could not find the "${n}" edge in the graph.`);const a=r.source.key,o=r.target.key;if(t===a)return o;if(t===o)return a;throw new Le(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${a}, ${o}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new Le(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return xee(this,t,n).key}mergeNode(t,n){if(n&&!vn(n))throw new Pe(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(nn(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new Pe(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const o=r.attributes;r.attributes=n(o),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const a=n?n({}):{};return r=new this.NodeDataClass(t,a),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:a}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const a in n.out){r=n.out[a];do gs(this,r),r=r.next;while(r)}for(const a in n.in){r=n.in[a];do gs(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const a in n.undirected){r=n.undirected[a];do gs(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],a=""+arguments[1];if(n=kr(this,r,a,this.type),!n)throw new Le(`Graph.dropEdge: could not find the "${r}" -> "${a}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new Le(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return gs(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Ze("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Ze("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;const r=kr(this,t,n,"directed");if(!r)throw new Le(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return gs(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Ze("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Ze("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=kr(this,t,n,"undirected");if(!r)throw new Le(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return gs(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new Pe("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!vn(t))throw new Pe("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(t){if(!vn(t))throw new Pe("Graph.mergeAttributes: provided attributes are not a plain object.");return nn(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new Pe("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(t,n){if(typeof t!="function")throw new Pe("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!hN(n))throw new Pe("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let a,o;for(;a=r.next(),a.done!==!0;)o=a.value,o.attributes=t(o.key,o.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new Pe("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!hN(n))throw new Pe("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let a,o,s,l;for(;a=r.next(),a.done!==!0;)o=a.value,s=o.source,l=o.target,o.attributes=t(o.key,o.attributes,s.key,l.key,s.attributes,l.attributes,o.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new Pe("Graph.forEachAdjacencyEntry: expecting a callback.");Cd(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Pe("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Cd(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new Pe("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Cd(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Pe("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Cd(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new Pe("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)}findNode(t){if(typeof t!="function")throw new Pe("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return a.key}mapNodes(t){if(typeof t!="function")throw new Pe("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,a;const o=new Array(this.order);let s=0;for(;r=n.next(),r.done!==!0;)a=r.value,o[s++]=t(a.key,a.attributes);return o}someNode(t){if(typeof t!="function")throw new Pe("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new Pe("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,!t(a.key,a.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new Pe("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,a;const o=[];for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)&&o.push(a.key);return o}reduceNodes(t,n){if(typeof t!="function")throw new Pe("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new Pe("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n;const a=this._nodes.values();let o,s;for(;o=a.next(),o.done!==!0;)s=o.value,r=t(r,s.key,s.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((a,o)=>{t[n++]=hee(o,a)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((a,o)=>{r[n++]=mee(this.type,o,a)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof _t)return t.forEachNode((u,d)=>{n?this.mergeNode(u,d):this.addNode(u,d)}),t.forEachEdge((u,d,p,g,m,b,y)=>{n?y?this.mergeUndirectedEdgeWithKey(u,p,g,d):this.mergeDirectedEdgeWithKey(u,p,g,d):y?this.addUndirectedEdgeWithKey(u,p,g,d):this.addDirectedEdgeWithKey(u,p,g,d)}),this;if(!vn(t))throw new Pe("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!vn(t.attributes))throw new Pe("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,a,o,s,l;if(t.nodes){if(o=t.nodes,!Array.isArray(o))throw new Pe("Graph.import: invalid nodes. Expecting an array.");for(r=0,a=o.length;r{const o=nn({},r.attributes);r=new n.NodeDataClass(a,o),n._nodes.set(a,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Ze(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${t.type}" because this would mean losing information about the current graph.`);if(typeof t.multi=="boolean"&&t.multi!==this.multi&&t.multi!==!0)throw new Ze("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof t.allowSelfLoops=="boolean"&&t.allowSelfLoops!==this.allowSelfLoops&&t.allowSelfLoops!==!0)throw new Ze("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(t),r=this._edges.values();let a,o;for(;a=r.next(),a.done!==!0;)o=a.value,E4(n,"copy",!1,o.undirected,o.key,o.source.key,o.target.key,nn({},o.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((o,s)=>{t[s]=o.attributes});const n={},r={};this._edges.forEach((o,s)=>{const l=o.undirected?"--":"->";let u="",d=o.source.key,p=o.target.key,g;o.undirected&&d>p&&(g=d,d=p,p=g);const m=`(${d})${l}(${p})`;s.startsWith("geid_")?this.multi&&(typeof r[m]>"u"?r[m]=0:r[m]++,u+=`${r[m]}. `):u+=`[${s}]: `,u+=m,n[u]=o.attributes});const a={};for(const o in this)this.hasOwnProperty(o)&&!mN.has(o)&&typeof this[o]!="function"&&typeof o!="symbol"&&(a[o]=this[o]);return a.attributes=this._attributes,a.nodes=t,a.edges=n,Sr(a,"constructor",this.constructor),a}}typeof Symbol<"u"&&(_t.prototype[Symbol.for("nodejs.util.inspect.custom")]=_t.prototype.inspect);Eee.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?E4:kee;e.generateKey?_t.prototype[n]=function(a,o,s){return r(this,n,!0,(e.type||this.type)==="undirected",null,a,o,s,t==="update")}:_t.prototype[n]=function(a,o,s,l){return r(this,n,!1,(e.type||this.type)==="undirected",a,o,s,l,t==="update")}})});DJ(_t);$J(_t);iee(_t);gee(_t);class w4 extends _t{constructor(t){const n=nn({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new Pe("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new Pe('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class Ac extends _t{constructor(t){const n=nn({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new Pe("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new Pe('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class x4 extends _t{constructor(t){const n=nn({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Pe("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class k4 extends _t{constructor(t){const n=nn({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Pe("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new Pe('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class T4 extends _t{constructor(t){const n=nn({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Pe("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new Pe('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Qs(e){e.from=function(t,n){const r=nn({},t.options,n),a=new e(r);return a.import(t),a}}Qs(_t);Qs(w4);Qs(Ac);Qs(x4);Qs(k4);Qs(T4);_t.Graph=_t;_t.DirectedGraph=w4;_t.UndirectedGraph=Ac;_t.MultiGraph=x4;_t.MultiDirectedGraph=k4;_t.MultiUndirectedGraph=T4;_t.InvalidArgumentsGraphError=Pe;_t.NotFoundGraphError=Le;_t.UsageGraphError=Ze;function Tee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function hc(e){var t=Tee(e,"string");return typeof t=="symbol"?t:t+""}function dn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yN(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);nE.jsx(ap,{ref:n,className:Me("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/30",e),...t}));qU.displayName=ap.displayName;const Vc=w.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(uQ,{children:[E.jsx(qU,{}),E.jsxs(op,{ref:r,className:Me("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 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,E.jsxs(eT,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[E.jsx(HU,{className:"h-4 w-4"}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Vc.displayName=op.displayName;const Wc=({className:e,...t})=>E.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Wc.displayName="DialogHeader";const VU=({className:e,...t})=>E.jsx("div",{className:Me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});VU.displayName="DialogFooter";const Yc=w.forwardRef(({className:e,...t},n)=>E.jsx(Qk,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));Yc.displayName=Qk.displayName;const Kc=w.forwardRef(({className:e,...t},n)=>E.jsx(Jk,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Kc.displayName=Jk.displayName;const dQ=({status:e})=>{const{t}=Et();return e?E.jsxs("div",{className:"min-w-[300px] space-y-2 text-xs",children:[E.jsxs("div",{className:"space-y-1",children:[E.jsx("h4",{className:"font-medium",children:t("graphPanel.statusCard.storageInfo")}),E.jsxs("div",{className:"text-foreground grid grid-cols-[120px_1fr] gap-1",children:[E.jsxs("span",{children:[t("graphPanel.statusCard.workingDirectory"),":"]}),E.jsx("span",{className:"truncate",children:e.working_directory}),E.jsxs("span",{children:[t("graphPanel.statusCard.inputDirectory"),":"]}),E.jsx("span",{className:"truncate",children:e.input_directory})]})]}),E.jsxs("div",{className:"space-y-1",children:[E.jsx("h4",{className:"font-medium",children:t("graphPanel.statusCard.llmConfig")}),E.jsxs("div",{className:"text-foreground grid grid-cols-[120px_1fr] gap-1",children:[E.jsxs("span",{children:[t("graphPanel.statusCard.llmBinding"),":"]}),E.jsx("span",{children:e.configuration.llm_binding}),E.jsxs("span",{children:[t("graphPanel.statusCard.llmBindingHost"),":"]}),E.jsx("span",{children:e.configuration.llm_binding_host}),E.jsxs("span",{children:[t("graphPanel.statusCard.llmModel"),":"]}),E.jsx("span",{children:e.configuration.llm_model}),E.jsxs("span",{children:[t("graphPanel.statusCard.maxTokens"),":"]}),E.jsx("span",{children:e.configuration.max_tokens})]})]}),E.jsxs("div",{className:"space-y-1",children:[E.jsx("h4",{className:"font-medium",children:t("graphPanel.statusCard.embeddingConfig")}),E.jsxs("div",{className:"text-foreground grid grid-cols-[120px_1fr] gap-1",children:[E.jsxs("span",{children:[t("graphPanel.statusCard.embeddingBinding"),":"]}),E.jsx("span",{children:e.configuration.embedding_binding}),E.jsxs("span",{children:[t("graphPanel.statusCard.embeddingBindingHost"),":"]}),E.jsx("span",{children:e.configuration.embedding_binding_host}),E.jsxs("span",{children:[t("graphPanel.statusCard.embeddingModel"),":"]}),E.jsx("span",{children:e.configuration.embedding_model})]})]}),E.jsxs("div",{className:"space-y-1",children:[E.jsx("h4",{className:"font-medium",children:t("graphPanel.statusCard.storageConfig")}),E.jsxs("div",{className:"text-foreground grid grid-cols-[120px_1fr] gap-1",children:[E.jsxs("span",{children:[t("graphPanel.statusCard.kvStorage"),":"]}),E.jsx("span",{children:e.configuration.kv_storage}),E.jsxs("span",{children:[t("graphPanel.statusCard.docStatusStorage"),":"]}),E.jsx("span",{children:e.configuration.doc_status_storage}),E.jsxs("span",{children:[t("graphPanel.statusCard.graphStorage"),":"]}),E.jsx("span",{children:e.configuration.graph_storage}),E.jsxs("span",{children:[t("graphPanel.statusCard.vectorStorage"),":"]}),E.jsx("span",{children:e.configuration.vector_storage})]})]})]}):E.jsx("div",{className:"text-foreground text-xs",children:t("graphPanel.statusCard.unavailable")})},fQ=({open:e,onOpenChange:t,status:n})=>{const{t:r}=Et();return E.jsx(hp,{open:e,onOpenChange:t,children:E.jsxs(Vc,{className:"sm:max-w-[500px]",children:[E.jsxs(Wc,{children:[E.jsx(Yc,{children:r("graphPanel.statusDialog.title")}),E.jsx(Kc,{children:r("graphPanel.statusDialog.description")})]}),E.jsx(dQ,{status:n})]})})},pQ=()=>{const{t:e}=Et(),t=rr.use.health(),n=rr.use.lastCheckTime(),r=rr.use.status(),[a,o]=w.useState(!1),[s,l]=w.useState(!1);return w.useEffect(()=>{o(!0);const u=setTimeout(()=>o(!1),300);return()=>clearTimeout(u)},[n]),E.jsxs("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:[E.jsxs("div",{className:"flex cursor-pointer items-center gap-2",onClick:()=>l(!0),children:[E.jsx("div",{className:Me("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",t?"bg-green-500":"bg-red-500",a&&"scale-125",a&&t&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",a&&!t&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),E.jsx("span",{className:"text-muted-foreground text-xs",children:e(t?"graphPanel.statusIndicator.connected":"graphPanel.statusIndicator.disconnected")})]}),E.jsx(fQ,{open:s,onOpenChange:l,status:r})]})};var ET="Popover",[WU,h0e]=$r(ET,[Ys]),Xc=Ys(),[gQ,Do]=WU(ET),YU=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!1}=e,l=Xc(t),u=w.useRef(null),[d,p]=w.useState(!1),[g=!1,m]=ja({prop:r,defaultProp:a,onChange:o});return E.jsx(uT,{...l,children:E.jsx(gQ,{scope:t,contentId:An(),triggerRef:u,open:g,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(b=>!b),[m]),hasCustomAnchor:d,onCustomAnchorAdd:w.useCallback(()=>p(!0),[]),onCustomAnchorRemove:w.useCallback(()=>p(!1),[]),modal:s,children:n})})};YU.displayName=ET;var KU="PopoverAnchor",hQ=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Do(KU,n),o=Xc(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=a;return w.useEffect(()=>(s(),()=>l()),[s,l]),E.jsx(cp,{...o,...r,ref:t})});hQ.displayName=KU;var XU="PopoverTrigger",ZU=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Do(XU,n),o=Xc(n),s=mt(t,a.triggerRef),l=E.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":n3(a.open),...r,ref:s,onClick:Ke(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:E.jsx(cp,{asChild:!0,...o,children:l})});ZU.displayName=XU;var wT="PopoverPortal",[mQ,bQ]=WU(wT,{forceMount:void 0}),QU=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,o=Do(wT,t);return E.jsx(mQ,{scope:t,forceMount:n,children:E.jsx(ir,{present:n||o.open,children:E.jsx(tp,{asChild:!0,container:a,children:r})})})};QU.displayName=wT;var Ms="PopoverContent",JU=w.forwardRef((e,t)=>{const n=bQ(Ms,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,o=Do(Ms,e.__scopePopover);return E.jsx(ir,{present:r||o.open,children:o.modal?E.jsx(yQ,{...a,ref:t}):E.jsx(vQ,{...a,ref:t})})});JU.displayName=Ms;var yQ=w.forwardRef((e,t)=>{const n=Do(Ms,e.__scopePopover),r=w.useRef(null),a=mt(t,r),o=w.useRef(!1);return w.useEffect(()=>{const s=r.current;if(s)return qk(s)},[]),E.jsx(rp,{as:_o,allowPinchZoom:!0,children:E.jsx(e3,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ke(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),o.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Ke(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Ke(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),vQ=w.forwardRef((e,t)=>{const n=Do(Ms,e.__scopePopover),r=w.useRef(!1),a=w.useRef(!1);return E.jsx(e3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{var u,d;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const s=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),e3=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,...g}=e,m=Do(Ms,n),b=Xc(n);return $k(),E.jsx(ep,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:E.jsx($c,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:p,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:E.jsx(dT,{"data-state":n3(m.open),role:"dialog",id:m.contentId,...b,...g,ref:t,style:{...g.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)"}})})})}),t3="PopoverClose",SQ=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Do(t3,n);return E.jsx(Je.button,{type:"button",...r,ref:t,onClick:Ke(e.onClick,()=>a.onOpenChange(!1))})});SQ.displayName=t3;var EQ="PopoverArrow",wQ=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Xc(n);return E.jsx(fT,{...a,...r,ref:t})});wQ.displayName=EQ;function n3(e){return e?"open":"closed"}var xQ=YU,kQ=ZU,TQ=QU,r3=JU;const mp=xQ,bp=kQ,Zc=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,collisionPadding:r,sticky:a,avoidCollisions:o=!1,...s},l)=>E.jsx(TQ,{children:E.jsx(r3,{ref:l,align:t,sideOffset:n,collisionPadding:r,sticky:a,avoidCollisions:o,className:Me("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",e),...s})}));Zc.displayName=r3.displayName;function z0(e,[t,n]){return Math.min(n,Math.max(t,e))}function a3(e){const t=e+"CollectionProvider",[n,r]=$r(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=b=>{const{scope:y,children:v}=b,x=we.useRef(null),T=we.useRef(new Map).current;return E.jsx(a,{scope:y,itemMap:T,collectionRef:x,children:v})};s.displayName=t;const l=e+"CollectionSlot",u=we.forwardRef((b,y)=>{const{scope:v,children:x}=b,T=o(l,v),k=mt(y,T.collectionRef);return E.jsx(_o,{ref:k,children:x})});u.displayName=l;const d=e+"CollectionItemSlot",p="data-radix-collection-item",g=we.forwardRef((b,y)=>{const{scope:v,children:x,...T}=b,k=we.useRef(null),R=mt(y,k),O=o(d,v);return we.useEffect(()=>(O.itemMap.set(k,{ref:k,...T}),()=>void O.itemMap.delete(k))),E.jsx(_o,{[p]:"",ref:R,children:x})});g.displayName=d;function m(b){const y=o(e+"CollectionConsumer",b);return we.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const T=Array.from(x.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((O,N)=>T.indexOf(O.ref.current)-T.indexOf(N.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:u,ItemSlot:g},m,r]}var AQ=w.createContext(void 0);function yp(e){const t=w.useContext(AQ);return e||t||"ltr"}function o3(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var RQ=[" ","Enter","ArrowUp","ArrowDown"],CQ=[" ","Enter"],Qc="Select",[vp,Sp,_Q]=a3(Qc),[Ks,m0e]=$r(Qc,[_Q,Ys]),Ep=Ys(),[NQ,Lo]=Ks(Qc),[OQ,IQ]=Ks(Qc),i3=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:s,defaultValue:l,onValueChange:u,dir:d,name:p,autoComplete:g,disabled:m,required:b,form:y}=e,v=Ep(t),[x,T]=w.useState(null),[k,R]=w.useState(null),[O,N]=w.useState(!1),C=yp(d),[_=!1,M]=ja({prop:r,defaultProp:a,onChange:o}),[D,I]=ja({prop:s,defaultProp:l,onChange:u}),U=w.useRef(null),$=x?y||!!x.closest("form"):!0,[B,W]=w.useState(new Set),K=Array.from(B).map(G=>G.props.value).join(";");return E.jsx(uT,{...v,children:E.jsxs(NQ,{required:b,scope:t,trigger:x,onTriggerChange:T,valueNode:k,onValueNodeChange:R,valueNodeHasChildren:O,onValueNodeHasChildrenChange:N,contentId:An(),value:D,onValueChange:I,open:_,onOpenChange:M,dir:C,triggerPointerDownPosRef:U,disabled:m,children:[E.jsx(vp.Provider,{scope:t,children:E.jsx(OQ,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(G=>{W(H=>new Set(H).add(G))},[]),onNativeOptionRemove:w.useCallback(G=>{W(H=>{const F=new Set(H);return F.delete(G),F})},[]),children:n})}),$?E.jsxs(I3,{"aria-hidden":!0,required:b,tabIndex:-1,name:p,autoComplete:g,value:D,onChange:G=>I(G.target.value),disabled:m,form:y,children:[D===void 0?E.jsx("option",{value:""}):null,Array.from(B)]},K):null]})})};i3.displayName=Qc;var s3="SelectTrigger",l3=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=Ep(n),s=Lo(s3,n),l=s.disabled||r,u=mt(t,s.onTriggerChange),d=Sp(n),p=w.useRef("touch"),[g,m,b]=D3(v=>{const x=d().filter(R=>!R.disabled),T=x.find(R=>R.value===s.value),k=L3(x,v,T);k!==void 0&&s.onValueChange(k.value)}),y=v=>{l||(s.onOpenChange(!0),b()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return E.jsx(cp,{asChild:!0,...o,children:E.jsx(Je.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":O3(s.value)?"":void 0,...a,ref:u,onClick:Ke(a.onClick,v=>{v.currentTarget.focus(),p.current!=="mouse"&&y(v)}),onPointerDown:Ke(a.onPointerDown,v=>{p.current=v.pointerType;const x=v.target;x.hasPointerCapture(v.pointerId)&&x.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(y(v),v.preventDefault())}),onKeyDown:Ke(a.onKeyDown,v=>{const x=g.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(x&&v.key===" ")&&RQ.includes(v.key)&&(y(),v.preventDefault())})})})});l3.displayName=s3;var c3="SelectValue",u3=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:s="",...l}=e,u=Lo(c3,n),{onValueNodeHasChildrenChange:d}=u,p=o!==void 0,g=mt(t,u.onValueNodeChange);return Rn(()=>{d(p)},[d,p]),E.jsx(Je.span,{...l,ref:g,style:{pointerEvents:"none"},children:O3(u.value)?E.jsx(E.Fragment,{children:s}):o})});u3.displayName=c3;var DQ="SelectIcon",d3=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return E.jsx(Je.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});d3.displayName=DQ;var LQ="SelectPortal",f3=e=>E.jsx(tp,{asChild:!0,...e});f3.displayName=LQ;var vi="SelectContent",p3=w.forwardRef((e,t)=>{const n=Lo(vi,e.__scopeSelect),[r,a]=w.useState();if(Rn(()=>{a(new DocumentFragment)},[]),!n.open){const o=r;return o?Uc.createPortal(E.jsx(g3,{scope:e.__scopeSelect,children:E.jsx(vp.Slot,{scope:e.__scopeSelect,children:E.jsx("div",{children:e.children})})}),o):null}return E.jsx(h3,{...e,ref:t})});p3.displayName=vi;var Pr=10,[g3,Mo]=Ks(vi),MQ="SelectContentImpl",h3=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:g,collisionBoundary:m,collisionPadding:b,sticky:y,hideWhenDetached:v,avoidCollisions:x,...T}=e,k=Lo(vi,n),[R,O]=w.useState(null),[N,C]=w.useState(null),_=mt(t,ae=>O(ae)),[M,D]=w.useState(null),[I,U]=w.useState(null),$=Sp(n),[B,W]=w.useState(!1),K=w.useRef(!1);w.useEffect(()=>{if(R)return qk(R)},[R]),$k();const G=w.useCallback(ae=>{const[ce,...Re]=$().map(ne=>ne.ref.current),[ie]=Re.slice(-1),Te=document.activeElement;for(const ne of ae)if(ne===Te||(ne==null||ne.scrollIntoView({block:"nearest"}),ne===ce&&N&&(N.scrollTop=0),ne===ie&&N&&(N.scrollTop=N.scrollHeight),ne==null||ne.focus(),document.activeElement!==Te))return},[$,N]),H=w.useCallback(()=>G([M,R]),[G,M,R]);w.useEffect(()=>{B&&H()},[B,H]);const{onOpenChange:F,triggerPointerDownPosRef:Y}=k;w.useEffect(()=>{if(R){let ae={x:0,y:0};const ce=ie=>{var Te,ne;ae={x:Math.abs(Math.round(ie.pageX)-(((Te=Y.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((ne=Y.current)==null?void 0:ne.y)??0))}},Re=ie=>{ae.x<=10&&ae.y<=10?ie.preventDefault():R.contains(ie.target)||F(!1),document.removeEventListener("pointermove",ce),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",Re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",Re,{capture:!0})}}},[R,F,Y]),w.useEffect(()=>{const ae=()=>F(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[F]);const[L,V]=D3(ae=>{const ce=$().filter(Te=>!Te.disabled),Re=ce.find(Te=>Te.ref.current===document.activeElement),ie=L3(ce,ae,Re);ie&&setTimeout(()=>ie.ref.current.focus())}),j=w.useCallback((ae,ce,Re)=>{const ie=!K.current&&!Re;(k.value!==void 0&&k.value===ce||ie)&&(D(ae),ie&&(K.current=!0))},[k.value]),P=w.useCallback(()=>R==null?void 0:R.focus(),[R]),Z=w.useCallback((ae,ce,Re)=>{const ie=!K.current&&!Re;(k.value!==void 0&&k.value===ce||ie)&&U(ae)},[k.value]),Q=r==="popper"?B0:m3,oe=Q===B0?{side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:g,collisionBoundary:m,collisionPadding:b,sticky:y,hideWhenDetached:v,avoidCollisions:x}:{};return E.jsx(g3,{scope:n,content:R,viewport:N,onViewportChange:C,itemRefCallback:j,selectedItem:M,onItemLeave:P,itemTextRefCallback:Z,focusSelectedItem:H,selectedItemText:I,position:r,isPositioned:B,searchRef:L,children:E.jsx(rp,{as:_o,allowPinchZoom:!0,children:E.jsx(ep,{asChild:!0,trapped:k.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Ke(a,ae=>{var ce;(ce=k.trigger)==null||ce.focus({preventScroll:!0}),ae.preventDefault()}),children:E.jsx($c,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:E.jsx(Q,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:ae=>ae.preventDefault(),...T,...oe,onPlaced:()=>W(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:Ke(T.onKeyDown,ae=>{const ce=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!ce&&ae.key.length===1&&V(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let ie=$().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Te=ae.target,ne=ie.indexOf(Te);ie=ie.slice(ne+1)}setTimeout(()=>G(ie)),ae.preventDefault()}})})})})})})});h3.displayName=MQ;var PQ="SelectItemAlignedPosition",m3=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=Lo(vi,n),s=Mo(vi,n),[l,u]=w.useState(null),[d,p]=w.useState(null),g=mt(t,_=>p(_)),m=Sp(n),b=w.useRef(!1),y=w.useRef(!0),{viewport:v,selectedItem:x,selectedItemText:T,focusSelectedItem:k}=s,R=w.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&v&&x&&T){const _=o.trigger.getBoundingClientRect(),M=d.getBoundingClientRect(),D=o.valueNode.getBoundingClientRect(),I=T.getBoundingClientRect();if(o.dir!=="rtl"){const Te=I.left-M.left,ne=D.left-Te,xe=_.left-ne,Se=_.width+xe,be=Math.max(Se,M.width),J=window.innerWidth-Pr,pe=z0(ne,[Pr,Math.max(Pr,J-be)]);l.style.minWidth=Se+"px",l.style.left=pe+"px"}else{const Te=M.right-I.right,ne=window.innerWidth-D.right-Te,xe=window.innerWidth-_.right-ne,Se=_.width+xe,be=Math.max(Se,M.width),J=window.innerWidth-Pr,pe=z0(ne,[Pr,Math.max(Pr,J-be)]);l.style.minWidth=Se+"px",l.style.right=pe+"px"}const U=m(),$=window.innerHeight-Pr*2,B=v.scrollHeight,W=window.getComputedStyle(d),K=parseInt(W.borderTopWidth,10),G=parseInt(W.paddingTop,10),H=parseInt(W.borderBottomWidth,10),F=parseInt(W.paddingBottom,10),Y=K+G+B+F+H,L=Math.min(x.offsetHeight*5,Y),V=window.getComputedStyle(v),j=parseInt(V.paddingTop,10),P=parseInt(V.paddingBottom,10),Z=_.top+_.height/2-Pr,Q=$-Z,oe=x.offsetHeight/2,ae=x.offsetTop+oe,ce=K+G+ae,Re=Y-ce;if(ce<=Z){const Te=U.length>0&&x===U[U.length-1].ref.current;l.style.bottom="0px";const ne=d.clientHeight-v.offsetTop-v.offsetHeight,xe=Math.max(Q,oe+(Te?P:0)+ne+H),Se=ce+xe;l.style.height=Se+"px"}else{const Te=U.length>0&&x===U[0].ref.current;l.style.top="0px";const xe=Math.max(Z,K+v.offsetTop+(Te?j:0)+oe)+Re;l.style.height=xe+"px",v.scrollTop=ce-Z+v.offsetTop}l.style.margin=`${Pr}px 0`,l.style.minHeight=L+"px",l.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[m,o.trigger,o.valueNode,l,d,v,x,T,o.dir,r]);Rn(()=>R(),[R]);const[O,N]=w.useState();Rn(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const C=w.useCallback(_=>{_&&y.current===!0&&(R(),k==null||k(),y.current=!1)},[R,k]);return E.jsx(zQ,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:b,onScrollButtonChange:C,children:E.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:E.jsx(Je.div,{...a,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});m3.displayName=PQ;var FQ="SelectPopperPosition",B0=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Pr,...o}=e,s=Ep(n);return E.jsx(dT,{...s,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.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)"}})});B0.displayName=FQ;var[zQ,xT]=Ks(vi,{}),j0="SelectViewport",b3=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=Mo(j0,n),s=xT(j0,n),l=mt(t,o.onViewportChange),u=w.useRef(0);return E.jsxs(E.Fragment,{children:[E.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}),E.jsx(vp.Slot,{scope:n,children:E.jsx(Je.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ke(a.onScroll,d=>{const p=d.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:m}=s;if(m!=null&&m.current&&g){const b=Math.abs(u.current-p.scrollTop);if(b>0){const y=window.innerHeight-Pr*2,v=parseFloat(g.style.minHeight),x=parseFloat(g.style.height),T=Math.max(v,x);if(T0?O:0,g.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});b3.displayName=j0;var y3="SelectGroup",[BQ,jQ]=Ks(y3),v3=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=An();return E.jsx(BQ,{scope:n,id:a,children:E.jsx(Je.div,{role:"group","aria-labelledby":a,...r,ref:t})})});v3.displayName=y3;var S3="SelectLabel",E3=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=jQ(S3,n);return E.jsx(Je.div,{id:a.id,...r,ref:t})});E3.displayName=S3;var xf="SelectItem",[UQ,w3]=Ks(xf),x3=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...s}=e,l=Lo(xf,n),u=Mo(xf,n),d=l.value===r,[p,g]=w.useState(o??""),[m,b]=w.useState(!1),y=mt(t,k=>{var R;return(R=u.itemRefCallback)==null?void 0:R.call(u,k,r,a)}),v=An(),x=w.useRef("touch"),T=()=>{a||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A 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 E.jsx(UQ,{scope:n,value:r,disabled:a,textId:v,isSelected:d,onItemTextChange:w.useCallback(k=>{g(R=>R||((k==null?void 0:k.textContent)??"").trim())},[]),children:E.jsx(vp.ItemSlot,{scope:n,value:r,disabled:a,textValue:p,children:E.jsx(Je.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:y,onFocus:Ke(s.onFocus,()=>b(!0)),onBlur:Ke(s.onBlur,()=>b(!1)),onClick:Ke(s.onClick,()=>{x.current!=="mouse"&&T()}),onPointerUp:Ke(s.onPointerUp,()=>{x.current==="mouse"&&T()}),onPointerDown:Ke(s.onPointerDown,k=>{x.current=k.pointerType}),onPointerMove:Ke(s.onPointerMove,k=>{var R;x.current=k.pointerType,a?(R=u.onItemLeave)==null||R.call(u):x.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ke(s.onPointerLeave,k=>{var R;k.currentTarget===document.activeElement&&((R=u.onItemLeave)==null||R.call(u))}),onKeyDown:Ke(s.onKeyDown,k=>{var O;((O=u.searchRef)==null?void 0:O.current)!==""&&k.key===" "||(CQ.includes(k.key)&&T(),k.key===" "&&k.preventDefault())})})})})});x3.displayName=xf;var pc="SelectItemText",k3=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,s=Lo(pc,n),l=Mo(pc,n),u=w3(pc,n),d=IQ(pc,n),[p,g]=w.useState(null),m=mt(t,T=>g(T),u.onItemTextChange,T=>{var k;return(k=l.itemTextRefCallback)==null?void 0:k.call(l,T,u.value,u.disabled)}),b=p==null?void 0:p.textContent,y=w.useMemo(()=>E.jsx("option",{value:u.value,disabled:u.disabled,children:b},u.value),[u.disabled,u.value,b]),{onNativeOptionAdd:v,onNativeOptionRemove:x}=d;return Rn(()=>(v(y),()=>x(y)),[v,x,y]),E.jsxs(E.Fragment,{children:[E.jsx(Je.span,{id:u.textId,...o,ref:m}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Uc.createPortal(o.children,s.valueNode):null]})});k3.displayName=pc;var T3="SelectItemIndicator",A3=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return w3(T3,n).isSelected?E.jsx(Je.span,{"aria-hidden":!0,...r,ref:t}):null});A3.displayName=T3;var U0="SelectScrollUpButton",R3=w.forwardRef((e,t)=>{const n=Mo(U0,e.__scopeSelect),r=xT(U0,e.__scopeSelect),[a,o]=w.useState(!1),s=mt(t,r.onScrollButtonChange);return Rn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollTop>0;o(d)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?E.jsx(_3,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});R3.displayName=U0;var G0="SelectScrollDownButton",C3=w.forwardRef((e,t)=>{const n=Mo(G0,e.__scopeSelect),r=xT(G0,e.__scopeSelect),[a,o]=w.useState(!1),s=mt(t,r.onScrollButtonChange);return Rn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?E.jsx(_3,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});C3.displayName=G0;var _3=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=Mo("SelectScrollButton",n),s=w.useRef(null),l=Sp(n),u=w.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return w.useEffect(()=>()=>u(),[u]),Rn(()=>{var p;const d=l().find(g=>g.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[l]),E.jsx(Je.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ke(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ke(a.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ke(a.onPointerLeave,()=>{u()})})}),GQ="SelectSeparator",N3=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return E.jsx(Je.div,{"aria-hidden":!0,...r,ref:t})});N3.displayName=GQ;var H0="SelectArrow",HQ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Ep(n),o=Lo(H0,n),s=Mo(H0,n);return o.open&&s.position==="popper"?E.jsx(fT,{...a,...r,ref:t}):null});HQ.displayName=H0;function O3(e){return e===""||e===void 0}var I3=w.forwardRef((e,t)=>{const{value:n,...r}=e,a=w.useRef(null),o=mt(t,a),s=o3(n);return w.useEffect(()=>{const l=a.current,u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==n&&p){const g=new Event("change",{bubbles:!0});p.call(l,n),l.dispatchEvent(g)}},[s,n]),E.jsx(pT,{asChild:!0,children:E.jsx("select",{...r,ref:o,defaultValue:n})})});I3.displayName="BubbleSelect";function D3(e){const t=vn(e),n=w.useRef(""),r=w.useRef(0),a=w.useCallback(s=>{const l=n.current+s;t(l),function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[t]),o=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function L3(e,t,n){const a=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=$Q(e,Math.max(o,0));a.length===1&&(s=s.filter(d=>d!==n));const u=s.find(d=>d.textValue.toLowerCase().startsWith(a.toLowerCase()));return u!==n?u:void 0}function $Q(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var qQ=i3,M3=l3,VQ=u3,WQ=d3,YQ=f3,P3=p3,KQ=b3,XQ=v3,F3=E3,z3=x3,ZQ=k3,QQ=A3,B3=R3,j3=C3,U3=N3;const kf=qQ,pN=XQ,Tf=VQ,kc=w.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(M3,{ref:r,className:Me("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,E.jsx(WQ,{asChild:!0,children:E.jsx(vT,{className:"h-4 w-4 opacity-50"})})]}));kc.displayName=M3.displayName;const G3=w.forwardRef(({className:e,...t},n)=>E.jsx(B3,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx(FU,{className:"h-4 w-4"})}));G3.displayName=B3.displayName;const H3=w.forwardRef(({className:e,...t},n)=>E.jsx(j3,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:E.jsx(vT,{className:"h-4 w-4"})}));H3.displayName=j3.displayName;const Tc=w.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>E.jsx(YQ,{children:E.jsxs(P3,{ref:a,className:Me("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",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,...r,children:[E.jsx(G3,{}),E.jsx(KQ,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),E.jsx(H3,{})]})}));Tc.displayName=P3.displayName;const JQ=w.forwardRef(({className:e,...t},n)=>E.jsx(F3,{ref:n,className:Me("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));JQ.displayName=F3.displayName;const bn=w.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(z3,{ref:r,className:Me("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[E.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:E.jsx(QQ,{children:E.jsx(yT,{className:"h-4 w-4"})})}),E.jsx(ZQ,{children:t})]}));bn.displayName=z3.displayName;const eJ=w.forwardRef(({className:e,...t},n)=>E.jsx(U3,{ref:n,className:Me("bg-muted -mx-1 my-1 h-px",e),...t}));eJ.displayName=U3.displayName;function $3({className:e}){const[t,n]=w.useState(!1),{t:r}=Et(),a=Ie.use.language(),o=Ie.use.setLanguage(),s=Ie.use.theme(),l=Ie.use.setTheme(),u=w.useCallback(p=>{o(p)},[o]),d=w.useCallback(p=>{l(p)},[l]);return E.jsxs(mp,{open:t,onOpenChange:n,children:[E.jsx(bp,{asChild:!0,children:E.jsx(nt,{variant:"ghost",size:"icon",className:Me("h-9 w-9",e),children:E.jsx(PZ,{className:"h-5 w-5"})})}),E.jsx(Zc,{side:"bottom",align:"end",className:"w-56",children:E.jsxs("div",{className:"flex flex-col gap-4",children:[E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{className:"text-sm font-medium",children:r("settings.language")}),E.jsxs(kf,{value:a,onValueChange:u,children:[E.jsx(kc,{children:E.jsx(Tf,{})}),E.jsxs(Tc,{children:[E.jsx(bn,{value:"en",children:"English"}),E.jsx(bn,{value:"zh",children:"中文"}),E.jsx(bn,{value:"fr",children:"Français"}),E.jsx(bn,{value:"ar",children:"العربية"})]})]})]}),E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{className:"text-sm font-medium",children:r("settings.theme")}),E.jsxs(kf,{value:s,onValueChange:d,children:[E.jsx(kc,{children:E.jsx(Tf,{})}),E.jsxs(Tc,{children:[E.jsx(bn,{value:"light",children:r("settings.light")}),E.jsx(bn,{value:"dark",children:r("settings.dark")}),E.jsx(bn,{value:"system",children:r("settings.system")})]})]})]})]})})]})}var bm="rovingFocusGroup.onEntryFocus",tJ={bubbles:!1,cancelable:!0},wp="RovingFocusGroup",[$0,q3,nJ]=a3(wp),[rJ,V3]=$r(wp,[nJ]),[aJ,oJ]=rJ(wp),W3=w.forwardRef((e,t)=>E.jsx($0.Provider,{scope:e.__scopeRovingFocusGroup,children:E.jsx($0.Slot,{scope:e.__scopeRovingFocusGroup,children:E.jsx(iJ,{...e,ref:t})})}));W3.displayName=wp;var iJ=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...g}=e,m=w.useRef(null),b=mt(t,m),y=yp(o),[v=null,x]=ja({prop:s,defaultProp:l,onChange:u}),[T,k]=w.useState(!1),R=vn(d),O=q3(n),N=w.useRef(!1),[C,_]=w.useState(0);return w.useEffect(()=>{const M=m.current;if(M)return M.addEventListener(bm,R),()=>M.removeEventListener(bm,R)},[R]),E.jsx(aJ,{scope:n,orientation:r,dir:y,loop:a,currentTabStopId:v,onItemFocus:w.useCallback(M=>x(M),[x]),onItemShiftTab:w.useCallback(()=>k(!0),[]),onFocusableItemAdd:w.useCallback(()=>_(M=>M+1),[]),onFocusableItemRemove:w.useCallback(()=>_(M=>M-1),[]),children:E.jsx(Je.div,{tabIndex:T||C===0?-1:0,"data-orientation":r,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:Ke(e.onMouseDown,()=>{N.current=!0}),onFocus:Ke(e.onFocus,M=>{const D=!N.current;if(M.target===M.currentTarget&&D&&!T){const I=new CustomEvent(bm,tJ);if(M.currentTarget.dispatchEvent(I),!I.defaultPrevented){const U=O().filter(G=>G.focusable),$=U.find(G=>G.active),B=U.find(G=>G.id===v),K=[$,B,...U].filter(Boolean).map(G=>G.ref.current);X3(K,p)}}N.current=!1}),onBlur:Ke(e.onBlur,()=>k(!1))})})}),Y3="RovingFocusGroupItem",K3=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,...s}=e,l=An(),u=o||l,d=oJ(Y3,n),p=d.currentTabStopId===u,g=q3(n),{onFocusableItemAdd:m,onFocusableItemRemove:b}=d;return w.useEffect(()=>{if(r)return m(),()=>b()},[r,m,b]),E.jsx($0.ItemSlot,{scope:n,id:u,focusable:r,active:a,children:E.jsx(Je.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:Ke(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:Ke(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Ke(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=cJ(y,d.orientation,d.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let T=g().filter(k=>k.focusable).map(k=>k.ref.current);if(v==="last")T.reverse();else if(v==="prev"||v==="next"){v==="prev"&&T.reverse();const k=T.indexOf(y.currentTarget);T=d.loop?uJ(T,k+1):T.slice(k+1)}setTimeout(()=>X3(T))}})})})});K3.displayName=Y3;var sJ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lJ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cJ(e,t,n){const r=lJ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sJ[r]}function X3(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function uJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dJ=W3,fJ=K3,kT="Tabs",[pJ,b0e]=$r(kT,[V3]),Z3=V3(),[gJ,TT]=pJ(kT),Q3=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s="horizontal",dir:l,activationMode:u="automatic",...d}=e,p=yp(l),[g,m]=ja({prop:r,onChange:a,defaultProp:o});return E.jsx(gJ,{scope:n,baseId:An(),value:g,onValueChange:m,orientation:s,dir:p,activationMode:u,children:E.jsx(Je.div,{dir:p,"data-orientation":s,...d,ref:t})})});Q3.displayName=kT;var J3="TabsList",e4=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,o=TT(J3,n),s=Z3(n);return E.jsx(dJ,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:E.jsx(Je.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});e4.displayName=J3;var t4="TabsTrigger",n4=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,s=TT(t4,n),l=Z3(n),u=o4(s.baseId,r),d=i4(s.baseId,r),p=r===s.value;return E.jsx(fJ,{asChild:!0,...l,focusable:!a,active:p,children:E.jsx(Je.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:u,...o,ref:t,onMouseDown:Ke(e.onMouseDown,g=>{!a&&g.button===0&&g.ctrlKey===!1?s.onValueChange(r):g.preventDefault()}),onKeyDown:Ke(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&s.onValueChange(r)}),onFocus:Ke(e.onFocus,()=>{const g=s.activationMode!=="manual";!p&&!a&&g&&s.onValueChange(r)})})})});n4.displayName=t4;var r4="TabsContent",a4=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:o,...s}=e,l=TT(r4,n),u=o4(l.baseId,r),d=i4(l.baseId,r),p=r===l.value,g=w.useRef(p);return w.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),E.jsx(ir,{present:a||p,children:({present:m})=>E.jsx(Je.div,{"data-state":p?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:m&&o})})});a4.displayName=r4;function o4(e,t){return`${e}-trigger-${t}`}function i4(e,t){return`${e}-content-${t}`}var hJ=Q3,s4=e4,l4=n4,c4=a4;const mJ=hJ,u4=w.forwardRef(({className:e,...t},n)=>E.jsx(s4,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));u4.displayName=s4.displayName;const d4=w.forwardRef(({className:e,...t},n)=>E.jsx(l4,{ref:n,className:Me("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-sm px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm",e),...t}));d4.displayName=l4.displayName;const gc=w.forwardRef(({className:e,...t},n)=>E.jsx(c4,{ref:n,className:Me("ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none","data-[state=inactive]:invisible data-[state=active]:visible","h-full w-full",e),forceMount:!0,...t}));gc.displayName=c4.displayName;function Ad({value:e,currentTab:t,children:n}){return E.jsx(d4,{value:e,className:Me("cursor-pointer px-2 py-1 transition-all",t===e?"!bg-emerald-400 !text-zinc-50":"hover:bg-background/60"),children:n})}function bJ(){const e=Ie.use.currentTab(),{t}=Et();return E.jsx("div",{className:"flex h-8 self-center",children:E.jsxs(u4,{className:"h-full gap-2",children:[E.jsx(Ad,{value:"documents",currentTab:e,children:t("header.documents")}),E.jsx(Ad,{value:"knowledge-graph",currentTab:e,children:t("header.knowledgeGraph")}),E.jsx(Ad,{value:"retrieval",currentTab:e,children:t("header.retrieval")}),E.jsx(Ad,{value:"api",currentTab:e,children:t("header.api")})]})})}function yJ(){const{t:e}=Et(),{isGuestMode:t,coreVersion:n,apiVersion:r,username:a,webuiTitle:o,webuiDescription:s}=xr(),l=n&&r?`${n}/${r}`:null,u=()=>{Gk.navigateToLogin()};return E.jsxs("header",{className:"border-border/40 bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50 flex h-10 w-full border-b px-4 backdrop-blur",children:[E.jsxs("div",{className:"min-w-[200px] w-auto flex items-center",children:[E.jsxs("a",{href:YB,className:"flex items-center gap-2",children:[E.jsx(ST,{className:"size-4 text-emerald-400","aria-hidden":"true"}),E.jsx("span",{className:"font-bold md:inline-block",children:x0.name})]}),o&&E.jsxs("div",{className:"flex items-center",children:[E.jsx("span",{className:"mx-1 text-xs text-gray-500 dark:text-gray-400",children:"|"}),E.jsx(hT,{children:E.jsxs(mT,{children:[E.jsx(bT,{asChild:!0,children:E.jsx("span",{className:"font-medium text-sm cursor-default",children:o})}),s&&E.jsx(gp,{side:"bottom",children:s})]})})]})]}),E.jsxs("div",{className:"flex h-10 flex-1 items-center justify-center",children:[E.jsx(bJ,{}),t&&E.jsx("div",{className:"ml-2 self-center px-2 py-1 text-xs bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200 rounded-md",children:e("login.guestMode","Guest Mode")})]}),E.jsx("nav",{className:"w-[200px] flex items-center justify-end",children:E.jsxs("div",{className:"flex items-center gap-2",children:[l&&E.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400 mr-1",children:["v",l]}),E.jsx(nt,{variant:"ghost",size:"icon",side:"bottom",tooltip:e("header.projectRepository"),children:E.jsx("a",{href:x0.github,target:"_blank",rel:"noopener noreferrer",children:E.jsx(xZ,{className:"size-4","aria-hidden":"true"})})}),E.jsx($3,{}),!t&&E.jsx(nt,{variant:"ghost",size:"icon",side:"bottom",tooltip:`${e("header.logout")} (${a})`,onClick:u,children:E.jsx(NZ,{className:"size-4","aria-hidden":"true"})})]})})]})}var Rd={exports:{}},gN;function vJ(){if(gN)return Rd.exports;gN=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(N,C,_){return Function.prototype.apply.call(N,C,_)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:n=function(N){return Object.getOwnPropertyNames(N)};function r(O){console&&console.warn&&console.warn(O)}var a=Number.isNaN||function(N){return N!==N};function o(){o.init.call(this)}Rd.exports=o,Rd.exports.once=T,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(O){if(typeof O!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof O)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(O){if(typeof O!="number"||O<0||a(O))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+O+".");s=O}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||a(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function u(O){return O._maxListeners===void 0?o.defaultMaxListeners:O._maxListeners}o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(N){for(var C=[],_=1;_0&&(I=C[0]),I instanceof Error)throw I;var U=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw U.context=I,U}var $=D[N];if($===void 0)return!1;if(typeof $=="function")t($,this,C);else for(var B=$.length,W=y($,B),_=0;_0&&I.length>M&&!I.warned){I.warned=!0;var U=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");U.name="MaxListenersExceededWarning",U.emitter=O,U.type=N,U.count=I.length,r(U)}return O}o.prototype.addListener=function(N,C){return d(this,N,C,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(N,C){return d(this,N,C,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(O,N,C){var _={fired:!1,wrapFn:void 0,target:O,type:N,listener:C},M=p.bind(_);return M.listener=C,_.wrapFn=M,M}o.prototype.once=function(N,C){return l(C),this.on(N,g(this,N,C)),this},o.prototype.prependOnceListener=function(N,C){return l(C),this.prependListener(N,g(this,N,C)),this},o.prototype.removeListener=function(N,C){var _,M,D,I,U;if(l(C),M=this._events,M===void 0)return this;if(_=M[N],_===void 0)return this;if(_===C||_.listener===C)--this._eventsCount===0?this._events=Object.create(null):(delete M[N],M.removeListener&&this.emit("removeListener",N,_.listener||C));else if(typeof _!="function"){for(D=-1,I=_.length-1;I>=0;I--)if(_[I]===C||_[I].listener===C){U=_[I].listener,D=I;break}if(D<0)return this;D===0?_.shift():v(_,D),_.length===1&&(M[N]=_[0]),M.removeListener!==void 0&&this.emit("removeListener",N,U||C)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(N){var C,_,M;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[N]),this;if(arguments.length===0){var D=Object.keys(_),I;for(M=0;M=0;M--)this.removeListener(N,C[M]);return this};function m(O,N,C){var _=O._events;if(_===void 0)return[];var M=_[N];return M===void 0?[]:typeof M=="function"?C?[M.listener||M]:[M]:C?x(M):y(M,M.length)}o.prototype.listeners=function(N){return m(this,N,!0)},o.prototype.rawListeners=function(N){return m(this,N,!1)},o.listenerCount=function(O,N){return typeof O.listenerCount=="function"?O.listenerCount(N):b.call(O,N)},o.prototype.listenerCount=b;function b(O){var N=this._events;if(N!==void 0){var C=N[O];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function y(O,N){for(var C=new Array(N),_=0;_e++}function za(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Xs(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class AT extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class Pe extends AT{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Pe.prototype.constructor)}}class Le extends AT{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Le.prototype.constructor)}}class Ze extends AT{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ze.prototype.constructor)}}function g4(e,t){this.key=e,this.attributes=t,this.clear()}g4.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function h4(e,t){this.key=e,this.attributes=t,this.clear()}h4.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function m4(e,t){this.key=e,this.attributes=t,this.clear()}m4.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Zs(e,t,n,r,a){this.key=t,this.attributes=a,this.undirected=e,this.source=n,this.target=r}Zs.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};Zs.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const a=this.source[e],o=a[r];if(typeof o>"u"){a[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}o.previous=this,this.next=o,a[r]=this,this.target[t][n]=this};Zs.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};Zs.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const b4=0,y4=1,wJ=2,v4=3;function qa(e,t,n,r,a,o,s){let l,u,d,p;if(r=""+r,n===b4){if(l=e._nodes.get(r),!l)throw new Le(`Graph.${t}: could not find the "${r}" node in the graph.`);d=a,p=o}else if(n===v4){if(a=""+a,u=e._edges.get(a),!u)throw new Le(`Graph.${t}: could not find the "${a}" edge in the graph.`);const g=u.source.key,m=u.target.key;if(r===g)l=u.target;else if(r===m)l=u.source;else throw new Le(`Graph.${t}: the "${r}" node is not attached to the "${a}" edge (${g}, ${m}).`);d=o,p=s}else{if(u=e._edges.get(r),!u)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===y4?l=u.source:l=u.target,d=a,p=o}return[l,d,p]}function xJ(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);return s.attributes[l]}}function kJ(e,t,n){e.prototype[t]=function(r,a){const[o]=qa(this,t,n,r,a);return o.attributes}}function TJ(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);return s.attributes.hasOwnProperty(l)}}function AJ(e,t,n){e.prototype[t]=function(r,a,o,s){const[l,u,d]=qa(this,t,n,r,a,o,s);return l.attributes[u]=d,this.emit("nodeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:u}),this}}function RJ(e,t,n){e.prototype[t]=function(r,a,o,s){const[l,u,d]=qa(this,t,n,r,a,o,s);if(typeof d!="function")throw new Pe(`Graph.${t}: updater should be a function.`);const p=l.attributes,g=d(p[u]);return p[u]=g,this.emit("nodeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:u}),this}}function CJ(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);return delete s.attributes[l],this.emit("nodeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:l}),this}}function _J(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);if(!Sn(l))throw new Pe(`Graph.${t}: provided attributes are not a plain object.`);return s.attributes=l,this.emit("nodeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function NJ(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);if(!Sn(l))throw new Pe(`Graph.${t}: provided attributes are not a plain object.`);return nn(s.attributes,l),this.emit("nodeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:l}),this}}function OJ(e,t,n){e.prototype[t]=function(r,a,o){const[s,l]=qa(this,t,n,r,a,o);if(typeof l!="function")throw new Pe(`Graph.${t}: provided updater is not a function.`);return s.attributes=l(s.attributes),this.emit("nodeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const IJ=[{name:e=>`get${e}Attribute`,attacher:xJ},{name:e=>`get${e}Attributes`,attacher:kJ},{name:e=>`has${e}Attribute`,attacher:TJ},{name:e=>`set${e}Attribute`,attacher:AJ},{name:e=>`update${e}Attribute`,attacher:RJ},{name:e=>`remove${e}Attribute`,attacher:CJ},{name:e=>`replace${e}Attributes`,attacher:_J},{name:e=>`merge${e}Attributes`,attacher:NJ},{name:e=>`update${e}Attributes`,attacher:OJ}];function DJ(e){IJ.forEach(function({name:t,attacher:n}){n(e,t("Node"),b4),n(e,t("Source"),y4),n(e,t("Target"),wJ),n(e,t("Opposite"),v4)})}function LJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes[a]}}function MJ(e,t,n){e.prototype[t]=function(r){let a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,s=""+arguments[1];if(a=kr(this,o,s,n),!a)throw new Le(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return a.attributes}}function PJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes.hasOwnProperty(a)}}function FJ(e,t,n){e.prototype[t]=function(r,a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],o=arguments[3],s=kr(this,l,u,n),!s)throw new Le(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return s.attributes[a]=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:a}),this}}function zJ(e,t,n){e.prototype[t]=function(r,a,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+a;if(a=arguments[2],o=arguments[3],s=kr(this,l,u,n),!s)throw new Le(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof o!="function")throw new Pe(`Graph.${t}: updater should be a function.`);return s.attributes[a]=o(s.attributes[a]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:a}),this}}function BJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete o.attributes[a],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:a}),this}}function jJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!Sn(a))throw new Pe(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=a,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function UJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!Sn(a))throw new Pe(`Graph.${t}: provided attributes are not a plain object.`);return nn(o.attributes,a),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:a}),this}}function GJ(e,t,n){e.prototype[t]=function(r,a){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ze(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ze(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,l=""+a;if(a=arguments[2],o=kr(this,s,l,n),!o)throw new Le(`Graph.${t}: could not find an edge for the given path ("${s}" - "${l}").`)}else{if(n!=="mixed")throw new Ze(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new Le(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof a!="function")throw new Pe(`Graph.${t}: provided updater is not a function.`);return o.attributes=a(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const HJ=[{name:e=>`get${e}Attribute`,attacher:LJ},{name:e=>`get${e}Attributes`,attacher:MJ},{name:e=>`has${e}Attribute`,attacher:PJ},{name:e=>`set${e}Attribute`,attacher:FJ},{name:e=>`update${e}Attribute`,attacher:zJ},{name:e=>`remove${e}Attribute`,attacher:BJ},{name:e=>`replace${e}Attributes`,attacher:jJ},{name:e=>`merge${e}Attributes`,attacher:UJ},{name:e=>`update${e}Attributes`,attacher:GJ}];function $J(e){HJ.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const qJ=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function VJ(e,t,n,r){let a=!1;for(const o in t){if(o===r)continue;const s=t[o];if(a=n(s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected),e&&a)return s.key}}function WJ(e,t,n,r){let a,o,s,l=!1;for(const u in t)if(u!==r){a=t[u];do{if(o=a.source,s=a.target,l=n(a.key,a.attributes,o.key,s.key,o.attributes,s.attributes,a.undirected),e&&l)return a.key;a=a.next}while(a!==void 0)}}function ym(e,t){const n=Object.keys(e),r=n.length;let a,o=0;return{[Symbol.iterator](){return this},next(){do if(a)a=a.next;else{if(o>=r)return{done:!0};const s=n[o++];if(s===t){a=void 0;continue}a=e[s]}while(!a);return{done:!1,value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected}}}}}function YJ(e,t,n,r){const a=t[n];if(!a)return;const o=a.source,s=a.target;if(r(a.key,a.attributes,o.key,s.key,o.attributes,s.attributes,a.undirected)&&e)return a.key}function KJ(e,t,n,r){let a=t[n];if(!a)return;let o=!1;do{if(o=r(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),e&&o)return a.key;a=a.next}while(a!==void 0)}function vm(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const a={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:a}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function XJ(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),a=t==="undirected",o=e._edges.values();let s=0,l,u;for(;l=o.next(),l.done!==!0;)u=l.value,u.undirected===a&&(r[s++]=u.key);return r}function S4(e,t,n,r){if(t.size===0)return;const a=n!=="mixed"&&n!==t.type,o=n==="undirected";let s,l,u=!1;const d=t._edges.values();for(;s=d.next(),s.done!==!0;){if(l=s.value,a&&l.undirected!==o)continue;const{key:p,attributes:g,source:m,target:b}=l;if(u=r(p,g,m.key,b.key,m.attributes,b.attributes,l.undirected),e&&u)return p}}function ZJ(e,t){if(e.size===0)return Xs();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",a=e._edges.values();return{[Symbol.iterator](){return this},next(){let o,s;for(;;){if(o=a.next(),o.done)return o;if(s=o.value,!(n&&s.undirected!==r))break}return{value:{edge:s.key,attributes:s.attributes,source:s.source.key,target:s.target.key,sourceAttributes:s.source.attributes,targetAttributes:s.target.attributes,undirected:s.undirected},done:!1}}}}function RT(e,t,n,r,a,o){const s=t?WJ:VJ;let l;if(n!=="undirected"&&(r!=="out"&&(l=s(e,a.in,o),e&&l)||r!=="in"&&(l=s(e,a.out,o,r?void 0:a.key),e&&l))||n!=="directed"&&(l=s(e,a.undirected,o),e&&l))return l}function QJ(e,t,n,r){const a=[];return RT(!1,e,t,n,r,function(o){a.push(o)}),a}function JJ(e,t,n){let r=Xs();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=za(r,ym(n.in))),t!=="in"&&typeof n.out<"u"&&(r=za(r,ym(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=za(r,ym(n.undirected))),r}function CT(e,t,n,r,a,o,s){const l=n?KJ:YJ;let u;if(t!=="undirected"&&(typeof a.in<"u"&&r!=="out"&&(u=l(e,a.in,o,s),e&&u)||typeof a.out<"u"&&r!=="in"&&(r||a.key!==o)&&(u=l(e,a.out,o,s),e&&u))||t!=="directed"&&typeof a.undirected<"u"&&(u=l(e,a.undirected,o,s),e&&u))return u}function eee(e,t,n,r,a){const o=[];return CT(!1,e,t,n,r,a,function(s){o.push(s)}),o}function tee(e,t,n,r){let a=Xs();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(a=za(a,vm(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(a=za(a,vm(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(a=za(a,vm(n.undirected,r))),a}function nee(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(o,s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return XJ(this,r);if(arguments.length===1){o=""+o;const l=this._nodes.get(o);if(typeof l>"u")throw new Le(`Graph.${n}: could not find the "${o}" node in the graph.`);return QJ(this.multi,r==="mixed"?this.type:r,a,l)}if(arguments.length===2){o=""+o,s=""+s;const l=this._nodes.get(o);if(!l)throw new Le(`Graph.${n}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(s))throw new Le(`Graph.${n}: could not find the "${s}" target node in the graph.`);return eee(r,this.multi,a,l,s)}throw new Pe(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function ree(e,t){const{name:n,type:r,direction:a}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p,g){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return g=d,S4(!1,this,r,g);if(arguments.length===2){d=""+d,g=p;const m=this._nodes.get(d);if(typeof m>"u")throw new Le(`Graph.${o}: could not find the "${d}" node in the graph.`);return RT(!1,this.multi,r==="mixed"?this.type:r,a,m,g)}if(arguments.length===3){d=""+d,p=""+p;const m=this._nodes.get(d);if(!m)throw new Le(`Graph.${o}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(p))throw new Le(`Graph.${o}: could not find the "${p}" target node in the graph.`);return CT(!1,r,this.multi,a,m,p,g)}throw new Pe(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const s="map"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop();let g;if(d.length===0){let m=0;r!=="directed"&&(m+=this.undirectedSize),r!=="undirected"&&(m+=this.directedSize),g=new Array(m);let b=0;d.push((y,v,x,T,k,R,O)=>{g[b++]=p(y,v,x,T,k,R,O)})}else g=[],d.push((m,b,y,v,x,T,k)=>{g.push(p(m,b,y,v,x,T,k))});return this[o].apply(this,d),g};const l="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop(),g=[];return d.push((m,b,y,v,x,T,k)=>{p(m,b,y,v,x,T,k)&&g.push(m)}),this[o].apply(this,d),g};const u="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){let d=Array.prototype.slice.call(arguments);if(d.length<2||d.length>4)throw new Pe(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${d.length}).`);if(typeof d[d.length-1]=="function"&&typeof d[d.length-2]!="function")throw new Pe(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p,g;d.length===2?(p=d[0],g=d[1],d=[]):d.length===3?(p=d[1],g=d[2],d=[d[0]]):d.length===4&&(p=d[2],g=d[3],d=[d[0],d[1]]);let m=g;return d.push((b,y,v,x,T,k,R)=>{m=p(m,b,y,v,x,T,k,R)}),this[o].apply(this,d),m}}function aee(e,t){const{name:n,type:r,direction:a}=t,o="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(u,d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=u,S4(!0,this,r,p);if(arguments.length===2){u=""+u,p=d;const g=this._nodes.get(u);if(typeof g>"u")throw new Le(`Graph.${o}: could not find the "${u}" node in the graph.`);return RT(!0,this.multi,r==="mixed"?this.type:r,a,g,p)}if(arguments.length===3){u=""+u,d=""+d;const g=this._nodes.get(u);if(!g)throw new Le(`Graph.${o}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(d))throw new Le(`Graph.${o}: could not find the "${d}" target node in the graph.`);return CT(!0,r,this.multi,a,g,d,p)}throw new Pe(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const s="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){const u=Array.prototype.slice.call(arguments),d=u.pop();return u.push((g,m,b,y,v,x,T)=>d(g,m,b,y,v,x,T)),!!this[o].apply(this,u)};const l="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[l]=function(){const u=Array.prototype.slice.call(arguments),d=u.pop();return u.push((g,m,b,y,v,x,T)=>!d(g,m,b,y,v,x,T)),!this[o].apply(this,u)}}function oee(e,t){const{name:n,type:r,direction:a}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(s,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Xs();if(!arguments.length)return ZJ(this,r);if(arguments.length===1){s=""+s;const u=this._nodes.get(s);if(!u)throw new Le(`Graph.${o}: could not find the "${s}" node in the graph.`);return JJ(r,a,u)}if(arguments.length===2){s=""+s,l=""+l;const u=this._nodes.get(s);if(!u)throw new Le(`Graph.${o}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(l))throw new Le(`Graph.${o}: could not find the "${l}" target node in the graph.`);return tee(r,a,u,l)}throw new Pe(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function iee(e){qJ.forEach(t=>{nee(e,t),ree(e,t),aee(e,t),oee(e,t)})}const see=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function xp(){this.A=null,this.B=null}xp.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};xp.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function nc(e,t,n,r,a){for(const o in r){const s=r[o],l=s.source,u=s.target,d=l===n?u:l;if(t&&t.has(d.key))continue;const p=a(d.key,d.attributes);if(e&&p)return d.key}}function _T(e,t,n,r,a){if(t!=="mixed"){if(t==="undirected")return nc(e,null,r,r.undirected,a);if(typeof n=="string")return nc(e,null,r,r[n],a)}const o=new xp;let s;if(t!=="undirected"){if(n!=="out"){if(s=nc(e,null,r,r.in,a),e&&s)return s;o.wrap(r.in)}if(n!=="in"){if(s=nc(e,o,r,r.out,a),e&&s)return s;o.wrap(r.out)}}if(t!=="directed"&&(s=nc(e,o,r,r.undirected,a),e&&s))return s}function lee(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return _T(!1,e,t,n,function(a){r.push(a)}),r}function rc(e,t,n){const r=Object.keys(n),a=r.length;let o=0;return{[Symbol.iterator](){return this},next(){let s=null;do{if(o>=a)return e&&e.wrap(n),{done:!0};const l=n[r[o++]],u=l.source,d=l.target;if(s=u===t?d:u,e&&e.has(s.key)){s=null;continue}}while(s===null);return{done:!1,value:{neighbor:s.key,attributes:s.attributes}}}}}function cee(e,t,n){if(e!=="mixed"){if(e==="undirected")return rc(null,n,n.undirected);if(typeof t=="string")return rc(null,n,n[t])}let r=Xs();const a=new xp;return e!=="undirected"&&(t!=="out"&&(r=za(r,rc(a,n,n.in))),t!=="in"&&(r=za(r,rc(a,n,n.out)))),e!=="directed"&&(r=za(r,rc(a,n,n.undirected))),r}function uee(e,t){const{name:n,type:r,direction:a}=t;e.prototype[n]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new Le(`Graph.${n}: could not find the "${o}" node in the graph.`);return lee(r==="mixed"?this.type:r,a,s)}}function dee(e,t){const{name:n,type:r,direction:a}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const g=this._nodes.get(d);if(typeof g>"u")throw new Le(`Graph.${o}: could not find the "${d}" node in the graph.`);_T(!1,r==="mixed"?this.type:r,a,g,p)};const s="map"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(d,p){const g=[];return this[o](d,(m,b)=>{g.push(p(m,b))}),g};const l="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(d,p){const g=[];return this[o](d,(m,b)=>{p(m,b)&&g.push(m)}),g};const u="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(d,p,g){if(arguments.length<3)throw new Pe(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let m=g;return this[o](d,(b,y)=>{m=p(m,b,y)}),m}}function fee(e,t){const{name:n,type:r,direction:a}=t,o=n[0].toUpperCase()+n.slice(1,-1),s="find"+o;e.prototype[s]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const g=this._nodes.get(d);if(typeof g>"u")throw new Le(`Graph.${s}: could not find the "${d}" node in the graph.`);return _T(!0,r==="mixed"?this.type:r,a,g,p)};const l="some"+o;e.prototype[l]=function(d,p){return!!this[s](d,p)};const u="every"+o;e.prototype[u]=function(d,p){return!this[s](d,(m,b)=>!p(m,b))}}function pee(e,t){const{name:n,type:r,direction:a}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Xs();s=""+s;const l=this._nodes.get(s);if(typeof l>"u")throw new Le(`Graph.${o}: could not find the "${s}" node in the graph.`);return cee(r==="mixed"?this.type:r,a,l)}}function gee(e){see.forEach(t=>{uee(e,t),dee(e,t),fee(e,t),pee(e,t)})}function Cd(e,t,n,r,a){const o=r._nodes.values(),s=r.type;let l,u,d,p,g,m;for(;l=o.next(),l.done!==!0;){let b=!1;if(u=l.value,s!=="undirected"){p=u.out;for(d in p){g=p[d];do m=g.target,b=!0,a(u.key,m.key,u.attributes,m.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}if(s!=="directed"){p=u.undirected;for(d in p)if(!(t&&u.key>d)){g=p[d];do m=g.target,m.key!==d&&(m=g.source),b=!0,a(u.key,m.key,u.attributes,m.attributes,g.key,g.attributes,g.undirected),g=g.next;while(g)}}n&&!b&&a(u.key,null,u.attributes,null,null,null,null)}}function hee(e,t){const n={key:e};return p4(t.attributes)||(n.attributes=nn({},t.attributes)),n}function mee(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return p4(n.attributes)||(r.attributes=nn({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function bee(e){if(!Sn(e))throw new Pe('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in e))throw new Pe("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!Sn(e.attributes)||e.attributes===null))throw new Pe("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function yee(e){if(!Sn(e))throw new Pe('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in e))throw new Pe("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new Pe("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!Sn(e.attributes)||e.attributes===null))throw new Pe("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new Pe("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const vee=EJ(),See=new Set(["directed","undirected","mixed"]),mN=new Set(["domain","_events","_eventsCount","_maxListeners"]),Eee=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:"directed"},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:"directed"},{name:e=>`${e}UndirectedEdgeWithKey`,type:"undirected"}],wee={allowSelfLoops:!0,multi:!1,type:"mixed"};function xee(e,t,n){if(n&&!Sn(n))throw new Pe(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Ze(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function bN(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function E4(e,t,n,r,a,o,s,l){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(l&&!Sn(l))throw new Pe(`Graph.${t}: invalid attributes. Expecting an object but got "${l}"`);if(o=""+o,s=""+s,l=l||{},!e.allowSelfLoops&&o===s)throw new Ze(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const u=e._nodes.get(o),d=e._nodes.get(s);if(!u)throw new Le(`Graph.${t}: source node "${o}" not found.`);if(!d)throw new Le(`Graph.${t}: target node "${s}" not found.`);const p={key:null,undirected:r,source:o,target:s,attributes:l};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);if(!e.multi&&(r?typeof u.undirected[s]<"u":typeof u.out[s]<"u"))throw new Ze(`Graph.${t}: an edge linking "${o}" to "${s}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const g=new Zs(r,a,u,d,l);e._edges.set(a,g);const m=o===s;return r?(u.undirectedDegree++,d.undirectedDegree++,m&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,m&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?g.attachMulti():g.attach(),r?e._undirectedSize++:e._directedSize++,p.key=a,e.emit("edgeAdded",p),a}function kee(e,t,n,r,a,o,s,l,u){if(!r&&e.type==="undirected")throw new Ze(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Ze(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(l){if(u){if(typeof l!="function")throw new Pe(`Graph.${t}: invalid updater function. Expecting a function but got "${l}"`)}else if(!Sn(l))throw new Pe(`Graph.${t}: invalid attributes. Expecting an object but got "${l}"`)}o=""+o,s=""+s;let d;if(u&&(d=l,l=void 0),!e.allowSelfLoops&&o===s)throw new Ze(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(o),g=e._nodes.get(s),m,b;if(!n&&(m=e._edges.get(a),m)){if((m.source.key!==o||m.target.key!==s)&&(!r||m.source.key!==s||m.target.key!==o))throw new Ze(`Graph.${t}: inconsistency detected when attempting to merge the "${a}" edge with "${o}" source & "${s}" target vs. ("${m.source.key}", "${m.target.key}").`);b=m}if(!b&&!e.multi&&p&&(b=r?p.undirected[s]:p.out[s]),b){const k=[b.key,!1,!1,!1];if(u?!d:!l)return k;if(u){const R=b.attributes;b.attributes=d(R),e.emit("edgeAttributesUpdated",{type:"replace",key:b.key,attributes:b.attributes})}else nn(b.attributes,l),e.emit("edgeAttributesUpdated",{type:"merge",key:b.key,attributes:b.attributes,data:l});return k}l=l||{},u&&d&&(l=d(l));const y={key:null,undirected:r,source:o,target:s,attributes:l};if(n)a=e._edgeKeyGenerator();else if(a=""+a,e._edges.has(a))throw new Ze(`Graph.${t}: the "${a}" edge already exists in the graph.`);let v=!1,x=!1;p||(p=bN(e,o,{}),v=!0,o===s&&(g=p,x=!0)),g||(g=bN(e,s,{}),x=!0),m=new Zs(r,a,p,g,l),e._edges.set(a,m);const T=o===s;return r?(p.undirectedDegree++,g.undirectedDegree++,T&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,g.inDegree++,T&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?m.attachMulti():m.attach(),r?e._undirectedSize++:e._directedSize++,y.key=a,e.emit("edgeAdded",y),[a,!0,v,x]}function gs(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:a}=t,o=t.undirected,s=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,s&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,s&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),o?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:a,source:n.key,target:r.key,undirected:o})}class _t extends f4.EventEmitter{constructor(t){if(super(),t=nn({},wee,t),typeof t.multi!="boolean")throw new Pe(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!See.has(t.type))throw new Pe(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new Pe(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?g4:t.type==="directed"?h4:m4;Sr(this,"NodeDataClass",n);const r="geid_"+vee()+"_";let a=0;const o=()=>{let s;do s=r+a++;while(this._edges.has(s));return s};Sr(this,"_attributes",{}),Sr(this,"_nodes",new Map),Sr(this,"_edges",new Map),Sr(this,"_directedSize",0),Sr(this,"_undirectedSize",0),Sr(this,"_directedSelfLoopCount",0),Sr(this,"_undirectedSelfLoopCount",0),Sr(this,"_edgeKeyGenerator",o),Sr(this,"_options",t),mN.forEach(s=>Sr(this,s,this[s])),Mr(this,"order",()=>this._nodes.size),Mr(this,"size",()=>this._edges.size),Mr(this,"directedSize",()=>this._directedSize),Mr(this,"undirectedSize",()=>this._undirectedSize),Mr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Mr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Mr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Mr(this,"multi",this._options.multi),Mr(this,"type",this._options.type),Mr(this,"allowSelfLoops",this._options.allowSelfLoops),Mr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&!a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new Pe(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+t,a=this._edges.get(r);return!!a&&a.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new Pe(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){const r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new Pe(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(t,n){if(this.type==="undirected")return;if(t=""+t,n=""+n,this.multi)throw new Ze("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new Le(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Le(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||void 0;if(a)return a.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Ze("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new Le(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Le(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const a=r.undirected&&r.undirected[n]||void 0;if(a)return a.key}edge(t,n){if(this.multi)throw new Ze("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new Le(`Graph.edge: could not find the "${n}" target node in the graph.`);const a=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(a)return a.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new Le(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,a+=n.directedLoops),r-a}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,a+=n.directedLoops),r-a}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,a=0;return this.type!=="directed"&&(r+=n.undirectedDegree,a+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,a+=n.directedLoops*2),r-a}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const r=this._edges.get(n);if(!r)throw new Le(`Graph.opposite: could not find the "${n}" edge in the graph.`);const a=r.source.key,o=r.target.key;if(t===a)return o;if(t===o)return a;throw new Le(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${a}, ${o}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new Le(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new Le(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return xee(this,t,n).key}mergeNode(t,n){if(n&&!Sn(n))throw new Pe(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(nn(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new Pe(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const o=r.attributes;r.attributes=n(o),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const a=n?n({}):{};return r=new this.NodeDataClass(t,a),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:a}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new Le(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const a in n.out){r=n.out[a];do gs(this,r),r=r.next;while(r)}for(const a in n.in){r=n.in[a];do gs(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const a in n.undirected){r=n.undirected[a];do gs(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],a=""+arguments[1];if(n=kr(this,r,a,this.type),!n)throw new Le(`Graph.dropEdge: could not find the "${r}" -> "${a}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new Le(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return gs(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Ze("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Ze("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;const r=kr(this,t,n,"directed");if(!r)throw new Le(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return gs(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Ze("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Ze("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=kr(this,t,n,"undirected");if(!r)throw new Le(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return gs(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new Pe("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!Sn(t))throw new Pe("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(t){if(!Sn(t))throw new Pe("Graph.mergeAttributes: provided attributes are not a plain object.");return nn(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new Pe("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(t,n){if(typeof t!="function")throw new Pe("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!hN(n))throw new Pe("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let a,o;for(;a=r.next(),a.done!==!0;)o=a.value,o.attributes=t(o.key,o.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new Pe("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!hN(n))throw new Pe("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let a,o,s,l;for(;a=r.next(),a.done!==!0;)o=a.value,s=o.source,l=o.target,o.attributes=t(o.key,o.attributes,s.key,l.key,s.attributes,l.attributes,o.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new Pe("Graph.forEachAdjacencyEntry: expecting a callback.");Cd(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Pe("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Cd(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new Pe("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Cd(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Pe("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Cd(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new Pe("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)}findNode(t){if(typeof t!="function")throw new Pe("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return a.key}mapNodes(t){if(typeof t!="function")throw new Pe("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,a;const o=new Array(this.order);let s=0;for(;r=n.next(),r.done!==!0;)a=r.value,o[s++]=t(a.key,a.attributes);return o}someNode(t){if(typeof t!="function")throw new Pe("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,t(a.key,a.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new Pe("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,a;for(;r=n.next(),r.done!==!0;)if(a=r.value,!t(a.key,a.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new Pe("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,a;const o=[];for(;r=n.next(),r.done!==!0;)a=r.value,t(a.key,a.attributes)&&o.push(a.key);return o}reduceNodes(t,n){if(typeof t!="function")throw new Pe("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new Pe("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n;const a=this._nodes.values();let o,s;for(;o=a.next(),o.done!==!0;)s=o.value,r=t(r,s.key,s.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((a,o)=>{t[n++]=hee(o,a)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((a,o)=>{r[n++]=mee(this.type,o,a)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof _t)return t.forEachNode((u,d)=>{n?this.mergeNode(u,d):this.addNode(u,d)}),t.forEachEdge((u,d,p,g,m,b,y)=>{n?y?this.mergeUndirectedEdgeWithKey(u,p,g,d):this.mergeDirectedEdgeWithKey(u,p,g,d):y?this.addUndirectedEdgeWithKey(u,p,g,d):this.addDirectedEdgeWithKey(u,p,g,d)}),this;if(!Sn(t))throw new Pe("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!Sn(t.attributes))throw new Pe("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,a,o,s,l;if(t.nodes){if(o=t.nodes,!Array.isArray(o))throw new Pe("Graph.import: invalid nodes. Expecting an array.");for(r=0,a=o.length;r{const o=nn({},r.attributes);r=new n.NodeDataClass(a,o),n._nodes.set(a,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Ze(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${t.type}" because this would mean losing information about the current graph.`);if(typeof t.multi=="boolean"&&t.multi!==this.multi&&t.multi!==!0)throw new Ze("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof t.allowSelfLoops=="boolean"&&t.allowSelfLoops!==this.allowSelfLoops&&t.allowSelfLoops!==!0)throw new Ze("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(t),r=this._edges.values();let a,o;for(;a=r.next(),a.done!==!0;)o=a.value,E4(n,"copy",!1,o.undirected,o.key,o.source.key,o.target.key,nn({},o.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((o,s)=>{t[s]=o.attributes});const n={},r={};this._edges.forEach((o,s)=>{const l=o.undirected?"--":"->";let u="",d=o.source.key,p=o.target.key,g;o.undirected&&d>p&&(g=d,d=p,p=g);const m=`(${d})${l}(${p})`;s.startsWith("geid_")?this.multi&&(typeof r[m]>"u"?r[m]=0:r[m]++,u+=`${r[m]}. `):u+=`[${s}]: `,u+=m,n[u]=o.attributes});const a={};for(const o in this)this.hasOwnProperty(o)&&!mN.has(o)&&typeof this[o]!="function"&&typeof o!="symbol"&&(a[o]=this[o]);return a.attributes=this._attributes,a.nodes=t,a.edges=n,Sr(a,"constructor",this.constructor),a}}typeof Symbol<"u"&&(_t.prototype[Symbol.for("nodejs.util.inspect.custom")]=_t.prototype.inspect);Eee.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?E4:kee;e.generateKey?_t.prototype[n]=function(a,o,s){return r(this,n,!0,(e.type||this.type)==="undirected",null,a,o,s,t==="update")}:_t.prototype[n]=function(a,o,s,l){return r(this,n,!1,(e.type||this.type)==="undirected",a,o,s,l,t==="update")}})});DJ(_t);$J(_t);iee(_t);gee(_t);class w4 extends _t{constructor(t){const n=nn({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new Pe("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new Pe('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class Ac extends _t{constructor(t){const n=nn({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new Pe("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new Pe('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class x4 extends _t{constructor(t){const n=nn({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Pe("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class k4 extends _t{constructor(t){const n=nn({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Pe("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new Pe('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class T4 extends _t{constructor(t){const n=nn({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Pe("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new Pe('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function Qs(e){e.from=function(t,n){const r=nn({},t.options,n),a=new e(r);return a.import(t),a}}Qs(_t);Qs(w4);Qs(Ac);Qs(x4);Qs(k4);Qs(T4);_t.Graph=_t;_t.DirectedGraph=w4;_t.UndirectedGraph=Ac;_t.MultiGraph=x4;_t.MultiDirectedGraph=k4;_t.MultiUndirectedGraph=T4;_t.InvalidArgumentsGraphError=Pe;_t.NotFoundGraphError=Le;_t.UsageGraphError=Ze;function Tee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function hc(e){var t=Tee(e,"string");return typeof t=="symbol"?t:t+""}function dn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yN(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n>8&255,o=n>>16&255,s=n>>24&255;return[r,a,o,s]}var Em={};function O4(e){if(typeof Em[e]<"u")return Em[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,r=e&255,a=255,o=N4(t,n,r,a);return Em[e]=o,o}function vN(e,t,n,r){return n+(t<<8)+(e<<16)}function SN(e,t,n,r,a,o){var s=Math.floor(n/o*a),l=Math.floor(e.drawingBufferHeight/o-r/o*a),u=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(s,l,1,1,e.RGBA,e.UNSIGNED_BYTE,u);var d=Fs(u,4),p=d[0],g=d[1],m=d[2],b=d[3];return[p,g,m,b]}function _e(e,t,n){return(t=hc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ue(e){for(var t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Jm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Jm}var TO;function Gre(){return TO||(TO=1,Qm.exports=Ure()),Qm.exports}var Hre=Gre(),cc='[cmdk-group=""]',eb='[cmdk-group-items=""]',$re='[cmdk-group-heading=""]',zT='[cmdk-item=""]',AO=`${zT}:not([aria-disabled="true"])`,nk="cmdk-item-select",ui="data-value",qre=(e,t,n)=>jre(e,t,n),E5=w.createContext(void 0),au=()=>w.useContext(E5),w5=w.createContext(void 0),BT=()=>w.useContext(w5),x5=w.createContext(void 0),k5=w.forwardRef((e,t)=>{let n=Es(()=>{var j,P;return{search:"",value:(P=(j=e.value)!=null?j:e.defaultValue)!=null?P:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Es(()=>new Set),a=Es(()=>new Map),o=Es(()=>new Map),s=Es(()=>new Set),l=T5(e),{label:u,children:d,value:p,onValueChange:g,filter:m,shouldFilter:b,loop:y,disablePointerSelection:v=!1,vimBindings:x=!0,...T}=e,k=An(),R=An(),O=An(),N=w.useRef(null),C=nae();Si(()=>{if(p!==void 0){let j=p.trim();n.current.value=j,_.emit()}},[p]),Si(()=>{C(6,B)},[]);let _=w.useMemo(()=>({subscribe:j=>(s.current.add(j),()=>s.current.delete(j)),snapshot:()=>n.current,setState:(j,P,Z)=>{var Q,oe,ae;if(!Object.is(n.current[j],P)){if(n.current[j]=P,j==="search")$(),I(),C(1,U);else if(j==="value"&&(Z||C(5,B),((Q=l.current)==null?void 0:Q.value)!==void 0)){let ce=P??"";(ae=(oe=l.current).onValueChange)==null||ae.call(oe,ce);return}_.emit()}},emit:()=>{s.current.forEach(j=>j())}}),[]),M=w.useMemo(()=>({value:(j,P,Z)=>{var Q;P!==((Q=o.current.get(j))==null?void 0:Q.value)&&(o.current.set(j,{value:P,keywords:Z}),n.current.filtered.items.set(j,D(P,Z)),C(2,()=>{I(),_.emit()}))},item:(j,P)=>(r.current.add(j),P&&(a.current.has(P)?a.current.get(P).add(j):a.current.set(P,new Set([j]))),C(3,()=>{$(),I(),n.current.value||U(),_.emit()}),()=>{o.current.delete(j),r.current.delete(j),n.current.filtered.items.delete(j);let Z=W();C(4,()=>{$(),(Z==null?void 0:Z.getAttribute("id"))===j&&U(),_.emit()})}),group:j=>(a.current.has(j)||a.current.set(j,new Set),()=>{o.current.delete(j),a.current.delete(j)}),filter:()=>l.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:k,inputId:O,labelId:R,listInnerRef:N}),[]);function D(j,P){var Z,Q;let oe=(Q=(Z=l.current)==null?void 0:Z.filter)!=null?Q:qre;return j?oe(j,n.current.search,P):0}function I(){if(!n.current.search||l.current.shouldFilter===!1)return;let j=n.current.filtered.items,P=[];n.current.filtered.groups.forEach(Q=>{let oe=a.current.get(Q),ae=0;oe.forEach(ce=>{let Re=j.get(ce);ae=Math.max(Re,ae)}),P.push([Q,ae])});let Z=N.current;K().sort((Q,oe)=>{var ae,ce;let Re=Q.getAttribute("id"),ie=oe.getAttribute("id");return((ae=j.get(ie))!=null?ae:0)-((ce=j.get(Re))!=null?ce:0)}).forEach(Q=>{let oe=Q.closest(eb);oe?oe.appendChild(Q.parentElement===oe?Q:Q.closest(`${eb} > *`)):Z.appendChild(Q.parentElement===Z?Q:Q.closest(`${eb} > *`))}),P.sort((Q,oe)=>oe[1]-Q[1]).forEach(Q=>{var oe;let ae=(oe=N.current)==null?void 0:oe.querySelector(`${cc}[${ui}="${encodeURIComponent(Q[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function U(){let j=K().find(Z=>Z.getAttribute("aria-disabled")!=="true"),P=j==null?void 0:j.getAttribute(ui);_.setState("value",P||void 0)}function $(){var j,P,Z,Q;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let ae of r.current){let ce=(P=(j=o.current.get(ae))==null?void 0:j.value)!=null?P:"",Re=(Q=(Z=o.current.get(ae))==null?void 0:Z.keywords)!=null?Q:[],ie=D(ce,Re);n.current.filtered.items.set(ae,ie),ie>0&&oe++}for(let[ae,ce]of a.current)for(let Re of ce)if(n.current.filtered.items.get(Re)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=oe}function B(){var j,P,Z;let Q=W();Q&&(((j=Q.parentElement)==null?void 0:j.firstChild)===Q&&((Z=(P=Q.closest(cc))==null?void 0:P.querySelector($re))==null||Z.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function W(){var j;return(j=N.current)==null?void 0:j.querySelector(`${zT}[aria-selected="true"]`)}function K(){var j;return Array.from(((j=N.current)==null?void 0:j.querySelectorAll(AO))||[])}function G(j){let P=K()[j];P&&_.setState("value",P.getAttribute(ui))}function H(j){var P;let Z=W(),Q=K(),oe=Q.findIndex(ce=>ce===Z),ae=Q[oe+j];(P=l.current)!=null&&P.loop&&(ae=oe+j<0?Q[Q.length-1]:oe+j===Q.length?Q[0]:Q[oe+j]),ae&&_.setState("value",ae.getAttribute(ui))}function F(j){let P=W(),Z=P==null?void 0:P.closest(cc),Q;for(;Z&&!Q;)Z=j>0?eae(Z,cc):tae(Z,cc),Q=Z==null?void 0:Z.querySelector(AO);Q?_.setState("value",Q.getAttribute(ui)):H(j)}let Y=()=>G(K().length-1),L=j=>{j.preventDefault(),j.metaKey?Y():j.altKey?F(1):H(1)},V=j=>{j.preventDefault(),j.metaKey?G(0):j.altKey?F(-1):H(-1)};return w.createElement(Je.div,{ref:t,tabIndex:-1,...T,"cmdk-root":"",onKeyDown:j=>{var P;if((P=T.onKeyDown)==null||P.call(T,j),!j.defaultPrevented)switch(j.key){case"n":case"j":{x&&j.ctrlKey&&L(j);break}case"ArrowDown":{L(j);break}case"p":case"k":{x&&j.ctrlKey&&V(j);break}case"ArrowUp":{V(j);break}case"Home":{j.preventDefault(),G(0);break}case"End":{j.preventDefault(),Y();break}case"Enter":if(!j.nativeEvent.isComposing&&j.keyCode!==229){j.preventDefault();let Z=W();if(Z){let Q=new Event(nk);Z.dispatchEvent(Q)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:aae},u),Tp(e,j=>w.createElement(w5.Provider,{value:_},w.createElement(E5.Provider,{value:M},j))))}),Vre=w.forwardRef((e,t)=>{var n,r;let a=An(),o=w.useRef(null),s=w.useContext(x5),l=au(),u=T5(e),d=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Si(()=>{if(!d)return l.item(a,s==null?void 0:s.id)},[d]);let p=A5(a,o,[e.value,e.children,o],e.keywords),g=BT(),m=Ei(C=>C.value&&C.value===p.current),b=Ei(C=>d||l.filter()===!1?!0:C.search?C.filtered.items.get(a)>0:!0);w.useEffect(()=>{let C=o.current;if(!(!C||e.disabled))return C.addEventListener(nk,y),()=>C.removeEventListener(nk,y)},[b,e.onSelect,e.disabled]);function y(){var C,_;v(),(_=(C=u.current).onSelect)==null||_.call(C,p.current)}function v(){g.setState("value",p.current,!0)}if(!b)return null;let{disabled:x,value:T,onSelect:k,forceMount:R,keywords:O,...N}=e;return w.createElement(Je.div,{ref:Rc([o,t]),...N,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!m,"data-disabled":!!x,"data-selected":!!m,onPointerMove:x||l.getDisablePointerSelection()?void 0:v,onClick:x?void 0:y},e.children)}),Wre=w.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,s=An(),l=w.useRef(null),u=w.useRef(null),d=An(),p=au(),g=Ei(b=>a||p.filter()===!1?!0:b.search?b.filtered.groups.has(s):!0);Si(()=>p.group(s),[]),A5(s,l,[e.value,e.heading,u]);let m=w.useMemo(()=>({id:s,forceMount:a}),[a]);return w.createElement(Je.div,{ref:Rc([l,t]),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&w.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Tp(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},w.createElement(x5.Provider,{value:m},b))))}),Yre=w.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=w.useRef(null),o=Ei(s=>!s.search);return!n&&!o?null:w.createElement(Je.div,{ref:Rc([a,t]),...r,"cmdk-separator":"",role:"separator"})}),Kre=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=BT(),s=Ei(p=>p.search),l=Ei(p=>p.value),u=au(),d=w.useMemo(()=>{var p;let g=(p=u.listInnerRef.current)==null?void 0:p.querySelector(`${zT}[${ui}="${encodeURIComponent(l)}"]`);return g==null?void 0:g.getAttribute("id")},[]);return w.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),w.createElement(Je.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":d,id:u.inputId,type:"text",value:a?e.value:s,onChange:p=>{a||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),Xre=w.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,o=w.useRef(null),s=w.useRef(null),l=au();return w.useEffect(()=>{if(s.current&&o.current){let u=s.current,d=o.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return g.observe(u),()=>{cancelAnimationFrame(p),g.unobserve(u)}}},[]),w.createElement(Je.div,{ref:Rc([o,t]),...a,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},Tp(e,u=>w.createElement("div",{ref:Rc([s,l.listInnerRef]),"cmdk-list-sizer":""},u)))}),Zre=w.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:s,...l}=e;return w.createElement(Xk,{open:n,onOpenChange:r},w.createElement(Zk,{container:s},w.createElement(ap,{"cmdk-overlay":"",className:a}),w.createElement(op,{"aria-label":e.label,"cmdk-dialog":"",className:o},w.createElement(k5,{ref:t,...l}))))}),Qre=w.forwardRef((e,t)=>Ei(n=>n.filtered.count===0)?w.createElement(Je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Jre=w.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return w.createElement(Je.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Tp(e,s=>w.createElement("div",{"aria-hidden":!0},s)))}),qn=Object.assign(k5,{List:Xre,Item:Vre,Input:Kre,Group:Wre,Separator:Yre,Dialog:Zre,Empty:Qre,Loading:Jre});function eae(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function tae(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function T5(e){let t=w.useRef(e);return Si(()=>{t.current=e}),t}var Si=typeof window>"u"?w.useEffect:w.useLayoutEffect;function Es(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function Rc(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ei(e){let t=BT(),n=()=>e(t.snapshot());return Hre.useSyncExternalStore(t.subscribe,n,n)}function A5(e,t,n,r=[]){let a=w.useRef(),o=au();return Si(()=>{var s;let l=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():a.current}})(),u=r.map(d=>d.trim());o.value(e,l,u),(s=t.current)==null||s.setAttribute(ui,l),a.current=l}),a}var nae=()=>{let[e,t]=w.useState(),n=Es(()=>new Map);return Si(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function rae(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Tp({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(rae(t),{ref:t.ref},n(t.props.children)):n(t)}var aae={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ap=w.forwardRef(({className:e,...t},n)=>E.jsx(qn,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));Ap.displayName=qn.displayName;const jT=w.forwardRef(({className:e,...t},n)=>E.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[E.jsx(KZ,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),E.jsx(qn.Input,{ref:n,className:Me("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));jT.displayName=qn.Input.displayName;const Rp=w.forwardRef(({className:e,...t},n)=>E.jsx(qn.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));Rp.displayName=qn.List.displayName;const UT=w.forwardRef((e,t)=>E.jsx(qn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));UT.displayName=qn.Empty.displayName;const el=w.forwardRef(({className:e,...t},n)=>E.jsx(qn.Group,{ref:n,className:Me("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}));el.displayName=qn.Group.displayName;const oae=w.forwardRef(({className:e,...t},n)=>E.jsx(qn.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));oae.displayName=qn.Separator.displayName;const tl=w.forwardRef(({className:e,...t},n)=>E.jsx(qn.Item,{ref:n,className:Me("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));tl.displayName=qn.Item.displayName;const iae=({layout:e,autoRunFor:t,mainLayout:n})=>{const r=Ar(),[a,o]=w.useState(!1),s=w.useRef(null),{t:l}=Et(),u=w.useCallback(()=>{if(r)try{const p=r.getGraph();if(!p||p.order===0)return;const g=n.positions();q4(p,g,{duration:300})}catch(p){console.error("Error updating positions:",p),s.current&&(window.clearInterval(s.current),s.current=null,o(!1))}},[r,n]),d=w.useCallback(()=>{if(a){console.log("Stopping layout animation"),s.current&&(window.clearInterval(s.current),s.current=null);try{typeof e.kill=="function"?(e.kill(),console.log("Layout algorithm killed")):typeof e.stop=="function"&&(e.stop(),console.log("Layout algorithm stopped"))}catch(p){console.error("Error stopping layout algorithm:",p)}o(!1)}else console.log("Starting layout animation"),u(),s.current=window.setInterval(()=>{u()},200),o(!0),setTimeout(()=>{if(s.current){console.log("Auto-stopping layout animation after 3 seconds"),window.clearInterval(s.current),s.current=null,o(!1);try{typeof e.kill=="function"?e.kill():typeof e.stop=="function"&&e.stop()}catch(p){console.error("Error stopping layout algorithm:",p)}}},3e3)},[a,e,u]);return w.useEffect(()=>{if(!r){console.log("No sigma instance available");return}let p=null;return t!==void 0&&t>-1&&r.getGraph().order>0&&(console.log("Auto-starting layout animation"),u(),s.current=window.setInterval(()=>{u()},200),o(!0),t>0&&(p=window.setTimeout(()=>{console.log("Auto-stopping layout animation after timeout"),s.current&&(window.clearInterval(s.current),s.current=null),o(!1)},t))),()=>{s.current&&(window.clearInterval(s.current),s.current=null),p&&window.clearTimeout(p),o(!1)}},[t,r,u]),E.jsx(nt,{size:"icon",onClick:d,tooltip:l(a?"graphPanel.sideBar.layoutsControl.stopAnimation":"graphPanel.sideBar.layoutsControl.startAnimation"),variant:wr,children:a?E.jsx(zZ,{}):E.jsx(jZ,{})})},sae=()=>{const e=Ar(),{t}=Et(),[n,r]=w.useState("Circular"),[a,o]=w.useState(!1),s=Ie.use.graphLayoutMaxIterations(),l=ere(),u=Xne(),d=Ore(),p=Are({maxIterations:s,settings:{margin:5,expansion:1.1,gridSize:1,ratio:1,speed:3}}),g=sre({maxIterations:s,settings:{attraction:3e-4,repulsion:.02,gravity:.02,inertia:.4,maxMove:100}}),m=b5({iterations:s}),b=Rre(),y=lre(),v=bre(),x=w.useMemo(()=>({Circular:{layout:l},Circlepack:{layout:u},Random:{layout:d},Noverlaps:{layout:p,worker:b},"Force Directed":{layout:g,worker:y},"Force Atlas":{layout:m,worker:v}}),[u,l,g,m,p,d,y,b,v]),T=w.useCallback(k=>{console.debug("Running layout:",k);const{positions:R}=x[k].layout;try{const O=e.getGraph();if(!O){console.error("No graph available");return}const N=R();console.log("Positions calculated, animating nodes"),q4(O,N,{duration:400}),r(k)}catch(O){console.error("Error running layout:",O)}},[x,e]);return E.jsxs("div",{children:[E.jsx("div",{children:x[n]&&"worker"in x[n]&&E.jsx(iae,{layout:x[n].worker,mainLayout:x[n].layout})}),E.jsx("div",{children:E.jsxs(mp,{open:a,onOpenChange:o,children:[E.jsx(bp,{asChild:!0,children:E.jsx(nt,{size:"icon",variant:wr,onClick:()=>o(k=>!k),tooltip:t("graphPanel.sideBar.layoutsControl.layoutGraph"),children:E.jsx(TZ,{})})}),E.jsx(Zc,{side:"right",align:"start",sideOffset:8,collisionPadding:5,sticky:"always",className:"p-1 min-w-auto",children:E.jsx(Ap,{children:E.jsx(Rp,{children:E.jsx(el,{children:Object.keys(x).map(k=>E.jsx(tl,{onSelect:()=>{T(k)},className:"cursor-pointer text-xs",children:t(`graphPanel.sideBar.layoutsControl.layouts.${k}`)},k))})})})})]})})]})},R5=()=>{const e=w.useContext(nj);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Md=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),lae=({disableHoverEffect:e})=>{const t=Ar(),n=X4(),r=K4(),a=Ie.use.graphLayoutMaxIterations(),{assign:o}=b5({iterations:a}),{theme:s}=R5(),l=Ie.use.enableHideUnselectedEdges(),u=Ie.use.enableEdgeEvents(),d=Ie.use.showEdgeLabel(),p=Ie.use.showNodeLabel(),g=Ie.use.minEdgeSize(),m=Ie.use.maxEdgeSize(),b=Fe.use.selectedNode(),y=Fe.use.focusedNode(),v=Fe.use.selectedEdge(),x=Fe.use.focusedEdge(),T=Fe.use.sigmaGraph();return w.useEffect(()=>{if(T&&t){try{typeof t.setGraph=="function"?(t.setGraph(T),console.log("Binding graph to sigma instance")):(t.graph=T,console.warn("Simgma missing setGraph function, set graph property directly"))}catch(k){console.error("Error setting graph on sigma instance:",k)}o(),console.log("Initial layout applied to graph")}},[t,T,o,a]),w.useEffect(()=>{t&&(Fe.getState().sigmaInstance||(console.log("Setting sigma instance from GraphControl"),Fe.getState().setSigmaInstance(t)))},[t]),w.useEffect(()=>{const{setFocusedNode:k,setSelectedNode:R,setFocusedEdge:O,setSelectedEdge:N,clearSelection:C}=Fe.getState(),_={enterNode:M=>{Md(M.event.original)||k(M.node)},leaveNode:M=>{Md(M.event.original)||k(null)},clickNode:M=>{R(M.node),N(null)},clickStage:()=>C()};u&&(_.clickEdge=M=>{N(M.edge),R(null)},_.enterEdge=M=>{Md(M.event.original)||O(M.edge)},_.leaveEdge=M=>{Md(M.event.original)||O(null)}),n(_)},[n,u]),w.useEffect(()=>{if(t&&T){const k=t.getGraph();let R=Number.MAX_SAFE_INTEGER,O=0;k.forEachEdge(C=>{const _=k.getEdgeAttribute(C,"originalWeight")||1;typeof _=="number"&&(R=Math.min(R,_),O=Math.max(O,_))});const N=O-R;if(N>0){const C=m-g;k.forEachEdge(_=>{const M=k.getEdgeAttribute(_,"originalWeight")||1;if(typeof M=="number"){const D=g+C*Math.pow((M-R)/N,.5);k.setEdgeAttribute(_,"size",D)}})}else k.forEachEdge(C=>{k.setEdgeAttribute(C,"size",g)});t.refresh()}},[t,T,g,m]),w.useEffect(()=>{const k=s==="dark",R=k?cV:void 0,O=k?pV:void 0;r({enableEdgeEvents:u,renderEdgeLabels:d,renderLabels:p,nodeReducer:(N,C)=>{const _=t.getGraph(),M={...C,highlighted:C.highlighted||!1,labelColor:R};if(!e){M.highlighted=!1;const D=y||b,I=x||v;if(D&&_.hasNode(D))try{(N===D||_.neighbors(D).includes(N))&&(M.highlighted=!0,N===b&&(M.borderColor=fV))}catch(U){console.error("Error in nodeReducer:",U)}else if(I&&_.hasEdge(I))_.extremities(I).includes(N)&&(M.highlighted=!0,M.size=3);else return M;M.highlighted?k&&(M.labelColor=uV):M.color=dV}return M},edgeReducer:(N,C)=>{const _=t.getGraph(),M={...C,hidden:!1,labelColor:R,color:O};if(!e){const D=y||b;if(D&&_.hasNode(D))try{l?_.extremities(N).includes(D)||(M.hidden=!0):_.extremities(N).includes(D)&&(M.color=P_)}catch(I){console.error("Error in edgeReducer:",I)}else{const I=v&&_.hasEdge(v)?v:null,U=x&&_.hasEdge(x)?x:null;(I||U)&&(N===I?M.color=gV:N===U?M.color=P_:l&&(M.hidden=!0))}}return M}})},[b,y,v,x,r,t,e,s,l,u,d,p]),null},cae=()=>{const{zoomIn:e,zoomOut:t,reset:n}=Z4({duration:200,factor:1.5}),r=Ar(),{t:a}=Et(),o=w.useCallback(()=>e(),[e]),s=w.useCallback(()=>t(),[t]),l=w.useCallback(()=>{if(r)try{r.setCustomBBox(null),r.refresh();const p=r.getGraph();if(!(p!=null&&p.order)||p.nodes().length===0){n();return}r.getCamera().animate({x:.5,y:.5,ratio:1.1},{duration:1e3})}catch(p){console.error("Error resetting zoom:",p),n()}},[r,n]),u=w.useCallback(()=>{if(!r)return;const p=r.getCamera(),m=p.angle+Math.PI/8;p.animate({angle:m},{duration:200})},[r]),d=w.useCallback(()=>{if(!r)return;const p=r.getCamera(),m=p.angle-Math.PI/8;p.animate({angle:m},{duration:200})},[r]);return E.jsxs(E.Fragment,{children:[E.jsx(nt,{variant:wr,onClick:d,tooltip:a("graphPanel.sideBar.zoomControl.rotateCameraCounterClockwise"),size:"icon",children:E.jsx(HZ,{})}),E.jsx(nt,{variant:wr,onClick:u,tooltip:a("graphPanel.sideBar.zoomControl.rotateCamera"),size:"icon",children:E.jsx(qZ,{})}),E.jsx(nt,{variant:wr,onClick:l,tooltip:a("graphPanel.sideBar.zoomControl.resetZoom"),size:"icon",children:E.jsx(vZ,{})}),E.jsx(nt,{variant:wr,onClick:o,tooltip:a("graphPanel.sideBar.zoomControl.zoomIn"),size:"icon",children:E.jsx(sQ,{})}),E.jsx(nt,{variant:wr,onClick:s,tooltip:a("graphPanel.sideBar.zoomControl.zoomOut"),size:"icon",children:E.jsx(cQ,{})})]})},uae=()=>{const{isFullScreen:e,toggle:t}=Vte(),{t:n}=Et();return E.jsx(E.Fragment,{children:e?E.jsx(nt,{variant:wr,onClick:t,tooltip:n("graphPanel.sideBar.fullScreenControl.windowed"),size:"icon",children:E.jsx(LZ,{})}):E.jsx(nt,{variant:wr,onClick:t,tooltip:n("graphPanel.sideBar.fullScreenControl.fullScreen"),size:"icon",children:E.jsx(IZ,{})})})};var GT="Checkbox",[dae,y0e]=$r(GT),[fae,pae]=dae(GT),C5=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:s,disabled:l,value:u="on",onCheckedChange:d,form:p,...g}=e,[m,b]=w.useState(null),y=mt(t,O=>b(O)),v=w.useRef(!1),x=m?p||!!m.closest("form"):!0,[T=!1,k]=ja({prop:a,defaultProp:o,onChange:d}),R=w.useRef(T);return w.useEffect(()=>{const O=m==null?void 0:m.form;if(O){const N=()=>k(R.current);return O.addEventListener("reset",N),()=>O.removeEventListener("reset",N)}},[m,k]),E.jsxs(fae,{scope:n,state:T,disabled:l,children:[E.jsx(Je.button,{type:"button",role:"checkbox","aria-checked":Ro(T)?"mixed":T,"aria-required":s,"data-state":O5(T),"data-disabled":l?"":void 0,disabled:l,value:u,...g,ref:y,onKeyDown:Ke(e.onKeyDown,O=>{O.key==="Enter"&&O.preventDefault()}),onClick:Ke(e.onClick,O=>{k(N=>Ro(N)?!0:!N),x&&(v.current=O.isPropagationStopped(),v.current||O.stopPropagation())})}),x&&E.jsx(gae,{control:m,bubbles:!v.current,name:r,value:u,checked:T,required:s,disabled:l,form:p,style:{transform:"translateX(-100%)"},defaultChecked:Ro(o)?!1:o})]})});C5.displayName=GT;var _5="CheckboxIndicator",N5=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=pae(_5,n);return E.jsx(ir,{present:r||Ro(o.state)||o.state===!0,children:E.jsx(Je.span,{"data-state":O5(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});N5.displayName=_5;var gae=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:a,...o}=e,s=w.useRef(null),l=o3(n),u=pU(t);w.useEffect(()=>{const p=s.current,g=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(g,"checked").set;if(l!==n&&b){const y=new Event("click",{bubbles:r});p.indeterminate=Ro(n),b.call(p,Ro(n)?!1:n),p.dispatchEvent(y)}},[l,n,r]);const d=w.useRef(Ro(n)?!1:n);return E.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??d.current,...o,tabIndex:-1,ref:s,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ro(e){return e==="indeterminate"}function O5(e){return Ro(e)?"indeterminate":e?"checked":"unchecked"}var I5=C5,hae=N5;const Ns=w.forwardRef(({className:e,...t},n)=>E.jsx(I5,{ref:n,className:Me("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-muted data-[state=checked]:text-muted-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:E.jsx(hae,{className:Me("flex items-center justify-center text-current"),children:E.jsx(yT,{className:"h-4 w-4"})})}));Ns.displayName=I5.displayName;var mae="Separator",RO="horizontal",bae=["horizontal","vertical"],D5=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=RO,...a}=e,o=yae(r)?r:RO,l=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return E.jsx(Je.div,{"data-orientation":o,...l,...a,ref:t})});D5.displayName=mae;function yae(e){return bae.includes(e)}var L5=D5;const ws=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>E.jsx(L5,{ref:a,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ws.displayName=L5.displayName;const vo=({checked:e,onCheckedChange:t,label:n})=>{const r=`checkbox-${n.toLowerCase().replace(/\s+/g,"-")}`;return E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(Ns,{id:r,checked:e,onCheckedChange:t}),E.jsx("label",{htmlFor:r,className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]})},tb=({value:e,onEditFinished:t,label:n,min:r,max:a,defaultValue:o})=>{const{t:s}=Et(),[l,u]=w.useState(e),d=`input-${n.toLowerCase().replace(/\s+/g,"-")}`,p=w.useCallback(b=>{const y=b.target.value.trim();if(y.length===0){u(null);return}const v=Number.parseInt(y);if(!isNaN(v)&&v!==l){if(r!==void 0&&va)return;u(v)}},[l,r,a]),g=w.useCallback(()=>{l!==null&&e!==l&&t(l)},[e,l,t]),m=w.useCallback(()=>{o!==void 0&&e!==o&&(u(o),t(o))},[o,e,t]);return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{htmlFor:d,className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n}),E.jsxs("div",{className:"flex items-center gap-1",children:[E.jsx(Tr,{id:d,type:"number",value:l===null?"":l,onChange:p,className:"h-6 w-full min-w-0 pr-1",min:r,max:a,onBlur:g,onKeyDown:b=>{b.key==="Enter"&&g()}}),o!==void 0&&E.jsx(nt,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 hover:bg-muted text-muted-foreground hover:text-foreground",onClick:m,type:"button",title:s("graphPanel.sideBar.settings.resetToDefault"),children:E.jsx(GU,{className:"h-3.5 w-3.5"})})]})]})};function vae(){const[e,t]=w.useState(!1),n=Ie.use.showPropertyPanel(),r=Ie.use.showNodeSearchBar(),a=Ie.use.showNodeLabel(),o=Ie.use.enableEdgeEvents(),s=Ie.use.enableNodeDrag(),l=Ie.use.enableHideUnselectedEdges(),u=Ie.use.showEdgeLabel(),d=Ie.use.minEdgeSize(),p=Ie.use.maxEdgeSize(),g=Ie.use.graphQueryMaxDepth(),m=Ie.use.graphMaxNodes(),b=Ie.use.graphLayoutMaxIterations(),y=Ie.use.enableHealthCheck(),v=w.useCallback(()=>Ie.setState($=>({enableNodeDrag:!$.enableNodeDrag})),[]),x=w.useCallback(()=>Ie.setState($=>({enableEdgeEvents:!$.enableEdgeEvents})),[]),T=w.useCallback(()=>Ie.setState($=>({enableHideUnselectedEdges:!$.enableHideUnselectedEdges})),[]),k=w.useCallback(()=>Ie.setState($=>({showEdgeLabel:!$.showEdgeLabel})),[]),R=w.useCallback(()=>Ie.setState($=>({showPropertyPanel:!$.showPropertyPanel})),[]),O=w.useCallback(()=>Ie.setState($=>({showNodeSearchBar:!$.showNodeSearchBar})),[]),N=w.useCallback(()=>Ie.setState($=>({showNodeLabel:!$.showNodeLabel})),[]),C=w.useCallback(()=>Ie.setState($=>({enableHealthCheck:!$.enableHealthCheck})),[]),_=w.useCallback($=>{if($<1)return;Ie.setState({graphQueryMaxDepth:$});const B=Ie.getState().queryLabel;Ie.getState().setQueryLabel(""),setTimeout(()=>{Ie.getState().setQueryLabel(B)},300)},[]),M=w.useCallback($=>{if($<1||$>1e3)return;Ie.setState({graphMaxNodes:$});const B=Ie.getState().queryLabel;Ie.getState().setQueryLabel(""),setTimeout(()=>{Ie.getState().setQueryLabel(B)},300)},[]),D=w.useCallback($=>{$<1||Ie.setState({graphLayoutMaxIterations:$})},[]),{t:I}=Et(),U=()=>t(!1);return E.jsx(E.Fragment,{children:E.jsxs(mp,{open:e,onOpenChange:t,children:[E.jsx(bp,{asChild:!0,children:E.jsx(nt,{variant:wr,tooltip:I("graphPanel.sideBar.settings.settings"),size:"icon",children:E.jsx(JZ,{})})}),E.jsx(Zc,{side:"right",align:"end",sideOffset:8,collisionPadding:5,className:"p-2 max-w-[200px]",onCloseAutoFocus:$=>$.preventDefault(),children:E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx(vo,{checked:y,onCheckedChange:C,label:I("graphPanel.sideBar.settings.healthCheck")}),E.jsx(ws,{}),E.jsx(vo,{checked:n,onCheckedChange:R,label:I("graphPanel.sideBar.settings.showPropertyPanel")}),E.jsx(vo,{checked:r,onCheckedChange:O,label:I("graphPanel.sideBar.settings.showSearchBar")}),E.jsx(ws,{}),E.jsx(vo,{checked:a,onCheckedChange:N,label:I("graphPanel.sideBar.settings.showNodeLabel")}),E.jsx(vo,{checked:s,onCheckedChange:v,label:I("graphPanel.sideBar.settings.nodeDraggable")}),E.jsx(ws,{}),E.jsx(vo,{checked:u,onCheckedChange:k,label:I("graphPanel.sideBar.settings.showEdgeLabel")}),E.jsx(vo,{checked:l,onCheckedChange:T,label:I("graphPanel.sideBar.settings.hideUnselectedEdges")}),E.jsx(vo,{checked:o,onCheckedChange:x,label:I("graphPanel.sideBar.settings.edgeEvents")}),E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{htmlFor:"edge-size-min",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:I("graphPanel.sideBar.settings.edgeSizeRange")}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(Tr,{id:"edge-size-min",type:"number",value:d,onChange:$=>{const B=Number($.target.value);!isNaN(B)&&B>=1&&B<=p&&Ie.setState({minEdgeSize:B})},className:"h-6 w-16 min-w-0 pr-1",min:1,max:Math.min(p,10)}),E.jsx("span",{children:"-"}),E.jsxs("div",{className:"flex items-center gap-1",children:[E.jsx(Tr,{id:"edge-size-max",type:"number",value:p,onChange:$=>{const B=Number($.target.value);!isNaN(B)&&B>=d&&B>=1&&B<=10&&Ie.setState({maxEdgeSize:B})},className:"h-6 w-16 min-w-0 pr-1",min:d,max:10}),E.jsx(nt,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 hover:bg-muted text-muted-foreground hover:text-foreground",onClick:()=>Ie.setState({minEdgeSize:1,maxEdgeSize:5}),type:"button",title:I("graphPanel.sideBar.settings.resetToDefault"),children:E.jsx(GU,{className:"h-3.5 w-3.5"})})]})]})]}),E.jsx(ws,{}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxQueryDepth"),min:1,value:g,defaultValue:3,onEditFinished:_}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxNodes"),min:1,max:1e3,value:m,defaultValue:1e3,onEditFinished:M}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxLayoutIterations"),min:1,max:30,value:b,defaultValue:15,onEditFinished:D}),E.jsx(ws,{}),E.jsx(nt,{onClick:U,variant:"outline",size:"sm",className:"ml-auto px-4",children:I("graphPanel.sideBar.settings.save")})]})})]})})}const Sae="ENTRIES",M5="KEYS",P5="VALUES",bn="";class nb{constructor(t,n){const r=t._tree,a=Array.from(r.keys());this.set=t,this._type=n,this._path=a.length>0?[{node:r,keys:a}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=hs(this._path);if(hs(n)===bn)return{done:!1,value:this.result()};const r=t.get(hs(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=hs(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>hs(t)).filter(t=>t!==bn).join("")}value(){return hs(this._path).node.get(bn)}result(){switch(this._type){case P5:return this.value();case M5:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const hs=e=>e[e.length-1],Eae=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const a=t.length+1,o=a+n,s=new Uint8Array(o*a).fill(n+1);for(let l=0;l{const u=o*s;e:for(const d of e.keys())if(d===bn){const p=a[u-1];p<=n&&r.set(l,[e.get(d),p])}else{let p=o;for(let g=0;gn)continue e}F5(e.get(d),t,n,r,a,p,s,l+d)}};class To{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Nf(this._tree,t.slice(this._prefix.length));if(n===void 0){const[a,o]=HT(r);for(const s of a.keys())if(s!==bn&&s.startsWith(o)){const l=new Map;return l.set(s.slice(o.length),a.get(s)),new To(l,t)}}return new To(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,wae(this._tree,t)}entries(){return new nb(this,Sae)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return Eae(this._tree,t,n)}get(t){const n=rk(this._tree,t);return n!==void 0?n.get(bn):void 0}has(t){const n=rk(this._tree,t);return n!==void 0&&n.has(bn)}keys(){return new nb(this,M5)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,rb(this._tree,t).set(bn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rb(this._tree,t);return r.set(bn,n(r.get(bn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rb(this._tree,t);let a=r.get(bn);return a===void 0&&r.set(bn,a=n()),a}values(){return new nb(this,P5)}[Symbol.iterator](){return this.entries()}static from(t){const n=new To;for(const[r,a]of t)n.set(r,a);return n}static fromObject(t){return To.from(Object.entries(t))}}const Nf=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==bn&&t.startsWith(r))return n.push([e,r]),Nf(e.get(r),t.slice(r.length),n);return n.push([e,t]),Nf(void 0,"",n)},rk=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==bn&&t.startsWith(n))return rk(e.get(n),t.slice(n.length))},rb=(e,t)=>{const n=t.length;e:for(let r=0;e&&r{const[n,r]=Nf(e,t);if(n!==void 0){if(n.delete(bn),n.size===0)z5(r);else if(n.size===1){const[a,o]=n.entries().next().value;B5(r,a,o)}}},z5=e=>{if(e.length===0)return;const[t,n]=HT(e);if(t.delete(n),t.size===0)z5(e.slice(0,-1));else if(t.size===1){const[r,a]=t.entries().next().value;r!==bn&&B5(e.slice(0,-1),r,a)}},B5=(e,t,n)=>{if(e.length===0)return;const[r,a]=HT(e);r.set(a+t,n),r.delete(a)},HT=e=>e[e.length-1],$T="or",j5="and",xae="and_not";class Co{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?ib:t.autoVacuum;this._options={...ob,...t,autoVacuum:n,searchOptions:{...CO,...t.searchOptions||{}},autoSuggestOptions:{...Cae,...t.autoSuggestOptions||{}}},this._index=new To,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=ok,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:a,fields:o,idField:s}=this._options,l=n(t,s);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);if(this._idToShortId.has(l))throw new Error(`MiniSearch: duplicate ID ${l}`);const u=this.addDocumentId(l);this.saveStoredFields(u,t);for(const d of o){const p=n(t,d);if(p==null)continue;const g=r(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.addFieldLength(u,m,this._documentCount-1,b);for(const y of g){const v=a(y,d);if(Array.isArray(v))for(const x of v)this.addTerm(m,u,x);else v&&this.addTerm(m,u,v)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,a={chunk:[],promise:Promise.resolve()},{chunk:o,promise:s}=t.reduce(({chunk:l,promise:u},d,p)=>(l.push(d),(p+1)%r===0?{chunk:[],promise:u.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(l))}:{chunk:l,promise:u}),a);return s.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:a,fields:o,idField:s}=this._options,l=a(t,s);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);const u=this._idToShortId.get(l);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${l}: it is not in the index`);for(const d of o){const p=a(t,d);if(p==null)continue;const g=n(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.removeFieldLength(u,m,this._documentCount,b);for(const y of g){const v=r(y,d);if(Array.isArray(v))for(const x of v)this.removeTerm(m,u,x);else v&&this.removeTerm(m,u,v)}}this._storedFields.delete(u),this._documentIds.delete(u),this._idToShortId.delete(l),this._fieldLength.delete(u),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new To,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,a)=>{this.removeFieldLength(n,a,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:a}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:a},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,a=r(t,n);this.discard(a),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=ok,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const a=t.batchSize||ak.batchSize,o=t.batchWait||ak.batchWait;let s=1;for(const[l,u]of this._index){for(const[d,p]of u)for(const[g]of p)this._documentIds.has(g)||(p.size<=1?u.delete(d):p.delete(g));this._index.get(l).size===0&&this._index.delete(l),s%a===0&&await new Promise(d=>setTimeout(d,o)),s+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||ib.minDirtCount,r=r||ib.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,a={...r,...n},o=this.executeQuery(t,n),s=[];for(const[l,{score:u,terms:d,match:p}]of o){const g=d.length||1,m={id:this._documentIds.get(l),score:u*g,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(m,this._storedFields.get(l)),(a.filter==null||a.filter(m))&&s.push(m)}return t===Co.wildcard&&a.boostDocument==null||s.sort(NO),s}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:o,terms:s}of this.search(t,n)){const l=s.join(" "),u=r.get(l);u!=null?(u.score+=o,u.count+=1):r.set(l,{score:o,terms:s,count:1})}const a=[];for(const[o,{score:s,terms:l,count:u}]of r)a.push({suggestion:o,terms:l,score:s/u});return a.sort(NO),a}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)}static getDefault(t){if(ob.hasOwnProperty(t))return ab(ob,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:a,fieldLength:o,storedFields:s,serializationVersion:l}=t,u=this.instantiateMiniSearch(t,n);u._documentIds=Pd(a),u._fieldLength=Pd(o),u._storedFields=Pd(s);for(const[d,p]of u._documentIds)u._idToShortId.set(p,d);for(const[d,p]of r){const g=new Map;for(const m of Object.keys(p)){let b=p[m];l===1&&(b=b.ds),g.set(parseInt(m,10),Pd(b))}u._index.set(d,g)}return u}static async loadJSAsync(t,n){const{index:r,documentIds:a,fieldLength:o,storedFields:s,serializationVersion:l}=t,u=this.instantiateMiniSearch(t,n);u._documentIds=await Fd(a),u._fieldLength=await Fd(o),u._storedFields=await Fd(s);for(const[p,g]of u._documentIds)u._idToShortId.set(g,p);let d=0;for(const[p,g]of r){const m=new Map;for(const b of Object.keys(g)){let y=g[b];l===1&&(y=y.ds),m.set(parseInt(b,10),await Fd(y))}++d%1e3===0&&await U5(0),u._index.set(p,m)}return u}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:a,fieldIds:o,averageFieldLength:s,dirtCount:l,serializationVersion:u}=t;if(u!==1&&u!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new Co(n);return d._documentCount=r,d._nextId=a,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=s,d._dirtCount=l||0,d._index=new To,d}executeQuery(t,n={}){if(t===Co.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const m={...n,...t,queries:void 0},b=t.queries.map(y=>this.executeQuery(y,m));return this.combineResults(b,m.combineWith)}const{tokenize:r,processTerm:a,searchOptions:o}=this._options,s={tokenize:r,processTerm:a,...o,...n},{tokenize:l,processTerm:u}=s,g=l(t).flatMap(m=>u(m)).filter(m=>!!m).map(Rae(s)).map(m=>this.executeQuerySpec(m,s));return this.combineResults(g,s.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},a=(r.fields||this._options.fields).reduce((v,x)=>({...v,[x]:ab(r.boost,x)||1}),{}),{boostDocument:o,weights:s,maxFuzzy:l,bm25:u}=r,{fuzzy:d,prefix:p}={...CO.weights,...s},g=this._index.get(t.term),m=this.termResults(t.term,t.term,1,t.termBoost,g,a,o,u);let b,y;if(t.prefix&&(b=this._index.atPrefix(t.term)),t.fuzzy){const v=t.fuzzy===!0?.2:t.fuzzy,x=v<1?Math.min(l,Math.round(t.term.length*v)):v;x&&(y=this._index.fuzzyGet(t.term,x))}if(b)for(const[v,x]of b){const T=v.length-t.term.length;if(!T)continue;y==null||y.delete(v);const k=p*v.length/(v.length+.3*T);this.termResults(t.term,v,k,t.termBoost,x,a,o,u,m)}if(y)for(const v of y.keys()){const[x,T]=y.get(v);if(!T)continue;const k=d*v.length/(v.length+T);this.termResults(t.term,v,k,t.termBoost,x,a,o,u,m)}return m}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[a,o]of this._documentIds){const s=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(a)):1;n.set(a,{score:s,terms:[],match:{}})}return n}combineResults(t,n=$T){if(t.length===0)return new Map;const r=n.toLowerCase(),a=kae[r];if(!a)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(a)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const a={};for(const[o,s]of r)a[o]=Object.fromEntries(s);t.push([n,a])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,a,o,s,l,u,d=new Map){if(o==null)return d;for(const p of Object.keys(s)){const g=s[p],m=this._fieldIds[p],b=o.get(m);if(b==null)continue;let y=b.size;const v=this._avgFieldLength[m];for(const x of b.keys()){if(!this._documentIds.has(x)){this.removeTerm(m,x,n),y-=1;continue}const T=l?l(this._documentIds.get(x),n,this._storedFields.get(x)):1;if(!T)continue;const k=b.get(x),R=this._fieldLength.get(x)[m],O=Aae(k,y,this._documentCount,R,v,u),N=r*a*g*T*O,C=d.get(x);if(C){C.score+=N,_ae(C.terms,t);const _=ab(C.match,n);_?_.push(p):C.match[n]=[p]}else d.set(x,{score:N,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const a=this._index.fetch(r,OO);let o=a.get(t);if(o==null)o=new Map,o.set(n,1),a.set(t,o);else{const s=o.get(n);o.set(n,(s||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const a=this._index.fetch(r,OO),o=a.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?a.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const a of Object.keys(this._fieldIds))if(this._fieldIds[a]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${a}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,kae={[$T]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:a,terms:o,match:s}=t.get(n);r.score=r.score+a,r.match=Object.assign(r.match,s),_O(r.terms,o)}}return e},[j5]:(e,t)=>{const n=new Map;for(const r of t.keys()){const a=e.get(r);if(a==null)continue;const{score:o,terms:s,match:l}=t.get(r);_O(a.terms,s),n.set(r,{score:a.score+o,terms:a.terms,match:Object.assign(a.match,l)})}return n},[xae]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},Tae={k:1.2,b:.7,d:.5},Aae=(e,t,n,r,a,o)=>{const{k:s,b:l,d:u}=o;return Math.log(1+(n-t+.5)/(t+.5))*(u+e*(s+1)/(e+s*(1-l+l*r/a)))},Rae=e=>(t,n,r)=>{const a=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,s=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:a,prefix:o,termBoost:s}},ob={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(Nae),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},CO={combineWith:$T,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Tae},Cae={combineWith:j5,prefix:(e,t,n)=>t===n.length-1},ak={batchSize:1e3,batchWait:10},ok={minDirtFactor:.1,minDirtCount:20},ib={...ak,...ok},_ae=(e,t)=>{e.includes(t)||e.push(t)},_O=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},NO=({score:e},{score:t})=>t-e,OO=()=>new Map,Pd=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Fd=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await U5(0);return t},U5=e=>new Promise(t=>setTimeout(t,e)),Nae=/[\n\r\p{Z}\p{P}]+/u,Oae={index:new Co({fields:[]})};w.createContext(Oae);const ik=({label:e,color:t,hidden:n,labels:r={}})=>we.createElement("div",{className:"node"},we.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),we.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),Iae=({id:e,labels:t})=>{const n=Ar(),r=w.useMemo(()=>{const a=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},a),o?o(e,a):{})},[n,e]);return we.createElement(ik,Object.assign({},r,{labels:t}))},Dae=({label:e,color:t,source:n,target:r,hidden:a,directed:o,labels:s={}})=>we.createElement("div",{className:"edge"},we.createElement(ik,Object.assign({},n,{labels:s})),we.createElement("div",{className:"body"},we.createElement("div",{className:"render"},we.createElement("span",{className:a?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&we.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),we.createElement("span",{className:`label ${a?"text-muted":""} ${e?"":"fst-italic"}`},e||s.no_label||"No label")),we.createElement(ik,Object.assign({},r,{labels:s}))),Lae=({id:e,labels:t})=>{const n=Ar(),r=w.useMemo(()=>{const a=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),s=n.getSetting("edgeReducer"),l=n.getGraph().getNodeAttributes(n.getGraph().source(e)),u=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},a),s?s(e,a):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},l),o?o(e,l):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{})})},[n,e]);return we.createElement(Dae,Object.assign({},r,{labels:t}))};function qT(e,t){const[n,r]=w.useState(e);return w.useEffect(()=>{const a=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(a)}},[e,t]),n}function Mae({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,notFound:o,loadingSkeleton:s,label:l,placeholder:u="Select...",value:d,onChange:p,onFocus:g,disabled:m=!1,className:b,noResultsMessage:y}){const[v,x]=w.useState(!1),[T,k]=w.useState(!1),[R,O]=w.useState([]),[N,C]=w.useState(!1),[_,M]=w.useState(null),[D,I]=w.useState(""),U=qT(D,t?0:150),$=w.useRef(null);w.useEffect(()=>{x(!0)},[]),w.useEffect(()=>{const H=F=>{$.current&&!$.current.contains(F.target)&&T&&k(!1)};return document.addEventListener("mousedown",H),()=>{document.removeEventListener("mousedown",H)}},[T]);const B=w.useCallback(async H=>{try{C(!0),M(null);const F=await e(H);O(F)}catch(F){M(F instanceof Error?F.message:"Failed to fetch options")}finally{C(!1)}},[e]);w.useEffect(()=>{v&&(t?U&&O(H=>H.filter(F=>n?n(F,U):!0)):B(U))},[v,U,t,n,B]),w.useEffect(()=>{!v||!d||B(d)},[v,d,B]);const W=w.useCallback(H=>{p(H),requestAnimationFrame(()=>{const F=document.activeElement;F==null||F.blur(),k(!1)})},[p]),K=w.useCallback(()=>{k(!0),B(D)},[D,B]),G=w.useCallback(H=>{H.target.closest(".cmd-item")&&H.preventDefault()},[]);return E.jsx("div",{ref:$,className:Me(m&&"cursor-not-allowed opacity-50",b),onMouseDown:G,children:E.jsxs(Ap,{shouldFilter:!1,className:"bg-transparent",children:[E.jsxs("div",{children:[E.jsx(jT,{placeholder:u,value:D,className:"max-h-8",onFocus:K,onValueChange:H=>{I(H),T||k(!0)}}),N&&E.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:E.jsx(jU,{className:"h-4 w-4 animate-spin"})})]}),E.jsxs(Rp,{hidden:!T,children:[_&&E.jsx("div",{className:"text-destructive p-4 text-center",children:_}),N&&R.length===0&&(s||E.jsx(Pae,{})),!N&&!_&&R.length===0&&(o||E.jsx(UT,{children:y??`No ${l.toLowerCase()} found.`})),E.jsx(el,{children:R.map((H,F)=>E.jsxs(we.Fragment,{children:[E.jsx(tl,{value:a(H),onSelect:W,onMouseMove:()=>g(a(H)),className:"truncate cmd-item",children:r(H)},a(H)+`${F}`),F!==R.length-1&&E.jsx("div",{className:"bg-foreground/10 h-[1px]"},`divider-${F}`)]},a(H)+`-fragment-${F}`))})]})]})})}function Pae(){return E.jsx(el,{children:E.jsx(tl,{disabled:!0,children:E.jsxs("div",{className:"flex w-full items-center gap-2",children:[E.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),E.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[E.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),E.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const sb="__message_item",Fae=({id:e})=>{const t=Fe.use.sigmaGraph();return t!=null&&t.hasNode(e)?E.jsx(Iae,{id:e}):null};function zae(e){return E.jsxs("div",{children:[e.type==="nodes"&&E.jsx(Fae,{id:e.id}),e.type==="edges"&&E.jsx(Lae,{id:e.id}),e.type==="message"&&E.jsx("div",{children:e.message})]})}const Bae=({onChange:e,onFocus:t,value:n})=>{const{t:r}=Et(),a=Fe.use.sigmaGraph(),o=Fe.use.searchEngine();w.useEffect(()=>{a&&Fe.getState().resetSearchEngine()},[a]),w.useEffect(()=>{if(!a||a.nodes().length===0||o)return;const l=new Co({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=a.nodes().map(d=>({id:d,label:a.getNodeAttribute(d,"label")}));l.addAll(u),Fe.getState().setSearchEngine(l)},[a,o]);const s=w.useCallback(async l=>{if(t&&t(null),!a||!o)return[];if(a.nodes().length===0)return[];if(!l)return a.nodes().filter(p=>a.hasNode(p)).slice(0,yd).map(p=>({id:p,type:"nodes"}));let u=o.search(l).filter(d=>a.hasNode(d.id)).map(d=>({id:d.id,type:"nodes"}));if(u.length<5){const d=new Set(u.map(g=>g.id)),p=a.nodes().filter(g=>{if(d.has(g))return!1;const m=a.getNodeAttribute(g,"label");return m&&typeof m=="string"&&!m.toLowerCase().startsWith(l.toLowerCase())&&m.toLowerCase().includes(l.toLowerCase())}).map(g=>({id:g,type:"nodes"}));u=[...u,...p]}return u.length<=yd?u:[...u.slice(0,yd),{type:"message",id:sb,message:r("graphPanel.search.message",{count:u.length-yd})}]},[a,o,t,r]);return E.jsx(Mae,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:s,renderOption:zae,getOptionValue:l=>l.id,value:n&&n.type!=="message"?n.id:null,onChange:l=>{l!==sb&&e(l?{id:l,type:"nodes"}:null)},onFocus:l=>{l!==sb&&t&&t(l?{id:l,type:"nodes"}:null)},label:"item",placeholder:r("graphPanel.search.placeholder")})},jae=({...e})=>E.jsx(Bae,{...e});function Uae({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,getDisplayValue:o,notFound:s,loadingSkeleton:l,label:u,placeholder:d="Select...",value:p,onChange:g,disabled:m=!1,className:b,triggerClassName:y,searchInputClassName:v,noResultsMessage:x,triggerTooltip:T,clearable:k=!0}){const[R,O]=w.useState(!1),[N,C]=w.useState(!1),[_,M]=w.useState([]),[D,I]=w.useState(!1),[U,$]=w.useState(null),[B,W]=w.useState(p),[K,G]=w.useState(null),[H,F]=w.useState(""),Y=qT(H,t?0:150),[L,V]=w.useState([]),[j,P]=w.useState(null);w.useEffect(()=>{O(!0),W(p)},[p]),w.useEffect(()=>{p&&(!_.length||!K)?P(E.jsx("div",{children:p})):K&&P(null)},[p,_.length,K]),w.useEffect(()=>{if(p&&_.length>0){const Q=_.find(oe=>a(oe)===p);Q&&G(Q)}},[p,_,a]),w.useEffect(()=>{R||(async()=>{try{I(!0),$(null);const oe=await e(p);V(oe),M(oe)}catch(oe){$(oe instanceof Error?oe.message:"Failed to fetch options")}finally{I(!1)}})()},[R,e,p]),w.useEffect(()=>{const Q=async()=>{try{I(!0),$(null);const oe=await e(Y);V(oe),M(oe)}catch(oe){$(oe instanceof Error?oe.message:"Failed to fetch options")}finally{I(!1)}};R&&t?t&&M(Y?L.filter(oe=>n?n(oe,Y):!0):L):Q()},[e,Y,R,t,n]);const Z=w.useCallback(Q=>{const oe=k&&Q===B?"":Q;W(oe),G(_.find(ae=>a(ae)===oe)||null),g(oe),C(!1)},[B,g,k,_,a]);return E.jsxs(mp,{open:N,onOpenChange:C,children:[E.jsx(bp,{asChild:!0,children:E.jsxs(nt,{variant:"outline",role:"combobox","aria-expanded":N,className:Me("justify-between",m&&"cursor-not-allowed opacity-50",y),disabled:m,tooltip:T,side:"bottom",children:[p==="*"?E.jsx("div",{children:"*"}):K?o(K):j||d,E.jsx(cZ,{className:"opacity-50",size:10})]})}),E.jsx(Zc,{className:Me("p-0",b),onCloseAutoFocus:Q=>Q.preventDefault(),align:"start",sideOffset:8,collisionPadding:5,children:E.jsxs(Ap,{shouldFilter:!1,children:[E.jsxs("div",{className:"relative w-full border-b",children:[E.jsx(jT,{placeholder:`Search ${u.toLowerCase()}...`,value:H,onValueChange:Q=>{F(Q)},className:v}),D&&_.length>0&&E.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:E.jsx(jU,{className:"h-4 w-4 animate-spin"})})]}),E.jsxs(Rp,{children:[U&&E.jsx("div",{className:"text-destructive p-4 text-center",children:U}),D&&_.length===0&&(l||E.jsx(Gae,{})),!D&&!U&&_.length===0&&(s||E.jsx(UT,{children:x??`No ${u.toLowerCase()} found.`})),E.jsx(el,{children:_.map(Q=>E.jsxs(tl,{value:a(Q),onSelect:Z,className:"truncate",children:[r(Q),E.jsx(yT,{className:Me("ml-auto h-3 w-3",B===a(Q)?"opacity-100":"opacity-0")})]},a(Q)))})]})]})})]})}function Gae(){return E.jsx(el,{children:E.jsx(tl,{disabled:!0,children:E.jsxs("div",{className:"flex w-full items-center gap-2",children:[E.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),E.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[E.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),E.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const Hae=()=>{const{t:e}=Et(),t=Ie.use.queryLabel(),n=Fe.use.allDatabaseLabels(),r=Fe.use.labelsFetchAttempted(),a=w.useCallback(()=>{const l=new Co({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=n.map((d,p)=>({id:p,value:d}));return l.addAll(u),{labels:n,searchEngine:l}},[n]),o=w.useCallback(async l=>{const{labels:u,searchEngine:d}=a();let p=u;if(l&&(p=d.search(l).map(g=>u[g.id]),p.length<5)){const g=new Set(p),m=u.filter(b=>g.has(b)?!1:b&&typeof b=="string"&&!b.toLowerCase().startsWith(l.toLowerCase())&&b.toLowerCase().includes(l.toLowerCase()));p=[...p,...m]}return p.length<=F_?p:[...p.slice(0,F_),"..."]},[a]);w.useEffect(()=>{r&&(n.length>1?t&&t!=="*"&&!n.includes(t)?(console.log(`Label "${t}" not in available labels, setting to "*"`),Ie.getState().setQueryLabel("*")):console.log(`Label "${t}" is valid`):t&&n.length<=1&&t&&t!=="*"&&(console.log("Available labels list is empty, setting label to empty"),Ie.getState().setQueryLabel("")),Fe.getState().setLabelsFetchAttempted(!1))},[n,t,r]);const s=w.useCallback(()=>{Fe.getState().setLabelsFetchAttempted(!1),Fe.getState().setGraphDataFetchAttempted(!1),Fe.getState().setLastSuccessfulQueryLabel("");const l=Ie.getState().queryLabel;l?(Ie.getState().setQueryLabel(""),setTimeout(()=>{Ie.getState().setQueryLabel(l)},0)):Ie.getState().setQueryLabel("*")},[]);return E.jsxs("div",{className:"flex items-center",children:[E.jsx(nt,{size:"icon",variant:wr,onClick:s,tooltip:e("graphPanel.graphLabels.refreshTooltip"),className:"mr-2",children:E.jsx(UU,{className:"h-4 w-4"})}),E.jsx(Uae,{className:"min-w-[300px]",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:e("graphPanel.graphLabels.selectTooltip"),fetcher:o,renderOption:l=>E.jsx("div",{children:l}),getOptionValue:l=>l,getDisplayValue:l=>E.jsx("div",{children:l}),notFound:E.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:e("graphPanel.graphLabels.label"),placeholder:e("graphPanel.graphLabels.placeholder"),value:t!==null?t:"*",onChange:l=>{const u=Ie.getState().queryLabel;l==="..."&&(l="*"),l===u&&l!=="*"&&(l="*"),Fe.getState().setGraphDataFetchAttempted(!1),Ie.getState().setQueryLabel(l)},clearable:!1})]})},Qn=({text:e,className:t,tooltipClassName:n,tooltip:r,side:a,onClick:o})=>r?E.jsx(hT,{delayDuration:200,children:E.jsxs(mT,{children:[E.jsx(bT,{asChild:!0,children:E.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),E.jsx(gp,{side:a,className:n,children:r})]})}):E.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e});var rf={exports:{}},$ae=rf.exports,IO;function qae(){return IO||(IO=1,function(e){(function(t,n,r){function a(u){var d=this,p=l();d.next=function(){var g=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=g-(d.c=g|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(u),d.s0<0&&(d.s0+=1),d.s1-=p(u),d.s1<0&&(d.s1+=1),d.s2-=p(u),d.s2<0&&(d.s2+=1),p=null}function o(u,d){return d.c=u.c,d.s0=u.s0,d.s1=u.s1,d.s2=u.s2,d}function s(u,d){var p=new a(u),g=d&&d.state,m=p.next;return m.int32=function(){return p.next()*4294967296|0},m.double=function(){return m()+(m()*2097152|0)*11102230246251565e-32},m.quick=m,g&&(typeof g=="object"&&o(g,p),m.state=function(){return o(p,{})}),m}function l(){var u=4022871197,d=function(p){p=String(p);for(var g=0;g>>0,m-=u,m*=u,u=m>>>0,m-=u,u+=m*4294967296}return(u>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=s:this.alea=s})($ae,e)}(rf)),rf.exports}var af={exports:{}},Vae=af.exports,DO;function Wae(){return DO||(DO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var g=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^g^g>>>8},l===(l|0)?u.x=l:d+=l;for(var p=0;p>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xor128=s})(Vae,e)}(af)),af.exports}var of={exports:{}},Yae=of.exports,LO;function Kae(){return LO||(LO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.next=function(){var g=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(g^g<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:d+=l;for(var p=0;p>>4),u.next()}function o(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function s(l,u){var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xorwow=s})(Yae,e)}(of)),of.exports}var sf={exports:{}},Xae=sf.exports,MO;function Zae(){return MO||(MO=1,function(e){(function(t,n,r){function a(l){var u=this;u.next=function(){var p=u.x,g=u.i,m,b;return m=p[g],m^=m>>>7,b=m^m<<24,m=p[g+1&7],b^=m^m>>>10,m=p[g+3&7],b^=m^m>>>3,m=p[g+4&7],b^=m^m<<7,m=p[g+7&7],m=m^m<<13,b^=m^m<<9,p[g]=b,u.i=g+1&7,b};function d(p,g){var m,b=[];if(g===(g|0))b[0]=g;else for(g=""+g,m=0;m0;--m)p.next()}d(u,l)}function o(l,u){return u.x=l.x.slice(),u.i=l.i,u}function s(l,u){l==null&&(l=+new Date);var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(p.x&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xorshift7=s})(Xae,e)}(sf)),sf.exports}var lf={exports:{}},Qae=lf.exports,PO;function Jae(){return PO||(PO=1,function(e){(function(t,n,r){function a(l){var u=this;u.next=function(){var p=u.w,g=u.X,m=u.i,b,y;return u.w=p=p+1640531527|0,y=g[m+34&127],b=g[m=m+1&127],y^=y<<13,b^=b<<17,y^=y>>>15,b^=b>>>12,y=g[m]=y^b,u.i=m,y+(p^p>>>16)|0};function d(p,g){var m,b,y,v,x,T=[],k=128;for(g===(g|0)?(b=g,g=null):(g=g+"\0",b=0,k=Math.max(k,g.length)),y=0,v=-32;v>>15,b^=b<<4,b^=b>>>13,v>=0&&(x=x+1640531527|0,m=T[v&127]^=b+x,y=m==0?y+1:0);for(y>=128&&(T[(g&&g.length||0)&127]=-1),y=127,v=4*128;v>0;--v)b=T[y+34&127],m=T[y=y+1&127],b^=b<<13,m^=m<<17,b^=b>>>15,m^=m>>>12,T[y]=b^m;p.w=x,p.X=T,p.i=y}d(u,l)}function o(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function s(l,u){l==null&&(l=+new Date);var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(p.X&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xor4096=s})(Qae,e)}(lf)),lf.exports}var cf={exports:{}},eoe=cf.exports,FO;function toe(){return FO||(FO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.next=function(){var g=u.b,m=u.c,b=u.d,y=u.a;return g=g<<25^g>>>7^m,m=m-b|0,b=b<<24^b>>>8^y,y=y-g|0,u.b=g=g<<20^g>>>12^m,u.c=m=m-b|0,u.d=b<<16^m>>>16^y,u.a=y-g|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):d+=l;for(var p=0;p>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.tychei=s})(eoe,e)}(cf)),cf.exports}var uf={exports:{}};const noe={},roe=Object.freeze(Object.defineProperty({__proto__:null,default:noe},Symbol.toStringTag,{value:"Module"})),aoe=uq(roe);var ooe=uf.exports,zO;function ioe(){return zO||(zO=1,function(e){(function(t,n,r){var a=256,o=6,s=52,l="random",u=r.pow(a,o),d=r.pow(2,s),p=d*2,g=a-1,m;function b(O,N,C){var _=[];N=N==!0?{entropy:!0}:N||{};var M=T(x(N.entropy?[O,R(n)]:O??k(),3),_),D=new y(_),I=function(){for(var U=D.g(o),$=u,B=0;U=p;)U/=2,$/=2,B>>>=1;return(U+B)/$};return I.int32=function(){return D.g(4)|0},I.quick=function(){return D.g(4)/4294967296},I.double=I,T(R(D.S),n),(N.pass||C||function(U,$,B,W){return W&&(W.S&&v(W,D),U.state=function(){return v(D,{})}),B?(r[l]=U,$):U})(I,M,"global"in N?N.global:this==r,N.state)}function y(O){var N,C=O.length,_=this,M=0,D=_.i=_.j=0,I=_.S=[];for(C||(O=[C++]);M{const t="#5D6D7E",n=e?e.toLowerCase():"unknown",r=Fe.getState().typeColorMap;if(r.has(n))return r.get(n)||t;const a=coe[n];if(a){const d=jO[a],p=new Map(r);return p.set(n,d),Fe.setState({typeColorMap:p}),d}const o=new Set(Array.from(r.entries()).filter(([,d])=>!Object.values(jO).includes(d)).map(([,d])=>d)),l=uoe.find(d=>!o.has(d))||t,u=new Map(r);return u.set(n,l),Fe.setState({typeColorMap:u}),l},doe=e=>{if(!e)return console.log("Graph validation failed: graph is null"),!1;if(!Array.isArray(e.nodes)||!Array.isArray(e.edges))return console.log("Graph validation failed: nodes or edges is not an array"),!1;if(e.nodes.length===0)return console.log("Graph validation failed: nodes array is empty"),!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return console.log("Graph validation failed: invalid node structure"),!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return console.log("Graph validation failed: invalid edge structure"),!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return console.log("Graph validation failed: edge references non-existent node"),!1}return console.log("Graph validation passed"),!0},foe=async(e,t,n)=>{let r=null;if(!Fe.getState().lastSuccessfulQueryLabel){console.log("Last successful queryLabel is empty");try{await Fe.getState().fetchAllDatabaseLabels()}catch(l){console.error("Failed to fetch all database labels:",l)}}Fe.getState().setLabelsFetchAttempted(!0);const o=e||"*";try{console.log(`Fetching graph label: ${o}, depth: ${t}, nodes: ${n}`),r=await QB(o,t,n)}catch(l){return rr.getState().setErrorMessage(tr(l),"Query Graphs Error!"),null}let s=null;if(r){const l={},u={};for(let m=0;m0){const m=w0-ci;for(const b of r.nodes)b.size=Math.round(ci+m*Math.pow((b.degree-d)/g,.5))}s=new xV,s.nodes=r.nodes,s.edges=r.edges,s.nodeIdMap=l,s.edgeIdMap=u,doe(s)||(s=null,console.warn("Invalid graph data")),console.log("Graph data loaded")}return{rawGraph:s,is_truncated:r.is_truncated}},poe=e=>{var l,u;const t=Ie.getState().minEdgeSize,n=Ie.getState().maxEdgeSize;if(!e||!e.nodes.length)return console.log("No graph data available, skipping sigma graph creation"),null;const r=new Ac;for(const d of(e==null?void 0:e.nodes)??[]){sk(d.id+Date.now().toString(),{global:!0});const p=Math.random(),g=Math.random();r.addNode(d.id,{label:d.labels.join(", "),color:d.color,x:p,y:g,size:d.size,borderColor:E0,borderSize:.2})}for(const d of(e==null?void 0:e.edges)??[]){const p=((l=d.properties)==null?void 0:l.weight)!==void 0?Number(d.properties.weight):1;d.dynamicId=r.addEdge(d.source,d.target,{label:((u=d.properties)==null?void 0:u.keywords)||void 0,size:p,originalWeight:p,type:"curvedNoArrow"})}let a=Number.MAX_SAFE_INTEGER,o=0;r.forEachEdge(d=>{const p=r.getEdgeAttribute(d,"originalWeight")||1;a=Math.min(a,p),o=Math.max(o,p)});const s=o-a;if(s>0){const d=n-t;r.forEachEdge(p=>{const g=r.getEdgeAttribute(p,"originalWeight")||1,m=t+d*Math.pow((g-a)/s,.5);r.setEdgeAttribute(p,"size",m)})}else r.forEachEdge(d=>{r.setEdgeAttribute(d,"size",t)});return r},goe=()=>{const{t:e}=Et(),t=Ie.use.queryLabel(),n=Fe.use.rawGraph(),r=Fe.use.sigmaGraph(),a=Ie.use.graphQueryMaxDepth(),o=Ie.use.graphMaxNodes(),s=Fe.use.isFetching(),l=Fe.use.nodeToExpand(),u=Fe.use.nodeToPrune(),d=w.useRef(!1),p=w.useRef(!1),g=w.useRef(!1),m=w.useCallback(T=>(n==null?void 0:n.getNode(T))||null,[n]),b=w.useCallback((T,k=!0)=>(n==null?void 0:n.getEdge(T,k))||null,[n]),y=w.useRef(!1);w.useEffect(()=>{if(!t&&(n!==null||r!==null)){const T=Fe.getState();T.reset(),T.setGraphDataFetchAttempted(!1),T.setLabelsFetchAttempted(!1),d.current=!1,p.current=!1}},[t,n,r]),w.useEffect(()=>{if(!y.current&&!(!t&&g.current)&&!s&&!Fe.getState().graphDataFetchAttempted){y.current=!0,Fe.getState().setGraphDataFetchAttempted(!0);const T=Fe.getState();T.setIsFetching(!0),T.clearSelection(),T.sigmaGraph&&T.sigmaGraph.forEachNode(C=>{var _;(_=T.sigmaGraph)==null||_.setNodeAttribute(C,"highlighted",!1)}),console.log("Preparing graph data...");const k=t,R=a,O=o;let N;k?N=foe(k,R,O):(console.log("Query label is empty, show empty graph"),N=Promise.resolve({rawGraph:null,is_truncated:!1})),N.then(C=>{const _=Fe.getState(),M=C==null?void 0:C.rawGraph;if(M&&M.nodes&&M.nodes.forEach(D=>{var U;const I=(U=D.properties)==null?void 0:U.entity_type;D.color=UO(I)}),C!=null&&C.is_truncated&&Ft.info(e("graphPanel.dataIsTruncated","Graph data is truncated to Max Nodes")),_.reset(),!M||!M.nodes||M.nodes.length===0){const D=new Ac;D.addNode("empty-graph-node",{label:e("graphPanel.emptyGraph"),color:"#5D6D7E",x:.5,y:.5,size:15,borderColor:E0,borderSize:.2}),_.setSigmaGraph(D),_.setRawGraph(null),_.setGraphIsEmpty(!0);const I=rr.getState().message,U=I&&I.includes("Authentication required");!U&&k&&Ie.getState().setQueryLabel(""),U?console.log("Keep queryLabel for post-login reload"):_.setLastSuccessfulQueryLabel(""),console.log(`Graph data is empty, created graph with empty graph node. Auth error: ${U}`)}else{const D=poe(M);M.buildDynamicMap(),_.setSigmaGraph(D),_.setRawGraph(M),_.setGraphIsEmpty(!1),_.setLastSuccessfulQueryLabel(k),_.setMoveToSelectedNode(!0)}d.current=!0,p.current=!0,y.current=!1,_.setIsFetching(!1),(!M||!M.nodes||M.nodes.length===0)&&!k&&(g.current=!0)}).catch(C=>{console.error("Error fetching graph data:",C);const _=Fe.getState();_.setIsFetching(!1),d.current=!1,y.current=!1,_.setGraphDataFetchAttempted(!1),_.setLastSuccessfulQueryLabel("")})}},[t,a,o,s,e]),w.useEffect(()=>{l&&((async k=>{var R,O,N,C,_,M;if(!(!k||!r||!n))try{const D=n.getNode(k);if(!D){console.error("Node not found:",k);return}const I=D.labels[0];if(!I){console.error("Node has no label:",k);return}const U=await QB(I,2,1e3);if(!U||!U.nodes||!U.edges){console.error("Failed to fetch extended graph");return}const $=[];for(const ne of U.nodes){sk(ne.id,{global:!0});const xe=(R=ne.properties)==null?void 0:R.entity_type,Se=UO(xe);$.push({id:ne.id,labels:ne.labels,properties:ne.properties,size:10,x:Math.random(),y:Math.random(),color:Se,degree:0})}const B=[];for(const ne of U.edges)B.push({id:ne.id,source:ne.source,target:ne.target,type:ne.type,properties:ne.properties,dynamicId:""});const W={};r.forEachNode(ne=>{W[ne]={x:r.getNodeAttribute(ne,"x"),y:r.getNodeAttribute(ne,"y")}});const K=new Set(r.nodes()),G=new Set,H=new Set,F=1;let Y=0,L=Number.MAX_SAFE_INTEGER,V=0;r.forEachNode(ne=>{const xe=r.degree(ne);Y=Math.max(Y,xe)}),r.forEachEdge(ne=>{const xe=r.getEdgeAttribute(ne,"originalWeight")||1;L=Math.min(L,xe),V=Math.max(V,xe)});for(const ne of $){if(K.has(ne.id))continue;B.some(Se=>Se.source===k&&Se.target===ne.id||Se.target===k&&Se.source===ne.id)&&G.add(ne.id)}const j=new Map,P=new Map,Z=new Set;for(const ne of B){const xe=K.has(ne.source)||G.has(ne.source),Se=K.has(ne.target)||G.has(ne.target);xe&&Se?(H.add(ne.id),G.has(ne.source)?j.set(ne.source,(j.get(ne.source)||0)+1):K.has(ne.source)&&P.set(ne.source,(P.get(ne.source)||0)+1),G.has(ne.target)?j.set(ne.target,(j.get(ne.target)||0)+1):K.has(ne.target)&&P.set(ne.target,(P.get(ne.target)||0)+1)):(r.hasNode(ne.source)?Z.add(ne.source):G.has(ne.source)&&(Z.add(ne.source),j.set(ne.source,(j.get(ne.source)||0)+1)),r.hasNode(ne.target)?Z.add(ne.target):G.has(ne.target)&&(Z.add(ne.target),j.set(ne.target,(j.get(ne.target)||0)+1)))}const Q=(ne,xe,Se,be)=>{const J=be-Se||1,pe=w0-ci;for(const ke of xe)if(ne.hasNode(ke)){let he=ne.degree(ke);he+=1;const Ee=Math.min(he,be+1),se=Math.round(ci+pe*Math.pow((Ee-Se)/J,.5)),Be=ne.getNodeAttribute(ke,"size");se>Be&&ne.setNodeAttribute(ke,"size",se)}},oe=(ne,xe,Se)=>{const be=Ie.getState().minEdgeSize,J=Ie.getState().maxEdgeSize,pe=Se-xe||1,ke=J-be;ne.forEachEdge(he=>{const Ee=ne.getEdgeAttribute(he,"originalWeight")||1,se=be+ke*Math.pow((Ee-xe)/pe,.5);ne.setEdgeAttribute(he,"size",se)})};if(G.size===0){Q(r,Z,F,Y),Ft.info(e("graphPanel.propertiesView.node.noNewNodes"));return}for(const[,ne]of j.entries())Y=Math.max(Y,ne);for(const[ne,xe]of P.entries()){const be=r.degree(ne)+xe;Y=Math.max(Y,be)}const ae=Y-F||1,ce=w0-ci,Re=((O=Fe.getState().sigmaInstance)==null?void 0:O.getCamera().ratio)||1,ie=Math.max(Math.sqrt(D.size)*4,Math.sqrt(G.size)*3)/Re;sk(Date.now().toString(),{global:!0});const Te=Math.random()*2*Math.PI;console.log("nodeSize:",D.size,"nodesToAdd:",G.size),console.log("cameraRatio:",Math.round(Re*100)/100,"spreadFactor:",Math.round(ie*100)/100);for(const ne of G){const xe=$.find(Ee=>Ee.id===ne),Se=j.get(ne)||0,be=Math.min(Se,Y+1),J=Math.round(ci+ce*Math.pow((be-F)/ae,.5)),pe=2*Math.PI*(Array.from(G).indexOf(ne)/G.size),ke=((N=W[ne])==null?void 0:N.x)||W[D.id].x+Math.cos(Te+pe)*ie,he=((C=W[ne])==null?void 0:C.y)||W[D.id].y+Math.sin(Te+pe)*ie;r.addNode(ne,{label:xe.labels.join(", "),color:xe.color,x:ke,y:he,size:J,borderColor:E0,borderSize:.2}),n.getNode(ne)||(xe.size=J,xe.x=ke,xe.y=he,xe.degree=Se,n.nodes.push(xe),n.nodeIdMap[ne]=n.nodes.length-1)}for(const ne of H){const xe=B.find(be=>be.id===ne);if(r.hasEdge(xe.source,xe.target))continue;const Se=((_=xe.properties)==null?void 0:_.weight)!==void 0?Number(xe.properties.weight):1;L=Math.min(L,Se),V=Math.max(V,Se),xe.dynamicId=r.addEdge(xe.source,xe.target,{label:((M=xe.properties)==null?void 0:M.keywords)||void 0,size:Se,originalWeight:Se,type:"curvedNoArrow"}),n.getEdge(xe.id,!1)?console.error("Edge already exists in rawGraph:",xe.id):(n.edges.push(xe),n.edgeIdMap[xe.id]=n.edges.length-1,n.edgeDynamicIdMap[xe.dynamicId]=n.edges.length-1)}if(n.buildDynamicMap(),Fe.getState().resetSearchEngine(),Q(r,Z,F,Y),oe(r,L,V),r.hasNode(k)){const ne=r.degree(k),xe=Math.min(ne,Y+1),Se=Math.round(ci+ce*Math.pow((xe-F)/ae,.5));r.setNodeAttribute(k,"size",Se),D.size=Se,D.degree=ne}}catch(D){console.error("Error expanding node:",D)}})(l),window.setTimeout(()=>{Fe.getState().triggerNodeExpand(null)},0))},[l,r,n,e]);const v=w.useCallback((T,k)=>{const R=new Set([T]);return k.forEachNode(O=>{if(O===T)return;const N=k.neighbors(O);N.length===1&&N[0]===T&&R.add(O)}),R},[]);return w.useEffect(()=>{u&&((k=>{if(!(!k||!r||!n))try{const R=Fe.getState();if(!r.hasNode(k)){console.error("Node not found:",k);return}const O=v(k,r);if(O.size===r.nodes().length){Ft.error(e("graphPanel.propertiesView.node.deleteAllNodesError"));return}R.clearSelection();for(const N of O){r.dropNode(N);const C=n.nodeIdMap[N];if(C!==void 0){const _=n.edges.filter(M=>M.source===N||M.target===N);for(const M of _){const D=n.edgeIdMap[M.id];if(D!==void 0){n.edges.splice(D,1);for(const[I,U]of Object.entries(n.edgeIdMap))U>D&&(n.edgeIdMap[I]=U-1);delete n.edgeIdMap[M.id],delete n.edgeDynamicIdMap[M.dynamicId]}}n.nodes.splice(C,1);for(const[M,D]of Object.entries(n.nodeIdMap))D>C&&(n.nodeIdMap[M]=D-1);delete n.nodeIdMap[N]}}n.buildDynamicMap(),Fe.getState().resetSearchEngine(),O.size>1&&Ft.info(e("graphPanel.propertiesView.node.nodesRemoved",{count:O.size}))}catch(R){console.error("Error pruning node:",R)}})(u),window.setTimeout(()=>{Fe.getState().triggerNodePrune(null)},0))},[u,r,n,v,e]),{lightrageGraph:w.useCallback(()=>{if(r)return r;console.log("Creating new Sigma graph instance");const T=new Ac;return Fe.getState().setSigmaGraph(T),T},[r]),getNode:m,getEdge:b}},hoe=()=>{const{getNode:e,getEdge:t}=goe(),n=Fe.use.selectedNode(),r=Fe.use.focusedNode(),a=Fe.use.selectedEdge(),o=Fe.use.focusedEdge(),[s,l]=w.useState(null),[u,d]=w.useState(null);return w.useEffect(()=>{let p=null,g=null;r?(p="node",g=e(r)):n?(p="node",g=e(n)):o?(p="edge",g=t(o,!0)):a&&(p="edge",g=t(a,!0)),g?(p=="node"?l(moe(g)):l(boe(g)),d(p)):(l(null),d(null))},[r,n,o,a,l,d,e,t]),s?E.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:u=="node"?E.jsx(yoe,{node:s}):E.jsx(voe,{edge:s})}):E.jsx(E.Fragment,{})},moe=e=>{const t=Fe.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)try{if(!t.sigmaGraph.hasNode(e.id))return{...e,relationships:[]};const r=t.sigmaGraph.edges(e.id);for(const a of r){if(!t.sigmaGraph.hasEdge(a))continue;const o=t.rawGraph.getEdge(a,!0);if(o){const l=e.id===o.source?o.target:o.source;if(!t.sigmaGraph.hasNode(l))continue;const u=t.rawGraph.getNode(l);u&&n.push({type:"Neighbour",id:l,label:u.properties.entity_id?u.properties.entity_id:u.labels.join(", ")})}}}catch(r){console.error("Error refining node properties:",r)}return{...e,relationships:n}},boe=e=>{const t=Fe.getState();let n,r;if(t.sigmaGraph&&t.rawGraph)try{if(!t.sigmaGraph.hasEdge(e.id))return{...e,sourceNode:void 0,targetNode:void 0};t.sigmaGraph.hasNode(e.source)&&(n=t.rawGraph.getNode(e.source)),t.sigmaGraph.hasNode(e.target)&&(r=t.rawGraph.getNode(e.target))}catch(a){console.error("Error refining edge properties:",a)}return{...e,sourceNode:n,targetNode:r}},ra=({name:e,value:t,onClick:n,tooltip:r})=>{const{t:a}=Et(),o=s=>{const l=`graphPanel.propertiesView.node.propertyNames.${s}`,u=a(l);return u===l?s:u};return E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-primary/60 tracking-wide whitespace-nowrap",children:o(e)}),":",E.jsx(Qn,{className:"hover:bg-primary/20 rounded p-1 overflow-hidden text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||(typeof t=="string"?t:JSON.stringify(t,null,2)),side:"left",onClick:n})]})},yoe=({node:e})=>{const{t}=Et(),n=()=>{Fe.getState().triggerNodeExpand(e.id)},r=()=>{Fe.getState().triggerNodePrune(e.id)};return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsxs("div",{className:"flex justify-between items-center",children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-blue-700",children:t("graphPanel.propertiesView.node.title")}),E.jsxs("div",{className:"flex gap-3",children:[E.jsx(nt,{size:"icon",variant:"ghost",className:"h-7 w-7 border border-gray-400 hover:bg-gray-200 dark:border-gray-600 dark:hover:bg-gray-700",onClick:n,tooltip:t("graphPanel.propertiesView.node.expandNode"),children:E.jsx(EZ,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),E.jsx(nt,{size:"icon",variant:"ghost",className:"h-7 w-7 border border-gray-400 hover:bg-gray-200 dark:border-gray-600 dark:hover:bg-gray-700",onClick:r,tooltip:t("graphPanel.propertiesView.node.pruneNode"),children:E.jsx(WZ,{className:"h-4 w-4 text-gray-900 dark:text-gray-300"})})]})]}),E.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[E.jsx(ra,{name:t("graphPanel.propertiesView.node.id"),value:e.id}),E.jsx(ra,{name:t("graphPanel.propertiesView.node.labels"),value:e.labels.join(", "),onClick:()=>{Fe.getState().setSelectedNode(e.id,!0)}}),E.jsx(ra,{name:t("graphPanel.propertiesView.node.degree"),value:e.degree})]}),E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-amber-700",children:t("graphPanel.propertiesView.node.properties")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(a=>E.jsx(ra,{name:a,value:e.properties[a]},a))}),e.relationships.length>0&&E.jsxs(E.Fragment,{children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-emerald-700",children:t("graphPanel.propertiesView.node.relationships")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:a,id:o,label:s})=>E.jsx(ra,{name:a,value:s,onClick:()=>{Fe.getState().setSelectedNode(o,!0)}},o))})]})]})},voe=({edge:e})=>{const{t}=Et();return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-violet-700",children:t("graphPanel.propertiesView.edge.title")}),E.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[E.jsx(ra,{name:t("graphPanel.propertiesView.edge.id"),value:e.id}),e.type&&E.jsx(ra,{name:t("graphPanel.propertiesView.edge.type"),value:e.type}),E.jsx(ra,{name:t("graphPanel.propertiesView.edge.source"),value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{Fe.getState().setSelectedNode(e.source,!0)}}),E.jsx(ra,{name:t("graphPanel.propertiesView.edge.target"),value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{Fe.getState().setSelectedNode(e.target,!0)}})]}),E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-amber-700",children:t("graphPanel.propertiesView.edge.properties")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(n=>E.jsx(ra,{name:n,value:e.properties[n]},n))})]})},Soe=()=>{const{t:e}=Et(),t=Ie.use.graphQueryMaxDepth(),n=Ie.use.graphMaxNodes();return E.jsxs("div",{className:"absolute bottom-4 left-[calc(1rem+2.5rem)] flex items-center gap-2 text-xs text-gray-400",children:[E.jsxs("div",{children:[e("graphPanel.sideBar.settings.depth"),": ",t]}),E.jsxs("div",{children:[e("graphPanel.sideBar.settings.max"),": ",n]})]})},wi=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));wi.displayName="Card";const Cc=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Cc.displayName="CardHeader";const _c=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));_c.displayName="CardTitle";const Cp=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Cp.displayName="CardDescription";const Nc=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Nc.displayName="CardContent";const Eoe=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));Eoe.displayName="CardFooter";function woe(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var VT="ScrollArea",[G5,v0e]=$r(VT),[xoe,Rr]=G5(VT),H5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:o=600,...s}=e,[l,u]=w.useState(null),[d,p]=w.useState(null),[g,m]=w.useState(null),[b,y]=w.useState(null),[v,x]=w.useState(null),[T,k]=w.useState(0),[R,O]=w.useState(0),[N,C]=w.useState(!1),[_,M]=w.useState(!1),D=mt(t,U=>u(U)),I=yp(a);return E.jsx(xoe,{scope:n,type:r,dir:I,scrollHideDelay:o,scrollArea:l,viewport:d,onViewportChange:p,content:g,onContentChange:m,scrollbarX:b,onScrollbarXChange:y,scrollbarXEnabled:N,onScrollbarXEnabledChange:C,scrollbarY:v,onScrollbarYChange:x,scrollbarYEnabled:_,onScrollbarYEnabledChange:M,onCornerWidthChange:k,onCornerHeightChange:O,children:E.jsx(Je.div,{dir:I,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":R+"px",...e.style}})})});H5.displayName=VT;var $5="ScrollAreaViewport",q5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...o}=e,s=Rr($5,n),l=w.useRef(null),u=mt(t,l,s.onViewportChange);return E.jsxs(E.Fragment,{children:[E.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:a}),E.jsx(Je.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:E.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});q5.displayName=$5;var da="ScrollAreaScrollbar",WT=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=a,l=e.orientation==="horizontal";return w.useEffect(()=>(l?o(!0):s(!0),()=>{l?o(!1):s(!1)}),[l,o,s]),a.type==="hover"?E.jsx(koe,{...r,ref:t,forceMount:n}):a.type==="scroll"?E.jsx(Toe,{...r,ref:t,forceMount:n}):a.type==="auto"?E.jsx(V5,{...r,ref:t,forceMount:n}):a.type==="always"?E.jsx(YT,{...r,ref:t}):null});WT.displayName=da;var koe=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),[o,s]=w.useState(!1);return w.useEffect(()=>{const l=a.scrollArea;let u=0;if(l){const d=()=>{window.clearTimeout(u),s(!0)},p=()=>{u=window.setTimeout(()=>s(!1),a.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",p),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",p)}}},[a.scrollArea,a.scrollHideDelay]),E.jsx(ir,{present:n||o,children:E.jsx(V5,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Toe=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Np(()=>u("SCROLL_END"),100),[l,u]=woe("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 w.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>u("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,a.scrollHideDelay,u]),w.useEffect(()=>{const d=a.viewport,p=o?"scrollLeft":"scrollTop";if(d){let g=d[p];const m=()=>{const b=d[p];g!==b&&(u("SCROLL"),s()),g=b};return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[a.viewport,o,u,s]),E.jsx(ir,{present:n||l!=="hidden",children:E.jsx(YT,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ke(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ke(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),V5=w.forwardRef((e,t)=>{const n=Rr(da,e.__scopeScrollArea),{forceMount:r,...a}=e,[o,s]=w.useState(!1),l=e.orientation==="horizontal",u=Np(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,a=Rr(da,e.__scopeScrollArea),o=w.useRef(null),s=w.useRef(0),[l,u]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Z5(l.viewport,l.content),p={...r,sizes:l,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function g(m,b){return Ooe(m,s.current,l,b)}return n==="horizontal"?E.jsx(Aoe,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const m=a.viewport.scrollLeft,b=GO(m,l,a.dir);o.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollLeft=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollLeft=g(m,a.dir))}}):n==="vertical"?E.jsx(Roe,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const m=a.viewport.scrollTop,b=GO(m,l);o.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollTop=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollTop=g(m))}}):null}),Aoe=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Rr(da,e.__scopeScrollArea),[s,l]=w.useState(),u=w.useRef(null),d=mt(t,u,o.onScrollbarXChange);return w.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),E.jsx(Y5,{"data-orientation":"horizontal",...a,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":_p(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,g)=>{if(o.viewport){const m=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(m),J5(m,g)&&p.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:If(s.paddingLeft),paddingEnd:If(s.paddingRight)}})}})}),Roe=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Rr(da,e.__scopeScrollArea),[s,l]=w.useState(),u=w.useRef(null),d=mt(t,u,o.onScrollbarYChange);return w.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),E.jsx(Y5,{"data-orientation":"vertical",...a,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":_p(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,g)=>{if(o.viewport){const m=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(m),J5(m,g)&&p.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:If(s.paddingTop),paddingEnd:If(s.paddingBottom)}})}})}),[Coe,W5]=G5(da),Y5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:g,...m}=e,b=Rr(da,n),[y,v]=w.useState(null),x=mt(t,D=>v(D)),T=w.useRef(null),k=w.useRef(""),R=b.viewport,O=r.content-r.viewport,N=yn(p),C=yn(u),_=Np(g,10);function M(D){if(T.current){const I=D.clientX-T.current.left,U=D.clientY-T.current.top;d({x:I,y:U})}}return w.useEffect(()=>{const D=I=>{const U=I.target;(y==null?void 0:y.contains(U))&&N(I,O)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[R,y,O,N]),w.useEffect(C,[r,C]),zs(y,_),zs(b.content,_),E.jsx(Coe,{scope:n,scrollbar:y,hasThumb:a,onThumbChange:yn(o),onThumbPointerUp:yn(s),onThumbPositionChange:C,onThumbPointerDown:yn(l),children:E.jsx(Je.div,{...m,ref:x,style:{position:"absolute",...m.style},onPointerDown:Ke(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),T.current=y.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),M(D))}),onPointerMove:Ke(e.onPointerMove,M),onPointerUp:Ke(e.onPointerUp,D=>{const I=D.target;I.hasPointerCapture(D.pointerId)&&I.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=k.current,b.viewport&&(b.viewport.style.scrollBehavior=""),T.current=null})})})}),Of="ScrollAreaThumb",K5=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=W5(Of,e.__scopeScrollArea);return E.jsx(ir,{present:n||a.hasThumb,children:E.jsx(_oe,{ref:t,...r})})}),_oe=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,o=Rr(Of,n),s=W5(Of,n),{onThumbPositionChange:l}=s,u=mt(t,g=>s.onThumbChange(g)),d=w.useRef(void 0),p=Np(()=>{d.current&&(d.current(),d.current=void 0)},100);return w.useEffect(()=>{const g=o.viewport;if(g){const m=()=>{if(p(),!d.current){const b=Ioe(g,l);d.current=b,l()}};return l(),g.addEventListener("scroll",m),()=>g.removeEventListener("scroll",m)}},[o.viewport,p,l]),E.jsx(Je.div,{"data-state":s.hasThumb?"visible":"hidden",...a,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ke(e.onPointerDownCapture,g=>{const b=g.target.getBoundingClientRect(),y=g.clientX-b.left,v=g.clientY-b.top;s.onThumbPointerDown({x:y,y:v})}),onPointerUp:Ke(e.onPointerUp,s.onThumbPointerUp)})});K5.displayName=Of;var KT="ScrollAreaCorner",X5=w.forwardRef((e,t)=>{const n=Rr(KT,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?E.jsx(Noe,{...e,ref:t}):null});X5.displayName=KT;var Noe=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Rr(KT,n),[o,s]=w.useState(0),[l,u]=w.useState(0),d=!!(o&&l);return zs(a.scrollbarX,()=>{var g;const p=((g=a.scrollbarX)==null?void 0:g.offsetHeight)||0;a.onCornerHeightChange(p),u(p)}),zs(a.scrollbarY,()=>{var g;const p=((g=a.scrollbarY)==null?void 0:g.offsetWidth)||0;a.onCornerWidthChange(p),s(p)}),d?E.jsx(Je.div,{...r,ref:t,style:{width:o,height:l,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function If(e){return e?parseInt(e,10):0}function Z5(e,t){const n=e/t;return isNaN(n)?0:n}function _p(e){const t=Z5(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Ooe(e,t,n,r="ltr"){const a=_p(n),o=a/2,s=t||o,l=a-s,u=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,p=n.content-n.viewport,g=r==="ltr"?[0,p]:[p*-1,0];return Q5([u,d],g)(e)}function GO(e,t,n="ltr"){const r=_p(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,s=t.content-t.viewport,l=o-r,u=n==="ltr"?[0,s]:[s*-1,0],d=z0(e,u);return Q5([0,s],[0,l])(d)}function Q5(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function J5(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,l=n.top!==o.top;(s||l)&&t(),n=o,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function Np(e,t){const n=yn(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function zs(e,t){const n=yn(t);Rn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var eG=H5,Doe=q5,Loe=X5;const XT=w.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(eG,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[E.jsx(Doe,{className:"h-full w-full rounded-[inherit]",children:t}),E.jsx(tG,{}),E.jsx(Loe,{})]}));XT.displayName=eG.displayName;const tG=w.forwardRef(({className:e,orientation:t="vertical",...n},r)=>E.jsx(WT,{ref:r,orientation:t,className:Me("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:E.jsx(K5,{className:"bg-border relative flex-1 rounded-full"})}));tG.displayName=WT.displayName;const Moe=({className:e})=>{const{t}=Et(),n=Fe.use.typeColorMap();return!n||n.size===0?null:E.jsxs(wi,{className:`p-2 max-w-xs ${e}`,children:[E.jsx("h3",{className:"text-sm font-medium mb-2",children:t("graphPanel.legend")}),E.jsx(XT,{className:"max-h-80",children:E.jsx("div",{className:"flex flex-col gap-1",children:Array.from(n.entries()).map(([r,a])=>E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:a}}),E.jsx("span",{className:"text-xs truncate",title:r,children:t(`graphPanel.nodeTypes.${r.toLowerCase()}`,r)})]},r))})})]})},Poe=()=>{const{t:e}=Et(),t=Ie.use.showLegend(),n=Ie.use.setShowLegend(),r=w.useCallback(()=>{n(!t)},[t,n]);return E.jsx(nt,{variant:wr,onClick:r,tooltip:e("graphPanel.sideBar.legendControl.toggleLegend"),size:"icon",children:E.jsx(aZ,{})})},HO={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedNoArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:U4,curvedArrow:Hne,curvedNoArrow:Gne},nodeProgramClasses:{default:Tne,circel:eu,point:Jte},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},Foe=()=>{const e=X4(),t=Ar(),[n,r]=w.useState(null);return w.useEffect(()=>{e({downNode:a=>{r(a.node),t.getGraph().setNodeAttribute(a.node,"highlighted",!0)},mousemovebody:a=>{if(!n)return;const o=t.viewportToGraph(a);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),a.preventSigmaDefault(),a.original.preventDefault(),a.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:a=>{a.original.buttons!==0&&!t.getCustomBBox()&&t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},zoe=()=>{const[e,t]=w.useState(HO),n=w.useRef(null),r=Fe.use.selectedNode(),a=Fe.use.focusedNode(),o=Fe.use.moveToSelectedNode(),s=Fe.use.isFetching(),l=Ie.use.showPropertyPanel(),u=Ie.use.showNodeSearchBar(),d=Ie.use.enableNodeDrag(),p=Ie.use.showLegend();w.useEffect(()=>{t(HO),console.log("Initialized sigma settings")},[]),w.useEffect(()=>()=>{const v=Fe.getState().sigmaInstance;if(v)try{v.kill(),Fe.getState().setSigmaInstance(null),console.log("Cleared sigma instance on Graphviewer unmount")}catch(x){console.error("Error cleaning up sigma instance:",x)}},[]);const g=w.useCallback(v=>{v===null?Fe.getState().setFocusedNode(null):v.type==="nodes"&&Fe.getState().setFocusedNode(v.id)},[]),m=w.useCallback(v=>{v===null?Fe.getState().setSelectedNode(null):v.type==="nodes"&&Fe.getState().setSelectedNode(v.id,!0)},[]),b=w.useMemo(()=>a??r,[a,r]),y=w.useMemo(()=>r?{type:"nodes",id:r}:null,[r]);return E.jsxs("div",{className:"relative h-full w-full overflow-hidden",children:[E.jsxs(Wte,{settings:e,className:"!bg-background !size-full overflow-hidden",ref:n,children:[E.jsx(lae,{}),d&&E.jsx(Foe,{}),E.jsx($ne,{node:b,move:o}),E.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[E.jsx(Hae,{}),u&&E.jsx(jae,{value:y,onFocus:g,onChange:m})]}),E.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[E.jsx(sae,{}),E.jsx(cae,{}),E.jsx(uae,{}),E.jsx(Poe,{}),E.jsx(vae,{})]}),l&&E.jsx("div",{className:"absolute top-2 right-2",children:E.jsx(hoe,{})}),p&&E.jsx("div",{className:"absolute bottom-10 right-2",children:E.jsx(Moe,{className:"bg-background/60 backdrop-blur-lg"})}),E.jsx(Soe,{})]}),s&&E.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/80 z-10",children:E.jsxs("div",{className:"text-center",children:[E.jsx("div",{className:"mb-2 h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"}),E.jsx("p",{children:"Loading Graph Data..."})]})})]})},nG=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{className:"relative w-full overflow-auto",children:E.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));nG.displayName="Table";const rG=w.forwardRef(({className:e,...t},n)=>E.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));rG.displayName="TableHeader";const aG=w.forwardRef(({className:e,...t},n)=>E.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));aG.displayName="TableBody";const Boe=w.forwardRef(({className:e,...t},n)=>E.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));Boe.displayName="TableFooter";const lk=w.forwardRef(({className:e,...t},n)=>E.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));lk.displayName="TableRow";const wo=w.forwardRef(({className:e,...t},n)=>E.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));wo.displayName="TableHead";const xo=w.forwardRef(({className:e,...t},n)=>E.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xo.displayName="TableCell";const joe=w.forwardRef(({className:e,...t},n)=>E.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));joe.displayName="TableCaption";function Uoe({title:e,description:t,icon:n=hZ,action:r,className:a,...o}){return E.jsxs(wi,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",a),...o,children:[E.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:E.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),E.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[E.jsx(_c,{children:e}),t?E.jsx(Cp,{children:t}):null]}),r||null]})}var cb={exports:{}},ub,$O;function Goe(){if($O)return ub;$O=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ub=e,ub}var db,qO;function Hoe(){if(qO)return db;qO=1;var e=Goe();function t(){}function n(){}return n.resetWarningCache=t,db=function(){function r(s,l,u,d,p,g){if(g!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},db}var VO;function $oe(){return VO||(VO=1,cb.exports=Hoe()()),cb.exports}var qoe=$oe();const It=un(qoe),Voe=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Bs(e,t,n){const r=Woe(e),{webkitRelativePath:a}=e,o=typeof t=="string"?t:typeof a=="string"&&a.length>0?a:`./${e.name}`;return typeof r.path!="string"&&WO(r,"path",o),WO(r,"relativePath",o),r}function Woe(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),a=Voe.get(r);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}function WO(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const Yoe=[".DS_Store","Thumbs.db"];function Koe(e){return Ai(this,void 0,void 0,function*(){return Df(e)&&Xoe(e.dataTransfer)?eie(e.dataTransfer,e.type):Zoe(e)?Qoe(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Joe(e):[]})}function Xoe(e){return Df(e)}function Zoe(e){return Df(e)&&Df(e.target)}function Df(e){return typeof e=="object"&&e!==null}function Qoe(e){return ck(e.target.files).map(t=>Bs(t))}function Joe(e){return Ai(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Bs(n))})}function eie(e,t){return Ai(this,void 0,void 0,function*(){if(e.items){const n=ck(e.items).filter(a=>a.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(tie));return YO(oG(r))}return YO(ck(e.files).map(n=>Bs(n)))})}function YO(e){return e.filter(t=>Yoe.indexOf(t.name)===-1)}function ck(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?oG(n):[n]],[])}function KO(e,t){return Ai(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const s=yield o.getFile();return s.handle=o,Bs(s)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Bs(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function nie(e){return Ai(this,void 0,void 0,function*(){return e.isDirectory?iG(e):rie(e)})}function iG(e){const t=e.createReader();return new Promise((n,r)=>{const a=[];function o(){t.readEntries(s=>Ai(this,void 0,void 0,function*(){if(s.length){const l=Promise.all(s.map(nie));a.push(l),o()}else try{const l=yield Promise.all(a);n(l)}catch(l){r(l)}}),s=>{r(s)})}o()})}function rie(e){return Ai(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const a=Bs(r,e.fullPath);t(a)},r=>{n(r)})})})}var zd={},XO;function aie(){return XO||(XO=1,zd.__esModule=!0,zd.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",a=(e.type||"").toLowerCase(),o=a.replace(/\/.*$/,"");return n.some(function(s){var l=s.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?o===l.replace(/\/.*$/,""):a===l})}return!0}),zd}var oie=aie();const fb=un(oie);function ZO(e){return lie(e)||sie(e)||lG(e)||iie()}function iie(){throw new TypeError(`Invalid attempt to spread non-iterable instance. + */var kO;function Ure(){if(kO)return Jm;kO=1;var e=$f();function t(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function l(g,m){var b=m(),y=r({inst:{value:b,getSnapshot:m}}),v=y[0].inst,x=y[1];return o(function(){v.value=b,v.getSnapshot=m,u(v)&&x({inst:v})},[g,b,m]),a(function(){return u(v)&&x({inst:v}),g(function(){u(v)&&x({inst:v})})},[g]),s(b),b}function u(g){var m=g.getSnapshot;g=g.value;try{var b=m();return!n(g,b)}catch{return!0}}function d(g,m){return m()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Jm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Jm}var TO;function Gre(){return TO||(TO=1,Qm.exports=Ure()),Qm.exports}var Hre=Gre(),cc='[cmdk-group=""]',eb='[cmdk-group-items=""]',$re='[cmdk-group-heading=""]',zT='[cmdk-item=""]',AO=`${zT}:not([aria-disabled="true"])`,nk="cmdk-item-select",ui="data-value",qre=(e,t,n)=>jre(e,t,n),E5=w.createContext(void 0),au=()=>w.useContext(E5),w5=w.createContext(void 0),BT=()=>w.useContext(w5),x5=w.createContext(void 0),k5=w.forwardRef((e,t)=>{let n=Es(()=>{var j,P;return{search:"",value:(P=(j=e.value)!=null?j:e.defaultValue)!=null?P:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Es(()=>new Set),a=Es(()=>new Map),o=Es(()=>new Map),s=Es(()=>new Set),l=T5(e),{label:u,children:d,value:p,onValueChange:g,filter:m,shouldFilter:b,loop:y,disablePointerSelection:v=!1,vimBindings:x=!0,...T}=e,k=An(),R=An(),O=An(),N=w.useRef(null),C=nae();Si(()=>{if(p!==void 0){let j=p.trim();n.current.value=j,_.emit()}},[p]),Si(()=>{C(6,B)},[]);let _=w.useMemo(()=>({subscribe:j=>(s.current.add(j),()=>s.current.delete(j)),snapshot:()=>n.current,setState:(j,P,Z)=>{var Q,oe,ae;if(!Object.is(n.current[j],P)){if(n.current[j]=P,j==="search")$(),I(),C(1,U);else if(j==="value"&&(Z||C(5,B),((Q=l.current)==null?void 0:Q.value)!==void 0)){let ce=P??"";(ae=(oe=l.current).onValueChange)==null||ae.call(oe,ce);return}_.emit()}},emit:()=>{s.current.forEach(j=>j())}}),[]),M=w.useMemo(()=>({value:(j,P,Z)=>{var Q;P!==((Q=o.current.get(j))==null?void 0:Q.value)&&(o.current.set(j,{value:P,keywords:Z}),n.current.filtered.items.set(j,D(P,Z)),C(2,()=>{I(),_.emit()}))},item:(j,P)=>(r.current.add(j),P&&(a.current.has(P)?a.current.get(P).add(j):a.current.set(P,new Set([j]))),C(3,()=>{$(),I(),n.current.value||U(),_.emit()}),()=>{o.current.delete(j),r.current.delete(j),n.current.filtered.items.delete(j);let Z=W();C(4,()=>{$(),(Z==null?void 0:Z.getAttribute("id"))===j&&U(),_.emit()})}),group:j=>(a.current.has(j)||a.current.set(j,new Set),()=>{o.current.delete(j),a.current.delete(j)}),filter:()=>l.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:k,inputId:O,labelId:R,listInnerRef:N}),[]);function D(j,P){var Z,Q;let oe=(Q=(Z=l.current)==null?void 0:Z.filter)!=null?Q:qre;return j?oe(j,n.current.search,P):0}function I(){if(!n.current.search||l.current.shouldFilter===!1)return;let j=n.current.filtered.items,P=[];n.current.filtered.groups.forEach(Q=>{let oe=a.current.get(Q),ae=0;oe.forEach(ce=>{let Re=j.get(ce);ae=Math.max(Re,ae)}),P.push([Q,ae])});let Z=N.current;K().sort((Q,oe)=>{var ae,ce;let Re=Q.getAttribute("id"),ie=oe.getAttribute("id");return((ae=j.get(ie))!=null?ae:0)-((ce=j.get(Re))!=null?ce:0)}).forEach(Q=>{let oe=Q.closest(eb);oe?oe.appendChild(Q.parentElement===oe?Q:Q.closest(`${eb} > *`)):Z.appendChild(Q.parentElement===Z?Q:Q.closest(`${eb} > *`))}),P.sort((Q,oe)=>oe[1]-Q[1]).forEach(Q=>{var oe;let ae=(oe=N.current)==null?void 0:oe.querySelector(`${cc}[${ui}="${encodeURIComponent(Q[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function U(){let j=K().find(Z=>Z.getAttribute("aria-disabled")!=="true"),P=j==null?void 0:j.getAttribute(ui);_.setState("value",P||void 0)}function $(){var j,P,Z,Q;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let ae of r.current){let ce=(P=(j=o.current.get(ae))==null?void 0:j.value)!=null?P:"",Re=(Q=(Z=o.current.get(ae))==null?void 0:Z.keywords)!=null?Q:[],ie=D(ce,Re);n.current.filtered.items.set(ae,ie),ie>0&&oe++}for(let[ae,ce]of a.current)for(let Re of ce)if(n.current.filtered.items.get(Re)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=oe}function B(){var j,P,Z;let Q=W();Q&&(((j=Q.parentElement)==null?void 0:j.firstChild)===Q&&((Z=(P=Q.closest(cc))==null?void 0:P.querySelector($re))==null||Z.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function W(){var j;return(j=N.current)==null?void 0:j.querySelector(`${zT}[aria-selected="true"]`)}function K(){var j;return Array.from(((j=N.current)==null?void 0:j.querySelectorAll(AO))||[])}function G(j){let P=K()[j];P&&_.setState("value",P.getAttribute(ui))}function H(j){var P;let Z=W(),Q=K(),oe=Q.findIndex(ce=>ce===Z),ae=Q[oe+j];(P=l.current)!=null&&P.loop&&(ae=oe+j<0?Q[Q.length-1]:oe+j===Q.length?Q[0]:Q[oe+j]),ae&&_.setState("value",ae.getAttribute(ui))}function F(j){let P=W(),Z=P==null?void 0:P.closest(cc),Q;for(;Z&&!Q;)Z=j>0?eae(Z,cc):tae(Z,cc),Q=Z==null?void 0:Z.querySelector(AO);Q?_.setState("value",Q.getAttribute(ui)):H(j)}let Y=()=>G(K().length-1),L=j=>{j.preventDefault(),j.metaKey?Y():j.altKey?F(1):H(1)},V=j=>{j.preventDefault(),j.metaKey?G(0):j.altKey?F(-1):H(-1)};return w.createElement(Je.div,{ref:t,tabIndex:-1,...T,"cmdk-root":"",onKeyDown:j=>{var P;if((P=T.onKeyDown)==null||P.call(T,j),!j.defaultPrevented)switch(j.key){case"n":case"j":{x&&j.ctrlKey&&L(j);break}case"ArrowDown":{L(j);break}case"p":case"k":{x&&j.ctrlKey&&V(j);break}case"ArrowUp":{V(j);break}case"Home":{j.preventDefault(),G(0);break}case"End":{j.preventDefault(),Y();break}case"Enter":if(!j.nativeEvent.isComposing&&j.keyCode!==229){j.preventDefault();let Z=W();if(Z){let Q=new Event(nk);Z.dispatchEvent(Q)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:aae},u),Tp(e,j=>w.createElement(w5.Provider,{value:_},w.createElement(E5.Provider,{value:M},j))))}),Vre=w.forwardRef((e,t)=>{var n,r;let a=An(),o=w.useRef(null),s=w.useContext(x5),l=au(),u=T5(e),d=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Si(()=>{if(!d)return l.item(a,s==null?void 0:s.id)},[d]);let p=A5(a,o,[e.value,e.children,o],e.keywords),g=BT(),m=Ei(C=>C.value&&C.value===p.current),b=Ei(C=>d||l.filter()===!1?!0:C.search?C.filtered.items.get(a)>0:!0);w.useEffect(()=>{let C=o.current;if(!(!C||e.disabled))return C.addEventListener(nk,y),()=>C.removeEventListener(nk,y)},[b,e.onSelect,e.disabled]);function y(){var C,_;v(),(_=(C=u.current).onSelect)==null||_.call(C,p.current)}function v(){g.setState("value",p.current,!0)}if(!b)return null;let{disabled:x,value:T,onSelect:k,forceMount:R,keywords:O,...N}=e;return w.createElement(Je.div,{ref:Rc([o,t]),...N,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!m,"data-disabled":!!x,"data-selected":!!m,onPointerMove:x||l.getDisablePointerSelection()?void 0:v,onClick:x?void 0:y},e.children)}),Wre=w.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,s=An(),l=w.useRef(null),u=w.useRef(null),d=An(),p=au(),g=Ei(b=>a||p.filter()===!1?!0:b.search?b.filtered.groups.has(s):!0);Si(()=>p.group(s),[]),A5(s,l,[e.value,e.heading,u]);let m=w.useMemo(()=>({id:s,forceMount:a}),[a]);return w.createElement(Je.div,{ref:Rc([l,t]),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&w.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Tp(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},w.createElement(x5.Provider,{value:m},b))))}),Yre=w.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=w.useRef(null),o=Ei(s=>!s.search);return!n&&!o?null:w.createElement(Je.div,{ref:Rc([a,t]),...r,"cmdk-separator":"",role:"separator"})}),Kre=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=BT(),s=Ei(p=>p.search),l=Ei(p=>p.value),u=au(),d=w.useMemo(()=>{var p;let g=(p=u.listInnerRef.current)==null?void 0:p.querySelector(`${zT}[${ui}="${encodeURIComponent(l)}"]`);return g==null?void 0:g.getAttribute("id")},[]);return w.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),w.createElement(Je.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":d,id:u.inputId,type:"text",value:a?e.value:s,onChange:p=>{a||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),Xre=w.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,o=w.useRef(null),s=w.useRef(null),l=au();return w.useEffect(()=>{if(s.current&&o.current){let u=s.current,d=o.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return g.observe(u),()=>{cancelAnimationFrame(p),g.unobserve(u)}}},[]),w.createElement(Je.div,{ref:Rc([o,t]),...a,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},Tp(e,u=>w.createElement("div",{ref:Rc([s,l.listInnerRef]),"cmdk-list-sizer":""},u)))}),Zre=w.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:s,...l}=e;return w.createElement(Xk,{open:n,onOpenChange:r},w.createElement(Zk,{container:s},w.createElement(ap,{"cmdk-overlay":"",className:a}),w.createElement(op,{"aria-label":e.label,"cmdk-dialog":"",className:o},w.createElement(k5,{ref:t,...l}))))}),Qre=w.forwardRef((e,t)=>Ei(n=>n.filtered.count===0)?w.createElement(Je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Jre=w.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return w.createElement(Je.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Tp(e,s=>w.createElement("div",{"aria-hidden":!0},s)))}),qn=Object.assign(k5,{List:Xre,Item:Vre,Input:Kre,Group:Wre,Separator:Yre,Dialog:Zre,Empty:Qre,Loading:Jre});function eae(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function tae(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function T5(e){let t=w.useRef(e);return Si(()=>{t.current=e}),t}var Si=typeof window>"u"?w.useEffect:w.useLayoutEffect;function Es(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function Rc(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ei(e){let t=BT(),n=()=>e(t.snapshot());return Hre.useSyncExternalStore(t.subscribe,n,n)}function A5(e,t,n,r=[]){let a=w.useRef(),o=au();return Si(()=>{var s;let l=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():a.current}})(),u=r.map(d=>d.trim());o.value(e,l,u),(s=t.current)==null||s.setAttribute(ui,l),a.current=l}),a}var nae=()=>{let[e,t]=w.useState(),n=Es(()=>new Map);return Si(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function rae(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Tp({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(rae(t),{ref:t.ref},n(t.props.children)):n(t)}var aae={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ap=w.forwardRef(({className:e,...t},n)=>E.jsx(qn,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));Ap.displayName=qn.displayName;const jT=w.forwardRef(({className:e,...t},n)=>E.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[E.jsx(KZ,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),E.jsx(qn.Input,{ref:n,className:Me("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));jT.displayName=qn.Input.displayName;const Rp=w.forwardRef(({className:e,...t},n)=>E.jsx(qn.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));Rp.displayName=qn.List.displayName;const UT=w.forwardRef((e,t)=>E.jsx(qn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));UT.displayName=qn.Empty.displayName;const el=w.forwardRef(({className:e,...t},n)=>E.jsx(qn.Group,{ref:n,className:Me("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}));el.displayName=qn.Group.displayName;const oae=w.forwardRef(({className:e,...t},n)=>E.jsx(qn.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));oae.displayName=qn.Separator.displayName;const tl=w.forwardRef(({className:e,...t},n)=>E.jsx(qn.Item,{ref:n,className:Me("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));tl.displayName=qn.Item.displayName;const iae=({layout:e,autoRunFor:t,mainLayout:n})=>{const r=Ar(),[a,o]=w.useState(!1),s=w.useRef(null),{t:l}=Et(),u=w.useCallback(()=>{if(r)try{const p=r.getGraph();if(!p||p.order===0)return;const g=n.positions();q4(p,g,{duration:300})}catch(p){console.error("Error updating positions:",p),s.current&&(window.clearInterval(s.current),s.current=null,o(!1))}},[r,n]),d=w.useCallback(()=>{if(a){console.log("Stopping layout animation"),s.current&&(window.clearInterval(s.current),s.current=null);try{typeof e.kill=="function"?(e.kill(),console.log("Layout algorithm killed")):typeof e.stop=="function"&&(e.stop(),console.log("Layout algorithm stopped"))}catch(p){console.error("Error stopping layout algorithm:",p)}o(!1)}else console.log("Starting layout animation"),u(),s.current=window.setInterval(()=>{u()},200),o(!0),setTimeout(()=>{if(s.current){console.log("Auto-stopping layout animation after 3 seconds"),window.clearInterval(s.current),s.current=null,o(!1);try{typeof e.kill=="function"?e.kill():typeof e.stop=="function"&&e.stop()}catch(p){console.error("Error stopping layout algorithm:",p)}}},3e3)},[a,e,u]);return w.useEffect(()=>{if(!r){console.log("No sigma instance available");return}let p=null;return t!==void 0&&t>-1&&r.getGraph().order>0&&(console.log("Auto-starting layout animation"),u(),s.current=window.setInterval(()=>{u()},200),o(!0),t>0&&(p=window.setTimeout(()=>{console.log("Auto-stopping layout animation after timeout"),s.current&&(window.clearInterval(s.current),s.current=null),o(!1)},t))),()=>{s.current&&(window.clearInterval(s.current),s.current=null),p&&window.clearTimeout(p),o(!1)}},[t,r,u]),E.jsx(nt,{size:"icon",onClick:d,tooltip:l(a?"graphPanel.sideBar.layoutsControl.stopAnimation":"graphPanel.sideBar.layoutsControl.startAnimation"),variant:wr,children:a?E.jsx(zZ,{}):E.jsx(jZ,{})})},sae=()=>{const e=Ar(),{t}=Et(),[n,r]=w.useState("Circular"),[a,o]=w.useState(!1),s=Ie.use.graphLayoutMaxIterations(),l=ere(),u=Xne(),d=Ore(),p=Are({maxIterations:s,settings:{margin:5,expansion:1.1,gridSize:1,ratio:1,speed:3}}),g=sre({maxIterations:s,settings:{attraction:3e-4,repulsion:.02,gravity:.02,inertia:.4,maxMove:100}}),m=b5({iterations:s}),b=Rre(),y=lre(),v=bre(),x=w.useMemo(()=>({Circular:{layout:l},Circlepack:{layout:u},Random:{layout:d},Noverlaps:{layout:p,worker:b},"Force Directed":{layout:g,worker:y},"Force Atlas":{layout:m,worker:v}}),[u,l,g,m,p,d,y,b,v]),T=w.useCallback(k=>{console.debug("Running layout:",k);const{positions:R}=x[k].layout;try{const O=e.getGraph();if(!O){console.error("No graph available");return}const N=R();console.log("Positions calculated, animating nodes"),q4(O,N,{duration:400}),r(k)}catch(O){console.error("Error running layout:",O)}},[x,e]);return E.jsxs("div",{children:[E.jsx("div",{children:x[n]&&"worker"in x[n]&&E.jsx(iae,{layout:x[n].worker,mainLayout:x[n].layout})}),E.jsx("div",{children:E.jsxs(mp,{open:a,onOpenChange:o,children:[E.jsx(bp,{asChild:!0,children:E.jsx(nt,{size:"icon",variant:wr,onClick:()=>o(k=>!k),tooltip:t("graphPanel.sideBar.layoutsControl.layoutGraph"),children:E.jsx(TZ,{})})}),E.jsx(Zc,{side:"right",align:"start",sideOffset:8,collisionPadding:5,sticky:"always",className:"p-1 min-w-auto",children:E.jsx(Ap,{children:E.jsx(Rp,{children:E.jsx(el,{children:Object.keys(x).map(k=>E.jsx(tl,{onSelect:()=>{T(k)},className:"cursor-pointer text-xs",children:t(`graphPanel.sideBar.layoutsControl.layouts.${k}`)},k))})})})})]})})]})},R5=()=>{const e=w.useContext(nj);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Md=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),lae=({disableHoverEffect:e})=>{const t=Ar(),n=X4(),r=K4(),a=Ie.use.graphLayoutMaxIterations(),{assign:o}=b5({iterations:a}),{theme:s}=R5(),l=Ie.use.enableHideUnselectedEdges(),u=Ie.use.enableEdgeEvents(),d=Ie.use.showEdgeLabel(),p=Ie.use.showNodeLabel(),g=Ie.use.minEdgeSize(),m=Ie.use.maxEdgeSize(),b=Fe.use.selectedNode(),y=Fe.use.focusedNode(),v=Fe.use.selectedEdge(),x=Fe.use.focusedEdge(),T=Fe.use.sigmaGraph();return w.useEffect(()=>{if(T&&t){try{typeof t.setGraph=="function"?(t.setGraph(T),console.log("Binding graph to sigma instance")):(t.graph=T,console.warn("Simgma missing setGraph function, set graph property directly"))}catch(k){console.error("Error setting graph on sigma instance:",k)}o(),console.log("Initial layout applied to graph")}},[t,T,o,a]),w.useEffect(()=>{t&&(Fe.getState().sigmaInstance||(console.log("Setting sigma instance from GraphControl"),Fe.getState().setSigmaInstance(t)))},[t]),w.useEffect(()=>{const{setFocusedNode:k,setSelectedNode:R,setFocusedEdge:O,setSelectedEdge:N,clearSelection:C}=Fe.getState(),_={enterNode:M=>{Md(M.event.original)||k(M.node)},leaveNode:M=>{Md(M.event.original)||k(null)},clickNode:M=>{R(M.node),N(null)},clickStage:()=>C()};u&&(_.clickEdge=M=>{N(M.edge),R(null)},_.enterEdge=M=>{Md(M.event.original)||O(M.edge)},_.leaveEdge=M=>{Md(M.event.original)||O(null)}),n(_)},[n,u]),w.useEffect(()=>{if(t&&T){const k=t.getGraph();let R=Number.MAX_SAFE_INTEGER,O=0;k.forEachEdge(C=>{const _=k.getEdgeAttribute(C,"originalWeight")||1;typeof _=="number"&&(R=Math.min(R,_),O=Math.max(O,_))});const N=O-R;if(N>0){const C=m-g;k.forEachEdge(_=>{const M=k.getEdgeAttribute(_,"originalWeight")||1;if(typeof M=="number"){const D=g+C*Math.pow((M-R)/N,.5);k.setEdgeAttribute(_,"size",D)}})}else k.forEachEdge(C=>{k.setEdgeAttribute(C,"size",g)});t.refresh()}},[t,T,g,m]),w.useEffect(()=>{const k=s==="dark",R=k?cV:void 0,O=k?pV:void 0;r({enableEdgeEvents:u,renderEdgeLabels:d,renderLabels:p,nodeReducer:(N,C)=>{const _=t.getGraph(),M={...C,highlighted:C.highlighted||!1,labelColor:R};if(!e){M.highlighted=!1;const D=y||b,I=x||v;if(D&&_.hasNode(D))try{(N===D||_.neighbors(D).includes(N))&&(M.highlighted=!0,N===b&&(M.borderColor=fV))}catch(U){console.error("Error in nodeReducer:",U)}else if(I&&_.hasEdge(I))_.extremities(I).includes(N)&&(M.highlighted=!0,M.size=3);else return M;M.highlighted?k&&(M.labelColor=uV):M.color=dV}return M},edgeReducer:(N,C)=>{const _=t.getGraph(),M={...C,hidden:!1,labelColor:R,color:O};if(!e){const D=y||b;if(D&&_.hasNode(D))try{l?_.extremities(N).includes(D)||(M.hidden=!0):_.extremities(N).includes(D)&&(M.color=P_)}catch(I){console.error("Error in edgeReducer:",I)}else{const I=v&&_.hasEdge(v)?v:null,U=x&&_.hasEdge(x)?x:null;(I||U)&&(N===I?M.color=gV:N===U?M.color=P_:l&&(M.hidden=!0))}}return M}})},[b,y,v,x,r,t,e,s,l,u,d,p]),null},cae=()=>{const{zoomIn:e,zoomOut:t,reset:n}=Z4({duration:200,factor:1.5}),r=Ar(),{t:a}=Et(),o=w.useCallback(()=>e(),[e]),s=w.useCallback(()=>t(),[t]),l=w.useCallback(()=>{if(r)try{r.setCustomBBox(null),r.refresh();const p=r.getGraph();if(!(p!=null&&p.order)||p.nodes().length===0){n();return}r.getCamera().animate({x:.5,y:.5,ratio:1.1},{duration:1e3})}catch(p){console.error("Error resetting zoom:",p),n()}},[r,n]),u=w.useCallback(()=>{if(!r)return;const p=r.getCamera(),m=p.angle+Math.PI/8;p.animate({angle:m},{duration:200})},[r]),d=w.useCallback(()=>{if(!r)return;const p=r.getCamera(),m=p.angle-Math.PI/8;p.animate({angle:m},{duration:200})},[r]);return E.jsxs(E.Fragment,{children:[E.jsx(nt,{variant:wr,onClick:d,tooltip:a("graphPanel.sideBar.zoomControl.rotateCameraCounterClockwise"),size:"icon",children:E.jsx(HZ,{})}),E.jsx(nt,{variant:wr,onClick:u,tooltip:a("graphPanel.sideBar.zoomControl.rotateCamera"),size:"icon",children:E.jsx(qZ,{})}),E.jsx(nt,{variant:wr,onClick:l,tooltip:a("graphPanel.sideBar.zoomControl.resetZoom"),size:"icon",children:E.jsx(vZ,{})}),E.jsx(nt,{variant:wr,onClick:o,tooltip:a("graphPanel.sideBar.zoomControl.zoomIn"),size:"icon",children:E.jsx(sQ,{})}),E.jsx(nt,{variant:wr,onClick:s,tooltip:a("graphPanel.sideBar.zoomControl.zoomOut"),size:"icon",children:E.jsx(cQ,{})})]})},uae=()=>{const{isFullScreen:e,toggle:t}=Vte(),{t:n}=Et();return E.jsx(E.Fragment,{children:e?E.jsx(nt,{variant:wr,onClick:t,tooltip:n("graphPanel.sideBar.fullScreenControl.windowed"),size:"icon",children:E.jsx(LZ,{})}):E.jsx(nt,{variant:wr,onClick:t,tooltip:n("graphPanel.sideBar.fullScreenControl.fullScreen"),size:"icon",children:E.jsx(IZ,{})})})};var GT="Checkbox",[dae,y0e]=$r(GT),[fae,pae]=dae(GT),C5=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:s,disabled:l,value:u="on",onCheckedChange:d,form:p,...g}=e,[m,b]=w.useState(null),y=mt(t,O=>b(O)),v=w.useRef(!1),x=m?p||!!m.closest("form"):!0,[T=!1,k]=ja({prop:a,defaultProp:o,onChange:d}),R=w.useRef(T);return w.useEffect(()=>{const O=m==null?void 0:m.form;if(O){const N=()=>k(R.current);return O.addEventListener("reset",N),()=>O.removeEventListener("reset",N)}},[m,k]),E.jsxs(fae,{scope:n,state:T,disabled:l,children:[E.jsx(Je.button,{type:"button",role:"checkbox","aria-checked":Ro(T)?"mixed":T,"aria-required":s,"data-state":O5(T),"data-disabled":l?"":void 0,disabled:l,value:u,...g,ref:y,onKeyDown:Ke(e.onKeyDown,O=>{O.key==="Enter"&&O.preventDefault()}),onClick:Ke(e.onClick,O=>{k(N=>Ro(N)?!0:!N),x&&(v.current=O.isPropagationStopped(),v.current||O.stopPropagation())})}),x&&E.jsx(gae,{control:m,bubbles:!v.current,name:r,value:u,checked:T,required:s,disabled:l,form:p,style:{transform:"translateX(-100%)"},defaultChecked:Ro(o)?!1:o})]})});C5.displayName=GT;var _5="CheckboxIndicator",N5=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=pae(_5,n);return E.jsx(ir,{present:r||Ro(o.state)||o.state===!0,children:E.jsx(Je.span,{"data-state":O5(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});N5.displayName=_5;var gae=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:a,...o}=e,s=w.useRef(null),l=o3(n),u=pU(t);w.useEffect(()=>{const p=s.current,g=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(g,"checked").set;if(l!==n&&b){const y=new Event("click",{bubbles:r});p.indeterminate=Ro(n),b.call(p,Ro(n)?!1:n),p.dispatchEvent(y)}},[l,n,r]);const d=w.useRef(Ro(n)?!1:n);return E.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??d.current,...o,tabIndex:-1,ref:s,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ro(e){return e==="indeterminate"}function O5(e){return Ro(e)?"indeterminate":e?"checked":"unchecked"}var I5=C5,hae=N5;const Ns=w.forwardRef(({className:e,...t},n)=>E.jsx(I5,{ref:n,className:Me("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-muted data-[state=checked]:text-muted-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:E.jsx(hae,{className:Me("flex items-center justify-center text-current"),children:E.jsx(yT,{className:"h-4 w-4"})})}));Ns.displayName=I5.displayName;var mae="Separator",RO="horizontal",bae=["horizontal","vertical"],D5=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=RO,...a}=e,o=yae(r)?r:RO,l=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return E.jsx(Je.div,{"data-orientation":o,...l,...a,ref:t})});D5.displayName=mae;function yae(e){return bae.includes(e)}var L5=D5;const ws=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>E.jsx(L5,{ref:a,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ws.displayName=L5.displayName;const vo=({checked:e,onCheckedChange:t,label:n})=>{const r=`checkbox-${n.toLowerCase().replace(/\s+/g,"-")}`;return E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(Ns,{id:r,checked:e,onCheckedChange:t}),E.jsx("label",{htmlFor:r,className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]})},tb=({value:e,onEditFinished:t,label:n,min:r,max:a,defaultValue:o})=>{const{t:s}=Et(),[l,u]=w.useState(e),d=`input-${n.toLowerCase().replace(/\s+/g,"-")}`,p=w.useCallback(b=>{const y=b.target.value.trim();if(y.length===0){u(null);return}const v=Number.parseInt(y);if(!isNaN(v)&&v!==l){if(r!==void 0&&va)return;u(v)}},[l,r,a]),g=w.useCallback(()=>{l!==null&&e!==l&&t(l)},[e,l,t]),m=w.useCallback(()=>{o!==void 0&&e!==o&&(u(o),t(o))},[o,e,t]);return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{htmlFor:d,className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n}),E.jsxs("div",{className:"flex items-center gap-1",children:[E.jsx(Tr,{id:d,type:"number",value:l===null?"":l,onChange:p,className:"h-6 w-full min-w-0 pr-1",min:r,max:a,onBlur:g,onKeyDown:b=>{b.key==="Enter"&&g()}}),o!==void 0&&E.jsx(nt,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 hover:bg-muted text-muted-foreground hover:text-foreground",onClick:m,type:"button",title:s("graphPanel.sideBar.settings.resetToDefault"),children:E.jsx(GU,{className:"h-3.5 w-3.5"})})]})]})};function vae(){const[e,t]=w.useState(!1),n=Ie.use.showPropertyPanel(),r=Ie.use.showNodeSearchBar(),a=Ie.use.showNodeLabel(),o=Ie.use.enableEdgeEvents(),s=Ie.use.enableNodeDrag(),l=Ie.use.enableHideUnselectedEdges(),u=Ie.use.showEdgeLabel(),d=Ie.use.minEdgeSize(),p=Ie.use.maxEdgeSize(),g=Ie.use.graphQueryMaxDepth(),m=Ie.use.graphMaxNodes(),b=Ie.use.graphLayoutMaxIterations(),y=Ie.use.enableHealthCheck(),v=w.useCallback(()=>Ie.setState($=>({enableNodeDrag:!$.enableNodeDrag})),[]),x=w.useCallback(()=>Ie.setState($=>({enableEdgeEvents:!$.enableEdgeEvents})),[]),T=w.useCallback(()=>Ie.setState($=>({enableHideUnselectedEdges:!$.enableHideUnselectedEdges})),[]),k=w.useCallback(()=>Ie.setState($=>({showEdgeLabel:!$.showEdgeLabel})),[]),R=w.useCallback(()=>Ie.setState($=>({showPropertyPanel:!$.showPropertyPanel})),[]),O=w.useCallback(()=>Ie.setState($=>({showNodeSearchBar:!$.showNodeSearchBar})),[]),N=w.useCallback(()=>Ie.setState($=>({showNodeLabel:!$.showNodeLabel})),[]),C=w.useCallback(()=>Ie.setState($=>({enableHealthCheck:!$.enableHealthCheck})),[]),_=w.useCallback($=>{if($<1)return;Ie.setState({graphQueryMaxDepth:$});const B=Ie.getState().queryLabel;Ie.getState().setQueryLabel(""),setTimeout(()=>{Ie.getState().setQueryLabel(B)},300)},[]),M=w.useCallback($=>{if($<1||$>1e3)return;Ie.setState({graphMaxNodes:$});const B=Ie.getState().queryLabel;Ie.getState().setQueryLabel(""),setTimeout(()=>{Ie.getState().setQueryLabel(B)},300)},[]),D=w.useCallback($=>{$<1||Ie.setState({graphLayoutMaxIterations:$})},[]),{t:I}=Et(),U=()=>t(!1);return E.jsx(E.Fragment,{children:E.jsxs(mp,{open:e,onOpenChange:t,children:[E.jsx(bp,{asChild:!0,children:E.jsx(nt,{variant:wr,tooltip:I("graphPanel.sideBar.settings.settings"),size:"icon",children:E.jsx(JZ,{})})}),E.jsx(Zc,{side:"right",align:"end",sideOffset:8,collisionPadding:5,className:"p-2 max-w-[200px]",onCloseAutoFocus:$=>$.preventDefault(),children:E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx(vo,{checked:y,onCheckedChange:C,label:I("graphPanel.sideBar.settings.healthCheck")}),E.jsx(ws,{}),E.jsx(vo,{checked:n,onCheckedChange:R,label:I("graphPanel.sideBar.settings.showPropertyPanel")}),E.jsx(vo,{checked:r,onCheckedChange:O,label:I("graphPanel.sideBar.settings.showSearchBar")}),E.jsx(ws,{}),E.jsx(vo,{checked:a,onCheckedChange:N,label:I("graphPanel.sideBar.settings.showNodeLabel")}),E.jsx(vo,{checked:s,onCheckedChange:v,label:I("graphPanel.sideBar.settings.nodeDraggable")}),E.jsx(ws,{}),E.jsx(vo,{checked:u,onCheckedChange:k,label:I("graphPanel.sideBar.settings.showEdgeLabel")}),E.jsx(vo,{checked:l,onCheckedChange:T,label:I("graphPanel.sideBar.settings.hideUnselectedEdges")}),E.jsx(vo,{checked:o,onCheckedChange:x,label:I("graphPanel.sideBar.settings.edgeEvents")}),E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{htmlFor:"edge-size-min",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:I("graphPanel.sideBar.settings.edgeSizeRange")}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(Tr,{id:"edge-size-min",type:"number",value:d,onChange:$=>{const B=Number($.target.value);!isNaN(B)&&B>=1&&B<=p&&Ie.setState({minEdgeSize:B})},className:"h-6 w-16 min-w-0 pr-1",min:1,max:Math.min(p,10)}),E.jsx("span",{children:"-"}),E.jsxs("div",{className:"flex items-center gap-1",children:[E.jsx(Tr,{id:"edge-size-max",type:"number",value:p,onChange:$=>{const B=Number($.target.value);!isNaN(B)&&B>=d&&B>=1&&B<=10&&Ie.setState({maxEdgeSize:B})},className:"h-6 w-16 min-w-0 pr-1",min:d,max:10}),E.jsx(nt,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 hover:bg-muted text-muted-foreground hover:text-foreground",onClick:()=>Ie.setState({minEdgeSize:1,maxEdgeSize:5}),type:"button",title:I("graphPanel.sideBar.settings.resetToDefault"),children:E.jsx(GU,{className:"h-3.5 w-3.5"})})]})]})]}),E.jsx(ws,{}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxQueryDepth"),min:1,value:g,defaultValue:3,onEditFinished:_}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxNodes"),min:1,max:1e3,value:m,defaultValue:1e3,onEditFinished:M}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxLayoutIterations"),min:1,max:30,value:b,defaultValue:15,onEditFinished:D}),E.jsx(ws,{}),E.jsx(nt,{onClick:U,variant:"outline",size:"sm",className:"ml-auto px-4",children:I("graphPanel.sideBar.settings.save")})]})})]})})}const Sae="ENTRIES",M5="KEYS",P5="VALUES",yn="";class nb{constructor(t,n){const r=t._tree,a=Array.from(r.keys());this.set=t,this._type=n,this._path=a.length>0?[{node:r,keys:a}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=hs(this._path);if(hs(n)===yn)return{done:!1,value:this.result()};const r=t.get(hs(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=hs(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>hs(t)).filter(t=>t!==yn).join("")}value(){return hs(this._path).node.get(yn)}result(){switch(this._type){case P5:return this.value();case M5:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const hs=e=>e[e.length-1],Eae=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const a=t.length+1,o=a+n,s=new Uint8Array(o*a).fill(n+1);for(let l=0;l{const u=o*s;e:for(const d of e.keys())if(d===yn){const p=a[u-1];p<=n&&r.set(l,[e.get(d),p])}else{let p=o;for(let g=0;gn)continue e}F5(e.get(d),t,n,r,a,p,s,l+d)}};class To{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Nf(this._tree,t.slice(this._prefix.length));if(n===void 0){const[a,o]=HT(r);for(const s of a.keys())if(s!==yn&&s.startsWith(o)){const l=new Map;return l.set(s.slice(o.length),a.get(s)),new To(l,t)}}return new To(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,wae(this._tree,t)}entries(){return new nb(this,Sae)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return Eae(this._tree,t,n)}get(t){const n=rk(this._tree,t);return n!==void 0?n.get(yn):void 0}has(t){const n=rk(this._tree,t);return n!==void 0&&n.has(yn)}keys(){return new nb(this,M5)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,rb(this._tree,t).set(yn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rb(this._tree,t);return r.set(yn,n(r.get(yn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rb(this._tree,t);let a=r.get(yn);return a===void 0&&r.set(yn,a=n()),a}values(){return new nb(this,P5)}[Symbol.iterator](){return this.entries()}static from(t){const n=new To;for(const[r,a]of t)n.set(r,a);return n}static fromObject(t){return To.from(Object.entries(t))}}const Nf=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==yn&&t.startsWith(r))return n.push([e,r]),Nf(e.get(r),t.slice(r.length),n);return n.push([e,t]),Nf(void 0,"",n)},rk=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==yn&&t.startsWith(n))return rk(e.get(n),t.slice(n.length))},rb=(e,t)=>{const n=t.length;e:for(let r=0;e&&r{const[n,r]=Nf(e,t);if(n!==void 0){if(n.delete(yn),n.size===0)z5(r);else if(n.size===1){const[a,o]=n.entries().next().value;B5(r,a,o)}}},z5=e=>{if(e.length===0)return;const[t,n]=HT(e);if(t.delete(n),t.size===0)z5(e.slice(0,-1));else if(t.size===1){const[r,a]=t.entries().next().value;r!==yn&&B5(e.slice(0,-1),r,a)}},B5=(e,t,n)=>{if(e.length===0)return;const[r,a]=HT(e);r.set(a+t,n),r.delete(a)},HT=e=>e[e.length-1],$T="or",j5="and",xae="and_not";class Co{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?ib:t.autoVacuum;this._options={...ob,...t,autoVacuum:n,searchOptions:{...CO,...t.searchOptions||{}},autoSuggestOptions:{...Cae,...t.autoSuggestOptions||{}}},this._index=new To,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=ok,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:a,fields:o,idField:s}=this._options,l=n(t,s);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);if(this._idToShortId.has(l))throw new Error(`MiniSearch: duplicate ID ${l}`);const u=this.addDocumentId(l);this.saveStoredFields(u,t);for(const d of o){const p=n(t,d);if(p==null)continue;const g=r(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.addFieldLength(u,m,this._documentCount-1,b);for(const y of g){const v=a(y,d);if(Array.isArray(v))for(const x of v)this.addTerm(m,u,x);else v&&this.addTerm(m,u,v)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,a={chunk:[],promise:Promise.resolve()},{chunk:o,promise:s}=t.reduce(({chunk:l,promise:u},d,p)=>(l.push(d),(p+1)%r===0?{chunk:[],promise:u.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(l))}:{chunk:l,promise:u}),a);return s.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:a,fields:o,idField:s}=this._options,l=a(t,s);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);const u=this._idToShortId.get(l);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${l}: it is not in the index`);for(const d of o){const p=a(t,d);if(p==null)continue;const g=n(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.removeFieldLength(u,m,this._documentCount,b);for(const y of g){const v=r(y,d);if(Array.isArray(v))for(const x of v)this.removeTerm(m,u,x);else v&&this.removeTerm(m,u,v)}}this._storedFields.delete(u),this._documentIds.delete(u),this._idToShortId.delete(l),this._fieldLength.delete(u),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new To,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,a)=>{this.removeFieldLength(n,a,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:a}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:a},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,a=r(t,n);this.discard(a),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=ok,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const a=t.batchSize||ak.batchSize,o=t.batchWait||ak.batchWait;let s=1;for(const[l,u]of this._index){for(const[d,p]of u)for(const[g]of p)this._documentIds.has(g)||(p.size<=1?u.delete(d):p.delete(g));this._index.get(l).size===0&&this._index.delete(l),s%a===0&&await new Promise(d=>setTimeout(d,o)),s+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||ib.minDirtCount,r=r||ib.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,a={...r,...n},o=this.executeQuery(t,n),s=[];for(const[l,{score:u,terms:d,match:p}]of o){const g=d.length||1,m={id:this._documentIds.get(l),score:u*g,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(m,this._storedFields.get(l)),(a.filter==null||a.filter(m))&&s.push(m)}return t===Co.wildcard&&a.boostDocument==null||s.sort(NO),s}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:o,terms:s}of this.search(t,n)){const l=s.join(" "),u=r.get(l);u!=null?(u.score+=o,u.count+=1):r.set(l,{score:o,terms:s,count:1})}const a=[];for(const[o,{score:s,terms:l,count:u}]of r)a.push({suggestion:o,terms:l,score:s/u});return a.sort(NO),a}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)}static getDefault(t){if(ob.hasOwnProperty(t))return ab(ob,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:a,fieldLength:o,storedFields:s,serializationVersion:l}=t,u=this.instantiateMiniSearch(t,n);u._documentIds=Pd(a),u._fieldLength=Pd(o),u._storedFields=Pd(s);for(const[d,p]of u._documentIds)u._idToShortId.set(p,d);for(const[d,p]of r){const g=new Map;for(const m of Object.keys(p)){let b=p[m];l===1&&(b=b.ds),g.set(parseInt(m,10),Pd(b))}u._index.set(d,g)}return u}static async loadJSAsync(t,n){const{index:r,documentIds:a,fieldLength:o,storedFields:s,serializationVersion:l}=t,u=this.instantiateMiniSearch(t,n);u._documentIds=await Fd(a),u._fieldLength=await Fd(o),u._storedFields=await Fd(s);for(const[p,g]of u._documentIds)u._idToShortId.set(g,p);let d=0;for(const[p,g]of r){const m=new Map;for(const b of Object.keys(g)){let y=g[b];l===1&&(y=y.ds),m.set(parseInt(b,10),await Fd(y))}++d%1e3===0&&await U5(0),u._index.set(p,m)}return u}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:a,fieldIds:o,averageFieldLength:s,dirtCount:l,serializationVersion:u}=t;if(u!==1&&u!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new Co(n);return d._documentCount=r,d._nextId=a,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=s,d._dirtCount=l||0,d._index=new To,d}executeQuery(t,n={}){if(t===Co.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const m={...n,...t,queries:void 0},b=t.queries.map(y=>this.executeQuery(y,m));return this.combineResults(b,m.combineWith)}const{tokenize:r,processTerm:a,searchOptions:o}=this._options,s={tokenize:r,processTerm:a,...o,...n},{tokenize:l,processTerm:u}=s,g=l(t).flatMap(m=>u(m)).filter(m=>!!m).map(Rae(s)).map(m=>this.executeQuerySpec(m,s));return this.combineResults(g,s.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},a=(r.fields||this._options.fields).reduce((v,x)=>({...v,[x]:ab(r.boost,x)||1}),{}),{boostDocument:o,weights:s,maxFuzzy:l,bm25:u}=r,{fuzzy:d,prefix:p}={...CO.weights,...s},g=this._index.get(t.term),m=this.termResults(t.term,t.term,1,t.termBoost,g,a,o,u);let b,y;if(t.prefix&&(b=this._index.atPrefix(t.term)),t.fuzzy){const v=t.fuzzy===!0?.2:t.fuzzy,x=v<1?Math.min(l,Math.round(t.term.length*v)):v;x&&(y=this._index.fuzzyGet(t.term,x))}if(b)for(const[v,x]of b){const T=v.length-t.term.length;if(!T)continue;y==null||y.delete(v);const k=p*v.length/(v.length+.3*T);this.termResults(t.term,v,k,t.termBoost,x,a,o,u,m)}if(y)for(const v of y.keys()){const[x,T]=y.get(v);if(!T)continue;const k=d*v.length/(v.length+T);this.termResults(t.term,v,k,t.termBoost,x,a,o,u,m)}return m}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[a,o]of this._documentIds){const s=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(a)):1;n.set(a,{score:s,terms:[],match:{}})}return n}combineResults(t,n=$T){if(t.length===0)return new Map;const r=n.toLowerCase(),a=kae[r];if(!a)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(a)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const a={};for(const[o,s]of r)a[o]=Object.fromEntries(s);t.push([n,a])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,a,o,s,l,u,d=new Map){if(o==null)return d;for(const p of Object.keys(s)){const g=s[p],m=this._fieldIds[p],b=o.get(m);if(b==null)continue;let y=b.size;const v=this._avgFieldLength[m];for(const x of b.keys()){if(!this._documentIds.has(x)){this.removeTerm(m,x,n),y-=1;continue}const T=l?l(this._documentIds.get(x),n,this._storedFields.get(x)):1;if(!T)continue;const k=b.get(x),R=this._fieldLength.get(x)[m],O=Aae(k,y,this._documentCount,R,v,u),N=r*a*g*T*O,C=d.get(x);if(C){C.score+=N,_ae(C.terms,t);const _=ab(C.match,n);_?_.push(p):C.match[n]=[p]}else d.set(x,{score:N,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const a=this._index.fetch(r,OO);let o=a.get(t);if(o==null)o=new Map,o.set(n,1),a.set(t,o);else{const s=o.get(n);o.set(n,(s||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const a=this._index.fetch(r,OO),o=a.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?a.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const a of Object.keys(this._fieldIds))if(this._fieldIds[a]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${a}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,kae={[$T]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:a,terms:o,match:s}=t.get(n);r.score=r.score+a,r.match=Object.assign(r.match,s),_O(r.terms,o)}}return e},[j5]:(e,t)=>{const n=new Map;for(const r of t.keys()){const a=e.get(r);if(a==null)continue;const{score:o,terms:s,match:l}=t.get(r);_O(a.terms,s),n.set(r,{score:a.score+o,terms:a.terms,match:Object.assign(a.match,l)})}return n},[xae]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},Tae={k:1.2,b:.7,d:.5},Aae=(e,t,n,r,a,o)=>{const{k:s,b:l,d:u}=o;return Math.log(1+(n-t+.5)/(t+.5))*(u+e*(s+1)/(e+s*(1-l+l*r/a)))},Rae=e=>(t,n,r)=>{const a=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,s=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:a,prefix:o,termBoost:s}},ob={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(Nae),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},CO={combineWith:$T,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Tae},Cae={combineWith:j5,prefix:(e,t,n)=>t===n.length-1},ak={batchSize:1e3,batchWait:10},ok={minDirtFactor:.1,minDirtCount:20},ib={...ak,...ok},_ae=(e,t)=>{e.includes(t)||e.push(t)},_O=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},NO=({score:e},{score:t})=>t-e,OO=()=>new Map,Pd=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Fd=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await U5(0);return t},U5=e=>new Promise(t=>setTimeout(t,e)),Nae=/[\n\r\p{Z}\p{P}]+/u,Oae={index:new Co({fields:[]})};w.createContext(Oae);const ik=({label:e,color:t,hidden:n,labels:r={}})=>we.createElement("div",{className:"node"},we.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),we.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),Iae=({id:e,labels:t})=>{const n=Ar(),r=w.useMemo(()=>{const a=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},a),o?o(e,a):{})},[n,e]);return we.createElement(ik,Object.assign({},r,{labels:t}))},Dae=({label:e,color:t,source:n,target:r,hidden:a,directed:o,labels:s={}})=>we.createElement("div",{className:"edge"},we.createElement(ik,Object.assign({},n,{labels:s})),we.createElement("div",{className:"body"},we.createElement("div",{className:"render"},we.createElement("span",{className:a?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&we.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),we.createElement("span",{className:`label ${a?"text-muted":""} ${e?"":"fst-italic"}`},e||s.no_label||"No label")),we.createElement(ik,Object.assign({},r,{labels:s}))),Lae=({id:e,labels:t})=>{const n=Ar(),r=w.useMemo(()=>{const a=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),s=n.getSetting("edgeReducer"),l=n.getGraph().getNodeAttributes(n.getGraph().source(e)),u=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},a),s?s(e,a):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},l),o?o(e,l):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{})})},[n,e]);return we.createElement(Dae,Object.assign({},r,{labels:t}))};function qT(e,t){const[n,r]=w.useState(e);return w.useEffect(()=>{const a=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(a)}},[e,t]),n}function Mae({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,notFound:o,loadingSkeleton:s,label:l,placeholder:u="Select...",value:d,onChange:p,onFocus:g,disabled:m=!1,className:b,noResultsMessage:y}){const[v,x]=w.useState(!1),[T,k]=w.useState(!1),[R,O]=w.useState([]),[N,C]=w.useState(!1),[_,M]=w.useState(null),[D,I]=w.useState(""),U=qT(D,t?0:150),$=w.useRef(null);w.useEffect(()=>{x(!0)},[]),w.useEffect(()=>{const H=F=>{$.current&&!$.current.contains(F.target)&&T&&k(!1)};return document.addEventListener("mousedown",H),()=>{document.removeEventListener("mousedown",H)}},[T]);const B=w.useCallback(async H=>{try{C(!0),M(null);const F=await e(H);O(F)}catch(F){M(F instanceof Error?F.message:"Failed to fetch options")}finally{C(!1)}},[e]);w.useEffect(()=>{v&&(t?U&&O(H=>H.filter(F=>n?n(F,U):!0)):B(U))},[v,U,t,n,B]),w.useEffect(()=>{!v||!d||B(d)},[v,d,B]);const W=w.useCallback(H=>{p(H),requestAnimationFrame(()=>{const F=document.activeElement;F==null||F.blur(),k(!1)})},[p]),K=w.useCallback(()=>{k(!0),B(D)},[D,B]),G=w.useCallback(H=>{H.target.closest(".cmd-item")&&H.preventDefault()},[]);return E.jsx("div",{ref:$,className:Me(m&&"cursor-not-allowed opacity-50",b),onMouseDown:G,children:E.jsxs(Ap,{shouldFilter:!1,className:"bg-transparent",children:[E.jsxs("div",{children:[E.jsx(jT,{placeholder:u,value:D,className:"max-h-8",onFocus:K,onValueChange:H=>{I(H),T||k(!0)}}),N&&E.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:E.jsx(jU,{className:"h-4 w-4 animate-spin"})})]}),E.jsxs(Rp,{hidden:!T,children:[_&&E.jsx("div",{className:"text-destructive p-4 text-center",children:_}),N&&R.length===0&&(s||E.jsx(Pae,{})),!N&&!_&&R.length===0&&(o||E.jsx(UT,{children:y??`No ${l.toLowerCase()} found.`})),E.jsx(el,{children:R.map((H,F)=>E.jsxs(we.Fragment,{children:[E.jsx(tl,{value:a(H),onSelect:W,onMouseMove:()=>g(a(H)),className:"truncate cmd-item",children:r(H)},a(H)+`${F}`),F!==R.length-1&&E.jsx("div",{className:"bg-foreground/10 h-[1px]"},`divider-${F}`)]},a(H)+`-fragment-${F}`))})]})]})})}function Pae(){return E.jsx(el,{children:E.jsx(tl,{disabled:!0,children:E.jsxs("div",{className:"flex w-full items-center gap-2",children:[E.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),E.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[E.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),E.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const sb="__message_item",Fae=({id:e})=>{const t=Fe.use.sigmaGraph();return t!=null&&t.hasNode(e)?E.jsx(Iae,{id:e}):null};function zae(e){return E.jsxs("div",{children:[e.type==="nodes"&&E.jsx(Fae,{id:e.id}),e.type==="edges"&&E.jsx(Lae,{id:e.id}),e.type==="message"&&E.jsx("div",{children:e.message})]})}const Bae=({onChange:e,onFocus:t,value:n})=>{const{t:r}=Et(),a=Fe.use.sigmaGraph(),o=Fe.use.searchEngine();w.useEffect(()=>{a&&Fe.getState().resetSearchEngine()},[a]),w.useEffect(()=>{if(!a||a.nodes().length===0||o)return;const l=new Co({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=a.nodes().map(d=>({id:d,label:a.getNodeAttribute(d,"label")}));l.addAll(u),Fe.getState().setSearchEngine(l)},[a,o]);const s=w.useCallback(async l=>{if(t&&t(null),!a||!o)return[];if(a.nodes().length===0)return[];if(!l)return a.nodes().filter(p=>a.hasNode(p)).slice(0,yd).map(p=>({id:p,type:"nodes"}));let u=o.search(l).filter(d=>a.hasNode(d.id)).map(d=>({id:d.id,type:"nodes"}));if(u.length<5){const d=new Set(u.map(g=>g.id)),p=a.nodes().filter(g=>{if(d.has(g))return!1;const m=a.getNodeAttribute(g,"label");return m&&typeof m=="string"&&!m.toLowerCase().startsWith(l.toLowerCase())&&m.toLowerCase().includes(l.toLowerCase())}).map(g=>({id:g,type:"nodes"}));u=[...u,...p]}return u.length<=yd?u:[...u.slice(0,yd),{type:"message",id:sb,message:r("graphPanel.search.message",{count:u.length-yd})}]},[a,o,t,r]);return E.jsx(Mae,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:s,renderOption:zae,getOptionValue:l=>l.id,value:n&&n.type!=="message"?n.id:null,onChange:l=>{l!==sb&&e(l?{id:l,type:"nodes"}:null)},onFocus:l=>{l!==sb&&t&&t(l?{id:l,type:"nodes"}:null)},label:"item",placeholder:r("graphPanel.search.placeholder")})},jae=({...e})=>E.jsx(Bae,{...e});function Uae({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,getDisplayValue:o,notFound:s,loadingSkeleton:l,label:u,placeholder:d="Select...",value:p,onChange:g,disabled:m=!1,className:b,triggerClassName:y,searchInputClassName:v,noResultsMessage:x,triggerTooltip:T,clearable:k=!0}){const[R,O]=w.useState(!1),[N,C]=w.useState(!1),[_,M]=w.useState([]),[D,I]=w.useState(!1),[U,$]=w.useState(null),[B,W]=w.useState(p),[K,G]=w.useState(null),[H,F]=w.useState(""),Y=qT(H,t?0:150),[L,V]=w.useState([]),[j,P]=w.useState(null);w.useEffect(()=>{O(!0),W(p)},[p]),w.useEffect(()=>{p&&(!_.length||!K)?P(E.jsx("div",{children:p})):K&&P(null)},[p,_.length,K]),w.useEffect(()=>{if(p&&_.length>0){const Q=_.find(oe=>a(oe)===p);Q&&G(Q)}},[p,_,a]),w.useEffect(()=>{R||(async()=>{try{I(!0),$(null);const oe=await e(p);V(oe),M(oe)}catch(oe){$(oe instanceof Error?oe.message:"Failed to fetch options")}finally{I(!1)}})()},[R,e,p]),w.useEffect(()=>{const Q=async()=>{try{I(!0),$(null);const oe=await e(Y);V(oe),M(oe)}catch(oe){$(oe instanceof Error?oe.message:"Failed to fetch options")}finally{I(!1)}};R&&t?t&&M(Y?L.filter(oe=>n?n(oe,Y):!0):L):Q()},[e,Y,R,t,n]);const Z=w.useCallback(Q=>{const oe=k&&Q===B?"":Q;W(oe),G(_.find(ae=>a(ae)===oe)||null),g(oe),C(!1)},[B,g,k,_,a]);return E.jsxs(mp,{open:N,onOpenChange:C,children:[E.jsx(bp,{asChild:!0,children:E.jsxs(nt,{variant:"outline",role:"combobox","aria-expanded":N,className:Me("justify-between",m&&"cursor-not-allowed opacity-50",y),disabled:m,tooltip:T,side:"bottom",children:[p==="*"?E.jsx("div",{children:"*"}):K?o(K):j||d,E.jsx(cZ,{className:"opacity-50",size:10})]})}),E.jsx(Zc,{className:Me("p-0",b),onCloseAutoFocus:Q=>Q.preventDefault(),align:"start",sideOffset:8,collisionPadding:5,children:E.jsxs(Ap,{shouldFilter:!1,children:[E.jsxs("div",{className:"relative w-full border-b",children:[E.jsx(jT,{placeholder:`Search ${u.toLowerCase()}...`,value:H,onValueChange:Q=>{F(Q)},className:v}),D&&_.length>0&&E.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:E.jsx(jU,{className:"h-4 w-4 animate-spin"})})]}),E.jsxs(Rp,{children:[U&&E.jsx("div",{className:"text-destructive p-4 text-center",children:U}),D&&_.length===0&&(l||E.jsx(Gae,{})),!D&&!U&&_.length===0&&(s||E.jsx(UT,{children:x??`No ${u.toLowerCase()} found.`})),E.jsx(el,{children:_.map(Q=>E.jsxs(tl,{value:a(Q),onSelect:Z,className:"truncate",children:[r(Q),E.jsx(yT,{className:Me("ml-auto h-3 w-3",B===a(Q)?"opacity-100":"opacity-0")})]},a(Q)))})]})]})})]})}function Gae(){return E.jsx(el,{children:E.jsx(tl,{disabled:!0,children:E.jsxs("div",{className:"flex w-full items-center gap-2",children:[E.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),E.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[E.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),E.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const Hae=()=>{const{t:e}=Et(),t=Ie.use.queryLabel(),n=Fe.use.allDatabaseLabels(),r=Fe.use.labelsFetchAttempted(),a=w.useCallback(()=>{const l=new Co({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=n.map((d,p)=>({id:p,value:d}));return l.addAll(u),{labels:n,searchEngine:l}},[n]),o=w.useCallback(async l=>{const{labels:u,searchEngine:d}=a();let p=u;if(l&&(p=d.search(l).map(g=>u[g.id]),p.length<5)){const g=new Set(p),m=u.filter(b=>g.has(b)?!1:b&&typeof b=="string"&&!b.toLowerCase().startsWith(l.toLowerCase())&&b.toLowerCase().includes(l.toLowerCase()));p=[...p,...m]}return p.length<=F_?p:[...p.slice(0,F_),"..."]},[a]);w.useEffect(()=>{r&&(n.length>1?t&&t!=="*"&&!n.includes(t)?(console.log(`Label "${t}" not in available labels, setting to "*"`),Ie.getState().setQueryLabel("*")):console.log(`Label "${t}" is valid`):t&&n.length<=1&&t&&t!=="*"&&(console.log("Available labels list is empty, setting label to empty"),Ie.getState().setQueryLabel("")),Fe.getState().setLabelsFetchAttempted(!1))},[n,t,r]);const s=w.useCallback(()=>{Fe.getState().setLabelsFetchAttempted(!1),Fe.getState().setGraphDataFetchAttempted(!1),Fe.getState().setLastSuccessfulQueryLabel("");const l=Ie.getState().queryLabel;l?(Ie.getState().setQueryLabel(""),setTimeout(()=>{Ie.getState().setQueryLabel(l)},0)):Ie.getState().setQueryLabel("*")},[]);return E.jsxs("div",{className:"flex items-center",children:[E.jsx(nt,{size:"icon",variant:wr,onClick:s,tooltip:e("graphPanel.graphLabels.refreshTooltip"),className:"mr-2",children:E.jsx(UU,{className:"h-4 w-4"})}),E.jsx(Uae,{className:"min-w-[300px]",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:e("graphPanel.graphLabels.selectTooltip"),fetcher:o,renderOption:l=>E.jsx("div",{children:l}),getOptionValue:l=>l,getDisplayValue:l=>E.jsx("div",{children:l}),notFound:E.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:e("graphPanel.graphLabels.label"),placeholder:e("graphPanel.graphLabels.placeholder"),value:t!==null?t:"*",onChange:l=>{const u=Ie.getState().queryLabel;l==="..."&&(l="*"),l===u&&l!=="*"&&(l="*"),Fe.getState().setGraphDataFetchAttempted(!1),Ie.getState().setQueryLabel(l)},clearable:!1})]})},Qn=({text:e,className:t,tooltipClassName:n,tooltip:r,side:a,onClick:o})=>r?E.jsx(hT,{delayDuration:200,children:E.jsxs(mT,{children:[E.jsx(bT,{asChild:!0,children:E.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),E.jsx(gp,{side:a,className:n,children:r})]})}):E.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e});var rf={exports:{}},$ae=rf.exports,IO;function qae(){return IO||(IO=1,function(e){(function(t,n,r){function a(u){var d=this,p=l();d.next=function(){var g=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=g-(d.c=g|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(u),d.s0<0&&(d.s0+=1),d.s1-=p(u),d.s1<0&&(d.s1+=1),d.s2-=p(u),d.s2<0&&(d.s2+=1),p=null}function o(u,d){return d.c=u.c,d.s0=u.s0,d.s1=u.s1,d.s2=u.s2,d}function s(u,d){var p=new a(u),g=d&&d.state,m=p.next;return m.int32=function(){return p.next()*4294967296|0},m.double=function(){return m()+(m()*2097152|0)*11102230246251565e-32},m.quick=m,g&&(typeof g=="object"&&o(g,p),m.state=function(){return o(p,{})}),m}function l(){var u=4022871197,d=function(p){p=String(p);for(var g=0;g>>0,m-=u,m*=u,u=m>>>0,m-=u,u+=m*4294967296}return(u>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=s:this.alea=s})($ae,e)}(rf)),rf.exports}var af={exports:{}},Vae=af.exports,DO;function Wae(){return DO||(DO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var g=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^g^g>>>8},l===(l|0)?u.x=l:d+=l;for(var p=0;p>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xor128=s})(Vae,e)}(af)),af.exports}var of={exports:{}},Yae=of.exports,LO;function Kae(){return LO||(LO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.next=function(){var g=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(g^g<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:d+=l;for(var p=0;p>>4),u.next()}function o(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function s(l,u){var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xorwow=s})(Yae,e)}(of)),of.exports}var sf={exports:{}},Xae=sf.exports,MO;function Zae(){return MO||(MO=1,function(e){(function(t,n,r){function a(l){var u=this;u.next=function(){var p=u.x,g=u.i,m,b;return m=p[g],m^=m>>>7,b=m^m<<24,m=p[g+1&7],b^=m^m>>>10,m=p[g+3&7],b^=m^m>>>3,m=p[g+4&7],b^=m^m<<7,m=p[g+7&7],m=m^m<<13,b^=m^m<<9,p[g]=b,u.i=g+1&7,b};function d(p,g){var m,b=[];if(g===(g|0))b[0]=g;else for(g=""+g,m=0;m0;--m)p.next()}d(u,l)}function o(l,u){return u.x=l.x.slice(),u.i=l.i,u}function s(l,u){l==null&&(l=+new Date);var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(p.x&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xorshift7=s})(Xae,e)}(sf)),sf.exports}var lf={exports:{}},Qae=lf.exports,PO;function Jae(){return PO||(PO=1,function(e){(function(t,n,r){function a(l){var u=this;u.next=function(){var p=u.w,g=u.X,m=u.i,b,y;return u.w=p=p+1640531527|0,y=g[m+34&127],b=g[m=m+1&127],y^=y<<13,b^=b<<17,y^=y>>>15,b^=b>>>12,y=g[m]=y^b,u.i=m,y+(p^p>>>16)|0};function d(p,g){var m,b,y,v,x,T=[],k=128;for(g===(g|0)?(b=g,g=null):(g=g+"\0",b=0,k=Math.max(k,g.length)),y=0,v=-32;v>>15,b^=b<<4,b^=b>>>13,v>=0&&(x=x+1640531527|0,m=T[v&127]^=b+x,y=m==0?y+1:0);for(y>=128&&(T[(g&&g.length||0)&127]=-1),y=127,v=4*128;v>0;--v)b=T[y+34&127],m=T[y=y+1&127],b^=b<<13,m^=m<<17,b^=b>>>15,m^=m>>>12,T[y]=b^m;p.w=x,p.X=T,p.i=y}d(u,l)}function o(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function s(l,u){l==null&&(l=+new Date);var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(p.X&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xor4096=s})(Qae,e)}(lf)),lf.exports}var cf={exports:{}},eoe=cf.exports,FO;function toe(){return FO||(FO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.next=function(){var g=u.b,m=u.c,b=u.d,y=u.a;return g=g<<25^g>>>7^m,m=m-b|0,b=b<<24^b>>>8^y,y=y-g|0,u.b=g=g<<20^g>>>12^m,u.c=m=m-b|0,u.d=b<<16^m>>>16^y,u.a=y-g|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):d+=l;for(var p=0;p>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.tychei=s})(eoe,e)}(cf)),cf.exports}var uf={exports:{}};const noe={},roe=Object.freeze(Object.defineProperty({__proto__:null,default:noe},Symbol.toStringTag,{value:"Module"})),aoe=uq(roe);var ooe=uf.exports,zO;function ioe(){return zO||(zO=1,function(e){(function(t,n,r){var a=256,o=6,s=52,l="random",u=r.pow(a,o),d=r.pow(2,s),p=d*2,g=a-1,m;function b(O,N,C){var _=[];N=N==!0?{entropy:!0}:N||{};var M=T(x(N.entropy?[O,R(n)]:O??k(),3),_),D=new y(_),I=function(){for(var U=D.g(o),$=u,B=0;U=p;)U/=2,$/=2,B>>>=1;return(U+B)/$};return I.int32=function(){return D.g(4)|0},I.quick=function(){return D.g(4)/4294967296},I.double=I,T(R(D.S),n),(N.pass||C||function(U,$,B,W){return W&&(W.S&&v(W,D),U.state=function(){return v(D,{})}),B?(r[l]=U,$):U})(I,M,"global"in N?N.global:this==r,N.state)}function y(O){var N,C=O.length,_=this,M=0,D=_.i=_.j=0,I=_.S=[];for(C||(O=[C++]);M{const t="#5D6D7E",n=e?e.toLowerCase():"unknown",r=Fe.getState().typeColorMap;if(r.has(n))return r.get(n)||t;const a=coe[n];if(a){const d=jO[a],p=new Map(r);return p.set(n,d),Fe.setState({typeColorMap:p}),d}const o=new Set(Array.from(r.entries()).filter(([,d])=>!Object.values(jO).includes(d)).map(([,d])=>d)),l=uoe.find(d=>!o.has(d))||t,u=new Map(r);return u.set(n,l),Fe.setState({typeColorMap:u}),l},doe=e=>{if(!e)return console.log("Graph validation failed: graph is null"),!1;if(!Array.isArray(e.nodes)||!Array.isArray(e.edges))return console.log("Graph validation failed: nodes or edges is not an array"),!1;if(e.nodes.length===0)return console.log("Graph validation failed: nodes array is empty"),!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return console.log("Graph validation failed: invalid node structure"),!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return console.log("Graph validation failed: invalid edge structure"),!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return console.log("Graph validation failed: edge references non-existent node"),!1}return console.log("Graph validation passed"),!0},foe=async(e,t,n)=>{let r=null;if(!Fe.getState().lastSuccessfulQueryLabel){console.log("Last successful queryLabel is empty");try{await Fe.getState().fetchAllDatabaseLabels()}catch(l){console.error("Failed to fetch all database labels:",l)}}Fe.getState().setLabelsFetchAttempted(!0);const o=e||"*";try{console.log(`Fetching graph label: ${o}, depth: ${t}, nodes: ${n}`),r=await QB(o,t,n)}catch(l){return rr.getState().setErrorMessage(tr(l),"Query Graphs Error!"),null}let s=null;if(r){const l={},u={};for(let m=0;m0){const m=w0-ci;for(const b of r.nodes)b.size=Math.round(ci+m*Math.pow((b.degree-d)/g,.5))}s=new xV,s.nodes=r.nodes,s.edges=r.edges,s.nodeIdMap=l,s.edgeIdMap=u,doe(s)||(s=null,console.warn("Invalid graph data")),console.log("Graph data loaded")}return{rawGraph:s,is_truncated:r.is_truncated}},poe=e=>{var l,u;const t=Ie.getState().minEdgeSize,n=Ie.getState().maxEdgeSize;if(!e||!e.nodes.length)return console.log("No graph data available, skipping sigma graph creation"),null;const r=new Ac;for(const d of(e==null?void 0:e.nodes)??[]){sk(d.id+Date.now().toString(),{global:!0});const p=Math.random(),g=Math.random();r.addNode(d.id,{label:d.labels.join(", "),color:d.color,x:p,y:g,size:d.size,borderColor:E0,borderSize:.2})}for(const d of(e==null?void 0:e.edges)??[]){const p=((l=d.properties)==null?void 0:l.weight)!==void 0?Number(d.properties.weight):1;d.dynamicId=r.addEdge(d.source,d.target,{label:((u=d.properties)==null?void 0:u.keywords)||void 0,size:p,originalWeight:p,type:"curvedNoArrow"})}let a=Number.MAX_SAFE_INTEGER,o=0;r.forEachEdge(d=>{const p=r.getEdgeAttribute(d,"originalWeight")||1;a=Math.min(a,p),o=Math.max(o,p)});const s=o-a;if(s>0){const d=n-t;r.forEachEdge(p=>{const g=r.getEdgeAttribute(p,"originalWeight")||1,m=t+d*Math.pow((g-a)/s,.5);r.setEdgeAttribute(p,"size",m)})}else r.forEachEdge(d=>{r.setEdgeAttribute(d,"size",t)});return r},goe=()=>{const{t:e}=Et(),t=Ie.use.queryLabel(),n=Fe.use.rawGraph(),r=Fe.use.sigmaGraph(),a=Ie.use.graphQueryMaxDepth(),o=Ie.use.graphMaxNodes(),s=Fe.use.isFetching(),l=Fe.use.nodeToExpand(),u=Fe.use.nodeToPrune(),d=w.useRef(!1),p=w.useRef(!1),g=w.useRef(!1),m=w.useCallback(T=>(n==null?void 0:n.getNode(T))||null,[n]),b=w.useCallback((T,k=!0)=>(n==null?void 0:n.getEdge(T,k))||null,[n]),y=w.useRef(!1);w.useEffect(()=>{if(!t&&(n!==null||r!==null)){const T=Fe.getState();T.reset(),T.setGraphDataFetchAttempted(!1),T.setLabelsFetchAttempted(!1),d.current=!1,p.current=!1}},[t,n,r]),w.useEffect(()=>{if(!y.current&&!(!t&&g.current)&&!s&&!Fe.getState().graphDataFetchAttempted){y.current=!0,Fe.getState().setGraphDataFetchAttempted(!0);const T=Fe.getState();T.setIsFetching(!0),T.clearSelection(),T.sigmaGraph&&T.sigmaGraph.forEachNode(C=>{var _;(_=T.sigmaGraph)==null||_.setNodeAttribute(C,"highlighted",!1)}),console.log("Preparing graph data...");const k=t,R=a,O=o;let N;k?N=foe(k,R,O):(console.log("Query label is empty, show empty graph"),N=Promise.resolve({rawGraph:null,is_truncated:!1})),N.then(C=>{const _=Fe.getState(),M=C==null?void 0:C.rawGraph;if(M&&M.nodes&&M.nodes.forEach(D=>{var U;const I=(U=D.properties)==null?void 0:U.entity_type;D.color=UO(I)}),C!=null&&C.is_truncated&&Ft.info(e("graphPanel.dataIsTruncated","Graph data is truncated to Max Nodes")),_.reset(),!M||!M.nodes||M.nodes.length===0){const D=new Ac;D.addNode("empty-graph-node",{label:e("graphPanel.emptyGraph"),color:"#5D6D7E",x:.5,y:.5,size:15,borderColor:E0,borderSize:.2}),_.setSigmaGraph(D),_.setRawGraph(null),_.setGraphIsEmpty(!0);const I=rr.getState().message,U=I&&I.includes("Authentication required");!U&&k&&Ie.getState().setQueryLabel(""),U?console.log("Keep queryLabel for post-login reload"):_.setLastSuccessfulQueryLabel(""),console.log(`Graph data is empty, created graph with empty graph node. Auth error: ${U}`)}else{const D=poe(M);M.buildDynamicMap(),_.setSigmaGraph(D),_.setRawGraph(M),_.setGraphIsEmpty(!1),_.setLastSuccessfulQueryLabel(k),_.setMoveToSelectedNode(!0)}d.current=!0,p.current=!0,y.current=!1,_.setIsFetching(!1),(!M||!M.nodes||M.nodes.length===0)&&!k&&(g.current=!0)}).catch(C=>{console.error("Error fetching graph data:",C);const _=Fe.getState();_.setIsFetching(!1),d.current=!1,y.current=!1,_.setGraphDataFetchAttempted(!1),_.setLastSuccessfulQueryLabel("")})}},[t,a,o,s,e]),w.useEffect(()=>{l&&((async k=>{var R,O,N,C,_,M;if(!(!k||!r||!n))try{const D=n.getNode(k);if(!D){console.error("Node not found:",k);return}const I=D.labels[0];if(!I){console.error("Node has no label:",k);return}const U=await QB(I,2,1e3);if(!U||!U.nodes||!U.edges){console.error("Failed to fetch extended graph");return}const $=[];for(const ne of U.nodes){sk(ne.id,{global:!0});const xe=(R=ne.properties)==null?void 0:R.entity_type,Se=UO(xe);$.push({id:ne.id,labels:ne.labels,properties:ne.properties,size:10,x:Math.random(),y:Math.random(),color:Se,degree:0})}const B=[];for(const ne of U.edges)B.push({id:ne.id,source:ne.source,target:ne.target,type:ne.type,properties:ne.properties,dynamicId:""});const W={};r.forEachNode(ne=>{W[ne]={x:r.getNodeAttribute(ne,"x"),y:r.getNodeAttribute(ne,"y")}});const K=new Set(r.nodes()),G=new Set,H=new Set,F=1;let Y=0,L=Number.MAX_SAFE_INTEGER,V=0;r.forEachNode(ne=>{const xe=r.degree(ne);Y=Math.max(Y,xe)}),r.forEachEdge(ne=>{const xe=r.getEdgeAttribute(ne,"originalWeight")||1;L=Math.min(L,xe),V=Math.max(V,xe)});for(const ne of $){if(K.has(ne.id))continue;B.some(Se=>Se.source===k&&Se.target===ne.id||Se.target===k&&Se.source===ne.id)&&G.add(ne.id)}const j=new Map,P=new Map,Z=new Set;for(const ne of B){const xe=K.has(ne.source)||G.has(ne.source),Se=K.has(ne.target)||G.has(ne.target);xe&&Se?(H.add(ne.id),G.has(ne.source)?j.set(ne.source,(j.get(ne.source)||0)+1):K.has(ne.source)&&P.set(ne.source,(P.get(ne.source)||0)+1),G.has(ne.target)?j.set(ne.target,(j.get(ne.target)||0)+1):K.has(ne.target)&&P.set(ne.target,(P.get(ne.target)||0)+1)):(r.hasNode(ne.source)?Z.add(ne.source):G.has(ne.source)&&(Z.add(ne.source),j.set(ne.source,(j.get(ne.source)||0)+1)),r.hasNode(ne.target)?Z.add(ne.target):G.has(ne.target)&&(Z.add(ne.target),j.set(ne.target,(j.get(ne.target)||0)+1)))}const Q=(ne,xe,Se,be)=>{const J=be-Se||1,pe=w0-ci;for(const ke of xe)if(ne.hasNode(ke)){let he=ne.degree(ke);he+=1;const Ee=Math.min(he,be+1),se=Math.round(ci+pe*Math.pow((Ee-Se)/J,.5)),Be=ne.getNodeAttribute(ke,"size");se>Be&&ne.setNodeAttribute(ke,"size",se)}},oe=(ne,xe,Se)=>{const be=Ie.getState().minEdgeSize,J=Ie.getState().maxEdgeSize,pe=Se-xe||1,ke=J-be;ne.forEachEdge(he=>{const Ee=ne.getEdgeAttribute(he,"originalWeight")||1,se=be+ke*Math.pow((Ee-xe)/pe,.5);ne.setEdgeAttribute(he,"size",se)})};if(G.size===0){Q(r,Z,F,Y),Ft.info(e("graphPanel.propertiesView.node.noNewNodes"));return}for(const[,ne]of j.entries())Y=Math.max(Y,ne);for(const[ne,xe]of P.entries()){const be=r.degree(ne)+xe;Y=Math.max(Y,be)}const ae=Y-F||1,ce=w0-ci,Re=((O=Fe.getState().sigmaInstance)==null?void 0:O.getCamera().ratio)||1,ie=Math.max(Math.sqrt(D.size)*4,Math.sqrt(G.size)*3)/Re;sk(Date.now().toString(),{global:!0});const Te=Math.random()*2*Math.PI;console.log("nodeSize:",D.size,"nodesToAdd:",G.size),console.log("cameraRatio:",Math.round(Re*100)/100,"spreadFactor:",Math.round(ie*100)/100);for(const ne of G){const xe=$.find(Ee=>Ee.id===ne),Se=j.get(ne)||0,be=Math.min(Se,Y+1),J=Math.round(ci+ce*Math.pow((be-F)/ae,.5)),pe=2*Math.PI*(Array.from(G).indexOf(ne)/G.size),ke=((N=W[ne])==null?void 0:N.x)||W[D.id].x+Math.cos(Te+pe)*ie,he=((C=W[ne])==null?void 0:C.y)||W[D.id].y+Math.sin(Te+pe)*ie;r.addNode(ne,{label:xe.labels.join(", "),color:xe.color,x:ke,y:he,size:J,borderColor:E0,borderSize:.2}),n.getNode(ne)||(xe.size=J,xe.x=ke,xe.y=he,xe.degree=Se,n.nodes.push(xe),n.nodeIdMap[ne]=n.nodes.length-1)}for(const ne of H){const xe=B.find(be=>be.id===ne);if(r.hasEdge(xe.source,xe.target))continue;const Se=((_=xe.properties)==null?void 0:_.weight)!==void 0?Number(xe.properties.weight):1;L=Math.min(L,Se),V=Math.max(V,Se),xe.dynamicId=r.addEdge(xe.source,xe.target,{label:((M=xe.properties)==null?void 0:M.keywords)||void 0,size:Se,originalWeight:Se,type:"curvedNoArrow"}),n.getEdge(xe.id,!1)?console.error("Edge already exists in rawGraph:",xe.id):(n.edges.push(xe),n.edgeIdMap[xe.id]=n.edges.length-1,n.edgeDynamicIdMap[xe.dynamicId]=n.edges.length-1)}if(n.buildDynamicMap(),Fe.getState().resetSearchEngine(),Q(r,Z,F,Y),oe(r,L,V),r.hasNode(k)){const ne=r.degree(k),xe=Math.min(ne,Y+1),Se=Math.round(ci+ce*Math.pow((xe-F)/ae,.5));r.setNodeAttribute(k,"size",Se),D.size=Se,D.degree=ne}}catch(D){console.error("Error expanding node:",D)}})(l),window.setTimeout(()=>{Fe.getState().triggerNodeExpand(null)},0))},[l,r,n,e]);const v=w.useCallback((T,k)=>{const R=new Set([T]);return k.forEachNode(O=>{if(O===T)return;const N=k.neighbors(O);N.length===1&&N[0]===T&&R.add(O)}),R},[]);return w.useEffect(()=>{u&&((k=>{if(!(!k||!r||!n))try{const R=Fe.getState();if(!r.hasNode(k)){console.error("Node not found:",k);return}const O=v(k,r);if(O.size===r.nodes().length){Ft.error(e("graphPanel.propertiesView.node.deleteAllNodesError"));return}R.clearSelection();for(const N of O){r.dropNode(N);const C=n.nodeIdMap[N];if(C!==void 0){const _=n.edges.filter(M=>M.source===N||M.target===N);for(const M of _){const D=n.edgeIdMap[M.id];if(D!==void 0){n.edges.splice(D,1);for(const[I,U]of Object.entries(n.edgeIdMap))U>D&&(n.edgeIdMap[I]=U-1);delete n.edgeIdMap[M.id],delete n.edgeDynamicIdMap[M.dynamicId]}}n.nodes.splice(C,1);for(const[M,D]of Object.entries(n.nodeIdMap))D>C&&(n.nodeIdMap[M]=D-1);delete n.nodeIdMap[N]}}n.buildDynamicMap(),Fe.getState().resetSearchEngine(),O.size>1&&Ft.info(e("graphPanel.propertiesView.node.nodesRemoved",{count:O.size}))}catch(R){console.error("Error pruning node:",R)}})(u),window.setTimeout(()=>{Fe.getState().triggerNodePrune(null)},0))},[u,r,n,v,e]),{lightrageGraph:w.useCallback(()=>{if(r)return r;console.log("Creating new Sigma graph instance");const T=new Ac;return Fe.getState().setSigmaGraph(T),T},[r]),getNode:m,getEdge:b}},hoe=()=>{const{getNode:e,getEdge:t}=goe(),n=Fe.use.selectedNode(),r=Fe.use.focusedNode(),a=Fe.use.selectedEdge(),o=Fe.use.focusedEdge(),[s,l]=w.useState(null),[u,d]=w.useState(null);return w.useEffect(()=>{let p=null,g=null;r?(p="node",g=e(r)):n?(p="node",g=e(n)):o?(p="edge",g=t(o,!0)):a&&(p="edge",g=t(a,!0)),g?(p=="node"?l(moe(g)):l(boe(g)),d(p)):(l(null),d(null))},[r,n,o,a,l,d,e,t]),s?E.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:u=="node"?E.jsx(yoe,{node:s}):E.jsx(voe,{edge:s})}):E.jsx(E.Fragment,{})},moe=e=>{const t=Fe.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)try{if(!t.sigmaGraph.hasNode(e.id))return{...e,relationships:[]};const r=t.sigmaGraph.edges(e.id);for(const a of r){if(!t.sigmaGraph.hasEdge(a))continue;const o=t.rawGraph.getEdge(a,!0);if(o){const l=e.id===o.source?o.target:o.source;if(!t.sigmaGraph.hasNode(l))continue;const u=t.rawGraph.getNode(l);u&&n.push({type:"Neighbour",id:l,label:u.properties.entity_id?u.properties.entity_id:u.labels.join(", ")})}}}catch(r){console.error("Error refining node properties:",r)}return{...e,relationships:n}},boe=e=>{const t=Fe.getState();let n,r;if(t.sigmaGraph&&t.rawGraph)try{if(!t.sigmaGraph.hasEdge(e.id))return{...e,sourceNode:void 0,targetNode:void 0};t.sigmaGraph.hasNode(e.source)&&(n=t.rawGraph.getNode(e.source)),t.sigmaGraph.hasNode(e.target)&&(r=t.rawGraph.getNode(e.target))}catch(a){console.error("Error refining edge properties:",a)}return{...e,sourceNode:n,targetNode:r}},ra=({name:e,value:t,onClick:n,tooltip:r})=>{const{t:a}=Et(),o=s=>{const l=`graphPanel.propertiesView.node.propertyNames.${s}`,u=a(l);return u===l?s:u};return E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-primary/60 tracking-wide whitespace-nowrap",children:o(e)}),":",E.jsx(Qn,{className:"hover:bg-primary/20 rounded p-1 overflow-hidden text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||(typeof t=="string"?t:JSON.stringify(t,null,2)),side:"left",onClick:n})]})},yoe=({node:e})=>{const{t}=Et(),n=()=>{Fe.getState().triggerNodeExpand(e.id)},r=()=>{Fe.getState().triggerNodePrune(e.id)};return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsxs("div",{className:"flex justify-between items-center",children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-blue-700",children:t("graphPanel.propertiesView.node.title")}),E.jsxs("div",{className:"flex gap-3",children:[E.jsx(nt,{size:"icon",variant:"ghost",className:"h-7 w-7 border border-gray-400 hover:bg-gray-200 dark:border-gray-600 dark:hover:bg-gray-700",onClick:n,tooltip:t("graphPanel.propertiesView.node.expandNode"),children:E.jsx(EZ,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),E.jsx(nt,{size:"icon",variant:"ghost",className:"h-7 w-7 border border-gray-400 hover:bg-gray-200 dark:border-gray-600 dark:hover:bg-gray-700",onClick:r,tooltip:t("graphPanel.propertiesView.node.pruneNode"),children:E.jsx(WZ,{className:"h-4 w-4 text-gray-900 dark:text-gray-300"})})]})]}),E.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[E.jsx(ra,{name:t("graphPanel.propertiesView.node.id"),value:e.id}),E.jsx(ra,{name:t("graphPanel.propertiesView.node.labels"),value:e.labels.join(", "),onClick:()=>{Fe.getState().setSelectedNode(e.id,!0)}}),E.jsx(ra,{name:t("graphPanel.propertiesView.node.degree"),value:e.degree})]}),E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-amber-700",children:t("graphPanel.propertiesView.node.properties")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(a=>E.jsx(ra,{name:a,value:e.properties[a]},a))}),e.relationships.length>0&&E.jsxs(E.Fragment,{children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-emerald-700",children:t("graphPanel.propertiesView.node.relationships")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:a,id:o,label:s})=>E.jsx(ra,{name:a,value:s,onClick:()=>{Fe.getState().setSelectedNode(o,!0)}},o))})]})]})},voe=({edge:e})=>{const{t}=Et();return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-violet-700",children:t("graphPanel.propertiesView.edge.title")}),E.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[E.jsx(ra,{name:t("graphPanel.propertiesView.edge.id"),value:e.id}),e.type&&E.jsx(ra,{name:t("graphPanel.propertiesView.edge.type"),value:e.type}),E.jsx(ra,{name:t("graphPanel.propertiesView.edge.source"),value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{Fe.getState().setSelectedNode(e.source,!0)}}),E.jsx(ra,{name:t("graphPanel.propertiesView.edge.target"),value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{Fe.getState().setSelectedNode(e.target,!0)}})]}),E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-amber-700",children:t("graphPanel.propertiesView.edge.properties")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(n=>E.jsx(ra,{name:n,value:e.properties[n]},n))})]})},Soe=()=>{const{t:e}=Et(),t=Ie.use.graphQueryMaxDepth(),n=Ie.use.graphMaxNodes();return E.jsxs("div",{className:"absolute bottom-4 left-[calc(1rem+2.5rem)] flex items-center gap-2 text-xs text-gray-400",children:[E.jsxs("div",{children:[e("graphPanel.sideBar.settings.depth"),": ",t]}),E.jsxs("div",{children:[e("graphPanel.sideBar.settings.max"),": ",n]})]})},wi=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));wi.displayName="Card";const Cc=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Cc.displayName="CardHeader";const _c=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));_c.displayName="CardTitle";const Cp=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Cp.displayName="CardDescription";const Nc=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Nc.displayName="CardContent";const Eoe=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));Eoe.displayName="CardFooter";function woe(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var VT="ScrollArea",[G5,v0e]=$r(VT),[xoe,Rr]=G5(VT),H5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:o=600,...s}=e,[l,u]=w.useState(null),[d,p]=w.useState(null),[g,m]=w.useState(null),[b,y]=w.useState(null),[v,x]=w.useState(null),[T,k]=w.useState(0),[R,O]=w.useState(0),[N,C]=w.useState(!1),[_,M]=w.useState(!1),D=mt(t,U=>u(U)),I=yp(a);return E.jsx(xoe,{scope:n,type:r,dir:I,scrollHideDelay:o,scrollArea:l,viewport:d,onViewportChange:p,content:g,onContentChange:m,scrollbarX:b,onScrollbarXChange:y,scrollbarXEnabled:N,onScrollbarXEnabledChange:C,scrollbarY:v,onScrollbarYChange:x,scrollbarYEnabled:_,onScrollbarYEnabledChange:M,onCornerWidthChange:k,onCornerHeightChange:O,children:E.jsx(Je.div,{dir:I,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":R+"px",...e.style}})})});H5.displayName=VT;var $5="ScrollAreaViewport",q5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...o}=e,s=Rr($5,n),l=w.useRef(null),u=mt(t,l,s.onViewportChange);return E.jsxs(E.Fragment,{children:[E.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:a}),E.jsx(Je.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:E.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});q5.displayName=$5;var da="ScrollAreaScrollbar",WT=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=a,l=e.orientation==="horizontal";return w.useEffect(()=>(l?o(!0):s(!0),()=>{l?o(!1):s(!1)}),[l,o,s]),a.type==="hover"?E.jsx(koe,{...r,ref:t,forceMount:n}):a.type==="scroll"?E.jsx(Toe,{...r,ref:t,forceMount:n}):a.type==="auto"?E.jsx(V5,{...r,ref:t,forceMount:n}):a.type==="always"?E.jsx(YT,{...r,ref:t}):null});WT.displayName=da;var koe=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),[o,s]=w.useState(!1);return w.useEffect(()=>{const l=a.scrollArea;let u=0;if(l){const d=()=>{window.clearTimeout(u),s(!0)},p=()=>{u=window.setTimeout(()=>s(!1),a.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",p),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",p)}}},[a.scrollArea,a.scrollHideDelay]),E.jsx(ir,{present:n||o,children:E.jsx(V5,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Toe=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Np(()=>u("SCROLL_END"),100),[l,u]=woe("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 w.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>u("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,a.scrollHideDelay,u]),w.useEffect(()=>{const d=a.viewport,p=o?"scrollLeft":"scrollTop";if(d){let g=d[p];const m=()=>{const b=d[p];g!==b&&(u("SCROLL"),s()),g=b};return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[a.viewport,o,u,s]),E.jsx(ir,{present:n||l!=="hidden",children:E.jsx(YT,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ke(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ke(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),V5=w.forwardRef((e,t)=>{const n=Rr(da,e.__scopeScrollArea),{forceMount:r,...a}=e,[o,s]=w.useState(!1),l=e.orientation==="horizontal",u=Np(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,a=Rr(da,e.__scopeScrollArea),o=w.useRef(null),s=w.useRef(0),[l,u]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Z5(l.viewport,l.content),p={...r,sizes:l,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function g(m,b){return Ooe(m,s.current,l,b)}return n==="horizontal"?E.jsx(Aoe,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const m=a.viewport.scrollLeft,b=GO(m,l,a.dir);o.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollLeft=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollLeft=g(m,a.dir))}}):n==="vertical"?E.jsx(Roe,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const m=a.viewport.scrollTop,b=GO(m,l);o.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollTop=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollTop=g(m))}}):null}),Aoe=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Rr(da,e.__scopeScrollArea),[s,l]=w.useState(),u=w.useRef(null),d=mt(t,u,o.onScrollbarXChange);return w.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),E.jsx(Y5,{"data-orientation":"horizontal",...a,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":_p(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,g)=>{if(o.viewport){const m=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(m),J5(m,g)&&p.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:If(s.paddingLeft),paddingEnd:If(s.paddingRight)}})}})}),Roe=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Rr(da,e.__scopeScrollArea),[s,l]=w.useState(),u=w.useRef(null),d=mt(t,u,o.onScrollbarYChange);return w.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),E.jsx(Y5,{"data-orientation":"vertical",...a,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":_p(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,g)=>{if(o.viewport){const m=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(m),J5(m,g)&&p.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:If(s.paddingTop),paddingEnd:If(s.paddingBottom)}})}})}),[Coe,W5]=G5(da),Y5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:g,...m}=e,b=Rr(da,n),[y,v]=w.useState(null),x=mt(t,D=>v(D)),T=w.useRef(null),k=w.useRef(""),R=b.viewport,O=r.content-r.viewport,N=vn(p),C=vn(u),_=Np(g,10);function M(D){if(T.current){const I=D.clientX-T.current.left,U=D.clientY-T.current.top;d({x:I,y:U})}}return w.useEffect(()=>{const D=I=>{const U=I.target;(y==null?void 0:y.contains(U))&&N(I,O)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[R,y,O,N]),w.useEffect(C,[r,C]),zs(y,_),zs(b.content,_),E.jsx(Coe,{scope:n,scrollbar:y,hasThumb:a,onThumbChange:vn(o),onThumbPointerUp:vn(s),onThumbPositionChange:C,onThumbPointerDown:vn(l),children:E.jsx(Je.div,{...m,ref:x,style:{position:"absolute",...m.style},onPointerDown:Ke(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),T.current=y.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),M(D))}),onPointerMove:Ke(e.onPointerMove,M),onPointerUp:Ke(e.onPointerUp,D=>{const I=D.target;I.hasPointerCapture(D.pointerId)&&I.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=k.current,b.viewport&&(b.viewport.style.scrollBehavior=""),T.current=null})})})}),Of="ScrollAreaThumb",K5=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=W5(Of,e.__scopeScrollArea);return E.jsx(ir,{present:n||a.hasThumb,children:E.jsx(_oe,{ref:t,...r})})}),_oe=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,o=Rr(Of,n),s=W5(Of,n),{onThumbPositionChange:l}=s,u=mt(t,g=>s.onThumbChange(g)),d=w.useRef(void 0),p=Np(()=>{d.current&&(d.current(),d.current=void 0)},100);return w.useEffect(()=>{const g=o.viewport;if(g){const m=()=>{if(p(),!d.current){const b=Ioe(g,l);d.current=b,l()}};return l(),g.addEventListener("scroll",m),()=>g.removeEventListener("scroll",m)}},[o.viewport,p,l]),E.jsx(Je.div,{"data-state":s.hasThumb?"visible":"hidden",...a,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ke(e.onPointerDownCapture,g=>{const b=g.target.getBoundingClientRect(),y=g.clientX-b.left,v=g.clientY-b.top;s.onThumbPointerDown({x:y,y:v})}),onPointerUp:Ke(e.onPointerUp,s.onThumbPointerUp)})});K5.displayName=Of;var KT="ScrollAreaCorner",X5=w.forwardRef((e,t)=>{const n=Rr(KT,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?E.jsx(Noe,{...e,ref:t}):null});X5.displayName=KT;var Noe=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Rr(KT,n),[o,s]=w.useState(0),[l,u]=w.useState(0),d=!!(o&&l);return zs(a.scrollbarX,()=>{var g;const p=((g=a.scrollbarX)==null?void 0:g.offsetHeight)||0;a.onCornerHeightChange(p),u(p)}),zs(a.scrollbarY,()=>{var g;const p=((g=a.scrollbarY)==null?void 0:g.offsetWidth)||0;a.onCornerWidthChange(p),s(p)}),d?E.jsx(Je.div,{...r,ref:t,style:{width:o,height:l,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function If(e){return e?parseInt(e,10):0}function Z5(e,t){const n=e/t;return isNaN(n)?0:n}function _p(e){const t=Z5(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Ooe(e,t,n,r="ltr"){const a=_p(n),o=a/2,s=t||o,l=a-s,u=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,p=n.content-n.viewport,g=r==="ltr"?[0,p]:[p*-1,0];return Q5([u,d],g)(e)}function GO(e,t,n="ltr"){const r=_p(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,s=t.content-t.viewport,l=o-r,u=n==="ltr"?[0,s]:[s*-1,0],d=z0(e,u);return Q5([0,s],[0,l])(d)}function Q5(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function J5(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,l=n.top!==o.top;(s||l)&&t(),n=o,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function Np(e,t){const n=vn(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function zs(e,t){const n=vn(t);Rn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var eG=H5,Doe=q5,Loe=X5;const XT=w.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(eG,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[E.jsx(Doe,{className:"h-full w-full rounded-[inherit]",children:t}),E.jsx(tG,{}),E.jsx(Loe,{})]}));XT.displayName=eG.displayName;const tG=w.forwardRef(({className:e,orientation:t="vertical",...n},r)=>E.jsx(WT,{ref:r,orientation:t,className:Me("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:E.jsx(K5,{className:"bg-border relative flex-1 rounded-full"})}));tG.displayName=WT.displayName;const Moe=({className:e})=>{const{t}=Et(),n=Fe.use.typeColorMap();return!n||n.size===0?null:E.jsxs(wi,{className:`p-2 max-w-xs ${e}`,children:[E.jsx("h3",{className:"text-sm font-medium mb-2",children:t("graphPanel.legend")}),E.jsx(XT,{className:"max-h-80",children:E.jsx("div",{className:"flex flex-col gap-1",children:Array.from(n.entries()).map(([r,a])=>E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:a}}),E.jsx("span",{className:"text-xs truncate",title:r,children:t(`graphPanel.nodeTypes.${r.toLowerCase()}`,r)})]},r))})})]})},Poe=()=>{const{t:e}=Et(),t=Ie.use.showLegend(),n=Ie.use.setShowLegend(),r=w.useCallback(()=>{n(!t)},[t,n]);return E.jsx(nt,{variant:wr,onClick:r,tooltip:e("graphPanel.sideBar.legendControl.toggleLegend"),size:"icon",children:E.jsx(aZ,{})})},HO={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedNoArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:U4,curvedArrow:Hne,curvedNoArrow:Gne},nodeProgramClasses:{default:Tne,circel:eu,point:Jte},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},Foe=()=>{const e=X4(),t=Ar(),[n,r]=w.useState(null);return w.useEffect(()=>{e({downNode:a=>{r(a.node),t.getGraph().setNodeAttribute(a.node,"highlighted",!0)},mousemovebody:a=>{if(!n)return;const o=t.viewportToGraph(a);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),a.preventSigmaDefault(),a.original.preventDefault(),a.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:a=>{a.original.buttons!==0&&!t.getCustomBBox()&&t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},zoe=()=>{const[e,t]=w.useState(HO),n=w.useRef(null),r=Fe.use.selectedNode(),a=Fe.use.focusedNode(),o=Fe.use.moveToSelectedNode(),s=Fe.use.isFetching(),l=Ie.use.showPropertyPanel(),u=Ie.use.showNodeSearchBar(),d=Ie.use.enableNodeDrag(),p=Ie.use.showLegend();w.useEffect(()=>{t(HO),console.log("Initialized sigma settings")},[]),w.useEffect(()=>()=>{const v=Fe.getState().sigmaInstance;if(v)try{v.kill(),Fe.getState().setSigmaInstance(null),console.log("Cleared sigma instance on Graphviewer unmount")}catch(x){console.error("Error cleaning up sigma instance:",x)}},[]);const g=w.useCallback(v=>{v===null?Fe.getState().setFocusedNode(null):v.type==="nodes"&&Fe.getState().setFocusedNode(v.id)},[]),m=w.useCallback(v=>{v===null?Fe.getState().setSelectedNode(null):v.type==="nodes"&&Fe.getState().setSelectedNode(v.id,!0)},[]),b=w.useMemo(()=>a??r,[a,r]),y=w.useMemo(()=>r?{type:"nodes",id:r}:null,[r]);return E.jsxs("div",{className:"relative h-full w-full overflow-hidden",children:[E.jsxs(Wte,{settings:e,className:"!bg-background !size-full overflow-hidden",ref:n,children:[E.jsx(lae,{}),d&&E.jsx(Foe,{}),E.jsx($ne,{node:b,move:o}),E.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[E.jsx(Hae,{}),u&&E.jsx(jae,{value:y,onFocus:g,onChange:m})]}),E.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[E.jsx(sae,{}),E.jsx(cae,{}),E.jsx(uae,{}),E.jsx(Poe,{}),E.jsx(vae,{})]}),l&&E.jsx("div",{className:"absolute top-2 right-2",children:E.jsx(hoe,{})}),p&&E.jsx("div",{className:"absolute bottom-10 right-2",children:E.jsx(Moe,{className:"bg-background/60 backdrop-blur-lg"})}),E.jsx(Soe,{})]}),s&&E.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/80 z-10",children:E.jsxs("div",{className:"text-center",children:[E.jsx("div",{className:"mb-2 h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"}),E.jsx("p",{children:"Loading Graph Data..."})]})})]})},nG=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{className:"relative w-full overflow-auto",children:E.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));nG.displayName="Table";const rG=w.forwardRef(({className:e,...t},n)=>E.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));rG.displayName="TableHeader";const aG=w.forwardRef(({className:e,...t},n)=>E.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));aG.displayName="TableBody";const Boe=w.forwardRef(({className:e,...t},n)=>E.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));Boe.displayName="TableFooter";const lk=w.forwardRef(({className:e,...t},n)=>E.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));lk.displayName="TableRow";const wo=w.forwardRef(({className:e,...t},n)=>E.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));wo.displayName="TableHead";const xo=w.forwardRef(({className:e,...t},n)=>E.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xo.displayName="TableCell";const joe=w.forwardRef(({className:e,...t},n)=>E.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));joe.displayName="TableCaption";function Uoe({title:e,description:t,icon:n=hZ,action:r,className:a,...o}){return E.jsxs(wi,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",a),...o,children:[E.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:E.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),E.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[E.jsx(_c,{children:e}),t?E.jsx(Cp,{children:t}):null]}),r||null]})}var cb={exports:{}},ub,$O;function Goe(){if($O)return ub;$O=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ub=e,ub}var db,qO;function Hoe(){if(qO)return db;qO=1;var e=Goe();function t(){}function n(){}return n.resetWarningCache=t,db=function(){function r(s,l,u,d,p,g){if(g!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},db}var VO;function $oe(){return VO||(VO=1,cb.exports=Hoe()()),cb.exports}var qoe=$oe();const It=un(qoe),Voe=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Bs(e,t,n){const r=Woe(e),{webkitRelativePath:a}=e,o=typeof t=="string"?t:typeof a=="string"&&a.length>0?a:`./${e.name}`;return typeof r.path!="string"&&WO(r,"path",o),WO(r,"relativePath",o),r}function Woe(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),a=Voe.get(r);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}function WO(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const Yoe=[".DS_Store","Thumbs.db"];function Koe(e){return Ai(this,void 0,void 0,function*(){return Df(e)&&Xoe(e.dataTransfer)?eie(e.dataTransfer,e.type):Zoe(e)?Qoe(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Joe(e):[]})}function Xoe(e){return Df(e)}function Zoe(e){return Df(e)&&Df(e.target)}function Df(e){return typeof e=="object"&&e!==null}function Qoe(e){return ck(e.target.files).map(t=>Bs(t))}function Joe(e){return Ai(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Bs(n))})}function eie(e,t){return Ai(this,void 0,void 0,function*(){if(e.items){const n=ck(e.items).filter(a=>a.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(tie));return YO(oG(r))}return YO(ck(e.files).map(n=>Bs(n)))})}function YO(e){return e.filter(t=>Yoe.indexOf(t.name)===-1)}function ck(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?oG(n):[n]],[])}function KO(e,t){return Ai(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const s=yield o.getFile();return s.handle=o,Bs(s)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Bs(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function nie(e){return Ai(this,void 0,void 0,function*(){return e.isDirectory?iG(e):rie(e)})}function iG(e){const t=e.createReader();return new Promise((n,r)=>{const a=[];function o(){t.readEntries(s=>Ai(this,void 0,void 0,function*(){if(s.length){const l=Promise.all(s.map(nie));a.push(l),o()}else try{const l=yield Promise.all(a);n(l)}catch(l){r(l)}}),s=>{r(s)})}o()})}function rie(e){return Ai(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const a=Bs(r,e.fullPath);t(a)},r=>{n(r)})})})}var zd={},XO;function aie(){return XO||(XO=1,zd.__esModule=!0,zd.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",a=(e.type||"").toLowerCase(),o=a.replace(/\/.*$/,"");return n.some(function(s){var l=s.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?o===l.replace(/\/.*$/,""):a===l})}return!0}),zd}var oie=aie();const fb=un(oie);function ZO(e){return lie(e)||sie(e)||lG(e)||iie()}function iie(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lie(e){if(Array.isArray(e))return uk(e)}function QO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function JO(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:pie,message:"File type must be ".concat(r)}},eI=function(t){return{code:gie,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},tI=function(t){return{code:hie,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},yie={code:mie,message:"Too many files"};function cG(e,t){var n=e.type==="application/x-moz-file"||fie(e,t);return[n,n?null:bie(t)]}function uG(e,t,n){if(di(e.size))if(di(t)&&di(n)){if(e.size>n)return[!1,eI(n)];if(e.sizen)return[!1,eI(n)]}return[!0,null]}function di(e){return e!=null}function vie(e){var t=e.files,n=e.accept,r=e.minSize,a=e.maxSize,o=e.multiple,s=e.maxFiles,l=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(u){var d=cG(u,n),p=Oc(d,1),g=p[0],m=uG(u,r,a),b=Oc(m,1),y=b[0],v=l?l(u):null;return g&&y&&!v})}function Lf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Bd(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function nI(e){e.preventDefault()}function Sie(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Eie(e){return e.indexOf("Edge/")!==-1}function wie(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Sie(e)||Eie(e)}function ea(){for(var e=arguments.length,t=new Array(e),n=0;n1?a-1:0),s=1;sV?!1:L>=Q.start&&L{const[v,x]=w.useState(m??r),T=w.useCallback(()=>{x(N=>N===void 0?e??1:Math.min(N+(e??1),o))},[e,o]),k=w.useCallback(()=>{x(N=>N===void 0?-(e??1):Math.max(N-(e??1),a))},[e,a]);w.useEffect(()=>{m!==void 0&&x(m)},[m]);const R=N=>{const C=N.floatValue===void 0?void 0:N.floatValue;x(C),s&&s(C)},O=()=>{v!==void 0&&(vo&&(x(o),y.current.value=String(o)))};return E.jsxs("div",{className:"relative flex",children:[E.jsx(vse,{value:v,onValueChange:R,thousandSeparator:t,decimalScale:u,fixedDecimalScale:l,allowNegative:a<0,valueIsNumericString:!0,onBlur:O,max:o,min:a,suffix:p,prefix:g,customInput:N=>E.jsx(Tr,{...N,className:Me("w-full",d)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:y,...b}),E.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[E.jsx(nt,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:T,disabled:v===o,children:E.jsx(FU,{size:15})}),E.jsx(nt,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:k,disabled:v===a,children:E.jsx(vT,{size:15})})]})]})});xs.displayName="NumberInput";function Sse(){var r,a;const{t:e}=Et(),t=Ie(o=>o.querySettings),n=w.useCallback((o,s)=>{Ie.getState().updateQuerySettings({[o]:s})},[]);return E.jsxs(wi,{className:"flex shrink-0 flex-col min-w-[180px]",children:[E.jsxs(Cc,{className:"px-4 pt-4 pb-2",children:[E.jsx(_c,{children:e("retrievePanel.querySettings.parametersTitle")}),E.jsx(Cp,{children:e("retrievePanel.querySettings.parametersDescription")})]}),E.jsx(Nc,{className:"m-0 flex grow flex-col p-0 text-xs",children:E.jsx("div",{className:"relative size-full",children:E.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.queryMode"),tooltip:e("retrievePanel.querySettings.queryModeTooltip"),side:"left"}),E.jsxs(kf,{value:t.mode,onValueChange:o=>n("mode",o),children:[E.jsx(kc,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:E.jsx(Tf,{})}),E.jsx(Tc,{children:E.jsxs(pN,{children:[E.jsx(xn,{value:"naive",children:e("retrievePanel.querySettings.queryModeOptions.naive")}),E.jsx(xn,{value:"local",children:e("retrievePanel.querySettings.queryModeOptions.local")}),E.jsx(xn,{value:"global",children:e("retrievePanel.querySettings.queryModeOptions.global")}),E.jsx(xn,{value:"hybrid",children:e("retrievePanel.querySettings.queryModeOptions.hybrid")}),E.jsx(xn,{value:"mix",children:e("retrievePanel.querySettings.queryModeOptions.mix")})]})})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.responseFormat"),tooltip:e("retrievePanel.querySettings.responseFormatTooltip"),side:"left"}),E.jsxs(kf,{value:t.response_type,onValueChange:o=>n("response_type",o),children:[E.jsx(kc,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:E.jsx(Tf,{})}),E.jsx(Tc,{children:E.jsxs(pN,{children:[E.jsx(xn,{value:"Multiple Paragraphs",children:e("retrievePanel.querySettings.responseFormatOptions.multipleParagraphs")}),E.jsx(xn,{value:"Single Paragraph",children:e("retrievePanel.querySettings.responseFormatOptions.singleParagraph")}),E.jsx(xn,{value:"Bullet Points",children:e("retrievePanel.querySettings.responseFormatOptions.bulletPoints")})]})})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.topK"),tooltip:e("retrievePanel.querySettings.topKTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"top_k",className:"sr-only",children:e("retrievePanel.querySettings.topK")}),E.jsx(xs,{id:"top_k",stepper:1,value:t.top_k,onValueChange:o=>n("top_k",o),min:1,placeholder:e("retrievePanel.querySettings.topKPlaceholder")})]})]}),E.jsxs(E.Fragment,{children:[E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.maxTokensTextUnit"),tooltip:e("retrievePanel.querySettings.maxTokensTextUnitTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"max_token_for_text_unit",className:"sr-only",children:e("retrievePanel.querySettings.maxTokensTextUnit")}),E.jsx(xs,{id:"max_token_for_text_unit",stepper:500,value:t.max_token_for_text_unit,onValueChange:o=>n("max_token_for_text_unit",o),min:1,placeholder:e("retrievePanel.querySettings.maxTokensTextUnit")})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{text:e("retrievePanel.querySettings.maxTokensGlobalContext"),tooltip:e("retrievePanel.querySettings.maxTokensGlobalContextTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"max_token_for_global_context",className:"sr-only",children:e("retrievePanel.querySettings.maxTokensGlobalContext")}),E.jsx(xs,{id:"max_token_for_global_context",stepper:500,value:t.max_token_for_global_context,onValueChange:o=>n("max_token_for_global_context",o),min:1,placeholder:e("retrievePanel.querySettings.maxTokensGlobalContext")})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.maxTokensLocalContext"),tooltip:e("retrievePanel.querySettings.maxTokensLocalContextTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"max_token_for_local_context",className:"sr-only",children:e("retrievePanel.querySettings.maxTokensLocalContext")}),E.jsx(xs,{id:"max_token_for_local_context",stepper:500,value:t.max_token_for_local_context,onValueChange:o=>n("max_token_for_local_context",o),min:1,placeholder:e("retrievePanel.querySettings.maxTokensLocalContext")})]})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.historyTurns"),tooltip:e("retrievePanel.querySettings.historyTurnsTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"history_turns",className:"sr-only",children:e("retrievePanel.querySettings.historyTurns")}),E.jsx(xs,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:t.history_turns,onValueChange:o=>n("history_turns",o),min:0,placeholder:e("retrievePanel.querySettings.historyTurnsPlaceholder")})]})]}),E.jsxs(E.Fragment,{children:[E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.hlKeywords"),tooltip:e("retrievePanel.querySettings.hlKeywordsTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"hl_keywords",className:"sr-only",children:e("retrievePanel.querySettings.hlKeywords")}),E.jsx(Tr,{id:"hl_keywords",type:"text",value:(r=t.hl_keywords)==null?void 0:r.join(", "),onChange:o=>{const s=o.target.value.split(",").map(l=>l.trim()).filter(l=>l!=="");n("hl_keywords",s)},placeholder:e("retrievePanel.querySettings.hlkeywordsPlaceHolder")})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.llKeywords"),tooltip:e("retrievePanel.querySettings.llKeywordsTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"ll_keywords",className:"sr-only",children:e("retrievePanel.querySettings.llKeywords")}),E.jsx(Tr,{id:"ll_keywords",type:"text",value:(a=t.ll_keywords)==null?void 0:a.join(", "),onChange:o=>{const s=o.target.value.split(",").map(l=>l.trim()).filter(l=>l!=="");n("ll_keywords",s)},placeholder:e("retrievePanel.querySettings.hlkeywordsPlaceHolder")})]})]})]}),E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("label",{htmlFor:"only_need_context",className:"flex-1",children:E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.onlyNeedContext"),tooltip:e("retrievePanel.querySettings.onlyNeedContextTooltip"),side:"left"})}),E.jsx(Ns,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:t.only_need_context,onCheckedChange:o=>n("only_need_context",o)})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("label",{htmlFor:"only_need_prompt",className:"flex-1",children:E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.onlyNeedPrompt"),tooltip:e("retrievePanel.querySettings.onlyNeedPromptTooltip"),side:"left"})}),E.jsx(Ns,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:t.only_need_prompt,onCheckedChange:o=>n("only_need_prompt",o)})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("label",{htmlFor:"stream",className:"flex-1",children:E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.streamResponse"),tooltip:e("retrievePanel.querySettings.streamResponseTooltip"),side:"left"})}),E.jsx(Ns,{className:"mr-1 cursor-pointer",id:"stream",checked:t.stream,onCheckedChange:o=>n("stream",o)})]})]})]})})})]})}function Ese(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const wse=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xse=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kse={};function dI(e,t){return(kse.jsx?xse:wse).test(e)}const Tse=/[ \t\n\f\r]/g;function Ase(e){return typeof e=="object"?e.type==="text"?fI(e.value):!1:fI(e)}function fI(e){return e.replace(Tse,"")===""}class ou{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}ou.prototype.property={};ou.prototype.normal={};ou.prototype.space=null;function xG(e,t){const n={},r={};let a=-1;for(;++a4&&n.slice(0,4)==="data"&&Ose.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(gI,Mse);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!gI.test(o)){let s=o.replace(Ise,Lse);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}a=QT}return new a(r,t)}function Lse(e){return"-"+e.toLowerCase()}function Mse(e){return e.charAt(1).toUpperCase()}const Pse={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"},Fse=xG([AG,TG,_G,NG,_se],"html"),JT=xG([AG,TG,_G,NG,Nse],"svg");function zse(e){return e.join(" ").trim()}var ms={},bb,hI;function Bse(){if(hI)return bb;hI=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,u=` + `),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function yse(e){e=bse(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,a=e.onKeyDown;a===void 0&&(a=ko);var o=e.onBlur;o===void 0&&(o=ko);var s=e.thousandSeparator,l=e.decimalScale,u=e.fixedDecimalScale,d=e.prefix;d===void 0&&(d="");var p=e.defaultValue,g=e.value,m=e.valueIsNumericString,b=e.onValueChange,y=mG(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),v=Ip(e),x=v.decimalSeparator,T=v.allowedDecimalSeparators,k=function(G){return uI(G,e)},R=function(G,H){return hse(G,H,e)},O=Os(g)?p:g,N=m??gse(O,d,t);Os(g)?Os(p)||(N=N||typeof p=="number"):N=N||typeof g=="number";var C=function(G){return bG(G)?G:(typeof G=="number"&&(G=SG(G)),N&&typeof l=="number"?lI(G,l,!!u):G)},_=wG(C(g),C(p),!!N,k,R,b),M=_[0],D=M.numAsString,I=M.formattedValue,U=_[1],$=function(G){var H=G.target,F=G.key,Y=H.selectionStart,L=H.selectionEnd,V=H.value;if(V===void 0&&(V=""),(F==="Backspace"||F==="Delete")&&LV?!1:L>=Q.start&&L{const[v,x]=w.useState(m??r),T=w.useCallback(()=>{x(N=>N===void 0?e??1:Math.min(N+(e??1),o))},[e,o]),k=w.useCallback(()=>{x(N=>N===void 0?-(e??1):Math.max(N-(e??1),a))},[e,a]);w.useEffect(()=>{m!==void 0&&x(m)},[m]);const R=N=>{const C=N.floatValue===void 0?void 0:N.floatValue;x(C),s&&s(C)},O=()=>{v!==void 0&&(vo&&(x(o),y.current.value=String(o)))};return E.jsxs("div",{className:"relative flex",children:[E.jsx(vse,{value:v,onValueChange:R,thousandSeparator:t,decimalScale:u,fixedDecimalScale:l,allowNegative:a<0,valueIsNumericString:!0,onBlur:O,max:o,min:a,suffix:p,prefix:g,customInput:N=>E.jsx(Tr,{...N,className:Me("w-full",d)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:y,...b}),E.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[E.jsx(nt,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:T,disabled:v===o,children:E.jsx(FU,{size:15})}),E.jsx(nt,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:k,disabled:v===a,children:E.jsx(vT,{size:15})})]})]})});xs.displayName="NumberInput";function Sse(){var r,a;const{t:e}=Et(),t=Ie(o=>o.querySettings),n=w.useCallback((o,s)=>{Ie.getState().updateQuerySettings({[o]:s})},[]);return E.jsxs(wi,{className:"flex shrink-0 flex-col min-w-[180px]",children:[E.jsxs(Cc,{className:"px-4 pt-4 pb-2",children:[E.jsx(_c,{children:e("retrievePanel.querySettings.parametersTitle")}),E.jsx(Cp,{children:e("retrievePanel.querySettings.parametersDescription")})]}),E.jsx(Nc,{className:"m-0 flex grow flex-col p-0 text-xs",children:E.jsx("div",{className:"relative size-full",children:E.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.queryMode"),tooltip:e("retrievePanel.querySettings.queryModeTooltip"),side:"left"}),E.jsxs(kf,{value:t.mode,onValueChange:o=>n("mode",o),children:[E.jsx(kc,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:E.jsx(Tf,{})}),E.jsx(Tc,{children:E.jsxs(pN,{children:[E.jsx(bn,{value:"naive",children:e("retrievePanel.querySettings.queryModeOptions.naive")}),E.jsx(bn,{value:"local",children:e("retrievePanel.querySettings.queryModeOptions.local")}),E.jsx(bn,{value:"global",children:e("retrievePanel.querySettings.queryModeOptions.global")}),E.jsx(bn,{value:"hybrid",children:e("retrievePanel.querySettings.queryModeOptions.hybrid")}),E.jsx(bn,{value:"mix",children:e("retrievePanel.querySettings.queryModeOptions.mix")}),E.jsx(bn,{value:"bypass",children:e("retrievePanel.querySettings.queryModeOptions.bypass")})]})})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.responseFormat"),tooltip:e("retrievePanel.querySettings.responseFormatTooltip"),side:"left"}),E.jsxs(kf,{value:t.response_type,onValueChange:o=>n("response_type",o),children:[E.jsx(kc,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:E.jsx(Tf,{})}),E.jsx(Tc,{children:E.jsxs(pN,{children:[E.jsx(bn,{value:"Multiple Paragraphs",children:e("retrievePanel.querySettings.responseFormatOptions.multipleParagraphs")}),E.jsx(bn,{value:"Single Paragraph",children:e("retrievePanel.querySettings.responseFormatOptions.singleParagraph")}),E.jsx(bn,{value:"Bullet Points",children:e("retrievePanel.querySettings.responseFormatOptions.bulletPoints")})]})})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.topK"),tooltip:e("retrievePanel.querySettings.topKTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"top_k",className:"sr-only",children:e("retrievePanel.querySettings.topK")}),E.jsx(xs,{id:"top_k",stepper:1,value:t.top_k,onValueChange:o=>n("top_k",o),min:1,placeholder:e("retrievePanel.querySettings.topKPlaceholder")})]})]}),E.jsxs(E.Fragment,{children:[E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.maxTokensTextUnit"),tooltip:e("retrievePanel.querySettings.maxTokensTextUnitTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"max_token_for_text_unit",className:"sr-only",children:e("retrievePanel.querySettings.maxTokensTextUnit")}),E.jsx(xs,{id:"max_token_for_text_unit",stepper:500,value:t.max_token_for_text_unit,onValueChange:o=>n("max_token_for_text_unit",o),min:1,placeholder:e("retrievePanel.querySettings.maxTokensTextUnit")})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{text:e("retrievePanel.querySettings.maxTokensGlobalContext"),tooltip:e("retrievePanel.querySettings.maxTokensGlobalContextTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"max_token_for_global_context",className:"sr-only",children:e("retrievePanel.querySettings.maxTokensGlobalContext")}),E.jsx(xs,{id:"max_token_for_global_context",stepper:500,value:t.max_token_for_global_context,onValueChange:o=>n("max_token_for_global_context",o),min:1,placeholder:e("retrievePanel.querySettings.maxTokensGlobalContext")})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.maxTokensLocalContext"),tooltip:e("retrievePanel.querySettings.maxTokensLocalContextTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"max_token_for_local_context",className:"sr-only",children:e("retrievePanel.querySettings.maxTokensLocalContext")}),E.jsx(xs,{id:"max_token_for_local_context",stepper:500,value:t.max_token_for_local_context,onValueChange:o=>n("max_token_for_local_context",o),min:1,placeholder:e("retrievePanel.querySettings.maxTokensLocalContext")})]})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.historyTurns"),tooltip:e("retrievePanel.querySettings.historyTurnsTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"history_turns",className:"sr-only",children:e("retrievePanel.querySettings.historyTurns")}),E.jsx(xs,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:t.history_turns,onValueChange:o=>n("history_turns",o),min:0,placeholder:e("retrievePanel.querySettings.historyTurnsPlaceholder")})]})]}),E.jsxs(E.Fragment,{children:[E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.hlKeywords"),tooltip:e("retrievePanel.querySettings.hlKeywordsTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"hl_keywords",className:"sr-only",children:e("retrievePanel.querySettings.hlKeywords")}),E.jsx(Tr,{id:"hl_keywords",type:"text",value:(r=t.hl_keywords)==null?void 0:r.join(", "),onChange:o=>{const s=o.target.value.split(",").map(l=>l.trim()).filter(l=>l!=="");n("hl_keywords",s)},placeholder:e("retrievePanel.querySettings.hlkeywordsPlaceHolder")})]})]}),E.jsxs(E.Fragment,{children:[E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.llKeywords"),tooltip:e("retrievePanel.querySettings.llKeywordsTooltip"),side:"left"}),E.jsxs("div",{children:[E.jsx("label",{htmlFor:"ll_keywords",className:"sr-only",children:e("retrievePanel.querySettings.llKeywords")}),E.jsx(Tr,{id:"ll_keywords",type:"text",value:(a=t.ll_keywords)==null?void 0:a.join(", "),onChange:o=>{const s=o.target.value.split(",").map(l=>l.trim()).filter(l=>l!=="");n("ll_keywords",s)},placeholder:e("retrievePanel.querySettings.hlkeywordsPlaceHolder")})]})]})]}),E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("label",{htmlFor:"only_need_context",className:"flex-1",children:E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.onlyNeedContext"),tooltip:e("retrievePanel.querySettings.onlyNeedContextTooltip"),side:"left"})}),E.jsx(Ns,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:t.only_need_context,onCheckedChange:o=>n("only_need_context",o)})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("label",{htmlFor:"only_need_prompt",className:"flex-1",children:E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.onlyNeedPrompt"),tooltip:e("retrievePanel.querySettings.onlyNeedPromptTooltip"),side:"left"})}),E.jsx(Ns,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:t.only_need_prompt,onCheckedChange:o=>n("only_need_prompt",o)})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("label",{htmlFor:"stream",className:"flex-1",children:E.jsx(Qn,{className:"ml-1",text:e("retrievePanel.querySettings.streamResponse"),tooltip:e("retrievePanel.querySettings.streamResponseTooltip"),side:"left"})}),E.jsx(Ns,{className:"mr-1 cursor-pointer",id:"stream",checked:t.stream,onCheckedChange:o=>n("stream",o)})]})]})]})})})]})}function Ese(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const wse=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xse=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kse={};function dI(e,t){return(kse.jsx?xse:wse).test(e)}const Tse=/[ \t\n\f\r]/g;function Ase(e){return typeof e=="object"?e.type==="text"?fI(e.value):!1:fI(e)}function fI(e){return e.replace(Tse,"")===""}class ou{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}ou.prototype.property={};ou.prototype.normal={};ou.prototype.space=null;function xG(e,t){const n={},r={};let a=-1;for(;++a4&&n.slice(0,4)==="data"&&Ose.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(gI,Mse);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!gI.test(o)){let s=o.replace(Ise,Lse);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}a=QT}return new a(r,t)}function Lse(e){return"-"+e.toLowerCase()}function Mse(e){return e.charAt(1).toUpperCase()}const Pse={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"},Fse=xG([AG,TG,_G,NG,_se],"html"),JT=xG([AG,TG,_G,NG,Nse],"svg");function zse(e){return e.join(" ").trim()}var ms={},bb,hI;function Bse(){if(hI)return bb;hI=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,u=` `,d="/",p="*",g="",m="comment",b="declaration";bb=function(v,x){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];x=x||{};var T=1,k=1;function R(B){var W=B.match(t);W&&(T+=W.length);var K=B.lastIndexOf(u);k=~K?B.length-K:k+B.length}function O(){var B={line:T,column:k};return function(W){return W.position=new N(B),M(),W}}function N(B){this.start=B,this.end={line:T,column:k},this.source=x.source}N.prototype.content=v;function C(B){var W=new Error(x.source+":"+T+":"+k+": "+B);if(W.reason=B,W.filename=x.source,W.line=T,W.column=k,W.source=v,!x.silent)throw W}function _(B){var W=B.exec(v);if(W){var K=W[0];return R(K),v=v.slice(K.length),W}}function M(){_(n)}function D(B){var W;for(B=B||[];W=I();)W!==!1&&B.push(W);return B}function I(){var B=O();if(!(d!=v.charAt(0)||p!=v.charAt(1))){for(var W=2;g!=v.charAt(W)&&(p!=v.charAt(W)||d!=v.charAt(W+1));)++W;if(W+=2,g===v.charAt(W-1))return C("End of comment missing");var K=v.slice(2,W-2);return k+=2,R(K),v=v.slice(W),k+=2,B({type:m,comment:K})}}function U(){var B=O(),W=_(r);if(W){if(I(),!_(a))return C("property missing ':'");var K=_(o),G=B({type:b,property:y(W[0].replace(e,g)),value:K?y(K[0].replace(e,g)):g});return _(s),G}}function $(){var B=[];D(B);for(var W;W=U();)W!==!1&&(B.push(W),D(B));return B}return M(),$()};function y(v){return v?v.replace(l,g):g}return bb}var mI;function jse(){if(mI)return ms;mI=1;var e=ms&&ms.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ms,"__esModule",{value:!0}),ms.default=n;var t=e(Bse());function n(r,a){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),l=typeof a=="function";return s.forEach(function(u){if(u.type==="declaration"){var d=u.property,p=u.value;l?a(d,p,u):p&&(o=o||{},o[d]=p)}}),o}return ms}var Use=jse();const bI=un(Use),Gse=bI.default||bI,OG=IG("end"),eA=IG("start");function IG(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Hse(e){const t=eA(e),n=OG(e);if(t&&n)return{start:t,end:n}}function mc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?yI(e.position):"start"in e||"end"in e?yI(e):"line"in e||"column"in e?bk(e):""}function bk(e){return vI(e&&e.line)+":"+vI(e&&e.column)}function yI(e){return bk(e&&e.start)+"-"+bk(e&&e.end)}function vI(e){return e&&typeof e=="number"?e:1}class Cn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(s=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=l?l.line:void 0,this.name=mc(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Cn.prototype.file="";Cn.prototype.name="";Cn.prototype.reason="";Cn.prototype.message="";Cn.prototype.stack="";Cn.prototype.column=void 0;Cn.prototype.line=void 0;Cn.prototype.ancestors=void 0;Cn.prototype.cause=void 0;Cn.prototype.fatal=void 0;Cn.prototype.place=void 0;Cn.prototype.ruleId=void 0;Cn.prototype.source=void 0;const tA={}.hasOwnProperty,$se=new Map,qse=/[A-Z]/g,Vse=/-([a-z])/g,Wse=new Set(["table","tbody","thead","tfoot","tr"]),Yse=new Set(["td","th"]),DG="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function LG(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=nle(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=tle(n,t.jsx,t.jsxs)}const a={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"?JT:Fse,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=MG(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function MG(e,t,n){if(t.type==="element")return Kse(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Xse(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qse(e,t,n);if(t.type==="mdxjsEsm")return Zse(e,t);if(t.type==="root")return Jse(e,t,n);if(t.type==="text")return ele(e,t)}function Kse(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=JT,e.schema=a),e.ancestors.push(t);const o=FG(e,t.tagName,!1),s=rle(e,t);let l=rA(e,t);return Wse.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Ase(u):!0})),PG(e,s,o,t),nA(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Xse(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Lc(e,t.position)}function Zse(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lc(e,t.position)}function Qse(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=JT,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:FG(e,t.name,!0),s=ale(e,t),l=rA(e,t);return PG(e,s,o,t),nA(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Jse(e,t,n){const r={};return nA(r,rA(e,t)),e.create(t,e.Fragment,r,n)}function ele(e,t){return t.value}function PG(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nA(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function tle(e,t,n){return r;function r(a,o,s,l){const d=Array.isArray(s.children)?n:t;return l?d(o,s,l):d(o,s)}}function nle(e,t){return n;function n(r,a,o,s){const l=Array.isArray(o.children),u=eA(r);return t(a,o,s,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function rle(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&tA.call(t.properties,a)){const o=ole(e,a,t.properties[a]);if(o){const[s,l]=o;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&Yse.has(t.tagName)?r=l:n[s]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ale(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Lc(e,t.position);else{const a=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Lc(e,t.position);else o=r.value===null?!0:r.value;n[a]=o}return n}function rA(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:$se;for(;++ra?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(or(e,e.length,0,t),e):t}const wI={}.hasOwnProperty;function BG(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Br(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const In=Po(/[A-Za-z]/),Tn=Po(/[\dA-Za-z]/),hle=Po(/[#-'*+\--9=?A-Z^-~]/);function Pf(e){return e!==null&&(e<32||e===127)}const yk=Po(/\d/),mle=Po(/[\dA-Fa-f]/),ble=Po(/[!-/:-@[-`{-~]/);function Ve(e){return e!==null&&e<-2}function Dt(e){return e!==null&&(e<0||e===32)}function pt(e){return e===-2||e===-1||e===32}const Dp=Po(new RegExp("\\p{P}|\\p{S}","u")),xi=Po(/\s/);function Po(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function rl(e){const t=[];let n=-1,r=0,a=0;for(;++n55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(s=String.fromCharCode(o,l),a=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+a+1,s=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function dt(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return pt(u)?(e.enter(n),l(u)):t(u)}function l(u){return pt(u)&&o++s))return;const _=t.events.length;let M=_,D,I;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(D){I=t.events[M][1].end;break}D=!0}for(T(r),C=_;CR;){const N=n[O];t.containerState=N[1],N[0].exit.call(t,e)}n.length=R}function k(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function wle(e,t,n){return dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function js(e){if(e===null||Dt(e)||xi(e))return 1;if(Dp(e))return 2}function Lp(e,t,n){const r=[];let a=-1;for(;++a1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},m={...e[n][1].start};kI(g,-u),kI(m,u),s={type:u>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:u>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Er(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Er(d,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",o,t]]),d=Er(d,Lp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Er(d,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=Er(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,or(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n0&&pt(C)?dt(e,k,"linePrefix",o+1)(C):k(C)}function k(C){return C===null||Ve(C)?e.check(TI,v,O)(C):(e.enter("codeFlowValue"),R(C))}function R(C){return C===null||Ve(C)?(e.exit("codeFlowValue"),k(C)):(e.consume(C),R)}function O(C){return e.exit("codeFenced"),t(C)}function N(C,_,M){let D=0;return I;function I(K){return C.enter("lineEnding"),C.consume(K),C.exit("lineEnding"),U}function U(K){return C.enter("codeFencedFence"),pt(K)?dt(C,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):$(K)}function $(K){return K===l?(C.enter("codeFencedFenceSequence"),B(K)):M(K)}function B(K){return K===l?(D++,C.consume(K),B):D>=s?(C.exit("codeFencedFenceSequence"),pt(K)?dt(C,W,"whitespace")(K):W(K)):M(K)}function W(K){return K===null||Ve(K)?(C.exit("codeFencedFence"),_(K)):M(K)}}}function Lle(e,t,n){const r=this;return a;function a(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const vb={name:"codeIndented",tokenize:Ple},Mle={partial:!0,tokenize:Fle};function Ple(e,t,n){const r=this;return a;function a(d){return e.enter("codeIndented"),dt(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?u(d):Ve(d)?e.attempt(Mle,s,u)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||Ve(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),l)}function u(d){return e.exit("codeIndented"),t(d)}}function Fle(e,t,n){const r=this;return a;function a(s){return r.parser.lazy[r.now().line]?n(s):Ve(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):dt(e,o,"linePrefix",5)(s)}function o(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):Ve(s)?a(s):n(s)}}const zle={name:"codeText",previous:jle,resolve:Ble,tokenize:Ule};function Ble(e){let t=e.length-4,n=3,r,a;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=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&uc(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),uc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),uc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function qG(e,t,n,r,a,o,s,l,u){const d=u||Number.POSITIVE_INFINITY;let p=0;return g;function g(T){return T===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(T),e.exit(o),m):T===null||T===32||T===41||Pf(T)?n(T):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),v(T))}function m(T){return T===62?(e.enter(o),e.consume(T),e.exit(o),e.exit(a),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),b(T))}function b(T){return T===62?(e.exit("chunkString"),e.exit(l),m(T)):T===null||T===60||Ve(T)?n(T):(e.consume(T),T===92?y:b)}function y(T){return T===60||T===62||T===92?(e.consume(T),b):b(T)}function v(T){return!p&&(T===null||T===41||Dt(T))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(T)):p999||b===null||b===91||b===93&&!u||b===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(b):b===93?(e.exit(o),e.enter(a),e.consume(b),e.exit(a),e.exit(r),t):Ve(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Ve(b)||l++>999?(e.exit("chunkString"),p(b)):(e.consume(b),u||(u=!pt(b)),b===92?m:g)}function m(b){return b===91||b===92||b===93?(e.consume(b),l++,g):g(b)}}function WG(e,t,n,r,a,o){let s;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(a),e.consume(m),e.exit(a),s=m===40?41:m,u):n(m)}function u(m){return m===s?(e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):(e.enter(o),d(m))}function d(m){return m===s?(e.exit(o),u(s)):m===null?n(m):Ve(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),dt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===s||m===null||Ve(m)?(e.exit("chunkString"),d(m)):(e.consume(m),m===92?g:p)}function g(m){return m===s||m===92?(e.consume(m),p):p(m)}}function bc(e,t){let n;return r;function r(a){return Ve(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):pt(a)?dt(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const Kle={name:"definition",tokenize:Zle},Xle={partial:!0,tokenize:Qle};function Zle(e,t,n){const r=this;let a;return o;function o(b){return e.enter("definition"),s(b)}function s(b){return VG.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function l(b){return a=Br(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),u):n(b)}function u(b){return Dt(b)?bc(e,d)(b):d(b)}function d(b){return qG(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return e.attempt(Xle,g,g)(b)}function g(b){return pt(b)?dt(e,m,"whitespace")(b):m(b)}function m(b){return b===null||Ve(b)?(e.exit("definition"),r.parser.defined.push(a),t(b)):n(b)}}function Qle(e,t,n){return r;function r(l){return Dt(l)?bc(e,a)(l):n(l)}function a(l){return WG(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return pt(l)?dt(e,s,"whitespace")(l):s(l)}function s(l){return l===null||Ve(l)?t(l):n(l)}}const Jle={name:"hardBreakEscape",tokenize:ece};function ece(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return Ve(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const tce={name:"headingAtx",resolve:nce,tokenize:rce};function nce(e,t){let n=e.length-2,r=3,a,o;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&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},or(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function rce(e,t,n){let r=0;return a;function a(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||Dt(p)?(e.exit("atxHeadingSequence"),l(p)):n(p)}function l(p){return p===35?(e.enter("atxHeadingSequence"),u(p)):p===null||Ve(p)?(e.exit("atxHeading"),t(p)):pt(p)?dt(e,l,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function u(p){return p===35?(e.consume(p),u):(e.exit("atxHeadingSequence"),l(p))}function d(p){return p===null||p===35||Dt(p)?(e.exit("atxHeadingText"),l(p)):(e.consume(p),d)}}const ace=["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"],RI=["pre","script","style","textarea"],oce={concrete:!0,name:"htmlFlow",resolveTo:lce,tokenize:cce},ice={partial:!0,tokenize:dce},sce={partial:!0,tokenize:uce};function lce(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 cce(e,t,n){const r=this;let a,o,s,l,u;return d;function d(P){return p(P)}function p(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),g}function g(P){return P===33?(e.consume(P),m):P===47?(e.consume(P),o=!0,v):P===63?(e.consume(P),a=3,r.interrupt?t:L):In(P)?(e.consume(P),s=String.fromCharCode(P),x):n(P)}function m(P){return P===45?(e.consume(P),a=2,b):P===91?(e.consume(P),a=5,l=0,y):In(P)?(e.consume(P),a=4,r.interrupt?t:L):n(P)}function b(P){return P===45?(e.consume(P),r.interrupt?t:L):n(P)}function y(P){const Z="CDATA[";return P===Z.charCodeAt(l++)?(e.consume(P),l===Z.length?r.interrupt?t:$:y):n(P)}function v(P){return In(P)?(e.consume(P),s=String.fromCharCode(P),x):n(P)}function x(P){if(P===null||P===47||P===62||Dt(P)){const Z=P===47,Q=s.toLowerCase();return!Z&&!o&&RI.includes(Q)?(a=1,r.interrupt?t(P):$(P)):ace.includes(s.toLowerCase())?(a=6,Z?(e.consume(P),T):r.interrupt?t(P):$(P)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):o?k(P):R(P))}return P===45||Tn(P)?(e.consume(P),s+=String.fromCharCode(P),x):n(P)}function T(P){return P===62?(e.consume(P),r.interrupt?t:$):n(P)}function k(P){return pt(P)?(e.consume(P),k):I(P)}function R(P){return P===47?(e.consume(P),I):P===58||P===95||In(P)?(e.consume(P),O):pt(P)?(e.consume(P),R):I(P)}function O(P){return P===45||P===46||P===58||P===95||Tn(P)?(e.consume(P),O):N(P)}function N(P){return P===61?(e.consume(P),C):pt(P)?(e.consume(P),N):R(P)}function C(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),u=P,_):pt(P)?(e.consume(P),C):M(P)}function _(P){return P===u?(e.consume(P),u=null,D):P===null||Ve(P)?n(P):(e.consume(P),_)}function M(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Dt(P)?N(P):(e.consume(P),M)}function D(P){return P===47||P===62||pt(P)?R(P):n(P)}function I(P){return P===62?(e.consume(P),U):n(P)}function U(P){return P===null||Ve(P)?$(P):pt(P)?(e.consume(P),U):n(P)}function $(P){return P===45&&a===2?(e.consume(P),G):P===60&&a===1?(e.consume(P),H):P===62&&a===4?(e.consume(P),V):P===63&&a===3?(e.consume(P),L):P===93&&a===5?(e.consume(P),Y):Ve(P)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(ice,j,B)(P)):P===null||Ve(P)?(e.exit("htmlFlowData"),B(P)):(e.consume(P),$)}function B(P){return e.check(sce,W,j)(P)}function W(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),K}function K(P){return P===null||Ve(P)?B(P):(e.enter("htmlFlowData"),$(P))}function G(P){return P===45?(e.consume(P),L):$(P)}function H(P){return P===47?(e.consume(P),s="",F):$(P)}function F(P){if(P===62){const Z=s.toLowerCase();return RI.includes(Z)?(e.consume(P),V):$(P)}return In(P)&&s.length<8?(e.consume(P),s+=String.fromCharCode(P),F):$(P)}function Y(P){return P===93?(e.consume(P),L):$(P)}function L(P){return P===62?(e.consume(P),V):P===45&&a===2?(e.consume(P),L):$(P)}function V(P){return P===null||Ve(P)?(e.exit("htmlFlowData"),j(P)):(e.consume(P),V)}function j(P){return e.exit("htmlFlow"),t(P)}}function uce(e,t,n){const r=this;return a;function a(s){return Ve(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function dce(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(iu,t,n)}}const fce={name:"htmlText",tokenize:pce};function pce(e,t,n){const r=this;let a,o,s;return l;function l(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),u}function u(L){return L===33?(e.consume(L),d):L===47?(e.consume(L),N):L===63?(e.consume(L),R):In(L)?(e.consume(L),M):n(L)}function d(L){return L===45?(e.consume(L),p):L===91?(e.consume(L),o=0,y):In(L)?(e.consume(L),k):n(L)}function p(L){return L===45?(e.consume(L),b):n(L)}function g(L){return L===null?n(L):L===45?(e.consume(L),m):Ve(L)?(s=g,H(L)):(e.consume(L),g)}function m(L){return L===45?(e.consume(L),b):g(L)}function b(L){return L===62?G(L):L===45?m(L):g(L)}function y(L){const V="CDATA[";return L===V.charCodeAt(o++)?(e.consume(L),o===V.length?v:y):n(L)}function v(L){return L===null?n(L):L===93?(e.consume(L),x):Ve(L)?(s=v,H(L)):(e.consume(L),v)}function x(L){return L===93?(e.consume(L),T):v(L)}function T(L){return L===62?G(L):L===93?(e.consume(L),T):v(L)}function k(L){return L===null||L===62?G(L):Ve(L)?(s=k,H(L)):(e.consume(L),k)}function R(L){return L===null?n(L):L===63?(e.consume(L),O):Ve(L)?(s=R,H(L)):(e.consume(L),R)}function O(L){return L===62?G(L):R(L)}function N(L){return In(L)?(e.consume(L),C):n(L)}function C(L){return L===45||Tn(L)?(e.consume(L),C):_(L)}function _(L){return Ve(L)?(s=_,H(L)):pt(L)?(e.consume(L),_):G(L)}function M(L){return L===45||Tn(L)?(e.consume(L),M):L===47||L===62||Dt(L)?D(L):n(L)}function D(L){return L===47?(e.consume(L),G):L===58||L===95||In(L)?(e.consume(L),I):Ve(L)?(s=D,H(L)):pt(L)?(e.consume(L),D):G(L)}function I(L){return L===45||L===46||L===58||L===95||Tn(L)?(e.consume(L),I):U(L)}function U(L){return L===61?(e.consume(L),$):Ve(L)?(s=U,H(L)):pt(L)?(e.consume(L),U):D(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),a=L,B):Ve(L)?(s=$,H(L)):pt(L)?(e.consume(L),$):(e.consume(L),W)}function B(L){return L===a?(e.consume(L),a=void 0,K):L===null?n(L):Ve(L)?(s=B,H(L)):(e.consume(L),B)}function W(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||Dt(L)?D(L):(e.consume(L),W)}function K(L){return L===47||L===62||Dt(L)?D(L):n(L)}function G(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function H(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),F}function F(L){return pt(L)?dt(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):Y(L)}function Y(L){return e.enter("htmlTextData"),s(L)}}const iA={name:"labelEnd",resolveAll:bce,resolveTo:yce,tokenize:vce},gce={tokenize:Sce},hce={tokenize:Ece},mce={tokenize:wce};function bce(e){let t=-1;const n=[];for(;++t=3&&(d===null||Ve(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===a?(e.consume(d),r++,u):(e.exit("thematicBreakSequence"),pt(d)?dt(e,l,"whitespace")(d):l(d))}}const Bn={continuation:{tokenize:Ice},exit:Lce,name:"list",tokenize:Oce},_ce={partial:!0,tokenize:Mce},Nce={partial:!0,tokenize:Dce};function Oce(e,t,n){const r=this,a=r.events[r.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return l;function l(b){const y=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:yk(b)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(df,n,d)(b):d(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(b)}return n(b)}function u(b){return yk(b)&&++s<10?(e.consume(b),u):(!r.interrupt||s<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):n(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(iu,r.interrupt?n:p,e.attempt(_ce,m,g))}function p(b){return r.containerState.initialBlankLine=!0,o++,m(b)}function g(b){return pt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),m):n(b)}function m(b){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function Ice(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(iu,a,o);function a(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,dt(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!pt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Nce,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,dt(e,e.attempt(Bn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Dce(e,t,n){const r=this;return dt(e,a,"listItemIndent",r.containerState.size+1);function a(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Lce(e){e.exit(this.containerState.type)}function Mce(e,t,n){const r=this;return dt(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const s=r.events[r.events.length-1];return!pt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const CI={name:"setextUnderline",resolveTo:Pce,tokenize:Fce};function Pce(e,t){let n=e.length,r,a,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Fce(e,t,n){const r=this;let a;return o;function o(d){let p=r.events.length,g;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){g=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),a=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===a?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),pt(d)?dt(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||Ve(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const zce={tokenize:Bce};function Bce(e){const t=this,n=e.attempt(iu,r,e.attempt(this.parser.constructs.flowInitial,a,dt(e,e.attempt(this.parser.constructs.flow,a,e.attempt($le,a)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const jce={resolveAll:KG()},Uce=YG("string"),Gce=YG("text");function YG(e){return{resolveAll:KG(e==="text"?Hce:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],o=n.attempt(a,s,l);return s;function s(p){return d(p)?o(p):l(p)}function l(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),u}function u(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),u)}function d(p){if(p===null)return!0;const g=a[p];let m=-1;if(g)for(;++m-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(e[a].slice(0,o))}return s}function nue(e,t){let n=-1;const r=[];let a;for(;++n0){const St=Ne.tokenStack[Ne.tokenStack.length-1];(St[1]||NI).call(Ne,void 0,St[0])}for(de.position={start:So(ee.length>0?ee[0][1].start:{line:1,column:1,offset:0}),end:So(ee.length>0?ee[ee.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We{var e;try{const t=localStorage.getItem("settings-storage");if(t)return((e=JSON.parse(t).state)==null?void 0:e.language)||"en"}catch(t){console.error("Failed to get stored language:",t)}return"en"};rn.use(RW).init({resources:{en:{translation:hxe},zh:{translation:Txe},fr:{translation:Mxe},ar:{translation:qxe}},lng:Vxe(),fallbackLng:"en",interpolation:{escapeValue:!1},returnEmptyString:!1,returnNull:!1});Ie.subscribe(e=>{const t=e.language;rn.language!==t&&rn.changeLanguage(t)});Sq.createRoot(document.getElementById("root")).render(E.jsx(w.StrictMode,{children:E.jsx(jwe,{})})); diff --git a/lightrag/api/webui/index.html b/lightrag/api/webui/index.html index 91068025..070c3628 100644 --- a/lightrag/api/webui/index.html +++ b/lightrag/api/webui/index.html @@ -8,7 +8,7 @@ Lightrag - +