@railtownai/railtracks-visualizer 0.0.17 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react"),t=require("react-dom"),n=require("react/jsx-runtime");function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var r=o(e),a=o(t);function i(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,o=0;o<e.length;o++)""!==(n=i(e[o]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l,c={exports:{}},u={},d={exports:{}},f={};var p,h,m,g={};function y(){return h||(h=1,"production"===process.env.NODE_ENV?d.exports=function(){if(l)return f;l=1;var t=e,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useState,r=t.useEffect,a=t.useLayoutEffect,i=t.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!n(e,o)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),l=o({inst:{value:n,getSnapshot:t}}),c=l[0].inst,u=l[1];return a(function(){c.value=n,c.getSnapshot=t,s(c)&&u({inst:c})},[e,n,t]),r(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),i(n),n};return f.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:c,f}():d.exports=(p||(p=1,"production"!==process.env.NODE_ENV&&function(){function t(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=e,o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useState,a=n.useEffect,i=n.useLayoutEffect,s=n.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,u){l||void 0===n.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=u();if(!c){var f=u();o(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var p=(f=r({inst:{value:d,getSnapshot:u}}))[0].inst,h=f[1];return i(function(){p.value=d,p.getSnapshot=u,t(p)&&h({inst:p})},[e,d,u]),a(function(){return t(p)&&h({inst:p}),e(function(){t(p)&&h({inst:p})})},[e]),s(d),d};g.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),g)),d.exports}var v,b={};"production"===process.env.NODE_ENV?c.exports=function(){if(m)return u;m=1;var t=e,n=y(),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useSyncExternalStore,a=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;return u.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,o(r,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(r=e,t):(r=e,a=n)}var r,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=r(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},u}():c.exports=(v||(v=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=e,n=y(),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useSyncExternalStore,a=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;b.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,o(r,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(r=e,t):(r=e,a=n)}var r,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=r(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),b);var w=s(c.exports);const x=e=>{let t;const n=new Set,o=(e,o)=>{const r="function"==typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=o?o:"object"!=typeof r||null===r)?r:Object.assign({},t,r),n.forEach(n=>n(t,e))}},r=()=>t,a={setState:o,getState:r,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(o,r,a);return a},{useDebugValue:E}=e,{useSyncExternalStoreWithSelector:S}=w,_=e=>e;function k(e,t=_,n){const o=S(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return E(o),o}const C=(e,t)=>{const n=(e=>e?x(e):x)(e),o=(e,o=t)=>k(n,e,o);return Object.assign(o,n),o};function N(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,o]of e)if(!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var M={value:()=>{}};function O(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw new Error("illegal type: "+e);o[e]=[]}return new P(o)}function P(e){this._=e}function R(e,t){for(var n,o=0,r=e.length;o<r;++o)if((n=e[o]).name===t)return n.value}function A(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=M,e=e.slice(0,o).concat(e.slice(o+1));break}return null!=n&&e.push({name:t,value:n}),e}P.prototype=O.prototype={constructor:P,on:function(e,t){var n,o,r=this._,a=(o=r,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!o.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),i=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<s;)if(n=(e=a[i]).type)r[n]=A(r[n],e.name,t);else if(null==t)for(n in r)r[n]=A(r[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=R(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new P(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,o,r=new Array(n),a=0;a<n;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(o=this._[e]).length;a<n;++a)o[a].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,a=o.length;r<a;++r)o[r].value.apply(t,n)}};var D="http://www.w3.org/1999/xhtml",T={svg:"http://www.w3.org/2000/svg",xhtml:D,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function I(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),T.hasOwnProperty(t)?{space:T[t],local:e}:e}function z(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===D&&t.documentElement.namespaceURI===D?t.createElement(e):t.createElementNS(n,e)}}function L(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function $(e){var t=I(e);return(t.local?L:z)(t)}function B(){}function j(e){return null==e?B:function(){return this.querySelector(e)}}function H(){return[]}function F(e){return null==e?H:function(){return this.querySelectorAll(e)}}function V(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function W(e){return function(){return this.matches(e)}}function Y(e){return function(t){return t.matches(e)}}var X=Array.prototype.find;function K(){return this.firstElementChild}var q=Array.prototype.filter;function U(){return Array.from(this.children)}function Z(e){return new Array(e.length)}function G(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Q(e,t,n,o,r,a){for(var i,s=0,l=t.length,c=a.length;s<c;++s)(i=t[s])?(i.__data__=a[s],o[s]=i):n[s]=new G(e,a[s]);for(;s<l;++s)(i=t[s])&&(r[s]=i)}function J(e,t,n,o,r,a,i){var s,l,c,u=new Map,d=t.length,f=a.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=i.call(l,l.__data__,s,t)+"",u.has(c)?r[s]=l:u.set(c,l));for(s=0;s<f;++s)c=i.call(e,a[s],s,a)+"",(l=u.get(c))?(o[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new G(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(r[s]=l)}function ee(e){return e.__data__}function te(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function ne(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function oe(e){return function(){this.removeAttribute(e)}}function re(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ae(e,t){return function(){this.setAttribute(e,t)}}function ie(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function se(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function le(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function ce(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ue(e){return function(){this.style.removeProperty(e)}}function de(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fe(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function pe(e,t){return e.style.getPropertyValue(t)||ce(e).getComputedStyle(e,null).getPropertyValue(t)}function he(e){return function(){delete this[e]}}function me(e,t){return function(){this[e]=t}}function ge(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function ye(e){return e.trim().split(/^|\s+/)}function ve(e){return e.classList||new be(e)}function be(e){this._node=e,this._names=ye(e.getAttribute("class")||"")}function we(e,t){for(var n=ve(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function xe(e,t){for(var n=ve(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function Ee(e){return function(){we(this,e)}}function Se(e){return function(){xe(this,e)}}function _e(e,t){return function(){(t.apply(this,arguments)?we:xe)(this,e)}}function ke(){this.textContent=""}function Ce(e){return function(){this.textContent=e}}function Ne(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Me(){this.innerHTML=""}function Oe(e){return function(){this.innerHTML=e}}function Pe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Re(){this.nextSibling&&this.parentNode.appendChild(this)}function Ae(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function De(){return null}function Te(){var e=this.parentNode;e&&e.removeChild(this)}function Ie(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ze(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Le(e){return function(){var t=this.__on;if(t){for(var n,o=0,r=-1,a=t.length;o<a;++o)n=t[o],e.type&&n.type!==e.type||n.name!==e.name?t[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?t.length=r:delete this.__on}}}function $e(e,t,n){return function(){var o,r=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(r)for(var i=0,s=r.length;i<s;++i)if((o=r[i]).type===e.type&&o.name===e.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=n),void(o.value=t);this.addEventListener(e.type,a,n),o={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(o):this.__on=[o]}}function Be(e,t,n){var o=ce(e),r=o.CustomEvent;"function"==typeof r?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function je(e,t){return function(){return Be(this,e,t)}}function He(e,t){return function(){return Be(this,e,t.apply(this,arguments))}}G.prototype={constructor:G,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},be.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var Fe=[null];function Ve(e,t){this._groups=e,this._parents=t}function We(){return new Ve([[document.documentElement]],Fe)}function Ye(e){return"string"==typeof e?new Ve([[document.querySelector(e)]],[document.documentElement]):new Ve([[e]],Fe)}function Xe(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}Ve.prototype=We.prototype={constructor:Ve,select:function(e){"function"!=typeof e&&(e=j(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i,s=t[r],l=s.length,c=o[r]=new Array(l),u=0;u<l;++u)(a=s[u])&&(i=e.call(a,a.__data__,u,s))&&("__data__"in a&&(i.__data__=a.__data__),c[u]=i);return new Ve(o,this._parents)},selectAll:function(e){e="function"==typeof e?V(e):F(e);for(var t=this._groups,n=t.length,o=[],r=[],a=0;a<n;++a)for(var i,s=t[a],l=s.length,c=0;c<l;++c)(i=s[c])&&(o.push(e.call(i,i.__data__,c,s)),r.push(i));return new Ve(o,r)},selectChild:function(e){return this.select(null==e?K:function(e){return function(){return X.call(this.children,e)}}("function"==typeof e?e:Y(e)))},selectChildren:function(e){return this.selectAll(null==e?U:function(e){return function(){return q.call(this.children,e)}}("function"==typeof e?e:Y(e)))},filter:function(e){"function"!=typeof e&&(e=W(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i=t[r],s=i.length,l=o[r]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new Ve(o,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,ee);var n,o=t?J:Q,r=this._parents,a=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var i=a.length,s=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var d=r[u],f=a[u],p=f.length,h=te(e.call(d,d&&d.__data__,u,r)),m=h.length,g=l[u]=new Array(m),y=s[u]=new Array(m);o(d,f,g,y,c[u]=new Array(p),h,t);for(var v,b,w=0,x=0;w<m;++w)if(v=g[w]){for(w>=x&&(x=w+1);!(b=y[x])&&++x<m;);v._next=b||null}}return(s=new Ve(s,r))._enter=l,s._exit=c,s},enter:function(){return new Ve(this._enter||this._groups.map(Z),this._parents)},exit:function(){return new Ve(this._exit||this._groups.map(Z),this._parents)},join:function(e,t,n){var o=this.enter(),r=this,a=this.exit();return"function"==typeof e?(o=e(o))&&(o=o.selection()):o=o.append(e+""),null!=t&&(r=t(r))&&(r=r.selection()),null==n?a.remove():n(a),o&&r?o.merge(r).order():r},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,a=o.length,i=Math.min(r,a),s=new Array(r),l=0;l<i;++l)for(var c,u=n[l],d=o[l],f=u.length,p=s[l]=new Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;l<r;++l)s[l]=n[l];return new Ve(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o,r=e[t],a=r.length-1,i=r[a];--a>=0;)(o=r[a])&&(i&&4^o.compareDocumentPosition(i)&&i.parentNode.insertBefore(o,i),i=o);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=ne);for(var n=this._groups,o=n.length,r=new Array(o),a=0;a<o;++a){for(var i,s=n[a],l=s.length,c=r[a]=new Array(l),u=0;u<l;++u)(i=s[u])&&(c[u]=i);c.sort(t)}return new Ve(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,a=o.length;r<a;++r){var i=o[r];if(i)return i}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r,a=t[n],i=0,s=a.length;i<s;++i)(r=a[i])&&e.call(r,r.__data__,i,a);return this},attr:function(e,t){var n=I(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==t?n.local?re:oe:"function"==typeof t?n.local?le:se:n.local?ie:ae)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?ue:"function"==typeof t?fe:de)(e,t,null==n?"":n)):pe(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?he:"function"==typeof t?ge:me)(e,t)):this.node()[e]},classed:function(e,t){var n=ye(e+"");if(arguments.length<2){for(var o=ve(this.node()),r=-1,a=n.length;++r<a;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof t?_e:t?Ee:Se)(n,t))},text:function(e){return arguments.length?this.each(null==e?ke:("function"==typeof e?Ne:Ce)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Me:("function"==typeof e?Pe:Oe)(e)):this.node().innerHTML},raise:function(){return this.each(Re)},lower:function(){return this.each(Ae)},append:function(e){var t="function"==typeof e?e:$(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:$(e),o=null==t?De:"function"==typeof t?t:j(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})},remove:function(){return this.each(Te)},clone:function(e){return this.select(e?ze:Ie)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var o,r,a=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),i=a.length;if(!(arguments.length<2)){for(s=t?$e:Le,o=0;o<i;++o)this.each(s(a[o],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(o=0,l=s[c];o<i;++o)if((r=a[o]).type===l.type&&r.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?He:je)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o,r=e[t],a=0,i=r.length;a<i;++a)(o=r[a])&&(yield o)}};const Ke={passive:!1},qe={capture:!0,passive:!1};function Ue(e){e.stopImmediatePropagation()}function Ze(e){e.preventDefault(),e.stopImmediatePropagation()}function Ge(e){var t=e.document.documentElement,n=Ye(e).on("dragstart.drag",Ze,qe);"onselectstart"in t?n.on("selectstart.drag",Ze,qe):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Qe(e,t){var n=e.document.documentElement,o=Ye(e).on("dragstart.drag",null);t&&(o.on("click.drag",Ze,qe),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Je=e=>()=>e;function et(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:a,x:i,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function tt(e){return!e.ctrlKey&&!e.button}function nt(){return this.parentNode}function ot(e,t){return null==t?{x:e.x,y:e.y}:t}function rt(){return navigator.maxTouchPoints||"ontouchstart"in this}function at(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function it(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function st(){}et.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var lt=.7,ct=1/lt,ut="\\s*([+-]?\\d+)\\s*",dt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pt=/^#([0-9a-f]{3,8})$/,ht=new RegExp(`^rgb\\(${ut},${ut},${ut}\\)$`),mt=new RegExp(`^rgb\\(${ft},${ft},${ft}\\)$`),gt=new RegExp(`^rgba\\(${ut},${ut},${ut},${dt}\\)$`),yt=new RegExp(`^rgba\\(${ft},${ft},${ft},${dt}\\)$`),vt=new RegExp(`^hsl\\(${dt},${ft},${ft}\\)$`),bt=new RegExp(`^hsla\\(${dt},${ft},${ft},${dt}\\)$`),wt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xt(){return this.rgb().formatHex()}function Et(){return this.rgb().formatRgb()}function St(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?_t(t):3===n?new Nt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?kt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?kt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ht.exec(e))?new Nt(t[1],t[2],t[3],1):(t=mt.exec(e))?new Nt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=gt.exec(e))?kt(t[1],t[2],t[3],t[4]):(t=yt.exec(e))?kt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=vt.exec(e))?Dt(t[1],t[2]/100,t[3]/100,1):(t=bt.exec(e))?Dt(t[1],t[2]/100,t[3]/100,t[4]):wt.hasOwnProperty(e)?_t(wt[e]):"transparent"===e?new Nt(NaN,NaN,NaN,0):null}function _t(e){return new Nt(e>>16&255,e>>8&255,255&e,1)}function kt(e,t,n,o){return o<=0&&(e=t=n=NaN),new Nt(e,t,n,o)}function Ct(e,t,n,o){return 1===arguments.length?((r=e)instanceof st||(r=St(r)),r?new Nt((r=r.rgb()).r,r.g,r.b,r.opacity):new Nt):new Nt(e,t,n,null==o?1:o);var r}function Nt(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function Mt(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function Ot(){const e=Pt(this.opacity);return`${1===e?"rgb(":"rgba("}${Rt(this.r)}, ${Rt(this.g)}, ${Rt(this.b)}${1===e?")":`, ${e})`}`}function Pt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function At(e){return((e=Rt(e))<16?"0":"")+e.toString(16)}function Dt(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new It(e,t,n,o)}function Tt(e){if(e instanceof It)return new It(e.h,e.s,e.l,e.opacity);if(e instanceof st||(e=St(e)),!e)return new It;if(e instanceof It)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),a=Math.max(t,n,o),i=NaN,s=a-r,l=(a+r)/2;return s?(i=t===a?(n-o)/s+6*(n<o):n===a?(o-t)/s+2:(t-n)/s+4,s/=l<.5?a+r:2-a-r,i*=60):s=l>0&&l<1?0:i,new It(i,s,l,e.opacity)}function It(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function zt(e){return(e=(e||0)%360)<0?e+360:e}function Lt(e){return Math.max(0,Math.min(1,e||0))}function $t(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}at(st,St,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xt,formatHex:xt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Tt(this).formatHsl()},formatRgb:Et,toString:Et}),at(Nt,Ct,it(st,{brighter(e){return e=null==e?ct:Math.pow(ct,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?lt:Math.pow(lt,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nt(Rt(this.r),Rt(this.g),Rt(this.b),Pt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Mt,formatHex:Mt,formatHex8:function(){return`#${At(this.r)}${At(this.g)}${At(this.b)}${At(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ot,toString:Ot})),at(It,function(e,t,n,o){return 1===arguments.length?Tt(e):new It(e,t,n,null==o?1:o)},it(st,{brighter(e){return e=null==e?ct:Math.pow(ct,e),new It(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?lt:Math.pow(lt,e),new It(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Nt($t(e>=240?e-240:e+120,r,o),$t(e,r,o),$t(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new It(zt(this.h),Lt(this.s),Lt(this.l),Pt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Pt(this.opacity);return`${1===e?"hsl(":"hsla("}${zt(this.h)}, ${100*Lt(this.s)}%, ${100*Lt(this.l)}%${1===e?")":`, ${e})`}`}}));var Bt=e=>()=>e;function jt(e){return 1===(e=+e)?Ht:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}(t,n,e):Bt(isNaN(t)?n:t)}}function Ht(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Bt(isNaN(e)?t:e)}var Ft=function e(t){var n=jt(t);function o(e,t){var o=n((e=Ct(e)).r,(t=Ct(t)).r),r=n(e.g,t.g),a=n(e.b,t.b),i=Ht(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=r(t),e.b=a(t),e.opacity=i(t),e+""}}return o.gamma=e,o}(1);function Vt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Wt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yt=new RegExp(Wt.source,"g");function Xt(e,t){var n,o,r,a=Wt.lastIndex=Yt.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=Wt.exec(e))&&(o=Yt.exec(t));)(r=o.index)>a&&(r=t.slice(a,r),s[i]?s[i]+=r:s[++i]=r),(n=n[0])===(o=o[0])?s[i]?s[i]+=o:s[++i]=o:(s[++i]=null,l.push({i:i,x:Vt(n,o)})),a=Yt.lastIndex;return a<t.length&&(r=t.slice(a),s[i]?s[i]+=r:s[++i]=r),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,o=0;o<t;++o)s[(n=l[o]).i]=n.x(e);return s.join("")})}var Kt,qt=180/Math.PI,Ut={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Zt(e,t,n,o,r,a){var i,s,l;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,i=-i),{translateX:r,translateY:a,rotate:Math.atan2(t,e)*qt,skewX:Math.atan(l)*qt,scaleX:i,scaleY:s}}function Gt(e,t,n,o){function r(e){return e.length?e.pop()+" ":""}return function(a,i){var s=[],l=[];return a=e(a),i=e(i),function(e,o,r,a,i,s){if(e!==r||o!==a){var l=i.push("translate(",null,t,null,n);s.push({i:l-4,x:Vt(e,r)},{i:l-2,x:Vt(o,a)})}else(r||a)&&i.push("translate("+r+t+a+n)}(a.translateX,a.translateY,i.translateX,i.translateY,s,l),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(r(n)+"rotate(",null,o)-2,x:Vt(e,t)})):t&&n.push(r(n)+"rotate("+t+o)}(a.rotate,i.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(r(n)+"skewX(",null,o)-2,x:Vt(e,t)}):t&&n.push(r(n)+"skewX("+t+o)}(a.skewX,i.skewX,s,l),function(e,t,n,o,a,i){if(e!==n||t!==o){var s=a.push(r(a)+"scale(",null,",",null,")");i.push({i:s-4,x:Vt(e,n)},{i:s-2,x:Vt(t,o)})}else 1===n&&1===o||a.push(r(a)+"scale("+n+","+o+")")}(a.scaleX,a.scaleY,i.scaleX,i.scaleY,s,l),a=i=null,function(e){for(var t,n=-1,o=l.length;++n<o;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var Qt=Gt(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ut:Zt(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),Jt=Gt(function(e){return null==e?Ut:(Kt||(Kt=document.createElementNS("http://www.w3.org/2000/svg","g")),Kt.setAttribute("transform",e),(e=Kt.transform.baseVal.consolidate())?Zt((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):Ut)},", ",")",")");function en(e){return((e=Math.exp(e))+1/e)/2}var tn,nn,on=function e(t,n,o){function r(e,r){var a,i,s=e[0],l=e[1],c=e[2],u=r[0],d=r[1],f=r[2],p=u-s,h=d-l,m=p*p+h*h;if(m<1e-12)i=Math.log(f/c)/t,a=function(e){return[s+e*p,l+e*h,c*Math.exp(t*e*i)]};else{var g=Math.sqrt(m),y=(f*f-c*c+o*m)/(2*c*n*g),v=(f*f-c*c-o*m)/(2*f*n*g),b=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);i=(w-b)/t,a=function(e){var o,r=e*i,a=en(b),u=c/(n*g)*(a*(o=t*r+b,((o=Math.exp(2*o))-1)/(o+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*p,l+u*h,c*a/en(t*r+b)]}}return a.duration=1e3*i*t/Math.SQRT2,a}return r.rho=function(t){var n=Math.max(.001,+t),o=n*n;return e(n,o,o*o)},r}(Math.SQRT2,2,4),rn=0,an=0,sn=0,ln=0,cn=0,un=0,dn="object"==typeof performance&&performance.now?performance:Date,fn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function pn(){return cn||(fn(hn),cn=dn.now()+un)}function hn(){cn=0}function mn(){this._call=this._time=this._next=null}function gn(e,t,n){var o=new mn;return o.restart(e,t,n),o}function yn(){cn=(ln=dn.now())+un,rn=an=0;try{!function(){pn(),++rn;for(var e,t=tn;t;)(e=cn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--rn}()}finally{rn=0,function(){var e,t,n=tn,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:tn=t);nn=e,bn(o)}(),cn=0}}function vn(){var e=dn.now(),t=e-ln;t>1e3&&(un-=t,ln=e)}function bn(e){rn||(an&&(an=clearTimeout(an)),e-cn>24?(e<1/0&&(an=setTimeout(yn,e-dn.now()-un)),sn&&(sn=clearInterval(sn))):(sn||(ln=dn.now(),sn=setInterval(vn,1e3)),rn=1,fn(yn)))}function wn(e,t,n){var o=new mn;return t=null==t?0:+t,o.restart(n=>{o.stop(),e(n+t)},t,n),o}mn.prototype=gn.prototype={constructor:mn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?pn():+n)+(null==t?0:+t),this._next||nn===this||(nn?nn._next=this:tn=this,nn=this),this._call=e,this._time=n,bn()},stop:function(){this._call&&(this._call=null,this._time=1/0,bn())}};var xn=O("start","end","cancel","interrupt"),En=[];function Sn(e,t,n,o,r,a){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var o,r=e.__transition;function a(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)}function i(a){var c,u,d,f;if(1!==n.state)return l();for(c in r)if((f=r[c]).name===n.name){if(3===f.state)return wn(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[c])}if(wn(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,o=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++u]=f);o.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,i=o.length;++a<i;)o[a].call(e,r);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var o in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}r[t]=n,n.timer=gn(a,0,n.time)}(e,n,{name:t,index:o,group:r,on:xn,tween:En,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function _n(e,t){var n=Cn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function kn(e,t){var n=Cn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Cn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Nn(e,t){var n,o,r,a=e.__transition,i=!0;if(a){for(r in t=null==t?null:t+"",a)(n=a[r]).name===t?(o=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[r]):i=!1;i&&delete e.__transition}}function Mn(e,t){var n,o;return function(){var r=kn(this,e),a=r.tween;if(a!==n)for(var i=0,s=(o=n=a).length;i<s;++i)if(o[i].name===t){(o=o.slice()).splice(i,1);break}r.tween=o}}function On(e,t,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var a=kn(this,e),i=a.tween;if(i!==o){r=(o=i).slice();for(var s={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=s;break}l===c&&r.push(s)}a.tween=r}}function Pn(e,t,n){var o=e._id;return e.each(function(){var e=kn(this,o);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return Cn(e,o).value[t]}}function Rn(e,t){var n;return("number"==typeof t?Vt:t instanceof St?Ft:(n=St(t))?(t=n,Ft):Xt)(e,t)}function An(e){return function(){this.removeAttribute(e)}}function Dn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tn(e,t,n){var o,r,a=n+"";return function(){var i=this.getAttribute(e);return i===a?null:i===o?r:r=t(o=i,n)}}function In(e,t,n){var o,r,a=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===o?r:r=t(o=i,n)}}function zn(e,t,n){var o,r,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttribute(e))===(s=l+"")?null:i===o&&s===r?a:(r=s,a=t(o=i,l));this.removeAttribute(e)}}function Ln(e,t,n){var o,r,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:i===o&&s===r?a:(r=s,a=t(o=i,l));this.removeAttributeNS(e.space,e.local)}}function $n(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,r)),n}return r._value=t,r}function Bn(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,r)),n}return r._value=t,r}function jn(e,t){return function(){_n(this,e).delay=+t.apply(this,arguments)}}function Hn(e,t){return t=+t,function(){_n(this,e).delay=t}}function Fn(e,t){return function(){kn(this,e).duration=+t.apply(this,arguments)}}function Vn(e,t){return t=+t,function(){kn(this,e).duration=t}}var Wn=We.prototype.constructor;function Yn(e){return function(){this.style.removeProperty(e)}}var Xn=0;function Kn(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function qn(){return++Xn}var Un=We.prototype;Kn.prototype={constructor:Kn,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=j(e));for(var o=this._groups,r=o.length,a=new Array(r),i=0;i<r;++i)for(var s,l,c=o[i],u=c.length,d=a[i]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,Sn(d[f],t,n,f,d,Cn(s,n)));return new Kn(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=F(e));for(var o=this._groups,r=o.length,a=[],i=[],s=0;s<r;++s)for(var l,c=o[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,p=e.call(l,l.__data__,d,c),h=Cn(l,n),m=0,g=p.length;m<g;++m)(f=p[m])&&Sn(f,t,n,m,p,h);a.push(p),i.push(l)}return new Kn(a,i,t,n)},selectChild:Un.selectChild,selectChildren:Un.selectChildren,filter:function(e){"function"!=typeof e&&(e=W(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var a,i=t[r],s=i.length,l=o[r]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new Kn(o,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,a=Math.min(o,r),i=new Array(o),s=0;s<a;++s)for(var l,c=t[s],u=n[s],d=c.length,f=i[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<o;++s)i[s]=t[s];return new Kn(i,this._parents,this._name,this._id)},selection:function(){return new Wn(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=qn(),o=this._groups,r=o.length,a=0;a<r;++a)for(var i,s=o[a],l=s.length,c=0;c<l;++c)if(i=s[c]){var u=Cn(i,t);Sn(i,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Kn(o,this._parents,e,n)},call:Un.call,nodes:Un.nodes,node:Un.node,size:Un.size,empty:Un.empty,each:Un.each,on:function(e,t){var n=this._id;return arguments.length<2?Cn(this.node(),n).on.on(e):this.each(function(e,t,n){var o,r,a=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?_n:kn;return function(){var i=a(this,e),s=i.on;s!==o&&(r=(o=s).copy()).on(t,n),i.on=r}}(n,e,t))},attr:function(e,t){var n=I(e),o="transform"===n?Jt:Rn;return this.attrTween(e,"function"==typeof t?(n.local?Ln:zn)(n,o,Pn(this,"attr."+e,t)):null==t?(n.local?Dn:An)(n):(n.local?In:Tn)(n,o,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var o=I(e);return this.tween(n,(o.local?$n:Bn)(o,t))},style:function(e,t,n){var o="transform"==(e+="")?Qt:Rn;return null==t?this.styleTween(e,function(e,t){var n,o,r;return function(){var a=pe(this,e),i=(this.style.removeProperty(e),pe(this,e));return a===i?null:a===n&&i===o?r:r=t(n=a,o=i)}}(e,o)).on("end.style."+e,Yn(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var o,r,a;return function(){var i=pe(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=pe(this,e)),i===l?null:i===o&&l===r?a:(r=l,a=t(o=i,s))}}(e,o,Pn(this,"style."+e,t))).each(function(e,t){var n,o,r,a,i="style."+t,s="end."+i;return function(){var l=kn(this,e),c=l.on,u=null==l.value[i]?a||(a=Yn(t)):void 0;c===n&&r===u||(o=(n=c).copy()).on(s,r=u),l.on=o}}(this._id,e)):this.styleTween(e,function(e,t,n){var o,r,a=n+"";return function(){var i=pe(this,e);return i===a?null:i===o?r:r=t(o=i,n)}}(e,o,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==t)return this.tween(o,null);if("function"!=typeof t)throw new Error;return this.tween(o,function(e,t,n){var o,r;function a(){var a=t.apply(this,arguments);return a!==r&&(o=(r=a)&&function(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}(e,a,n)),o}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(Pn(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function o(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&function(e){return function(t){this.textContent=e.call(this,t)}}(o)),t}return o._value=e,o}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o,r=Cn(this.node(),n).tween,a=0,i=r.length;a<i;++a)if((o=r[a]).name===e)return o.value;return null}return this.each((null==t?Mn:On)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?jn:Hn)(t,e)):Cn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Fn:Vn)(t,e)):Cn(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){kn(this,e).ease=t}}(t,e)):Cn(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;kn(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(a,i){var s={value:i},l={value:function(){0===--r&&a()}};n.each(function(){var n=kn(this,o),r=n.on;r!==e&&((t=(e=r).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===r&&a()})},[Symbol.iterator]:Un[Symbol.iterator]};var Zn={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function Gn(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}We.prototype.interrupt=function(e){return this.each(function(){Nn(this,e)})},We.prototype.transition=function(e){var t,n;e instanceof Kn?(t=e._id,e=e._name):(t=qn(),(n=Zn).time=pn(),e=null==e?null:e+"");for(var o=this._groups,r=o.length,a=0;a<r;++a)for(var i,s=o[a],l=s.length,c=0;c<l;++c)(i=s[c])&&Sn(i,e,t,c,s,n||Gn(i,t));return new Kn(o,this._parents,e,t)};var Qn=e=>()=>e;function Jn(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function eo(e,t,n){this.k=e,this.x=t,this.y=n}eo.prototype={constructor:eo,scale:function(e){return 1===e?this:new eo(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new eo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var to=new eo(1,0,0);function no(e){e.stopImmediatePropagation()}function oo(e){e.preventDefault(),e.stopImmediatePropagation()}function ro(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function ao(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function io(){return this.__zoom||to}function so(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lo(){return navigator.maxTouchPoints||"ontouchstart"in this}function co(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}eo.prototype;const uo=e.createContext(null),fo=uo.Provider,po=()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",ho=e=>`Node type "${e}" not found. Using fallback type "default".`,mo=()=>"The React Flow parent container needs a width and a height to render the graph.",go=()=>"Only child nodes can use a parent extent.",yo=()=>"Can't create edge. An edge needs a source and a target.",vo=e=>`Marker type "${e}" doesn't exist.`,bo=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,wo=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",xo=e=>`Edge type "${e}" not found. Using fallback type "default".`,Eo=e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,So=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function _o(t,n){const o=e.useContext(uo);if(null===o)throw new Error(So);return k(o,t,n)}const ko=()=>{const t=e.useContext(uo);if(null===t)throw new Error(So);return e.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},Co=e=>e.userSelectionActive?"none":"all";function No({position:t,children:n,className:o,style:r,...a}){const s=_o(Co),l=`${t}`.split("-");return e.createElement("div",{className:i(["react-flow__panel",o,...l]),style:{...r,pointerEvents:s},...a},n)}function Mo({proOptions:t,position:n="bottom-right"}){return t?.hideAttribution?null:e.createElement(No,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},e.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var Oo=e.memo(({x:t,y:n,label:o,labelStyle:r={},labelShowBg:a=!0,labelBgStyle:s={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:u,className:d,...f})=>{const p=e.useRef(null),[h,m]=e.useState({x:0,y:0,width:0,height:0}),g=i(["react-flow__edge-textwrapper",d]);return e.useEffect(()=>{if(p.current){const e=p.current.getBBox();m({x:e.x,y:e.y,width:e.width,height:e.height})}},[o]),void 0!==o&&o?e.createElement("g",{transform:`translate(${t-h.width/2} ${n-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...f},a&&e.createElement("rect",{width:h.width+2*l[0],x:-l[0],y:-l[1],height:h.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),e.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:p,style:r},o),u):null});const Po=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ro=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ao=(e={x:0,y:0},t)=>({x:Ro(e.x,t[0][0],t[1][0]),y:Ro(e.y,t[0][1],t[1][1])}),Do=(e,t,n)=>e<t?Ro(Math.abs(e-t),1,50)/50:e>n?-Ro(Math.abs(e-n),1,50)/50:0,To=(e,t)=>[20*Do(e.x,35,t.width-35),20*Do(e.y,35,t.height-35)],Io=e=>e.getRootNode?.()||window?.document,zo=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),Lo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),$o=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Bo=e=>!isNaN(e)&&isFinite(e),jo=Symbol.for("internals"),Ho=["Enter"," ","Escape"],Fo=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function Vo(e){const t=(e=>"nativeEvent"in e)(e)?e.nativeEvent:e,n=t.composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const Wo=e=>"clientX"in e,Yo=(e,t)=>{const n=Wo(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Xo=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,Ko=({id:t,path:n,labelX:o,labelY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>e.createElement(e.Fragment,null,e.createElement("path",{id:t,style:d,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&e.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),a&&Bo(o)&&Bo(r)?e.createElement(Oo,{x:o,y:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function qo(e,t,n){return void 0===n?n:o=>{const r=t().edges.find(t=>t.id===e);r&&n(o,{...r})}}function Uo({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,a=n<e?n+r:n-r,i=Math.abs(o-t)/2;return[a,o<t?o+i:o-i,r,i]}function Zo({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:a,targetControlX:i,targetControlY:s}){const l=.125*e+.375*r+.375*i+.125*n,c=.125*t+.375*a+.375*s+.125*o;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var Go,Qo,Jo,er,tr,nr;function or({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===nr.Left||e===nr.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function rr({sourceX:e,sourceY:t,sourcePosition:n=nr.Bottom,targetX:o,targetY:r,targetPosition:a=nr.Top}){const[i,s]=or({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=or({pos:a,x1:o,y1:r,x2:e,y2:t}),[u,d,f,p]=Zo({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${i},${s} ${l},${c} ${o},${r}`,u,d,f,p]}Ko.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(Go||(Go={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(Qo||(Qo={})),function(e){e.Partial="partial",e.Full="full"}(Jo||(Jo={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(er||(er={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(tr||(tr={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(nr||(nr={}));const ar=e.memo(({sourceX:t,sourceY:n,targetX:o,targetY:r,sourcePosition:a=nr.Bottom,targetPosition:i=nr.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})=>{const[y,v,b]=rr({sourceX:t,sourceY:n,sourcePosition:a,targetX:o,targetY:r,targetPosition:i});return e.createElement(Ko,{path:y,labelX:v,labelY:b,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})});ar.displayName="SimpleBezierEdge";const ir={[nr.Left]:{x:-1,y:0},[nr.Right]:{x:1,y:0},[nr.Top]:{x:0,y:-1},[nr.Bottom]:{x:0,y:1}},sr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function lr({source:e,sourcePosition:t=nr.Bottom,target:n,targetPosition:o=nr.Top,center:r,offset:a}){const i=ir[t],s=ir[o],l={x:e.x+i.x*a,y:e.y+i.y*a},c={x:n.x+s.x*a,y:n.y+s.y*a},u=(({source:e,sourcePosition:t=nr.Bottom,target:n})=>t===nr.Left||t===nr.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:t,target:c}),d=0!==u.x?"x":"y",f=u[d];let p,h,m=[];const g={x:0,y:0},y={x:0,y:0},[v,b,w,x]=Uo({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[d]*s[d]===-1){p=r.x??v,h=r.y??b;const e=[{x:p,y:l.y},{x:p,y:c.y}],t=[{x:l.x,y:h},{x:c.x,y:h}];m=i[d]===f?"x"===d?e:t:"x"===d?t:e}else{const r=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(m="x"===d?i.x===f?u:r:i.y===f?r:u,t===o){const t=Math.abs(e[d]-n[d]);if(t<=a){const o=Math.min(a-1,a-t);i[d]===f?g[d]=(l[d]>e[d]?-1:1)*o:y[d]=(c[d]>n[d]?-1:1)*o}}if(t!==o){const e="x"===d?"y":"x",t=i[d]===s[e],n=l[e]>c[e],o=l[e]<c[e];(1===i[d]&&(!t&&n||t&&o)||1!==i[d]&&(!t&&o||t&&n))&&(m="x"===d?r:u)}const v={x:l.x+g.x,y:l.y+g.y},b={x:c.x+y.x,y:c.y+y.y};Math.max(Math.abs(v.x-m[0].x),Math.abs(b.x-m[0].x))>=Math.max(Math.abs(v.y-m[0].y),Math.abs(b.y-m[0].y))?(p=(v.x+b.x)/2,h=m[0].y):(p=m[0].x,h=(v.y+b.y)/2)}return[[e,{x:l.x+g.x,y:l.y+g.y},...m,{x:c.x+y.x,y:c.y+y.y},n],p,h,w,x]}function cr({sourceX:e,sourceY:t,sourcePosition:n=nr.Bottom,targetX:o,targetY:r,targetPosition:a=nr.Top,borderRadius:i=5,centerX:s,centerY:l,offset:c=20}){const[u,d,f,p,h]=lr({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:a,center:{x:s,y:l},offset:c}),m=u.reduce((e,t,n)=>{let o="";return o=n>0&&n<u.length-1?function(e,t,n,o){const r=Math.min(sr(e,t)/2,sr(t,n)/2,o),{x:a,y:i}=t;if(e.x===a&&a===n.x||e.y===i&&i===n.y)return`L${a} ${i}`;if(e.y===i)return`L ${a+r*(e.x<n.x?-1:1)},${i}Q ${a},${i} ${a},${i+r*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${a},${i+r*(e.y<n.y?-1:1)}Q ${a},${i} ${a+r*s},${i}`}(u[n-1],t,u[n+1],i):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=o},"");return[m,d,f,p,h]}const ur=e.memo(({sourceX:t,sourceY:n,targetX:o,targetY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=nr.Bottom,targetPosition:p=nr.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=cr({sourceX:t,sourceY:n,sourcePosition:f,targetX:o,targetY:r,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return e.createElement(Ko,{path:v,labelX:b,labelY:w,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:m,interactionWidth:y})});ur.displayName="SmoothStepEdge";const dr=e.memo(t=>e.createElement(ur,{...t,pathOptions:e.useMemo(()=>({borderRadius:0,offset:t.pathOptions?.offset}),[t.pathOptions?.offset])}));dr.displayName="StepEdge";const fr=e.memo(({sourceX:t,sourceY:n,targetX:o,targetY:r,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[m,g,y]=function({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,a,i,s]=Uo({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,a,i,s]}({sourceX:t,sourceY:n,targetX:o,targetY:r});return e.createElement(Ko,{path:m,labelX:g,labelY:y,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})});function pr(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function hr({pos:e,x1:t,y1:n,x2:o,y2:r,c:a}){switch(e){case nr.Left:return[t-pr(t-o,a),n];case nr.Right:return[t+pr(o-t,a),n];case nr.Top:return[t,n-pr(n-r,a)];case nr.Bottom:return[t,n+pr(r-n,a)]}}function mr({sourceX:e,sourceY:t,sourcePosition:n=nr.Bottom,targetX:o,targetY:r,targetPosition:a=nr.Top,curvature:i=.25}){const[s,l]=hr({pos:n,x1:e,y1:t,x2:o,y2:r,c:i}),[c,u]=hr({pos:a,x1:o,y1:r,x2:e,y2:t,c:i}),[d,f,p,h]=Zo({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${o},${r}`,d,f,p,h]}fr.displayName="StraightEdge";const gr=e.memo(({sourceX:t,sourceY:n,targetX:o,targetY:r,sourcePosition:a=nr.Bottom,targetPosition:i=nr.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=mr({sourceX:t,sourceY:n,sourcePosition:a,targetX:o,targetY:r,targetPosition:i,curvature:g?.curvature});return e.createElement(Ko,{path:v,labelX:b,labelY:w,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:y})});gr.displayName="BezierEdge";const yr=e.createContext(null),vr=yr.Provider;yr.Consumer;const br=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`reactflow__edge-${e}${t||""}-${n}${o||""}`,wr=(e,t)=>{if(void 0===e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`},xr=(e,t)=>{if(!e.source||!e.target)return Fo("006",yo()),t;let n;var o;return n="id"in(o=e)&&"source"in o&&"target"in o?{...e}:{...e,id:br(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(n,t)?t:t.concat(n)},Er=({x:e,y:t},[n,o,r],a,[i,s])=>{const l={x:(e-n)/r,y:(t-o)/r};return a?{x:i*Math.round(l.x/i),y:s*Math.round(l.y/s)}:l},Sr=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o}),_r=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],o=(e.height??0)*t[1],r={x:e.position.x-n,y:e.position.y-o};return{...r,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-o}:r}},kr=(e,t=[0,0])=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const{x:o,y:r}=_r(n,t).positionAbsolute;return a=e,i=zo({x:o,y:r,width:n.width||0,height:n.height||0}),{x:Math.min(a.x,i.x),y:Math.min(a.y,i.y),x2:Math.max(a.x2,i.x2),y2:Math.max(a.y2,i.y2)};var a,i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}))(n)},Cr=(e,t,[n,o,r]=[0,0,1],a=!1,i=!1,s=[0,0])=>{const l={x:(t.x-n)/r,y:(t.y-o)/r,width:t.width/r,height:t.height/r},c=[];return e.forEach(e=>{const{width:t,height:n,selectable:o=!0,hidden:r=!1}=e;if(i&&!o||r)return!1;const{positionAbsolute:u}=_r(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},f=$o(l,d);(void 0===t||void 0===n||null===t||null===n||a&&f>0||f>=(t||0)*(n||0)||e.dragging)&&c.push(e)}),c},Nr=(e,t)=>{const n=e.map(e=>e.id);return t.filter(e=>n.includes(e.source)||n.includes(e.target))},Mr=(e,t,n,o,r,a=.1)=>{const i=t/(e.width*(1+a)),s=n/(e.height*(1+a)),l=Math.min(i,s),c=Ro(l,o,r);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Or=(e,t=0)=>e.transition().duration(t);function Pr(e,t,n,o){return(t[n]||[]).reduce((t,r)=>(`${e.id}-${r.id}-${n}`!==o&&t.push({id:r.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+r.x+r.width/2,y:(e.positionAbsolute?.y??0)+r.y+r.height/2}),t),[])}const Rr={source:null,target:null,sourceHandle:null,targetHandle:null},Ar=()=>({handleDomNode:null,isValid:!1,connection:Rr,endHandle:null});function Dr(e,t,n,o,r,a,i){const s="target"===r,l=i.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...Ar(),handleDomNode:l};if(l){const e=Tr(void 0,l),r=l.getAttribute("data-nodeid"),i=l.getAttribute("data-handleid"),u=l.classList.contains("connectable"),d=l.classList.contains("connectableend"),f={source:s?r:n,sourceHandle:s?i:o,target:s?n:r,targetHandle:s?o:i};c.connection=f;u&&d&&(t===Go.Strict?s&&"source"===e||!s&&"target"===e:r!==n||i!==o)&&(c.endHandle={nodeId:r,handleId:i,type:e},c.isValid=a(f))}return c}function Tr(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Ir(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function zr(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Lr({event:e,handleId:t,nodeId:n,onConnect:o,isTarget:r,getState:a,setState:i,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=Io(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:v}=a();let b,w=0;const{x:x,y:E}=Yo(e),S=u?.elementFromPoint(x,E),_=Tr(l,S),k=f?.getBoundingClientRect();if(!k||!_)return;let C,N=Yo(e,k),M=!1,O=null,P=!1,R=null;const A=function({nodes:e,nodeId:t,handleId:n,handleType:o}){return e.reduce((e,r)=>{if(r[jo]){const{handleBounds:a}=r[jo];let i=[],s=[];a&&(i=Pr(r,a,"source",`${t}-${n}-${o}`),s=Pr(r,a,"target",`${t}-${n}-${o}`)),e.push(...i,...s)}return e},[])}({nodes:y(),nodeId:n,handleId:t,handleType:_}),D=()=>{if(!p)return;const[e,t]=To(N,k);g({x:e,y:t}),w=requestAnimationFrame(D)};function T(e){const{transform:o}=a();N=Yo(e,k);const{handle:l,validHandleResult:c}=function(e,t,n,o,r,a){const{x:i,y:s}=Yo(e),l=t.elementsFromPoint(i,s).find(e=>e.classList.contains("react-flow__handle"));if(l){const e=l.getAttribute("data-nodeid");if(e){const t=Tr(void 0,l),o=l.getAttribute("data-handleid"),i=a({nodeId:e,id:o,type:t});if(i){const a=r.find(n=>n.nodeId===e&&n.type===t&&n.id===o);return{handle:{id:o,type:t,nodeId:e,x:a?.x||n.x,y:a?.y||n.y},validHandleResult:i}}}}let c=[],u=1/0;if(r.forEach(e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=o){const n=a(e);t<=u&&(t<u?c=[{handle:e,validHandleResult:n}]:t===u&&c.push({handle:e,validHandleResult:n}),u=t)}}),!c.length)return{handle:null,validHandleResult:Ar()};if(1===c.length)return c[0];const d=c.some(({validHandleResult:e})=>e.isValid),f=c.some(({handle:e})=>"target"===e.type);return c.find(({handle:e,validHandleResult:t})=>f?"target"===e.type:!d||t.isValid)||c[0]}(e,u,Er(N,o,!1,[1,1]),h,A,e=>Dr(e,d,n,t,r?"target":"source",s,u));if(b=l,M||(D(),M=!0),R=c.handleDomNode,O=c.connection,P=c.isValid,i({connectionPosition:b&&P?Sr({x:b.x,y:b.y},o):N,connectionStatus:zr(!!b,P),connectionEndHandle:c.endHandle}),!b&&!P&&!R)return Ir(C);O.source!==O.target&&R&&(Ir(C),C=R,R.classList.add("connecting","react-flow__handle-connecting"),R.classList.toggle("valid",P),R.classList.toggle("react-flow__handle-valid",P))}function I(e){(b||R)&&O&&P&&o?.(O),a().onConnectEnd?.(e),l&&c?.(e),Ir(C),v(),cancelAnimationFrame(w),M=!1,P=!1,O=null,R=null,u.removeEventListener("mousemove",T),u.removeEventListener("mouseup",I),u.removeEventListener("touchmove",T),u.removeEventListener("touchend",I)}i({connectionPosition:N,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:_,connectionStartHandle:{nodeId:n,handleId:t,type:_},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:_}),u.addEventListener("mousemove",T),u.addEventListener("mouseup",I),u.addEventListener("touchmove",T),u.addEventListener("touchend",I)}const $r=()=>!0,Br=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),jr=e.forwardRef(({type:t="source",position:n=nr.Top,isValidConnection:o,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:s=!0,id:l,onConnect:c,children:u,className:d,onMouseDown:f,onTouchStart:p,...h},m)=>{const g=l||null,y="target"===t,v=ko(),b=e.useContext(yr),{connectOnClick:w,noPanClassName:x}=_o(Br,N),{connecting:E,clickConnecting:S}=_o(((e,t,n)=>o=>{const{connectionStartHandle:r,connectionEndHandle:a,connectionClickStartHandle:i}=o;return{connecting:r?.nodeId===e&&r?.handleId===t&&r?.type===n||a?.nodeId===e&&a?.handleId===t&&a?.type===n,clickConnecting:i?.nodeId===e&&i?.handleId===t&&i?.type===n}})(b,g,t),N);b||v.getState().onError?.("010",wo());const _=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:o}=v.getState(),r={...t,...e};if(o){const{edges:e,setEdges:t}=v.getState();t(xr(r,e))}n?.(r),c?.(r)},k=e=>{if(!b)return;const t=Wo(e);a&&(t&&0===e.button||!t)&&Lr({event:e,handleId:g,nodeId:b,onConnect:_,isTarget:y,getState:v.getState,setState:v.setState,isValidConnection:o||v.getState().isValidConnection||$r}),t?f?.(e):p?.(e)};return e.createElement("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":n,"data-id":`${b}-${g}-${t}`,className:i(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",x,d,{source:!y,target:y,connectable:r,connectablestart:a,connectableend:s,connecting:S,connectionindicator:r&&(a&&!E||s&&E)}]),onMouseDown:k,onTouchStart:k,onClick:w?e=>{const{onClickConnectStart:n,onClickConnectEnd:r,connectionClickStartHandle:i,connectionMode:s,isValidConnection:l}=v.getState();if(!b||!i&&!a)return;if(!i)return n?.(e,{nodeId:b,handleId:g,handleType:t}),void v.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:g}});const c=Io(e.target),u=o||l||$r,{connection:d,isValid:f}=Dr({nodeId:b,id:g,type:t},s,i.nodeId,i.handleId||null,i.type,u,c);f&&_(d),r?.(e),v.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)});jr.displayName="Handle";var Hr=e.memo(jr);const Fr=({data:t,isConnectable:n,targetPosition:o=nr.Top,sourcePosition:r=nr.Bottom})=>e.createElement(e.Fragment,null,e.createElement(Hr,{type:"target",position:o,isConnectable:n}),t?.label,e.createElement(Hr,{type:"source",position:r,isConnectable:n}));Fr.displayName="DefaultNode";var Vr=e.memo(Fr);const Wr=({data:t,isConnectable:n,sourcePosition:o=nr.Bottom})=>e.createElement(e.Fragment,null,t?.label,e.createElement(Hr,{type:"source",position:o,isConnectable:n}));Wr.displayName="InputNode";var Yr=e.memo(Wr);const Xr=({data:t,isConnectable:n,targetPosition:o=nr.Top})=>e.createElement(e.Fragment,null,e.createElement(Hr,{type:"target",position:o,isConnectable:n}),t?.label);Xr.displayName="OutputNode";var Kr=e.memo(Xr);const qr=()=>null;qr.displayName="GroupNode";const Ur=e=>({selectedNodes:e.getNodes().filter(e=>e.selected),selectedEdges:e.edges.filter(e=>e.selected).map(e=>({...e}))}),Zr=e=>e.id;function Gr(e,t){return N(e.selectedNodes.map(Zr),t.selectedNodes.map(Zr))&&N(e.selectedEdges.map(Zr),t.selectedEdges.map(Zr))}const Qr=e.memo(({onSelectionChange:t})=>{const n=ko(),{selectedNodes:o,selectedEdges:r}=_o(Ur,Gr);return e.useEffect(()=>{const e={nodes:o,edges:r};t?.(e),n.getState().onSelectionChange.forEach(t=>t(e))},[o,r,t]),null});Qr.displayName="SelectionListener";const Jr=e=>!!e.onSelectionChange;function ea({onSelectionChange:t}){const n=_o(Jr);return t||n?e.createElement(Qr,{onSelectionChange:t}):null}const ta=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function na(t,n){e.useEffect(()=>{void 0!==t&&n(t)},[t])}function oa(t,n,o){e.useEffect(()=>{void 0!==n&&o({[t]:n})},[n])}const ra=({nodes:t,edges:n,defaultNodes:o,defaultEdges:r,onConnect:a,onConnectStart:i,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:g,maxZoom:y,nodeExtent:v,onNodesChange:b,onEdgesChange:w,elementsSelectable:x,connectionMode:E,snapGrid:S,snapToGrid:_,translateExtent:k,connectOnClick:C,defaultEdgeOptions:M,fitView:O,fitViewOptions:P,onNodesDelete:R,onEdgesDelete:A,onNodeDrag:D,onNodeDragStart:T,onNodeDragStop:I,onSelectionDrag:z,onSelectionDragStart:L,onSelectionDragStop:$,noPanClassName:B,nodeOrigin:j,rfId:H,autoPanOnConnect:F,autoPanOnNodeDrag:V,onError:W,connectionRadius:Y,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:q,setEdges:U,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=_o(ta,N),ne=ko();return e.useEffect(()=>{const e=r?.map(e=>({...e,...M}));return Z(o,e),()=>{te()}},[]),oa("defaultEdgeOptions",M,ne.setState),oa("connectionMode",E,ne.setState),oa("onConnect",a,ne.setState),oa("onConnectStart",i,ne.setState),oa("onConnectEnd",s,ne.setState),oa("onClickConnectStart",l,ne.setState),oa("onClickConnectEnd",c,ne.setState),oa("nodesDraggable",u,ne.setState),oa("nodesConnectable",d,ne.setState),oa("nodesFocusable",f,ne.setState),oa("edgesFocusable",p,ne.setState),oa("edgesUpdatable",h,ne.setState),oa("elementsSelectable",x,ne.setState),oa("elevateNodesOnSelect",m,ne.setState),oa("snapToGrid",_,ne.setState),oa("snapGrid",S,ne.setState),oa("onNodesChange",b,ne.setState),oa("onEdgesChange",w,ne.setState),oa("connectOnClick",C,ne.setState),oa("fitViewOnInit",O,ne.setState),oa("fitViewOnInitOptions",P,ne.setState),oa("onNodesDelete",R,ne.setState),oa("onEdgesDelete",A,ne.setState),oa("onNodeDrag",D,ne.setState),oa("onNodeDragStart",T,ne.setState),oa("onNodeDragStop",I,ne.setState),oa("onSelectionDrag",z,ne.setState),oa("onSelectionDragStart",L,ne.setState),oa("onSelectionDragStop",$,ne.setState),oa("noPanClassName",B,ne.setState),oa("nodeOrigin",j,ne.setState),oa("rfId",H,ne.setState),oa("autoPanOnConnect",F,ne.setState),oa("autoPanOnNodeDrag",V,ne.setState),oa("onError",W,ne.setState),oa("connectionRadius",Y,ne.setState),oa("isValidConnection",X,ne.setState),oa("nodeDragThreshold",K,ne.setState),na(t,q),na(n,U),na(g,G),na(y,Q),na(k,J),na(v,ee),null},aa={display:"none"},ia={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sa="react-flow__node-desc",la="react-flow__edge-desc",ca=e=>e.ariaLiveMessage;function ua({rfId:t}){const n=_o(ca);return e.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:ia},n)}function da({rfId:t,disableKeyboardA11y:n}){return e.createElement(e.Fragment,null,e.createElement("div",{id:`${sa}-${t}`,style:aa},"Press enter or space to select a node.",!n&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),e.createElement("div",{id:`${la}-${t}`,style:aa},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&e.createElement(ua,{rfId:t}))}var fa=(t=null,n={actInsideInputWithModifier:!0})=>{const[o,r]=e.useState(!1),a=e.useRef(!1),i=e.useRef(new Set([])),[s,l]=e.useMemo(()=>{if(null!==t){const e=(Array.isArray(t)?t:[t]).filter(e=>"string"==typeof e).map(e=>e.split("+")),n=e.reduce((e,t)=>e.concat(...t),[]);return[e,n]}return[[],[]]},[t]);return e.useEffect(()=>{const e="undefined"!=typeof document?document:null,o=n?.target||e;if(null!==t){const e=e=>{a.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!a.current||a.current&&!n.actInsideInputWithModifier)&&Vo(e))return!1;const t=ha(e.code,l);i.current.add(e[t]),pa(s,i.current,!1)&&(e.preventDefault(),r(!0))},t=e=>{if((!a.current||a.current&&!n.actInsideInputWithModifier)&&Vo(e))return!1;const t=ha(e.code,l);pa(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(e[t]),"Meta"===e.key&&i.current.clear(),a.current=!1},c=()=>{i.current.clear(),r(!1)};return o?.addEventListener("keydown",e),o?.addEventListener("keyup",t),window.addEventListener("blur",c),()=>{o?.removeEventListener("keydown",e),o?.removeEventListener("keyup",t),window.removeEventListener("blur",c)}}},[t,r]),o};function pa(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function ha(e,t){return t.includes(e)?"code":"key"}function ma(e,t,n,o){const r=e.parentNode||e.parentId;if(!r)return n;const a=t.get(r),i=_r(a,o);return ma(a,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(a[jo]?.z??0)>(n.z??0)?a[jo]?.z??0:n.z??0},o)}function ga(e,t,n){e.forEach(o=>{const r=o.parentNode||o.parentId;if(r&&!e.has(r))throw new Error(`Parent node ${r} not found`);if(r||n?.[o.id]){const{x:r,y:a,z:i}=ma(o,e,{...o.position,z:o[jo]?.z??0},t);o.positionAbsolute={x:r,y:a},o[jo].z=i,n?.[o.id]&&(o[jo].isParent=!0)}})}function ya(e,t,n,o){const r=new Map,a={},i=o?1e3:0;return e.forEach(e=>{const n=(Bo(e.zIndex)?e.zIndex:0)+(e.selected?i:0),o=t.get(e.id),s={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},l=e.parentNode||e.parentId;l&&(a[l]=!0);const c=o?.type&&o?.type!==e.type;Object.defineProperty(s,jo,{enumerable:!1,value:{handleBounds:c?void 0:o?.[jo]?.handleBounds,z:n}}),r.set(e.id,s)}),ga(r,n,a),r}function va(e,t={}){const{getNodes:n,width:o,height:r,minZoom:a,maxZoom:i,d3Zoom:s,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),f=t.initial&&!c&&u;if(s&&l&&(f||!t.initial)){const e=n().filter(e=>{const n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some(t=>t.id===e.id):n}),c=e.every(e=>e.width&&e.height);if(e.length>0&&c){const n=kr(e,d),{x:c,y:u,zoom:f}=Mr(n,o,r,t.minZoom??a,t.maxZoom??i,t.padding??.1),p=to.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?s.transform(Or(l,t.duration),p):s.transform(l,p),!0}}return!1}function ba(e,t){return e.forEach(e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[jo]:n[jo],selected:e.selected})}),new Map(t)}function wa(e,t){return t.map(t=>{const n=e.find(e=>e.id===t.id);return n&&(t.selected=n.selected),t})}function xa({changedNodes:e,changedEdges:t,get:n,set:o}){const{nodeInternals:r,edges:a,onNodesChange:i,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&o({nodeInternals:ba(e,r)}),i?.(e)),t?.length&&(c&&o({edges:wa(t,a)}),s?.(t))}const Ea=()=>{},Sa={zoomIn:Ea,zoomOut:Ea,zoomTo:Ea,getZoom:()=>1,setViewport:Ea,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ea,fitBounds:Ea,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},_a=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function ka(){const t=(()=>{const t=ko(),{d3Zoom:n,d3Selection:o}=_o(_a,N),r=e.useMemo(()=>o&&n?{zoomIn:e=>n.scaleBy(Or(o,e?.duration),1.2),zoomOut:e=>n.scaleBy(Or(o,e?.duration),1/1.2),zoomTo:(e,t)=>n.scaleTo(Or(o,t?.duration),e),getZoom:()=>t.getState().transform[2],setViewport:(e,r)=>{const[a,i,s]=t.getState().transform,l=to.translate(e.x??a,e.y??i).scale(e.zoom??s);n.transform(Or(o,r?.duration),l)},getViewport:()=>{const[e,n,o]=t.getState().transform;return{x:e,y:n,zoom:o}},fitView:e=>va(t.getState,e),setCenter:(e,r,a)=>{const{width:i,height:s,maxZoom:l}=t.getState(),c=void 0!==a?.zoom?a.zoom:l,u=i/2-e*c,d=s/2-r*c,f=to.translate(u,d).scale(c);n.transform(Or(o,a?.duration),f)},fitBounds:(e,r)=>{const{width:a,height:i,minZoom:s,maxZoom:l}=t.getState(),{x:c,y:u,zoom:d}=Mr(e,a,i,s,l,r?.padding??.1),f=to.translate(c,u).scale(d);n.transform(Or(o,r?.duration),f)},project:e=>{const{transform:n,snapToGrid:o,snapGrid:r}=t.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Er(e,n,o,r)},screenToFlowPosition:e=>{const{transform:n,snapToGrid:o,snapGrid:r,domNode:a}=t.getState();if(!a)return e;const{x:i,y:s}=a.getBoundingClientRect(),l={x:e.x-i,y:e.y-s};return Er(l,n,o,r)},flowToScreenPosition:e=>{const{transform:n,domNode:o}=t.getState();if(!o)return e;const{x:r,y:a}=o.getBoundingClientRect(),i=Sr(e,n);return{x:i.x+r,y:i.y+a}},viewportInitialized:!0}:Sa,[n,o]);return r})(),n=ko(),o=e.useCallback(()=>n.getState().getNodes().map(e=>({...e})),[]),r=e.useCallback(e=>n.getState().nodeInternals.get(e),[]),a=e.useCallback(()=>{const{edges:e=[]}=n.getState();return e.map(e=>({...e}))},[]),i=e.useCallback(e=>{const{edges:t=[]}=n.getState();return t.find(t=>t.id===e)},[]),s=e.useCallback(e=>{const{getNodes:t,setNodes:o,hasDefaultNodes:r,onNodesChange:a}=n.getState(),i=t(),s="function"==typeof e?e(i):e;if(r)o(s);else if(a){const e=0===s.length?i.map(e=>({type:"remove",id:e.id})):s.map(e=>({item:e,type:"reset"}));a(e)}},[]),l=e.useCallback(e=>{const{edges:t=[],setEdges:o,hasDefaultEdges:r,onEdgesChange:a}=n.getState(),i="function"==typeof e?e(t):e;if(r)o(i);else if(a){a(0===i.length?t.map(e=>({type:"remove",id:e.id})):i.map(e=>({item:e,type:"reset"})))}},[]),c=e.useCallback(e=>{const t=Array.isArray(e)?e:[e],{getNodes:o,setNodes:r,hasDefaultNodes:a,onNodesChange:i}=n.getState();if(a){r([...o(),...t])}else if(i){const e=t.map(e=>({item:e,type:"add"}));i(e)}},[]),u=e.useCallback(e=>{const t=Array.isArray(e)?e:[e],{edges:o=[],setEdges:r,hasDefaultEdges:a,onEdgesChange:i}=n.getState();if(a)r([...o,...t]);else if(i){i(t.map(e=>({item:e,type:"add"})))}},[]),d=e.useCallback(()=>{const{getNodes:e,edges:t=[],transform:o}=n.getState(),[r,a,i]=o;return{nodes:e().map(e=>({...e})),edges:t.map(e=>({...e})),viewport:{x:r,y:a,zoom:i}}},[]),f=e.useCallback(({nodes:e,edges:t})=>{const{nodeInternals:o,getNodes:r,edges:a,hasDefaultNodes:i,hasDefaultEdges:s,onNodesDelete:l,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=n.getState(),f=(e||[]).map(e=>e.id),p=(t||[]).map(e=>e.id),h=r().reduce((e,t)=>{const n=t.parentNode||t.parentId,o=!f.includes(t.id)&&n&&e.find(e=>e.id===n);return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||o)&&e.push(t),e},[]),m=a.filter(e=>"boolean"!=typeof e.deletable||e.deletable),g=m.filter(e=>p.includes(e.id));if(h||g){const e=Nr(h,m),t=[...g,...e],r=t.reduce((e,t)=>(e.includes(t.id)||e.push(t.id),e),[]);if((s||i)&&(s&&n.setState({edges:a.filter(e=>!r.includes(e.id))}),i&&(h.forEach(e=>{o.delete(e.id)}),n.setState({nodeInternals:new Map(o)}))),r.length>0&&(c?.(t),d&&d(r.map(e=>({id:e,type:"remove"})))),h.length>0&&(l?.(h),u)){u(h.map(e=>({id:e.id,type:"remove"})))}}},[]),p=e.useCallback(e=>{const t=Bo((o=e).width)&&Bo(o.height)&&Bo(o.x)&&Bo(o.y);var o;const r=t?null:n.getState().nodeInternals.get(e.id);if(!t&&!r)return[null,null,t];return[t?e:Lo(r),r,t]},[]),h=e.useCallback((e,t=!0,o)=>{const[r,a,i]=p(e);return r?(o||n.getState().getNodes()).filter(e=>{if(!(i||e.id!==a.id&&e.positionAbsolute))return!1;const n=Lo(e),o=$o(n,r);return t&&o>0||o>=r.width*r.height}):[]},[]),m=e.useCallback((e,t,n=!0)=>{const[o]=p(e);if(!o)return!1;const r=$o(o,t);return n&&r>0||r>=o.width*o.height},[]);return e.useMemo(()=>({...t,getNodes:o,getNode:r,getEdges:a,getEdge:i,setNodes:s,setEdges:l,addNodes:c,addEdges:u,toObject:d,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:m}),[t,o,r,a,i,s,l,c,u,d,f,h,m])}const Ca={actInsideInputWithModifier:!1};const Na={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ma=e=>({x:e.x,y:e.y,zoom:e.k}),Oa=(e,t)=>e.target.closest(`.${t}`),Pa=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Ra=e=>{const t=e.ctrlKey&&Xo()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},Aa=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Da=({onMove:t,onMoveStart:n,onMoveEnd:o,onPaneContextMenu:r,zoomOnScroll:a=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Qo.Free,zoomOnDoubleClick:u=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:p,translateExtent:h,minZoom:m,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:v=!0,children:b,noWheelClassName:w,noPanClassName:x})=>{const E=e.useRef(),S=ko(),_=e.useRef(!1),k=e.useRef(!1),C=e.useRef(null),M=e.useRef({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:R,d3ZoomHandler:A,userSelectionActive:D}=_o(Aa,N),T=fa(y),I=e.useRef(0),z=e.useRef(!1),L=e.useRef();return function(t){const n=ko();e.useEffect(()=>{let e;const o=()=>{if(!t.current)return;const e=Po(t.current);0!==e.height&&0!==e.width||n.getState().onError?.("004",mo()),n.setState({width:e.width||500,height:e.height||500})};return o(),window.addEventListener("resize",o),t.current&&(e=new ResizeObserver(()=>o()),e.observe(t.current)),()=>{window.removeEventListener("resize",o),e&&t.current&&e.unobserve(t.current)}},[])}(C),e.useEffect(()=>{if(C.current){const e=C.current.getBoundingClientRect(),t=function(){var e,t,n,o=ro,r=ao,a=co,i=so,s=lo,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=on,f=O("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",io).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",_).filter(s).on("touchstart.zoom",k).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new eo(t,e.x,e.y)}function y(e,t,n){var o=t[0]-n[0]*e.k,r=t[1]-n[1]*e.k;return o===e.x&&r===e.y?e:new eo(e.k,o,r)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,o){e.on("start.zoom",function(){w(this,arguments).event(o).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(o).end()}).tween("zoom",function(){var e=this,a=arguments,i=w(e,a).event(o),s=r.apply(e,a),l=null==n?v(s):"function"==typeof n?n.apply(e,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,a):t,p=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=c/t[2];e=new eo(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=r.apply(e,t),this.taps=0}function E(e,...t){if(o.apply(this,arguments)){var n=w(this,t).event(e),r=this.__zoom,s=Math.max(l[0],Math.min(l[1],r.k*Math.pow(2,i.apply(this,arguments)))),u=Xe(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=r.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[u,r.invert(u)],Nn(this),n.start()}oo(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(y(g(r,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(e,...t){if(!n&&o.apply(this,arguments)){var r=e.currentTarget,i=w(this,t,!0).event(e),s=Ye(e.view).on("mousemove.zoom",function(e){if(oo(e),!i.moved){var t=e.clientX-u,n=e.clientY-d;i.moved=t*t+n*n>p}i.event(e).zoom("mouse",a(y(i.that.__zoom,i.mouse[0]=Xe(e,r),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),Qe(e.view,i.moved),oo(e),i.event(e).end()},!0),l=Xe(e,r),u=e.clientX,d=e.clientY;Ge(e.view),no(e),i.mouse=[l,this.__zoom.invert(l)],Nn(this),i.start()}}function _(e,...t){if(o.apply(this,arguments)){var n=this.__zoom,i=Xe(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(i),l=n.k*(e.shiftKey?.5:2),d=a(y(g(n,l),i,s),r.apply(this,t),c);oo(e),u>0?Ye(this).transition().duration(u).call(b,d,i,e):Ye(this).call(m.transform,d,i,e)}}function k(n,...r){if(o.apply(this,arguments)){var a,i,s,l,c=n.touches,u=c.length,d=w(this,r,n.changedTouches.length===u).event(n);for(no(n),i=0;i<u;++i)l=[l=Xe(s=c[i],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,a=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),a&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),Nn(this),d.start())}}function C(e,...t){if(this.__zooming){var n,o,r,i,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(oo(e),n=0;n<u;++n)r=Xe(o=l[n],this),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=r:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=r);if(o=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],p=s.touch1[0],h=s.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,v=(v=h[0]-f[0])*v+(v=h[1]-f[1])*v;o=g(o,Math.sqrt(m/v)),r=[(d[0]+p[0])/2,(d[1]+p[1])/2],i=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],i=s.touch0[1]}s.zoom("touch",a(y(o,r,i),s.extent,c))}}function N(e,...o){if(this.__zooming){var r,a,i=w(this,o).event(e),s=e.changedTouches,l=s.length;for(no(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),r=0;r<l;++r)a=s[r],i.touch0&&i.touch0[2]===a.identifier?delete i.touch0:i.touch1&&i.touch1[2]===a.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps&&(a=Xe(a,this),Math.hypot(t[0]-a[0],t[1]-a[1])<h)){var c=Ye(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,o){var r=e.selection?e.selection():e;r.property("__zoom",io),e!==r?b(e,t,n,o):r.interrupt().each(function(){w(this,arguments).event(o).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,o){m.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,o)},m.scaleTo=function(e,t,n,o){m.transform(e,function(){var e=r.apply(this,arguments),o=this.__zoom,i=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(i),l="function"==typeof t?t.apply(this,arguments):t;return a(y(g(o,l),i,s),e,c)},n,o)},m.translateBy=function(e,t,n,o){m.transform(e,function(){return a(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)},null,o)},m.translateTo=function(e,t,n,o,i){m.transform(e,function(){var e=r.apply(this,arguments),i=this.__zoom,s=null==o?v(e):"function"==typeof o?o.apply(this,arguments):o;return a(to.translate(s[0],s[1]).scale(i.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},o,i)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=Ye(this.that).datum();f.call(e,this.that,new Jn(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:Qn(+e),m):i},m.filter=function(e){return arguments.length?(o="function"==typeof e?e:Qn(!!e),m):o},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Qn(!!e),m):s},m.extent=function(e){return arguments.length?(r="function"==typeof e?e:Qn([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):r},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(a=e,m):a},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}().scaleExtent([m,g]).translateExtent(h),n=Ye(C.current).call(t),o=to.translate(p.x,p.y).scale(Ro(p.zoom,m,g)),r=[[0,0],[e.width,e.height]],a=t.constrain()(o,r,h);t.transform(n,a),t.wheelDelta(Ra),S.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[a.x,a.y,a.k],domNode:C.current.closest(".react-flow")})}},[]),e.useEffect(()=>{R&&P&&(!s||T||D?void 0!==A&&R.on("wheel.zoom",function(e,t){if(!v&&"wheel"===e.type&&!e.ctrlKey||Oa(e,w))return null;e.preventDefault(),A.call(this,e,t)},{passive:!1}):R.on("wheel.zoom",e=>{if(Oa(e,w))return!1;e.preventDefault(),e.stopImmediatePropagation();const r=R.property("__zoom").k||1;if(e.ctrlKey&&i){const t=Xe(e),n=Ra(e),o=r*Math.pow(2,n);return void P.scaleTo(R,o,t,e)}const a=1===e.deltaMode?20:1;let s=c===Qo.Vertical?0:e.deltaX*a,u=c===Qo.Horizontal?0:e.deltaY*a;!Xo()&&e.shiftKey&&c!==Qo.Vertical&&(s=e.deltaY*a,u=0),P.translateBy(R,-s/r*l,-u/r*l,{internal:!0});const d=Ma(R.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=S.getState();clearTimeout(L.current),z.current||(z.current=!0,n?.(e,d),f?.(d)),z.current&&(t?.(e,d),p?.(d),L.current=setTimeout(()=>{o?.(e,d),h?.(d),z.current=!1},150))},{passive:!1}))},[D,s,c,R,P,A,T,i,v,w,n,t,o]),e.useEffect(()=>{P&&P.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;I.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=S.getState(),o=Ma(e.transform);_.current=!0,M.current=o,"mousedown"===e.sourceEvent?.type&&S.setState({paneDragging:!0}),t?.(o),n?.(e.sourceEvent,o)})},[P,n]),e.useEffect(()=>{P&&(D&&!_.current?P.on("zoom",null):D||P.on("zoom",e=>{const{onViewportChange:n}=S.getState();if(S.setState({transform:[e.transform.x,e.transform.y,e.transform.k]}),k.current=!(!r||!Pa(f,I.current??0)),(t||n)&&!e.sourceEvent?.internal){const o=Ma(e.transform);n?.(o),t?.(e.sourceEvent,o)}}))},[D,P,t,f,r]),e.useEffect(()=>{P&&P.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=S.getState();if(_.current=!1,S.setState({paneDragging:!1}),r&&Pa(f,I.current??0)&&!k.current&&r(e.sourceEvent),k.current=!1,(o||t)&&(n=M.current,a=e.transform,n.x!==a.x||n.y!==a.y||n.zoom!==a.k)){const n=Ma(e.transform);M.current=n,clearTimeout(E.current),E.current=setTimeout(()=>{t?.(n),o?.(e.sourceEvent,n)},s?150:0)}var n,a})},[P,s,f,o,r]),e.useEffect(()=>{P&&P.filter(e=>{const t=T||a,n=i&&e.ctrlKey;if((!0===f||Array.isArray(f)&&f.includes(1))&&1===e.button&&"mousedown"===e.type&&(Oa(e,"react-flow__node")||Oa(e,"react-flow__edge")))return!0;if(!(f||t||s||u||i))return!1;if(D)return!1;if(!u&&"dblclick"===e.type)return!1;if(Oa(e,w)&&"wheel"===e.type)return!1;if(Oa(e,x)&&("wheel"!==e.type||s&&"wheel"===e.type&&!T))return!1;if(!i&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!s&&!n&&"wheel"===e.type)return!1;if(!f&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(f)&&!f.includes(e.button)&&"mousedown"===e.type)return!1;const o=Array.isArray(f)&&f.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&o})},[D,P,a,i,s,u,f,d,T]),e.createElement("div",{className:"react-flow__renderer",ref:C,style:Na},b)},Ta=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Ia(){const{userSelectionActive:t,userSelectionRect:n}=_o(Ta,N);return t&&n?e.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}function za(e,t){const n=t.parentNode||t.parentId,o=e.find(e=>e.id===n);if(o){const e=t.position.x+t.width-o.width,n=t.position.y+t.height-o.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(o.style={...o.style}||{},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,e>0&&(o.style.width+=e),n>0&&(o.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);o.position.x=o.position.x-e,o.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);o.position.y=o.position.y-e,o.style.height+=e,t.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function La(e,t){if(e.some(e=>"reset"===e.type))return e.filter(e=>"reset"===e.type).map(e=>e.item);const n=e.filter(e=>"add"===e.type).map(e=>e.item);return t.reduce((t,n)=>{const o=e.filter(e=>e.id===n.id);if(0===o.length)return t.push(n),t;const r={...n};for(const e of o)if(e)switch(e.type){case"select":r.selected=e.selected;break;case"position":void 0!==e.position&&(r.position=e.position),void 0!==e.positionAbsolute&&(r.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(r.dragging=e.dragging),r.expandParent&&za(t,r);break;case"dimensions":void 0!==e.dimensions&&(r.width=e.dimensions.width,r.height=e.dimensions.height),void 0!==e.updateStyle&&(r.style={...r.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(r.resizing=e.resizing),r.expandParent&&za(t,r);break;case"remove":return t}return t.push(r),t},n)}function $a(e,t){return La(e,t)}const Ba=(e,t)=>({id:e,type:"select",selected:t});function ja(e,t){return e.reduce((e,n)=>{const o=t.includes(n.id);return!n.selected&&o?(n.selected=!0,e.push(Ba(n.id,!0))):n.selected&&!o&&(n.selected=!1,e.push(Ba(n.id,!1))),e},[])}const Ha=(e,t)=>n=>{n.target===t.current&&e?.(n)},Fa=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Va=e.memo(({isSelecting:t,selectionMode:n=Jo.Full,panOnDrag:o,onSelectionStart:r,onSelectionEnd:a,onPaneClick:s,onPaneContextMenu:l,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=e.useRef(null),m=ko(),g=e.useRef(0),y=e.useRef(0),v=e.useRef(),{userSelectionActive:b,elementsSelectable:w,dragging:x}=_o(Fa,N),E=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},S=e=>{s?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},_=c?e=>c(e):void 0,k=w&&(t||b);return e.createElement("div",{className:i(["react-flow__pane",{dragging:x,selection:t}]),onClick:k?void 0:Ha(S,h),onContextMenu:Ha(e=>{Array.isArray(o)&&o?.includes(2)?e.preventDefault():l?.(e)},h),onWheel:Ha(_,h),onMouseEnter:k?void 0:u,onMouseDown:k?e=>{const{resetSelectedElements:n,domNode:o}=m.getState();if(v.current=o?.getBoundingClientRect(),!w||!t||0!==e.button||e.target!==h.current||!v.current)return;const{x:a,y:i}=Yo(e,v.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:a,startY:i,x:a,y:i}}),r?.(e)}:void 0,onMouseMove:k?e=>{const{userSelectionRect:o,nodeInternals:r,edges:a,transform:i,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=m.getState();if(!t||!v.current||!o)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=Yo(e,v.current),f=o.startX??0,p=o.startY??0,h={...o,x:d.x<f?d.x:f,y:d.y<p?d.y:p,width:Math.abs(d.x-f),height:Math.abs(d.y-p)},b=u(),w=Cr(r,h,i,n===Jo.Partial,!0,c),x=Nr(w,a).map(e=>e.id),E=w.map(e=>e.id);if(g.current!==E.length){g.current=E.length;const e=ja(b,E);e.length&&s?.(e)}if(y.current!==x.length){y.current=x.length;const e=ja(a,x);e.length&&l?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:k?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!b&&t&&e.target===h.current&&S?.(e),m.setState({nodesSelectionActive:g.current>0}),E(),a?.(e)}:void 0,onMouseLeave:k?e=>{b&&(m.setState({nodesSelectionActive:g.current>0}),a?.(e)),E()}:f,ref:h,style:Na},p,e.createElement(Ia,null))});function Wa(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const o=t.get(n);return!!o&&(!!o.selected||Wa(o,t))}function Ya(e,t,n){let o=e;do{if(o?.matches(t))return!0;if(o===n.current)return!1;o=o.parentElement}while(o);return!1}function Xa(e,t,n,o){return Array.from(e.values()).filter(n=>(n.selected||n.id===o)&&(!n.parentNode||n.parentId||!Wa(n,e))&&(n.draggable||t&&void 0===n.draggable)).map(e=>({id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:n.x-(e.positionAbsolute?.x??0),y:n.y-(e.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode||e.parentId,parentId:e.parentNode||e.parentId,width:e.width,height:e.height,expandParent:e.expandParent}))}function Ka(e,t,n,o,r=[0,0],a){const i=function(e,t){return t&&"parent"!==t?[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]:t}(e,e.extent||o);let s=i;const l=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&l&&"parent"!==e.extent){const t=n.get(l),{x:o,y:a}=_r(t,r).positionAbsolute;s=[[e.extent[0][0]+o,e.extent[0][1]+a],[e.extent[1][0]+o,e.extent[1][1]+a]]}}else if(l&&e.width&&e.height){const t=n.get(l),{x:o,y:a}=_r(t,r).positionAbsolute;s=t&&Bo(o)&&Bo(a)&&Bo(t.width)&&Bo(t.height)?[[o+e.width*r[0],a+e.height*r[1]],[o+t.width-e.width+e.width*r[0],a+t.height-e.height+e.height*r[1]]]:s}else a?.("005",go()),s=i;let c={x:0,y:0};if(l){const e=n.get(l);c=_r(e,r).positionAbsolute}const u=s&&"parent"!==s?Ao(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function qa({nodeId:e,dragItems:t,nodeInternals:n}){const o=t.map(e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute}));return[e?o.find(t=>t.id===e):o[0],o]}Va.displayName="Pane";const Ua=(e,t,n,o)=>{const r=t.querySelectorAll(e);if(!r||!r.length)return null;const a=Array.from(r),i=t.getBoundingClientRect(),s=i.width*o[0],l=i.height*o[1];return a.map(e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-i.left-s)/n,y:(t.top-i.top-l)/n,...Po(e)}})};function Za(e,t,n){return void 0===n?n:o=>{const r=t().nodeInternals.get(e);r&&n(o,{...r})}}function Ga({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:a,multiSelectionActive:i,nodeInternals:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(a({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])):l?.("012",Eo(e))}function Qa(e){return(t,n,o)=>e?.(t,o)}function Ja({nodeRef:t,disabled:n=!1,noDragClassName:o,handleSelector:r,nodeId:a,isSelectable:i,selectNodesOnDrag:s}){const l=ko(),[c,u]=e.useState(!1),d=e.useRef([]),f=e.useRef({x:null,y:null}),p=e.useRef(0),h=e.useRef(null),m=e.useRef({x:0,y:0}),g=e.useRef(null),y=e.useRef(!1),v=e.useRef(!1),b=e.useRef(!1),w=function(){const t=ko(),n=e.useCallback(({sourceEvent:e})=>{const{transform:n,snapGrid:o,snapToGrid:r}=t.getState(),a=e.touches?e.touches[0].clientX:e.clientX,i=e.touches?e.touches[0].clientY:e.clientY,s={x:(a-n[0])/n[2],y:(i-n[1])/n[2]};return{xSnapped:r?o[0]*Math.round(s.x/o[0]):s.x,ySnapped:r?o[1]*Math.round(s.y/o[1]):s.y,...s}},[]);return n}();return e.useEffect(()=>{if(t?.current){const e=Ye(t.current),c=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:o,onSelectionDrag:r,updateNodePositions:i,nodeExtent:s,snapGrid:c,snapToGrid:p,nodeOrigin:h,onError:m}=l.getState();f.current={x:e,y:t};let y=!1,v={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&s){const e=kr(d.current,h);v=zo(e)}if(d.current=d.current.map(o=>{const r={x:e-o.distance.x,y:t-o.distance.y};p&&(r.x=c[0]*Math.round(r.x/c[0]),r.y=c[1]*Math.round(r.y/c[1]));const a=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];d.current.length>1&&s&&!o.extent&&(a[0][0]=o.positionAbsolute.x-v.x+s[0][0],a[1][0]=o.positionAbsolute.x+(o.width??0)-v.x2+s[1][0],a[0][1]=o.positionAbsolute.y-v.y+s[0][1],a[1][1]=o.positionAbsolute.y+(o.height??0)-v.y2+s[1][1]);const i=Ka(o,r,n,a,h,m);return y=y||o.position.x!==i.position.x||o.position.y!==i.position.y,o.position=i.position,o.positionAbsolute=i.positionAbsolute,o}),!y)return;i(d.current,!0,!0),u(!0);const b=a?o:Qa(r);if(b&&g.current){const[e,t]=qa({nodeId:a,dragItems:d.current,nodeInternals:n});b(g.current,e,t)}},x=()=>{if(!h.current)return;const[e,t]=To(m.current,h.current);if(0!==e||0!==t){const{transform:n,panBy:o}=l.getState();f.current.x=(f.current.x??0)-e/n[2],f.current.y=(f.current.y??0)-t/n[2],o({x:e,y:t})&&c(f.current)}p.current=requestAnimationFrame(x)},E=e=>{const{nodeInternals:n,multiSelectionActive:o,nodesDraggable:r,unselectNodesAndEdges:c,onNodeDragStart:u,onSelectionDragStart:p}=l.getState();v.current=!0;const h=a?u:Qa(p);s&&i||o||!a||n.get(a)?.selected||c(),a&&i&&s&&Ga({id:a,store:l,nodeRef:t});const m=w(e);if(f.current=m,d.current=Xa(n,r,m,a),h&&d.current){const[t,o]=qa({nodeId:a,dragItems:d.current,nodeInternals:n});h(e.sourceEvent,t,o)}};if(!n){const n=function(){var e,t,n,o,r=tt,a=nt,i=ot,s=rt,l={},c=O("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",g).on("touchmove.drag",y,Ke).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(i,s){if(!o&&r.call(this,i,s)){var l=b(this,a.call(this,i,s),i,s,"mouse");l&&(Ye(i.view).on("mousemove.drag",h,qe).on("mouseup.drag",m,qe),Ge(i.view),Ue(i),n=!1,e=i.clientX,t=i.clientY,l("start",i))}}function h(o){if(Ze(o),!n){var r=o.clientX-e,a=o.clientY-t;n=r*r+a*a>d}l.mouse("drag",o)}function m(e){Ye(e.view).on("mousemove.drag mouseup.drag",null),Qe(e.view,n),Ze(e),l.mouse("end",e)}function g(e,t){if(r.call(this,e,t)){var n,o,i=e.changedTouches,s=a.call(this,e,t),l=i.length;for(n=0;n<l;++n)(o=b(this,s,e,t,i[n].identifier,i[n]))&&(Ue(e),o("start",e,i[n]))}}function y(e){var t,n,o=e.changedTouches,r=o.length;for(t=0;t<r;++t)(n=l[o[t].identifier])&&(Ze(e),n("drag",e,o[t]))}function v(e){var t,n,r=e.changedTouches,a=r.length;for(o&&clearTimeout(o),o=setTimeout(function(){o=null},500),t=0;t<a;++t)(n=l[r[t].identifier])&&(Ue(e),n("end",e,r[t]))}function b(e,t,n,o,r,a){var s,d,p,h=c.copy(),m=Xe(a||n,t);if(null!=(p=i.call(e,new et("beforestart",{sourceEvent:n,target:f,identifier:r,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),o)))return s=p.x-m[0]||0,d=p.y-m[1]||0,function n(a,i,c){var g,y=m;switch(a){case"start":l[r]=n,g=u++;break;case"end":delete l[r],--u;case"drag":m=Xe(c||i,t),g=u}h.call(a,e,new et(a,{sourceEvent:i,subject:p,target:f,identifier:r,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),o)}}return f.filter=function(e){return arguments.length?(r="function"==typeof e?e:Je(!!e),f):r},f.container=function(e){return arguments.length?(a="function"==typeof e?e:Je(e),f):a},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:Je(e),f):i},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Je(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}().on("start",e=>{const{domNode:t,nodeDragThreshold:n}=l.getState();0===n&&E(e),b.current=!1;const o=w(e);f.current=o,h.current=t?.getBoundingClientRect()||null,m.current=Yo(e.sourceEvent,h.current)}).on("drag",e=>{const t=w(e),{autoPanOnNodeDrag:n,nodeDragThreshold:o}=l.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(b.current=!0),!b.current){if(!y.current&&v.current&&n&&(y.current=!0,x()),!v.current){const n=t.xSnapped-(f?.current?.x??0),r=t.ySnapped-(f?.current?.y??0);Math.sqrt(n*n+r*r)>o&&E(e)}(f.current.x!==t.xSnapped||f.current.y!==t.ySnapped)&&d.current&&v.current&&(g.current=e.sourceEvent,m.current=Yo(e.sourceEvent,h.current),c(t))}}).on("end",e=>{if(v.current&&!b.current&&(u(!1),y.current=!1,v.current=!1,cancelAnimationFrame(p.current),d.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:o,onSelectionDragStop:r}=l.getState(),i=a?o:Qa(r);if(t(d.current,!1,!1),i){const[t,o]=qa({nodeId:a,dragItems:d.current,nodeInternals:n});i(e.sourceEvent,t,o)}}}).filter(e=>{const n=e.target;return!e.button&&(!o||!Ya(n,`.${o}`,t))&&(!r||Ya(n,r,t))});return e.call(n),()=>{e.on(".drag",null)}}e.on(".drag",null)}},[t,n,o,r,i,l,a,s,w]),c}function ei(){const t=ko(),n=e.useCallback(e=>{const{nodeInternals:n,nodeExtent:o,updateNodePositions:r,getNodes:a,snapToGrid:i,snapGrid:s,onError:l,nodesDraggable:c}=t.getState(),u=a().filter(e=>e.selected&&(e.draggable||c&&void 0===e.draggable)),d=i?s[0]:5,f=i?s[1]:5,p=e.isShiftPressed?4:1,h=e.x*d*p,m=e.y*f*p,g=u.map(e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};i&&(t.x=s[0]*Math.round(t.x/s[0]),t.y=s[1]*Math.round(t.y/s[1]));const{positionAbsolute:r,position:a}=Ka(e,t,n,o,void 0,l);e.position=a,e.positionAbsolute=r}return e});r(g,!0,!1)},[]);return n}const ti={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ni=t=>{const n=({id:n,type:o,data:r,xPos:a,yPos:s,xPosOrigin:l,yPosOrigin:c,selected:u,onClick:d,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:m,onDoubleClick:g,style:y,className:v,isDraggable:b,isSelectable:w,isConnectable:x,isFocusable:E,selectNodesOnDrag:S,sourcePosition:_,targetPosition:k,hidden:C,resizeObserver:N,dragHandle:M,zIndex:O,isParent:P,noDragClassName:R,noPanClassName:A,initialized:D,disableKeyboardA11y:T,ariaLabel:I,rfId:z,hasHandleBounds:L})=>{const $=ko(),B=e.useRef(null),j=e.useRef(null),H=e.useRef(_),F=e.useRef(k),V=e.useRef(o),W=w||b||d||f||p||h,Y=ei(),X=Za(n,$.getState,f),K=Za(n,$.getState,p),q=Za(n,$.getState,h),U=Za(n,$.getState,m),Z=Za(n,$.getState,g);e.useEffect(()=>()=>{j.current&&(N?.unobserve(j.current),j.current=null)},[]),e.useEffect(()=>{if(B.current&&!C){const e=B.current;D&&L&&j.current===e||(j.current&&N?.unobserve(j.current),N?.observe(e),j.current=e)}},[C,D,L]),e.useEffect(()=>{const e=V.current!==o,t=H.current!==_,r=F.current!==k;B.current&&(e||t||r)&&(e&&(V.current=o),t&&(H.current=_),r&&(F.current=k),$.getState().updateNodeDimensions([{id:n,nodeElement:B.current,forceUpdate:!0}]))},[n,o,_,k]);const G=Ja({nodeRef:B,disabled:C||!b,noDragClassName:R,handleSelector:M,nodeId:n,isSelectable:w,selectNodesOnDrag:S});return C?null:e.createElement("div",{className:i(["react-flow__node",`react-flow__node-${o}`,{[A]:b},v,{selected:u,selectable:w,parent:P,dragging:G}]),ref:B,style:{zIndex:O,transform:`translate(${l}px,${c}px)`,pointerEvents:W?"all":"none",visibility:D?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:X,onMouseMove:K,onMouseLeave:q,onContextMenu:U,onClick:e=>{const{nodeDragThreshold:t}=$.getState();if(w&&(!S||!b||t>0)&&Ga({id:n,store:$,nodeRef:B}),d){const t=$.getState().nodeInternals.get(n);t&&d(e,{...t})}},onDoubleClick:Z,onKeyDown:E?e=>{if(!Vo(e)&&!T)if(Ho.includes(e.key)&&w){const t="Escape"===e.key;Ga({id:n,store:$,unselect:t,nodeRef:B})}else b&&u&&Object.prototype.hasOwnProperty.call(ti,e.key)&&($.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~a}, y: ${~~s}`}),Y({x:ti[e.key].x,y:ti[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:E?0:void 0,role:E?"button":void 0,"aria-describedby":T?void 0:`${sa}-${z}`,"aria-label":I},e.createElement(vr,{value:n},e.createElement(t,{id:n,data:r,type:o,xPos:a,yPos:s,selected:u,isConnectable:x,sourcePosition:_,targetPosition:k,dragging:G,dragHandle:M,zIndex:O})))};return n.displayName="NodeWrapper",e.memo(n)};const oi=e=>{const t=e.getNodes().filter(e=>e.selected);return{...kr(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var ri=e.memo(function({onSelectionContextMenu:t,noPanClassName:n,disableKeyboardA11y:o}){const r=ko(),{width:a,height:s,x:l,y:c,transformString:u,userSelectionActive:d}=_o(oi,N),f=ei(),p=e.useRef(null);if(e.useEffect(()=>{o||p.current?.focus({preventScroll:!0})},[o]),Ja({nodeRef:p}),d||!a||!s)return null;const h=t?e=>{const n=r.getState().getNodes().filter(e=>e.selected);t(e,n)}:void 0;return e.createElement("div",{className:i(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u}},e.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:o?void 0:-1,onKeyDown:o?void 0:e=>{Object.prototype.hasOwnProperty.call(ti,e.key)&&f({x:ti[e.key].x,y:ti[e.key].y,isShiftPressed:e.shiftKey})},style:{width:a,height:s,top:c,left:l}}))});const ai=e=>e.nodesSelectionActive,ii=({children:t,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:l,onMove:c,onMoveStart:u,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:S,panOnScrollSpeed:_,panOnScrollMode:k,zoomOnDoubleClick:C,panOnDrag:N,defaultViewport:M,translateExtent:O,minZoom:P,maxZoom:R,preventScrolling:A,onSelectionContextMenu:D,noWheelClassName:T,noPanClassName:I,disableKeyboardA11y:z})=>{const L=_o(ai),$=fa(f),B=fa(v),j=B||N,H=B||S,F=$||p&&!0!==j;return(({deleteKeyCode:t,multiSelectionKeyCode:n})=>{const o=ko(),{deleteElements:r}=ka(),a=fa(t,Ca),i=fa(n);e.useEffect(()=>{if(a){const{edges:e,getNodes:t}=o.getState(),n=t().filter(e=>e.selected),a=e.filter(e=>e.selected);r({nodes:n,edges:a}),o.setState({nodesSelectionActive:!1})}},[a]),e.useEffect(()=>{o.setState({multiSelectionActive:i})},[i])})({deleteKeyCode:l,multiSelectionKeyCode:y}),e.createElement(Da,{onMove:c,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:H,panOnScrollSpeed:_,panOnScrollMode:k,zoomOnDoubleClick:C,panOnDrag:!$&&j,defaultViewport:M,translateExtent:O,minZoom:P,maxZoom:R,zoomActivationKeyCode:b,preventScrolling:A,noWheelClassName:T,noPanClassName:I},e.createElement(Va,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:j,isSelecting:!!F,selectionMode:h},t,L&&e.createElement(ri,{onSelectionContextMenu:D,noPanClassName:I,disableKeyboardA11y:z})))};ii.displayName="FlowRenderer";var si=e.memo(ii);function li(e){return{...{input:ni(e.input||Yr),default:ni(e.default||Vr),output:ni(e.output||Kr),group:ni(e.group||qr)},...Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=ni(e[n]||Vr),t),{})}}const ci=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),ui=t=>{const{nodesDraggable:n,nodesConnectable:o,nodesFocusable:r,elementsSelectable:a,updateNodeDimensions:i,onError:s}=_o(ci,N),l=(c=t.onlyRenderVisibleElements,_o(e.useCallback(e=>c?Cr(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes(),[c])));var c;const u=e.useRef(),d=e.useMemo(()=>{if("undefined"==typeof ResizeObserver)return null;const e=new ResizeObserver(e=>{const t=e.map(e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0}));i(t)});return u.current=e,e},[]);return e.useEffect(()=>()=>{u?.current?.disconnect()},[]),e.createElement("div",{className:"react-flow__nodes",style:Na},l.map(i=>{let l=i.type||"default";t.nodeTypes[l]||(s?.("003",ho(l)),l="default");const c=t.nodeTypes[l]||t.nodeTypes.default,u=!!(i.draggable||n&&void 0===i.draggable),f=!!(i.selectable||a&&void 0===i.selectable),p=!!(i.connectable||o&&void 0===i.connectable),h=!!(i.focusable||r&&void 0===i.focusable),m=t.nodeExtent?Ao(i.positionAbsolute,t.nodeExtent):i.positionAbsolute,g=m?.x??0,y=m?.y??0,v=(({x:e,y:t,width:n,height:o,origin:r})=>n&&o?r[0]<0||r[1]<0||r[0]>1||r[1]>1?{x:e,y:t}:{x:e-n*r[0],y:t-o*r[1]}:{x:e,y:t})({x:g,y:y,width:i.width??0,height:i.height??0,origin:t.nodeOrigin});return e.createElement(c,{key:i.id,id:i.id,className:i.className,style:i.style,type:l,data:i.data,sourcePosition:i.sourcePosition||nr.Bottom,targetPosition:i.targetPosition||nr.Top,hidden:i.hidden,xPos:g,yPos:y,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!i.selected,isDraggable:u,isSelectable:f,isConnectable:p,isFocusable:h,resizeObserver:d,dragHandle:i.dragHandle,zIndex:i[jo]?.z??0,isParent:!!i[jo]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!i.width&&!!i.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:i.ariaLabel,hasHandleBounds:!!i[jo]?.handleBounds})}))};ui.displayName="NodeRenderer";var di=e.memo(ui);const fi=(e,t,n)=>n===nr.Left?e-t:n===nr.Right?e+t:e,pi=(e,t,n)=>n===nr.Top?e-t:n===nr.Bottom?e+t:e,hi="react-flow__edgeupdater",mi=({position:t,centerX:n,centerY:o,radius:r=10,onMouseDown:a,onMouseEnter:s,onMouseOut:l,type:c})=>e.createElement("circle",{onMouseDown:a,onMouseEnter:s,onMouseOut:l,className:i([hi,`${hi}-${c}`]),cx:fi(n,r,t),cy:pi(o,r,t),r:r,stroke:"transparent",fill:"transparent"}),gi=()=>!0;var yi=t=>{const n=({id:n,className:o,type:r,data:a,onClick:s,onEdgeDoubleClick:l,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:y,source:v,target:b,sourceX:w,sourceY:x,targetX:E,targetY:S,sourcePosition:_,targetPosition:k,elementsSelectable:C,hidden:N,sourceHandleId:M,targetHandleId:O,onContextMenu:P,onMouseEnter:R,onMouseMove:A,onMouseLeave:D,reconnectRadius:T,onReconnect:I,onReconnectStart:z,onReconnectEnd:L,markerEnd:$,markerStart:B,rfId:j,ariaLabel:H,isFocusable:F,isReconnectable:V,pathOptions:W,interactionWidth:Y,disableKeyboardA11y:X})=>{const K=e.useRef(null),[q,U]=e.useState(!1),[Z,G]=e.useState(!1),Q=ko(),J=e.useMemo(()=>`url('#${wr(B,j)}')`,[B,j]),ee=e.useMemo(()=>`url('#${wr($,j)}')`,[$,j]);if(N)return null;const te=qo(n,Q.getState,l),ne=qo(n,Q.getState,P),oe=qo(n,Q.getState,R),re=qo(n,Q.getState,A),ae=qo(n,Q.getState,D),ie=(e,t)=>{if(0!==e.button)return;const{edges:o,isValidConnection:r}=Q.getState(),a=t?b:v,i=(t?O:M)||null,s=t?"target":"source",l=r||gi,c=t,u=o.find(e=>e.id===n);G(!0),z?.(e,u,s);Lr({event:e,handleId:i,nodeId:a,onConnect:e=>I?.(u,e),isTarget:c,getState:Q.getState,setState:Q.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{G(!1),L?.(e,u,s)}})},se=()=>U(!0),le=()=>U(!1),ce=!C&&!s;return e.createElement("g",{className:i(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:c,animated:u,inactive:ce,updating:q}]),onClick:e=>{const{edges:t,addSelectedEdges:o,unselectNodesAndEdges:r,multiSelectionActive:a}=Q.getState(),i=t.find(e=>e.id===n);i&&(C&&(Q.setState({nodesSelectionActive:!1}),i.selected&&a?(r({nodes:[],edges:[i]}),K.current?.blur()):o([n])),s&&s(e,i))},onDoubleClick:te,onContextMenu:ne,onMouseEnter:oe,onMouseMove:re,onMouseLeave:ae,onKeyDown:F?e=>{if(!X&&Ho.includes(e.key)&&C){const{unselectNodesAndEdges:t,addSelectedEdges:o,edges:r}=Q.getState();"Escape"===e.key?(K.current?.blur(),t({edges:[r.find(e=>e.id===n)]})):o([n])}}:void 0,tabIndex:F?0:void 0,role:F?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===H?void 0:H||`Edge from ${v} to ${b}`,"aria-describedby":F?`${la}-${j}`:void 0,ref:K},!Z&&e.createElement(t,{id:n,source:v,target:b,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,data:a,style:y,sourceX:w,sourceY:x,targetX:E,targetY:S,sourcePosition:_,targetPosition:k,sourceHandleId:M,targetHandleId:O,markerStart:J,markerEnd:ee,pathOptions:W,interactionWidth:Y}),V&&e.createElement(e.Fragment,null,("source"===V||!0===V)&&e.createElement(mi,{position:_,centerX:w,centerY:x,radius:T,onMouseDown:e=>ie(e,!0),onMouseEnter:se,onMouseOut:le,type:"source"}),("target"===V||!0===V)&&e.createElement(mi,{position:k,centerX:E,centerY:S,radius:T,onMouseDown:e=>ie(e,!1),onMouseEnter:se,onMouseOut:le,type:"target"})))};return n.displayName="EdgeWrapper",e.memo(n)};function vi(e){return{...{default:yi(e.default||gr),straight:yi(e.bezier||fr),step:yi(e.step||dr),smoothstep:yi(e.step||ur),simplebezier:yi(e.simplebezier||ar)},...Object.keys(e).filter(e=>!["default","bezier"].includes(e)).reduce((t,n)=>(t[n]=yi(e[n]||gr),t),{})}}function bi(e,t,n=null){const o=(n?.x||0)+t.x,r=(n?.y||0)+t.y,a=n?.width||t.width,i=n?.height||t.height;switch(e){case nr.Top:return{x:o+a/2,y:r};case nr.Right:return{x:o+a,y:r+i/2};case nr.Bottom:return{x:o+a/2,y:r+i};case nr.Left:return{x:o,y:r+i/2}}}function wi(e,t){return e?1!==e.length&&t?t&&e.find(e=>e.id===t)||null:e[0]:null}function xi(e){const t=e?.[jo]?.handleBounds||null,n=t&&e?.width&&e?.height&&void 0!==e?.positionAbsolute?.x&&void 0!==e?.positionAbsolute?.y;return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const Ei=[{level:0,isMaxLevel:!0,edges:[]}];function Si(t,n,o){return function(e,t,n=!1){let o=-1;const r=e.reduce((e,r)=>{const a=Bo(r.zIndex);let i=a?r.zIndex:0;if(n){const e=t.get(r.target),n=t.get(r.source),o=r.selected||e?.selected||n?.selected,s=Math.max(n?.[jo]?.z||0,e?.[jo]?.z||0,1e3);i=(a?r.zIndex:0)+(o?s:0)}return e[i]?e[i].push(r):e[i]=[r],o=i>o?i:o,e},{}),a=Object.entries(r).map(([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===o}});return 0===a.length?Ei:a}(_o(e.useCallback(e=>t?e.edges.filter(t=>{const o=n.get(t.source),r=n.get(t.target);return o?.width&&o?.height&&r?.width&&r?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:a,width:i,height:s,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+o,t.y+a)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=zo({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:i/l[2],height:s/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),f=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*f)>0}({sourcePos:o.positionAbsolute||{x:0,y:0},targetPos:r.positionAbsolute||{x:0,y:0},sourceWidth:o.width,sourceHeight:o.height,targetWidth:r.width,targetHeight:r.height,width:e.width,height:e.height,transform:e.transform})}):e.edges,[t,n])),n,o)}const _i={[tr.Arrow]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[tr.ArrowClosed]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const ki=({id:t,type:n,color:o,width:r=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const c=function(t){const n=ko();return e.useMemo(()=>Object.prototype.hasOwnProperty.call(_i,t)?_i[t]:(n.getState().onError?.("009",vo(t)),null),[t])}(n);return c?e.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},e.createElement(c,{color:o,strokeWidth:s})):null},Ci=({defaultColor:t,rfId:n})=>{const o=_o(e.useCallback((({defaultColor:e,rfId:t})=>n=>{const o=[];return n.edges.reduce((n,r)=>([r.markerStart,r.markerEnd].forEach(r=>{if(r&&"object"==typeof r){const a=wr(r,t);o.includes(a)||(n.push({id:a,color:r.color||e,...r}),o.push(a))}}),n),[]).sort((e,t)=>e.id.localeCompare(t.id))})({defaultColor:t,rfId:n}),[t,n]),(e,t)=>!(e.length!==t.length||e.some((e,n)=>e.id!==t[n].id)));return e.createElement("defs",null,o.map(t=>e.createElement(ki,{id:t.id,key:t.id,type:t.type,color:t.color,width:t.width,height:t.height,markerUnits:t.markerUnits,strokeWidth:t.strokeWidth,orient:t.orient})))};Ci.displayName="MarkerDefinitions";var Ni=e.memo(Ci);const Mi=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Oi=({defaultMarkerColor:t,onlyRenderVisibleElements:n,elevateEdgesOnSelect:o,rfId:r,edgeTypes:a,noPanClassName:s,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:f,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:y,children:v,disableKeyboardA11y:b})=>{const{edgesFocusable:w,edgesUpdatable:x,elementsSelectable:E,width:S,height:_,connectionMode:k,nodeInternals:C,onError:M}=_o(Mi,N),O=Si(n,C,o);return S?e.createElement(e.Fragment,null,O.map(({level:n,edges:o,isMaxLevel:v})=>e.createElement("svg",{key:n,style:{zIndex:n},width:S,height:_,className:"react-flow__edges react-flow__container"},v&&e.createElement(Ni,{defaultColor:t,rfId:r}),e.createElement("g",null,o.map(t=>{const[n,o,v]=xi(C.get(t.source)),[S,_,N]=xi(C.get(t.target));if(!v||!N)return null;let O=t.type||"default";a[O]||(M?.("011",xo(O)),O="default");const P=a[O]||a.default,R=k===Go.Strict?_.target:(_.target??[]).concat(_.source??[]),A=wi(o.source,t.sourceHandle),D=wi(R,t.targetHandle),T=A?.position||nr.Bottom,I=D?.position||nr.Top,z=!!(t.focusable||w&&void 0===t.focusable),L=t.reconnectable||t.updatable,$=void 0!==h&&(L||x&&void 0===L);if(!A||!D)return M?.("008",bo(A,t)),null;const{sourceX:B,sourceY:j,targetX:H,targetY:F}=((e,t,n,o,r,a)=>{const i=bi(n,e,t),s=bi(a,o,r);return{sourceX:i.x,sourceY:i.y,targetX:s.x,targetY:s.y}})(n,A,T,S,D,I);return e.createElement(P,{key:t.id,id:t.id,className:i([t.className,s]),type:O,data:t.data,selected:!!t.selected,animated:!!t.animated,hidden:!!t.hidden,label:t.label,labelStyle:t.labelStyle,labelShowBg:t.labelShowBg,labelBgStyle:t.labelBgStyle,labelBgPadding:t.labelBgPadding,labelBgBorderRadius:t.labelBgBorderRadius,style:t.style,source:t.source,target:t.target,sourceHandleId:t.sourceHandle,targetHandleId:t.targetHandle,markerEnd:t.markerEnd,markerStart:t.markerStart,sourceX:B,sourceY:j,targetX:H,targetY:F,sourcePosition:T,targetPosition:I,elementsSelectable:E,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:f,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:y,rfId:r,ariaLabel:t.ariaLabel,isFocusable:z,isReconnectable:$,pathOptions:"pathOptions"in t?t.pathOptions:void 0,interactionWidth:t.interactionWidth,disableKeyboardA11y:b})})))),v):null};Oi.displayName="EdgeRenderer";var Pi=e.memo(Oi);const Ri=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ai({children:t}){const n=_o(Ri);return e.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},t)}const Di={[nr.Left]:nr.Right,[nr.Right]:nr.Left,[nr.Top]:nr.Bottom,[nr.Bottom]:nr.Top},Ti=({nodeId:t,handleType:n,style:o,type:r=er.Bezier,CustomComponent:a,connectionStatus:i})=>{const{fromNode:s,handleId:l,toX:c,toY:u,connectionMode:d}=_o(e.useCallback(e=>({fromNode:e.nodeInternals.get(t),handleId:e.connectionHandleId,toX:(e.connectionPosition.x-e.transform[0])/e.transform[2],toY:(e.connectionPosition.y-e.transform[1])/e.transform[2],connectionMode:e.connectionMode}),[t]),N),f=s?.[jo]?.handleBounds;let p=f?.[n];if(d===Go.Loose&&(p=p||f?.["source"===n?"target":"source"]),!s||!p)return null;const h=l?p.find(e=>e.id===l):p[0],m=h?h.x+h.width/2:(s.width??0)/2,g=h?h.y+h.height/2:s.height??0,y=(s.positionAbsolute?.x??0)+m,v=(s.positionAbsolute?.y??0)+g,b=h?.position,w=b?Di[b]:null;if(!b||!w)return null;if(a)return e.createElement(a,{connectionLineType:r,connectionLineStyle:o,fromNode:s,fromHandle:h,fromX:y,fromY:v,toX:c,toY:u,fromPosition:b,toPosition:w,connectionStatus:i});let x="";const E={sourceX:y,sourceY:v,sourcePosition:b,targetX:c,targetY:u,targetPosition:w};return r===er.Bezier?[x]=mr(E):r===er.Step?[x]=cr({...E,borderRadius:0}):r===er.SmoothStep?[x]=cr(E):r===er.SimpleBezier?[x]=rr(E):x=`M${y},${v} ${c},${u}`,e.createElement("path",{d:x,fill:"none",className:"react-flow__connection-path",style:o})};Ti.displayName="ConnectionLine";const Ii=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function zi({containerStyle:t,style:n,type:o,component:r}){const{nodeId:a,handleType:s,nodesConnectable:l,width:c,height:u,connectionStatus:d}=_o(Ii,N);return!!(a&&s&&c&&l)?e.createElement("svg",{style:t,width:c,height:u,className:"react-flow__edges react-flow__connectionline react-flow__container"},e.createElement("g",{className:i(["react-flow__connection",d])},e.createElement(Ti,{nodeId:a,handleType:s,style:n,type:o,CustomComponent:r,connectionStatus:d}))):null}function Li(t,n){const o=e.useRef(null),r=ko();return e.useMemo(()=>{if("development"===process.env.NODE_ENV){const e=Object.keys(t);N(o.current,e)&&r.getState().onError?.("002",po()),o.current=e}return n(t)},[t])}const $i=({nodeTypes:t,edgeTypes:n,onMove:o,onMoveStart:r,onMoveEnd:a,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:g,onSelectionEnd:y,connectionLineType:v,connectionLineStyle:b,connectionLineComponent:w,connectionLineContainerStyle:x,selectionKeyCode:E,selectionOnDrag:S,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:C,zoomActivationKeyCode:N,deleteKeyCode:M,onlyRenderVisibleElements:O,elementsSelectable:P,selectNodesOnDrag:R,defaultViewport:A,translateExtent:D,minZoom:T,maxZoom:I,preventScrolling:z,defaultMarkerColor:L,zoomOnScroll:$,zoomOnPinch:B,panOnScroll:j,panOnScrollSpeed:H,panOnScrollMode:F,zoomOnDoubleClick:V,panOnDrag:W,onPaneClick:Y,onPaneMouseEnter:X,onPaneMouseMove:K,onPaneMouseLeave:q,onPaneScroll:U,onPaneContextMenu:Z,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,reconnectRadius:re,noDragClassName:ae,noWheelClassName:ie,noPanClassName:se,elevateEdgesOnSelect:le,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:fe})=>{const pe=Li(t,li),he=Li(n,vi);return function(t){const n=ka(),o=e.useRef(!1);e.useEffect(()=>{!o.current&&n.viewportInitialized&&t&&(setTimeout(()=>t(n),1),o.current=!0)},[t,n.viewportInitialized])}(i),e.createElement(si,{onPaneClick:Y,onPaneMouseEnter:X,onPaneMouseMove:K,onPaneMouseLeave:q,onPaneContextMenu:Z,onPaneScroll:U,deleteKeyCode:M,selectionKeyCode:E,selectionOnDrag:S,selectionMode:_,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:k,panActivationKeyCode:C,zoomActivationKeyCode:N,elementsSelectable:P,onMove:o,onMoveStart:r,onMoveEnd:a,zoomOnScroll:$,zoomOnPinch:B,zoomOnDoubleClick:V,panOnScroll:j,panOnScrollSpeed:H,panOnScrollMode:F,panOnDrag:W,defaultViewport:A,translateExtent:D,minZoom:T,maxZoom:I,onSelectionContextMenu:m,preventScrolling:z,noDragClassName:ae,noWheelClassName:ie,noPanClassName:se,disableKeyboardA11y:ce},e.createElement(Ai,null,e.createElement(Pi,{edgeTypes:he,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:O,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,reconnectRadius:re,defaultMarkerColor:L,noPanClassName:se,elevateEdgesOnSelect:!!le,disableKeyboardA11y:ce,rfId:fe},e.createElement(zi,{style:b,type:v,component:w,containerStyle:x})),e.createElement("div",{className:"react-flow__edgelabel-renderer"}),e.createElement(di,{nodeTypes:pe,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,selectNodesOnDrag:R,onlyRenderVisibleElements:O,noPanClassName:se,noDragClassName:ae,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:fe})))};$i.displayName="GraphView";var Bi=e.memo($i);const ji=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Hi={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:ji,nodeExtent:ji,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Go.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Fo,isValidConnection:void 0},Fi=()=>{return e=(e,t)=>({...Hi,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:a}=t();e({nodeInternals:ya(n,o,r,a)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:o={}}=t();e({edges:n.map(e=>({...o,...e}))})},setDefaultNodesAndEdges:(n,o)=>{const r=void 0!==n,a=void 0!==o,i=r?ya(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:a?o:[],hasDefaultNodes:r,hasDefaultEdges:a})},updateNodeDimensions:n=>{const{onNodesChange:o,nodeInternals:r,fitViewOnInit:a,fitViewOnInitDone:i,fitViewOnInitOptions:s,domNode:l,nodeOrigin:c}=t(),u=l?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(d.transform),p=n.reduce((e,t)=>{const n=r.get(t.id);if(n?.hidden)r.set(n.id,{...n,[jo]:{...n[jo],handleBounds:void 0}});else if(n){const o=Po(t.nodeElement);o.width&&o.height&&(n.width!==o.width||n.height!==o.height||t.forceUpdate)&&(r.set(n.id,{...n,[jo]:{...n[jo],handleBounds:{source:Ua(".source",t.nodeElement,f,c),target:Ua(".target",t.nodeElement,f,c)}},...o}),e.push({id:n.id,type:"dimensions",dimensions:o}))}return e},[]);ga(r,c);const h=i||a&&!i&&va(t,{initial:!0,...s});e({nodeInternals:new Map(r),fitViewOnInitDone:h}),p?.length>0&&o?.(p)},updateNodePositions:(e,n=!0,o=!1)=>{const{triggerNodeChanges:r}=t(),a=e.map(e=>{const t={id:e.id,type:"position",dragging:o};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t});r(a)},triggerNodeChanges:n=>{const{onNodesChange:o,nodeInternals:r,hasDefaultNodes:a,nodeOrigin:i,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(a){const t=ya($a(n,s()),r,i,l);e({nodeInternals:t})}o?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:o,edges:r,getNodes:a}=t();let i,s=null;o?i=n.map(e=>Ba(e,!0)):(i=ja(a(),n),s=ja(r,[])),xa({changedNodes:i,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:o,edges:r,getNodes:a}=t();let i,s=null;o?i=n.map(e=>Ba(e,!0)):(i=ja(r,n),s=ja(a(),[])),xa({changedNodes:s,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:a}=t(),i=o||r;xa({changedNodes:(n||a()).map(e=>(e.selected=!1,Ba(e.id,!1))),changedEdges:i.map(e=>Ba(e.id,!1)),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:o,maxZoom:r}=t();o?.scaleExtent([n,r]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:o,minZoom:r}=t();o?.scaleExtent([r,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:o}=t();xa({changedNodes:o().filter(e=>e.selected).map(e=>Ba(e.id,!1)),changedEdges:n.filter(e=>e.selected).map(e=>Ba(e.id,!1)),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:o}=t();o.forEach(e=>{e.positionAbsolute=Ao(e.position,n)}),e({nodeExtent:n,nodeInternals:new Map(o)})},panBy:e=>{const{transform:n,width:o,height:r,d3Zoom:a,d3Selection:i,translateExtent:s}=t();if(!a||!i||!e.x&&!e.y)return!1;const l=to.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[o,r]],u=a?.constrain()(l,c,s);return a.transform(i,u),n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:Hi.connectionNodeId,connectionHandleId:Hi.connectionHandleId,connectionHandleType:Hi.connectionHandleType,connectionStatus:Hi.connectionStatus,connectionStartHandle:Hi.connectionStartHandle,connectionEndHandle:Hi.connectionEndHandle}),reset:()=>e({...Hi})}),t=Object.is,e?C(e,t):C;var e,t},Vi=({children:t})=>{const n=e.useRef(null);return n.current||(n.current=Fi()),e.createElement(fo,{value:n.current},t)};Vi.displayName="ReactFlowProvider";const Wi=({children:t})=>e.useContext(uo)?e.createElement(e.Fragment,null,t):e.createElement(Vi,null,t);Wi.displayName="ReactFlowWrapper";const Yi={input:Yr,default:Vr,output:Kr,group:qr},Xi={default:gr,straight:fr,step:dr,smoothstep:ur,simplebezier:ar},Ki=[0,0],qi=[15,15],Ui={x:0,y:0,zoom:1},Zi={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Gi=e.forwardRef(({nodes:t,edges:n,defaultNodes:o,defaultEdges:r,className:a,nodeTypes:s=Yi,edgeTypes:l=Xi,onNodeClick:c,onEdgeClick:u,onInit:d,onMove:f,onMoveStart:p,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:N,onNodesDelete:M,onEdgesDelete:O,onSelectionChange:P,onSelectionDragStart:R,onSelectionDrag:A,onSelectionDragStop:D,onSelectionContextMenu:T,onSelectionStart:I,onSelectionEnd:z,connectionMode:L=Go.Strict,connectionLineType:$=er.Bezier,connectionLineStyle:B,connectionLineComponent:j,connectionLineContainerStyle:H,deleteKeyCode:F="Backspace",selectionKeyCode:V="Shift",selectionOnDrag:W=!1,selectionMode:Y=Jo.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(Xo()?"Meta":"Control"),zoomActivationKeyCode:q=(Xo()?"Meta":"Control"),snapToGrid:U=!1,snapGrid:Z=qi,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=Ki,edgesFocusable:oe,edgesUpdatable:re,elementsSelectable:ae,defaultViewport:ie=Ui,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=ji,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:pe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=Qo.Free,zoomOnDoubleClick:ve=!0,panOnDrag:be=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:ke,children:Ce,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Pe,onEdgeMouseLeave:Re,onEdgeUpdate:Ae,onEdgeUpdateStart:De,onEdgeUpdateEnd:Te,onReconnect:Ie,onReconnectStart:ze,onReconnectEnd:Le,reconnectRadius:$e=10,edgeUpdaterRadius:Be=10,onNodesChange:je,onEdgesChange:He,noDragClassName:Fe="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:We="nopan",fitView:Ye=!1,fitViewOptions:Xe,connectOnClick:Ke=!0,attributionPosition:qe,proOptions:Ue,defaultEdgeOptions:Ze,elevateNodesOnSelect:Ge=!0,elevateEdgesOnSelect:Qe=!1,disableKeyboardA11y:Je=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:ot,onError:rt,style:at,id:it,nodeDragThreshold:st,...lt},ct)=>{const ut=it||"1";return e.createElement("div",{...lt,style:{...at,...Zi},ref:ct,className:i(["react-flow",a]),"data-testid":"rf__wrapper",id:it},e.createElement(Wi,null,e.createElement(Bi,{onInit:d,onMove:f,onMoveStart:p,onMoveEnd:h,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:s,edgeTypes:l,connectionLineType:$,connectionLineStyle:B,connectionLineComponent:j,connectionLineContainerStyle:H,selectionKeyCode:V,selectionOnDrag:W,selectionMode:Y,deleteKeyCode:F,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:q,onlyRenderVisibleElements:G,selectNodesOnDrag:Q,defaultViewport:ie,translateExtent:ce,minZoom:se,maxZoom:le,preventScrolling:ue,zoomOnScroll:pe,zoomOnPinch:he,zoomOnDoubleClick:ve,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:be,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:ke,onSelectionContextMenu:T,onSelectionStart:I,onSelectionEnd:z,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Pe,onEdgeMouseLeave:Re,onReconnect:Ie??Ae,onReconnectStart:ze??De,onReconnectEnd:Le??Te,reconnectRadius:$e??Be,defaultMarkerColor:fe,noDragClassName:Fe,noWheelClassName:Ve,noPanClassName:We,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),e.createElement(ra,{nodes:t,edges:n,defaultNodes:o,defaultEdges:r,onConnect:m,onConnectStart:g,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:oe,edgesUpdatable:re,elementsSelectable:ae,elevateNodesOnSelect:Ge,minZoom:se,maxZoom:le,nodeExtent:de,onNodesChange:je,onEdgesChange:He,snapToGrid:U,snapGrid:Z,connectionMode:L,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:Ye,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:O,onNodeDragStart:k,onNodeDrag:C,onNodeDragStop:N,onSelectionDrag:A,onSelectionDragStart:R,onSelectionDragStop:D,noPanClassName:We,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:rt,connectionRadius:nt,isValidConnection:ot,nodeDragThreshold:st}),e.createElement(ea,{onSelectionChange:P}),Ce,e.createElement(Mo,{proOptions:Ue,position:qe}),e.createElement(da,{rfId:ut,disableKeyboardA11y:Je})))});function Qi(t){return n=>{const[o,r]=e.useState(n),a=e.useCallback(e=>r(n=>t(e,n)),[]);return[o,r,a]}}Gi.displayName="ReactFlow";const Ji=Qi($a),es=Qi(function(e,t){return La(e,t)});var ts;function ns({color:t,dimensions:n,lineWidth:o}){return e.createElement("path",{stroke:t,strokeWidth:o,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function os({color:t,radius:n}){return e.createElement("circle",{cx:n,cy:n,r:n,fill:t})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(ts||(ts={}));const rs={[ts.Dots]:"#91919a",[ts.Lines]:"#eee",[ts.Cross]:"#e2e2e2"},as={[ts.Dots]:1,[ts.Lines]:1,[ts.Cross]:6},is=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ss({id:t,variant:n=ts.Dots,gap:o=20,size:r,lineWidth:a=1,offset:s=2,color:l,style:c,className:u}){const d=e.useRef(null),{transform:f,patternId:p}=_o(is,N),h=l||rs[n],m=r||as[n],g=n===ts.Dots,y=n===ts.Cross,v=Array.isArray(o)?o:[o,o],b=[v[0]*f[2]||1,v[1]*f[2]||1],w=m*f[2],x=y?[w,w]:b,E=g?[w/s,w/s]:[x[0]/s,x[1]/s];return e.createElement("svg",{className:i(["react-flow__background",u]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},e.createElement("pattern",{id:p+t,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`},g?e.createElement(os,{color:h,radius:w/s}):e.createElement(ns,{dimensions:x,color:h,lineWidth:a})),e.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+t})`}))}ss.displayName="Background";var ls=e.memo(ss);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".react-flow{direction:ltr}.react-flow__container{height:100%;left:0;position:absolute;top:0;width:100%}.react-flow__pane{cursor:grab;z-index:1}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:grabbing}.react-flow__viewport{pointer-events:none;transform-origin:0 0;z-index:2}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{overflow:visible;pointer-events:none}.react-flow__connection-path,.react-flow__edge-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{cursor:pointer;pointer-events:visibleStroke}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{box-sizing:border-box;cursor:grab;pointer-events:all;position:absolute;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__node.dragging{cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:grab;pointer-events:all;position:absolute}.react-flow__handle{background:#1a192b;border:1px solid #fff;border-radius:100%;height:6px;min-height:5px;min-width:5px;pointer-events:none;position:absolute;width:6px}.react-flow__handle.connectionindicator{cursor:crosshair;pointer-events:all}.react-flow__handle-bottom{bottom:-4px;left:50%;top:auto;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{left:-4px;top:50%;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{margin:15px;position:absolute;z-index:5}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translateX(-50%)}.react-flow__attribution{background:hsla(0,0%,100%,.5);font-size:10px;margin:0;padding:2px 3px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{height:100%;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-group,.react-flow__node-input,.react-flow__node-output{background-color:#fff;border:1px solid #1a192b;border-radius:3px;color:#222;font-size:12px;padding:10px;text-align:center;width:150px}.react-flow__node-default.selectable:hover,.react-flow__node-group.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover{box-shadow:0 1px 4px 1px rgba(0,0,0,.08)}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:hsla(0,0%,94%,.25)}.react-flow__nodesselection-rect,.react-flow__selection{background:rgba(0,89,220,.08);border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px rgba(0,0,0,.08)}.react-flow__controls-button{align-items:center;background:#fefefe;border:none;border-bottom:1px solid #eee;box-sizing:content-box;cursor:pointer;display:flex;height:16px;justify-content:center;padding:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{max-height:12px;max-width:12px;width:100%}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.bottom,.react-flow__resize-control.top{cursor:ns-resize}.react-flow__resize-control.bottom.right,.react-flow__resize-control.top.left{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:#3367d9;border:1px solid #fff;border-radius:1px;height:4px;transform:translate(-50%,-50%);width:4px}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.bottom.left,.react-flow__resize-control.handle.top.left{left:0}.react-flow__resize-control.handle.bottom.right,.react-flow__resize-control.handle.top.right{left:100%}.react-flow__resize-control.line{border:0 solid #3367d9}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{height:100%;top:0;transform:translate(-50%);width:1px}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.bottom,.react-flow__resize-control.line.top{height:1px;left:0;transform:translateY(-50%);width:100%}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}");
1
+ "use strict";var e=require("react"),t=require("react-dom"),n=require("react/jsx-runtime");function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var o=r(e),a=r(t);function i(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=i(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l,c={exports:{}},u={},d={exports:{}},f={};var p,h,m,g={};function y(){return h||(h=1,"production"===process.env.NODE_ENV?d.exports=function(){if(l)return f;l=1;var t=e,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useState,o=t.useEffect,a=t.useLayoutEffect,i=t.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),l=r({inst:{value:n,getSnapshot:t}}),c=l[0].inst,u=l[1];return a(function(){c.value=n,c.getSnapshot=t,s(c)&&u({inst:c})},[e,n,t]),o(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),i(n),n};return f.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:c,f}():d.exports=(p||(p=1,"production"!==process.env.NODE_ENV&&function(){function t(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=e,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,a=n.useEffect,i=n.useLayoutEffect,s=n.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,u){l||void 0===n.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=u();if(!c){var f=u();r(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var p=(f=o({inst:{value:d,getSnapshot:u}}))[0].inst,h=f[1];return i(function(){p.value=d,p.getSnapshot=u,t(p)&&h({inst:p})},[e,d,u]),a(function(){return t(p)&&h({inst:p}),e(function(){t(p)&&h({inst:p})})},[e]),s(d),d};g.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),g)),d.exports}var v,b={};"production"===process.env.NODE_ENV?c.exports=function(){if(m)return u;m=1;var t=e,n=y(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,a=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;return u.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,o=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,a=n)}var o,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=o(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},u}():c.exports=(v||(v=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=e,n=y(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,a=t.useRef,i=t.useEffect,s=t.useMemo,l=t.useDebugValue;b.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,o=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,a=n)}var o,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=o(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),b);var w=s(c.exports);const x=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(r,o,a);return a},{useDebugValue:E}=e,{useSyncExternalStoreWithSelector:S}=w,_=e=>e;function C(e,t=_,n){const r=S(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return E(r),r}const k=(e,t)=>{const n=(e=>e?x(e):x)(e),r=(e,r=t)=>C(n,e,r);return Object.assign(r,n),r};function N(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var M={value:()=>{}};function R(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new O(r)}function O(e){this._=e}function P(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function A(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=M,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}O.prototype=R.prototype={constructor:O,on:function(e,t){var n,r,o=this._,a=(r=o,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),i=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<s;)if(n=(e=a[i]).type)o[n]=A(o[n],e.name,t);else if(null==t)for(n in o)o[n]=A(o[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=P(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new O(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),a=0;a<n;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(r=this._[e]).length;a<n;++a)r[a].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,a=r.length;o<a;++o)r[o].value.apply(t,n)}};var T="http://www.w3.org/1999/xhtml",D={svg:"http://www.w3.org/2000/svg",xhtml:T,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),D.hasOwnProperty(t)?{space:D[t],local:e}:e}function I(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===T&&t.documentElement.namespaceURI===T?t.createElement(e):t.createElementNS(n,e)}}function z(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function L(e){var t=$(e);return(t.local?z:I)(t)}function B(){}function F(e){return null==e?B:function(){return this.querySelector(e)}}function j(){return[]}function H(e){return null==e?j:function(){return this.querySelectorAll(e)}}function V(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function W(e){return function(){return this.matches(e)}}function Y(e){return function(t){return t.matches(e)}}var X=Array.prototype.find;function K(){return this.firstElementChild}var U=Array.prototype.filter;function q(){return Array.from(this.children)}function Z(e){return new Array(e.length)}function G(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Q(e,t,n,r,o,a){for(var i,s=0,l=t.length,c=a.length;s<c;++s)(i=t[s])?(i.__data__=a[s],r[s]=i):n[s]=new G(e,a[s]);for(;s<l;++s)(i=t[s])&&(o[s]=i)}function J(e,t,n,r,o,a,i){var s,l,c,u=new Map,d=t.length,f=a.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=i.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<f;++s)c=i.call(e,a[s],s,a)+"",(l=u.get(c))?(r[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new G(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(o[s]=l)}function ee(e){return e.__data__}function te(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function ne(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function re(e){return function(){this.removeAttribute(e)}}function oe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ae(e,t){return function(){this.setAttribute(e,t)}}function ie(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function se(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function le(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function ce(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ue(e){return function(){this.style.removeProperty(e)}}function de(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fe(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function pe(e,t){return e.style.getPropertyValue(t)||ce(e).getComputedStyle(e,null).getPropertyValue(t)}function he(e){return function(){delete this[e]}}function me(e,t){return function(){this[e]=t}}function ge(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function ye(e){return e.trim().split(/^|\s+/)}function ve(e){return e.classList||new be(e)}function be(e){this._node=e,this._names=ye(e.getAttribute("class")||"")}function we(e,t){for(var n=ve(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function xe(e,t){for(var n=ve(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Ee(e){return function(){we(this,e)}}function Se(e){return function(){xe(this,e)}}function _e(e,t){return function(){(t.apply(this,arguments)?we:xe)(this,e)}}function Ce(){this.textContent=""}function ke(e){return function(){this.textContent=e}}function Ne(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Me(){this.innerHTML=""}function Re(e){return function(){this.innerHTML=e}}function Oe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Pe(){this.nextSibling&&this.parentNode.appendChild(this)}function Ae(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Te(){return null}function De(){var e=this.parentNode;e&&e.removeChild(this)}function $e(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ie(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ze(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,a=t.length;r<a;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function Le(e,t,n){return function(){var r,o=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var i=0,s=o.length;i<s;++i)if((r=o[i]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=t);this.addEventListener(e.type,a,n),r={type:e.type,name:e.name,value:t,listener:a,options:n},o?o.push(r):this.__on=[r]}}function Be(e,t,n){var r=ce(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Fe(e,t){return function(){return Be(this,e,t)}}function je(e,t){return function(){return Be(this,e,t.apply(this,arguments))}}G.prototype={constructor:G,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},be.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var He=[null];function Ve(e,t){this._groups=e,this._parents=t}function We(){return new Ve([[document.documentElement]],He)}function Ye(e){return"string"==typeof e?new Ve([[document.querySelector(e)]],[document.documentElement]):new Ve([[e]],He)}function Xe(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}Ve.prototype=We.prototype={constructor:Ve,select:function(e){"function"!=typeof e&&(e=F(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i,s=t[o],l=s.length,c=r[o]=new Array(l),u=0;u<l;++u)(a=s[u])&&(i=e.call(a,a.__data__,u,s))&&("__data__"in a&&(i.__data__=a.__data__),c[u]=i);return new Ve(r,this._parents)},selectAll:function(e){e="function"==typeof e?V(e):H(e);for(var t=this._groups,n=t.length,r=[],o=[],a=0;a<n;++a)for(var i,s=t[a],l=s.length,c=0;c<l;++c)(i=s[c])&&(r.push(e.call(i,i.__data__,c,s)),o.push(i));return new Ve(r,o)},selectChild:function(e){return this.select(null==e?K:function(e){return function(){return X.call(this.children,e)}}("function"==typeof e?e:Y(e)))},selectChildren:function(e){return this.selectAll(null==e?q:function(e){return function(){return U.call(this.children,e)}}("function"==typeof e?e:Y(e)))},filter:function(e){"function"!=typeof e&&(e=W(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i=t[o],s=i.length,l=r[o]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new Ve(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,ee);var n,r=t?J:Q,o=this._parents,a=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var i=a.length,s=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var d=o[u],f=a[u],p=f.length,h=te(e.call(d,d&&d.__data__,u,o)),m=h.length,g=l[u]=new Array(m),y=s[u]=new Array(m);r(d,f,g,y,c[u]=new Array(p),h,t);for(var v,b,w=0,x=0;w<m;++w)if(v=g[w]){for(w>=x&&(x=w+1);!(b=y[x])&&++x<m;);v._next=b||null}}return(s=new Ve(s,o))._enter=l,s._exit=c,s},enter:function(){return new Ve(this._enter||this._groups.map(Z),this._parents)},exit:function(){return new Ve(this._exit||this._groups.map(Z),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,a=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?a.remove():n(a),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,a=r.length,i=Math.min(o,a),s=new Array(o),l=0;l<i;++l)for(var c,u=n[l],d=r[l],f=u.length,p=s[l]=new Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;l<o;++l)s[l]=n[l];return new Ve(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],a=o.length-1,i=o[a];--a>=0;)(r=o[a])&&(i&&4^r.compareDocumentPosition(i)&&i.parentNode.insertBefore(r,i),i=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=ne);for(var n=this._groups,r=n.length,o=new Array(r),a=0;a<r;++a){for(var i,s=n[a],l=s.length,c=o[a]=new Array(l),u=0;u<l;++u)(i=s[u])&&(c[u]=i);c.sort(t)}return new Ve(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,a=r.length;o<a;++o){var i=r[o];if(i)return i}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,a=t[n],i=0,s=a.length;i<s;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this},attr:function(e,t){var n=$(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?oe:re:"function"==typeof t?n.local?le:se:n.local?ie:ae)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?ue:"function"==typeof t?fe:de)(e,t,null==n?"":n)):pe(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?he:"function"==typeof t?ge:me)(e,t)):this.node()[e]},classed:function(e,t){var n=ye(e+"");if(arguments.length<2){for(var r=ve(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?_e:t?Ee:Se)(n,t))},text:function(e){return arguments.length?this.each(null==e?Ce:("function"==typeof e?Ne:ke)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Me:("function"==typeof e?Oe:Re)(e)):this.node().innerHTML},raise:function(){return this.each(Pe)},lower:function(){return this.each(Ae)},append:function(e){var t="function"==typeof e?e:L(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:L(e),r=null==t?Te:"function"==typeof t?t:F(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(De)},clone:function(e){return this.select(e?Ie:$e)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,a=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),i=a.length;if(!(arguments.length<2)){for(s=t?Le:ze,r=0;r<i;++r)this.each(s(a[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<i;++r)if((o=a[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?je:Fe)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],a=0,i=o.length;a<i;++a)(r=o[a])&&(yield r)}};const Ke={passive:!1},Ue={capture:!0,passive:!1};function qe(e){e.stopImmediatePropagation()}function Ze(e){e.preventDefault(),e.stopImmediatePropagation()}function Ge(e){var t=e.document.documentElement,n=Ye(e).on("dragstart.drag",Ze,Ue);"onselectstart"in t?n.on("selectstart.drag",Ze,Ue):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Qe(e,t){var n=e.document.documentElement,r=Ye(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ze,Ue),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Je=e=>()=>e;function et(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:a,x:i,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function tt(e){return!e.ctrlKey&&!e.button}function nt(){return this.parentNode}function rt(e,t){return null==t?{x:e.x,y:e.y}:t}function ot(){return navigator.maxTouchPoints||"ontouchstart"in this}function at(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function it(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function st(){}et.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var lt=.7,ct=1/lt,ut="\\s*([+-]?\\d+)\\s*",dt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pt=/^#([0-9a-f]{3,8})$/,ht=new RegExp(`^rgb\\(${ut},${ut},${ut}\\)$`),mt=new RegExp(`^rgb\\(${ft},${ft},${ft}\\)$`),gt=new RegExp(`^rgba\\(${ut},${ut},${ut},${dt}\\)$`),yt=new RegExp(`^rgba\\(${ft},${ft},${ft},${dt}\\)$`),vt=new RegExp(`^hsl\\(${dt},${ft},${ft}\\)$`),bt=new RegExp(`^hsla\\(${dt},${ft},${ft},${dt}\\)$`),wt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xt(){return this.rgb().formatHex()}function Et(){return this.rgb().formatRgb()}function St(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?_t(t):3===n?new Nt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ct(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ct(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ht.exec(e))?new Nt(t[1],t[2],t[3],1):(t=mt.exec(e))?new Nt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=gt.exec(e))?Ct(t[1],t[2],t[3],t[4]):(t=yt.exec(e))?Ct(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=vt.exec(e))?Tt(t[1],t[2]/100,t[3]/100,1):(t=bt.exec(e))?Tt(t[1],t[2]/100,t[3]/100,t[4]):wt.hasOwnProperty(e)?_t(wt[e]):"transparent"===e?new Nt(NaN,NaN,NaN,0):null}function _t(e){return new Nt(e>>16&255,e>>8&255,255&e,1)}function Ct(e,t,n,r){return r<=0&&(e=t=n=NaN),new Nt(e,t,n,r)}function kt(e,t,n,r){return 1===arguments.length?((o=e)instanceof st||(o=St(o)),o?new Nt((o=o.rgb()).r,o.g,o.b,o.opacity):new Nt):new Nt(e,t,n,null==r?1:r);var o}function Nt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Mt(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function Rt(){const e=Ot(this.opacity);return`${1===e?"rgb(":"rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${1===e?")":`, ${e})`}`}function Ot(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function At(e){return((e=Pt(e))<16?"0":"")+e.toString(16)}function Tt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $t(e,t,n,r)}function Dt(e){if(e instanceof $t)return new $t(e.h,e.s,e.l,e.opacity);if(e instanceof st||(e=St(e)),!e)return new $t;if(e instanceof $t)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,s=a-o,l=(a+o)/2;return s?(i=t===a?(n-r)/s+6*(n<r):n===a?(r-t)/s+2:(t-n)/s+4,s/=l<.5?a+o:2-a-o,i*=60):s=l>0&&l<1?0:i,new $t(i,s,l,e.opacity)}function $t(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function It(e){return(e=(e||0)%360)<0?e+360:e}function zt(e){return Math.max(0,Math.min(1,e||0))}function Lt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}at(st,St,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xt,formatHex:xt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Dt(this).formatHsl()},formatRgb:Et,toString:Et}),at(Nt,kt,it(st,{brighter(e){return e=null==e?ct:Math.pow(ct,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?lt:Math.pow(lt,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nt(Pt(this.r),Pt(this.g),Pt(this.b),Ot(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Mt,formatHex:Mt,formatHex8:function(){return`#${At(this.r)}${At(this.g)}${At(this.b)}${At(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Rt,toString:Rt})),at($t,function(e,t,n,r){return 1===arguments.length?Dt(e):new $t(e,t,n,null==r?1:r)},it(st,{brighter(e){return e=null==e?ct:Math.pow(ct,e),new $t(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?lt:Math.pow(lt,e),new $t(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Nt(Lt(e>=240?e-240:e+120,o,r),Lt(e,o,r),Lt(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new $t(It(this.h),zt(this.s),zt(this.l),Ot(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ot(this.opacity);return`${1===e?"hsl(":"hsla("}${It(this.h)}, ${100*zt(this.s)}%, ${100*zt(this.l)}%${1===e?")":`, ${e})`}`}}));var Bt=e=>()=>e;function Ft(e){return 1===(e=+e)?jt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Bt(isNaN(t)?n:t)}}function jt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Bt(isNaN(e)?t:e)}var Ht=function e(t){var n=Ft(t);function r(e,t){var r=n((e=kt(e)).r,(t=kt(t)).r),o=n(e.g,t.g),a=n(e.b,t.b),i=jt(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return r.gamma=e,r}(1);function Vt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Wt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yt=new RegExp(Wt.source,"g");function Xt(e,t){var n,r,o,a=Wt.lastIndex=Yt.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=Wt.exec(e))&&(r=Yt.exec(t));)(o=r.index)>a&&(o=t.slice(a,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(r=r[0])?s[i]?s[i]+=r:s[++i]=r:(s[++i]=null,l.push({i:i,x:Vt(n,r)})),a=Yt.lastIndex;return a<t.length&&(o=t.slice(a),s[i]?s[i]+=o:s[++i]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}var Kt,Ut=180/Math.PI,qt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Zt(e,t,n,r,o,a){var i,s,l;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,i=-i),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*Ut,skewX:Math.atan(l)*Ut,scaleX:i,scaleY:s}}function Gt(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(a,i){var s=[],l=[];return a=e(a),i=e(i),function(e,r,o,a,i,s){if(e!==o||r!==a){var l=i.push("translate(",null,t,null,n);s.push({i:l-4,x:Vt(e,o)},{i:l-2,x:Vt(r,a)})}else(o||a)&&i.push("translate("+o+t+a+n)}(a.translateX,a.translateY,i.translateX,i.translateY,s,l),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(o(n)+"rotate(",null,r)-2,x:Vt(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(a.rotate,i.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(o(n)+"skewX(",null,r)-2,x:Vt(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(a.skewX,i.skewX,s,l),function(e,t,n,r,a,i){if(e!==n||t!==r){var s=a.push(o(a)+"scale(",null,",",null,")");i.push({i:s-4,x:Vt(e,n)},{i:s-2,x:Vt(t,r)})}else 1===n&&1===r||a.push(o(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,i.scaleX,i.scaleY,s,l),a=i=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var Qt=Gt(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?qt:Zt(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),Jt=Gt(function(e){return null==e?qt:(Kt||(Kt=document.createElementNS("http://www.w3.org/2000/svg","g")),Kt.setAttribute("transform",e),(e=Kt.transform.baseVal.consolidate())?Zt((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):qt)},", ",")",")");function en(e){return((e=Math.exp(e))+1/e)/2}var tn,nn,rn=function e(t,n,r){function o(e,o){var a,i,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],f=o[2],p=u-s,h=d-l,m=p*p+h*h;if(m<1e-12)i=Math.log(f/c)/t,a=function(e){return[s+e*p,l+e*h,c*Math.exp(t*e*i)]};else{var g=Math.sqrt(m),y=(f*f-c*c+r*m)/(2*c*n*g),v=(f*f-c*c-r*m)/(2*f*n*g),b=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);i=(w-b)/t,a=function(e){var r,o=e*i,a=en(b),u=c/(n*g)*(a*(r=t*o+b,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*p,l+u*h,c*a/en(t*o+b)]}}return a.duration=1e3*i*t/Math.SQRT2,a}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4),on=0,an=0,sn=0,ln=0,cn=0,un=0,dn="object"==typeof performance&&performance.now?performance:Date,fn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function pn(){return cn||(fn(hn),cn=dn.now()+un)}function hn(){cn=0}function mn(){this._call=this._time=this._next=null}function gn(e,t,n){var r=new mn;return r.restart(e,t,n),r}function yn(){cn=(ln=dn.now())+un,on=an=0;try{!function(){pn(),++on;for(var e,t=tn;t;)(e=cn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--on}()}finally{on=0,function(){var e,t,n=tn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:tn=t);nn=e,bn(r)}(),cn=0}}function vn(){var e=dn.now(),t=e-ln;t>1e3&&(un-=t,ln=e)}function bn(e){on||(an&&(an=clearTimeout(an)),e-cn>24?(e<1/0&&(an=setTimeout(yn,e-dn.now()-un)),sn&&(sn=clearInterval(sn))):(sn||(ln=dn.now(),sn=setInterval(vn,1e3)),on=1,fn(yn)))}function wn(e,t,n){var r=new mn;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}mn.prototype=gn.prototype={constructor:mn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?pn():+n)+(null==t?0:+t),this._next||nn===this||(nn?nn._next=this:tn=this,nn=this),this._call=e,this._time=n,bn()},stop:function(){this._call&&(this._call=null,this._time=1/0,bn())}};var xn=R("start","end","cancel","interrupt"),En=[];function Sn(e,t,n,r,o,a){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function a(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)}function i(a){var c,u,d,f;if(1!==n.state)return l();for(c in o)if((f=o[c]).name===n.name){if(3===f.state)return wn(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(wn(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function s(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,i=r.length;++a<i;)r[a].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=gn(a,0,n.time)}(e,n,{name:t,index:r,group:o,on:xn,tween:En,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function _n(e,t){var n=kn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function Cn(e,t){var n=kn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function kn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Nn(e,t){var n,r,o,a=e.__transition,i=!0;if(a){for(o in t=null==t?null:t+"",a)(n=a[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[o]):i=!1;i&&delete e.__transition}}function Mn(e,t){var n,r;return function(){var o=Cn(this,e),a=o.tween;if(a!==n)for(var i=0,s=(r=n=a).length;i<s;++i)if(r[i].name===t){(r=r.slice()).splice(i,1);break}o.tween=r}}function Rn(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var a=Cn(this,e),i=a.tween;if(i!==r){o=(r=i).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}a.tween=o}}function On(e,t,n){var r=e._id;return e.each(function(){var e=Cn(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return kn(e,r).value[t]}}function Pn(e,t){var n;return("number"==typeof t?Vt:t instanceof St?Ht:(n=St(t))?(t=n,Ht):Xt)(e,t)}function An(e){return function(){this.removeAttribute(e)}}function Tn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dn(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttribute(e);return i===a?null:i===r?o:o=t(r=i,n)}}function $n(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===r?o:o=t(r=i,n)}}function In(e,t,n){var r,o,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttribute(e))===(s=l+"")?null:i===r&&s===o?a:(o=s,a=t(r=i,l));this.removeAttribute(e)}}function zn(e,t,n){var r,o,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:i===r&&s===o?a:(o=s,a=t(r=i,l));this.removeAttributeNS(e.space,e.local)}}function Ln(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Bn(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Fn(e,t){return function(){_n(this,e).delay=+t.apply(this,arguments)}}function jn(e,t){return t=+t,function(){_n(this,e).delay=t}}function Hn(e,t){return function(){Cn(this,e).duration=+t.apply(this,arguments)}}function Vn(e,t){return t=+t,function(){Cn(this,e).duration=t}}var Wn=We.prototype.constructor;function Yn(e){return function(){this.style.removeProperty(e)}}var Xn=0;function Kn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Un(){return++Xn}var qn=We.prototype;Kn.prototype={constructor:Kn,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=F(e));for(var r=this._groups,o=r.length,a=new Array(o),i=0;i<o;++i)for(var s,l,c=r[i],u=c.length,d=a[i]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,Sn(d[f],t,n,f,d,kn(s,n)));return new Kn(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=H(e));for(var r=this._groups,o=r.length,a=[],i=[],s=0;s<o;++s)for(var l,c=r[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,p=e.call(l,l.__data__,d,c),h=kn(l,n),m=0,g=p.length;m<g;++m)(f=p[m])&&Sn(f,t,n,m,p,h);a.push(p),i.push(l)}return new Kn(a,i,t,n)},selectChild:qn.selectChild,selectChildren:qn.selectChildren,filter:function(e){"function"!=typeof e&&(e=W(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i=t[o],s=i.length,l=r[o]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new Kn(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,a=Math.min(r,o),i=new Array(r),s=0;s<a;++s)for(var l,c=t[s],u=n[s],d=c.length,f=i[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<r;++s)i[s]=t[s];return new Kn(i,this._parents,this._name,this._id)},selection:function(){return new Wn(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=Un(),r=this._groups,o=r.length,a=0;a<o;++a)for(var i,s=r[a],l=s.length,c=0;c<l;++c)if(i=s[c]){var u=kn(i,t);Sn(i,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Kn(r,this._parents,e,n)},call:qn.call,nodes:qn.nodes,node:qn.node,size:qn.size,empty:qn.empty,each:qn.each,on:function(e,t){var n=this._id;return arguments.length<2?kn(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,a=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?_n:Cn;return function(){var i=a(this,e),s=i.on;s!==r&&(o=(r=s).copy()).on(t,n),i.on=o}}(n,e,t))},attr:function(e,t){var n=$(e),r="transform"===n?Jt:Pn;return this.attrTween(e,"function"==typeof t?(n.local?zn:In)(n,r,On(this,"attr."+e,t)):null==t?(n.local?Tn:An)(n):(n.local?$n:Dn)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=$(e);return this.tween(n,(r.local?Ln:Bn)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?Qt:Pn;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var a=pe(this,e),i=(this.style.removeProperty(e),pe(this,e));return a===i?null:a===n&&i===r?o:o=t(n=a,r=i)}}(e,r)).on("end.style."+e,Yn(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,a;return function(){var i=pe(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=pe(this,e)),i===l?null:i===r&&l===o?a:(o=l,a=t(r=i,s))}}(e,r,On(this,"style."+e,t))).each(function(e,t){var n,r,o,a,i="style."+t,s="end."+i;return function(){var l=Cn(this,e),c=l.on,u=null==l.value[i]?a||(a=Yn(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(s,o=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,a=n+"";return function(){var i=pe(this,e);return i===a?null:i===r?o:o=t(r=i,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function a(){var a=t.apply(this,arguments);return a!==o&&(r=(o=a)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,a,n)),r}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(On(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=kn(this.node(),n).tween,a=0,i=o.length;a<i;++a)if((r=o[a]).name===e)return r.value;return null}return this.each((null==t?Mn:Rn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Fn:jn)(t,e)):kn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Hn:Vn)(t,e)):kn(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){Cn(this,e).ease=t}}(t,e)):kn(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;Cn(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(a,i){var s={value:i},l={value:function(){0===--o&&a()}};n.each(function(){var n=Cn(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===o&&a()})},[Symbol.iterator]:qn[Symbol.iterator]};var Zn={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function Gn(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}We.prototype.interrupt=function(e){return this.each(function(){Nn(this,e)})},We.prototype.transition=function(e){var t,n;e instanceof Kn?(t=e._id,e=e._name):(t=Un(),(n=Zn).time=pn(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,a=0;a<o;++a)for(var i,s=r[a],l=s.length,c=0;c<l;++c)(i=s[c])&&Sn(i,e,t,c,s,n||Gn(i,t));return new Kn(r,this._parents,e,t)};var Qn=e=>()=>e;function Jn(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function er(e,t,n){this.k=e,this.x=t,this.y=n}er.prototype={constructor:er,scale:function(e){return 1===e?this:new er(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new er(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var tr=new er(1,0,0);function nr(e){e.stopImmediatePropagation()}function rr(e){e.preventDefault(),e.stopImmediatePropagation()}function or(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function ar(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function ir(){return this.__zoom||tr}function sr(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lr(){return navigator.maxTouchPoints||"ontouchstart"in this}function cr(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}er.prototype;const ur=e.createContext(null),dr=ur.Provider,fr=()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",pr=e=>`Node type "${e}" not found. Using fallback type "default".`,hr=()=>"The React Flow parent container needs a width and a height to render the graph.",mr=()=>"Only child nodes can use a parent extent.",gr=()=>"Can't create edge. An edge needs a source and a target.",yr=e=>`Marker type "${e}" doesn't exist.`,vr=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,br=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",wr=e=>`Edge type "${e}" not found. Using fallback type "default".`,xr=e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,Er=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function Sr(t,n){const r=e.useContext(ur);if(null===r)throw new Error(Er);return C(r,t,n)}const _r=()=>{const t=e.useContext(ur);if(null===t)throw new Error(Er);return e.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},Cr=e=>e.userSelectionActive?"none":"all";function kr({position:t,children:n,className:r,style:o,...a}){const s=Sr(Cr),l=`${t}`.split("-");return e.createElement("div",{className:i(["react-flow__panel",r,...l]),style:{...o,pointerEvents:s},...a},n)}function Nr({proOptions:t,position:n="bottom-right"}){return t?.hideAttribution?null:e.createElement(kr,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},e.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var Mr=e.memo(({x:t,y:n,label:r,labelStyle:o={},labelShowBg:a=!0,labelBgStyle:s={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:u,className:d,...f})=>{const p=e.useRef(null),[h,m]=e.useState({x:0,y:0,width:0,height:0}),g=i(["react-flow__edge-textwrapper",d]);return e.useEffect(()=>{if(p.current){const e=p.current.getBBox();m({x:e.x,y:e.y,width:e.width,height:e.height})}},[r]),void 0!==r&&r?e.createElement("g",{transform:`translate(${t-h.width/2} ${n-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...f},a&&e.createElement("rect",{width:h.width+2*l[0],x:-l[0],y:-l[1],height:h.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),e.createElement("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:p,style:o},r),u):null});const Rr=e=>({width:e.offsetWidth,height:e.offsetHeight}),Or=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Pr=(e={x:0,y:0},t)=>({x:Or(e.x,t[0][0],t[1][0]),y:Or(e.y,t[0][1],t[1][1])}),Ar=(e,t,n)=>e<t?Or(Math.abs(e-t),1,50)/50:e>n?-Or(Math.abs(e-n),1,50)/50:0,Tr=(e,t)=>[20*Ar(e.x,35,t.width-35),20*Ar(e.y,35,t.height-35)],Dr=e=>e.getRootNode?.()||window?.document,$r=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ir=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),zr=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Lr=e=>!isNaN(e)&&isFinite(e),Br=Symbol.for("internals"),Fr=["Enter"," ","Escape"],jr=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function Hr(e){const t=(e=>"nativeEvent"in e)(e)?e.nativeEvent:e,n=t.composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const Vr=e=>"clientX"in e,Wr=(e,t)=>{const n=Vr(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},Yr=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,Xr=({id:t,path:n,labelX:r,labelY:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>e.createElement(e.Fragment,null,e.createElement("path",{id:t,style:d,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&e.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),a&&Lr(r)&&Lr(o)?e.createElement(Mr,{x:r,y:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function Kr(e,t,n){return void 0===n?n:r=>{const o=t().edges.find(t=>t.id===e);o&&n(r,{...o})}}function Ur({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,a=n<e?n+o:n-o,i=Math.abs(r-t)/2;return[a,r<t?r+i:r-i,o,i]}function qr({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:a,targetControlX:i,targetControlY:s}){const l=.125*e+.375*o+.375*i+.125*n,c=.125*t+.375*a+.375*s+.125*r;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var Zr,Gr,Qr,Jr,eo,to;function no({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===to.Left||e===to.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function ro({sourceX:e,sourceY:t,sourcePosition:n=to.Bottom,targetX:r,targetY:o,targetPosition:a=to.Top}){const[i,s]=no({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=no({pos:a,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=qr({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${i},${s} ${l},${c} ${r},${o}`,u,d,f,p]}Xr.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(Zr||(Zr={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(Gr||(Gr={})),function(e){e.Partial="partial",e.Full="full"}(Qr||(Qr={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(Jr||(Jr={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(eo||(eo={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(to||(to={}));const oo=e.memo(({sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:a=to.Bottom,targetPosition:i=to.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})=>{const[y,v,b]=ro({sourceX:t,sourceY:n,sourcePosition:a,targetX:r,targetY:o,targetPosition:i});return e.createElement(Xr,{path:y,labelX:v,labelY:b,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})});oo.displayName="SimpleBezierEdge";const ao={[to.Left]:{x:-1,y:0},[to.Right]:{x:1,y:0},[to.Top]:{x:0,y:-1},[to.Bottom]:{x:0,y:1}},io=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function so({source:e,sourcePosition:t=to.Bottom,target:n,targetPosition:r=to.Top,center:o,offset:a}){const i=ao[t],s=ao[r],l={x:e.x+i.x*a,y:e.y+i.y*a},c={x:n.x+s.x*a,y:n.y+s.y*a},u=(({source:e,sourcePosition:t=to.Bottom,target:n})=>t===to.Left||t===to.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:l,sourcePosition:t,target:c}),d=0!==u.x?"x":"y",f=u[d];let p,h,m=[];const g={x:0,y:0},y={x:0,y:0},[v,b,w,x]=Ur({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[d]*s[d]===-1){p=o.x??v,h=o.y??b;const e=[{x:p,y:l.y},{x:p,y:c.y}],t=[{x:l.x,y:h},{x:c.x,y:h}];m=i[d]===f?"x"===d?e:t:"x"===d?t:e}else{const o=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(m="x"===d?i.x===f?u:o:i.y===f?o:u,t===r){const t=Math.abs(e[d]-n[d]);if(t<=a){const r=Math.min(a-1,a-t);i[d]===f?g[d]=(l[d]>e[d]?-1:1)*r:y[d]=(c[d]>n[d]?-1:1)*r}}if(t!==r){const e="x"===d?"y":"x",t=i[d]===s[e],n=l[e]>c[e],r=l[e]<c[e];(1===i[d]&&(!t&&n||t&&r)||1!==i[d]&&(!t&&r||t&&n))&&(m="x"===d?o:u)}const v={x:l.x+g.x,y:l.y+g.y},b={x:c.x+y.x,y:c.y+y.y};Math.max(Math.abs(v.x-m[0].x),Math.abs(b.x-m[0].x))>=Math.max(Math.abs(v.y-m[0].y),Math.abs(b.y-m[0].y))?(p=(v.x+b.x)/2,h=m[0].y):(p=m[0].x,h=(v.y+b.y)/2)}return[[e,{x:l.x+g.x,y:l.y+g.y},...m,{x:c.x+y.x,y:c.y+y.y},n],p,h,w,x]}function lo({sourceX:e,sourceY:t,sourcePosition:n=to.Bottom,targetX:r,targetY:o,targetPosition:a=to.Top,borderRadius:i=5,centerX:s,centerY:l,offset:c=20}){const[u,d,f,p,h]=so({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:a,center:{x:s,y:l},offset:c}),m=u.reduce((e,t,n)=>{let r="";return r=n>0&&n<u.length-1?function(e,t,n,r){const o=Math.min(io(e,t)/2,io(t,n)/2,r),{x:a,y:i}=t;if(e.x===a&&a===n.x||e.y===i&&i===n.y)return`L${a} ${i}`;if(e.y===i)return`L ${a+o*(e.x<n.x?-1:1)},${i}Q ${a},${i} ${a},${i+o*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${a},${i+o*(e.y<n.y?-1:1)}Q ${a},${i} ${a+o*s},${i}`}(u[n-1],t,u[n+1],i):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=r},"");return[m,d,f,p,h]}const co=e.memo(({sourceX:t,sourceY:n,targetX:r,targetY:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=to.Bottom,targetPosition:p=to.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=lo({sourceX:t,sourceY:n,sourcePosition:f,targetX:r,targetY:o,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return e.createElement(Xr,{path:v,labelX:b,labelY:w,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:m,interactionWidth:y})});co.displayName="SmoothStepEdge";const uo=e.memo(t=>e.createElement(co,{...t,pathOptions:e.useMemo(()=>({borderRadius:0,offset:t.pathOptions?.offset}),[t.pathOptions?.offset])}));uo.displayName="StepEdge";const fo=e.memo(({sourceX:t,sourceY:n,targetX:r,targetY:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[m,g,y]=function({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,a,i,s]=Ur({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,a,i,s]}({sourceX:t,sourceY:n,targetX:r,targetY:o});return e.createElement(Xr,{path:m,labelX:g,labelY:y,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})});function po(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function ho({pos:e,x1:t,y1:n,x2:r,y2:o,c:a}){switch(e){case to.Left:return[t-po(t-r,a),n];case to.Right:return[t+po(r-t,a),n];case to.Top:return[t,n-po(n-o,a)];case to.Bottom:return[t,n+po(o-n,a)]}}function mo({sourceX:e,sourceY:t,sourcePosition:n=to.Bottom,targetX:r,targetY:o,targetPosition:a=to.Top,curvature:i=.25}){const[s,l]=ho({pos:n,x1:e,y1:t,x2:r,y2:o,c:i}),[c,u]=ho({pos:a,x1:r,y1:o,x2:e,y2:t,c:i}),[d,f,p,h]=qr({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${r},${o}`,d,f,p,h]}fo.displayName="StraightEdge";const go=e.memo(({sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:a=to.Bottom,targetPosition:i=to.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=mo({sourceX:t,sourceY:n,sourcePosition:a,targetX:r,targetY:o,targetPosition:i,curvature:g?.curvature});return e.createElement(Xr,{path:v,labelX:b,labelY:w,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:y})});go.displayName="BezierEdge";const yo=e.createContext(null),vo=yo.Provider;yo.Consumer;const bo=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,wo=(e,t)=>{if(void 0===e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`},xo=(e,t)=>{if(!e.source||!e.target)return jr("006",gr()),t;let n;var r;return n="id"in(r=e)&&"source"in r&&"target"in r?{...e}:{...e,id:bo(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(n,t)?t:t.concat(n)},Eo=({x:e,y:t},[n,r,o],a,[i,s])=>{const l={x:(e-n)/o,y:(t-r)/o};return a?{x:i*Math.round(l.x/i),y:s*Math.round(l.y/s)}:l},So=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),_o=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},Co=(e,t=[0,0])=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const{x:r,y:o}=_o(n,t).positionAbsolute;return a=e,i=$r({x:r,y:o,width:n.width||0,height:n.height||0}),{x:Math.min(a.x,i.x),y:Math.min(a.y,i.y),x2:Math.max(a.x2,i.x2),y2:Math.max(a.y2,i.y2)};var a,i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}))(n)},ko=(e,t,[n,r,o]=[0,0,1],a=!1,i=!1,s=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach(e=>{const{width:t,height:n,selectable:r=!0,hidden:o=!1}=e;if(i&&!r||o)return!1;const{positionAbsolute:u}=_o(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},f=zr(l,d);(void 0===t||void 0===n||null===t||null===n||a&&f>0||f>=(t||0)*(n||0)||e.dragging)&&c.push(e)}),c},No=(e,t)=>{const n=e.map(e=>e.id);return t.filter(e=>n.includes(e.source)||n.includes(e.target))},Mo=(e,t,n,r,o,a=.1)=>{const i=t/(e.width*(1+a)),s=n/(e.height*(1+a)),l=Math.min(i,s),c=Or(l,r,o);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Ro=(e,t=0)=>e.transition().duration(t);function Oo(e,t,n,r){return(t[n]||[]).reduce((t,o)=>(`${e.id}-${o.id}-${n}`!==r&&t.push({id:o.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+o.x+o.width/2,y:(e.positionAbsolute?.y??0)+o.y+o.height/2}),t),[])}const Po={source:null,target:null,sourceHandle:null,targetHandle:null},Ao=()=>({handleDomNode:null,isValid:!1,connection:Po,endHandle:null});function To(e,t,n,r,o,a,i){const s="target"===o,l=i.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...Ao(),handleDomNode:l};if(l){const e=Do(void 0,l),o=l.getAttribute("data-nodeid"),i=l.getAttribute("data-handleid"),u=l.classList.contains("connectable"),d=l.classList.contains("connectableend"),f={source:s?o:n,sourceHandle:s?i:r,target:s?n:o,targetHandle:s?r:i};c.connection=f;u&&d&&(t===Zr.Strict?s&&"source"===e||!s&&"target"===e:o!==n||i!==r)&&(c.endHandle={nodeId:o,handleId:i,type:e},c.isValid=a(f))}return c}function Do(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function $o(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Io(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function zo({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:a,setState:i,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=Dr(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:v}=a();let b,w=0;const{x:x,y:E}=Wr(e),S=u?.elementFromPoint(x,E),_=Do(l,S),C=f?.getBoundingClientRect();if(!C||!_)return;let k,N=Wr(e,C),M=!1,R=null,O=!1,P=null;const A=function({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((e,o)=>{if(o[Br]){const{handleBounds:a}=o[Br];let i=[],s=[];a&&(i=Oo(o,a,"source",`${t}-${n}-${r}`),s=Oo(o,a,"target",`${t}-${n}-${r}`)),e.push(...i,...s)}return e},[])}({nodes:y(),nodeId:n,handleId:t,handleType:_}),T=()=>{if(!p)return;const[e,t]=Tr(N,C);g({x:e,y:t}),w=requestAnimationFrame(T)};function D(e){const{transform:r}=a();N=Wr(e,C);const{handle:l,validHandleResult:c}=function(e,t,n,r,o,a){const{x:i,y:s}=Wr(e),l=t.elementsFromPoint(i,s).find(e=>e.classList.contains("react-flow__handle"));if(l){const e=l.getAttribute("data-nodeid");if(e){const t=Do(void 0,l),r=l.getAttribute("data-handleid"),i=a({nodeId:e,id:r,type:t});if(i){const a=o.find(n=>n.nodeId===e&&n.type===t&&n.id===r);return{handle:{id:r,type:t,nodeId:e,x:a?.x||n.x,y:a?.y||n.y},validHandleResult:i}}}}let c=[],u=1/0;if(o.forEach(e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=r){const n=a(e);t<=u&&(t<u?c=[{handle:e,validHandleResult:n}]:t===u&&c.push({handle:e,validHandleResult:n}),u=t)}}),!c.length)return{handle:null,validHandleResult:Ao()};if(1===c.length)return c[0];const d=c.some(({validHandleResult:e})=>e.isValid),f=c.some(({handle:e})=>"target"===e.type);return c.find(({handle:e,validHandleResult:t})=>f?"target"===e.type:!d||t.isValid)||c[0]}(e,u,Eo(N,r,!1,[1,1]),h,A,e=>To(e,d,n,t,o?"target":"source",s,u));if(b=l,M||(T(),M=!0),P=c.handleDomNode,R=c.connection,O=c.isValid,i({connectionPosition:b&&O?So({x:b.x,y:b.y},r):N,connectionStatus:Io(!!b,O),connectionEndHandle:c.endHandle}),!b&&!O&&!P)return $o(k);R.source!==R.target&&P&&($o(k),k=P,P.classList.add("connecting","react-flow__handle-connecting"),P.classList.toggle("valid",O),P.classList.toggle("react-flow__handle-valid",O))}function $(e){(b||P)&&R&&O&&r?.(R),a().onConnectEnd?.(e),l&&c?.(e),$o(k),v(),cancelAnimationFrame(w),M=!1,O=!1,R=null,P=null,u.removeEventListener("mousemove",D),u.removeEventListener("mouseup",$),u.removeEventListener("touchmove",D),u.removeEventListener("touchend",$)}i({connectionPosition:N,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:_,connectionStartHandle:{nodeId:n,handleId:t,type:_},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:_}),u.addEventListener("mousemove",D),u.addEventListener("mouseup",$),u.addEventListener("touchmove",D),u.addEventListener("touchend",$)}const Lo=()=>!0,Bo=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Fo=e.forwardRef(({type:t="source",position:n=to.Top,isValidConnection:r,isConnectable:o=!0,isConnectableStart:a=!0,isConnectableEnd:s=!0,id:l,onConnect:c,children:u,className:d,onMouseDown:f,onTouchStart:p,...h},m)=>{const g=l||null,y="target"===t,v=_r(),b=e.useContext(yo),{connectOnClick:w,noPanClassName:x}=Sr(Bo,N),{connecting:E,clickConnecting:S}=Sr(((e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:a,connectionClickStartHandle:i}=r;return{connecting:o?.nodeId===e&&o?.handleId===t&&o?.type===n||a?.nodeId===e&&a?.handleId===t&&a?.type===n,clickConnecting:i?.nodeId===e&&i?.handleId===t&&i?.type===n}})(b,g,t),N);b||v.getState().onError?.("010",br());const _=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=v.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=v.getState();t(xo(o,e))}n?.(o),c?.(o)},C=e=>{if(!b)return;const t=Vr(e);a&&(t&&0===e.button||!t)&&zo({event:e,handleId:g,nodeId:b,onConnect:_,isTarget:y,getState:v.getState,setState:v.setState,isValidConnection:r||v.getState().isValidConnection||Lo}),t?f?.(e):p?.(e)};return e.createElement("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":n,"data-id":`${b}-${g}-${t}`,className:i(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",x,d,{source:!y,target:y,connectable:o,connectablestart:a,connectableend:s,connecting:S,connectionindicator:o&&(a&&!E||s&&E)}]),onMouseDown:C,onTouchStart:C,onClick:w?e=>{const{onClickConnectStart:n,onClickConnectEnd:o,connectionClickStartHandle:i,connectionMode:s,isValidConnection:l}=v.getState();if(!b||!i&&!a)return;if(!i)return n?.(e,{nodeId:b,handleId:g,handleType:t}),void v.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:g}});const c=Dr(e.target),u=r||l||Lo,{connection:d,isValid:f}=To({nodeId:b,id:g,type:t},s,i.nodeId,i.handleId||null,i.type,u,c);f&&_(d),o?.(e),v.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)});Fo.displayName="Handle";var jo=e.memo(Fo);const Ho=({data:t,isConnectable:n,targetPosition:r=to.Top,sourcePosition:o=to.Bottom})=>e.createElement(e.Fragment,null,e.createElement(jo,{type:"target",position:r,isConnectable:n}),t?.label,e.createElement(jo,{type:"source",position:o,isConnectable:n}));Ho.displayName="DefaultNode";var Vo=e.memo(Ho);const Wo=({data:t,isConnectable:n,sourcePosition:r=to.Bottom})=>e.createElement(e.Fragment,null,t?.label,e.createElement(jo,{type:"source",position:r,isConnectable:n}));Wo.displayName="InputNode";var Yo=e.memo(Wo);const Xo=({data:t,isConnectable:n,targetPosition:r=to.Top})=>e.createElement(e.Fragment,null,e.createElement(jo,{type:"target",position:r,isConnectable:n}),t?.label);Xo.displayName="OutputNode";var Ko=e.memo(Xo);const Uo=()=>null;Uo.displayName="GroupNode";const qo=e=>({selectedNodes:e.getNodes().filter(e=>e.selected),selectedEdges:e.edges.filter(e=>e.selected).map(e=>({...e}))}),Zo=e=>e.id;function Go(e,t){return N(e.selectedNodes.map(Zo),t.selectedNodes.map(Zo))&&N(e.selectedEdges.map(Zo),t.selectedEdges.map(Zo))}const Qo=e.memo(({onSelectionChange:t})=>{const n=_r(),{selectedNodes:r,selectedEdges:o}=Sr(qo,Go);return e.useEffect(()=>{const e={nodes:r,edges:o};t?.(e),n.getState().onSelectionChange.forEach(t=>t(e))},[r,o,t]),null});Qo.displayName="SelectionListener";const Jo=e=>!!e.onSelectionChange;function ea({onSelectionChange:t}){const n=Sr(Jo);return t||n?e.createElement(Qo,{onSelectionChange:t}):null}const ta=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function na(t,n){e.useEffect(()=>{void 0!==t&&n(t)},[t])}function ra(t,n,r){e.useEffect(()=>{void 0!==n&&r({[t]:n})},[n])}const oa=({nodes:t,edges:n,defaultNodes:r,defaultEdges:o,onConnect:a,onConnectStart:i,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:g,maxZoom:y,nodeExtent:v,onNodesChange:b,onEdgesChange:w,elementsSelectable:x,connectionMode:E,snapGrid:S,snapToGrid:_,translateExtent:C,connectOnClick:k,defaultEdgeOptions:M,fitView:R,fitViewOptions:O,onNodesDelete:P,onEdgesDelete:A,onNodeDrag:T,onNodeDragStart:D,onNodeDragStop:$,onSelectionDrag:I,onSelectionDragStart:z,onSelectionDragStop:L,noPanClassName:B,nodeOrigin:F,rfId:j,autoPanOnConnect:H,autoPanOnNodeDrag:V,onError:W,connectionRadius:Y,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:U,setEdges:q,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=Sr(ta,N),ne=_r();return e.useEffect(()=>{const e=o?.map(e=>({...e,...M}));return Z(r,e),()=>{te()}},[]),ra("defaultEdgeOptions",M,ne.setState),ra("connectionMode",E,ne.setState),ra("onConnect",a,ne.setState),ra("onConnectStart",i,ne.setState),ra("onConnectEnd",s,ne.setState),ra("onClickConnectStart",l,ne.setState),ra("onClickConnectEnd",c,ne.setState),ra("nodesDraggable",u,ne.setState),ra("nodesConnectable",d,ne.setState),ra("nodesFocusable",f,ne.setState),ra("edgesFocusable",p,ne.setState),ra("edgesUpdatable",h,ne.setState),ra("elementsSelectable",x,ne.setState),ra("elevateNodesOnSelect",m,ne.setState),ra("snapToGrid",_,ne.setState),ra("snapGrid",S,ne.setState),ra("onNodesChange",b,ne.setState),ra("onEdgesChange",w,ne.setState),ra("connectOnClick",k,ne.setState),ra("fitViewOnInit",R,ne.setState),ra("fitViewOnInitOptions",O,ne.setState),ra("onNodesDelete",P,ne.setState),ra("onEdgesDelete",A,ne.setState),ra("onNodeDrag",T,ne.setState),ra("onNodeDragStart",D,ne.setState),ra("onNodeDragStop",$,ne.setState),ra("onSelectionDrag",I,ne.setState),ra("onSelectionDragStart",z,ne.setState),ra("onSelectionDragStop",L,ne.setState),ra("noPanClassName",B,ne.setState),ra("nodeOrigin",F,ne.setState),ra("rfId",j,ne.setState),ra("autoPanOnConnect",H,ne.setState),ra("autoPanOnNodeDrag",V,ne.setState),ra("onError",W,ne.setState),ra("connectionRadius",Y,ne.setState),ra("isValidConnection",X,ne.setState),ra("nodeDragThreshold",K,ne.setState),na(t,U),na(n,q),na(g,G),na(y,Q),na(C,J),na(v,ee),null},aa={display:"none"},ia={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sa="react-flow__node-desc",la="react-flow__edge-desc",ca=e=>e.ariaLiveMessage;function ua({rfId:t}){const n=Sr(ca);return e.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:ia},n)}function da({rfId:t,disableKeyboardA11y:n}){return e.createElement(e.Fragment,null,e.createElement("div",{id:`${sa}-${t}`,style:aa},"Press enter or space to select a node.",!n&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),e.createElement("div",{id:`${la}-${t}`,style:aa},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&e.createElement(ua,{rfId:t}))}var fa=(t=null,n={actInsideInputWithModifier:!0})=>{const[r,o]=e.useState(!1),a=e.useRef(!1),i=e.useRef(new Set([])),[s,l]=e.useMemo(()=>{if(null!==t){const e=(Array.isArray(t)?t:[t]).filter(e=>"string"==typeof e).map(e=>e.split("+")),n=e.reduce((e,t)=>e.concat(...t),[]);return[e,n]}return[[],[]]},[t]);return e.useEffect(()=>{const e="undefined"!=typeof document?document:null,r=n?.target||e;if(null!==t){const e=e=>{a.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!a.current||a.current&&!n.actInsideInputWithModifier)&&Hr(e))return!1;const t=ha(e.code,l);i.current.add(e[t]),pa(s,i.current,!1)&&(e.preventDefault(),o(!0))},t=e=>{if((!a.current||a.current&&!n.actInsideInputWithModifier)&&Hr(e))return!1;const t=ha(e.code,l);pa(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(e[t]),"Meta"===e.key&&i.current.clear(),a.current=!1},c=()=>{i.current.clear(),o(!1)};return r?.addEventListener("keydown",e),r?.addEventListener("keyup",t),window.addEventListener("blur",c),()=>{r?.removeEventListener("keydown",e),r?.removeEventListener("keyup",t),window.removeEventListener("blur",c)}}},[t,o]),r};function pa(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function ha(e,t){return t.includes(e)?"code":"key"}function ma(e,t,n,r){const o=e.parentNode||e.parentId;if(!o)return n;const a=t.get(o),i=_o(a,r);return ma(a,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(a[Br]?.z??0)>(n.z??0)?a[Br]?.z??0:n.z??0},r)}function ga(e,t,n){e.forEach(r=>{const o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n?.[r.id]){const{x:o,y:a,z:i}=ma(r,e,{...r.position,z:r[Br]?.z??0},t);r.positionAbsolute={x:o,y:a},r[Br].z=i,n?.[r.id]&&(r[Br].isParent=!0)}})}function ya(e,t,n,r){const o=new Map,a={},i=r?1e3:0;return e.forEach(e=>{const n=(Lr(e.zIndex)?e.zIndex:0)+(e.selected?i:0),r=t.get(e.id),s={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},l=e.parentNode||e.parentId;l&&(a[l]=!0);const c=r?.type&&r?.type!==e.type;Object.defineProperty(s,Br,{enumerable:!1,value:{handleBounds:c?void 0:r?.[Br]?.handleBounds,z:n}}),o.set(e.id,s)}),ga(o,n,a),o}function va(e,t={}){const{getNodes:n,width:r,height:o,minZoom:a,maxZoom:i,d3Zoom:s,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),f=t.initial&&!c&&u;if(s&&l&&(f||!t.initial)){const e=n().filter(e=>{const n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some(t=>t.id===e.id):n}),c=e.every(e=>e.width&&e.height);if(e.length>0&&c){const n=Co(e,d),{x:c,y:u,zoom:f}=Mo(n,r,o,t.minZoom??a,t.maxZoom??i,t.padding??.1),p=tr.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?s.transform(Ro(l,t.duration),p):s.transform(l,p),!0}}return!1}function ba(e,t){return e.forEach(e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[Br]:n[Br],selected:e.selected})}),new Map(t)}function wa(e,t){return t.map(t=>{const n=e.find(e=>e.id===t.id);return n&&(t.selected=n.selected),t})}function xa({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:a,onNodesChange:i,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&r({nodeInternals:ba(e,o)}),i?.(e)),t?.length&&(c&&r({edges:wa(t,a)}),s?.(t))}const Ea=()=>{},Sa={zoomIn:Ea,zoomOut:Ea,zoomTo:Ea,getZoom:()=>1,setViewport:Ea,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ea,fitBounds:Ea,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},_a=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function Ca(){const t=(()=>{const t=_r(),{d3Zoom:n,d3Selection:r}=Sr(_a,N),o=e.useMemo(()=>r&&n?{zoomIn:e=>n.scaleBy(Ro(r,e?.duration),1.2),zoomOut:e=>n.scaleBy(Ro(r,e?.duration),1/1.2),zoomTo:(e,t)=>n.scaleTo(Ro(r,t?.duration),e),getZoom:()=>t.getState().transform[2],setViewport:(e,o)=>{const[a,i,s]=t.getState().transform,l=tr.translate(e.x??a,e.y??i).scale(e.zoom??s);n.transform(Ro(r,o?.duration),l)},getViewport:()=>{const[e,n,r]=t.getState().transform;return{x:e,y:n,zoom:r}},fitView:e=>va(t.getState,e),setCenter:(e,o,a)=>{const{width:i,height:s,maxZoom:l}=t.getState(),c=void 0!==a?.zoom?a.zoom:l,u=i/2-e*c,d=s/2-o*c,f=tr.translate(u,d).scale(c);n.transform(Ro(r,a?.duration),f)},fitBounds:(e,o)=>{const{width:a,height:i,minZoom:s,maxZoom:l}=t.getState(),{x:c,y:u,zoom:d}=Mo(e,a,i,s,l,o?.padding??.1),f=tr.translate(c,u).scale(d);n.transform(Ro(r,o?.duration),f)},project:e=>{const{transform:n,snapToGrid:r,snapGrid:o}=t.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Eo(e,n,r,o)},screenToFlowPosition:e=>{const{transform:n,snapToGrid:r,snapGrid:o,domNode:a}=t.getState();if(!a)return e;const{x:i,y:s}=a.getBoundingClientRect(),l={x:e.x-i,y:e.y-s};return Eo(l,n,r,o)},flowToScreenPosition:e=>{const{transform:n,domNode:r}=t.getState();if(!r)return e;const{x:o,y:a}=r.getBoundingClientRect(),i=So(e,n);return{x:i.x+o,y:i.y+a}},viewportInitialized:!0}:Sa,[n,r]);return o})(),n=_r(),r=e.useCallback(()=>n.getState().getNodes().map(e=>({...e})),[]),o=e.useCallback(e=>n.getState().nodeInternals.get(e),[]),a=e.useCallback(()=>{const{edges:e=[]}=n.getState();return e.map(e=>({...e}))},[]),i=e.useCallback(e=>{const{edges:t=[]}=n.getState();return t.find(t=>t.id===e)},[]),s=e.useCallback(e=>{const{getNodes:t,setNodes:r,hasDefaultNodes:o,onNodesChange:a}=n.getState(),i=t(),s="function"==typeof e?e(i):e;if(o)r(s);else if(a){const e=0===s.length?i.map(e=>({type:"remove",id:e.id})):s.map(e=>({item:e,type:"reset"}));a(e)}},[]),l=e.useCallback(e=>{const{edges:t=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:a}=n.getState(),i="function"==typeof e?e(t):e;if(o)r(i);else if(a){a(0===i.length?t.map(e=>({type:"remove",id:e.id})):i.map(e=>({item:e,type:"reset"})))}},[]),c=e.useCallback(e=>{const t=Array.isArray(e)?e:[e],{getNodes:r,setNodes:o,hasDefaultNodes:a,onNodesChange:i}=n.getState();if(a){o([...r(),...t])}else if(i){const e=t.map(e=>({item:e,type:"add"}));i(e)}},[]),u=e.useCallback(e=>{const t=Array.isArray(e)?e:[e],{edges:r=[],setEdges:o,hasDefaultEdges:a,onEdgesChange:i}=n.getState();if(a)o([...r,...t]);else if(i){i(t.map(e=>({item:e,type:"add"})))}},[]),d=e.useCallback(()=>{const{getNodes:e,edges:t=[],transform:r}=n.getState(),[o,a,i]=r;return{nodes:e().map(e=>({...e})),edges:t.map(e=>({...e})),viewport:{x:o,y:a,zoom:i}}},[]),f=e.useCallback(({nodes:e,edges:t})=>{const{nodeInternals:r,getNodes:o,edges:a,hasDefaultNodes:i,hasDefaultEdges:s,onNodesDelete:l,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=n.getState(),f=(e||[]).map(e=>e.id),p=(t||[]).map(e=>e.id),h=o().reduce((e,t)=>{const n=t.parentNode||t.parentId,r=!f.includes(t.id)&&n&&e.find(e=>e.id===n);return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||r)&&e.push(t),e},[]),m=a.filter(e=>"boolean"!=typeof e.deletable||e.deletable),g=m.filter(e=>p.includes(e.id));if(h||g){const e=No(h,m),t=[...g,...e],o=t.reduce((e,t)=>(e.includes(t.id)||e.push(t.id),e),[]);if((s||i)&&(s&&n.setState({edges:a.filter(e=>!o.includes(e.id))}),i&&(h.forEach(e=>{r.delete(e.id)}),n.setState({nodeInternals:new Map(r)}))),o.length>0&&(c?.(t),d&&d(o.map(e=>({id:e,type:"remove"})))),h.length>0&&(l?.(h),u)){u(h.map(e=>({id:e.id,type:"remove"})))}}},[]),p=e.useCallback(e=>{const t=Lr((r=e).width)&&Lr(r.height)&&Lr(r.x)&&Lr(r.y);var r;const o=t?null:n.getState().nodeInternals.get(e.id);if(!t&&!o)return[null,null,t];return[t?e:Ir(o),o,t]},[]),h=e.useCallback((e,t=!0,r)=>{const[o,a,i]=p(e);return o?(r||n.getState().getNodes()).filter(e=>{if(!(i||e.id!==a.id&&e.positionAbsolute))return!1;const n=Ir(e),r=zr(n,o);return t&&r>0||r>=o.width*o.height}):[]},[]),m=e.useCallback((e,t,n=!0)=>{const[r]=p(e);if(!r)return!1;const o=zr(r,t);return n&&o>0||o>=r.width*r.height},[]);return e.useMemo(()=>({...t,getNodes:r,getNode:o,getEdges:a,getEdge:i,setNodes:s,setEdges:l,addNodes:c,addEdges:u,toObject:d,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:m}),[t,r,o,a,i,s,l,c,u,d,f,h,m])}const ka={actInsideInputWithModifier:!1};const Na={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ma=e=>({x:e.x,y:e.y,zoom:e.k}),Ra=(e,t)=>e.target.closest(`.${t}`),Oa=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Pa=e=>{const t=e.ctrlKey&&Yr()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},Aa=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Ta=({onMove:t,onMoveStart:n,onMoveEnd:r,onPaneContextMenu:o,zoomOnScroll:a=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Gr.Free,zoomOnDoubleClick:u=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:p,translateExtent:h,minZoom:m,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:v=!0,children:b,noWheelClassName:w,noPanClassName:x})=>{const E=e.useRef(),S=_r(),_=e.useRef(!1),C=e.useRef(!1),k=e.useRef(null),M=e.useRef({x:0,y:0,zoom:0}),{d3Zoom:O,d3Selection:P,d3ZoomHandler:A,userSelectionActive:T}=Sr(Aa,N),D=fa(y),$=e.useRef(0),I=e.useRef(!1),z=e.useRef();return function(t){const n=_r();e.useEffect(()=>{let e;const r=()=>{if(!t.current)return;const e=Rr(t.current);0!==e.height&&0!==e.width||n.getState().onError?.("004",hr()),n.setState({width:e.width||500,height:e.height||500})};return r(),window.addEventListener("resize",r),t.current&&(e=new ResizeObserver(()=>r()),e.observe(t.current)),()=>{window.removeEventListener("resize",r),e&&t.current&&e.unobserve(t.current)}},[])}(k),e.useEffect(()=>{if(k.current){const e=k.current.getBoundingClientRect(),t=function(){var e,t,n,r=or,o=ar,a=cr,i=sr,s=lr,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=rn,f=R("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",ir).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",_).filter(s).on("touchstart.zoom",C).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new er(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new er(e.k,r,o)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",function(){w(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(r).end()}).tween("zoom",function(){var e=this,a=arguments,i=w(e,a).event(r),s=o.apply(e,a),l=null==n?v(s):"function"==typeof n?n.apply(e,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,a):t,p=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=c/t[2];e=new er(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function E(e,...t){if(r.apply(this,arguments)){var n=w(this,t).event(e),o=this.__zoom,s=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,i.apply(this,arguments)))),u=Xe(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[u,o.invert(u)],Nn(this),n.start()}rr(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(y(g(o,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,i=w(this,t,!0).event(e),s=Ye(e.view).on("mousemove.zoom",function(e){if(rr(e),!i.moved){var t=e.clientX-u,n=e.clientY-d;i.moved=t*t+n*n>p}i.event(e).zoom("mouse",a(y(i.that.__zoom,i.mouse[0]=Xe(e,o),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),Qe(e.view,i.moved),rr(e),i.event(e).end()},!0),l=Xe(e,o),u=e.clientX,d=e.clientY;Ge(e.view),nr(e),i.mouse=[l,this.__zoom.invert(l)],Nn(this),i.start()}}function _(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,i=Xe(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(i),l=n.k*(e.shiftKey?.5:2),d=a(y(g(n,l),i,s),o.apply(this,t),c);rr(e),u>0?Ye(this).transition().duration(u).call(b,d,i,e):Ye(this).call(m.transform,d,i,e)}}function C(n,...o){if(r.apply(this,arguments)){var a,i,s,l,c=n.touches,u=c.length,d=w(this,o,n.changedTouches.length===u).event(n);for(nr(n),i=0;i<u;++i)l=[l=Xe(s=c[i],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,a=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),a&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),Nn(this),d.start())}}function k(e,...t){if(this.__zooming){var n,r,o,i,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(rr(e),n=0;n<u;++n)o=Xe(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],p=s.touch1[0],h=s.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,v=(v=h[0]-f[0])*v+(v=h[1]-f[1])*v;r=g(r,Math.sqrt(m/v)),o=[(d[0]+p[0])/2,(d[1]+p[1])/2],i=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],i=s.touch0[1]}s.zoom("touch",a(y(r,o,i),s.extent,c))}}function N(e,...r){if(this.__zooming){var o,a,i=w(this,r).event(e),s=e.changedTouches,l=s.length;for(nr(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<l;++o)a=s[o],i.touch0&&i.touch0[2]===a.identifier?delete i.touch0:i.touch1&&i.touch1[2]===a.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps&&(a=Xe(a,this),Math.hypot(t[0]-a[0],t[1]-a[1])<h)){var c=Ye(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",ir),e!==o?b(e,t,n,r):o.interrupt().each(function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,r){m.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,i=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(i),l="function"==typeof t?t.apply(this,arguments):t;return a(y(g(r,l),i,s),e,c)},n,r)},m.translateBy=function(e,t,n,r){m.transform(e,function(){return a(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)},null,r)},m.translateTo=function(e,t,n,r,i){m.transform(e,function(){var e=o.apply(this,arguments),i=this.__zoom,s=null==r?v(e):"function"==typeof r?r.apply(this,arguments):r;return a(tr.translate(s[0],s[1]).scale(i.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},r,i)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=Ye(this.that).datum();f.call(e,this.that,new Jn(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:Qn(+e),m):i},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:Qn(!!e),m):r},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Qn(!!e),m):s},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:Qn([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(a=e,m):a},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}().scaleExtent([m,g]).translateExtent(h),n=Ye(k.current).call(t),r=tr.translate(p.x,p.y).scale(Or(p.zoom,m,g)),o=[[0,0],[e.width,e.height]],a=t.constrain()(r,o,h);t.transform(n,a),t.wheelDelta(Pa),S.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[a.x,a.y,a.k],domNode:k.current.closest(".react-flow")})}},[]),e.useEffect(()=>{P&&O&&(!s||D||T?void 0!==A&&P.on("wheel.zoom",function(e,t){if(!v&&"wheel"===e.type&&!e.ctrlKey||Ra(e,w))return null;e.preventDefault(),A.call(this,e,t)},{passive:!1}):P.on("wheel.zoom",e=>{if(Ra(e,w))return!1;e.preventDefault(),e.stopImmediatePropagation();const o=P.property("__zoom").k||1;if(e.ctrlKey&&i){const t=Xe(e),n=Pa(e),r=o*Math.pow(2,n);return void O.scaleTo(P,r,t,e)}const a=1===e.deltaMode?20:1;let s=c===Gr.Vertical?0:e.deltaX*a,u=c===Gr.Horizontal?0:e.deltaY*a;!Yr()&&e.shiftKey&&c!==Gr.Vertical&&(s=e.deltaY*a,u=0),O.translateBy(P,-s/o*l,-u/o*l,{internal:!0});const d=Ma(P.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=S.getState();clearTimeout(z.current),I.current||(I.current=!0,n?.(e,d),f?.(d)),I.current&&(t?.(e,d),p?.(d),z.current=setTimeout(()=>{r?.(e,d),h?.(d),I.current=!1},150))},{passive:!1}))},[T,s,c,P,O,A,D,i,v,w,n,t,r]),e.useEffect(()=>{O&&O.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;$.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=S.getState(),r=Ma(e.transform);_.current=!0,M.current=r,"mousedown"===e.sourceEvent?.type&&S.setState({paneDragging:!0}),t?.(r),n?.(e.sourceEvent,r)})},[O,n]),e.useEffect(()=>{O&&(T&&!_.current?O.on("zoom",null):T||O.on("zoom",e=>{const{onViewportChange:n}=S.getState();if(S.setState({transform:[e.transform.x,e.transform.y,e.transform.k]}),C.current=!(!o||!Oa(f,$.current??0)),(t||n)&&!e.sourceEvent?.internal){const r=Ma(e.transform);n?.(r),t?.(e.sourceEvent,r)}}))},[T,O,t,f,o]),e.useEffect(()=>{O&&O.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=S.getState();if(_.current=!1,S.setState({paneDragging:!1}),o&&Oa(f,$.current??0)&&!C.current&&o(e.sourceEvent),C.current=!1,(r||t)&&(n=M.current,a=e.transform,n.x!==a.x||n.y!==a.y||n.zoom!==a.k)){const n=Ma(e.transform);M.current=n,clearTimeout(E.current),E.current=setTimeout(()=>{t?.(n),r?.(e.sourceEvent,n)},s?150:0)}var n,a})},[O,s,f,r,o]),e.useEffect(()=>{O&&O.filter(e=>{const t=D||a,n=i&&e.ctrlKey;if((!0===f||Array.isArray(f)&&f.includes(1))&&1===e.button&&"mousedown"===e.type&&(Ra(e,"react-flow__node")||Ra(e,"react-flow__edge")))return!0;if(!(f||t||s||u||i))return!1;if(T)return!1;if(!u&&"dblclick"===e.type)return!1;if(Ra(e,w)&&"wheel"===e.type)return!1;if(Ra(e,x)&&("wheel"!==e.type||s&&"wheel"===e.type&&!D))return!1;if(!i&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!s&&!n&&"wheel"===e.type)return!1;if(!f&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(f)&&!f.includes(e.button)&&"mousedown"===e.type)return!1;const r=Array.isArray(f)&&f.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&r})},[T,O,a,i,s,u,f,d,D]),e.createElement("div",{className:"react-flow__renderer",ref:k,style:Na},b)},Da=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function $a(){const{userSelectionActive:t,userSelectionRect:n}=Sr(Da,N);return t&&n?e.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}function Ia(e,t){const n=t.parentNode||t.parentId,r=e.find(e=>e.id===n);if(r){const e=t.position.x+t.width-r.width,n=t.position.y+t.height-r.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(r.style={...r.style}||{},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,e>0&&(r.style.width+=e),n>0&&(r.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);r.position.x=r.position.x-e,r.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);r.position.y=r.position.y-e,r.style.height+=e,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function za(e,t){if(e.some(e=>"reset"===e.type))return e.filter(e=>"reset"===e.type).map(e=>e.item);const n=e.filter(e=>"add"===e.type).map(e=>e.item);return t.reduce((t,n)=>{const r=e.filter(e=>e.id===n.id);if(0===r.length)return t.push(n),t;const o={...n};for(const e of r)if(e)switch(e.type){case"select":o.selected=e.selected;break;case"position":void 0!==e.position&&(o.position=e.position),void 0!==e.positionAbsolute&&(o.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(o.dragging=e.dragging),o.expandParent&&Ia(t,o);break;case"dimensions":void 0!==e.dimensions&&(o.width=e.dimensions.width,o.height=e.dimensions.height),void 0!==e.updateStyle&&(o.style={...o.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(o.resizing=e.resizing),o.expandParent&&Ia(t,o);break;case"remove":return t}return t.push(o),t},n)}function La(e,t){return za(e,t)}const Ba=(e,t)=>({id:e,type:"select",selected:t});function Fa(e,t){return e.reduce((e,n)=>{const r=t.includes(n.id);return!n.selected&&r?(n.selected=!0,e.push(Ba(n.id,!0))):n.selected&&!r&&(n.selected=!1,e.push(Ba(n.id,!1))),e},[])}const ja=(e,t)=>n=>{n.target===t.current&&e?.(n)},Ha=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Va=e.memo(({isSelecting:t,selectionMode:n=Qr.Full,panOnDrag:r,onSelectionStart:o,onSelectionEnd:a,onPaneClick:s,onPaneContextMenu:l,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=e.useRef(null),m=_r(),g=e.useRef(0),y=e.useRef(0),v=e.useRef(),{userSelectionActive:b,elementsSelectable:w,dragging:x}=Sr(Ha,N),E=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},S=e=>{s?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},_=c?e=>c(e):void 0,C=w&&(t||b);return e.createElement("div",{className:i(["react-flow__pane",{dragging:x,selection:t}]),onClick:C?void 0:ja(S,h),onContextMenu:ja(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():l?.(e)},h),onWheel:ja(_,h),onMouseEnter:C?void 0:u,onMouseDown:C?e=>{const{resetSelectedElements:n,domNode:r}=m.getState();if(v.current=r?.getBoundingClientRect(),!w||!t||0!==e.button||e.target!==h.current||!v.current)return;const{x:a,y:i}=Wr(e,v.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:a,startY:i,x:a,y:i}}),o?.(e)}:void 0,onMouseMove:C?e=>{const{userSelectionRect:r,nodeInternals:o,edges:a,transform:i,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=m.getState();if(!t||!v.current||!r)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=Wr(e,v.current),f=r.startX??0,p=r.startY??0,h={...r,x:d.x<f?d.x:f,y:d.y<p?d.y:p,width:Math.abs(d.x-f),height:Math.abs(d.y-p)},b=u(),w=ko(o,h,i,n===Qr.Partial,!0,c),x=No(w,a).map(e=>e.id),E=w.map(e=>e.id);if(g.current!==E.length){g.current=E.length;const e=Fa(b,E);e.length&&s?.(e)}if(y.current!==x.length){y.current=x.length;const e=Fa(a,x);e.length&&l?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:C?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!b&&t&&e.target===h.current&&S?.(e),m.setState({nodesSelectionActive:g.current>0}),E(),a?.(e)}:void 0,onMouseLeave:C?e=>{b&&(m.setState({nodesSelectionActive:g.current>0}),a?.(e)),E()}:f,ref:h,style:Na},p,e.createElement($a,null))});function Wa(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return!!r&&(!!r.selected||Wa(r,t))}function Ya(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function Xa(e,t,n,r){return Array.from(e.values()).filter(n=>(n.selected||n.id===r)&&(!n.parentNode||n.parentId||!Wa(n,e))&&(n.draggable||t&&void 0===n.draggable)).map(e=>({id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:n.x-(e.positionAbsolute?.x??0),y:n.y-(e.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode||e.parentId,parentId:e.parentNode||e.parentId,width:e.width,height:e.height,expandParent:e.expandParent}))}function Ka(e,t,n,r,o=[0,0],a){const i=function(e,t){return t&&"parent"!==t?[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]:t}(e,e.extent||r);let s=i;const l=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&l&&"parent"!==e.extent){const t=n.get(l),{x:r,y:a}=_o(t,o).positionAbsolute;s=[[e.extent[0][0]+r,e.extent[0][1]+a],[e.extent[1][0]+r,e.extent[1][1]+a]]}}else if(l&&e.width&&e.height){const t=n.get(l),{x:r,y:a}=_o(t,o).positionAbsolute;s=t&&Lr(r)&&Lr(a)&&Lr(t.width)&&Lr(t.height)?[[r+e.width*o[0],a+e.height*o[1]],[r+t.width-e.width+e.width*o[0],a+t.height-e.height+e.height*o[1]]]:s}else a?.("005",mr()),s=i;let c={x:0,y:0};if(l){const e=n.get(l);c=_o(e,o).positionAbsolute}const u=s&&"parent"!==s?Pr(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function Ua({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute}));return[e?r.find(t=>t.id===e):r[0],r]}Va.displayName="Pane";const qa=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const a=Array.from(o),i=t.getBoundingClientRect(),s=i.width*r[0],l=i.height*r[1];return a.map(e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-i.left-s)/n,y:(t.top-i.top-l)/n,...Rr(e)}})};function Za(e,t,n){return void 0===n?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function Ga({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:i,nodeInternals:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(a({nodes:[c],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):o([e])):l?.("012",xr(e))}function Qa(e){return(t,n,r)=>e?.(t,r)}function Ja({nodeRef:t,disabled:n=!1,noDragClassName:r,handleSelector:o,nodeId:a,isSelectable:i,selectNodesOnDrag:s}){const l=_r(),[c,u]=e.useState(!1),d=e.useRef([]),f=e.useRef({x:null,y:null}),p=e.useRef(0),h=e.useRef(null),m=e.useRef({x:0,y:0}),g=e.useRef(null),y=e.useRef(!1),v=e.useRef(!1),b=e.useRef(!1),w=function(){const t=_r(),n=e.useCallback(({sourceEvent:e})=>{const{transform:n,snapGrid:r,snapToGrid:o}=t.getState(),a=e.touches?e.touches[0].clientX:e.clientX,i=e.touches?e.touches[0].clientY:e.clientY,s={x:(a-n[0])/n[2],y:(i-n[1])/n[2]};return{xSnapped:o?r[0]*Math.round(s.x/r[0]):s.x,ySnapped:o?r[1]*Math.round(s.y/r[1]):s.y,...s}},[]);return n}();return e.useEffect(()=>{if(t?.current){const e=Ye(t.current),c=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:r,onSelectionDrag:o,updateNodePositions:i,nodeExtent:s,snapGrid:c,snapToGrid:p,nodeOrigin:h,onError:m}=l.getState();f.current={x:e,y:t};let y=!1,v={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&s){const e=Co(d.current,h);v=$r(e)}if(d.current=d.current.map(r=>{const o={x:e-r.distance.x,y:t-r.distance.y};p&&(o.x=c[0]*Math.round(o.x/c[0]),o.y=c[1]*Math.round(o.y/c[1]));const a=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];d.current.length>1&&s&&!r.extent&&(a[0][0]=r.positionAbsolute.x-v.x+s[0][0],a[1][0]=r.positionAbsolute.x+(r.width??0)-v.x2+s[1][0],a[0][1]=r.positionAbsolute.y-v.y+s[0][1],a[1][1]=r.positionAbsolute.y+(r.height??0)-v.y2+s[1][1]);const i=Ka(r,o,n,a,h,m);return y=y||r.position.x!==i.position.x||r.position.y!==i.position.y,r.position=i.position,r.positionAbsolute=i.positionAbsolute,r}),!y)return;i(d.current,!0,!0),u(!0);const b=a?r:Qa(o);if(b&&g.current){const[e,t]=Ua({nodeId:a,dragItems:d.current,nodeInternals:n});b(g.current,e,t)}},x=()=>{if(!h.current)return;const[e,t]=Tr(m.current,h.current);if(0!==e||0!==t){const{transform:n,panBy:r}=l.getState();f.current.x=(f.current.x??0)-e/n[2],f.current.y=(f.current.y??0)-t/n[2],r({x:e,y:t})&&c(f.current)}p.current=requestAnimationFrame(x)},E=e=>{const{nodeInternals:n,multiSelectionActive:r,nodesDraggable:o,unselectNodesAndEdges:c,onNodeDragStart:u,onSelectionDragStart:p}=l.getState();v.current=!0;const h=a?u:Qa(p);s&&i||r||!a||n.get(a)?.selected||c(),a&&i&&s&&Ga({id:a,store:l,nodeRef:t});const m=w(e);if(f.current=m,d.current=Xa(n,o,m,a),h&&d.current){const[t,r]=Ua({nodeId:a,dragItems:d.current,nodeInternals:n});h(e.sourceEvent,t,r)}};if(!n){const n=function(){var e,t,n,r,o=tt,a=nt,i=rt,s=ot,l={},c=R("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",g).on("touchmove.drag",y,Ke).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(i,s){if(!r&&o.call(this,i,s)){var l=b(this,a.call(this,i,s),i,s,"mouse");l&&(Ye(i.view).on("mousemove.drag",h,Ue).on("mouseup.drag",m,Ue),Ge(i.view),qe(i),n=!1,e=i.clientX,t=i.clientY,l("start",i))}}function h(r){if(Ze(r),!n){var o=r.clientX-e,a=r.clientY-t;n=o*o+a*a>d}l.mouse("drag",r)}function m(e){Ye(e.view).on("mousemove.drag mouseup.drag",null),Qe(e.view,n),Ze(e),l.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,i=e.changedTouches,s=a.call(this,e,t),l=i.length;for(n=0;n<l;++n)(r=b(this,s,e,t,i[n].identifier,i[n]))&&(qe(e),r("start",e,i[n]))}}function y(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=l[r[t].identifier])&&(Ze(e),n("drag",e,r[t]))}function v(e){var t,n,o=e.changedTouches,a=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<a;++t)(n=l[o[t].identifier])&&(qe(e),n("end",e,o[t]))}function b(e,t,n,r,o,a){var s,d,p,h=c.copy(),m=Xe(a||n,t);if(null!=(p=i.call(e,new et("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))return s=p.x-m[0]||0,d=p.y-m[1]||0,function n(a,i,c){var g,y=m;switch(a){case"start":l[o]=n,g=u++;break;case"end":delete l[o],--u;case"drag":m=Xe(c||i,t),g=u}h.call(a,e,new et(a,{sourceEvent:i,subject:p,target:f,identifier:o,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:Je(!!e),f):o},f.container=function(e){return arguments.length?(a="function"==typeof e?e:Je(e),f):a},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:Je(e),f):i},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Je(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}().on("start",e=>{const{domNode:t,nodeDragThreshold:n}=l.getState();0===n&&E(e),b.current=!1;const r=w(e);f.current=r,h.current=t?.getBoundingClientRect()||null,m.current=Wr(e.sourceEvent,h.current)}).on("drag",e=>{const t=w(e),{autoPanOnNodeDrag:n,nodeDragThreshold:r}=l.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(b.current=!0),!b.current){if(!y.current&&v.current&&n&&(y.current=!0,x()),!v.current){const n=t.xSnapped-(f?.current?.x??0),o=t.ySnapped-(f?.current?.y??0);Math.sqrt(n*n+o*o)>r&&E(e)}(f.current.x!==t.xSnapped||f.current.y!==t.ySnapped)&&d.current&&v.current&&(g.current=e.sourceEvent,m.current=Wr(e.sourceEvent,h.current),c(t))}}).on("end",e=>{if(v.current&&!b.current&&(u(!1),y.current=!1,v.current=!1,cancelAnimationFrame(p.current),d.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:r,onSelectionDragStop:o}=l.getState(),i=a?r:Qa(o);if(t(d.current,!1,!1),i){const[t,r]=Ua({nodeId:a,dragItems:d.current,nodeInternals:n});i(e.sourceEvent,t,r)}}}).filter(e=>{const n=e.target;return!e.button&&(!r||!Ya(n,`.${r}`,t))&&(!o||Ya(n,o,t))});return e.call(n),()=>{e.on(".drag",null)}}e.on(".drag",null)}},[t,n,r,o,i,l,a,s,w]),c}function ei(){const t=_r(),n=e.useCallback(e=>{const{nodeInternals:n,nodeExtent:r,updateNodePositions:o,getNodes:a,snapToGrid:i,snapGrid:s,onError:l,nodesDraggable:c}=t.getState(),u=a().filter(e=>e.selected&&(e.draggable||c&&void 0===e.draggable)),d=i?s[0]:5,f=i?s[1]:5,p=e.isShiftPressed?4:1,h=e.x*d*p,m=e.y*f*p,g=u.map(e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};i&&(t.x=s[0]*Math.round(t.x/s[0]),t.y=s[1]*Math.round(t.y/s[1]));const{positionAbsolute:o,position:a}=Ka(e,t,n,r,void 0,l);e.position=a,e.positionAbsolute=o}return e});o(g,!0,!1)},[]);return n}const ti={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ni=t=>{const n=({id:n,type:r,data:o,xPos:a,yPos:s,xPosOrigin:l,yPosOrigin:c,selected:u,onClick:d,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:m,onDoubleClick:g,style:y,className:v,isDraggable:b,isSelectable:w,isConnectable:x,isFocusable:E,selectNodesOnDrag:S,sourcePosition:_,targetPosition:C,hidden:k,resizeObserver:N,dragHandle:M,zIndex:R,isParent:O,noDragClassName:P,noPanClassName:A,initialized:T,disableKeyboardA11y:D,ariaLabel:$,rfId:I,hasHandleBounds:z})=>{const L=_r(),B=e.useRef(null),F=e.useRef(null),j=e.useRef(_),H=e.useRef(C),V=e.useRef(r),W=w||b||d||f||p||h,Y=ei(),X=Za(n,L.getState,f),K=Za(n,L.getState,p),U=Za(n,L.getState,h),q=Za(n,L.getState,m),Z=Za(n,L.getState,g);e.useEffect(()=>()=>{F.current&&(N?.unobserve(F.current),F.current=null)},[]),e.useEffect(()=>{if(B.current&&!k){const e=B.current;T&&z&&F.current===e||(F.current&&N?.unobserve(F.current),N?.observe(e),F.current=e)}},[k,T,z]),e.useEffect(()=>{const e=V.current!==r,t=j.current!==_,o=H.current!==C;B.current&&(e||t||o)&&(e&&(V.current=r),t&&(j.current=_),o&&(H.current=C),L.getState().updateNodeDimensions([{id:n,nodeElement:B.current,forceUpdate:!0}]))},[n,r,_,C]);const G=Ja({nodeRef:B,disabled:k||!b,noDragClassName:P,handleSelector:M,nodeId:n,isSelectable:w,selectNodesOnDrag:S});return k?null:e.createElement("div",{className:i(["react-flow__node",`react-flow__node-${r}`,{[A]:b},v,{selected:u,selectable:w,parent:O,dragging:G}]),ref:B,style:{zIndex:R,transform:`translate(${l}px,${c}px)`,pointerEvents:W?"all":"none",visibility:T?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:X,onMouseMove:K,onMouseLeave:U,onContextMenu:q,onClick:e=>{const{nodeDragThreshold:t}=L.getState();if(w&&(!S||!b||t>0)&&Ga({id:n,store:L,nodeRef:B}),d){const t=L.getState().nodeInternals.get(n);t&&d(e,{...t})}},onDoubleClick:Z,onKeyDown:E?e=>{if(!Hr(e)&&!D)if(Fr.includes(e.key)&&w){const t="Escape"===e.key;Ga({id:n,store:L,unselect:t,nodeRef:B})}else b&&u&&Object.prototype.hasOwnProperty.call(ti,e.key)&&(L.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~a}, y: ${~~s}`}),Y({x:ti[e.key].x,y:ti[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:E?0:void 0,role:E?"button":void 0,"aria-describedby":D?void 0:`${sa}-${I}`,"aria-label":$},e.createElement(vo,{value:n},e.createElement(t,{id:n,data:o,type:r,xPos:a,yPos:s,selected:u,isConnectable:x,sourcePosition:_,targetPosition:C,dragging:G,dragHandle:M,zIndex:R})))};return n.displayName="NodeWrapper",e.memo(n)};const ri=e=>{const t=e.getNodes().filter(e=>e.selected);return{...Co(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var oi=e.memo(function({onSelectionContextMenu:t,noPanClassName:n,disableKeyboardA11y:r}){const o=_r(),{width:a,height:s,x:l,y:c,transformString:u,userSelectionActive:d}=Sr(ri,N),f=ei(),p=e.useRef(null);if(e.useEffect(()=>{r||p.current?.focus({preventScroll:!0})},[r]),Ja({nodeRef:p}),d||!a||!s)return null;const h=t?e=>{const n=o.getState().getNodes().filter(e=>e.selected);t(e,n)}:void 0;return e.createElement("div",{className:i(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u}},e.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:r?void 0:-1,onKeyDown:r?void 0:e=>{Object.prototype.hasOwnProperty.call(ti,e.key)&&f({x:ti[e.key].x,y:ti[e.key].y,isShiftPressed:e.shiftKey})},style:{width:a,height:s,top:c,left:l}}))});const ai=e=>e.nodesSelectionActive,ii=({children:t,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:l,onMove:c,onMoveStart:u,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:S,panOnScrollSpeed:_,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:N,defaultViewport:M,translateExtent:R,minZoom:O,maxZoom:P,preventScrolling:A,onSelectionContextMenu:T,noWheelClassName:D,noPanClassName:$,disableKeyboardA11y:I})=>{const z=Sr(ai),L=fa(f),B=fa(v),F=B||N,j=B||S,H=L||p&&!0!==F;return(({deleteKeyCode:t,multiSelectionKeyCode:n})=>{const r=_r(),{deleteElements:o}=Ca(),a=fa(t,ka),i=fa(n);e.useEffect(()=>{if(a){const{edges:e,getNodes:t}=r.getState(),n=t().filter(e=>e.selected),a=e.filter(e=>e.selected);o({nodes:n,edges:a}),r.setState({nodesSelectionActive:!1})}},[a]),e.useEffect(()=>{r.setState({multiSelectionActive:i})},[i])})({deleteKeyCode:l,multiSelectionKeyCode:y}),e.createElement(Ta,{onMove:c,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:j,panOnScrollSpeed:_,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:!L&&F,defaultViewport:M,translateExtent:R,minZoom:O,maxZoom:P,zoomActivationKeyCode:b,preventScrolling:A,noWheelClassName:D,noPanClassName:$},e.createElement(Va,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:F,isSelecting:!!H,selectionMode:h},t,z&&e.createElement(oi,{onSelectionContextMenu:T,noPanClassName:$,disableKeyboardA11y:I})))};ii.displayName="FlowRenderer";var si=e.memo(ii);function li(e){return{...{input:ni(e.input||Yo),default:ni(e.default||Vo),output:ni(e.output||Ko),group:ni(e.group||Uo)},...Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=ni(e[n]||Vo),t),{})}}const ci=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),ui=t=>{const{nodesDraggable:n,nodesConnectable:r,nodesFocusable:o,elementsSelectable:a,updateNodeDimensions:i,onError:s}=Sr(ci,N),l=(c=t.onlyRenderVisibleElements,Sr(e.useCallback(e=>c?ko(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes(),[c])));var c;const u=e.useRef(),d=e.useMemo(()=>{if("undefined"==typeof ResizeObserver)return null;const e=new ResizeObserver(e=>{const t=e.map(e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0}));i(t)});return u.current=e,e},[]);return e.useEffect(()=>()=>{u?.current?.disconnect()},[]),e.createElement("div",{className:"react-flow__nodes",style:Na},l.map(i=>{let l=i.type||"default";t.nodeTypes[l]||(s?.("003",pr(l)),l="default");const c=t.nodeTypes[l]||t.nodeTypes.default,u=!!(i.draggable||n&&void 0===i.draggable),f=!!(i.selectable||a&&void 0===i.selectable),p=!!(i.connectable||r&&void 0===i.connectable),h=!!(i.focusable||o&&void 0===i.focusable),m=t.nodeExtent?Pr(i.positionAbsolute,t.nodeExtent):i.positionAbsolute,g=m?.x??0,y=m?.y??0,v=(({x:e,y:t,width:n,height:r,origin:o})=>n&&r?o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]}:{x:e,y:t})({x:g,y:y,width:i.width??0,height:i.height??0,origin:t.nodeOrigin});return e.createElement(c,{key:i.id,id:i.id,className:i.className,style:i.style,type:l,data:i.data,sourcePosition:i.sourcePosition||to.Bottom,targetPosition:i.targetPosition||to.Top,hidden:i.hidden,xPos:g,yPos:y,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!i.selected,isDraggable:u,isSelectable:f,isConnectable:p,isFocusable:h,resizeObserver:d,dragHandle:i.dragHandle,zIndex:i[Br]?.z??0,isParent:!!i[Br]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!i.width&&!!i.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:i.ariaLabel,hasHandleBounds:!!i[Br]?.handleBounds})}))};ui.displayName="NodeRenderer";var di=e.memo(ui);const fi=(e,t,n)=>n===to.Left?e-t:n===to.Right?e+t:e,pi=(e,t,n)=>n===to.Top?e-t:n===to.Bottom?e+t:e,hi="react-flow__edgeupdater",mi=({position:t,centerX:n,centerY:r,radius:o=10,onMouseDown:a,onMouseEnter:s,onMouseOut:l,type:c})=>e.createElement("circle",{onMouseDown:a,onMouseEnter:s,onMouseOut:l,className:i([hi,`${hi}-${c}`]),cx:fi(n,o,t),cy:pi(r,o,t),r:o,stroke:"transparent",fill:"transparent"}),gi=()=>!0;var yi=t=>{const n=({id:n,className:r,type:o,data:a,onClick:s,onEdgeDoubleClick:l,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:y,source:v,target:b,sourceX:w,sourceY:x,targetX:E,targetY:S,sourcePosition:_,targetPosition:C,elementsSelectable:k,hidden:N,sourceHandleId:M,targetHandleId:R,onContextMenu:O,onMouseEnter:P,onMouseMove:A,onMouseLeave:T,reconnectRadius:D,onReconnect:$,onReconnectStart:I,onReconnectEnd:z,markerEnd:L,markerStart:B,rfId:F,ariaLabel:j,isFocusable:H,isReconnectable:V,pathOptions:W,interactionWidth:Y,disableKeyboardA11y:X})=>{const K=e.useRef(null),[U,q]=e.useState(!1),[Z,G]=e.useState(!1),Q=_r(),J=e.useMemo(()=>`url('#${wo(B,F)}')`,[B,F]),ee=e.useMemo(()=>`url('#${wo(L,F)}')`,[L,F]);if(N)return null;const te=Kr(n,Q.getState,l),ne=Kr(n,Q.getState,O),re=Kr(n,Q.getState,P),oe=Kr(n,Q.getState,A),ae=Kr(n,Q.getState,T),ie=(e,t)=>{if(0!==e.button)return;const{edges:r,isValidConnection:o}=Q.getState(),a=t?b:v,i=(t?R:M)||null,s=t?"target":"source",l=o||gi,c=t,u=r.find(e=>e.id===n);G(!0),I?.(e,u,s);zo({event:e,handleId:i,nodeId:a,onConnect:e=>$?.(u,e),isTarget:c,getState:Q.getState,setState:Q.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{G(!1),z?.(e,u,s)}})},se=()=>q(!0),le=()=>q(!1),ce=!k&&!s;return e.createElement("g",{className:i(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:c,animated:u,inactive:ce,updating:U}]),onClick:e=>{const{edges:t,addSelectedEdges:r,unselectNodesAndEdges:o,multiSelectionActive:a}=Q.getState(),i=t.find(e=>e.id===n);i&&(k&&(Q.setState({nodesSelectionActive:!1}),i.selected&&a?(o({nodes:[],edges:[i]}),K.current?.blur()):r([n])),s&&s(e,i))},onDoubleClick:te,onContextMenu:ne,onMouseEnter:re,onMouseMove:oe,onMouseLeave:ae,onKeyDown:H?e=>{if(!X&&Fr.includes(e.key)&&k){const{unselectNodesAndEdges:t,addSelectedEdges:r,edges:o}=Q.getState();"Escape"===e.key?(K.current?.blur(),t({edges:[o.find(e=>e.id===n)]})):r([n])}}:void 0,tabIndex:H?0:void 0,role:H?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===j?void 0:j||`Edge from ${v} to ${b}`,"aria-describedby":H?`${la}-${F}`:void 0,ref:K},!Z&&e.createElement(t,{id:n,source:v,target:b,selected:c,animated:u,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,data:a,style:y,sourceX:w,sourceY:x,targetX:E,targetY:S,sourcePosition:_,targetPosition:C,sourceHandleId:M,targetHandleId:R,markerStart:J,markerEnd:ee,pathOptions:W,interactionWidth:Y}),V&&e.createElement(e.Fragment,null,("source"===V||!0===V)&&e.createElement(mi,{position:_,centerX:w,centerY:x,radius:D,onMouseDown:e=>ie(e,!0),onMouseEnter:se,onMouseOut:le,type:"source"}),("target"===V||!0===V)&&e.createElement(mi,{position:C,centerX:E,centerY:S,radius:D,onMouseDown:e=>ie(e,!1),onMouseEnter:se,onMouseOut:le,type:"target"})))};return n.displayName="EdgeWrapper",e.memo(n)};function vi(e){return{...{default:yi(e.default||go),straight:yi(e.bezier||fo),step:yi(e.step||uo),smoothstep:yi(e.step||co),simplebezier:yi(e.simplebezier||oo)},...Object.keys(e).filter(e=>!["default","bezier"].includes(e)).reduce((t,n)=>(t[n]=yi(e[n]||go),t),{})}}function bi(e,t,n=null){const r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,a=n?.width||t.width,i=n?.height||t.height;switch(e){case to.Top:return{x:r+a/2,y:o};case to.Right:return{x:r+a,y:o+i/2};case to.Bottom:return{x:r+a/2,y:o+i};case to.Left:return{x:r,y:o+i/2}}}function wi(e,t){return e?1!==e.length&&t?t&&e.find(e=>e.id===t)||null:e[0]:null}function xi(e){const t=e?.[Br]?.handleBounds||null,n=t&&e?.width&&e?.height&&void 0!==e?.positionAbsolute?.x&&void 0!==e?.positionAbsolute?.y;return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const Ei=[{level:0,isMaxLevel:!0,edges:[]}];function Si(t,n,r){return function(e,t,n=!1){let r=-1;const o=e.reduce((e,o)=>{const a=Lr(o.zIndex);let i=a?o.zIndex:0;if(n){const e=t.get(o.target),n=t.get(o.source),r=o.selected||e?.selected||n?.selected,s=Math.max(n?.[Br]?.z||0,e?.[Br]?.z||0,1e3);i=(a?o.zIndex:0)+(r?s:0)}return e[i]?e[i].push(o):e[i]=[o],r=i>r?i:r,e},{}),a=Object.entries(o).map(([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===r}});return 0===a.length?Ei:a}(Sr(e.useCallback(e=>t?e.edges.filter(t=>{const r=n.get(t.source),o=n.get(t.target);return r?.width&&r?.height&&o?.width&&o?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:a,width:i,height:s,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+a)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=$r({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:i/l[2],height:s/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),f=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*f)>0}({sourcePos:r.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:r.width,sourceHeight:r.height,targetWidth:o.width,targetHeight:o.height,width:e.width,height:e.height,transform:e.transform})}):e.edges,[t,n])),n,r)}const _i={[eo.Arrow]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[eo.ArrowClosed]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const Ci=({id:t,type:n,color:r,width:o=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const c=function(t){const n=_r();return e.useMemo(()=>Object.prototype.hasOwnProperty.call(_i,t)?_i[t]:(n.getState().onError?.("009",yr(t)),null),[t])}(n);return c?e.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0"},e.createElement(c,{color:r,strokeWidth:s})):null},ki=({defaultColor:t,rfId:n})=>{const r=Sr(e.useCallback((({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((n,o)=>([o.markerStart,o.markerEnd].forEach(o=>{if(o&&"object"==typeof o){const a=wo(o,t);r.includes(a)||(n.push({id:a,color:o.color||e,...o}),r.push(a))}}),n),[]).sort((e,t)=>e.id.localeCompare(t.id))})({defaultColor:t,rfId:n}),[t,n]),(e,t)=>!(e.length!==t.length||e.some((e,n)=>e.id!==t[n].id)));return e.createElement("defs",null,r.map(t=>e.createElement(Ci,{id:t.id,key:t.id,type:t.type,color:t.color,width:t.width,height:t.height,markerUnits:t.markerUnits,strokeWidth:t.strokeWidth,orient:t.orient})))};ki.displayName="MarkerDefinitions";var Ni=e.memo(ki);const Mi=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Ri=({defaultMarkerColor:t,onlyRenderVisibleElements:n,elevateEdgesOnSelect:r,rfId:o,edgeTypes:a,noPanClassName:s,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:f,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:y,children:v,disableKeyboardA11y:b})=>{const{edgesFocusable:w,edgesUpdatable:x,elementsSelectable:E,width:S,height:_,connectionMode:C,nodeInternals:k,onError:M}=Sr(Mi,N),R=Si(n,k,r);return S?e.createElement(e.Fragment,null,R.map(({level:n,edges:r,isMaxLevel:v})=>e.createElement("svg",{key:n,style:{zIndex:n},width:S,height:_,className:"react-flow__edges react-flow__container"},v&&e.createElement(Ni,{defaultColor:t,rfId:o}),e.createElement("g",null,r.map(t=>{const[n,r,v]=xi(k.get(t.source)),[S,_,N]=xi(k.get(t.target));if(!v||!N)return null;let R=t.type||"default";a[R]||(M?.("011",wr(R)),R="default");const O=a[R]||a.default,P=C===Zr.Strict?_.target:(_.target??[]).concat(_.source??[]),A=wi(r.source,t.sourceHandle),T=wi(P,t.targetHandle),D=A?.position||to.Bottom,$=T?.position||to.Top,I=!!(t.focusable||w&&void 0===t.focusable),z=t.reconnectable||t.updatable,L=void 0!==h&&(z||x&&void 0===z);if(!A||!T)return M?.("008",vr(A,t)),null;const{sourceX:B,sourceY:F,targetX:j,targetY:H}=((e,t,n,r,o,a)=>{const i=bi(n,e,t),s=bi(a,r,o);return{sourceX:i.x,sourceY:i.y,targetX:s.x,targetY:s.y}})(n,A,D,S,T,$);return e.createElement(O,{key:t.id,id:t.id,className:i([t.className,s]),type:R,data:t.data,selected:!!t.selected,animated:!!t.animated,hidden:!!t.hidden,label:t.label,labelStyle:t.labelStyle,labelShowBg:t.labelShowBg,labelBgStyle:t.labelBgStyle,labelBgPadding:t.labelBgPadding,labelBgBorderRadius:t.labelBgBorderRadius,style:t.style,source:t.source,target:t.target,sourceHandleId:t.sourceHandle,targetHandleId:t.targetHandle,markerEnd:t.markerEnd,markerStart:t.markerStart,sourceX:B,sourceY:F,targetX:j,targetY:H,sourcePosition:D,targetPosition:$,elementsSelectable:E,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:f,onEdgeDoubleClick:p,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,reconnectRadius:y,rfId:o,ariaLabel:t.ariaLabel,isFocusable:I,isReconnectable:L,pathOptions:"pathOptions"in t?t.pathOptions:void 0,interactionWidth:t.interactionWidth,disableKeyboardA11y:b})})))),v):null};Ri.displayName="EdgeRenderer";var Oi=e.memo(Ri);const Pi=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ai({children:t}){const n=Sr(Pi);return e.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},t)}const Ti={[to.Left]:to.Right,[to.Right]:to.Left,[to.Top]:to.Bottom,[to.Bottom]:to.Top},Di=({nodeId:t,handleType:n,style:r,type:o=Jr.Bezier,CustomComponent:a,connectionStatus:i})=>{const{fromNode:s,handleId:l,toX:c,toY:u,connectionMode:d}=Sr(e.useCallback(e=>({fromNode:e.nodeInternals.get(t),handleId:e.connectionHandleId,toX:(e.connectionPosition.x-e.transform[0])/e.transform[2],toY:(e.connectionPosition.y-e.transform[1])/e.transform[2],connectionMode:e.connectionMode}),[t]),N),f=s?.[Br]?.handleBounds;let p=f?.[n];if(d===Zr.Loose&&(p=p||f?.["source"===n?"target":"source"]),!s||!p)return null;const h=l?p.find(e=>e.id===l):p[0],m=h?h.x+h.width/2:(s.width??0)/2,g=h?h.y+h.height/2:s.height??0,y=(s.positionAbsolute?.x??0)+m,v=(s.positionAbsolute?.y??0)+g,b=h?.position,w=b?Ti[b]:null;if(!b||!w)return null;if(a)return e.createElement(a,{connectionLineType:o,connectionLineStyle:r,fromNode:s,fromHandle:h,fromX:y,fromY:v,toX:c,toY:u,fromPosition:b,toPosition:w,connectionStatus:i});let x="";const E={sourceX:y,sourceY:v,sourcePosition:b,targetX:c,targetY:u,targetPosition:w};return o===Jr.Bezier?[x]=mo(E):o===Jr.Step?[x]=lo({...E,borderRadius:0}):o===Jr.SmoothStep?[x]=lo(E):o===Jr.SimpleBezier?[x]=ro(E):x=`M${y},${v} ${c},${u}`,e.createElement("path",{d:x,fill:"none",className:"react-flow__connection-path",style:r})};Di.displayName="ConnectionLine";const $i=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Ii({containerStyle:t,style:n,type:r,component:o}){const{nodeId:a,handleType:s,nodesConnectable:l,width:c,height:u,connectionStatus:d}=Sr($i,N);return!!(a&&s&&c&&l)?e.createElement("svg",{style:t,width:c,height:u,className:"react-flow__edges react-flow__connectionline react-flow__container"},e.createElement("g",{className:i(["react-flow__connection",d])},e.createElement(Di,{nodeId:a,handleType:s,style:n,type:r,CustomComponent:o,connectionStatus:d}))):null}function zi(t,n){const r=e.useRef(null),o=_r();return e.useMemo(()=>{if("development"===process.env.NODE_ENV){const e=Object.keys(t);N(r.current,e)&&o.getState().onError?.("002",fr()),r.current=e}return n(t)},[t])}const Li=({nodeTypes:t,edgeTypes:n,onMove:r,onMoveStart:o,onMoveEnd:a,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:g,onSelectionEnd:y,connectionLineType:v,connectionLineStyle:b,connectionLineComponent:w,connectionLineContainerStyle:x,selectionKeyCode:E,selectionOnDrag:S,selectionMode:_,multiSelectionKeyCode:C,panActivationKeyCode:k,zoomActivationKeyCode:N,deleteKeyCode:M,onlyRenderVisibleElements:R,elementsSelectable:O,selectNodesOnDrag:P,defaultViewport:A,translateExtent:T,minZoom:D,maxZoom:$,preventScrolling:I,defaultMarkerColor:z,zoomOnScroll:L,zoomOnPinch:B,panOnScroll:F,panOnScrollSpeed:j,panOnScrollMode:H,zoomOnDoubleClick:V,panOnDrag:W,onPaneClick:Y,onPaneMouseEnter:X,onPaneMouseMove:K,onPaneMouseLeave:U,onPaneScroll:q,onPaneContextMenu:Z,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,reconnectRadius:oe,noDragClassName:ae,noWheelClassName:ie,noPanClassName:se,elevateEdgesOnSelect:le,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:fe})=>{const pe=zi(t,li),he=zi(n,vi);return function(t){const n=Ca(),r=e.useRef(!1);e.useEffect(()=>{!r.current&&n.viewportInitialized&&t&&(setTimeout(()=>t(n),1),r.current=!0)},[t,n.viewportInitialized])}(i),e.createElement(si,{onPaneClick:Y,onPaneMouseEnter:X,onPaneMouseMove:K,onPaneMouseLeave:U,onPaneContextMenu:Z,onPaneScroll:q,deleteKeyCode:M,selectionKeyCode:E,selectionOnDrag:S,selectionMode:_,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:C,panActivationKeyCode:k,zoomActivationKeyCode:N,elementsSelectable:O,onMove:r,onMoveStart:o,onMoveEnd:a,zoomOnScroll:L,zoomOnPinch:B,zoomOnDoubleClick:V,panOnScroll:F,panOnScrollSpeed:j,panOnScrollMode:H,panOnDrag:W,defaultViewport:A,translateExtent:T,minZoom:D,maxZoom:$,onSelectionContextMenu:m,preventScrolling:I,noDragClassName:ae,noWheelClassName:ie,noPanClassName:se,disableKeyboardA11y:ce},e.createElement(Ai,null,e.createElement(Oi,{edgeTypes:he,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:R,onEdgeContextMenu:G,onEdgeMouseEnter:Q,onEdgeMouseMove:J,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,reconnectRadius:oe,defaultMarkerColor:z,noPanClassName:se,elevateEdgesOnSelect:!!le,disableKeyboardA11y:ce,rfId:fe},e.createElement(Ii,{style:b,type:v,component:w,containerStyle:x})),e.createElement("div",{className:"react-flow__edgelabel-renderer"}),e.createElement(di,{nodeTypes:pe,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,selectNodesOnDrag:P,onlyRenderVisibleElements:R,noPanClassName:se,noDragClassName:ae,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:fe})))};Li.displayName="GraphView";var Bi=e.memo(Li);const Fi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ji={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Fi,nodeExtent:Fi,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Zr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:jr,isValidConnection:void 0},Hi=()=>{return e=(e,t)=>({...ji,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:a}=t();e({nodeInternals:ya(n,r,o,a)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(e=>({...r,...e}))})},setDefaultNodesAndEdges:(n,r)=>{const o=void 0!==n,a=void 0!==r,i=o?ya(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:a?r:[],hasDefaultNodes:o,hasDefaultEdges:a})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:a,fitViewOnInitDone:i,fitViewOnInitOptions:s,domNode:l,nodeOrigin:c}=t(),u=l?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(d.transform),p=n.reduce((e,t)=>{const n=o.get(t.id);if(n?.hidden)o.set(n.id,{...n,[Br]:{...n[Br],handleBounds:void 0}});else if(n){const r=Rr(t.nodeElement);r.width&&r.height&&(n.width!==r.width||n.height!==r.height||t.forceUpdate)&&(o.set(n.id,{...n,[Br]:{...n[Br],handleBounds:{source:qa(".source",t.nodeElement,f,c),target:qa(".target",t.nodeElement,f,c)}},...r}),e.push({id:n.id,type:"dimensions",dimensions:r}))}return e},[]);ga(o,c);const h=i||a&&!i&&va(t,{initial:!0,...s});e({nodeInternals:new Map(o),fitViewOnInitDone:h}),p?.length>0&&r?.(p)},updateNodePositions:(e,n=!0,r=!1)=>{const{triggerNodeChanges:o}=t(),a=e.map(e=>{const t={id:e.id,type:"position",dragging:r};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t});o(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:a,nodeOrigin:i,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(a){const t=ya(La(n,s()),o,i,l);e({nodeInternals:t})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:a}=t();let i,s=null;r?i=n.map(e=>Ba(e,!0)):(i=Fa(a(),n),s=Fa(o,[])),xa({changedNodes:i,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:a}=t();let i,s=null;r?i=n.map(e=>Ba(e,!0)):(i=Fa(o,n),s=Fa(a(),[])),xa({changedNodes:s,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:a}=t(),i=r||o;xa({changedNodes:(n||a()).map(e=>(e.selected=!1,Ba(e.id,!1))),changedEdges:i.map(e=>Ba(e.id,!1)),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t();xa({changedNodes:r().filter(e=>e.selected).map(e=>Ba(e.id,!1)),changedEdges:n.filter(e=>e.selected).map(e=>Ba(e.id,!1)),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(e=>{e.positionAbsolute=Pr(e.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:e=>{const{transform:n,width:r,height:o,d3Zoom:a,d3Selection:i,translateExtent:s}=t();if(!a||!i||!e.x&&!e.y)return!1;const l=tr.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[r,o]],u=a?.constrain()(l,c,s);return a.transform(i,u),n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:ji.connectionNodeId,connectionHandleId:ji.connectionHandleId,connectionHandleType:ji.connectionHandleType,connectionStatus:ji.connectionStatus,connectionStartHandle:ji.connectionStartHandle,connectionEndHandle:ji.connectionEndHandle}),reset:()=>e({...ji})}),t=Object.is,e?k(e,t):k;var e,t},Vi=({children:t})=>{const n=e.useRef(null);return n.current||(n.current=Hi()),e.createElement(dr,{value:n.current},t)};Vi.displayName="ReactFlowProvider";const Wi=({children:t})=>e.useContext(ur)?e.createElement(e.Fragment,null,t):e.createElement(Vi,null,t);Wi.displayName="ReactFlowWrapper";const Yi={input:Yo,default:Vo,output:Ko,group:Uo},Xi={default:go,straight:fo,step:uo,smoothstep:co,simplebezier:oo},Ki=[0,0],Ui=[15,15],qi={x:0,y:0,zoom:1},Zi={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Gi=e.forwardRef(({nodes:t,edges:n,defaultNodes:r,defaultEdges:o,className:a,nodeTypes:s=Yi,edgeTypes:l=Xi,onNodeClick:c,onEdgeClick:u,onInit:d,onMove:f,onMoveStart:p,onMoveEnd:h,onConnect:m,onConnectStart:g,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:M,onEdgesDelete:R,onSelectionChange:O,onSelectionDragStart:P,onSelectionDrag:A,onSelectionDragStop:T,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,connectionMode:z=Zr.Strict,connectionLineType:L=Jr.Bezier,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:j,deleteKeyCode:H="Backspace",selectionKeyCode:V="Shift",selectionOnDrag:W=!1,selectionMode:Y=Qr.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(Yr()?"Meta":"Control"),zoomActivationKeyCode:U=(Yr()?"Meta":"Control"),snapToGrid:q=!1,snapGrid:Z=Ui,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=Ki,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ae,defaultViewport:ie=qi,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=Fi,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:pe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=Gr.Free,zoomOnDoubleClick:ve=!0,panOnDrag:be=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:Ce,children:ke,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Re,onEdgeMouseMove:Oe,onEdgeMouseLeave:Pe,onEdgeUpdate:Ae,onEdgeUpdateStart:Te,onEdgeUpdateEnd:De,onReconnect:$e,onReconnectStart:Ie,onReconnectEnd:ze,reconnectRadius:Le=10,edgeUpdaterRadius:Be=10,onNodesChange:Fe,onEdgesChange:je,noDragClassName:He="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:We="nopan",fitView:Ye=!1,fitViewOptions:Xe,connectOnClick:Ke=!0,attributionPosition:Ue,proOptions:qe,defaultEdgeOptions:Ze,elevateNodesOnSelect:Ge=!0,elevateEdgesOnSelect:Qe=!1,disableKeyboardA11y:Je=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:rt,onError:ot,style:at,id:it,nodeDragThreshold:st,...lt},ct)=>{const ut=it||"1";return e.createElement("div",{...lt,style:{...at,...Zi},ref:ct,className:i(["react-flow",a]),"data-testid":"rf__wrapper",id:it},e.createElement(Wi,null,e.createElement(Bi,{onInit:d,onMove:f,onMoveStart:p,onMoveEnd:h,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:s,edgeTypes:l,connectionLineType:L,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:j,selectionKeyCode:V,selectionOnDrag:W,selectionMode:Y,deleteKeyCode:H,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:U,onlyRenderVisibleElements:G,selectNodesOnDrag:Q,defaultViewport:ie,translateExtent:ce,minZoom:se,maxZoom:le,preventScrolling:ue,zoomOnScroll:pe,zoomOnPinch:he,zoomOnDoubleClick:ve,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:be,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:Ce,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Re,onEdgeMouseMove:Oe,onEdgeMouseLeave:Pe,onReconnect:$e??Ae,onReconnectStart:Ie??Te,onReconnectEnd:ze??De,reconnectRadius:Le??Be,defaultMarkerColor:fe,noDragClassName:He,noWheelClassName:Ve,noPanClassName:We,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),e.createElement(oa,{nodes:t,edges:n,defaultNodes:r,defaultEdges:o,onConnect:m,onConnectStart:g,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ae,elevateNodesOnSelect:Ge,minZoom:se,maxZoom:le,nodeExtent:de,onNodesChange:Fe,onEdgesChange:je,snapToGrid:q,snapGrid:Z,connectionMode:z,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:Ye,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:R,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:A,onSelectionDragStart:P,onSelectionDragStop:T,noPanClassName:We,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:ot,connectionRadius:nt,isValidConnection:rt,nodeDragThreshold:st}),e.createElement(ea,{onSelectionChange:O}),ke,e.createElement(Nr,{proOptions:qe,position:Ue}),e.createElement(da,{rfId:ut,disableKeyboardA11y:Je})))});function Qi(t){return n=>{const[r,o]=e.useState(n),a=e.useCallback(e=>o(n=>t(e,n)),[]);return[r,o,a]}}Gi.displayName="ReactFlow";const Ji=Qi(La),es=Qi(function(e,t){return za(e,t)});var ts;function ns({color:t,dimensions:n,lineWidth:r}){return e.createElement("path",{stroke:t,strokeWidth:r,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function rs({color:t,radius:n}){return e.createElement("circle",{cx:n,cy:n,r:n,fill:t})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(ts||(ts={}));const os={[ts.Dots]:"#91919a",[ts.Lines]:"#eee",[ts.Cross]:"#e2e2e2"},as={[ts.Dots]:1,[ts.Lines]:1,[ts.Cross]:6},is=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ss({id:t,variant:n=ts.Dots,gap:r=20,size:o,lineWidth:a=1,offset:s=2,color:l,style:c,className:u}){const d=e.useRef(null),{transform:f,patternId:p}=Sr(is,N),h=l||os[n],m=o||as[n],g=n===ts.Dots,y=n===ts.Cross,v=Array.isArray(r)?r:[r,r],b=[v[0]*f[2]||1,v[1]*f[2]||1],w=m*f[2],x=y?[w,w]:b,E=g?[w/s,w/s]:[x[0]/s,x[1]/s];return e.createElement("svg",{className:i(["react-flow__background",u]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},e.createElement("pattern",{id:p+t,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`},g?e.createElement(rs,{color:h,radius:w/s}):e.createElement(ns,{dimensions:x,color:h,lineWidth:a})),e.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+t})`}))}ss.displayName="Background";var ls=e.memo(ss);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".react-flow{direction:ltr}.react-flow__container{height:100%;left:0;position:absolute;top:0;width:100%}.react-flow__pane{cursor:-webkit-grab;cursor:grab;z-index:1}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__viewport{pointer-events:none;transform-origin:0 0;z-index:2}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{overflow:visible;pointer-events:none}.react-flow__connection-path,.react-flow__edge-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{cursor:pointer;pointer-events:visibleStroke}.react-flow__edge.animated path{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;-webkit-animation:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{box-sizing:border-box;cursor:-webkit-grab;cursor:grab;pointer-events:all;position:absolute;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__node.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:-webkit-grab;cursor:grab;pointer-events:all;position:absolute}.react-flow__handle{background:#1a192b;border:1px solid #fff;border-radius:100%;height:6px;min-height:5px;min-width:5px;pointer-events:none;position:absolute;width:6px}.react-flow__handle.connectionindicator{cursor:crosshair;pointer-events:all}.react-flow__handle-bottom{bottom:-4px;left:50%;top:auto;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{left:-4px;top:50%;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{margin:15px;position:absolute;z-index:5}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translateX(-50%)}.react-flow__attribution{background:hsla(0,0%,100%,.5);font-size:10px;margin:0;padding:2px 3px}.react-flow__attribution a{color:#999;text-decoration:none}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{height:100%;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-group,.react-flow__node-input,.react-flow__node-output{background-color:#fff;border:1px solid #1a192b;border-radius:3px;color:#222;font-size:12px;padding:10px;text-align:center;width:150px}.react-flow__node-default.selectable:hover,.react-flow__node-group.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover{box-shadow:0 1px 4px 1px rgba(0,0,0,.08)}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:hsla(0,0%,94%,.25)}.react-flow__nodesselection-rect,.react-flow__selection{background:rgba(0,89,220,.08);border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px rgba(0,0,0,.08)}.react-flow__controls-button{align-items:center;background:#fefefe;border:none;border-bottom:1px solid #eee;box-sizing:content-box;cursor:pointer;display:flex;height:16px;justify-content:center;padding:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{max-height:12px;max-width:12px;width:100%}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.bottom,.react-flow__resize-control.top{cursor:ns-resize}.react-flow__resize-control.bottom.right,.react-flow__resize-control.top.left{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:#3367d9;border:1px solid #fff;border-radius:1px;height:4px;transform:translate(-50%,-50%);width:4px}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.bottom.left,.react-flow__resize-control.handle.top.left{left:0}.react-flow__resize-control.handle.bottom.right,.react-flow__resize-control.handle.top.right{left:100%}.react-flow__resize-control.line{border:0 solid #3367d9}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{height:100%;top:0;transform:translate(-50%);width:1px}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.bottom,.react-flow__resize-control.line.top{height:1px;left:0;transform:translateY(-50%);width:100%}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}");
2
2
  /**
3
3
  * @license lucide-react v0.525.0 - ISC
4
4
  *
@@ -12,7 +12,7 @@ const cs=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperC
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
14
  */
15
- var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ps=e.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:s,...l},c)=>e.createElement("svg",{ref:c,...fs,width:n,height:n,stroke:t,strokeWidth:r?24*Number(o)/Number(n):o,className:us("lucide",a),...!i&&!ds(l)&&{"aria-hidden":"true"},...l},[...s.map(([t,n])=>e.createElement(t,n)),...Array.isArray(i)?i:[i]])),hs=(t,n)=>{const o=e.forwardRef(({className:o,...r},a)=>{return e.createElement(ps,{ref:a,iconNode:n,className:us(`lucide-${i=cs(t),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${t}`,o),...r});var i});return o.displayName=cs(t),o},ms=hs("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),gs=hs("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ys=hs("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),vs=hs("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),bs=hs("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ws=hs("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),xs=hs("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Es=({id:t,sourceX:n,sourceY:o,targetX:r,targetY:a,sourcePosition:i,targetPosition:s,style:l={},markerEnd:c,bidirectional:u=!1,data:d,clientToSvgCoords:f,svgRef:p})=>{e.useState(!1);const[h,m,g]=e.useMemo(()=>mr({sourceX:n,sourceY:o,targetX:r,targetY:a}),[n,o,r,a]),y={...l,stroke:(()=>{const e=d?.details?.state;switch(e){case"Open":case"Completed":return"#000000";case"Error":return"#ef4444";default:return l.stroke||"#000000"}})(),strokeWidth:l.strokeWidth||2};return e.createElement(e.Fragment,null,e.createElement(Ko,{path:h,style:y}))};function Ss(){return Ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ss.apply(null,arguments)}var _s=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),ks="-ms-",Cs="-moz-",Ns="-webkit-",Ms="comm",Os="rule",Ps="decl",Rs="@keyframes",As=Math.abs,Ds=String.fromCharCode,Ts=Object.assign;function Is(e){return e.trim()}function zs(e,t,n){return e.replace(t,n)}function Ls(e,t){return e.indexOf(t)}function $s(e,t){return 0|e.charCodeAt(t)}function Bs(e,t,n){return e.slice(t,n)}function js(e){return e.length}function Hs(e){return e.length}function Fs(e,t){return t.push(e),e}var Vs=1,Ws=1,Ys=0,Xs=0,Ks=0,qs="";function Us(e,t,n,o,r,a,i){return{value:e,root:t,parent:n,type:o,props:r,children:a,line:Vs,column:Ws,length:i,return:""}}function Zs(e,t){return Ts(Us("",null,null,"",null,null,0),e,{length:-e.length},t)}function Gs(){return Ks=Xs>0?$s(qs,--Xs):0,Ws--,10===Ks&&(Ws=1,Vs--),Ks}function Qs(){return Ks=Xs<Ys?$s(qs,Xs++):0,Ws++,10===Ks&&(Ws=1,Vs++),Ks}function Js(){return $s(qs,Xs)}function el(){return Xs}function tl(e,t){return Bs(qs,e,t)}function nl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ol(e){return Vs=Ws=1,Ys=js(qs=e),Xs=0,[]}function rl(e){return qs="",e}function al(e){return Is(tl(Xs-1,ll(91===e?e+2:40===e?e+1:e)))}function il(e){for(;(Ks=Js())&&Ks<33;)Qs();return nl(e)>2||nl(Ks)>3?"":" "}function sl(e,t){for(;--t&&Qs()&&!(Ks<48||Ks>102||Ks>57&&Ks<65||Ks>70&&Ks<97););return tl(e,el()+(t<6&&32==Js()&&32==Qs()))}function ll(e){for(;Qs();)switch(Ks){case e:return Xs;case 34:case 39:34!==e&&39!==e&&ll(Ks);break;case 40:41===e&&ll(e);break;case 92:Qs()}return Xs}function cl(e,t){for(;Qs()&&e+Ks!==57&&(e+Ks!==84||47!==Js()););return"/*"+tl(t,Xs-1)+"*"+Ds(47===e?e:Qs())}function ul(e){for(;!nl(Js());)Qs();return tl(e,Xs)}function dl(e){return rl(fl("",null,null,null,[""],e=ol(e),0,[0],e))}function fl(e,t,n,o,r,a,i,s,l){for(var c=0,u=0,d=i,f=0,p=0,h=0,m=1,g=1,y=1,v=0,b="",w=r,x=a,E=o,S=b;g;)switch(h=v,v=Qs()){case 40:if(108!=h&&58==$s(S,d-1)){-1!=Ls(S+=zs(al(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:S+=al(v);break;case 9:case 10:case 13:case 32:S+=il(h);break;case 92:S+=sl(el()-1,7);continue;case 47:switch(Js()){case 42:case 47:Fs(hl(cl(Qs(),el()),t,n),l);break;default:S+="/"}break;case 123*m:s[c++]=js(S)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(S=zs(S,/\f/g,"")),p>0&&js(S)-d&&Fs(p>32?ml(S+";",o,n,d-1):ml(zs(S," ","")+";",o,n,d-2),l);break;case 59:S+=";";default:if(Fs(E=pl(S,t,n,c,u,r,s,b,w=[],x=[],d),a),123===v)if(0===u)fl(S,t,E,E,w,a,d,s,x);else switch(99===f&&110===$s(S,3)?100:f){case 100:case 108:case 109:case 115:fl(e,E,E,o&&Fs(pl(e,E,E,0,0,r,s,b,r,w=[],d),x),r,x,d,s,o?w:x);break;default:fl(S,E,E,E,[""],x,0,s,x)}}c=u=p=0,m=y=1,b=S="",d=i;break;case 58:d=1+js(S),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==Gs())continue;switch(S+=Ds(v),v*m){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(js(S)-1)*y,y=1;break;case 64:45===Js()&&(S+=al(Qs())),f=Js(),u=d=js(b=S+=ul(el())),v++;break;case 45:45===h&&2==js(S)&&(m=0)}}return a}function pl(e,t,n,o,r,a,i,s,l,c,u){for(var d=r-1,f=0===r?a:[""],p=Hs(f),h=0,m=0,g=0;h<o;++h)for(var y=0,v=Bs(e,d+1,d=As(m=i[h])),b=e;y<p;++y)(b=Is(m>0?f[y]+" "+v:zs(v,/&\f/g,f[y])))&&(l[g++]=b);return Us(e,t,n,0===r?Os:s,l,c,u)}function hl(e,t,n){return Us(e,t,n,Ms,Ds(Ks),Bs(e,2,-2),0)}function ml(e,t,n,o){return Us(e,t,n,Ps,Bs(e,0,o),Bs(e,o+1,-1),o)}function gl(e,t){for(var n="",o=Hs(e),r=0;r<o;r++)n+=t(e[r],r,e,t)||"";return n}function yl(e,t,n,o){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ps:return e.return=e.return||e.value;case Ms:return"";case Rs:return e.return=e.value+"{"+gl(e.children,o)+"}";case Os:e.value=e.props.join(",")}return js(n=gl(e.children,o))?e.return=e.value+"{"+n+"}":""}function vl(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var bl=function(e,t,n){for(var o=0,r=0;o=r,r=Js(),38===o&&12===r&&(t[n]=1),!nl(r);)Qs();return tl(e,Xs)},wl=function(e,t){return rl(function(e,t){var n=-1,o=44;do{switch(nl(o)){case 0:38===o&&12===Js()&&(t[n]=1),e[n]+=bl(Xs-1,t,n);break;case 2:e[n]+=al(o);break;case 4:if(44===o){e[++n]=58===Js()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Ds(o)}}while(o=Qs());return e}(ol(e),t))},xl=new WeakMap,El=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||xl.get(n))&&!o){xl.set(e,!0);for(var r=[],a=wl(t,r),i=n.props,s=0,l=0;s<a.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=r[s]?a[s].replace(/&\f/g,i[c]):i[c]+" "+a[s]}}},Sl=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function _l(e,t){switch(function(e,t){return 45^$s(e,0)?(((t<<2^$s(e,0))<<2^$s(e,1))<<2^$s(e,2))<<2^$s(e,3):0}(e,t)){case 5103:return Ns+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ns+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ns+e+Cs+e+ks+e+e;case 6828:case 4268:return Ns+e+ks+e+e;case 6165:return Ns+e+ks+"flex-"+e+e;case 5187:return Ns+e+zs(e,/(\w+).+(:[^]+)/,Ns+"box-$1$2"+ks+"flex-$1$2")+e;case 5443:return Ns+e+ks+"flex-item-"+zs(e,/flex-|-self/,"")+e;case 4675:return Ns+e+ks+"flex-line-pack"+zs(e,/align-content|flex-|-self/,"")+e;case 5548:return Ns+e+ks+zs(e,"shrink","negative")+e;case 5292:return Ns+e+ks+zs(e,"basis","preferred-size")+e;case 6060:return Ns+"box-"+zs(e,"-grow","")+Ns+e+ks+zs(e,"grow","positive")+e;case 4554:return Ns+zs(e,/([^-])(transform)/g,"$1"+Ns+"$2")+e;case 6187:return zs(zs(zs(e,/(zoom-|grab)/,Ns+"$1"),/(image-set)/,Ns+"$1"),e,"")+e;case 5495:case 3959:return zs(e,/(image-set\([^]*)/,Ns+"$1$`$1");case 4968:return zs(zs(e,/(.+:)(flex-)?(.*)/,Ns+"box-pack:$3"+ks+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ns+e+e;case 4095:case 3583:case 4068:case 2532:return zs(e,/(.+)-inline(.+)/,Ns+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(js(e)-1-t>6)switch($s(e,t+1)){case 109:if(45!==$s(e,t+4))break;case 102:return zs(e,/(.+:)(.+)-([^]+)/,"$1"+Ns+"$2-$3$1"+Cs+(108==$s(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ls(e,"stretch")?_l(zs(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==$s(e,t+1))break;case 6444:switch($s(e,js(e)-3-(~Ls(e,"!important")&&10))){case 107:return zs(e,":",":"+Ns)+e;case 101:return zs(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ns+(45===$s(e,14)?"inline-":"")+"box$3$1"+Ns+"$2$3$1"+ks+"$2box$3")+e}break;case 5936:switch($s(e,t+11)){case 114:return Ns+e+ks+zs(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ns+e+ks+zs(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ns+e+ks+zs(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ns+e+ks+e+e}return e}var kl=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case Ps:e.return=_l(e.value,e.length);break;case Rs:return gl([Zs(e,{value:zs(e.value,"@","@"+Ns)})],o);case Os:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return gl([Zs(e,{props:[zs(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return gl([Zs(e,{props:[zs(t,/:(plac\w+)/,":"+Ns+"input-$1")]}),Zs(e,{props:[zs(t,/:(plac\w+)/,":-moz-$1")]}),Zs(e,{props:[zs(t,/:(plac\w+)/,ks+"input-$1")]})],o)}return""})}}],Cl=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var o,r,a=e.stylisPlugins||kl,i={},s=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u=[yl,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=Hs(e);return function(n,o,r,a){for(var i="",s=0;s<t;s++)i+=e[s](n,o,r,a)||"";return i}}([El,Sl].concat(a,u));r=function(e,t,n,o){l=n,gl(dl(e?e+"{"+t.styles+"}":t.styles),d),o&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new _s({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:r};return f.sheet.hydrate(s),f};var Nl=function(e,t,n){var o=e.key+"-"+t.name;!1===n&&void 0===e.registered[o]&&(e.registered[o]=t.styles)};var Ml={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ol=/[A-Z]|^ms/g,Pl=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Rl=function(e){return 45===e.charCodeAt(1)},Al=function(e){return null!=e&&"boolean"!=typeof e},Dl=vl(function(e){return Rl(e)?e:e.replace(Ol,"-$&").toLowerCase()}),Tl=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Pl,function(e,t,n){return zl={name:t,styles:n,next:zl},t})}return 1===Ml[e]||Rl(e)||"number"!=typeof t||0===t?t:t+"px"};function Il(e,t,n){if(null==n)return"";var o=n;if(void 0!==o.__emotion_styles)return o;switch(typeof n){case"boolean":return"";case"object":var r=n;if(1===r.anim)return zl={name:r.name,styles:r.styles,next:zl},r.name;var a=n;if(void 0!==a.styles){var i=a.next;if(void 0!==i)for(;void 0!==i;)zl={name:i.name,styles:i.styles,next:zl},i=i.next;return a.styles+";"}return function(e,t,n){var o="";if(Array.isArray(n))for(var r=0;r<n.length;r++)o+=Il(e,t,n[r])+";";else for(var a in n){var i=n[a];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?o+=a+"{"+t[s]+"}":Al(s)&&(o+=Dl(a)+":"+Tl(a,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=Il(e,t,i);switch(a){case"animation":case"animationName":o+=Dl(a)+":"+l+";";break;default:o+=a+"{"+l+"}"}}else for(var c=0;c<i.length;c++)Al(i[c])&&(o+=Dl(a)+":"+Tl(a,i[c])+";")}return o}(e,t,n);case"function":if(void 0!==e){var s=zl,l=n(e);return zl=s,Il(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var zl,Ll=/label:\s*([^\s;{]+)\s*(;|$)/g;var $l=!!r.useInsertionEffect&&r.useInsertionEffect||function(e){return e()},Bl=r.createContext("undefined"!=typeof HTMLElement?Cl({key:"css"}):null);Bl.Provider;var jl=r.createContext({}),Hl=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Fl=vl(function(e){return Hl.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),Vl=function(e){return"theme"!==e},Wl=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Fl:Vl},Yl=function(e,t,n){var o;if(t){var r=t.shouldForwardProp;o=e.__emotion_forwardProp&&r?function(t){return e.__emotion_forwardProp(t)&&r(t)}:r}return"function"!=typeof o&&n&&(o=e.__emotion_forwardProp),o},Xl=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return Nl(t,n,o),$l(function(){return function(e,t,n){Nl(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)}),null},Kl=function t(n,o){var a,i,s=n.__emotion_real===n,l=s&&n.__emotion_base||n;void 0!==o&&(a=o.label,i=o.target);var c=Yl(n,o,s),u=c||Wl(l),d=!u("as");return function(){var f=arguments,p=s&&void 0!==n.__emotion_styles?n.__emotion_styles.slice(0):[];if(void 0!==a&&p.push("label:"+a+";"),null==f[0]||void 0===f[0].raw)p.push.apply(p,f);else{var h=f[0];p.push(h[0]);for(var m=f.length,g=1;g<m;g++)p.push(f[g],h[g])}var y,v=(y=function(e,t,n){var o,a,s,f,h=d&&e.as||l,m="",g=[],y=e;if(null==e.theme){for(var v in y={},e)y[v]=e[v];y.theme=r.useContext(jl)}"string"==typeof e.className?(o=t.registered,a=g,s=e.className,f="",s.split(" ").forEach(function(e){void 0!==o[e]?a.push(o[e]+";"):e&&(f+=e+" ")}),m=f):null!=e.className&&(m=e.className+" ");var b=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,r="";zl=void 0;var a=e[0];null==a||void 0===a.raw?(o=!1,r+=Il(n,t,a)):r+=a[0];for(var i=1;i<e.length;i++)r+=Il(n,t,e[i]),o&&(r+=a[i]);Ll.lastIndex=0;for(var s,l="";null!==(s=Ll.exec(r));)l+="-"+s[1];var c=function(e){for(var t,n=0,o=0,r=e.length;r>=4;++o,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:zl}}(p.concat(g),t.registered,y);m+=t.key+"-"+b.name,void 0!==i&&(m+=" "+i);var w=d&&void 0===c?Wl(h):u,x={};for(var E in e)d&&"as"===E||w(E)&&(x[E]=e[E]);return x.className=m,n&&(x.ref=n),r.createElement(r.Fragment,null,r.createElement(Xl,{cache:t,serialized:b,isStringTag:"string"==typeof h}),r.createElement(h,x))},e.forwardRef(function(t,n){var o=e.useContext(Bl);return y(t,o,n)}));return v.displayName=void 0!==a?a:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",v.defaultProps=n.defaultProps,v.__emotion_real=v,v.__emotion_base=l,v.__emotion_styles=p,v.__emotion_forwardProp=c,Object.defineProperty(v,"toString",{value:function(){return"."+i}}),v.withComponent=function(e,n){return t(e,Ss({},o,n,{shouldForwardProp:Yl(v,n,!0)})).apply(void 0,p)},v}}.bind(null);function ql(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=ql(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Ul(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=ql(e))&&(o&&(o+=" "),o+=t);return o}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){Kl[e]=Kl(e)});const Zl=e=>{const t=ec(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),Gl(n,t)||Jl(e)},getConflictingClassGroupIds:(e,t)=>{const r=n[e]||[];return t&&o[e]?[...r,...o[e]]:r}}},Gl=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Gl(e.slice(1),o):void 0;if(r)return r;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},Ql=/^\[(.+)\]$/,Jl=e=>{if(Ql.test(e)){const t=Ql.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ec=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const e in n)tc(n[e],o,e,t);return o},tc=(e,t,n,o)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:nc(t,e)).classGroupId=n)}if("function"==typeof e)return oc(e)?void tc(e(o),t,n,o):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,r])=>{tc(r,nc(t,e),n,o)})})},nc=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},oc=e=>e.isThemeGetter,rc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(r,a)=>{n.set(r,a),t++,t>e&&(t=0,o=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=o.get(e))?(r(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):r(e,t)}}},ac=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=e=>{const t=[];let n,o=0,r=0,a=0;for(let i=0;i<e.length;i++){let s=e[i];if(0===o&&0===r){if(":"===s){t.push(e.slice(a,i)),a=i+1;continue}if("/"===s){n=i;continue}}"["===s?o++:"]"===s?o--:"("===s?r++:")"===s&&r--}const i=0===t.length?e:e.substring(a),s=ic(i);return{modifiers:t,hasImportantModifier:s!==i,baseClassName:s,maybePostfixModifierPosition:n&&n>a?n-a:void 0}};if(t){const e=t+":",n=o;o=t=>t.startsWith(e)?n(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(n){const e=o;o=t=>n({className:t,parseClassName:e})}return o},ic=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,sc=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const n=[];let o=[];return e.forEach(e=>{"["===e[0]||t[e]?(n.push(...o.sort(),e),o=[]):o.push(e)}),n.push(...o.sort()),n}},lc=/\s+/;function cc(){let e,t,n=0,o="";for(;n<arguments.length;)(e=arguments[n++])&&(t=uc(e))&&(o&&(o+=" "),o+=t);return o}const uc=e=>{if("string"==typeof e)return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=uc(e[o]))&&(n&&(n+=" "),n+=t);return n};function dc(e,...t){let n,o,r,a=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:rc(e.cacheSize),parseClassName:ac(e),sortModifiers:sc(e),...Zl(e)}))(l),o=n.cache.get,r=n.cache.set,a=i,i(s)};function i(e){const t=o(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:a}=t,i=[],s=e.trim().split(lc);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(c){l=t+(l.length>0?" "+l:l);continue}let h=!!p,m=o(h?f.substring(0,p):f);if(!m){if(!h){l=t+(l.length>0?" "+l:l);continue}if(m=o(f),!m){l=t+(l.length>0?" "+l:l);continue}h=!1}const g=a(u).join(":"),y=d?g+"!":g,v=y+m;if(i.includes(v))continue;i.push(v);const b=r(m,h);for(let e=0;e<b.length;++e){const t=b[e];i.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,n);return r(e,a),a}return function(){return a(cc.apply(null,arguments))}}const fc=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},pc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mc=/^\d+\/\d+$/,gc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xc=e=>mc.test(e),Ec=e=>!!e&&!Number.isNaN(Number(e)),Sc=e=>!!e&&Number.isInteger(Number(e)),_c=e=>e.endsWith("%")&&Ec(e.slice(0,-1)),kc=e=>gc.test(e),Cc=()=>!0,Nc=e=>yc.test(e)&&!vc.test(e),Mc=()=>!1,Oc=e=>bc.test(e),Pc=e=>wc.test(e),Rc=e=>!Dc(e)&&!Bc(e),Ac=e=>Xc(e,Zc,Mc),Dc=e=>pc.test(e),Tc=e=>Xc(e,Gc,Nc),Ic=e=>Xc(e,Qc,Ec),zc=e=>Xc(e,qc,Mc),Lc=e=>Xc(e,Uc,Pc),$c=e=>Xc(e,eu,Oc),Bc=e=>hc.test(e),jc=e=>Kc(e,Gc),Hc=e=>Kc(e,Jc),Fc=e=>Kc(e,qc),Vc=e=>Kc(e,Zc),Wc=e=>Kc(e,Uc),Yc=e=>Kc(e,eu,!0),Xc=(e,t,n)=>{const o=pc.exec(e);return!!o&&(o[1]?t(o[1]):n(o[2]))},Kc=(e,t,n=!1)=>{const o=hc.exec(e);return!!o&&(o[1]?t(o[1]):n)},qc=e=>"position"===e||"percentage"===e,Uc=e=>"image"===e||"url"===e,Zc=e=>"length"===e||"size"===e||"bg-size"===e,Gc=e=>"length"===e,Qc=e=>"number"===e,Jc=e=>"family-name"===e,eu=e=>"shadow"===e,tu=dc(()=>{const e=fc("color"),t=fc("font"),n=fc("text"),o=fc("font-weight"),r=fc("tracking"),a=fc("leading"),i=fc("breakpoint"),s=fc("container"),l=fc("spacing"),c=fc("radius"),u=fc("shadow"),d=fc("inset-shadow"),f=fc("text-shadow"),p=fc("drop-shadow"),h=fc("blur"),m=fc("perspective"),g=fc("aspect"),y=fc("ease"),v=fc("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Bc,Dc],w=()=>[Bc,Dc,l],x=()=>[xc,"full","auto",...w()],E=()=>[Sc,"none","subgrid",Bc,Dc],S=()=>["auto",{span:["full",Sc,Bc,Dc]},Sc,Bc,Dc],_=()=>[Sc,"auto",Bc,Dc],k=()=>["auto","min","max","fr",Bc,Dc],C=()=>["auto",...w()],N=()=>[xc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],M=()=>[e,Bc,Dc],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Fc,zc,{position:[Bc,Dc]}],P=()=>["auto","cover","contain",Vc,Ac,{size:[Bc,Dc]}],R=()=>[_c,jc,Tc],A=()=>["","none","full",c,Bc,Dc],D=()=>["",Ec,jc,Tc],T=()=>[Ec,_c,Fc,zc],I=()=>["","none",h,Bc,Dc],z=()=>["none",Ec,Bc,Dc],L=()=>["none",Ec,Bc,Dc],$=()=>[Ec,Bc,Dc],B=()=>[xc,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[kc],breakpoint:[kc],color:[Cc],container:[kc],"drop-shadow":[kc],ease:["in","out","in-out"],font:[Rc],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[kc],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[kc],shadow:[kc],spacing:["px",Ec],text:[kc],"text-shadow":[kc],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xc,Dc,Bc,g]}],container:["container"],columns:[{columns:[Ec,Dc,Bc,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[Sc,"auto",Bc,Dc]}],basis:[{basis:[xc,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ec,xc,"auto","initial","none",Dc]}],grow:[{grow:["",Ec,Bc,Dc]}],shrink:[{shrink:["",Ec,Bc,Dc]}],order:[{order:[Sc,"first","last","none",Bc,Dc]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:N()}],w:[{w:[s,"screen",...N()]}],"min-w":[{"min-w":[s,"screen","none",...N()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...N()]}],h:[{h:["screen","lh",...N()]}],"min-h":[{"min-h":["screen","lh","none",...N()]}],"max-h":[{"max-h":["screen","lh",...N()]}],"font-size":[{text:["base",n,jc,Tc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Bc,Ic]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_c,Dc]}],"font-family":[{font:[Hc,Dc,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Bc,Dc]}],"line-clamp":[{"line-clamp":[Ec,"none",Bc,Ic]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",Bc,Dc]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Bc,Dc]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Ec,"from-font","auto",Bc,Tc]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Ec,"auto",Bc,Dc]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Bc,Dc]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Bc,Dc]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Sc,Bc,Dc],radial:["",Bc,Dc],conic:[Sc,Bc,Dc]},Wc,Lc]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:D()}],"border-w-x":[{"border-x":D()}],"border-w-y":[{"border-y":D()}],"border-w-s":[{"border-s":D()}],"border-w-e":[{"border-e":D()}],"border-w-t":[{"border-t":D()}],"border-w-r":[{"border-r":D()}],"border-w-b":[{"border-b":D()}],"border-w-l":[{"border-l":D()}],"divide-x":[{"divide-x":D()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":D()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Ec,Bc,Dc]}],"outline-w":[{outline:["",Ec,jc,Tc]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",u,Yc,$c]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",d,Yc,$c]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Ec,Tc]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":D()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",f,Yc,$c]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Ec,Bc,Dc]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ec]}],"mask-image-linear-from-pos":[{"mask-linear-from":T()}],"mask-image-linear-to-pos":[{"mask-linear-to":T()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":T()}],"mask-image-t-to-pos":[{"mask-t-to":T()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":T()}],"mask-image-r-to-pos":[{"mask-r-to":T()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":T()}],"mask-image-b-to-pos":[{"mask-b-to":T()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":T()}],"mask-image-l-to-pos":[{"mask-l-to":T()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":T()}],"mask-image-x-to-pos":[{"mask-x-to":T()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":T()}],"mask-image-y-to-pos":[{"mask-y-to":T()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Bc,Dc]}],"mask-image-radial-from-pos":[{"mask-radial-from":T()}],"mask-image-radial-to-pos":[{"mask-radial-to":T()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Ec]}],"mask-image-conic-from-pos":[{"mask-conic-from":T()}],"mask-image-conic-to-pos":[{"mask-conic-to":T()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Bc,Dc]}],filter:[{filter:["","none",Bc,Dc]}],blur:[{blur:I()}],brightness:[{brightness:[Ec,Bc,Dc]}],contrast:[{contrast:[Ec,Bc,Dc]}],"drop-shadow":[{"drop-shadow":["","none",p,Yc,$c]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Ec,Bc,Dc]}],"hue-rotate":[{"hue-rotate":[Ec,Bc,Dc]}],invert:[{invert:["",Ec,Bc,Dc]}],saturate:[{saturate:[Ec,Bc,Dc]}],sepia:[{sepia:["",Ec,Bc,Dc]}],"backdrop-filter":[{"backdrop-filter":["","none",Bc,Dc]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[Ec,Bc,Dc]}],"backdrop-contrast":[{"backdrop-contrast":[Ec,Bc,Dc]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ec,Bc,Dc]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ec,Bc,Dc]}],"backdrop-invert":[{"backdrop-invert":["",Ec,Bc,Dc]}],"backdrop-opacity":[{"backdrop-opacity":[Ec,Bc,Dc]}],"backdrop-saturate":[{"backdrop-saturate":[Ec,Bc,Dc]}],"backdrop-sepia":[{"backdrop-sepia":["",Ec,Bc,Dc]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Bc,Dc]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ec,"initial",Bc,Dc]}],ease:[{ease:["linear","initial",y,Bc,Dc]}],delay:[{delay:[Ec,Bc,Dc]}],animate:[{animate:["none",v,Bc,Dc]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Bc,Dc]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:$()}],"skew-x":[{"skew-x":$()}],"skew-y":[{"skew-y":$()}],transform:[{transform:[Bc,Dc,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Bc,Dc]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Bc,Dc]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Ec,jc,Tc,Ic]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function nu(...e){return tu(Ul(e))}function ou(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function ru(e,t){return e.length<=t?e:e.substring(0,t)+"..."}function au(e){if(null==e)return"$0.00";const t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}function iu(e){if(null==e)return"0ms";const t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"0ms":`${Math.round(t)}ms`}const su=Kl.div`
15
+ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ps=e.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:i,iconNode:s,...l},c)=>e.createElement("svg",{ref:c,...fs,width:n,height:n,stroke:t,strokeWidth:o?24*Number(r)/Number(n):r,className:us("lucide",a),...!i&&!ds(l)&&{"aria-hidden":"true"},...l},[...s.map(([t,n])=>e.createElement(t,n)),...Array.isArray(i)?i:[i]])),hs=(t,n)=>{const r=e.forwardRef(({className:r,...o},a)=>{return e.createElement(ps,{ref:a,iconNode:n,className:us(`lucide-${i=cs(t),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${t}`,r),...o});var i});return r.displayName=cs(t),r},ms=hs("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),gs=hs("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ys=hs("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),vs=hs("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),bs=hs("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ws=hs("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),xs=hs("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var Es=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),Ss="-ms-",_s="-moz-",Cs="-webkit-",ks="comm",Ns="rule",Ms="decl",Rs="@keyframes",Os=Math.abs,Ps=String.fromCharCode,As=Object.assign;function Ts(e){return e.trim()}function Ds(e,t,n){return e.replace(t,n)}function $s(e,t){return e.indexOf(t)}function Is(e,t){return 0|e.charCodeAt(t)}function zs(e,t,n){return e.slice(t,n)}function Ls(e){return e.length}function Bs(e){return e.length}function Fs(e,t){return t.push(e),e}var js=1,Hs=1,Vs=0,Ws=0,Ys=0,Xs="";function Ks(e,t,n,r,o,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:a,line:js,column:Hs,length:i,return:""}}function Us(e,t){return As(Ks("",null,null,"",null,null,0),e,{length:-e.length},t)}function qs(){return Ys=Ws>0?Is(Xs,--Ws):0,Hs--,10===Ys&&(Hs=1,js--),Ys}function Zs(){return Ys=Ws<Vs?Is(Xs,Ws++):0,Hs++,10===Ys&&(Hs=1,js++),Ys}function Gs(){return Is(Xs,Ws)}function Qs(){return Ws}function Js(e,t){return zs(Xs,e,t)}function el(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tl(e){return js=Hs=1,Vs=Ls(Xs=e),Ws=0,[]}function nl(e){return Xs="",e}function rl(e){return Ts(Js(Ws-1,il(91===e?e+2:40===e?e+1:e)))}function ol(e){for(;(Ys=Gs())&&Ys<33;)Zs();return el(e)>2||el(Ys)>3?"":" "}function al(e,t){for(;--t&&Zs()&&!(Ys<48||Ys>102||Ys>57&&Ys<65||Ys>70&&Ys<97););return Js(e,Qs()+(t<6&&32==Gs()&&32==Zs()))}function il(e){for(;Zs();)switch(Ys){case e:return Ws;case 34:case 39:34!==e&&39!==e&&il(Ys);break;case 40:41===e&&il(e);break;case 92:Zs()}return Ws}function sl(e,t){for(;Zs()&&e+Ys!==57&&(e+Ys!==84||47!==Gs()););return"/*"+Js(t,Ws-1)+"*"+Ps(47===e?e:Zs())}function ll(e){for(;!el(Gs());)Zs();return Js(e,Ws)}function cl(e){return nl(ul("",null,null,null,[""],e=tl(e),0,[0],e))}function ul(e,t,n,r,o,a,i,s,l){for(var c=0,u=0,d=i,f=0,p=0,h=0,m=1,g=1,y=1,v=0,b="",w=o,x=a,E=r,S=b;g;)switch(h=v,v=Zs()){case 40:if(108!=h&&58==Is(S,d-1)){-1!=$s(S+=Ds(rl(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:S+=rl(v);break;case 9:case 10:case 13:case 32:S+=ol(h);break;case 92:S+=al(Qs()-1,7);continue;case 47:switch(Gs()){case 42:case 47:Fs(fl(sl(Zs(),Qs()),t,n),l);break;default:S+="/"}break;case 123*m:s[c++]=Ls(S)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(S=Ds(S,/\f/g,"")),p>0&&Ls(S)-d&&Fs(p>32?pl(S+";",r,n,d-1):pl(Ds(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(Fs(E=dl(S,t,n,c,u,o,s,b,w=[],x=[],d),a),123===v)if(0===u)ul(S,t,E,E,w,a,d,s,x);else switch(99===f&&110===Is(S,3)?100:f){case 100:case 108:case 109:case 115:ul(e,E,E,r&&Fs(dl(e,E,E,0,0,o,s,b,o,w=[],d),x),o,x,d,s,r?w:x);break;default:ul(S,E,E,E,[""],x,0,s,x)}}c=u=p=0,m=y=1,b=S="",d=i;break;case 58:d=1+Ls(S),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==qs())continue;switch(S+=Ps(v),v*m){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(Ls(S)-1)*y,y=1;break;case 64:45===Gs()&&(S+=rl(Zs())),f=Gs(),u=d=Ls(b=S+=ll(Qs())),v++;break;case 45:45===h&&2==Ls(S)&&(m=0)}}return a}function dl(e,t,n,r,o,a,i,s,l,c,u){for(var d=o-1,f=0===o?a:[""],p=Bs(f),h=0,m=0,g=0;h<r;++h)for(var y=0,v=zs(e,d+1,d=Os(m=i[h])),b=e;y<p;++y)(b=Ts(m>0?f[y]+" "+v:Ds(v,/&\f/g,f[y])))&&(l[g++]=b);return Ks(e,t,n,0===o?Ns:s,l,c,u)}function fl(e,t,n){return Ks(e,t,n,ks,Ps(Ys),zs(e,2,-2),0)}function pl(e,t,n,r){return Ks(e,t,n,Ms,zs(e,0,r),zs(e,r+1,-1),r)}function hl(e,t){for(var n="",r=Bs(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function ml(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ms:return e.return=e.return||e.value;case ks:return"";case Rs:return e.return=e.value+"{"+hl(e.children,r)+"}";case Ns:e.value=e.props.join(",")}return Ls(n=hl(e.children,r))?e.return=e.value+"{"+n+"}":""}var gl=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}};function yl(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var vl=function(e,t,n){for(var r=0,o=0;r=o,o=Gs(),38===r&&12===o&&(t[n]=1),!el(o);)Zs();return Js(e,Ws)},bl=function(e,t){return nl(function(e,t){var n=-1,r=44;do{switch(el(r)){case 0:38===r&&12===Gs()&&(t[n]=1),e[n]+=vl(Ws-1,t,n);break;case 2:e[n]+=rl(r);break;case 4:if(44===r){e[++n]=58===Gs()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Ps(r)}}while(r=Zs());return e}(tl(e),t))},wl=new WeakMap,xl=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||wl.get(n))&&!r){wl.set(e,!0);for(var o=[],a=bl(t,o),i=n.props,s=0,l=0;s<a.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=o[s]?a[s].replace(/&\f/g,i[c]):i[c]+" "+a[s]}}},El=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Sl(e,t){switch(function(e,t){return 45^Is(e,0)?(((t<<2^Is(e,0))<<2^Is(e,1))<<2^Is(e,2))<<2^Is(e,3):0}(e,t)){case 5103:return Cs+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Cs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Cs+e+_s+e+Ss+e+e;case 6828:case 4268:return Cs+e+Ss+e+e;case 6165:return Cs+e+Ss+"flex-"+e+e;case 5187:return Cs+e+Ds(e,/(\w+).+(:[^]+)/,Cs+"box-$1$2"+Ss+"flex-$1$2")+e;case 5443:return Cs+e+Ss+"flex-item-"+Ds(e,/flex-|-self/,"")+e;case 4675:return Cs+e+Ss+"flex-line-pack"+Ds(e,/align-content|flex-|-self/,"")+e;case 5548:return Cs+e+Ss+Ds(e,"shrink","negative")+e;case 5292:return Cs+e+Ss+Ds(e,"basis","preferred-size")+e;case 6060:return Cs+"box-"+Ds(e,"-grow","")+Cs+e+Ss+Ds(e,"grow","positive")+e;case 4554:return Cs+Ds(e,/([^-])(transform)/g,"$1"+Cs+"$2")+e;case 6187:return Ds(Ds(Ds(e,/(zoom-|grab)/,Cs+"$1"),/(image-set)/,Cs+"$1"),e,"")+e;case 5495:case 3959:return Ds(e,/(image-set\([^]*)/,Cs+"$1$`$1");case 4968:return Ds(Ds(e,/(.+:)(flex-)?(.*)/,Cs+"box-pack:$3"+Ss+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Cs+e+e;case 4095:case 3583:case 4068:case 2532:return Ds(e,/(.+)-inline(.+)/,Cs+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ls(e)-1-t>6)switch(Is(e,t+1)){case 109:if(45!==Is(e,t+4))break;case 102:return Ds(e,/(.+:)(.+)-([^]+)/,"$1"+Cs+"$2-$3$1"+_s+(108==Is(e,t+3)?"$3":"$2-$3"))+e;case 115:return~$s(e,"stretch")?Sl(Ds(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Is(e,t+1))break;case 6444:switch(Is(e,Ls(e)-3-(~$s(e,"!important")&&10))){case 107:return Ds(e,":",":"+Cs)+e;case 101:return Ds(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Cs+(45===Is(e,14)?"inline-":"")+"box$3$1"+Cs+"$2$3$1"+Ss+"$2box$3")+e}break;case 5936:switch(Is(e,t+11)){case 114:return Cs+e+Ss+Ds(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Cs+e+Ss+Ds(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Cs+e+Ss+Ds(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Cs+e+Ss+e+e}return e}var _l=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ms:e.return=Sl(e.value,e.length);break;case Rs:return hl([Us(e,{value:Ds(e.value,"@","@"+Cs)})],r);case Ns:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return hl([Us(e,{props:[Ds(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return hl([Us(e,{props:[Ds(t,/:(plac\w+)/,":"+Cs+"input-$1")]}),Us(e,{props:[Ds(t,/:(plac\w+)/,":-moz-$1")]}),Us(e,{props:[Ds(t,/:(plac\w+)/,Ss+"input-$1")]})],r)}return""})}}],Cl=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,o,a=e.stylisPlugins||_l,i={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u=[ml,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=Bs(e);return function(n,r,o,a){for(var i="",s=0;s<t;s++)i+=e[s](n,r,o,a)||"";return i}}([xl,El].concat(a,u));o=function(e,t,n,r){l=n,hl(cl(e?e+"{"+t.styles+"}":t.styles),d),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Es({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:o};return f.sheet.hydrate(s),f};function kl(){return kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kl.apply(null,arguments)}var Nl,Ml={exports:{}},Rl={};var Ol,Pl={};"production"===process.env.NODE_ENV?Ml.exports=function(){if(Nl)return Rl;Nl=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case l:case c:case r:case a:case o:case d:return e;default:switch(e=e&&e.$$typeof){case s:case u:case h:case p:case i:return e;default:return f}}case n:return f}}}function w(e){return b(e)===c}return Rl.AsyncMode=l,Rl.ConcurrentMode=c,Rl.ContextConsumer=s,Rl.ContextProvider=i,Rl.Element=t,Rl.ForwardRef=u,Rl.Fragment=r,Rl.Lazy=h,Rl.Memo=p,Rl.Portal=n,Rl.Profiler=a,Rl.StrictMode=o,Rl.Suspense=d,Rl.isAsyncMode=function(e){return w(e)||b(e)===l},Rl.isConcurrentMode=w,Rl.isContextConsumer=function(e){return b(e)===s},Rl.isContextProvider=function(e){return b(e)===i},Rl.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Rl.isForwardRef=function(e){return b(e)===u},Rl.isFragment=function(e){return b(e)===r},Rl.isLazy=function(e){return b(e)===h},Rl.isMemo=function(e){return b(e)===p},Rl.isPortal=function(e){return b(e)===n},Rl.isProfiler=function(e){return b(e)===a},Rl.isStrictMode=function(e){return b(e)===o},Rl.isSuspense=function(e){return b(e)===d},Rl.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===a||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===i||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===v||e.$$typeof===m)},Rl.typeOf=b,Rl}():Ml.exports=(Ol||(Ol=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var m=e.type;switch(m){case l:case c:case r:case a:case o:case d:return m;default:var g=m&&m.$$typeof;switch(g){case s:case u:case h:case p:case i:return g;default:return f}}case n:return f}}}var w=l,x=c,E=s,S=i,_=t,C=u,k=r,N=h,M=p,R=n,O=a,P=o,A=d,T=!1;function D(e){return b(e)===c}Pl.AsyncMode=w,Pl.ConcurrentMode=x,Pl.ContextConsumer=E,Pl.ContextProvider=S,Pl.Element=_,Pl.ForwardRef=C,Pl.Fragment=k,Pl.Lazy=N,Pl.Memo=M,Pl.Portal=R,Pl.Profiler=O,Pl.StrictMode=P,Pl.Suspense=A,Pl.isAsyncMode=function(e){return T||(T=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(e)||b(e)===l},Pl.isConcurrentMode=D,Pl.isContextConsumer=function(e){return b(e)===s},Pl.isContextProvider=function(e){return b(e)===i},Pl.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Pl.isForwardRef=function(e){return b(e)===u},Pl.isFragment=function(e){return b(e)===r},Pl.isLazy=function(e){return b(e)===h},Pl.isMemo=function(e){return b(e)===p},Pl.isPortal=function(e){return b(e)===n},Pl.isProfiler=function(e){return b(e)===a},Pl.isStrictMode=function(e){return b(e)===o},Pl.isSuspense=function(e){return b(e)===d},Pl.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===a||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===i||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===v||e.$$typeof===m)},Pl.typeOf=b}()),Pl);var Al=Ml.exports,Tl={};Tl[Al.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Tl[Al.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};function Dl(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}var $l=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Il=function(e,t,n){$l(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}};var zl={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ll=/[A-Z]|^ms/g,Bl=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Fl=function(e){return 45===e.charCodeAt(1)},jl=function(e){return null!=e&&"boolean"!=typeof e},Hl=yl(function(e){return Fl(e)?e:e.replace(Ll,"-$&").toLowerCase()}),Vl=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Bl,function(e,t,n){return Yl={name:t,styles:n,next:Yl},t})}return 1===zl[e]||Fl(e)||"number"!=typeof t||0===t?t:t+"px"};function Wl(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return Yl={name:o.name,styles:o.styles,next:Yl},o.name;var a=n;if(void 0!==a.styles){var i=a.next;if(void 0!==i)for(;void 0!==i;)Yl={name:i.name,styles:i.styles,next:Yl},i=i.next;return a.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Wl(e,t,n[o])+";";else for(var a in n){var i=n[a];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?r+=a+"{"+t[s]+"}":jl(s)&&(r+=Hl(a)+":"+Vl(a,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=Wl(e,t,i);switch(a){case"animation":case"animationName":r+=Hl(a)+":"+l+";";break;default:r+=a+"{"+l+"}"}}else for(var c=0;c<i.length;c++)jl(i[c])&&(r+=Hl(a)+":"+Vl(a,i[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=Yl,l=n(e);return Yl=s,Wl(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Yl,Xl=/label:\s*([^\s;{]+)\s*(;|$)/g;function Kl(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";Yl=void 0;var a=e[0];null==a||void 0===a.raw?(r=!1,o+=Wl(n,t,a)):o+=a[0];for(var i=1;i<e.length;i++){if(o+=Wl(n,t,e[i]),r)o+=a[i]}Xl.lastIndex=0;for(var s,l="";null!==(s=Xl.exec(o));)l+="-"+s[1];var c=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:Yl}}var Ul=!!o.useInsertionEffect&&o.useInsertionEffect,ql=Ul||function(e){return e()},Zl=Ul||o.useLayoutEffect,Gl=o.createContext("undefined"!=typeof HTMLElement?Cl({key:"css"}):null);Gl.Provider;var Ql,Jl,ec=function(t){return e.forwardRef(function(n,r){var o=e.useContext(Gl);return t(n,o,r)})},tc=o.createContext({}),nc=gl(function(e){return gl(function(t){return function(e,t){return"function"==typeof t?t(e):kl({},e,t)}(e,t)})}),rc=function(e){var t=o.useContext(tc);return e.theme!==t&&(t=nc(t)(e.theme)),o.createElement(tc.Provider,{value:t},e.children)},oc={}.hasOwnProperty,ac="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",ic=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return $l(t,n,r),ql(function(){return Il(t,n,r)}),null},sc=ec(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var a=e[ac],i=[r],s="";"string"==typeof e.className?s=Dl(t.registered,i,e.className):null!=e.className&&(s=e.className+" ");var l=Kl(i,void 0,o.useContext(tc));s+=t.key+"-"+l.name;var c={};for(var u in e)oc.call(e,u)&&"css"!==u&&u!==ac&&(c[u]=e[u]);return c.className=s,n&&(c.ref=n),o.createElement(o.Fragment,null,o.createElement(ic,{cache:t,serialized:l,isStringTag:"string"==typeof a}),o.createElement(a,c))}),lc=sc,cc=function(e,t){var n=arguments;if(null==t||!oc.call(t,"css"))return o.createElement.apply(void 0,n);var r=n.length,a=new Array(r);a[0]=lc,a[1]=function(e,t){var n={};for(var r in t)oc.call(t,r)&&(n[r]=t[r]);return n[ac]=e,n}(e,t);for(var i=2;i<r;i++)a[i]=n[i];return o.createElement.apply(null,a)};Ql=cc||(cc={}),Jl||(Jl=Ql.JSX||(Ql.JSX={}));var uc=ec(function(e,t){var n=Kl([e.styles],void 0,o.useContext(tc)),r=o.useRef();return Zl(function(){var e=t.key+"-global",o=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),a=!1,i=document.querySelector('style[data-emotion="'+e+" "+n.name+'"]');return t.sheet.tags.length&&(o.before=t.sheet.tags[0]),null!==i&&(a=!0,i.setAttribute("data-emotion",e),o.hydrate([i])),r.current=[o,a],function(){o.flush()}},[t]),Zl(function(){var e=r.current,o=e[0];if(e[1])e[1]=!1;else{if(void 0!==n.next&&Il(t,n.next,!0),o.tags.length){var a=o.tags[o.tags.length-1].nextElementSibling;o.before=a,o.flush()}t.insert("",n,o,!1)}},[t,n.name]),null});function dc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Kl(t)}const fc={colors:{background:"hsl(0 0% 100%)",foreground:"hsl(222.2 84% 4.9%)",card:"hsl(0 0% 100%)",cardForeground:"hsl(222.2 84% 4.9%)",popover:"hsl(0 0% 100%)",popoverForeground:"hsl(222.2 84% 4.9%)",primary:"hsl(221.2 83.2% 53.3%)",primaryForeground:"hsl(210 40% 98%)",secondary:"hsl(210 40% 96%)",secondaryForeground:"hsl(222.2 84% 4.9%)",muted:"hsl(210 40% 96%)",mutedForeground:"hsl(215.4 16.3% 46.9%)",accent:"hsl(210 40% 96%)",accentForeground:"hsl(222.2 84% 4.9%)",destructive:"hsl(0 84.2% 60.2%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(214.3 31.8% 91.4%)",mutedBorder:"hsl(214.3 31.8% 91.4%)",input:"hsl(214.3 31.8% 91.4%)",ring:"hsl(221.2 83.2% 53.3%)"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{sm:"calc(var(--radius) - 4px)",md:"calc(var(--radius) - 2px)",lg:"var(--radius)",xl:"0.75rem"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"},transitions:{fast:"0.15s ease-in-out",normal:"0.2s ease-in-out",slow:"0.3s ease-in-out"}},pc={colors:{background:"hsl(222.2 84% 4.9%)",foreground:"hsl(210 40% 98%)",card:"hsl(222.2 84% 4.9%)",cardForeground:"hsl(210 40% 98%)",popover:"hsl(222.2 84% 4.9%)",popoverForeground:"hsl(210 40% 98%)",primary:"hsl(217.2 91.2% 59.8%)",primaryForeground:"hsl(222.2 84% 4.9%)",secondary:"hsl(217.2 32.6% 17.5%)",secondaryForeground:"hsl(210 40% 98%)",muted:"hsl(217.2 32.6% 17.5%)",mutedForeground:"hsl(215 20.2% 65.1%)",accent:"hsl(217.2 32.6% 17.5%)",accentForeground:"hsl(210 40% 98%)",destructive:"hsl(0 62.8% 30.6%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(217.2 32.6% 17.5%)",mutedBorder:"hsl(217.2 32.6% 5%)",input:"hsl(217.2 32.6% 17.5%)",ring:"hsl(224.3 76.3% 94.1%)"},spacing:fc.spacing,borderRadius:fc.borderRadius,fontSize:fc.fontSize,fontWeight:fc.fontWeight,shadows:fc.shadows,transitions:fc.transitions},hc=fc,mc=e.createContext(void 0),gc=({children:t,theme:n})=>{const[r,o]=e.useState(()=>{if(n)return n;return"dark"===localStorage.getItem("theme")?pc:fc});e.useEffect(()=>{const e=()=>{const e=localStorage.getItem("theme");o("dark"===e?pc:fc)};if(window.addEventListener("storage",e),!n){const e=localStorage.getItem("theme");o("dark"===e?pc:fc)}return()=>{window.removeEventListener("storage",e)}},[n]),e.useEffect(()=>{n&&o(n)},[n]);const a=e.useMemo(()=>({theme:r,setTheme:o}),[r]);return e.createElement(mc.Provider,{value:a},e.createElement(rc,{theme:r},t))},yc=()=>{const t=e.useContext(mc);return void 0===t?{theme:hc,setTheme:()=>{console.warn("Theme context not available. setTheme called but ignored.")}}:t},vc=({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:i,targetPosition:s,style:l={},markerEnd:c,bidirectional:u=!1,data:d,clientToSvgCoords:f,svgRef:p})=>{e.useState(!1);const{theme:h}=yc(),[m,g,y]=e.useMemo(()=>mo({sourceX:n,sourceY:r,targetX:o,targetY:a}),[n,r,o,a]),v={...l,stroke:(()=>{const e=d?.details?.state;switch(e){case"Open":case"Completed":default:return h.colors.mutedForeground;case"Error":return h.colors.destructive}})(),strokeWidth:l.strokeWidth||2};return e.createElement(e.Fragment,null,e.createElement(Xr,{path:m,style:v}))};var bc=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,wc=yl(function(e){return bc.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),xc=function(e){return"theme"!==e},Ec=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?wc:xc},Sc=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},_c=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return $l(t,n,r),ql(function(){return Il(t,n,r)}),null},Cc=function e(t,n){var r,a,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,a=n.target);var l=Sc(t,n,i),c=l||Ec(s),u=!c("as");return function(){var d=arguments,f=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&f.push("label:"+r+";"),null==d[0]||void 0===d[0].raw)f.push.apply(f,d);else{var p=d[0];f.push(p[0]);for(var h=d.length,m=1;m<h;m++)f.push(d[m],p[m])}var g=ec(function(e,t,n){var r=u&&e.as||s,i="",d=[],p=e;if(null==e.theme){for(var h in p={},e)p[h]=e[h];p.theme=o.useContext(tc)}"string"==typeof e.className?i=Dl(t.registered,d,e.className):null!=e.className&&(i=e.className+" ");var m=Kl(f.concat(d),t.registered,p);i+=t.key+"-"+m.name,void 0!==a&&(i+=" "+a);var g=u&&void 0===l?Ec(r):c,y={};for(var v in e)u&&"as"===v||g(v)&&(y[v]=e[v]);return y.className=i,n&&(y.ref=n),o.createElement(o.Fragment,null,o.createElement(_c,{cache:t,serialized:m,isStringTag:"string"==typeof r}),o.createElement(r,y))});return g.displayName=void 0!==r?r:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=s,g.__emotion_styles=f,g.__emotion_forwardProp=l,Object.defineProperty(g,"toString",{value:function(){return"."+a}}),g.withComponent=function(t,r){return e(t,kl({},n,r,{shouldForwardProp:Sc(g,r,!0)})).apply(void 0,f)},g}}.bind(null);function kc(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=kc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Nc(e){return e.split(/[-_\s]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function Mc(e){return null==e?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(e)}function Rc(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;return`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`}function Oc(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){Cc[e]=Cc(e)});const Pc=Cc.div`
16
16
  display: inline-flex;
17
17
  align-items: center;
18
18
  border-radius: 9999px;
@@ -28,13 +28,92 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
28
28
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
29
29
  }
30
30
 
31
- ${({variant:e})=>{switch(e){case"default":default:return"\n background-color: #6366f1;\n color: white;\n &:hover {\n background-color: #5855eb;\n }\n ";case"secondary":return"\n background-color: #f3f4f6;\n color: #374151;\n &:hover {\n background-color: #e5e7eb;\n }\n ";case"destructive":return"\n background-color: #ef4444;\n color: white;\n &:hover {\n background-color: #dc2626;\n }\n ";case"outline":return"\n background-color: transparent;\n color: #374151;\n border-color: #d1d5db;\n ";case"cost":case"gray":return"\n background-color: #f3f4f6;\n color: #1f2937;\n &:hover {\n background-color: #e5e7eb;\n }\n ";case"latency":return"\n background-color: #dbeafe;\n color: #1e40af;\n &:hover {\n background-color: #bfdbfe;\n }\n ";case"latencyLow":return"\n background-color: #dcfce7;\n color: #166534;\n &:hover {\n background-color: #bbf7d0;\n }\n ";case"latencyMedium":return"\n background-color: #fed7aa;\n color: #c2410c;\n &:hover {\n background-color: #fdba74;\n }\n ";case"latencyHigh":return"\n background-color: #fecaca;\n color: #dc2626;\n &:hover {\n background-color: #fca5a5;\n }\n "}}}
32
- `;function lu({className:e,variant:t="default",...n}){return r.createElement(su,{variant:t,className:e,...n})}const cu=(e,t=["input","output"])=>Object.entries(e).sort(([e],[n])=>{const o=t.indexOf(e),r=t.indexOf(n);return-1!==o&&-1!==r?o-r:-1!==o?-1:-1!==r?1:e.localeCompare(n)}),uu=({data:t,label:n,depth:o,maxDepth:r,path:a,priorityKeys:i})=>{const[s,l]=e.useState(!1),c=null!==t&&"object"==typeof t&&!Array.isArray(t),u=Array.isArray(t),d=(c||u)&&o<r,f=d&&Object.keys(t).length>0;return e.createElement("div",{className:"select-none"},e.createElement("div",{className:"flex items-center gap-1 py-1 px-2 hover:bg-gray-50 rounded cursor-pointer transition-colors duration-150 "+(d?"hover:bg-gray-50":""),onClick:()=>{d&&l(!s)},style:{paddingLeft:12*o+8+"px"}},d&&f?s?e.createElement(gs,{className:"w-3 h-3 text-gray-500 flex-shrink-0"}):e.createElement(ys,{className:"w-3 h-3 text-gray-500 flex-shrink-0"}):e.createElement("div",{className:"w-3 h-3 flex-shrink-0"}),e.createElement("span",{className:"font-medium text-gray-800 text-xs"},n,":"),!d&&e.createElement("span",{className:"text-xs "+(p=t,null==p?"text-gray-500":"string"==typeof p?"text-green-600":"number"==typeof p?"text-blue-600":"boolean"==typeof p?"text-purple-600":"text-gray-700")},(e=>null===e?"null":void 0===e?"undefined":"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?e.toString():Array.isArray(e)?`Array(${e.length})`:"object"==typeof e?`Object(${Object.keys(e).length})`:String(e))(t)),d&&!f&&e.createElement("span",{className:"text-xs text-gray-500"},u?"[]":"{}"),d&&f&&!s&&e.createElement("span",{className:"text-xs text-gray-500"},u?`[${Object.keys(t).length} items]`:`{${Object.keys(t).length} keys}`)),s&&f&&e.createElement("div",{className:"border-l border-gray-200 ml-3"},cu(t,i).map(([t,n])=>e.createElement(uu,{key:`${a}.${t}`,data:n,label:t,depth:o+1,maxDepth:r,path:`${a}.${t}`,priorityKeys:i}))));var p},du=({data:t,maxDepth:n=4,initialExpanded:o=!1,className:r="",priorityKeys:a=["input","output"]})=>null==t?e.createElement("div",{className:`text-xs text-gray-500 italic ${r}`},"No data available"):"object"!=typeof t?e.createElement("div",{className:`text-xs ${r}`},e.createElement("span",{className:"font-medium text-gray-800"},"Value:")," ",e.createElement("span",{className:"text-gray-600"},String(t))):0===Object.keys(t).length?e.createElement("div",{className:`w-full bg-gray-50 rounded border border-gray-200 p-4 text-center ${r}`},e.createElement("div",{className:"text-xs text-gray-500 italic"},Array.isArray(t)?"Empty array":"Empty object")):e.createElement("div",{className:`w-full bg-gray-50 rounded border border-gray-200 overflow-hidden ${r}`},e.createElement("div",{className:"w-full max-h-64 overflow-y-auto"},cu(t,a).map(([t,o])=>e.createElement(uu,{key:t,data:o,label:t,depth:0,maxDepth:n,path:t,priorityKeys:a})))),fu=({className:t="w-6 h-6"})=>e.createElement("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24",role:"img",xmlns:"http://www.w3.org/2000/svg"},e.createElement("title",null,"OpenAI icon"),e.createElement("path",{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})),pu=({className:t="w-6 h-6"})=>e.createElement("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",height:"24",width:"24"},e.createElement("path",{fill:"currentColor",d:"m13.788825 3.932 6.43325 16.136075h3.5279L17.316725 3.932H13.788825Z",strokeWidth:"0.25"}),e.createElement("path",{fill:"currentColor",d:"m6.325375 13.682775 2.20125 -5.67065 2.201275 5.67065H6.325375ZM6.68225 3.932 0.25 20.068075h3.596525l1.3155 -3.3886h6.729425l1.315275 3.3886h3.59655L10.371 3.932H6.68225Z",strokeWidth:"0.25"})),hu=({className:t="w-6 h-6"})=>e.createElement("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},e.createElement("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),e.createElement("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),e.createElement("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),e.createElement("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"}),e.createElement("path",{d:"M1 1h22v22H1z",fill:"none"})),mu=({label:t,content:n,isExpanded:o,onToggle:r})=>{const a=o?n:n?.slice(0,100)+(n?.length>100?"...":"");return e.createElement(_u,null,e.createElement(ku,{onClick:r},e.createElement(Cu,null,t),e.createElement(Mu,null,o?e.createElement(gs,{style:{width:"12px",height:"12px",color:"#6b7280"}}):e.createElement(ys,{style:{width:"12px",height:"12px",color:"#6b7280"}}))),e.createElement(Nu,{value:a||"",readOnly:!0,rows:o?Math.max(3,Math.max(n?.split("\n").length||0,Math.ceil((n?.length||0)/60))):2}))},gu=({data:t,id:n})=>{ka();const[o,r]=e.useState(!1),[a,i]=e.useState(!1),s=t.edges?.some(e=>e.source===n)||!1,l=t.edges?.some(e=>e.target===n)||!1,c=t.nodeType||"Agent",u=t.label||ou(c)||"Agent",d=t.details?.internals?.llm_details?.[0]?.model_provider,f=((t,n)=>{if("tool"===t)return"🔧";if("coordinator"===t)return"🎯";if("agent"===t){if("OpenAI"===n)return e.createElement(fu,null);if("Anthropic"===n)return e.createElement(pu,null);if("Google"===n||"Vertex_AI"===n)return e.createElement(hu,null)}return"🤖"})(c.toLowerCase(),d),p=t.details?.internals?.llm_details?.[0]?.model_name||"Unknown",h=au(t.details?.internals?.llm_details?.[0]?.total_cost),m=t.details?.internals?.llm_details?.[0]?.input?.[0]?.content||"",g=t.details?.internals?.llm_details?.[0]?.input?.[1]?.content||"",y=t.details?.internals?.latency?.total_time;return e.createElement(yu,{onClick:()=>{console.log("Node clicked:",{label:t.label,nodeType:t.nodeType,details:t.details})}},l&&e.createElement(Hr,{type:"target",position:nr.Top,style:{width:"8px",height:"8px",border:"2px solid #6366f1",backgroundColor:"white",cursor:"default"},isConnectable:!1}),e.createElement(vu,null,e.createElement(bu,null,e.createElement(wu,null,f),e.createElement(xu,null,u)),"Agent"===c&&e.createElement(Eu,null,e.createElement(lu,{variant:"gray"},p),e.createElement(lu,{variant:"cost"},h)),"Tool"===c&&y&&e.createElement(Eu,null,e.createElement(lu,{variant:"latency"},iu(y))),"Coordinator"===c&&e.createElement(Eu,null,e.createElement(lu,{variant:"gray"},"Coordinator"))),e.createElement(Su,null,"Agent"===c?e.createElement(e.Fragment,null,e.createElement(mu,{label:"System Message",content:m,isExpanded:o,onToggle:()=>r(!o)}),e.createElement(mu,{label:"User Message",content:g,isExpanded:a,onToggle:()=>i(!a)})):"Tool"===c?e.createElement(du,{data:(()=>{const e=t.details?.internals||{};return t.edgeDetails&&t.edgeDetails.length>0?{...e,input:{args:t.edgeDetails[0]?.input_args,kwargs:t.edgeDetails[0]?.input_kwargs},output:t.edgeDetails[0]?.output,state:t.edgeDetails[0]?.state,status:t.edgeDetails[0]?.status}:e})()}):"Coordinator"===c?e.createElement(du,{data:t.details?.internals||{}}):null),s&&e.createElement(Hr,{type:"source",position:nr.Bottom,style:{width:"8px",height:"8px",border:"2px solid #6366f1",backgroundColor:"white",cursor:"default"},isConnectable:!1}))},yu=Kl.div`
31
+ ${({variant:e,theme:t})=>{switch(e){case"default":default:return`\n background-color: ${t.colors.primary};\n color: ${t.colors.primaryForeground};\n &:hover {\n background-color: ${t.colors.primary};\n opacity: 0.9;\n }\n `;case"secondary":case"cost":case"gray":case"latency":case"latencyLow":case"latencyMedium":return`\n background-color: ${t.colors.secondary};\n color: ${t.colors.secondaryForeground};\n &:hover {\n background-color: ${t.colors.muted};\n }\n `;case"destructive":case"latencyHigh":return`\n background-color: ${t.colors.destructive};\n color: ${t.colors.destructiveForeground};\n &:hover {\n background-color: ${t.colors.destructive};\n opacity: 0.9;\n }\n `;case"outline":return`\n background-color: transparent;\n color: ${t.colors.cardForeground};\n border-color: ${t.colors.border};\n `}}}
32
+ `;function Ac({className:e,variant:t="default",...n}){return o.createElement(Pc,{variant:t,className:e,...n})}const Tc=Cc.div`
33
+ user-select: none;
34
+ `,Dc=Cc.div`
35
+ display: flex;
36
+ align-items: center;
37
+ gap: 0.25rem;
38
+ padding: 0.25rem 0.5rem;
39
+ border-radius: 0.25rem;
40
+ cursor: ${e=>e.isExpandable?"pointer":"default"};
41
+ transition: background-color 0.15s ease-in-out;
42
+
43
+ &:hover {
44
+ background-color: ${e=>e.isExpandable?e.theme.colors.muted:"transparent"};
45
+ }
46
+ `,$c=Cc.div`
47
+ width: 0.5rem;
48
+ height: 0.5rem;
49
+ flex-shrink: 0;
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ color: ${e=>e.theme.colors.mutedForeground};
54
+ `,Ic=Cc.span`
55
+ font-weight: 500;
56
+ color: ${e=>e.theme.colors.foreground};
57
+ font-size: 0.75rem;
58
+ `,zc=Cc.span`
59
+ font-size: 0.75rem;
60
+ color: ${e=>e.theme.colors.primary};
61
+ `,Lc=Cc.span`
62
+ font-size: 0.75rem;
63
+ color: ${e=>e.theme.colors.mutedForeground};
64
+ `,Bc=Cc.div`
65
+ border-left: 1px solid ${e=>e.theme.colors.border};
66
+ margin-left: 0.5rem;
67
+ `,Fc=Cc.div`
68
+ width: 100%;
69
+ background-color: ${e=>e.theme.colors.muted};
70
+ border-radius: 0.5rem;
71
+ border: 1px solid ${e=>e.theme.colors.border};
72
+ overflow: hidden;
73
+ `,jc=Cc.div`
74
+ width: 100%;
75
+ max-height: 16rem;
76
+ overflow-y: auto;
77
+ padding: 0.5rem;
78
+ `,Hc=Cc.div`
79
+ width: 100%;
80
+ padding: 1rem;
81
+ text-align: center;
82
+ color: ${e=>e.theme.colors.mutedForeground};
83
+ font-size: 0.875rem;
84
+ background-color: ${e=>e.theme.colors.muted};
85
+ border-radius: 0.5rem;
86
+ border: 1px solid ${e=>e.theme.colors.border};
87
+ `,Vc=Cc.div`
88
+ width: 100%;
89
+ padding: 0.5rem;
90
+ background-color: ${e=>e.theme.colors.muted};
91
+ border-radius: 0.5rem;
92
+ border: 1px solid ${e=>e.theme.colors.border};
93
+ `,Wc=Cc.span`
94
+ font-weight: 500;
95
+ color: ${e=>e.theme.colors.cardForeground};
96
+ font-size: 0.875rem;
97
+ `,Yc=Cc.span`
98
+ color: ${e=>e.theme.colors.foreground};
99
+ font-size: 0.875rem;
100
+ `,Xc=Cc.div`
101
+ width: 100%;
102
+ padding: 1rem;
103
+ text-align: center;
104
+ color: ${e=>e.theme.colors.mutedForeground};
105
+ font-size: 0.875rem;
106
+ background-color: ${e=>e.theme.colors.muted};
107
+ border-radius: 0.5rem;
108
+ border: 1px solid ${e=>e.theme.colors.border};
109
+ `,Kc=Cc.span`
110
+ color: ${e=>e.theme.colors.mutedForeground};
111
+ `,Uc=(e,t=["input","output"])=>Object.entries(e).sort(([e],[n])=>{const r=t.indexOf(e),o=t.indexOf(n);return-1!==r&&-1!==o?r-o:-1!==r?-1:-1!==o?1:e.localeCompare(n)}),qc=({data:t,label:n,depth:r,maxDepth:o,path:a,priorityKeys:i})=>{const[s,l]=e.useState(!1),c=null!==t&&"object"==typeof t&&!Array.isArray(t),u=Array.isArray(t),d=(c||u)&&r<o,f=d&&Object.keys(t).length>0;return e.createElement(Tc,null,e.createElement(Dc,{isExpandable:d,onClick:()=>{d&&l(!s)},style:{paddingLeft:12*r+8+"px"}},e.createElement($c,null,d&&f?s?e.createElement(gs,{size:12}):e.createElement(ys,{size:12}):e.createElement("div",{style:{width:"12px",height:"12px"}})),e.createElement(Ic,null,n,":"),!d&&e.createElement(zc,{valueType:(p=t,null===p?"null":void 0===p?"undefined":typeof p)},(e=>null===e?"null":void 0===e?"undefined":"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?e.toString():Array.isArray(e)?`Array(${e.length})`:"object"==typeof e?`Object(${Object.keys(e).length})`:String(e))(t)),d&&!f&&e.createElement(Lc,null,u?"[]":"{}"),d&&f&&!s&&e.createElement(Lc,null,u?`[${Object.keys(t).length} items]`:`{${Object.keys(t).length} keys}`)),s&&f&&e.createElement(Bc,null,Uc(t,i).map(([t,n])=>e.createElement(qc,{key:`${a}.${t}`,data:n,label:t,depth:r+1,maxDepth:o,path:`${a}.${t}`,priorityKeys:i}))));var p},Zc=({data:t,maxDepth:n=4,initialExpanded:r=!1,className:o="",priorityKeys:a=["input","output"]})=>null==t?e.createElement(Hc,{className:o},"No data available"):"object"!=typeof t?e.createElement(Vc,{className:o},e.createElement(Wc,null,"Value:")," ",e.createElement(Yc,null,String(t))):0===Object.keys(t).length?e.createElement(Xc,{className:o},e.createElement(Kc,null,Array.isArray(t)?"Empty array":"Empty object")):e.createElement(Fc,{className:o},e.createElement(jc,null,Uc(t,a).map(([t,r])=>e.createElement(qc,{key:t,data:r,label:t,depth:0,maxDepth:n,path:t,priorityKeys:a})))),Gc=({width:t="1.5rem",height:n="1.5rem"})=>e.createElement("svg",{style:{width:"number"==typeof t?`${t}px`:t,height:"number"==typeof n?`${n}px`:n,display:"block"},fill:"currentColor",viewBox:"0 0 24 24",role:"img",xmlns:"http://www.w3.org/2000/svg"},e.createElement("title",null,"OpenAI icon"),e.createElement("path",{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})),Qc=({width:t="1.5rem",height:n="1.5rem"})=>e.createElement("svg",{style:{width:"number"==typeof t?`${t}px`:t,height:"number"==typeof n?`${n}px`:n},xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},e.createElement("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),e.createElement("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),e.createElement("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),e.createElement("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"}),e.createElement("path",{d:"M1 1h22v22H1z",fill:"none"})),Jc=({width:t="1.5rem",height:n="1.5rem"})=>e.createElement("svg",{style:{width:"number"==typeof t?`${t}px`:t,height:"number"==typeof n?`${n}px`:n},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",height:"24",width:"24"},e.createElement("path",{fill:"currentColor",d:"m13.788825 3.932 6.43325 16.136075h3.5279L17.316725 3.932H13.788825Z",strokeWidth:"0.25"}),e.createElement("path",{fill:"currentColor",d:"m6.325375 13.682775 2.20125 -5.67065 2.201275 5.67065H6.325375ZM6.68225 3.932 0.25 20.068075h3.596525l1.3155 -3.3886h6.729425l1.315275 3.3886h3.59655L10.371 3.932H6.68225Z",strokeWidth:"0.25"})),eu=({label:t,content:n,isExpanded:r,onToggle:o,theme:a})=>{const i=r?n:n?.slice(0,100)+(n?.length>100?"...":"");return e.createElement(cu,null,e.createElement(uu,{onClick:o,onMouseEnter:e=>{e.currentTarget.style.backgroundColor=a.colors.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},e.createElement(du,{style:{color:a.colors.mutedForeground}},t),e.createElement(pu,null,r?e.createElement(gs,{style:{width:"12px",height:"12px",color:a.colors.mutedForeground}}):e.createElement(ys,{style:{width:"12px",height:"12px",color:a.colors.mutedForeground}}))),e.createElement(fu,{theme:a,value:i||"",readOnly:!0,rows:r?Math.max(3,Math.max(n?.split("\n").length||0,Math.ceil((n?.length||0)/60))):2,style:{border:`1px solid ${a.colors.border}`,backgroundColor:a.colors.muted,color:a.colors.foreground}}))},tu=({data:t,id:n})=>{Ca();const{theme:r}=yc(),[o,a]=e.useState(!1),[i,s]=e.useState(!1),l=t.edges?.some(e=>e.source===n)||!1,c=t.edges?.some(e=>e.target===n)||!1,u=t.nodeType||"Agent",d=t.label||Nc(u)||"Agent",f=t.details?.internals?.llm_details?.[0]?.model_provider,p=((t,n)=>{if("tool"===t)return"🔧";if("coordinator"===t)return"🎯";if("agent"===t){if("OpenAI"===n)return e.createElement(Gc,null);if("Anthropic"===n)return e.createElement(Jc,null);if("Google"===n||"Vertex_AI"===n)return e.createElement(Qc,null)}return"🤖"})(u.toLowerCase(),f),h=t.details?.internals?.llm_details?.[0]?.model_name||"Unknown",m=Mc(t.details?.internals?.llm_details?.[0]?.total_cost),g=t.details?.internals?.llm_details?.[0]?.input?.[0]?.content||"",y=t.details?.internals?.llm_details?.[0]?.input?.[1]?.content||"",v=t.details?.internals?.latency?.total_time;return e.createElement(nu,{onClick:()=>{console.log("Node clicked:",{label:t.label,nodeType:t.nodeType,details:t.details})},theme:r},c&&e.createElement(jo,{type:"target",position:to.Top,style:{width:"8px",height:"8px",border:`2px solid ${r.colors.primary}`,backgroundColor:r.colors.background,cursor:"default"},isConnectable:!1}),e.createElement(ru,{theme:r},e.createElement(ou,null,e.createElement(au,null,p),e.createElement(iu,{theme:r},d)),"Agent"===u&&e.createElement(su,null,e.createElement(Ac,{variant:"gray"},h),e.createElement(Ac,{variant:"cost"},m)),"Tool"===u&&null!=v&&e.createElement(su,null,e.createElement(Ac,{variant:"latency"},Rc(v))),"Coordinator"===u&&e.createElement(su,null,e.createElement(Ac,{variant:"gray"},"Coordinator"))),e.createElement(lu,null,"Agent"===u?e.createElement(e.Fragment,null,e.createElement(eu,{label:"System Message",content:g,isExpanded:o,onToggle:()=>a(!o),theme:r}),e.createElement(eu,{label:"User Message",content:y,isExpanded:i,onToggle:()=>s(!i),theme:r})):"Tool"===u?e.createElement(Zc,{data:(()=>{const e=t.details?.internals||{};return t.edgeDetails&&t.edgeDetails.length>0?{...e,input:{args:t.edgeDetails[0]?.input_args,kwargs:t.edgeDetails[0]?.input_kwargs},output:t.edgeDetails[0]?.output,state:t.edgeDetails[0]?.state,status:t.edgeDetails[0]?.status}:e})()}):"Coordinator"===u?e.createElement(Zc,{data:t.details?.internals||{}}):null),l&&e.createElement(jo,{type:"source",position:to.Bottom,style:{width:"8px",height:"8px",border:`2px solid ${r.colors.primary}`,backgroundColor:r.colors.background,cursor:"default"},isConnectable:!1}))},nu=Cc.div`
33
112
  font-family: ui-sans-serif, system-ui, sans-serif;
34
113
  border-radius: 0.5rem;
35
- background-color: white;
36
- border: 2px solid #e5e7eb;
37
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
114
+ background-color: ${e=>e.theme.colors.card};
115
+ border: 2px solid ${e=>e.theme.colors.border};
116
+ box-shadow: ${e=>e.theme.shadows.sm};
38
117
  min-width: 300px;
39
118
  max-width: 500px;
40
119
  transition: all 0.2s ease-in-out;
@@ -42,47 +121,45 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
42
121
  cursor: pointer;
43
122
 
44
123
  &:hover {
45
- border-color: #6366f1;
46
- box-shadow:
47
- 0 4px 6px -1px rgba(0, 0, 0, 0.1),
48
- 0 2px 4px -1px rgba(0, 0, 0, 0.06);
124
+ border-color: ${e=>e.theme.colors.primary};
125
+ box-shadow: ${e=>e.theme.shadows.md};
49
126
  }
50
- `,vu=Kl.div`
127
+ `,ru=Cc.div`
51
128
  display: flex;
52
129
  justify-content: space-between;
53
130
  align-items: center;
54
131
  gap: 0.5rem;
55
132
  padding: 0.75rem;
56
- border-bottom: 1px solid #e5e7eb;
57
- `,bu=Kl.div`
133
+ border-bottom: 1px solid ${e=>e.theme.colors.border};
134
+ `,ou=Cc.div`
58
135
  display: flex;
59
136
  align-items: center;
60
137
  gap: 0.5rem;
61
- `,wu=Kl.div`
138
+ `,au=Cc.div`
62
139
  font-size: 1.25rem;
63
140
  display: flex;
64
141
  align-items: center;
65
142
  justify-content: center;
66
- `,xu=Kl.div`
143
+ `,iu=Cc.div`
67
144
  font-weight: 600;
68
- color: #1f2937;
145
+ color: ${e=>e.theme.colors.foreground};
69
146
  font-size: 0.875rem;
70
147
  word-break: break-words;
71
- `,Eu=Kl.div`
148
+ `,su=Cc.div`
72
149
  display: flex;
73
150
  gap: 0.5rem;
74
151
  justify-content: flex-end;
75
152
  align-items: center;
76
- `,Su=Kl.div`
153
+ `,lu=Cc.div`
77
154
  padding: 0.75rem;
78
155
  display: flex;
79
156
  flex-direction: column;
80
157
  align-items: flex-start;
81
158
  justify-content: center;
82
159
  gap: 0.5rem;
83
- `,_u=Kl.div`
160
+ `,cu=Cc.div`
84
161
  width: 100%;
85
- `,ku=Kl.div`
162
+ `,uu=Cc.div`
86
163
  display: flex;
87
164
  justify-content: space-between;
88
165
  align-items: center;
@@ -94,30 +171,516 @@ var fs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
94
171
  padding-right: 0.25rem;
95
172
 
96
173
  &:hover {
97
- background-color: #f9fafb;
174
+ background-color: transparent;
98
175
  }
99
- `,Cu=Kl.span`
176
+ `,du=Cc.span`
100
177
  font-weight: 600;
101
- color: #374151;
102
178
  font-size: 0.75rem;
103
- `,Nu=Kl.textarea`
179
+ `,fu=Cc.textarea`
180
+ box-sizing: border-box;
104
181
  width: 100%;
105
- border: 1px solid #d1d5db;
106
182
  border-radius: 0.25rem;
107
183
  padding: 0.5rem;
108
184
  font-size: 0.75rem;
109
- background-color: #f9fafb;
110
185
  resize: none;
111
186
  min-height: 40px;
112
187
  font-family: inherit;
113
188
 
114
189
  &:focus {
115
190
  outline: none;
116
- border-color: #6366f1;
117
- box-shadow: 0 0 0 1px #6366f1;
191
+ border-color: ${e=>e.theme.colors.primary};
192
+ box-shadow: 0 0 0 1px ${e=>e.theme.colors.primary};
118
193
  }
119
194
 
120
195
  transition: all 0.2s ease-in-out;
121
- `,Mu=Kl.div`
196
+ `,pu=Cc.div`
122
197
  transition: transform 0.2s ease-in-out;
123
- `,Ou=({stamps:t,currentStep:n,onStepChange:o,onToggle:r})=>{const a=t.length>0?Math.max(...t.map(e=>e.step)):0,i=t.length>0?Math.min(...t.map(e=>e.step)):0,s=a-i+1,l=e=>e<5e3?"latencyLow":e<=3e4?"latencyMedium":"latencyHigh";return e.createElement("div",{className:"w-full h-full bg-white flex flex-col overflow-hidden"},e.createElement("div",{className:"p-4 border-b border-gray-200 bg-gray-50 flex justify-between items-start"},e.createElement("div",null,e.createElement("h3",{className:"m-0 text-base font-semibold text-gray-800"},"Timeline")),r&&e.createElement("button",{onClick:r,className:"border-none bg-transparent cursor-pointer text-gray-500 p-1 flex items-center justify-center transition-colors duration-200 hover:text-gray-700",title:"Collapse Panel"},e.createElement(ws,{size:16}))),e.createElement("div",{className:"flex-1 overflow-y-auto py-2 pb-4"},Array.from({length:s},(r,a)=>{const s=i+a,c=s===n,u=s<n,d=t.some(e=>e.step===s),f=(e=>{const n=t.filter(t=>t.step===e);if(0===n.length)return null;const o=e-1,r=t.filter(e=>e.step===o);return 0===r.length?null:Math.min(...n.map(e=>e.time))-Math.max(...r.map(e=>e.time))})(s),p=(e=>{const n=t.filter(t=>t.step===e);return 0===n.length?`Step ${e}`:n[0]?.identifier||`Step ${e}`})(s);return e.createElement("div",{key:s,onClick:()=>d&&o(s),className:`\n px-4 py-3 border-b border-gray-100 relative transition-all duration-200\n ${d?"cursor-pointer":"cursor-default"}\n ${c?"bg-blue-50 border-l-4 border-l-indigo-500":"border-l-4 border-l-transparent"}\n ${d&&!c?"hover:bg-gray-50":""}\n `},e.createElement("div",{className:"flex items-center gap-2 mb-1"},e.createElement("div",{className:`\n w-3 h-3 rounded-full border flex-shrink-0\n ${c?"bg-indigo-500 border-indigo-500":u?"bg-yellow-400 border-gray-300":d?"bg-gray-400 border-gray-300":"bg-gray-200 border-gray-300"}\n `}),e.createElement("span",{className:`\n text-sm font-medium\n ${c?"font-semibold text-gray-800":"text-gray-500"}\n `},"Step ",s),f&&e.createElement(lu,{variant:l(f),className:"ml-auto"},iu(f))),e.createElement("div",{className:`\n text-sm leading-relaxed break-words\n ${d?"text-gray-800":"text-gray-400 italic"}\n `},d?p:"No activity"),c&&e.createElement("div",{className:"absolute right-2 top-1/2 transform -translate-y-1/2 w-1.5 h-1.5 rounded-full bg-indigo-500 animate-pulse"}))})))};function Pu(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}function Ru(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Au(...e){return t=>{let n=!1;const o=e.map(e=>{const o=Ru(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():Ru(e[t],null)}}}}function Du(...e){return r.useCallback(Au(...e),e)}function Tu(e,t=[]){let o=[];const a=()=>{const t=o.map(e=>r.createContext(e));return function(n){const o=n?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return a.scopeName=e,[function(t,a){const i=r.createContext(a),s=o.length;o=[...o,a];const l=t=>{const{scope:o,children:a,...l}=t,c=o?.[e]?.[s]||i,u=r.useMemo(()=>l,Object.values(l));return n.jsx(c.Provider,{value:u,children:a})};return l.displayName=t+"Provider",[l,function(n,o){const l=o?.[e]?.[s]||i,c=r.useContext(l);if(c)return c;if(void 0!==a)return a;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Iu(a,...t)]}function Iu(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var zu=globalThis?.document?r.useLayoutEffect:()=>{},Lu=r[" useId ".trim().toString()]||(()=>{}),$u=0;function Bu(e){const[t,n]=r.useState(Lu());return zu(()=>{e||n(e=>e??String($u++))},[e]),e||(t?`radix-${t}`:"")}var ju=r[" useInsertionEffect ".trim().toString()]||zu;function Hu({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[a,i,s]=function({defaultProp:e,onChange:t}){const[n,o]=r.useState(e),a=r.useRef(n),i=r.useRef(t);return ju(()=>{i.current=t},[t]),r.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,o,i]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:a;{const t=r.useRef(void 0!==e);r.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,o])}const u=r.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else i(t)},[l,e,i,s]);return[c,u]}function Fu(e){const t=Vu(e),o=r.forwardRef((e,o)=>{const{children:a,...i}=e,s=r.Children.toArray(a),l=s.find(Yu);if(l){const e=l.props.children,a=s.map(t=>t===l?r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null:t);return n.jsx(t,{...i,ref:o,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return n.jsx(t,{...i,ref:o,children:a})});return o.displayName=`${e}.Slot`,o}function Vu(e){const t=r.forwardRef((e,t)=>{const{children:n,...o}=e;if(r.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(a.ref=t?Au(t,e):e),r.cloneElement(n,a)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wu=Symbol("radix.slottable");function Yu(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Wu}var Xu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const o=Fu(`Primitive.${t}`),a=r.forwardRef((e,r)=>{const{asChild:a,...i}=e,s=a?o:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),n.jsx(s,{...i,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function Ku(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var qu,Uu="dismissableLayer.update",Zu="dismissableLayer.pointerDownOutside",Gu="dismissableLayer.focusOutside",Qu=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ju=r.forwardRef((e,t)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=r.useContext(Qu),[f,p]=r.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=r.useState({}),g=Du(t,e=>p(e)),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=f?y.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,E=w>=b,S=function(e,t=globalThis?.document){const n=Ku(e),o=r.useRef(!1),a=r.useRef(()=>{});return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let o=function(){nd(Zu,n,r,{discrete:!0})};const r={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=o,t.addEventListener("click",a.current,{once:!0})):o()}else t.removeEventListener("click",a.current);o.current=!1},r=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(r),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...d.branches].some(e=>e.contains(t));E&&!n&&(i?.(e),l?.(e),e.defaultPrevented||c?.())},h),_=function(e,t=globalThis?.document){const n=Ku(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){nd(Gu,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},h);return function(e,t=globalThis?.document){const n=Ku(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===d.layers.size-1&&(a?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},h),r.useEffect(()=>{if(f)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(qu=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),td(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=qu)}},[f,h,o,d]),r.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),td())},[f,d]),r.useEffect(()=>{const e=()=>m({});return document.addEventListener(Uu,e),()=>document.removeEventListener(Uu,e)},[]),n.jsx(Xu.div,{...u,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:Pu(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Pu(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Pu(e.onPointerDownCapture,S.onPointerDownCapture)})});Ju.displayName="DismissableLayer";var ed=r.forwardRef((e,t)=>{const o=r.useContext(Qu),a=r.useRef(null),i=Du(t,a);return r.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),n.jsx(Xu.div,{...e,ref:i})});function td(){const e=new CustomEvent(Uu);document.dispatchEvent(e)}function nd(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}(r,i):r.dispatchEvent(i)}ed.displayName="DismissableLayerBranch";var od="focusScope.autoFocusOnMount",rd="focusScope.autoFocusOnUnmount",ad={bubbles:!1,cancelable:!0},id=r.forwardRef((e,t)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,u]=r.useState(null),d=Ku(i),f=Ku(s),p=r.useRef(null),h=Du(t,e=>u(e)),m=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(a){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?p.current=t:ud(p.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||ud(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ud(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return c&&o.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[a,c,m.paused]),r.useEffect(()=>{if(c){dd.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(od,ad);c.addEventListener(od,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ud(o,{select:t}),document.activeElement!==n)return}((e=sd(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&ud(c))}return()=>{c.removeEventListener(od,d),setTimeout(()=>{const e=new CustomEvent(rd,ad);c.addEventListener(rd,f),c.dispatchEvent(e),e.defaultPrevented||ud(t??document.body,{select:!0}),c.removeEventListener(rd,f),dd.remove(m)},0)}}var e},[c,d,f,m]);const g=r.useCallback(e=>{if(!o&&!a)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=sd(e),n=ld(t,e),o=ld(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&ud(a,{select:!0})):(e.preventDefault(),o&&ud(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,m.paused]);return n.jsx(Xu.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})});function sd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ld(e,t){for(const n of e)if(!cd(n,{upTo:t}))return n}function cd(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ud(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}id.displayName="FocusScope";var dd=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=fd(e,t),e.unshift(t)},remove(t){e=fd(e,t),e[0]?.resume()}}}();function fd(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var pd=r.forwardRef((e,o)=>{const{container:a,...i}=e,[s,l]=r.useState(!1);zu(()=>l(!0),[]);const c=a||s&&globalThis?.document?.body;return c?t.createPortal(n.jsx(Xu.div,{...i,ref:o}),c):null});pd.displayName="Portal";var hd=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=r.useState(),o=r.useRef(null),a=r.useRef(e),i=r.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return r.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=md(o.current);i.current="mounted"===l?e:"none"},[l]),zu(()=>{const t=o.current,n=a.current;if(n!==e){const o=i.current,r=md(t);if(e)c("MOUNT");else if("none"===r||"none"===t?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),zu(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const i=md(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&i&&(c("ANIMATION_END"),!a.current)){const o=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=o)})}},s=e=>{e.target===t&&(i.current=md(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),i=Du(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||o.isPresent?r.cloneElement(a,{ref:i}):null};function md(e){return e?.animationName||"none"}hd.displayName="Presence";var gd=0;function yd(){r.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??vd()),document.body.insertAdjacentElement("beforeend",e[1]??vd()),gd++,()=>{1===gd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),gd--}},[])}function vd(){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 bd=function(){return bd=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},bd.apply(this,arguments)};function wd(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;var xd="right-scroll-bar-position",Ed="width-before-scroll-bar";function Sd(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var _d="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,kd=new WeakMap;function Cd(t,n){var o,r,a,i=(o=n||null,r=function(e){return t.forEach(function(t){return Sd(t,e)})},(a=e.useState(function(){return{value:o,callback:r,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=r,a.facade);return _d(function(){var e=kd.get(i);if(e){var n=new Set(e),o=new Set(t),r=i.current;n.forEach(function(e){o.has(e)||Sd(e,null)}),o.forEach(function(e){n.has(e)||Sd(e,r)})}kd.set(i,t)},[t]),i}function Nd(e){return e}var Md=function(e){var t=e.sideCar,n=wd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return r.createElement(o,bd({},n))};Md.isSideCarExport=!0;var Od=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Nd);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var r=t(e,o);return n.push(r),function(){n=n.filter(function(e){return e!==r})}},assignSyncMedium:function(e){for(o=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){o=!0;var t=[];if(n.length){var r=n;n=[],r.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}};return r}(null);return t.options=bd({async:!0,ssr:!1},e),t}(),Pd=function(){},Rd=r.forwardRef(function(e,t){var n=r.useRef(null),o=r.useState({onScrollCapture:Pd,onWheelCapture:Pd,onTouchMoveCapture:Pd}),a=o[0],i=o[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,b=void 0===v?"div":v,w=e.gapMode,x=wd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,S=Cd([n,t]),_=bd(bd({},x),a);return r.createElement(r.Fragment,null,d&&r.createElement(E,{sideCar:Od,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:w}),s?r.cloneElement(r.Children.only(l),bd(bd({},_),{ref:S})):r.createElement(b,bd({},_,{className:c,ref:S}),l))});Rd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Rd.classNames={fullWidth:Ed,zeroRight:xd};function Ad(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Dd=function(){var e=0,t=null;return{add:function(n){var o,r;0==e&&(t=Ad())&&(r=n,(o=t).styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Td=function(){var e,t=(e=Dd(),function(t,n){r.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,o=e.dynamic;return t(n,o),null}},Id={left:0,top:0,right:0,gap:0},zd=function(e){return parseInt(e||"",10)||0},Ld=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Id;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],o=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[zd(n),zd(o),zd(r)]}(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},$d=Td(),Bd="data-scroll-locked",jd=function(e,t,n,o){var r=e.left,a=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(o,";\n padding-right: ").concat(s,"px ").concat(o,";\n }\n body[").concat(Bd,"] {\n overflow: hidden ").concat(o,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(o,";"),"margin"===n&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(o,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),"\n }\n \n .").concat(xd," {\n right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Ed," {\n margin-right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(xd," .").concat(xd," {\n right: 0 ").concat(o,";\n }\n \n .").concat(Ed," .").concat(Ed," {\n margin-right: 0 ").concat(o,";\n }\n \n body[").concat(Bd,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Hd=function(){var e=parseInt(document.body.getAttribute(Bd)||"0",10);return isFinite(e)?e:0},Fd=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,a=void 0===o?"margin":o;r.useEffect(function(){return document.body.setAttribute(Bd,(Hd()+1).toString()),function(){var e=Hd()-1;e<=0?document.body.removeAttribute(Bd):document.body.setAttribute(Bd,e.toString())}},[]);var i=r.useMemo(function(){return Ld(a)},[a]);return r.createElement($d,{styles:jd(i,!t,a,n?"":"!important")})},Vd=!1;if("undefined"!=typeof window)try{var Wd=Object.defineProperty({},"passive",{get:function(){return Vd=!0,!0}});window.addEventListener("test",Wd,Wd),window.removeEventListener("test",Wd,Wd)}catch(e){Vd=!1}var Yd=!!Vd&&{passive:!1},Xd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Kd=function(e,t){var n=t.ownerDocument,o=t;do{if("undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot&&(o=o.host),qd(e,o)){var r=Ud(e,o);if(r[1]>r[2])return!0}o=o.parentNode}while(o&&o!==n.body);return!1},qd=function(e,t){return"v"===e?function(e){return Xd(e,"overflowY")}(t):function(e){return Xd(e,"overflowX")}(t)},Ud=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Zd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gd=function(e){return[e.deltaX,e.deltaY]},Qd=function(e){return e&&"current"in e?e.current:e},Jd=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},ef=0,tf=[];function nf(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var of,rf=(of=function(e){var t=r.useRef([]),n=r.useRef([0,0]),o=r.useRef(),a=r.useState(ef++)[0],i=r.useState(Td)[0],s=r.useRef(e);r.useEffect(function(){s.current=e},[e]),r.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=function(e,t,n){if(n||2===arguments.length)for(var o,r=0,a=t.length;r<a;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(Qd),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=r.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var r,a=Zd(e),i=n.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=Kd(d,u);if(!f)return!0;if(f?r=d:(r="v"===d?"h":"v",f=Kd(d,u)),!f)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=r),!r)return!0;var p=o.current||r;return function(e,t,n,o,r){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*o,s=n.target,l=t.contains(s),c=!1,u=i>0,d=0,f=0;do{if(!s)break;var p=Ud(e,s),h=p[0],m=p[1]-p[2]-a*h;(h||m)&&qd(e,s)&&(d+=m,f+=h);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(r&&Math.abs(d)<1||!r&&i>d)||!u&&(r&&Math.abs(f)<1||!r&&-i>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=r.useCallback(function(e){var n=e;if(tf.length&&tf[tf.length-1]===i){var o="deltaY"in n?Gd(n):Zd(n),r=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,r=o,t[0]===r[0]&&t[1]===r[1]);var t,r})[0];if(r&&r.should)n.cancelable&&n.preventDefault();else if(!r){var a=(s.current.shards||[]).map(Qd).filter(Boolean).filter(function(e){return e.contains(n.target)});(a.length>0?l(n,a[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=r.useCallback(function(e,n,o,r){var a={name:e,delta:n,target:o,should:r,shadowParent:nf(o)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=r.useCallback(function(e){n.current=Zd(e),o.current=void 0},[]),f=r.useCallback(function(t){u(t.type,Gd(t),t.target,l(t,e.lockRef.current))},[]),p=r.useCallback(function(t){u(t.type,Zd(t),t.target,l(t,e.lockRef.current))},[]);r.useEffect(function(){return tf.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Yd),document.addEventListener("touchmove",c,Yd),document.addEventListener("touchstart",d,Yd),function(){tf=tf.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,Yd),document.removeEventListener("touchmove",c,Yd),document.removeEventListener("touchstart",d,Yd)}},[]);var h=e.removeScrollBar,m=e.inert;return r.createElement(r.Fragment,null,m?r.createElement(i,{styles:Jd(a)}):null,h?r.createElement(Fd,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Od.useMedium(of),Md),af=r.forwardRef(function(e,t){return r.createElement(Rd,bd({},e,{ref:t,sideCar:rf}))});af.classNames=Rd.classNames;var sf=af,lf=new WeakMap,cf=new WeakMap,uf={},df=0,ff=function(e){return e&&(e.host||ff(e.parentNode))},pf=function(e,t,n,o){var r=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ff(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);uf[n]||(uf[n]=new WeakMap);var a=uf[n],i=[],s=new Set,l=new Set(r),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};r.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(o),r=null!==t&&"false"!==t,l=(lf.get(e)||0)+1,c=(a.get(e)||0)+1;lf.set(e,l),a.set(e,c),i.push(e),1===l&&r&&cf.set(e,!0),1===c&&e.setAttribute(n,"true"),r||e.setAttribute(o,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),df++,function(){i.forEach(function(e){var t=lf.get(e)-1,r=a.get(e)-1;lf.set(e,t),a.set(e,r),t||(cf.has(e)||e.removeAttribute(o),cf.delete(e)),r||e.removeAttribute(n)}),--df||(lf=new WeakMap,lf=new WeakMap,cf=new WeakMap,uf={})}},hf=function(e,t,n){void 0===n&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),pf(o,r,n,"aria-hidden")):function(){return null}},mf="Dialog",[gf,yf]=Tu(mf),[vf,bf]=gf(mf),wf=e=>{const{__scopeDialog:t,children:o,open:a,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=r.useRef(null),u=r.useRef(null),[d,f]=Hu({prop:a,defaultProp:i??!1,onChange:s,caller:mf});return n.jsx(vf,{scope:t,triggerRef:c,contentRef:u,contentId:Bu(),titleId:Bu(),descriptionId:Bu(),open:d,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),modal:l,children:o})};wf.displayName=mf;var xf="DialogTrigger",Ef=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=bf(xf,o),i=Du(t,a.triggerRef);return n.jsx(Xu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ff(a.open),...r,ref:i,onClick:Pu(e.onClick,a.onOpenToggle)})});Ef.displayName=xf;var Sf="DialogPortal",[_f,kf]=gf(Sf,{forceMount:void 0}),Cf=e=>{const{__scopeDialog:t,forceMount:o,children:a,container:i}=e,s=bf(Sf,t);return n.jsx(_f,{scope:t,forceMount:o,children:r.Children.map(a,e=>n.jsx(hd,{present:o||s.open,children:n.jsx(pd,{asChild:!0,container:i,children:e})}))})};Cf.displayName=Sf;var Nf="DialogOverlay",Mf=r.forwardRef((e,t)=>{const o=kf(Nf,e.__scopeDialog),{forceMount:r=o.forceMount,...a}=e,i=bf(Nf,e.__scopeDialog);return i.modal?n.jsx(hd,{present:r||i.open,children:n.jsx(Pf,{...a,ref:t})}):null});Mf.displayName=Nf;var Of=Fu("DialogOverlay.RemoveScroll"),Pf=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=bf(Nf,o);return n.jsx(sf,{as:Of,allowPinchZoom:!0,shards:[a.contentRef],children:n.jsx(Xu.div,{"data-state":Ff(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Rf="DialogContent",Af=r.forwardRef((e,t)=>{const o=kf(Rf,e.__scopeDialog),{forceMount:r=o.forceMount,...a}=e,i=bf(Rf,e.__scopeDialog);return n.jsx(hd,{present:r||i.open,children:i.modal?n.jsx(Df,{...a,ref:t}):n.jsx(Tf,{...a,ref:t})})});Af.displayName=Rf;var Df=r.forwardRef((e,t)=>{const o=bf(Rf,e.__scopeDialog),a=r.useRef(null),i=Du(t,o.contentRef,a);return r.useEffect(()=>{const e=a.current;if(e)return hf(e)},[]),n.jsx(If,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pu(e.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Pu(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Pu(e.onFocusOutside,e=>e.preventDefault())})}),Tf=r.forwardRef((e,t)=>{const o=bf(Rf,e.__scopeDialog),a=r.useRef(!1),i=r.useRef(!1);return n.jsx(If,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||o.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const n=t.target,r=o.triggerRef.current?.contains(n);r&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),If=r.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=bf(Rf,o),u=r.useRef(null),d=Du(t,u);return yd(),n.jsxs(n.Fragment,{children:[n.jsx(id,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:n.jsx(Ju,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ff(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(Xf,{titleId:c.titleId}),n.jsx(Kf,{contentRef:u,descriptionId:c.descriptionId})]})]})}),zf="DialogTitle",Lf=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=bf(zf,o);return n.jsx(Xu.h2,{id:a.titleId,...r,ref:t})});Lf.displayName=zf;var $f="DialogDescription",Bf=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=bf($f,o);return n.jsx(Xu.p,{id:a.descriptionId,...r,ref:t})});Bf.displayName=$f;var jf="DialogClose",Hf=r.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,a=bf(jf,o);return n.jsx(Xu.button,{type:"button",...r,ref:t,onClick:Pu(e.onClick,()=>a.onOpenChange(!1))})});function Ff(e){return e?"open":"closed"}Hf.displayName=jf;var Vf="DialogTitleWarning",[Wf,Yf]=function(e,t){const o=r.createContext(t),a=e=>{const{children:t,...a}=e,i=r.useMemo(()=>a,Object.values(a));return n.jsx(o.Provider,{value:i,children:t})};return a.displayName=e+"Provider",[a,function(n){const a=r.useContext(o);if(a)return a;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}(Vf,{contentName:Rf,titleName:zf,docsSlug:"dialog"}),Xf=({titleId:e})=>{const t=Yf(Vf),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return r.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},Kf=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Yf("DialogDescriptionWarning").contentName}}.`;return r.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");if(t&&o){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},qf=wf,Uf=Ef,Zf=Cf,Gf=Mf,Qf=Af,Jf=Lf,ep=Bf,tp=Hf;const np=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,op=Ul,rp=qf,ap=Uf,ip=Zf,sp=r.forwardRef(({className:e,...t},n)=>r.createElement(Gf,{className:nu("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));sp.displayName=Gf.displayName;const lp=(cp="fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",up={variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}},e=>{var t;if(null==(null==up?void 0:up.variants))return op(cp,null==e?void 0:e.class,null==e?void 0:e.className);const{variants:n,defaultVariants:o}=up,r=Object.keys(n).map(t=>{const r=null==e?void 0:e[t],a=null==o?void 0:o[t];if(null===r)return null;const i=np(r)||np(a);return n[t][i]}),a=e&&Object.entries(e).reduce((e,t)=>{let[n,o]=t;return void 0===o||(e[n]=o),e},{}),i=null==up||null===(t=up.compoundVariants)||void 0===t?void 0:t.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...a}[t]):{...o,...a}[t]===n})?[...e,n,r]:e},[]);return op(cp,r,i,null==e?void 0:e.class,null==e?void 0:e.className)});var cp,up;const dp=r.forwardRef(({side:e="right",className:t,children:n,...o},a)=>r.createElement(ip,null,r.createElement(sp,null),r.createElement(Qf,{ref:a,className:nu(lp({side:e}),t),...o},n,r.createElement(tp,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},r.createElement("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),r.createElement("span",{className:"sr-only"},"Close")))));dp.displayName=Qf.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(Jf,{ref:n,className:nu("text-lg font-semibold text-foreground",e),...t})).displayName=Jf.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(ep,{ref:n,className:nu("text-sm text-muted-foreground",e),...t})).displayName=ep.displayName;const fp=(e,t,n={})=>{const{minNodeSpacing:o=200,containerWidth:r=600}=n;if(!e||0===e.length)return new Map;new Map(e.map(e=>[e.identifier,e]));const a=new Map,i=new Map;e.forEach(e=>a.set(e.identifier,[])),t.length>0?t.forEach(e=>{e.source&&e.target&&(a.get(e.source)?.push(e.target),i.set(e.target,e.source))}):e.forEach(e=>{e.parent&&e.parent.identifier!==e.identifier&&(a.get(e.parent.identifier)?.push(e.identifier),i.set(e.identifier,e.parent.identifier))});const s=e.filter(e=>!i.has(e.identifier)),l=new Map,c=(e,t)=>{l.set(e,t);for(const n of a.get(e)||[])c(n,t+1)};s.forEach(e=>c(e.identifier,0));const u=[];e.forEach(e=>{const t=l.get(e.identifier)??0;u[t]||(u[t]=[]),u[t].push(e.identifier)});const d=new Map,f=200,p=Math.max(250,o+50),h=e=>{const t=a.get(e)||[];if(0===t.length)return d.set(e,f),f;let n=0;for(const e of t)n+=h(e);return n+=(t.length-1)*p,d.set(e,n),n};s.forEach(e=>h(e.identifier));const m=new Map,g=Math.max(400,o+200),y=(e,t,n)=>{const o=d.get(e)||f,r=n*g+100,i=a.get(e)||[];if(0===i.length)m.set(e,{x:t+o/2-100,y:r});else{let o=t;for(const e of i){const t=d.get(e)||f;y(e,o,n+1),o+=t+p}const a=i[0],s=i[i.length-1],l=m.get(a),c=m.get(s),u=(l.x+c.x)/2;m.set(e,{x:u,y:r})}};let v=0;for(const e of s)v+=d.get(e.identifier)||f;s.length>1&&(v+=(s.length-1)*p*2);let b=Math.max(0,(r-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const w=o,x=Array.from(m.keys());for(let e=0;e<x.length;e++)for(let t=e+1;t<x.length;t++){const n=m.get(x[e]),o=m.get(x[t]);if(Math.sqrt((o.x-n.x)**2+(o.y-n.y)**2)<w){const e=o.x-n.x,t=o.y-n.y,r=Math.sqrt(e*e+t*t);if(r>0){const a=w/r,i=(e*a-e)/2,s=(t*a-t)/2;n.x-=i,n.y-=s,o.x+=i,o.y+=s}else n.x-=w/2,o.x+=w/2}}return m},pp={Agent:gu,Tool:gu,Coordinator:gu},hp=({flowData:t,width:n="100%",height:o="1000px",className:r="",defaultZoom:a=1,defaultPan:i={x:0,y:0},disableAutoFit:s=!0,showTimeline:l=!1,minNodeSpacing:c=200})=>{const u=t;if(!u)return e.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:"1px solid #e5e7eb",borderRadius:"8px",background:"#f9fafb",position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:r},e.createElement("div",{style:{textAlign:"center"}},e.createElement("div",{style:{fontSize:"16px",color:"#6b7280",marginBottom:"8px"}},"No flow data available"),e.createElement("div",{style:{fontSize:"14px",color:"#9ca3af"}},"Please provide flowData prop")));const d=e.useRef(null),f=e.useRef(null),[p,h]=e.useState({width:"number"==typeof n?n:1200,height:"number"==typeof o?o:600}),[m,g]=e.useState(0),[y,v]=e.useState(!1),b=e.useRef(null),[w,x]=e.useState(!1),E=e.useMemo(()=>{const e=u.stamps||u.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[u.stamps,u.steps]);e.useEffect(()=>(y?b.current=setInterval(()=>{g(e=>e>=E?(v(!1),e):e+1)},250):b.current&&(clearInterval(b.current),b.current=null),()=>{b.current&&clearInterval(b.current)}),[y,E]),e.useEffect(()=>{const e=u.stamps||u.steps||[];e.length>0&&g(Math.max(...e.map(e=>e.step)))},[u.stamps,u.steps]),e.useEffect(()=>{const e=()=>{if(d.current){const e=d.current.getBoundingClientRect();h({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof o?o:600)})}};if(e(),window.ResizeObserver&&d.current){const t=new ResizeObserver(e);return t.observe(d.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,o]);const S=e.useMemo(()=>{if(!u.nodes)return new Map;const e=Math.max(p.width||800,1200);return fp(u.nodes,u.edges||[],{minNodeSpacing:c,containerWidth:e})},[u.nodes,u.edges,p.width,c]),_=e.useCallback(e=>u.nodes?u.nodes.filter(t=>t.stamp.step<=e):[],[u.nodes]),k=e.useCallback(e=>(u.edges||[]).filter(t=>t.stamp.step<=e),[u.edges]),C=e.useMemo(()=>{const e=_(m),t=k(m);return e.map(e=>{const n=S.get(e.identifier)||{x:0,y:0},o=e.stamp.step===m,r="Tool"===e.node_type?t.filter(t=>t.target===e.identifier&&t.details).map(e=>e.details):void 0;return{id:e.identifier,type:e.node_type||"Agent",position:n,data:{label:e.name||e.node_type,nodeType:e.node_type,details:e.details,isActive:o,id:e.identifier,edges:t,edgeDetails:r},style:{filter:o?"drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3))":"none"}}})},[S,m,_,k]),N=e.useMemo(()=>k(m).filter(e=>e.source&&e.target).map(e=>{const t=e.stamp.step===m;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:t,bidirectional:!0,style:{stroke:t?"#6366f1":"#9ca3af",strokeWidth:t?3:2},label:e.stamp?.identifier?ru(String(e.stamp.identifier),50):void 0,data:{label:e.stamp?.identifier?ru(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:e.stamp?.step,time:e.stamp?.time,details:e.details}}}),[m,k]),[M,O,P]=Ji(C),[R,A,D]=es(N);e.useEffect(()=>{O(C)},[C,O]),e.useEffect(()=>{A(N)},[N,A]);const T=e.useCallback(e=>A(t=>xr(e,t)),[A]),I=e.useCallback(e=>{g(e),v(!1)},[]);e.useCallback(()=>{v(e=>!e)},[]);const z=(e,t)=>{if(!f.current)return{x:0,y:0};const n=f.current.createSVGPoint();n.x=e,n.y=t;const o=n.matrixTransform(f.current.getScreenCTM()?.inverse());return{x:o.x,y:o.y}},L=ka();return e.useEffect(()=>{if(s||!L||0===C.length)return;const e=new Map;N.forEach(t=>{const n=e.get(t.source)||0;e.set(t.source,n+1);const o=e.get(t.target)||0;e.set(t.target,o+1)});let t="",n=0;e.forEach((e,o)=>{e>n&&(n=e,t=o)}),!t&&C.length>0&&(t=C[0].id),t&&setTimeout(()=>{L.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:a,maxZoom:1})},500)},[C,N,L,s,a]),e.createElement("div",{ref:d,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof o?`${o}px`:o,border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px"},className:r},l&&e.createElement(rp,{open:w,onOpenChange:x},e.createElement(ap,{asChild:!0},e.createElement("button",{className:"absolute top-4 left-4 z-50 w-10 h-10 bg-white border border-gray-300 rounded-lg shadow-sm hover:bg-gray-50 flex items-center justify-center transition-colors duration-200",title:"Open Timeline"},e.createElement(ws,{size:20,className:"text-gray-600"}))),e.createElement(ip,null,e.createElement(Qf,{className:"fixed inset-y-0 left-0 h-full w-[280px] z-50 bg-background border-r shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left p-0",onPointerDownOutside:e=>e.preventDefault()},e.createElement("div",{className:"flex flex-col h-full"},e.createElement("div",{className:"flex-1 overflow-y-auto"},e.createElement(Ou,{stamps:u.stamps||u.steps||[],currentStep:m,onStepChange:I}))),e.createElement(tp,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},e.createElement("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),e.createElement("span",{className:"sr-only"},"Close"))))),e.createElement(Gi,{nodes:M,edges:R,onNodesChange:P,onEdgesChange:D,onConnect:T,nodeTypes:pp,edgeTypes:{default:t=>e.createElement(Es,{...t,clientToSvgCoords:z,svgRef:f})},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:i.x,y:i.y,zoom:a},onInit:()=>{if(d.current){const e=d.current.querySelector("svg");e&&(f.current=e)}}},e.createElement(ls,{variant:ts.Lines,color:"#EEEEEE",gap:16})),e.createElement("style",null,"\n .react-flow__edge-label {\n font-size: 10px;\n background: white;\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid #e5e7eb;\n max-width: 150px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .react-flow__edge {\n cursor: default !important;\n }\n\n .react-flow__edge-path {\n cursor: default !important;\n }\n "))};function mp(e,[t,n]){return Math.min(n,Math.max(t,e))}var gp=r.createContext(void 0);const yp=["top","right","bottom","left"],vp=Math.min,bp=Math.max,wp=Math.round,xp=Math.floor,Ep=e=>({x:e,y:e}),Sp={left:"right",right:"left",bottom:"top",top:"bottom"},_p={start:"end",end:"start"};function kp(e,t,n){return bp(e,vp(t,n))}function Cp(e,t){return"function"==typeof e?e(t):e}function Np(e){return e.split("-")[0]}function Mp(e){return e.split("-")[1]}function Op(e){return"x"===e?"y":"x"}function Pp(e){return"y"===e?"height":"width"}const Rp=new Set(["top","bottom"]);function Ap(e){return Rp.has(Np(e))?"y":"x"}function Dp(e){return Op(Ap(e))}function Tp(e){return e.replace(/start|end/g,e=>_p[e])}const Ip=["left","right"],zp=["right","left"],Lp=["top","bottom"],$p=["bottom","top"];function Bp(e,t,n,o){const r=Mp(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?zp:Ip:t?Ip:zp;case"left":case"right":return t?Lp:$p;default:return[]}}(Np(e),"start"===n,o);return r&&(a=a.map(e=>e+"-"+r),t&&(a=a.concat(a.map(Tp)))),a}function jp(e){return e.replace(/left|right|bottom|top/g,e=>Sp[e])}function Hp(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Fp(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Vp(e,t,n){let{reference:o,floating:r}=e;const a=Ap(t),i=Dp(t),s=Pp(i),l=Np(t),c="y"===a,u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[s]/2-r[s]/2;let p;switch(l){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(Mp(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function Wp(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Cp(t,e),h=Hp(p),m=s[f?"floating"===d?"reference":"floating":d],g=Fp(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},w=Fp(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function Yp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xp(e){return yp.some(t=>e[t]>=0)}const Kp=new Set(["left","top"]);function qp(){return"undefined"!=typeof window}function Up(e){return Qp(e)?(e.nodeName||"").toLowerCase():"#document"}function Zp(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Gp(e){var t;return null==(t=(Qp(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Qp(e){return!!qp()&&(e instanceof Node||e instanceof Zp(e).Node)}function Jp(e){return!!qp()&&(e instanceof Element||e instanceof Zp(e).Element)}function eh(e){return!!qp()&&(e instanceof HTMLElement||e instanceof Zp(e).HTMLElement)}function th(e){return!(!qp()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Zp(e).ShadowRoot)}const nh=new Set(["inline","contents"]);function oh(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=mh(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!nh.has(r)}const rh=new Set(["table","td","th"]);function ah(e){return rh.has(Up(e))}const ih=[":popover-open",":modal"];function sh(e){return ih.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const lh=["transform","translate","scale","rotate","perspective"],ch=["transform","translate","scale","rotate","perspective","filter"],uh=["paint","layout","strict","content"];function dh(e){const t=fh(),n=Jp(e)?mh(e):e;return lh.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||ch.some(e=>(n.willChange||"").includes(e))||uh.some(e=>(n.contain||"").includes(e))}function fh(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ph=new Set(["html","body","#document"]);function hh(e){return ph.has(Up(e))}function mh(e){return Zp(e).getComputedStyle(e)}function gh(e){return Jp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yh(e){if("html"===Up(e))return e;const t=e.assignedSlot||e.parentNode||th(e)&&e.host||Gp(e);return th(t)?t.host:t}function vh(e){const t=yh(e);return hh(t)?e.ownerDocument?e.ownerDocument.body:e.body:eh(t)&&oh(t)?t:vh(t)}function bh(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=vh(e),a=r===(null==(o=e.ownerDocument)?void 0:o.body),i=Zp(r);if(a){const e=wh(i);return t.concat(i,i.visualViewport||[],oh(r)?r:[],e&&n?bh(e):[])}return t.concat(r,bh(r,[],n))}function wh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xh(e){const t=mh(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=eh(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,s=wp(n)!==a||wp(o)!==i;return s&&(n=a,o=i),{width:n,height:o,$:s}}function Eh(e){return Jp(e)?e:e.contextElement}function Sh(e){const t=Eh(e);if(!eh(t))return Ep(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=xh(t);let i=(a?wp(n.width):n.width)/o,s=(a?wp(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const _h=Ep(0);function kh(e){const t=Zp(e);return fh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:_h}function Ch(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),a=Eh(e);let i=Ep(1);t&&(o?Jp(o)&&(i=Sh(o)):i=Sh(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Zp(e))&&t}(a,n,o)?kh(a):Ep(0);let l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,u=r.width/i.x,d=r.height/i.y;if(a){const e=Zp(a),t=o&&Jp(o)?Zp(o):o;let n=e,r=wh(n);for(;r&&o&&t!==n;){const e=Sh(r),t=r.getBoundingClientRect(),o=mh(r),a=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=Zp(r),r=wh(n)}}return Fp({width:u,height:d,x:l,y:c})}function Nh(e,t){const n=gh(e).scrollLeft;return t?t.left+n:Ch(Gp(e)).left+n}function Mh(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Nh(e,n),y:n.top+t.scrollTop}}const Oh=new Set(["absolute","fixed"]);function Ph(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=Zp(e),o=Gp(e),r=n.visualViewport;let a=o.clientWidth,i=o.clientHeight,s=0,l=0;if(r){a=r.width,i=r.height;const e=fh();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}const c=Nh(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r);i<=25&&(a-=i)}else c<=25&&(a+=c);return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=Gp(e),n=gh(e),o=e.ownerDocument.body,r=bp(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=bp(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Nh(e);const s=-n.scrollTop;return"rtl"===mh(o).direction&&(i+=bp(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:s}}(Gp(e));else if(Jp(t))o=function(e,t){const n=Ch(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=eh(e)?Sh(e):Ep(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:r*a.x,y:o*a.y}}(t,n);else{const n=kh(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Fp(o)}function Rh(e,t){const n=yh(e);return!(n===t||!Jp(n)||hh(n))&&("fixed"===mh(n).position||Rh(n,t))}function Ah(e,t,n){const o=eh(t),r=Gp(t),a="fixed"===n,i=Ch(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Ep(0);function c(){l.x=Nh(r)}if(o||!o&&!a)if(("body"!==Up(t)||oh(r))&&(s=gh(t)),o){const e=Ch(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&c();a&&!o&&r&&c();const u=!r||o||a?Ep(0):Mh(r,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function Dh(e){return"static"===mh(e).position}function Th(e,t){if(!eh(e)||"fixed"===mh(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Gp(e)===n&&(n=n.ownerDocument.body),n}function Ih(e,t){const n=Zp(e);if(sh(e))return n;if(!eh(e)){let t=yh(e);for(;t&&!hh(t);){if(Jp(t)&&!Dh(t))return t;t=yh(t)}return n}let o=Th(e,t);for(;o&&ah(o)&&Dh(o);)o=Th(o,t);return o&&hh(o)&&Dh(o)&&!dh(o)?n:o||function(e){let t=yh(e);for(;eh(t)&&!hh(t);){if(dh(t))return t;if(sh(t))return null;t=yh(t)}return null}(e)||n}const zh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a="fixed"===r,i=Gp(o),s=!!t&&sh(t.floating);if(o===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Ep(1);const u=Ep(0),d=eh(o);if((d||!d&&!a)&&(("body"!==Up(o)||oh(i))&&(l=gh(o)),eh(o))){const e=Ch(o);c=Sh(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const f=!i||d||a?Ep(0):Mh(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Gp,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a="clippingAncestors"===n?sh(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=bh(e,[],!1).filter(e=>Jp(e)&&"body"!==Up(e)),r=null;const a="fixed"===mh(e).position;let i=a?yh(e):e;for(;Jp(i)&&!hh(i);){const t=mh(i),n=dh(i);n||"fixed"!==t.position||(r=null),(a?!n&&!r:!n&&"static"===t.position&&r&&Oh.has(r.position)||oh(i)&&!n&&Rh(e,i))?o=o.filter(e=>e!==i):r=t,i=yh(i)}return t.set(e,o),o}(t,this._c):[].concat(n),i=[...a,o],s=i[0],l=i.reduce((e,n)=>{const o=Ph(t,n,r);return e.top=bp(o.top,e.top),e.right=vp(o.right,e.right),e.bottom=vp(o.bottom,e.bottom),e.left=bp(o.left,e.left),e},Ph(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Ih,getElementRects:async function(e){const t=this.getOffsetParent||Ih,n=this.getDimensions,o=await n(e.floating);return{reference:Ah(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=xh(e);return{width:t,height:n}},getScale:Sh,isElement:Jp,isRTL:function(e){return"rtl"===mh(e).direction}};function Lh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $h(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=Eh(e),u=r||a?[...c?bh(c):[],...bh(t)]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,o=null;const r=Gp(e);function a(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const h={rootMargin:-xp(d)+"px "+-xp(r.clientWidth-(u+f))+"px "+-xp(r.clientHeight-(d+p))+"px "+-xp(u)+"px",threshold:bp(0,vp(1,l))||1};let m=!0;function g(t){const o=t[0].intersectionRatio;if(o!==l){if(!m)return i();o?i(!1,o):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==o||Lh(c,e.getBoundingClientRect())||i(),m=!1}try{o=new IntersectionObserver(g,{...h,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,h)}o.observe(e)}(!0),a}(c,n):null;let f,p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?Ch(e):null;return l&&function t(){const o=Ch(e);m&&!Lh(m,o)&&n();m=o,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Bh=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,a=await(null==o.isRTL?void 0:o.isRTL(r.floating)),i=Np(n),s=Mp(n),l="y"===Ap(n),c=Kp.has(i)?-1:1,u=a&&l?-1:1,d=Cp(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:i}}}}},jh=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Cp(e,t),c={x:n,y:o},u=await Wp(t,l),d=Ap(Np(r)),f=Op(d);let p=c[f],h=c[d];if(a){const e="y"===f?"bottom":"right";p=kp(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=kp(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[f]:a,[d]:i}}}}}},Hh=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Cp(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const y=Np(r),v=Ap(s),b=Np(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[jp(s)]:function(e){const t=jp(e);return[Tp(e),t,Tp(t)]}(s)),E="none"!==h;!f&&E&&x.push(...Bp(s,m,h,w));const S=[s,...x],_=await Wp(t,g),k=[];let C=(null==(o=a.flip)?void 0:o.overflows)||[];if(u&&k.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=Mp(e),r=Dp(e),a=Pp(r);let i="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=jp(i)),[i,jp(i)]}(r,i,w);k.push(_[e[0]],_[e[1]])}if(C=[...C,{placement:r,overflows:k}],!k.every(e=>e<=0)){var N,M;const e=((null==(N=a.flip)?void 0:N.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&v!==Ap(t))||C.every(e=>Ap(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:C},reset:{placement:t}}}let n=null==(M=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var O;const e=null==(O=C.filter(e=>{if(E){const t=Ap(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},Fh=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Cp(e,t),u=await Wp(t,c),d=Np(r),f=Mp(r),p="y"===Ap(r),{width:h,height:m}=a.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=m-u.top-u.bottom,b=h-u.left-u.right,w=vp(m-u[g],v),x=vp(h-u[y],b),E=!t.middlewareData.shift;let S=w,_=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=b),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(S=v),E&&!f){const e=bp(u.left,0),t=bp(u.right,0),n=bp(u.top,0),o=bp(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:bp(u.left,u.right)):S=m-2*(0!==n||0!==o?n+o:bp(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:S});const k=await i.getDimensions(s.floating);return h!==k.width||m!==k.height?{reset:{rects:!0}}:{}}}},Vh=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Cp(e,t);switch(o){case"referenceHidden":{const e=Yp(await Wp(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Xp(e)}}}case"escaped":{const e=Yp(await Wp(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Xp(e)}}}default:return{}}}}},Wh=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Cp(e,t)||{};if(null==c)return{};const d=Hp(u),f={x:n,y:o},p=Dp(r),h=Pp(p),m=await i.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],x=f[p]-a.reference[p],E=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let S=E?E[b]:0;S&&await(null==i.isElement?void 0:i.isElement(E))||(S=s.floating[b]||a.floating[h]);const _=w/2-x/2,k=S/2-m[h]/2-1,C=vp(d[y],k),N=vp(d[v],k),M=C,O=S-m[h]-N,P=S/2-m[h]/2+_,R=kp(M,P,O),A=!l.arrow&&null!=Mp(r)&&P!==R&&a.reference[h]/2-(P<M?C:N)-m[h]/2<0,D=A?P<M?P-M:P-O:0;return{[p]:f[p]+D,data:{[p]:R,centerOffset:P-R-D,...A&&{alignmentOffset:D}},reset:A}}}),Yh=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Cp(e,t),u={x:n,y:o},d=Ap(r),f=Op(d);let p=u[f],h=u[d];const m=Cp(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,v;const e="y"===f?"width":"height",t=Kp.has(Np(r)),n=a.reference[d]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),o=a.reference[d]+a.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>o&&(h=o)}return{[f]:p,[d]:h}}}},Xh=(e,t,n)=>{const o=new Map,r={platform:zh,...n},a={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=Vp(c,o,l),f=o,p={},h=0;for(let n=0;n<s.length;n++){const{name:a,fn:m}=s[n],{x:g,y:y,data:v,reset:b}=await m({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,p={...p,[a]:{...p[a],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:u,y:d}=Vp(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:a})};var Kh="undefined"!=typeof document?e.useLayoutEffect:function(){};function qh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!==o--;)if(!qh(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!==o--;){const n=r[o];if(("_owner"!==n||!e.$$typeof)&&!qh(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Uh(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zh(e,t){const n=Uh(e);return Math.round(t*n)/n}function Gh(e){const t=r.useRef(e);return Kh(()=>{t.current=e}),t}const Qh=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:o}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?Wh({element:n.current,padding:o}).fn(t):{}:n?Wh({element:n,padding:o}).fn(t):{};var r}}),Jh=(e,t)=>({...Bh(e),options:[e,t]}),em=(e,t)=>({...jh(e),options:[e,t]}),tm=(e,t)=>({...Yh(e),options:[e,t]}),nm=(e,t)=>({...Hh(e),options:[e,t]}),om=(e,t)=>({...Fh(e),options:[e,t]}),rm=(e,t)=>({...Vh(e),options:[e,t]}),am=(e,t)=>({...Qh(e),options:[e,t]});var im=r.forwardRef((e,t)=>{const{children:o,width:r=10,height:a=5,...i}=e;return n.jsx(Xu.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});im.displayName="Arrow";var sm=im;function lm(e){const[t,n]=r.useState(void 0);return zu(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,a;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var cm="Popper",[um,dm]=Tu(cm),[fm,pm]=um(cm),hm=e=>{const{__scopePopper:t,children:o}=e,[a,i]=r.useState(null);return n.jsx(fm,{scope:t,anchor:a,onAnchorChange:i,children:o})};hm.displayName=cm;var mm="PopperAnchor",gm=r.forwardRef((e,t)=>{const{__scopePopper:o,virtualRef:a,...i}=e,s=pm(mm,o),l=r.useRef(null),c=Du(t,l),u=r.useRef(null);return r.useEffect(()=>{const e=u.current;u.current=a?.current||l.current,e!==u.current&&s.onAnchorChange(u.current)}),a?null:n.jsx(Xu.div,{...i,ref:c})});gm.displayName=mm;var ym="PopperContent",[vm,bm]=um(ym),wm=r.forwardRef((e,t)=>{const{__scopePopper:o,side:i="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,b=pm(ym,o),[w,x]=r.useState(null),E=Du(t,e=>x(e)),[S,_]=r.useState(null),k=lm(S),C=k?.width??0,N=k?.height??0,M=i+("center"!==l?"-"+l:""),O="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},P=Array.isArray(f)?f:[f],R=P.length>0,A={padding:O,boundary:P.filter(_m),altBoundary:R},{refs:D,floatingStyles:T,placement:I,isPositioned:z,middlewareData:L}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,p]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=r.useState(o);qh(h,o)||m(o);const[g,y]=r.useState(null),[v,b]=r.useState(null),w=r.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),x=r.useCallback(e=>{e!==k.current&&(k.current=e,b(e))},[]),E=s||g,S=l||v,_=r.useRef(null),k=r.useRef(null),C=r.useRef(f),N=null!=u,M=Gh(u),O=Gh(i),P=Gh(d),R=r.useCallback(()=>{if(!_.current||!k.current)return;const e={placement:t,strategy:n,middleware:h};O.current&&(e.platform=O.current),Xh(_.current,k.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};A.current&&!qh(C.current,t)&&(C.current=t,a.flushSync(()=>{p(t)}))})},[h,t,n,O,P]);Kh(()=>{!1===d&&C.current.isPositioned&&(C.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const A=r.useRef(!1);Kh(()=>(A.current=!0,()=>{A.current=!1}),[]),Kh(()=>{if(E&&(_.current=E),S&&(k.current=S),E&&S){if(M.current)return M.current(E,S,R);R()}},[E,S,R,M,N]);const D=r.useMemo(()=>({reference:_,floating:k,setReference:w,setFloating:x}),[w,x]),T=r.useMemo(()=>({reference:E,floating:S}),[E,S]),I=r.useMemo(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Zh(T.floating,f.x),o=Zh(T.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+o+"px)",...Uh(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}},[n,c,T.floating,f.x,f.y]);return r.useMemo(()=>({...f,update:R,refs:D,elements:T,floatingStyles:I}),[f,R,D,T,I])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>$h(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[Jh({mainAxis:s+N,alignmentAxis:c}),d&&em({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?tm():void 0,...A}),d&&nm({...A}),om({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),S&&am({element:S,padding:u}),km({arrowWidth:C,arrowHeight:N}),m&&rm({strategy:"referenceHidden",...A})]}),[$,B]=Cm(I),j=Ku(y);zu(()=>{z&&j?.()},[z,j]);const H=L.arrow?.x,F=L.arrow?.y,V=0!==L.arrow?.centerOffset,[W,Y]=r.useState();return zu(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),n.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:z?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(vm,{scope:o,placedSide:$,onArrowChange:_,arrowX:H,arrowY:F,shouldHideArrow:V,children:n.jsx(Xu.div,{"data-side":$,"data-align":B,...v,ref:E,style:{...v.style,animation:z?void 0:"none"}})})})});wm.displayName=ym;var xm="PopperArrow",Em={top:"bottom",right:"left",bottom:"top",left:"right"},Sm=r.forwardRef(function(e,t){const{__scopePopper:o,...r}=e,a=bm(xm,o),i=Em[a.placedSide];return n.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:n.jsx(sm,{...r,ref:t,style:{...r.style,display:"block"}})})});function _m(e){return null!==e}Sm.displayName=xm;var km=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=Cm(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(r.arrow?.x??0)+i/2,f=(r.arrow?.y??0)+s/2;let p="",h="";return"bottom"===l?(p=a?u:`${d}px`,h=-s+"px"):"top"===l?(p=a?u:`${d}px`,h=`${o.floating.height+s}px`):"right"===l?(p=-s+"px",h=a?u:`${f}px`):"left"===l&&(p=`${o.floating.width+s}px`,h=a?u:`${f}px`),{data:{x:p,y:h}}}});function Cm(e){const[t,n="center"]=e.split("-");return[t,n]}var Nm=hm,Mm=gm,Om=wm,Pm=Sm;function Rm(e){const t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Am=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});r.forwardRef((e,t)=>n.jsx(Xu.span,{...e,ref:t,style:{...Am,...e.style}})).displayName="VisuallyHidden";var Dm=[" ","Enter","ArrowUp","ArrowDown"],Tm=[" ","Enter"],Im="Select",[zm,Lm,$m]=function(t){const o=t+"CollectionProvider",[r,a]=Tu(o),[i,s]=r(o,{collectionRef:{current:null},itemMap:new Map}),l=t=>{const{scope:o,children:r}=t,a=e.useRef(null),s=e.useRef(new Map).current;return n.jsx(i,{scope:o,itemMap:s,collectionRef:a,children:r})};l.displayName=o;const c=t+"CollectionSlot",u=Fu(c),d=e.forwardRef((e,t)=>{const{scope:o,children:r}=e,a=Du(t,s(c,o).collectionRef);return n.jsx(u,{ref:a,children:r})});d.displayName=c;const f=t+"CollectionItemSlot",p="data-radix-collection-item",h=Fu(f),m=e.forwardRef((t,o)=>{const{scope:r,children:a,...i}=t,l=e.useRef(null),c=Du(o,l),u=s(f,r);return e.useEffect(()=>(u.itemMap.set(l,{ref:l,...i}),()=>{u.itemMap.delete(l)})),n.jsx(h,{[p]:"",ref:c,children:a})});return m.displayName=f,[{Provider:l,Slot:d,ItemSlot:m},function(n){const o=s(t+"CollectionConsumer",n);return e.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},a]}(Im),[Bm,jm]=Tu(Im,[$m,dm]),Hm=dm(),[Fm,Vm]=Bm(Im),[Wm,Ym]=Bm(Im),Xm=e=>{const{__scopeSelect:t,children:o,open:a,defaultOpen:i,onOpenChange:s,value:l,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:h,required:m,form:g}=e,y=Hm(t),[v,b]=r.useState(null),[w,x]=r.useState(null),[E,S]=r.useState(!1),_=function(e){const t=r.useContext(gp);return e||t||"ltr"}(d),[k,C]=Hu({prop:a,defaultProp:i??!1,onChange:s,caller:Im}),[N,M]=Hu({prop:l,defaultProp:c,onChange:u,caller:Im}),O=r.useRef(null),P=!v||(g||!!v.closest("form")),[R,A]=r.useState(new Set),D=Array.from(R).map(e=>e.props.value).join(";");return n.jsx(Nm,{...y,children:n.jsxs(Fm,{required:m,scope:t,trigger:v,onTriggerChange:b,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:Bu(),value:N,onValueChange:M,open:k,onOpenChange:C,dir:_,triggerPointerDownPosRef:O,disabled:h,children:[n.jsx(zm.Provider,{scope:t,children:n.jsx(Wm,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:r.useCallback(e=>{A(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:o})}),P?n.jsxs(Ag,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:p,value:N,onChange:e=>M(e.target.value),disabled:h,form:g,children:[void 0===N?n.jsx("option",{value:""}):null,Array.from(R)]},D):null]})})};Xm.displayName=Im;var Km="SelectTrigger",qm=r.forwardRef((e,t)=>{const{__scopeSelect:o,disabled:a=!1,...i}=e,s=Hm(o),l=Vm(Km,o),c=l.disabled||a,u=Du(t,l.onTriggerChange),d=Lm(o),f=r.useRef("touch"),[p,h,m]=Tg(e=>{const t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),o=Ig(t,e,n);void 0!==o&&l.onValueChange(o.value)}),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return n.jsx(Mm,{asChild:!0,...s,children:n.jsx(Xu.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Dg(l.value)?"":void 0,...i,ref:u,onClick:Pu(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:Pu(i.onPointerDown,e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:Pu(i.onKeyDown,e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||Dm.includes(e.key)&&(g(),e.preventDefault())})})})});qm.displayName=Km;var Um="SelectValue",Zm=r.forwardRef((e,t)=>{const{__scopeSelect:o,className:r,style:a,children:i,placeholder:s="",...l}=e,c=Vm(Um,o),{onValueNodeHasChildrenChange:u}=c,d=void 0!==i,f=Du(t,c.onValueNodeChange);return zu(()=>{u(d)},[u,d]),n.jsx(Xu.span,{...l,ref:f,style:{pointerEvents:"none"},children:Dg(c.value)?n.jsx(n.Fragment,{children:s}):i})});Zm.displayName=Um;var Gm=r.forwardRef((e,t)=>{const{__scopeSelect:o,children:r,...a}=e;return n.jsx(Xu.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});Gm.displayName="SelectIcon";var Qm=e=>n.jsx(pd,{asChild:!0,...e});Qm.displayName="SelectPortal";var Jm="SelectContent",eg=r.forwardRef((e,t)=>{const o=Vm(Jm,e.__scopeSelect),[i,s]=r.useState();if(zu(()=>{s(new DocumentFragment)},[]),!o.open){const t=i;return t?a.createPortal(n.jsx(ng,{scope:e.__scopeSelect,children:n.jsx(zm.Slot,{scope:e.__scopeSelect,children:n.jsx("div",{children:e.children})})}),t):null}return n.jsx(ag,{...e,ref:t})});eg.displayName=Jm;var tg=10,[ng,og]=Bm(Jm),rg=Fu("SelectContent.RemoveScroll"),ag=r.forwardRef((e,t)=>{const{__scopeSelect:o,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=e,w=Vm(Jm,o),[x,E]=r.useState(null),[S,_]=r.useState(null),k=Du(t,e=>E(e)),[C,N]=r.useState(null),[M,O]=r.useState(null),P=Lm(o),[R,A]=r.useState(!1),D=r.useRef(!1);r.useEffect(()=>{if(x)return hf(x)},[x]),yd();const T=r.useCallback(e=>{const[t,...n]=P().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===o&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==r)return}},[P,S]),I=r.useCallback(()=>T([C,x]),[T,C,x]);r.useEffect(()=>{R&&I()},[R,I]);const{onOpenChange:z,triggerPointerDownPosRef:L}=w;r.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||z(!1),document.removeEventListener("pointermove",t),L.current=null};return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,z,L]),r.useEffect(()=>{const e=()=>z(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);const[$,B]=Tg(e=>{const t=P().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=Ig(t,e,n);o&&setTimeout(()=>o.ref.current.focus())}),j=r.useCallback((e,t,n)=>{const o=!D.current&&!n;(void 0!==w.value&&w.value===t||o)&&(N(e),o&&(D.current=!0))},[w.value]),H=r.useCallback(()=>x?.focus(),[x]),F=r.useCallback((e,t,n)=>{const o=!D.current&&!n;(void 0!==w.value&&w.value===t||o)&&O(e)},[w.value]),V="popper"===a?sg:ig,W=V===sg?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return n.jsx(ng,{scope:o,content:x,viewport:S,onViewportChange:_,itemRefCallback:j,selectedItem:C,onItemLeave:H,itemTextRefCallback:F,focusSelectedItem:I,selectedItemText:M,position:a,isPositioned:R,searchRef:$,children:n.jsx(sf,{as:rg,allowPinchZoom:!0,children:n.jsx(id,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Pu(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:n.jsx(Ju,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:n.jsx(V,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...W,onPlaced:()=>A(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Pu(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>T(t)),e.preventDefault()}})})})})})})});ag.displayName="SelectContentImpl";var ig=r.forwardRef((e,t)=>{const{__scopeSelect:o,onPlaced:a,...i}=e,s=Vm(Jm,o),l=og(Jm,o),[c,u]=r.useState(null),[d,f]=r.useState(null),p=Du(t,e=>f(e)),h=Lm(o),m=r.useRef(!1),g=r.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=l,x=r.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&y&&v&&b){const e=s.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),o=b.getBoundingClientRect();if("rtl"!==s.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-tg,d=mp(a,[tg,Math.max(tg,u-l)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-tg,d=mp(a,[tg,Math.max(tg,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const r=h(),i=window.innerHeight-2*tg,l=y.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),w=f+p+l+parseInt(u.paddingBottom,10)+g,x=Math.min(5*v.offsetHeight,w),E=window.getComputedStyle(y),S=parseInt(E.paddingTop,10),_=parseInt(E.paddingBottom,10),k=e.top+e.height/2-tg,C=i-k,N=v.offsetHeight/2,M=f+p+(v.offsetTop+N),O=w-M;if(M<=k){const e=r.length>0&&v===r[r.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,n=M+Math.max(C,N+(e?_:0)+t+g);c.style.height=n+"px"}else{const e=r.length>0&&v===r[0].ref.current;c.style.top="0px";const t=Math.max(k,f+y.offsetTop+(e?S:0)+N)+O;c.style.height=t+"px",y.scrollTop=M-k+y.offsetTop}c.style.margin=`${tg}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,c,d,y,v,b,s.dir,a]);zu(()=>x(),[x]);const[E,S]=r.useState();zu(()=>{d&&S(window.getComputedStyle(d).zIndex)},[d]);const _=r.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return n.jsx(lg,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:_,children:n.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:n.jsx(Xu.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});ig.displayName="SelectItemAlignedPosition";var sg=r.forwardRef((e,t)=>{const{__scopeSelect:o,align:r="start",collisionPadding:a=tg,...i}=e,s=Hm(o);return n.jsx(Om,{...s,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.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)"}})});sg.displayName="SelectPopperPosition";var[lg,cg]=Bm(Jm,{}),ug="SelectViewport",dg=r.forwardRef((e,t)=>{const{__scopeSelect:o,nonce:a,...i}=e,s=og(ug,o),l=cg(ug,o),c=Du(t,s.onViewportChange),u=r.useRef(0);return n.jsxs(n.Fragment,{children:[n.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:a}),n.jsx(zm.Slot,{scope:o,children:n.jsx(Xu.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Pu(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=l;if(o?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*tg,r=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(r,a);if(i<o){const r=i+e,a=Math.min(o,r),s=r-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});dg.displayName=ug;var fg="SelectGroup",[pg,hg]=Bm(fg);r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=Bu();return n.jsx(pg,{scope:o,id:a,children:n.jsx(Xu.div,{role:"group","aria-labelledby":a,...r,ref:t})})}).displayName=fg;var mg="SelectLabel",gg=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=hg(mg,o);return n.jsx(Xu.div,{id:a.id,...r,ref:t})});gg.displayName=mg;var yg="SelectItem",[vg,bg]=Bm(yg),wg=r.forwardRef((e,t)=>{const{__scopeSelect:o,value:a,disabled:i=!1,textValue:s,...l}=e,c=Vm(yg,o),u=og(yg,o),d=c.value===a,[f,p]=r.useState(s??""),[h,m]=r.useState(!1),g=Du(t,e=>u.itemRefCallback?.(e,a,i)),y=Bu(),v=r.useRef("touch"),b=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};if(""===a)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return n.jsx(vg,{scope:o,value:a,disabled:i,textId:y,isSelected:d,onItemTextChange:r.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:n.jsx(zm.ItemSlot,{scope:o,value:a,disabled:i,textValue:f,children:n.jsx(Xu.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:g,onFocus:Pu(l.onFocus,()=>m(!0)),onBlur:Pu(l.onBlur,()=>m(!1)),onClick:Pu(l.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:Pu(l.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:Pu(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Pu(l.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pu(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Pu(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(Tm.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});wg.displayName=yg;var xg="SelectItemText",Eg=r.forwardRef((e,t)=>{const{__scopeSelect:o,className:i,style:s,...l}=e,c=Vm(xg,o),u=og(xg,o),d=bg(xg,o),f=Ym(xg,o),[p,h]=r.useState(null),m=Du(t,e=>h(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=p?.textContent,y=r.useMemo(()=>n.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=f;return zu(()=>(v(y),()=>b(y)),[v,b,y]),n.jsxs(n.Fragment,{children:[n.jsx(Xu.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?a.createPortal(l.children,c.valueNode):null]})});Eg.displayName=xg;var Sg="SelectItemIndicator",_g=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e;return bg(Sg,o).isSelected?n.jsx(Xu.span,{"aria-hidden":!0,...r,ref:t}):null});_g.displayName=Sg;var kg="SelectScrollUpButton",Cg=r.forwardRef((e,t)=>{const o=og(kg,e.__scopeSelect),a=cg(kg,e.__scopeSelect),[i,s]=r.useState(!1),l=Du(t,a.onScrollButtonChange);return zu(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?n.jsx(Og,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Cg.displayName=kg;var Ng="SelectScrollDownButton",Mg=r.forwardRef((e,t)=>{const o=og(Ng,e.__scopeSelect),a=cg(Ng,e.__scopeSelect),[i,s]=r.useState(!1),l=Du(t,a.onScrollButtonChange);return zu(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?n.jsx(Og,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Mg.displayName=Ng;var Og=r.forwardRef((e,t)=>{const{__scopeSelect:o,onAutoScroll:a,...i}=e,s=og("SelectScrollButton",o),l=r.useRef(null),c=Lm(o),u=r.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return r.useEffect(()=>()=>u(),[u]),zu(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),n.jsx(Xu.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Pu(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(a,50))}),onPointerMove:Pu(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(a,50))}),onPointerLeave:Pu(i.onPointerLeave,()=>{u()})})}),Pg=r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e;return n.jsx(Xu.div,{"aria-hidden":!0,...r,ref:t})});Pg.displayName="SelectSeparator";var Rg="SelectArrow";r.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,a=Hm(o),i=Vm(Rg,o),s=og(Rg,o);return i.open&&"popper"===s.position?n.jsx(Pm,{...a,...r,ref:t}):null}).displayName=Rg;var Ag=r.forwardRef(({__scopeSelect:e,value:t,...o},a)=>{const i=r.useRef(null),s=Du(a,i),l=Rm(t);return r.useEffect(()=>{const e=i.current;if(!e)return;const n=window.HTMLSelectElement.prototype,o=Object.getOwnPropertyDescriptor(n,"value").set;if(l!==t&&o){const n=new Event("change",{bubbles:!0});o.call(e,t),e.dispatchEvent(n)}},[l,t]),n.jsx(Xu.select,{...o,style:{...Am,...o.style},ref:s,defaultValue:t})});function Dg(e){return""===e||void 0===e}function Tg(e){const t=Ku(e),n=r.useRef(""),o=r.useRef(0),a=r.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),i=r.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,a,i]}function Ig(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0]),r=o?t[0]:t,a=n?e.indexOf(n):-1;let i=function(e,t){return e.map((n,o)=>e[(t+o)%e.length])}(e,Math.max(a,0));1===r.length&&(i=i.filter(e=>e!==n));const s=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return s!==n?s:void 0}Ag.displayName="SelectBubbleInput";var zg=qm,Lg=Gm,$g=Qm,Bg=eg,jg=dg,Hg=gg,Fg=wg,Vg=Eg,Wg=_g,Yg=Cg,Xg=Mg,Kg=Pg;const qg=Xm,Ug=Zm,Zg=r.forwardRef(({className:e,children:t,...n},o)=>r.createElement(zg,{ref:o,className:nu("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n},t,r.createElement(Lg,{asChild:!0},r.createElement(gs,{className:"h-4 w-4 opacity-50"}))));Zg.displayName=zg.displayName;const Gg=r.forwardRef(({className:e,...t},n)=>r.createElement(Yg,{ref:n,className:nu("flex cursor-default items-center justify-center py-1",e),...t},r.createElement(vs,{className:"h-4 w-4"})));Gg.displayName=Yg.displayName;const Qg=r.forwardRef(({className:e,...t},n)=>r.createElement(Xg,{ref:n,className:nu("flex cursor-default items-center justify-center py-1",e),...t},r.createElement(gs,{className:"h-4 w-4"})));Qg.displayName=Xg.displayName;const Jg=r.forwardRef(({className:e,children:t,position:n="popper",...o},a)=>r.createElement($g,null,r.createElement(Bg,{ref:a,className:nu("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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","popper"===n&&"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,...o},r.createElement(Gg,null),r.createElement(jg,{className:nu("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},t),r.createElement(Qg,null))));Jg.displayName=Bg.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(Hg,{ref:n,className:nu("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t})).displayName=Hg.displayName;const ey=r.forwardRef(({className:e,children:t,...n},o)=>r.createElement(Fg,{ref:o,className:nu("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n},r.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},r.createElement(Wg,null,r.createElement(ms,{className:"h-4 w-4"}))),r.createElement(Vg,null,t)));ey.displayName=Fg.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(Kg,{ref:n,className:nu("-mx-1 my-1 h-px bg-muted",e),...t})).displayName=Kg.displayName;var ty="Checkbox",[ny,oy]=Tu(ty),[ry,ay]=ny(ty);function iy(e){const{__scopeCheckbox:t,checked:o,children:a,defaultChecked:i,disabled:s,form:l,name:c,onCheckedChange:u,required:d,value:f="on",internal_do_not_use_render:p}=e,[h,m]=Hu({prop:o,defaultProp:i??!1,onChange:u,caller:ty}),[g,y]=r.useState(null),[v,b]=r.useState(null),w=r.useRef(!1),x=!g||(!!l||!!g.closest("form")),E={checked:h,disabled:s,setChecked:m,control:g,setControl:y,name:c,form:l,value:f,hasConsumerStoppedPropagationRef:w,required:d,defaultChecked:!my(i)&&i,isFormControl:x,bubbleInput:v,setBubbleInput:b};return n.jsx(ry,{scope:t,...E,children:hy(p)?p(E):a})}var sy="CheckboxTrigger",ly=r.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:o,...a},i)=>{const{control:s,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:g}=ay(sy,e),y=Du(i,f),v=r.useRef(u);return r.useEffect(()=>{const e=s?.form;if(e){const t=()=>p(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[s,p]),n.jsx(Xu.button,{type:"button",role:"checkbox","aria-checked":my(u)?"mixed":u,"aria-required":d,"data-state":gy(u),"data-disabled":c?"":void 0,disabled:c,value:l,...a,ref:y,onKeyDown:Pu(t,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:Pu(o,e=>{p(e=>!!my(e)||!e),g&&m&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})})});ly.displayName=sy;var cy=r.forwardRef((e,t)=>{const{__scopeCheckbox:o,name:r,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return n.jsx(iy,{__scopeCheckbox:o,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:e})=>n.jsxs(n.Fragment,{children:[n.jsx(ly,{...f,ref:t,__scopeCheckbox:o}),e&&n.jsx(py,{__scopeCheckbox:o})]})})});cy.displayName=ty;var uy="CheckboxIndicator",dy=r.forwardRef((e,t)=>{const{__scopeCheckbox:o,forceMount:r,...a}=e,i=ay(uy,o);return n.jsx(hd,{present:r||my(i.checked)||!0===i.checked,children:n.jsx(Xu.span,{"data-state":gy(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});dy.displayName=uy;var fy="CheckboxBubbleInput",py=r.forwardRef(({__scopeCheckbox:e,...t},o)=>{const{control:a,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:l,required:c,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:m}=ay(fy,e),g=Du(o,m),y=Rm(s),v=lm(a);r.useEffect(()=>{const e=h;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,o=!i.current;if(y!==s&&n){const t=new Event("click",{bubbles:o});e.indeterminate=my(s),n.call(e,!my(s)&&s),e.dispatchEvent(t)}},[h,y,s,i]);const b=r.useRef(!my(s)&&s);return n.jsx(Xu.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??b.current,required:c,disabled:u,name:d,value:f,form:p,...t,tabIndex:-1,ref:g,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function hy(e){return"function"==typeof e}function my(e){return"indeterminate"===e}function gy(e){return my(e)?"indeterminate":e?"checked":"unchecked"}py.displayName=fy;const yy=r.forwardRef(({className:e,...t},n)=>r.createElement(cy,{ref:n,className:nu("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t},r.createElement(dy,{className:nu("flex items-center justify-center text-current")},r.createElement(ms,{className:"h-4 w-4"}))));yy.displayName=cy.displayName;const vy=e.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),by=()=>{const t=e.useContext(vy);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};function wy(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function xy(){return Sy(/^iPad/)||Sy(/^Mac/)&&navigator.maxTouchPoints>1}function Ey(){return Sy(/^iPhone/)||xy()}function Sy(e){return"undefined"!=typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");const _y="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;function ky(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const Cy="undefined"!=typeof document&&window.visualViewport;function Ny(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function My(e){for(Ny(e)&&(e=e.parentElement);e&&!Ny(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Oy=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Py,Ry=0;function Ay(e={}){let{isDisabled:t}=e;_y(()=>{if(!t)return Ry++,1===Ry&&Ey()&&(Py=function(){let e,t=0,n=n=>{e=My(n.target),e===document.documentElement&&e===document.body||(t=n.changedTouches[0].pageY)},o=n=>{if(!e||e===document.documentElement||e===document.body)return void n.preventDefault();let o=n.changedTouches[0].pageY,r=e.scrollTop,a=e.scrollHeight-e.clientHeight;0!==a&&((r<=0&&o>t||r>=a&&o<t)&&n.preventDefault(),t=o)},r=e=>{let t=e.target;Iy(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},a=e=>{let t=e.target;Iy(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",Cy&&(Cy.height<window.innerHeight?requestAnimationFrame(()=>{Ty(t)}):Cy.addEventListener("resize",()=>Ty(t),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=ky(function(e,t,n){let o=e.style[t];return e.style[t]=n,()=>{e.style[t]=o}}(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let u=ky(Dy(document,"touchstart",n,{passive:!1,capture:!0}),Dy(document,"touchmove",o,{passive:!1,capture:!0}),Dy(document,"touchend",r,{passive:!1,capture:!0}),Dy(document,"focus",a,!0),Dy(window,"scroll",i));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{Ry--,0===Ry&&(null==Py||Py())}},[t])}function Dy(e,t,n,o){return e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o)}}function Ty(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=My(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,o=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=o-n)}e=t.parentElement}}function Iy(e){return e instanceof HTMLInputElement&&!Oy.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function zy(...e){return r.useCallback(function(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}(...e),e)}const Ly=new WeakMap;function $y(e,t,n=!1){if(!(e&&e instanceof HTMLElement))return;let o={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(o[t]=e.style[t],e.style[t]=n)}),n||Ly.set(e,o)}const By=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function jy(e,t){if(!e)return null;const n=window.getComputedStyle(e),o=n.transform||n.webkitTransform||n.mozTransform;let r=o.match(/^matrix3d\((.+)\)$/);return r?parseFloat(r[1].split(", ")[By(t)?13:12]):(r=o.match(/^matrix\((.+)\)$/),r?parseFloat(r[1].split(", ")[By(t)?5:4]):null)}function Hy(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const Fy={DURATION:.5,EASE:[.32,.72,0,1]},Vy=16,Wy="vaul-dragging";function Yy(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>null==n.current?void 0:n.current.call(n,...e),[])}function Xy({prop:t,defaultProp:n,onChange:o=()=>{}}){const[r,a]=function({defaultProp:t,onChange:n}){const o=e.useState(t),[r]=o,a=e.useRef(r),i=Yy(n);return e.useEffect(()=>{a.current!==r&&(i(r),a.current=r)},[r,a,i]),o}({defaultProp:n,onChange:o}),i=void 0!==t,s=i?t:r,l=Yy(o),c=e.useCallback(e=>{if(i){const n="function"==typeof e?e(t):e;n!==t&&l(n)}else a(e)},[i,t,a,l]);return[s,c]}let Ky=null;function qy({open:t,onOpenChange:n,children:o,onDrag:r,onRelease:a,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=.25,scrollLockTimeout:u=100,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:m,fixed:g,modal:y=!0,onClose:v,nested:b,noBodyStyles:w=!1,direction:x="bottom",defaultOpen:E=!1,disablePreventScroll:S=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:k=!1,repositionInputs:C=!0,onAnimationEnd:N,container:M,autoFocus:O=!1}){var P,R;const[A=!1,D]=Xy({defaultProp:E,prop:t,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==N||N(e)},1e3*Fy.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[T,I]=e.useState(!1),[z,L]=e.useState(!1),[$,B]=e.useState(!1),j=e.useRef(null),H=e.useRef(null),F=e.useRef(null),V=e.useRef(null),W=e.useRef(null),Y=e.useRef(!1),X=e.useRef(null),K=e.useRef(0),q=e.useRef(!1),U=e.useRef(!E),Z=e.useRef(0),G=e.useRef(null),Q=e.useRef((null==(P=G.current)?void 0:P.getBoundingClientRect().height)||0),J=e.useRef((null==(R=G.current)?void 0:R.getBoundingClientRect().width)||0),ee=e.useRef(0),te=e.useCallback(e=>{i&&e===ie.length-1&&(H.current=new Date)},[]),{activeSnapPoint:ne,activeSnapPointIndex:oe,setActiveSnapPoint:re,onRelease:ae,snapPointsOffset:ie,onDrag:se,shouldFade:le,getPercentageDragged:ce}=function({activeSnapPointProp:t,setActiveSnapPointProp:n,snapPoints:o,drawerRef:r,overlayRef:a,fadeFromIndex:i,onSnapPointChange:s,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=Xy({prop:t,defaultProp:null==o?void 0:o[0],onChange:n}),[p,h]=e.useState("undefined"!=typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);e.useEffect(()=>{function e(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const m=e.useMemo(()=>d===(null==o?void 0:o[o.length-1])||null,[o,d]),g=e.useMemo(()=>{var e;return null!=(e=null==o?void 0:o.findIndex(e=>e===d))?e:null},[o,d]),y=o&&o.length>0&&(i||0===i)&&!Number.isNaN(i)&&o[i]===d||!o,v=e.useMemo(()=>{const e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:"undefined"!=typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var t;return null!=(t=null==o?void 0:o.map(t=>{const n="string"==typeof t;let o=0;if(n&&(o=parseInt(t,10)),By(l)){const r=n?o:p?t*e.height:0;return p?"bottom"===l?e.height-r:-e.height+r:r}const r=n?o:p?t*e.width:0;return p?"right"===l?e.width-r:-e.width+r:r}))?t:[]},[o,p,c]),b=e.useMemo(()=>null!==g?null==v?void 0:v[g]:null,[v,g]),w=e.useCallback(e=>{var t;const n=null!=(t=null==v?void 0:v.findIndex(t=>t===e))?t:null;s(n),$y(r.current,{transition:`transform ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`,transform:By(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==i&&n!==i&&n<i?$y(a.current,{transition:`opacity ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`,opacity:"0"}):$y(a.current,{transition:`opacity ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`,opacity:"1"}),f(null==o?void 0:o[Math.max(n,0)])},[r.current,o,v,i,a,f]);return e.useEffect(()=>{if(d||t){var e;const n=null!=(e=null==o?void 0:o.findIndex(e=>e===t||e===d))?e:-1;v&&-1!==n&&"number"==typeof v[n]&&w(v[n])}},[d,t,o,v,w]),{isLastSnapPoint:m,activeSnapPoint:d,shouldFade:y,getPercentageDragged:function(e,t){if(!o||"number"!=typeof g||!v||void 0===i)return null;const n=g===i-1;if(g>=i&&t)return 0;if(n&&!t)return 1;if(!y&&!n)return null;const r=n?g+1:g-1,a=n?v[r]-v[r-1]:v[r+1]-v[r],s=e/Math.abs(a);return n?1-s:s},setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:r}){if(void 0===i)return;const s="bottom"===l||"right"===l?(null!=b?b:0)-e:(null!=b?b:0)+e,c=0===g,d=e>0;if(g===i-1&&$y(a.current,{transition:`opacity ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`}),!u&&n>2&&!d)return void(r?t():w(v[0]));if(!u&&n>2&&d&&v&&o)return void w(v[o.length-1]);const f=null==v?void 0:v.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-s)<Math.abs(e-s)?t:e),p=By(l)?window.innerHeight:window.innerWidth;if(n>.4&&Math.abs(e)<.4*p){const e=d?1:-1;if(e>0&&m&&o)return void w(v[o.length-1]);if(c&&e<0&&r&&t(),null===g)return;return void w(v[g+e])}w(f)},onDrag:function({draggedDistance:e}){if(null===b)return;const t="bottom"===l||"right"===l?b-e:b+e;("bottom"===l||"right"===l)&&t<v[v.length-1]||("top"===l||"left"===l)&&t>v[v.length-1]||$y(r.current,{transform:By(l)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:v}}({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:G,fadeFromIndex:p,overlayRef:j,onSnapPointChange:te,direction:x,container:M,snapToSequentialPoint:_});Ay({isDisabled:!A||z||!y||$||!T||!C||!S});const{restorePositionSetting:ue}=function({isOpen:t,modal:n,nested:o,hasBeenOpened:r,preventScrollRestoration:a,noBodyStyles:i}){const[s,l]=e.useState(()=>"undefined"!=typeof window?window.location.href:""),c=e.useRef(0),u=e.useCallback(()=>{if(wy()&&null===Ky&&t&&!i){Ky={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:-c.current+"px",left:-e+"px",right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=-(c.current+e)+"px")}),300)}},[t]),d=e.useCallback(()=>{if(wy()&&null!==Ky&&!i){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ky),window.requestAnimationFrame(()=>{a&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),Ky=null}},[s]);return e.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),e.useEffect(()=>{if(n)return()=>{"undefined"!=typeof document&&(document.querySelector("[data-vaul-drawer]")||d())}},[n,d]),e.useEffect(()=>{!o&&r&&(t?(!window.matchMedia("(display-mode: standalone)").matches&&u(),n||window.setTimeout(()=>{d()},500)):d())},[t,r,s,n,o,u,d]),{restorePositionSetting:d}}({isOpen:A,modal:y,nested:null!=b&&b,hasBeenOpened:T,preventScrollRestoration:k,noBodyStyles:w});function de(){return(window.innerWidth-26)/window.innerWidth}function fe(e,t){var n;let o=e;const r=null==(n=window.getSelection())?void 0:n.toString(),a=G.current?jy(G.current,x):null,i=new Date;if("SELECT"===o.tagName)return!1;if(o.hasAttribute("data-vaul-no-drag")||o.closest("[data-vaul-no-drag]"))return!1;if("right"===x||"left"===x)return!0;if(H.current&&i.getTime()-H.current.getTime()<500)return!1;if(null!==a&&("bottom"===x?a>0:a<0))return!0;if(r&&r.length>0)return!1;if(W.current&&i.getTime()-W.current.getTime()<u&&0===a)return W.current=i,!1;if(t)return W.current=i,!1;for(;o;){if(o.scrollHeight>o.clientHeight){if(0!==o.scrollTop)return W.current=new Date,!1;if("dialog"===o.getAttribute("role"))return!0}o=o.parentNode}return!0}function pe(e){!function(){if(!z||!G.current)return;G.current.classList.remove(Wy),Y.current=!1,L(!1),V.current=new Date}(),null==v||v(),e||D(!1),setTimeout(()=>{i&&re(i[0])},1e3*Fy.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=jy(G.current,x);$y(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`}),$y(j.current,{transition:`opacity ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&A&&$y(e,{borderRadius:"8px",overflow:"hidden",...By(x)?{transform:`scale(${de()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${de()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Fy.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Fy.EASE.join(",")})`},!0)}return e.useEffect(()=>{window.requestAnimationFrame(()=>{U.current=!0})},[]),e.useEffect(()=>{var e;function t(){if(!G.current||!C)return;if(Iy(document.activeElement)||q.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight;let o=n-t;const r=G.current.getBoundingClientRect().height||0,a=r>.8*n;ee.current||(ee.current=r);const s=G.current.getBoundingClientRect().top;if(Math.abs(Z.current-o)>60&&(q.current=!q.current),i&&i.length>0&&ie&&oe){o+=ie[oe]||0}if(Z.current=o,r>t||q.current){const e=G.current.getBoundingClientRect().height;let n=e;e>t&&(n=t-(a?s:26)),G.current.style.height=g?e-Math.max(o,0)+"px":`${Math.max(n,t-s)}px`}else(function(){const e=navigator.userAgent;return"undefined"!=typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))})()||(G.current.style.height=`${ee.current}px`);i&&i.length>0&&!q.current?G.current.style.bottom="0px":G.current.style.bottom=`${Math.max(o,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[oe,i,ie]),e.useEffect(()=>(A&&($y(document.documentElement,{scrollBehavior:"auto"}),H.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=Ly.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[A]),e.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),e.createElement(qf,{defaultOpen:E,onOpenChange:e=>{(d||e)&&(e?I(!0):pe(!0),D(e))},open:A},e.createElement(vy.Provider,{value:{activeSnapPoint:ne,snapPoints:i,setActiveSnapPoint:re,drawerRef:G,overlayRef:j,onOpenChange:n,onPress:function(e){var t,n;(d||i)&&(G.current&&!G.current.contains(e.target)||(Q.current=(null==(t=G.current)?void 0:t.getBoundingClientRect().height)||0,J.current=(null==(n=G.current)?void 0:n.getBoundingClientRect().width)||0,L(!0),F.current=new Date,Ey()&&window.addEventListener("touchend",()=>Y.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=By(x)?e.pageY:e.pageX))},onRelease:function(e){if(!z||!G.current)return;G.current.classList.remove(Wy),Y.current=!1,L(!1),V.current=new Date;const t=jy(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===F.current)return;const n=V.current.getTime()-F.current.getTime(),o=K.current-(By(x)?e.pageY:e.pageX),r=Math.abs(o)/n;if(r>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),i){return ae({draggedDistance:o*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:r,dismissible:d}),void(null==a||a(e,!0))}if("bottom"===x||"right"===x?o>0:o<0)return he(),void(null==a||a(e,!0));if(r>.4)return pe(),void(null==a||a(e,!1));var s;const l=Math.min(null!=(s=G.current.getBoundingClientRect().height)?s:0,window.innerHeight);var u;const f=Math.min(null!=(u=G.current.getBoundingClientRect().width)?u:0,window.innerWidth),p="left"===x||"right"===x;if(Math.abs(t)>=(p?f:l)*c)return pe(),void(null==a||a(e,!1));null==a||a(e,!0),he()},onDrag:function(e){var t;if(G.current&&z){const n="bottom"===x||"right"===x?1:-1,o=(K.current-(By(x)?e.pageY:e.pageX))*n,a=o>0,l=i&&!d&&!a;if(l&&0===oe)return;const c=Math.abs(o),u=document.querySelector("[data-vaul-drawer-wrapper]");let f=c/("bottom"===x||"top"===x?Q.current:J.current);const h=ce(c,a);if(null!==h&&(f=h),l&&f>=1)return;if(!Y.current&&!fe(e.target,a))return;if(G.current.classList.add(Wy),Y.current=!0,$y(G.current,{transition:"none"}),$y(j.current,{transition:"none"}),i&&se({draggedDistance:o}),a&&!i){const e=(t=o,8*(Math.log(t+1)-2)),r=Math.min(-1*e,0)*n;return void $y(G.current,{transform:By(x)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`})}const m=1-f;if((le||p&&oe===p-1)&&(null==r||r(e,f),$y(j.current,{opacity:`${m}`,transition:"none"},!0)),u&&j.current&&s){const e=Math.min(de()+f*(1-de()),1),t=8-8*f,n=Math.max(0,14-14*f);$y(u,{borderRadius:`${t}px`,transform:By(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){const e=c*n;$y(G.current,{transform:By(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:U,handleOnly:f,isOpen:A,isDragging:z,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-Vy)/window.innerWidth,o=n+t*(1-n),r=t*Vy-16;$y(G.current,{transform:By(x)?`scale(${o}) translate3d(0, ${r}px, 0)`:`scale(${o}) translate3d(${r}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-Vy)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),$y(G.current,{transition:`transform ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`,transform:By(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&G.current&&(X.current=setTimeout(()=>{const e=jy(G.current,x);$y(G.current,{transition:"none",transform:By(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=By(x)?window.innerHeight:window.innerWidth,o=t?(n-Vy)/n:1,r=t?-16:0;t&&$y(G.current,{transition:`transform ${Fy.DURATION}s cubic-bezier(${Fy.EASE.join(",")})`,transform:By(x)?`scale(${o}) translate3d(0, ${r}px, 0)`:`scale(${o}) translate3d(${r}px, 0, 0)`})},keyboardIsOpen:q,modal:y,snapPointsOffset:ie,activeSnapPointIndex:oe,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:l,noBodyStyles:w,container:M,autoFocus:O}},o))}const Uy=e.forwardRef(function({...t},n){const{overlayRef:o,snapPoints:r,onRelease:a,shouldFade:i,isOpen:s,modal:l,shouldAnimate:c}=by(),u=zy(n,o),d=r&&r.length>0;if(!l)return null;const f=e.useCallback(e=>a(e),[a]);return e.createElement(Gf,{onMouseUp:f,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&d?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":(null==c?void 0:c.current)?"true":"false",...t})});Uy.displayName="Drawer.Overlay";const Zy=e.forwardRef(function({onPointerDownOutside:t,style:n,onOpenAutoFocus:o,...r},a){const{drawerRef:i,onPress:s,onRelease:l,onDrag:c,keyboardIsOpen:u,snapPointsOffset:d,activeSnapPointIndex:f,modal:p,isOpen:h,direction:m,snapPoints:g,container:y,handleOnly:v,shouldAnimate:b,autoFocus:w}=by(),[x,E]=e.useState(!1),S=zy(a,i),_=e.useRef(null),k=e.useRef(null),C=e.useRef(!1),N=g&&g.length>0;!function(){const{direction:t,isOpen:n,shouldScaleBackground:o,setBackgroundColorOnScale:r,noBodyStyles:a}=by(),i=e.useRef(null),s=e.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-26)/window.innerWidth}e.useEffect(()=>{if(n&&o){i.current&&clearTimeout(i.current);const e=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!e)return;r&&!a&&Hy(document.body,{background:"black"}),Hy(e,{transformOrigin:By(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Fy.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Fy.EASE.join(",")})`});const n=Hy(e,{borderRadius:"8px",overflow:"hidden",...By(t)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),i.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},1e3*Fy.DURATION)}}},[n,o,s])}();function M(e){_.current=null,C.current=!1,l(e)}return e.useEffect(()=>{N&&window.requestAnimationFrame(()=>{E(!0)})},[]),e.createElement(Qf,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":x?"true":"false","data-vaul-snap-points":h&&N?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":(null==b?void 0:b.current)?"true":"false",...r,ref:S,style:d&&d.length>0?{"--snap-point-height":`${d[null!=f?f:0]}px`,...n}:n,onPointerDown:e=>{v||(null==r.onPointerDown||r.onPointerDown.call(r,e),_.current={x:e.pageX,y:e.pageY},s(e))},onOpenAutoFocus:e=>{null==o||o(e),w||e.preventDefault()},onPointerDownOutside:e=>{null==t||t(e),p&&!e.defaultPrevented?u.current&&(u.current=!1):e.preventDefault()},onFocusOutside:e=>{p||e.preventDefault()},onPointerMove:e=>{if(k.current=e,v)return;if(null==r.onPointerMove||r.onPointerMove.call(r,e),!_.current)return;const t=e.pageY-_.current.y,n=e.pageX-_.current.x,o="touch"===e.pointerType?10:2,a=((e,t,n=0)=>{if(C.current)return!0;const o=Math.abs(e.y),r=Math.abs(e.x),a=r>o,i=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*i<0)&&r>=0&&r<=n)return a}else if(!(e.y*i<0)&&o>=0&&o<=n)return!a;return C.current=!0,!0})({x:n,y:t},m,o);a?c(e):(Math.abs(n)>o||Math.abs(t)>o)&&(_.current=null)},onPointerUp:e=>{null==r.onPointerUp||r.onPointerUp.call(r,e),_.current=null,C.current=!1,l(e)},onPointerOut:e=>{null==r.onPointerOut||r.onPointerOut.call(r,e),M(k.current)},onContextMenu:e=>{null==r.onContextMenu||r.onContextMenu.call(r,e),k.current&&M(k.current)}})});Zy.displayName="Drawer.Content";const Gy=e.forwardRef(function({preventCycle:t=!1,children:n,...o},r){const{closeDrawer:a,isDragging:i,snapPoints:s,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:u,handleOnly:d,isOpen:f,onPress:p,onDrag:h}=by(),m=e.useRef(null),g=e.useRef(!1);function y(){m.current&&window.clearTimeout(m.current),g.current=!1}return e.createElement("div",{onClick:function(){g.current?y():window.setTimeout(()=>{!function(){if(i||t||g.current)return void y();if(y(),!s||0===s.length)return void(u||a());if(l===s[s.length-1]&&u)return void a();const e=s.findIndex(e=>e===l);if(-1===e)return;const n=s[e+1];c(n)}()},120)},onPointerCancel:y,onPointerDown:e=>{d&&p(e),m.current=window.setTimeout(()=>{g.current=!0},250)},onPointerMove:e=>{d&&h(e)},ref:r,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...o},e.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});Gy.displayName="Drawer.Handle";const Qy={Root:qy,NestedRoot:function({onDrag:t,onOpenChange:n,open:o,...r}){const{onNestedDrag:a,onNestedOpenChange:i,onNestedRelease:s}=by();if(!a)throw new Error("Drawer.NestedRoot must be placed in another drawer");return e.createElement(qy,{nested:!0,open:o,onClose:()=>{i(!1)},onDrag:(e,n)=>{a(e,n),null==t||t(e,n)},onOpenChange:e=>{e&&i(e),null==n||n(e)},onRelease:s,...r})},Content:Zy,Overlay:Uy,Trigger:Uf,Portal:function(t){const n=by(),{container:o=n.container,...r}=t;return e.createElement(Zf,{container:o,...r})},Handle:Gy,Close:tp,Title:Jf,Description:ep},Jy=({shouldScaleBackground:e=!0,...t})=>r.createElement(Qy.Root,{shouldScaleBackground:e,...t});Jy.displayName="Drawer";const ev=Qy.Portal,tv=r.forwardRef(({className:e,...t},n)=>r.createElement(Qy.Overlay,{ref:n,className:nu("fixed inset-0 z-50 bg-black/80",e),...t}));tv.displayName=Qy.Overlay.displayName;const nv=r.forwardRef(({className:e,children:t,...n},o)=>r.createElement(ev,null,r.createElement(tv,null),r.createElement(Qy.Content,{ref:o,className:nu("fixed inset-x-0 top-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n},r.createElement("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t)));nv.displayName="DrawerContent";r.forwardRef(({className:e,...t},n)=>r.createElement(Qy.Title,{ref:n,className:nu("text-lg font-semibold leading-none tracking-tight",e),...t})).displayName=Qy.Title.displayName;r.forwardRef(({className:e,...t},n)=>r.createElement(Qy.Description,{ref:n,className:nu("text-sm text-muted-foreground",e),...t})).displayName=Qy.Description.displayName,exports.AgenticFlowVisualizer=hp,exports.AnthropicIcon=pu,exports.Badge=lu,exports.Checkbox=yy,exports.Drawer=Jy,exports.Edge=Es,exports.FileSelector=({files:t,currentFile:n,onFileSelect:o,onRefresh:r,loading:a=!1,disabled:i=!1})=>e.createElement("div",{className:"flex items-center gap-2"},0!==t.length||a?e.createElement(qg,{value:n||"",onValueChange:o,disabled:i||a},e.createElement(Zg,{className:nu("w-fit shadcn-select transition-all duration-200",(i||a)&&"opacity-60 cursor-not-allowed")},e.createElement("div",{className:"flex items-center justify-between w-full gap-3 p-2"},e.createElement(Ug,{placeholder:a?"Loading sessions...":0===t.length?"No sessions found":"Select an Agent Session..."}))),e.createElement(Jg,null,0!==t.length||a?t.map(t=>e.createElement(ey,{key:t.name,value:t.name},t.name)):e.createElement("div",{className:"px-2 py-3 text-center text-sm text-gray-500"},"No agent sessions available"))):e.createElement("div",{className:"text-sm text-gray-500 px-3 py-2"},"No agent sessions available"),t.length>0&&e.createElement("button",{onClick:e=>{e.stopPropagation(),r()},disabled:a||i,title:a?"Loading...":"Refresh files",className:nu("file-selector-refresh-btn transition-all duration-200",(a||i)&&"opacity-50 cursor-not-allowed")},a?e.createElement(bs,{className:"h-4 w-4 animate-spin text-gray-400"}):e.createElement(xs,{className:"h-4 w-4"}))),exports.GoogleIcon=hu,exports.JsonTreeViewer=du,exports.Node=gu,exports.OpenAIIcon=fu,exports.Select=qg,exports.Sheet=rp,exports.Timeline=Ou,exports.Visualizer=t=>e.createElement(Vi,null,e.createElement(hp,t)),exports.calculateAutoLayout=fp,exports.cn=nu,exports.formatCurrency=au,exports.formatLatency=iu,exports.toTitleCase=ou,exports.truncateText=ru;
198
+ `,hu=Cc.div`
199
+ background-color: ${e=>e.theme.colors.card};
200
+ border: 1px solid ${e=>e.theme.colors.border};
201
+ border-radius: 0.5rem;
202
+ overflow: hidden;
203
+ width: 100%;
204
+ max-width: 400px;
205
+ `,mu=Cc.div`
206
+ display: flex;
207
+ justify-content: space-between;
208
+ align-items: center;
209
+ padding: 0.75rem;
210
+ border-bottom: 1px solid ${e=>e.theme.colors.border};
211
+ background-color: ${e=>e.theme.colors.muted};
212
+ `,gu=Cc.h3`
213
+ margin: 0;
214
+ font-size: 0.875rem;
215
+ font-weight: 600;
216
+ color: ${e=>e.theme.colors.cardForeground};
217
+ `,yu=Cc.button`
218
+ display: flex;
219
+ align-items: center;
220
+ justify-content: center;
221
+ padding: 0.25rem;
222
+ border: none;
223
+ background: none;
224
+ color: ${e=>e.theme.colors.mutedForeground};
225
+ cursor: pointer;
226
+ border-radius: 0.25rem;
227
+ transition: all 0.2s ease-in-out;
228
+
229
+ &:hover {
230
+ background-color: ${e=>e.theme.colors.accent};
231
+ color: ${e=>e.theme.colors.accentForeground};
232
+ }
233
+ `,vu=Cc.div`
234
+ padding: 0.75rem;
235
+ max-height: 400px;
236
+ overflow-y: auto;
237
+ `,bu=Cc.div`
238
+ position: relative;
239
+ padding: 0.5rem;
240
+ border-radius: 0.375rem;
241
+ margin-bottom: 0.5rem;
242
+ cursor: ${e=>e.hasStep?"pointer":"default"};
243
+ transition: all 0.2s ease-in-out;
244
+ background-color: ${e=>e.isActive?e.theme.colors.primary:e.isPast?e.theme.colors.muted:"transparent"};
245
+ color: ${e=>e.isActive?e.theme.colors.primaryForeground:e.theme.colors.cardForeground};
246
+
247
+ &:hover {
248
+ background-color: ${e=>e.hasStep&&!e.isActive?e.theme.colors.accent:e.isActive?e.theme.colors.primary:"transparent"};
249
+ }
250
+ `,wu=Cc.div`
251
+ display: flex;
252
+ align-items: center;
253
+ gap: 0.5rem;
254
+ margin-bottom: 0.25rem;
255
+ `,xu=Cc.div`
256
+ width: 0.5rem;
257
+ height: 0.5rem;
258
+ border-radius: 50%;
259
+ background-color: ${e=>e.isActive?e.theme.colors.primaryForeground:e.isPast?e.theme.colors.primary:e.hasStep?e.theme.colors.mutedForeground:e.theme.colors.border};
260
+ flex-shrink: 0;
261
+ `,Eu=Cc.span`
262
+ font-weight: 600;
263
+ font-size: 0.75rem;
264
+ color: ${e=>e.isActive?e.theme.colors.primaryForeground:e.theme.colors.cardForeground};
265
+ `,Su=Cc.div`
266
+ font-size: 0.75rem;
267
+ color: ${e=>e.hasStep?e.theme.colors.cardForeground:e.theme.colors.mutedForeground};
268
+ font-style: ${e=>e.hasStep?"normal":"italic"};
269
+ `,_u=Cc.div`
270
+ position: absolute;
271
+ top: 0;
272
+ left: 0;
273
+ right: 0;
274
+ bottom: 0;
275
+ border: 2px solid ${e=>e.theme.colors.primary};
276
+ border-radius: 0.375rem;
277
+ pointer-events: none;
278
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
279
+
280
+ @keyframes pulse {
281
+ 0%,
282
+ 100% {
283
+ opacity: 1;
284
+ }
285
+ 50% {
286
+ opacity: 0.5;
287
+ }
288
+ }
289
+ `,Cu=({stamps:t,currentStep:n,onStepChange:r,onToggle:o})=>{const a=t.length>0?Math.max(...t.map(e=>e.step)):0,i=t.length>0?Math.min(...t.map(e=>e.step)):0,s=a-i+1,l=e=>e<5e3?"latencyLow":e<=3e4?"latencyMedium":"latencyHigh";return e.createElement(hu,null,e.createElement(mu,null,e.createElement(gu,null,"Timeline"),o&&e.createElement(yu,{onClick:o,title:"Collapse Panel"},e.createElement(ws,{size:16}))),e.createElement(vu,null,Array.from({length:s},(o,a)=>{const s=i+a,c=s===n,u=s<n,d=t.some(e=>e.step===s),f=(e=>{const n=t.filter(t=>t.step===e);if(0===n.length)return null;const r=e-1,o=t.filter(e=>e.step===r);return 0===o.length?null:Math.min(...n.map(e=>e.time))-Math.max(...o.map(e=>e.time))})(s),p=(e=>{const n=t.filter(t=>t.step===e);return 0===n.length?`Step ${e}`:n[0]?.identifier||`Step ${e}`})(s);return e.createElement(bu,{key:s,isActive:c,isPast:u,hasStep:d,onClick:()=>d&&r(s)},e.createElement(wu,null,e.createElement(xu,{isActive:c,isPast:u,hasStep:d}),e.createElement(Eu,{isActive:c},"Step ",s),f&&e.createElement(Ac,{variant:l(f),style:{marginLeft:"auto"}},(e=>e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`)(f))),e.createElement(Su,{hasStep:d},d?p:"No activity"),c&&e.createElement(_u,null))})))};function ku(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function Nu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Mu(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Nu(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Nu(e[t],null)}}}}function Ru(...e){return o.useCallback(Mu(...e),e)}function Ou(e,t=[]){let r=[];const a=()=>{const t=r.map(e=>o.createContext(e));return function(n){const r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return a.scopeName=e,[function(t,a){const i=o.createContext(a),s=r.length;r=[...r,a];const l=t=>{const{scope:r,children:a,...l}=t,c=r?.[e]?.[s]||i,u=o.useMemo(()=>l,Object.values(l));return n.jsx(c.Provider,{value:u,children:a})};return l.displayName=t+"Provider",[l,function(n,r){const l=r?.[e]?.[s]||i,c=o.useContext(l);if(c)return c;if(void 0!==a)return a;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Pu(a,...t)]}function Pu(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Au=globalThis?.document?o.useLayoutEffect:()=>{},Tu=o[" useId ".trim().toString()]||(()=>{}),Du=0;function $u(e){const[t,n]=o.useState(Tu());return Au(()=>{e||n(e=>e??String(Du++))},[e]),e||(t?`radix-${t}`:"")}var Iu=o[" useInsertionEffect ".trim().toString()]||Au;function zu({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,s]=function({defaultProp:e,onChange:t}){const[n,r]=o.useState(e),a=o.useRef(n),i=o.useRef(t);return Iu(()=>{i.current=t},[t]),o.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:a;{const t=o.useRef(void 0!==e);o.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,r])}const u=o.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else i(t)},[l,e,i,s]);return[c,u]}function Lu(e){const t=Bu(e),r=o.forwardRef((e,r)=>{const{children:a,...i}=e,s=o.Children.toArray(a),l=s.find(ju);if(l){const e=l.props.children,a=s.map(t=>t===l?o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null:t);return n.jsx(t,{...i,ref:r,children:o.isValidElement(e)?o.cloneElement(e,void 0,a):null})}return n.jsx(t,{...i,ref:r,children:a})});return r.displayName=`${e}.Slot`,r}function Bu(e){const t=o.forwardRef((e,t)=>{const{children:n,...r}=e;if(o.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),a=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==o.Fragment&&(a.ref=t?Mu(t,e):e),o.cloneElement(n,a)}return o.Children.count(n)>1?o.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fu=Symbol("radix.slottable");function ju(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Fu}var Hu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const r=Lu(`Primitive.${t}`),a=o.forwardRef((e,o)=>{const{asChild:a,...i}=e,s=a?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),n.jsx(s,{...i,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function Vu(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...e)=>t.current?.(...e),[])}var Wu,Yu="dismissableLayer.update",Xu="dismissableLayer.pointerDownOutside",Ku="dismissableLayer.focusOutside",Uu=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qu=o.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=e,d=o.useContext(Uu),[f,p]=o.useState(null),h=f?.ownerDocument??globalThis?.document,[,m]=o.useState({}),g=Ru(t,e=>p(e)),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=f?y.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,E=w>=b,S=function(e,t=globalThis?.document){const n=Vu(e),r=o.useRef(!1),a=o.useRef(()=>{});return o.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Qu(Xu,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=r,t.addEventListener("click",a.current,{once:!0})):r()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...d.branches].some(e=>e.contains(t));E&&!n&&(i?.(e),l?.(e),e.defaultPrevented||c?.())},h),_=function(e,t=globalThis?.document){const n=Vu(e),r=o.useRef(!1);return o.useEffect(()=>{const e=e=>{if(e.target&&!r.current){Qu(Ku,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),l?.(e),e.defaultPrevented||c?.())},h);return function(e,t=globalThis?.document){const n=Vu(e);o.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===d.layers.size-1&&(a?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},h),o.useEffect(()=>{if(f)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Wu=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Gu(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Wu)}},[f,h,r,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Gu())},[f,d]),o.useEffect(()=>{const e=()=>m({});return document.addEventListener(Yu,e),()=>document.removeEventListener(Yu,e)},[]),n.jsx(Hu.div,{...u,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:ku(e.onFocusCapture,_.onFocusCapture),onBlurCapture:ku(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:ku(e.onPointerDownCapture,S.onPointerDownCapture)})});qu.displayName="DismissableLayer";var Zu=o.forwardRef((e,t)=>{const r=o.useContext(Uu),a=o.useRef(null),i=Ru(t,a);return o.useEffect(()=>{const e=a.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),n.jsx(Hu.div,{...e,ref:i})});function Gu(){const e=new CustomEvent(Yu);document.dispatchEvent(e)}function Qu(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}(o,i):o.dispatchEvent(i)}Zu.displayName="DismissableLayerBranch";var Ju="focusScope.autoFocusOnMount",ed="focusScope.autoFocusOnUnmount",td={bubbles:!1,cancelable:!0},nd=o.forwardRef((e,t)=>{const{loop:r=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,u]=o.useState(null),d=Vu(i),f=Vu(s),p=o.useRef(null),h=Ru(t,e=>u(e)),m=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(a){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?p.current=t:id(p.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||id(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&id(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[a,c,m.paused]),o.useEffect(()=>{if(c){sd.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(Ju,td);c.addEventListener(Ju,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(id(r,{select:t}),document.activeElement!==n)return}((e=rd(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&id(c))}return()=>{c.removeEventListener(Ju,d),setTimeout(()=>{const e=new CustomEvent(ed,td);c.addEventListener(ed,f),c.dispatchEvent(e),e.defaultPrevented||id(t??document.body,{select:!0}),c.removeEventListener(ed,f),sd.remove(m)},0)}}var e},[c,d,f,m]);const g=o.useCallback(e=>{if(!r&&!a)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,a]=function(e){const t=rd(e),n=od(t,e),r=od(t.reverse(),e);return[n,r]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&id(a,{select:!0})):(e.preventDefault(),r&&id(o,{select:!0})):n===t&&e.preventDefault()}},[r,a,m.paused]);return n.jsx(Hu.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})});function rd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function od(e,t){for(const n of e)if(!ad(n,{upTo:t}))return n}function ad(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function id(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}nd.displayName="FocusScope";var sd=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ld(e,t),e.unshift(t)},remove(t){e=ld(e,t),e[0]?.resume()}}}();function ld(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var cd=o.forwardRef((e,r)=>{const{container:a,...i}=e,[s,l]=o.useState(!1);Au(()=>l(!0),[]);const c=a||s&&globalThis?.document?.body;return c?t.createPortal(n.jsx(Hu.div,{...i,ref:r}),c):null});cd.displayName="Portal";var ud=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=o.useState(),r=o.useRef(null),a=o.useRef(e),i=o.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect(()=>{const e=dd(r.current);i.current="mounted"===l?e:"none"},[l]),Au(()=>{const t=r.current,n=a.current;if(n!==e){const r=i.current,o=dd(t);if(e)c("MOUNT");else if("none"===o||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),Au(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,o=o=>{const i=dd(r.current).includes(CSS.escape(o.animationName));if(o.target===t&&i&&(c("ANIMATION_END"),!a.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(i.current=dd(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",o),t.addEventListener("animationend",o),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",o),t.removeEventListener("animationend",o)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:o.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:r.isPresent}):o.Children.only(n),i=Ru(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||r.isPresent?o.cloneElement(a,{ref:i}):null};function dd(e){return e?.animationName||"none"}ud.displayName="Presence";var fd=0;function pd(){o.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hd()),document.body.insertAdjacentElement("beforeend",e[1]??hd()),fd++,()=>{1===fd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),fd--}},[])}function hd(){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 md=function(){return md=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},md.apply(this,arguments)};function gd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var yd="right-scroll-bar-position",vd="width-before-scroll-bar";function bd(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var wd="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,xd=new WeakMap;function Ed(t,n){var r,o,a,i=(r=n||null,o=function(e){return t.forEach(function(t){return bd(t,e)})},(a=e.useState(function(){return{value:r,callback:o,facade:{get current(){return a.value},set current(e){var t=a.value;t!==e&&(a.value=e,a.callback(e,t))}}}})[0]).callback=o,a.facade);return wd(function(){var e=xd.get(i);if(e){var n=new Set(e),r=new Set(t),o=i.current;n.forEach(function(e){r.has(e)||bd(e,null)}),r.forEach(function(e){n.has(e)||bd(e,o)})}xd.set(i,t)},[t]),i}function Sd(e){return e}var _d=function(e){var t=e.sideCar,n=gd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return o.createElement(r,md({},n))};_d.isSideCarExport=!0;var Cd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Sd);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}};return o}(null);return t.options=md({async:!0,ssr:!1},e),t}(),kd=function(){},Nd=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:kd,onWheelCapture:kd,onTouchMoveCapture:kd}),a=r[0],i=r[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,b=void 0===v?"div":v,w=e.gapMode,x=gd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,S=Ed([n,t]),_=md(md({},x),a);return o.createElement(o.Fragment,null,d&&o.createElement(E,{sideCar:Cd,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:w}),s?o.cloneElement(o.Children.only(l),md(md({},_),{ref:S})):o.createElement(b,md({},_,{className:c,ref:S}),l))});Nd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Nd.classNames={fullWidth:vd,zeroRight:yd};function Md(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Rd=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=Md())&&(!function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Od=function(){var e,t=(e=Rd(),function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},Pd={left:0,top:0,right:0,gap:0},Ad=function(e){return parseInt(e||"",10)||0},Td=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Pd;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Ad(n),Ad(r),Ad(o)]}(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])}},Dd=Od(),$d="data-scroll-locked",Id=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat($d,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(yd," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(vd," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(yd," .").concat(yd," {\n right: 0 ").concat(r,";\n }\n \n .").concat(vd," .").concat(vd," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat($d,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},zd=function(){var e=parseInt(document.body.getAttribute($d)||"0",10);return isFinite(e)?e:0},Ld=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=void 0===r?"margin":r;o.useEffect(function(){return document.body.setAttribute($d,(zd()+1).toString()),function(){var e=zd()-1;e<=0?document.body.removeAttribute($d):document.body.setAttribute($d,e.toString())}},[]);var i=o.useMemo(function(){return Td(a)},[a]);return o.createElement(Dd,{styles:Id(i,!t,a,n?"":"!important")})},Bd=!1;if("undefined"!=typeof window)try{var Fd=Object.defineProperty({},"passive",{get:function(){return Bd=!0,!0}});window.addEventListener("test",Fd,Fd),window.removeEventListener("test",Fd,Fd)}catch(e){Bd=!1}var jd=!!Bd&&{passive:!1},Hd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Vd=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Wd(e,r)){var o=Yd(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Wd=function(e,t){return"v"===e?function(e){return Hd(e,"overflowY")}(t):function(e){return Hd(e,"overflowX")}(t)},Yd=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Xd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Kd=function(e){return[e.deltaX,e.deltaY]},Ud=function(e){return e&&"current"in e?e.current:e},qd=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Zd=0,Gd=[];function Qd(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Jd,ef=(Jd=function(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),a=o.useState(Zd++)[0],i=o.useState(Od)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(Ud),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=o.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,a=Xd(e),i=n.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=Vd(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=Vd(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r,o){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*r,s=n.target,l=t.contains(s),c=!1,u=i>0,d=0,f=0;do{if(!s)break;var p=Yd(e,s),h=p[0],m=p[1]-p[2]-a*h;(h||m)&&Wd(e,s)&&(d+=m,f+=h);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(o&&Math.abs(d)<1||!o&&i>d)||!u&&(o&&Math.abs(f)<1||!o&&-i>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=o.useCallback(function(e){var n=e;if(Gd.length&&Gd[Gd.length-1]===i){var r="deltaY"in n?Kd(n):Xd(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var a=(s.current.shards||[]).map(Ud).filter(Boolean).filter(function(e){return e.contains(n.target)});(a.length>0?l(n,a[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=o.useCallback(function(e,n,r,o){var a={name:e,delta:n,target:r,should:o,shadowParent:Qd(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=o.useCallback(function(e){n.current=Xd(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,Kd(t),t.target,l(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,Xd(t),t.target,l(t,e.lockRef.current))},[]);o.useEffect(function(){return Gd.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,jd),document.addEventListener("touchmove",c,jd),document.addEventListener("touchstart",d,jd),function(){Gd=Gd.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,jd),document.removeEventListener("touchmove",c,jd),document.removeEventListener("touchstart",d,jd)}},[]);var h=e.removeScrollBar,m=e.inert;return o.createElement(o.Fragment,null,m?o.createElement(i,{styles:qd(a)}):null,h?o.createElement(Ld,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Cd.useMedium(Jd),_d),tf=o.forwardRef(function(e,t){return o.createElement(Nd,md({},e,{ref:t,sideCar:ef}))});tf.classNames=Nd.classNames;var nf=tf,rf=new WeakMap,of=new WeakMap,af={},sf=0,lf=function(e){return e&&(e.host||lf(e.parentNode))},cf=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=lf(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);af[n]||(af[n]=new WeakMap);var a=af[n],i=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(rf.get(e)||0)+1,c=(a.get(e)||0)+1;rf.set(e,l),a.set(e,c),i.push(e),1===l&&o&&of.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),sf++,function(){i.forEach(function(e){var t=rf.get(e)-1,o=a.get(e)-1;rf.set(e,t),a.set(e,o),t||(of.has(e)||e.removeAttribute(r),of.delete(e)),o||e.removeAttribute(n)}),--sf||(rf=new WeakMap,rf=new WeakMap,of=new WeakMap,af={})}},uf=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),cf(r,o,n,"aria-hidden")):function(){return null}},df="Dialog",[ff,pf]=Ou(df),[hf,mf]=ff(df),gf=e=>{const{__scopeDialog:t,children:r,open:a,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=o.useRef(null),u=o.useRef(null),[d,f]=zu({prop:a,defaultProp:i??!1,onChange:s,caller:df});return n.jsx(hf,{scope:t,triggerRef:c,contentRef:u,contentId:$u(),titleId:$u(),descriptionId:$u(),open:d,onOpenChange:f,onOpenToggle:o.useCallback(()=>f(e=>!e),[f]),modal:l,children:r})};gf.displayName=df;var yf="DialogTrigger",vf=o.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=mf(yf,r),i=Ru(t,a.triggerRef);return n.jsx(Hu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Lf(a.open),...o,ref:i,onClick:ku(e.onClick,a.onOpenToggle)})});vf.displayName=yf;var bf="DialogPortal",[wf,xf]=ff(bf,{forceMount:void 0}),Ef=e=>{const{__scopeDialog:t,forceMount:r,children:a,container:i}=e,s=mf(bf,t);return n.jsx(wf,{scope:t,forceMount:r,children:o.Children.map(a,e=>n.jsx(ud,{present:r||s.open,children:n.jsx(cd,{asChild:!0,container:i,children:e})}))})};Ef.displayName=bf;var Sf="DialogOverlay",_f=o.forwardRef((e,t)=>{const r=xf(Sf,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,i=mf(Sf,e.__scopeDialog);return i.modal?n.jsx(ud,{present:o||i.open,children:n.jsx(kf,{...a,ref:t})}):null});_f.displayName=Sf;var Cf=Lu("DialogOverlay.RemoveScroll"),kf=o.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=mf(Sf,r);return n.jsx(nf,{as:Cf,allowPinchZoom:!0,shards:[a.contentRef],children:n.jsx(Hu.div,{"data-state":Lf(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Nf="DialogContent",Mf=o.forwardRef((e,t)=>{const r=xf(Nf,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,i=mf(Nf,e.__scopeDialog);return n.jsx(ud,{present:o||i.open,children:i.modal?n.jsx(Rf,{...a,ref:t}):n.jsx(Of,{...a,ref:t})})});Mf.displayName=Nf;var Rf=o.forwardRef((e,t)=>{const r=mf(Nf,e.__scopeDialog),a=o.useRef(null),i=Ru(t,r.contentRef,a);return o.useEffect(()=>{const e=a.current;if(e)return uf(e)},[]),n.jsx(Pf,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ku(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:ku(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:ku(e.onFocusOutside,e=>e.preventDefault())})}),Of=o.forwardRef((e,t)=>{const r=mf(Nf,e.__scopeDialog),a=o.useRef(!1),i=o.useRef(!1);return n.jsx(Pf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||r.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const n=t.target,o=r.triggerRef.current?.contains(n);o&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),Pf=o.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=mf(Nf,r),u=o.useRef(null),d=Ru(t,u);return pd(),n.jsxs(n.Fragment,{children:[n.jsx(nd,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:s,children:n.jsx(qu,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Lf(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(Hf,{titleId:c.titleId}),n.jsx(Vf,{contentRef:u,descriptionId:c.descriptionId})]})]})}),Af="DialogTitle",Tf=o.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=mf(Af,r);return n.jsx(Hu.h2,{id:a.titleId,...o,ref:t})});Tf.displayName=Af;var Df="DialogDescription",$f=o.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=mf(Df,r);return n.jsx(Hu.p,{id:a.descriptionId,...o,ref:t})});$f.displayName=Df;var If="DialogClose",zf=o.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=mf(If,r);return n.jsx(Hu.button,{type:"button",...o,ref:t,onClick:ku(e.onClick,()=>a.onOpenChange(!1))})});function Lf(e){return e?"open":"closed"}zf.displayName=If;var Bf="DialogTitleWarning",[Ff,jf]=function(e,t){const r=o.createContext(t),a=e=>{const{children:t,...a}=e,i=o.useMemo(()=>a,Object.values(a));return n.jsx(r.Provider,{value:i,children:t})};return a.displayName=e+"Provider",[a,function(n){const a=o.useContext(r);if(a)return a;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}(Bf,{contentName:Nf,titleName:Af,docsSlug:"dialog"}),Hf=({titleId:e})=>{const t=jf(Bf),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return o.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},Vf=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jf("DialogDescriptionWarning").contentName}}.`;return o.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");if(t&&r){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},Wf=gf,Yf=vf,Xf=Ef,Kf=_f,Uf=Mf,qf=Tf,Zf=$f,Gf=zf;const Qf=Wf,Jf=Yf,ep=Xf,tp=o.forwardRef(({className:e,...t},n)=>o.createElement(Kf,{style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"hsla(var(--background), 0.8)",backdropFilter:"blur(4px)"},className:e,...t,ref:n}));tp.displayName=Kf.displayName;const np=(e="right")=>{const t={position:"fixed",zIndex:50,gap:"16px",backgroundColor:"hsl(var(--background))",padding:"24px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",transition:"all 0.3s ease-in-out"};switch(e){case"top":return{...t,left:0,right:0,top:0,borderBottom:"1px solid hsl(var(--border))"};case"bottom":return{...t,left:0,right:0,bottom:0,borderTop:"1px solid hsl(var(--border))"};case"left":return{...t,top:0,bottom:0,left:0,height:"100%",width:"75%",borderRight:"1px solid hsl(var(--border))",maxWidth:"384px"};default:return{...t,top:0,bottom:0,right:0,height:"100%",width:"75%",borderLeft:"1px solid hsl(var(--border))",maxWidth:"384px"}}},rp=o.forwardRef(({side:e="right",className:t,children:n,...r},a)=>o.createElement(ep,null,o.createElement(tp,null),o.createElement(Uf,{ref:a,style:np(e),className:t,...r},n,o.createElement(Gf,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px"},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},o.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),o.createElement("span",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close")))));rp.displayName=Uf.displayName;o.forwardRef(({className:e,...t},n)=>o.createElement(qf,{ref:n,style:{fontSize:"18px",fontWeight:600,color:"hsl(var(--foreground))"},className:e,...t})).displayName=qf.displayName;o.forwardRef(({className:e,...t},n)=>o.createElement(Zf,{ref:n,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:e,...t})).displayName=Zf.displayName;const op=(e,t,n={})=>{const{minNodeSpacing:r=200,containerWidth:o=600}=n;if(!e||0===e.length)return new Map;new Map(e.map(e=>[e.identifier,e]));const a=new Map,i=new Map;e.forEach(e=>a.set(e.identifier,[])),t.length>0?t.forEach(e=>{e.source&&e.target&&(a.get(e.source)?.push(e.target),i.set(e.target,e.source))}):e.forEach(e=>{e.parent&&e.parent.identifier!==e.identifier&&(a.get(e.parent.identifier)?.push(e.identifier),i.set(e.identifier,e.parent.identifier))});const s=e.filter(e=>!i.has(e.identifier)),l=new Map,c=(e,t)=>{l.set(e,t);for(const n of a.get(e)||[])c(n,t+1)};s.forEach(e=>c(e.identifier,0));const u=[];e.forEach(e=>{const t=l.get(e.identifier)??0;u[t]||(u[t]=[]),u[t].push(e.identifier)});const d=new Map,f=200,p=Math.max(250,r+50),h=e=>{const t=a.get(e)||[];if(0===t.length)return d.set(e,f),f;let n=0;for(const e of t)n+=h(e);return n+=(t.length-1)*p,d.set(e,n),n};s.forEach(e=>h(e.identifier));const m=new Map,g=Math.max(400,r+200),y=(e,t,n)=>{const r=d.get(e)||f,o=n*g+100,i=a.get(e)||[];if(0===i.length)m.set(e,{x:t+r/2-100,y:o});else{let r=t;for(const e of i){const t=d.get(e)||f;y(e,r,n+1),r+=t+p}const a=i[0],s=i[i.length-1],l=m.get(a),c=m.get(s),u=(l.x+c.x)/2;m.set(e,{x:u,y:o})}};let v=0;for(const e of s)v+=d.get(e.identifier)||f;s.length>1&&(v+=(s.length-1)*p*2);let b=Math.max(0,(o-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const w=r,x=Array.from(m.keys());for(let e=0;e<x.length;e++)for(let t=e+1;t<x.length;t++){const n=m.get(x[e]),r=m.get(x[t]);if(Math.sqrt((r.x-n.x)**2+(r.y-n.y)**2)<w){const e=r.x-n.x,t=r.y-n.y,o=Math.sqrt(e*e+t*t);if(o>0){const a=w/o,i=(e*a-e)/2,s=(t*a-t)/2;n.x-=i,n.y-=s,r.x+=i,r.y+=s}else n.x-=w/2,r.x+=w/2}}return m},ap={Agent:tu,Tool:tu,Coordinator:tu},ip=({flowData:t,width:n="100%",height:r="1000px",className:o="",defaultZoom:a=1,defaultPan:i={x:0,y:0},disableAutoFit:s=!0,showTimeline:l=!1,minNodeSpacing:c=200})=>{const{theme:u}=yc(),d=t;if(!d)return e.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${u.colors.border}`,borderRadius:"8px",background:u.colors.muted,position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:o},e.createElement("div",{style:{textAlign:"center"}},e.createElement("div",{style:{fontSize:"16px",color:u.colors.mutedForeground,marginBottom:"8px"}},"No flow data available"),e.createElement("div",{style:{fontSize:"14px",color:u.colors.mutedForeground}},"Please provide flowData prop")));const f=e.useRef(null),p=e.useRef(null),[h,m]=e.useState({width:"number"==typeof n?n:1200,height:"number"==typeof r?r:600}),[g,y]=e.useState(0),[v,b]=e.useState(!1),w=e.useRef(null),[x,E]=e.useState(!1),S=e.useMemo(()=>{const e=d.stamps||d.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[d.stamps,d.steps]);e.useEffect(()=>(v?w.current=setInterval(()=>{y(e=>e>=S?(b(!1),e):e+1)},250):w.current&&(clearInterval(w.current),w.current=null),()=>{w.current&&clearInterval(w.current)}),[v,S]),e.useEffect(()=>{const e=d.stamps||d.steps||[];e.length>0&&y(Math.max(...e.map(e=>e.step)))},[d.stamps,d.steps]),e.useEffect(()=>{const e=()=>{if(f.current){const e=f.current.getBoundingClientRect();m({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof r?r:600)})}};if(e(),window.ResizeObserver&&f.current){const t=new ResizeObserver(e);return t.observe(f.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,r]);const _=e.useMemo(()=>{if(!d.nodes)return new Map;const e=Math.max(h.width||800,1200);return op(d.nodes,d.edges||[],{minNodeSpacing:c,containerWidth:e})},[d.nodes,d.edges,h.width,c]),C=e.useCallback(e=>d.nodes?d.nodes.filter(t=>t.stamp.step<=e):[],[d.nodes]),k=e.useCallback(e=>(d.edges||[]).filter(t=>t.stamp.step<=e),[d.edges]),N=e.useMemo(()=>{const e=C(g),t=k(g);return e.map(e=>{const n=_.get(e.identifier)||{x:0,y:0},r=e.stamp.step===g,o="Tool"===e.node_type?t.filter(t=>t.target===e.identifier&&t.details).map(e=>e.details):void 0;return{id:e.identifier,type:e.node_type||"Agent",position:n,data:{label:e.name||e.node_type,nodeType:e.node_type,details:e.details,isActive:r,id:e.identifier,edges:t,edgeDetails:o},style:{filter:r?"drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3))":"none"}}})},[_,g,C,k]),M=e.useMemo(()=>k(g).filter(e=>e.source&&e.target).map(e=>{const t=e.stamp.step===g;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:t,bidirectional:!0,style:{stroke:t?u.colors.primary:u.colors.mutedForeground,strokeWidth:t?3:2},label:e.stamp?.identifier?Oc(String(e.stamp.identifier),50):void 0,data:{label:e.stamp?.identifier?Oc(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:e.stamp?.step,time:e.stamp?.time,details:e.details}}}),[g,k]),[R,O,P]=Ji(N),[A,T,D]=es(M);e.useEffect(()=>{O(N)},[N,O]),e.useEffect(()=>{T(M)},[M,T]);const $=e.useCallback(e=>T(t=>xo(e,t)),[T]),I=e.useCallback(e=>{y(e),b(!1)},[]);e.useCallback(()=>{b(e=>!e)},[]);const z=(e,t)=>{if(!p.current)return{x:0,y:0};const n=p.current.createSVGPoint();n.x=e,n.y=t;const r=n.matrixTransform(p.current.getScreenCTM()?.inverse());return{x:r.x,y:r.y}},L=Ca();return e.useEffect(()=>{if(s||!L||0===N.length)return;const e=new Map;M.forEach(t=>{const n=e.get(t.source)||0;e.set(t.source,n+1);const r=e.get(t.target)||0;e.set(t.target,r+1)});let t="",n=0;e.forEach((e,r)=>{e>n&&(n=e,t=r)}),!t&&N.length>0&&(t=N[0].id),t&&setTimeout(()=>{L.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:a,maxZoom:1})},500)},[N,M,L,s,a]),e.createElement("div",{ref:f,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${u.colors.border}`,borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px",background:u.colors.background},className:o},l&&e.createElement(Qf,{open:x,onOpenChange:E},e.createElement(Jf,{asChild:!0},e.createElement("button",{style:{position:"absolute",top:"16px",left:"16px",zIndex:50,width:"40px",height:"40px",backgroundColor:u.colors.card,border:`1px solid ${u.colors.border}`,borderRadius:"8px",boxShadow:u.shadows.sm,display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease-in-out",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=u.colors.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=u.colors.card},title:"Open Timeline"},e.createElement(ws,{size:20,style:{color:u.colors.mutedForeground}}))),e.createElement(ep,null,e.createElement(Uf,{style:{position:"fixed",top:0,bottom:0,left:0,height:"100%",width:"280px",zIndex:50,backgroundColor:u.colors.background,borderRight:`1px solid ${u.colors.border}`,boxShadow:u.shadows.lg,transition:"all 0.3s ease-in-out",padding:0},onPointerDownOutside:e=>e.preventDefault()},e.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%"}},e.createElement("div",{style:{flex:1,overflowY:"auto"}},e.createElement(Cu,{stamps:d.stamps||d.steps||[],currentStep:g,onStepChange:I}))),e.createElement(Gf,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px",color:u.colors.mutedForeground},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},e.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),e.createElement("span",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close"))))),e.createElement(Gi,{nodes:R,edges:A,onNodesChange:P,onEdgesChange:D,onConnect:$,nodeTypes:ap,edgeTypes:{default:t=>e.createElement(vc,{...t,clientToSvgCoords:z,svgRef:p})},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:i.x,y:i.y,zoom:a},onInit:()=>{if(f.current){const e=f.current.querySelector("svg");e&&(p.current=e)}}},e.createElement(ls,{variant:ts.Lines,color:u.colors.mutedBorder,gap:16})),e.createElement("style",null,`\n .react-flow__edge-label {\n font-size: 10px;\n background: ${u.colors.card};\n color: ${u.colors.cardForeground};\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid ${u.colors.border};\n max-width: 150px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .react-flow__edge {\n cursor: default !important;\n }\n\n .react-flow__edge-path {\n cursor: default !important;\n }\n `))};function sp(e,[t,n]){return Math.min(n,Math.max(t,e))}var lp=o.createContext(void 0);const cp=["top","right","bottom","left"],up=Math.min,dp=Math.max,fp=Math.round,pp=Math.floor,hp=e=>({x:e,y:e}),mp={left:"right",right:"left",bottom:"top",top:"bottom"},gp={start:"end",end:"start"};function yp(e,t,n){return dp(e,up(t,n))}function vp(e,t){return"function"==typeof e?e(t):e}function bp(e){return e.split("-")[0]}function wp(e){return e.split("-")[1]}function xp(e){return"x"===e?"y":"x"}function Ep(e){return"y"===e?"height":"width"}const Sp=new Set(["top","bottom"]);function _p(e){return Sp.has(bp(e))?"y":"x"}function Cp(e){return xp(_p(e))}function kp(e){return e.replace(/start|end/g,e=>gp[e])}const Np=["left","right"],Mp=["right","left"],Rp=["top","bottom"],Op=["bottom","top"];function Pp(e,t,n,r){const o=wp(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Mp:Np:t?Np:Mp;case"left":case"right":return t?Rp:Op;default:return[]}}(bp(e),"start"===n,r);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(kp)))),a}function Ap(e){return e.replace(/left|right|bottom|top/g,e=>mp[e])}function Tp(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Dp(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function $p(e,t,n){let{reference:r,floating:o}=e;const a=_p(t),i=Cp(t),s=Ep(i),l=bp(t),c="y"===a,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(wp(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function Ip(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=vp(t,e),h=Tp(p),m=s[f?"floating"===d?"reference":"floating":d],g=Dp(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},w=Dp(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function zp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Lp(e){return cp.some(t=>e[t]>=0)}const Bp=new Set(["left","top"]);function Fp(){return"undefined"!=typeof window}function jp(e){return Wp(e)?(e.nodeName||"").toLowerCase():"#document"}function Hp(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Vp(e){var t;return null==(t=(Wp(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Wp(e){return!!Fp()&&(e instanceof Node||e instanceof Hp(e).Node)}function Yp(e){return!!Fp()&&(e instanceof Element||e instanceof Hp(e).Element)}function Xp(e){return!!Fp()&&(e instanceof HTMLElement||e instanceof Hp(e).HTMLElement)}function Kp(e){return!(!Fp()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Hp(e).ShadowRoot)}const Up=new Set(["inline","contents"]);function qp(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=sh(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Up.has(o)}const Zp=new Set(["table","td","th"]);function Gp(e){return Zp.has(jp(e))}const Qp=[":popover-open",":modal"];function Jp(e){return Qp.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const eh=["transform","translate","scale","rotate","perspective"],th=["transform","translate","scale","rotate","perspective","filter"],nh=["paint","layout","strict","content"];function rh(e){const t=oh(),n=Yp(e)?sh(e):e;return eh.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||th.some(e=>(n.willChange||"").includes(e))||nh.some(e=>(n.contain||"").includes(e))}function oh(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ah=new Set(["html","body","#document"]);function ih(e){return ah.has(jp(e))}function sh(e){return Hp(e).getComputedStyle(e)}function lh(e){return Yp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ch(e){if("html"===jp(e))return e;const t=e.assignedSlot||e.parentNode||Kp(e)&&e.host||Vp(e);return Kp(t)?t.host:t}function uh(e){const t=ch(e);return ih(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xp(t)&&qp(t)?t:uh(t)}function dh(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=uh(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=Hp(o);if(a){const e=fh(i);return t.concat(i,i.visualViewport||[],qp(o)?o:[],e&&n?dh(e):[])}return t.concat(o,dh(o,[],n))}function fh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ph(e){const t=sh(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Xp(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=fp(n)!==a||fp(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function hh(e){return Yp(e)?e:e.contextElement}function mh(e){const t=hh(e);if(!Xp(t))return hp(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=ph(t);let i=(a?fp(n.width):n.width)/r,s=(a?fp(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const gh=hp(0);function yh(e){const t=Hp(e);return oh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:gh}function vh(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=hh(e);let i=hp(1);t&&(r?Yp(r)&&(i=mh(r)):i=mh(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Hp(e))&&t}(a,n,r)?yh(a):hp(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=Hp(a),t=r&&Yp(r)?Hp(r):r;let n=e,o=fh(n);for(;o&&r&&t!==n;){const e=mh(o),t=o.getBoundingClientRect(),r=sh(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=Hp(o),o=fh(n)}}return Dp({width:u,height:d,x:l,y:c})}function bh(e,t){const n=lh(e).scrollLeft;return t?t.left+n:vh(Vp(e)).left+n}function wh(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-bh(e,n),y:n.top+t.scrollTop}}const xh=new Set(["absolute","fixed"]);function Eh(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Hp(e),r=Vp(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=oh();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=bh(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-t.clientWidth-o);i<=25&&(a-=i)}else c<=25&&(a+=c);return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Vp(e),n=lh(e),r=e.ownerDocument.body,o=dp(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=dp(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+bh(e);const s=-n.scrollTop;return"rtl"===sh(r).direction&&(i+=dp(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(Vp(e));else if(Yp(t))r=function(e,t){const n=vh(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=Xp(e)?mh(e):hp(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=yh(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Dp(r)}function Sh(e,t){const n=ch(e);return!(n===t||!Yp(n)||ih(n))&&("fixed"===sh(n).position||Sh(n,t))}function _h(e,t,n){const r=Xp(t),o=Vp(t),a="fixed"===n,i=vh(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=hp(0);function c(){l.x=bh(o)}if(r||!r&&!a)if(("body"!==jp(t)||qp(o))&&(s=lh(t)),r){const e=vh(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!r&&o&&c();const u=!o||r||a?hp(0):wh(o,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function Ch(e){return"static"===sh(e).position}function kh(e,t){if(!Xp(e)||"fixed"===sh(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Vp(e)===n&&(n=n.ownerDocument.body),n}function Nh(e,t){const n=Hp(e);if(Jp(e))return n;if(!Xp(e)){let t=ch(e);for(;t&&!ih(t);){if(Yp(t)&&!Ch(t))return t;t=ch(t)}return n}let r=kh(e,t);for(;r&&Gp(r)&&Ch(r);)r=kh(r,t);return r&&ih(r)&&Ch(r)&&!rh(r)?n:r||function(e){let t=ch(e);for(;Xp(t)&&!ih(t);){if(rh(t))return t;if(Jp(t))return null;t=ch(t)}return null}(e)||n}const Mh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=Vp(r),s=!!t&&Jp(t.floating);if(r===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=hp(1);const u=hp(0),d=Xp(r);if((d||!d&&!a)&&(("body"!==jp(r)||qp(i))&&(l=lh(r)),Xp(r))){const e=vh(r);c=mh(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!i||d||a?hp(0):wh(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Vp,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a="clippingAncestors"===n?Jp(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=dh(e,[],!1).filter(e=>Yp(e)&&"body"!==jp(e)),o=null;const a="fixed"===sh(e).position;let i=a?ch(e):e;for(;Yp(i)&&!ih(i);){const t=sh(i),n=rh(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&xh.has(o.position)||qp(i)&&!n&&Sh(e,i))?r=r.filter(e=>e!==i):o=t,i=ch(i)}return t.set(e,r),r}(t,this._c):[].concat(n),i=[...a,r],s=i[0],l=i.reduce((e,n)=>{const r=Eh(t,n,o);return e.top=dp(r.top,e.top),e.right=up(r.right,e.right),e.bottom=up(r.bottom,e.bottom),e.left=dp(r.left,e.left),e},Eh(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Nh,getElementRects:async function(e){const t=this.getOffsetParent||Nh,n=this.getDimensions,r=await n(e.floating);return{reference:_h(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ph(e);return{width:t,height:n}},getScale:mh,isElement:Yp,isRTL:function(e){return"rtl"===sh(e).direction}};function Rh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Oh(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=hh(e),u=o||a?[...c?dh(c):[],...dh(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const o=Vp(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const h={rootMargin:-pp(d)+"px "+-pp(o.clientWidth-(u+f))+"px "+-pp(o.clientHeight-(d+p))+"px "+-pp(u)+"px",threshold:dp(0,up(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||Rh(c,e.getBoundingClientRect())||i(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),a}(c,n):null;let f,p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?vh(e):null;return l&&function t(){const r=vh(e);m&&!Rh(m,r)&&n();m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Ph=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=bp(n),s=wp(n),l="y"===_p(n),c=Bp.has(i)?-1:1,u=a&&l?-1:1,d=vp(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},Ah=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=vp(e,t),c={x:n,y:r},u=await Ip(t,l),d=_p(bp(o)),f=xp(d);let p=c[f],h=c[d];if(a){const e="y"===f?"bottom":"right";p=yp(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=yp(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:a,[d]:i}}}}}},Th=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=vp(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const y=bp(o),v=_p(s),b=bp(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[Ap(s)]:function(e){const t=Ap(e);return[kp(e),t,kp(t)]}(s)),E="none"!==h;!f&&E&&x.push(...Pp(s,m,h,w));const S=[s,...x],_=await Ip(t,g),C=[];let k=(null==(r=a.flip)?void 0:r.overflows)||[];if(u&&C.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=wp(e),o=Cp(e),a=Ep(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Ap(i)),[i,Ap(i)]}(o,i,w);C.push(_[e[0]],_[e[1]])}if(k=[...k,{placement:o,overflows:C}],!C.every(e=>e<=0)){var N,M;const e=((null==(N=a.flip)?void 0:N.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&v!==_p(t))||k.every(e=>_p(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:k},reset:{placement:t}}}let n=null==(M=k.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var R;const e=null==(R=k.filter(e=>{if(E){const t=_p(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Dh=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=vp(e,t),u=await Ip(t,c),d=bp(o),f=wp(o),p="y"===_p(o),{width:h,height:m}=a.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=m-u.top-u.bottom,b=h-u.left-u.right,w=up(m-u[g],v),x=up(h-u[y],b),E=!t.middlewareData.shift;let S=w,_=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(S=v),E&&!f){const e=dp(u.left,0),t=dp(u.right,0),n=dp(u.top,0),r=dp(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:dp(u.left,u.right)):S=m-2*(0!==n||0!==r?n+r:dp(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:S});const C=await i.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},$h=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=vp(e,t);switch(r){case"referenceHidden":{const e=zp(await Ip(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Lp(e)}}}case"escaped":{const e=zp(await Ip(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Lp(e)}}}default:return{}}}}},Ih=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=vp(e,t)||{};if(null==c)return{};const d=Tp(u),f={x:n,y:r},p=Cp(o),h=Ep(p),m=await i.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],x=f[p]-a.reference[p],E=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let S=E?E[b]:0;S&&await(null==i.isElement?void 0:i.isElement(E))||(S=s.floating[b]||a.floating[h]);const _=w/2-x/2,C=S/2-m[h]/2-1,k=up(d[y],C),N=up(d[v],C),M=k,R=S-m[h]-N,O=S/2-m[h]/2+_,P=yp(M,O,R),A=!l.arrow&&null!=wp(o)&&O!==P&&a.reference[h]/2-(O<M?k:N)-m[h]/2<0,T=A?O<M?O-M:O-R:0;return{[p]:f[p]+T,data:{[p]:P,centerOffset:O-P-T,...A&&{alignmentOffset:T}},reset:A}}}),zh=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=vp(e,t),u={x:n,y:r},d=_p(o),f=xp(d);let p=u[f],h=u[d];const m=vp(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,v;const e="y"===f?"width":"height",t=Bp.has(bp(o)),n=a.reference[d]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[f]:p,[d]:h}}}},Lh=(e,t,n)=>{const r=new Map,o={platform:Mh,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=$p(c,r,l),f=r,p={},h=0;for(let n=0;n<s.length;n++){const{name:a,fn:m}=s[n],{x:g,y:y,data:v,reset:b}=await m({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,p={...p,[a]:{...p[a],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=$p(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:a})};var Bh="undefined"!=typeof document?e.useLayoutEffect:function(){};function Fh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!Fh(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Fh(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function jh(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hh(e,t){const n=jh(e);return Math.round(t*n)/n}function Vh(e){const t=o.useRef(e);return Bh(()=>{t.current=e}),t}const Wh=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Ih({element:n.current,padding:r}).fn(t):{}:n?Ih({element:n,padding:r}).fn(t):{};var o}}),Yh=(e,t)=>({...Ph(e),options:[e,t]}),Xh=(e,t)=>({...Ah(e),options:[e,t]}),Kh=(e,t)=>({...zh(e),options:[e,t]}),Uh=(e,t)=>({...Th(e),options:[e,t]}),qh=(e,t)=>({...Dh(e),options:[e,t]}),Zh=(e,t)=>({...$h(e),options:[e,t]}),Gh=(e,t)=>({...Wh(e),options:[e,t]});var Qh=o.forwardRef((e,t)=>{const{children:r,width:o=10,height:a=5,...i}=e;return n.jsx(Hu.svg,{...i,ref:t,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});Qh.displayName="Arrow";var Jh=Qh;function em(e){const[t,n]=o.useState(void 0);return Au(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,a;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var tm="Popper",[nm,rm]=Ou(tm),[om,am]=nm(tm),im=e=>{const{__scopePopper:t,children:r}=e,[a,i]=o.useState(null);return n.jsx(om,{scope:t,anchor:a,onAnchorChange:i,children:r})};im.displayName=tm;var sm="PopperAnchor",lm=o.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:a,...i}=e,s=am(sm,r),l=o.useRef(null),c=Ru(t,l),u=o.useRef(null);return o.useEffect(()=>{const e=u.current;u.current=a?.current||l.current,e!==u.current&&s.onAnchorChange(u.current)}),a?null:n.jsx(Hu.div,{...i,ref:c})});lm.displayName=sm;var cm="PopperContent",[um,dm]=nm(cm),fm=o.forwardRef((e,t)=>{const{__scopePopper:r,side:i="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,b=am(cm,r),[w,x]=o.useState(null),E=Ru(t,e=>x(e)),[S,_]=o.useState(null),C=em(S),k=C?.width??0,N=C?.height??0,M=i+("center"!==l?"-"+l:""),R="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},O=Array.isArray(f)?f:[f],P=O.length>0,A={padding:R,boundary:O.filter(gm),altBoundary:P},{refs:T,floatingStyles:D,placement:$,isPositioned:I,middlewareData:z}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,p]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=o.useState(r);Fh(h,r)||m(r);const[g,y]=o.useState(null),[v,b]=o.useState(null),w=o.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),x=o.useCallback(e=>{e!==C.current&&(C.current=e,b(e))},[]),E=s||g,S=l||v,_=o.useRef(null),C=o.useRef(null),k=o.useRef(f),N=null!=u,M=Vh(u),R=Vh(i),O=Vh(d),P=o.useCallback(()=>{if(!_.current||!C.current)return;const e={placement:t,strategy:n,middleware:h};R.current&&(e.platform=R.current),Lh(_.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};A.current&&!Fh(k.current,t)&&(k.current=t,a.flushSync(()=>{p(t)}))})},[h,t,n,R,O]);Bh(()=>{!1===d&&k.current.isPositioned&&(k.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const A=o.useRef(!1);Bh(()=>(A.current=!0,()=>{A.current=!1}),[]),Bh(()=>{if(E&&(_.current=E),S&&(C.current=S),E&&S){if(M.current)return M.current(E,S,P);P()}},[E,S,P,M,N]);const T=o.useMemo(()=>({reference:_,floating:C,setReference:w,setFloating:x}),[w,x]),D=o.useMemo(()=>({reference:E,floating:S}),[E,S]),$=o.useMemo(()=>{const e={position:n,left:0,top:0};if(!D.floating)return e;const t=Hh(D.floating,f.x),r=Hh(D.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...jh(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,c,D.floating,f.x,f.y]);return o.useMemo(()=>({...f,update:P,refs:T,elements:D,floatingStyles:$}),[f,P,T,D,$])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>Oh(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[Yh({mainAxis:s+N,alignmentAxis:c}),d&&Xh({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?Kh():void 0,...A}),d&&Uh({...A}),qh({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),S&&Gh({element:S,padding:u}),ym({arrowWidth:k,arrowHeight:N}),m&&Zh({strategy:"referenceHidden",...A})]}),[L,B]=vm($),F=Vu(y);Au(()=>{I&&F?.()},[I,F]);const j=z.arrow?.x,H=z.arrow?.y,V=0!==z.arrow?.centerOffset,[W,Y]=o.useState();return Au(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),n.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:I?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(um,{scope:r,placedSide:L,onArrowChange:_,arrowX:j,arrowY:H,shouldHideArrow:V,children:n.jsx(Hu.div,{"data-side":L,"data-align":B,...v,ref:E,style:{...v.style,animation:I?void 0:"none"}})})})});fm.displayName=cm;var pm="PopperArrow",hm={top:"bottom",right:"left",bottom:"top",left:"right"},mm=o.forwardRef(function(e,t){const{__scopePopper:r,...o}=e,a=dm(pm,r),i=hm[a.placedSide];return n.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:n.jsx(Jh,{...o,ref:t,style:{...o.style,display:"block"}})})});function gm(e){return null!==e}mm.displayName=pm;var ym=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=vm(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+s/2;let p="",h="";return"bottom"===l?(p=a?u:`${d}px`,h=-s+"px"):"top"===l?(p=a?u:`${d}px`,h=`${r.floating.height+s}px`):"right"===l?(p=-s+"px",h=a?u:`${f}px`):"left"===l&&(p=`${r.floating.width+s}px`,h=a?u:`${f}px`),{data:{x:p,y:h}}}});function vm(e){const[t,n="center"]=e.split("-");return[t,n]}var bm=im,wm=lm,xm=fm,Em=mm;function Sm(e){const t=o.useRef({value:e,previous:e});return o.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var _m=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});o.forwardRef((e,t)=>n.jsx(Hu.span,{...e,ref:t,style:{..._m,...e.style}})).displayName="VisuallyHidden";var Cm=[" ","Enter","ArrowUp","ArrowDown"],km=[" ","Enter"],Nm="Select",[Mm,Rm,Om]=function(t){const r=t+"CollectionProvider",[o,a]=Ou(r),[i,s]=o(r,{collectionRef:{current:null},itemMap:new Map}),l=t=>{const{scope:r,children:o}=t,a=e.useRef(null),s=e.useRef(new Map).current;return n.jsx(i,{scope:r,itemMap:s,collectionRef:a,children:o})};l.displayName=r;const c=t+"CollectionSlot",u=Lu(c),d=e.forwardRef((e,t)=>{const{scope:r,children:o}=e,a=Ru(t,s(c,r).collectionRef);return n.jsx(u,{ref:a,children:o})});d.displayName=c;const f=t+"CollectionItemSlot",p="data-radix-collection-item",h=Lu(f),m=e.forwardRef((t,r)=>{const{scope:o,children:a,...i}=t,l=e.useRef(null),c=Ru(r,l),u=s(f,o);return e.useEffect(()=>(u.itemMap.set(l,{ref:l,...i}),()=>{u.itemMap.delete(l)})),n.jsx(h,{[p]:"",ref:c,children:a})});return m.displayName=f,[{Provider:l,Slot:d,ItemSlot:m},function(n){const r=s(t+"CollectionConsumer",n);return e.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])},a]}(Nm),[Pm,Am]=Ou(Nm,[Om,rm]),Tm=rm(),[Dm,$m]=Pm(Nm),[Im,zm]=Pm(Nm),Lm=e=>{const{__scopeSelect:t,children:r,open:a,defaultOpen:i,onOpenChange:s,value:l,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:h,required:m,form:g}=e,y=Tm(t),[v,b]=o.useState(null),[w,x]=o.useState(null),[E,S]=o.useState(!1),_=function(e){const t=o.useContext(lp);return e||t||"ltr"}(d),[C,k]=zu({prop:a,defaultProp:i??!1,onChange:s,caller:Nm}),[N,M]=zu({prop:l,defaultProp:c,onChange:u,caller:Nm}),R=o.useRef(null),O=!v||(g||!!v.closest("form")),[P,A]=o.useState(new Set),T=Array.from(P).map(e=>e.props.value).join(";");return n.jsx(bm,{...y,children:n.jsxs(Dm,{required:m,scope:t,trigger:v,onTriggerChange:b,valueNode:w,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:$u(),value:N,onValueChange:M,open:C,onOpenChange:k,dir:_,triggerPointerDownPosRef:R,disabled:h,children:[n.jsx(Mm.Provider,{scope:t,children:n.jsx(Im,{scope:e.__scopeSelect,onNativeOptionAdd:o.useCallback(e=>{A(t=>new Set(t).add(e))},[]),onNativeOptionRemove:o.useCallback(e=>{A(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),O?n.jsxs(_g,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:p,value:N,onChange:e=>M(e.target.value),disabled:h,form:g,children:[void 0===N?n.jsx("option",{value:""}):null,Array.from(P)]},T):null]})})};Lm.displayName=Nm;var Bm="SelectTrigger",Fm=o.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:a=!1,...i}=e,s=Tm(r),l=$m(Bm,r),c=l.disabled||a,u=Ru(t,l.onTriggerChange),d=Rm(r),f=o.useRef("touch"),[p,h,m]=kg(e=>{const t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),r=Ng(t,e,n);void 0!==r&&l.onValueChange(r.value)}),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return n.jsx(wm,{asChild:!0,...s,children:n.jsx(Hu.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Cg(l.value)?"":void 0,...i,ref:u,onClick:ku(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:ku(i.onPointerDown,e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:ku(i.onKeyDown,e=>{const t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||Cm.includes(e.key)&&(g(),e.preventDefault())})})})});Fm.displayName=Bm;var jm="SelectValue",Hm=o.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:a,children:i,placeholder:s="",...l}=e,c=$m(jm,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==i,f=Ru(t,c.onValueNodeChange);return Au(()=>{u(d)},[u,d]),n.jsx(Hu.span,{...l,ref:f,style:{pointerEvents:"none"},children:Cg(c.value)?n.jsx(n.Fragment,{children:s}):i})});Hm.displayName=jm;var Vm=o.forwardRef((e,t)=>{const{__scopeSelect:r,children:o,...a}=e;return n.jsx(Hu.span,{"aria-hidden":!0,...a,ref:t,children:o||"▼"})});Vm.displayName="SelectIcon";var Wm=e=>n.jsx(cd,{asChild:!0,...e});Wm.displayName="SelectPortal";var Ym="SelectContent",Xm=o.forwardRef((e,t)=>{const r=$m(Ym,e.__scopeSelect),[i,s]=o.useState();if(Au(()=>{s(new DocumentFragment)},[]),!r.open){const t=i;return t?a.createPortal(n.jsx(Um,{scope:e.__scopeSelect,children:n.jsx(Mm.Slot,{scope:e.__scopeSelect,children:n.jsx("div",{children:e.children})})}),t):null}return n.jsx(Gm,{...e,ref:t})});Xm.displayName=Ym;var Km=10,[Um,qm]=Pm(Ym),Zm=Lu("SelectContent.RemoveScroll"),Gm=o.forwardRef((e,t)=>{const{__scopeSelect:r,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=e,w=$m(Ym,r),[x,E]=o.useState(null),[S,_]=o.useState(null),C=Ru(t,e=>E(e)),[k,N]=o.useState(null),[M,R]=o.useState(null),O=Rm(r),[P,A]=o.useState(!1),T=o.useRef(!1);o.useEffect(()=>{if(x)return uf(x)},[x]),pd();const D=o.useCallback(e=>{const[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==o)return}},[O,S]),$=o.useCallback(()=>D([k,x]),[D,k,x]);o.useEffect(()=>{P&&$()},[P,$]);const{onOpenChange:I,triggerPointerDownPosRef:z}=w;o.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||I(!1),document.removeEventListener("pointermove",t),z.current=null};return null!==z.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,I,z]),o.useEffect(()=>{const e=()=>I(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);const[L,B]=kg(e=>{const t=O().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=Ng(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),F=o.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&(N(e),r&&(T.current=!0))},[w.value]),j=o.useCallback(()=>x?.focus(),[x]),H=o.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&R(e)},[w.value]),V="popper"===a?Jm:Qm,W=V===Jm?{side:c,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return n.jsx(Um,{scope:r,content:x,viewport:S,onViewportChange:_,itemRefCallback:F,selectedItem:k,onItemLeave:j,itemTextRefCallback:H,focusSelectedItem:$,selectedItemText:M,position:a,isPositioned:P,searchRef:L,children:n.jsx(nf,{as:Zm,allowPinchZoom:!0,children:n.jsx(nd,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ku(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:n.jsx(qu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:n.jsx(V,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...W,onPlaced:()=>A(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ku(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>D(t)),e.preventDefault()}})})})})})})});Gm.displayName="SelectContentImpl";var Qm=o.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:a,...i}=e,s=$m(Ym,r),l=qm(Ym,r),[c,u]=o.useState(null),[d,f]=o.useState(null),p=Ru(t,e=>f(e)),h=Rm(r),m=o.useRef(!1),g=o.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=l,x=o.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&d&&y&&v&&b){const e=s.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==s.dir){const o=r.left-t.left,a=n.left-o,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-Km,d=sp(a,[Km,Math.max(Km,u-l)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{const o=t.right-r.right,a=window.innerWidth-n.right-o,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-Km,d=sp(a,[Km,Math.max(Km,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const o=h(),i=window.innerHeight-2*Km,l=y.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),w=f+p+l+parseInt(u.paddingBottom,10)+g,x=Math.min(5*v.offsetHeight,w),E=window.getComputedStyle(y),S=parseInt(E.paddingTop,10),_=parseInt(E.paddingBottom,10),C=e.top+e.height/2-Km,k=i-C,N=v.offsetHeight/2,M=f+p+(v.offsetTop+N),R=w-M;if(M<=C){const e=o.length>0&&v===o[o.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,n=M+Math.max(k,N+(e?_:0)+t+g);c.style.height=n+"px"}else{const e=o.length>0&&v===o[0].ref.current;c.style.top="0px";const t=Math.max(C,f+y.offsetTop+(e?S:0)+N)+R;c.style.height=t+"px",y.scrollTop=M-C+y.offsetTop}c.style.margin=`${Km}px 0`,c.style.minHeight=x+"px",c.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>m.current=!0)}},[h,s.trigger,s.valueNode,c,d,y,v,b,s.dir,a]);Au(()=>x(),[x]);const[E,S]=o.useState();Au(()=>{d&&S(window.getComputedStyle(d).zIndex)},[d]);const _=o.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return n.jsx(eg,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:_,children:n.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:n.jsx(Hu.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Qm.displayName="SelectItemAlignedPosition";var Jm=o.forwardRef((e,t)=>{const{__scopeSelect:r,align:o="start",collisionPadding:a=Km,...i}=e,s=Tm(r);return n.jsx(xm,{...s,...i,ref:t,align:o,collisionPadding:a,style:{boxSizing:"border-box",...i.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)"}})});Jm.displayName="SelectPopperPosition";var[eg,tg]=Pm(Ym,{}),ng="SelectViewport",rg=o.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:a,...i}=e,s=qm(ng,r),l=tg(ng,r),c=Ru(t,s.onViewportChange),u=o.useRef(0);return n.jsxs(n.Fragment,{children:[n.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:a}),n.jsx(Mm.Slot,{scope:r,children:n.jsx(Hu.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ku(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*Km,o=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(o,a);if(i<r){const o=i+e,a=Math.min(r,o),s=o-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});rg.displayName=ng;var og="SelectGroup",[ag,ig]=Pm(og);o.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,a=$u();return n.jsx(ag,{scope:r,id:a,children:n.jsx(Hu.div,{role:"group","aria-labelledby":a,...o,ref:t})})}).displayName=og;var sg="SelectLabel",lg=o.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,a=ig(sg,r);return n.jsx(Hu.div,{id:a.id,...o,ref:t})});lg.displayName=sg;var cg="SelectItem",[ug,dg]=Pm(cg),fg=o.forwardRef((e,t)=>{const{__scopeSelect:r,value:a,disabled:i=!1,textValue:s,...l}=e,c=$m(cg,r),u=qm(cg,r),d=c.value===a,[f,p]=o.useState(s??""),[h,m]=o.useState(!1),g=Ru(t,e=>u.itemRefCallback?.(e,a,i)),y=$u(),v=o.useRef("touch"),b=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};if(""===a)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return n.jsx(ug,{scope:r,value:a,disabled:i,textId:y,isSelected:d,onItemTextChange:o.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:n.jsx(Mm.ItemSlot,{scope:r,value:a,disabled:i,textValue:f,children:n.jsx(Hu.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:g,onFocus:ku(l.onFocus,()=>m(!0)),onBlur:ku(l.onBlur,()=>m(!1)),onClick:ku(l.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:ku(l.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:ku(l.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:ku(l.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ku(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:ku(l.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(km.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});fg.displayName=cg;var pg="SelectItemText",hg=o.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:s,...l}=e,c=$m(pg,r),u=qm(pg,r),d=dg(pg,r),f=zm(pg,r),[p,h]=o.useState(null),m=Ru(t,e=>h(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=p?.textContent,y=o.useMemo(()=>n.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=f;return Au(()=>(v(y),()=>b(y)),[v,b,y]),n.jsxs(n.Fragment,{children:[n.jsx(Hu.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?a.createPortal(l.children,c.valueNode):null]})});hg.displayName=pg;var mg="SelectItemIndicator",gg=o.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return dg(mg,r).isSelected?n.jsx(Hu.span,{"aria-hidden":!0,...o,ref:t}):null});gg.displayName=mg;var yg="SelectScrollUpButton",vg=o.forwardRef((e,t)=>{const r=qm(yg,e.__scopeSelect),a=tg(yg,e.__scopeSelect),[i,s]=o.useState(!1),l=Ru(t,a.onScrollButtonChange);return Au(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?n.jsx(xg,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});vg.displayName=yg;var bg="SelectScrollDownButton",wg=o.forwardRef((e,t)=>{const r=qm(bg,e.__scopeSelect),a=tg(bg,e.__scopeSelect),[i,s]=o.useState(!1),l=Ru(t,a.onScrollButtonChange);return Au(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?n.jsx(xg,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});wg.displayName=bg;var xg=o.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:a,...i}=e,s=qm("SelectScrollButton",r),l=o.useRef(null),c=Rm(r),u=o.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return o.useEffect(()=>()=>u(),[u]),Au(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),n.jsx(Hu.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ku(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(a,50))}),onPointerMove:ku(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(a,50))}),onPointerLeave:ku(i.onPointerLeave,()=>{u()})})}),Eg=o.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return n.jsx(Hu.div,{"aria-hidden":!0,...o,ref:t})});Eg.displayName="SelectSeparator";var Sg="SelectArrow";o.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,a=Tm(r),i=$m(Sg,r),s=qm(Sg,r);return i.open&&"popper"===s.position?n.jsx(Em,{...a,...o,ref:t}):null}).displayName=Sg;var _g=o.forwardRef(({__scopeSelect:e,value:t,...r},a)=>{const i=o.useRef(null),s=Ru(a,i),l=Sm(t);return o.useEffect(()=>{const e=i.current;if(!e)return;const n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,"value").set;if(l!==t&&r){const n=new Event("change",{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[l,t]),n.jsx(Hu.select,{...r,style:{..._m,...r.style},ref:s,defaultValue:t})});function Cg(e){return""===e||void 0===e}function kg(e){const t=Vu(e),n=o.useRef(""),r=o.useRef(0),a=o.useCallback(e=>{const o=n.current+e;t(o),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),i=o.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function Ng(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,a=n?e.indexOf(n):-1;let i=function(e,t){return e.map((n,r)=>e[(t+r)%e.length])}(e,Math.max(a,0));1===o.length&&(i=i.filter(e=>e!==n));const s=i.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return s!==n?s:void 0}_g.displayName="SelectBubbleInput";var Mg=Fm,Rg=Vm,Og=Wm,Pg=Xm,Ag=rg,Tg=lg,Dg=fg,$g=hg,Ig=gg,zg=vg,Lg=wg,Bg=Eg;const Fg=Lm,jg=Hm,Hg=Cc(Mg)`
290
+ display: flex;
291
+ height: 2.5rem;
292
+ width: 100%;
293
+ align-items: center;
294
+ justify-content: space-between;
295
+ border-radius: 0.375rem;
296
+ border: 1px solid #e5e7eb;
297
+ background-color: white;
298
+ padding: 0.5rem 0.75rem;
299
+ font-size: 0.875rem;
300
+ line-height: 1.25rem;
301
+ outline: none;
302
+ transition: all 0.2s ease-in-out;
303
+
304
+ &:focus {
305
+ outline: none;
306
+ box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
307
+ }
308
+
309
+ &:disabled {
310
+ cursor: not-allowed;
311
+ opacity: 0.5;
312
+ }
313
+
314
+ &[data-placeholder] {
315
+ color: #6b7280;
316
+ }
317
+ `,Vg=Cc(gs)`
318
+ height: 1rem;
319
+ width: 1rem;
320
+ opacity: 0.5;
321
+ `,Wg=Cc(zg)`
322
+ display: flex;
323
+ cursor: default;
324
+ align-items: center;
325
+ justify-content: center;
326
+ padding: 0.25rem;
327
+ `,Yg=Cc(vs)`
328
+ height: 1rem;
329
+ width: 1rem;
330
+ `,Xg=Cc(Lg)`
331
+ display: flex;
332
+ cursor: default;
333
+ align-items: center;
334
+ justify-content: center;
335
+ padding: 0.25rem;
336
+ `,Kg=Cc(gs)`
337
+ height: 1rem;
338
+ width: 1rem;
339
+ `,Ug=Cc(Pg)`
340
+ position: relative;
341
+ z-index: 50;
342
+ min-width: 8rem;
343
+ overflow: hidden;
344
+ border-radius: 0.5rem;
345
+ border: 1px solid #e5e7eb;
346
+ background-color: white;
347
+ box-shadow:
348
+ 0 10px 15px -3px rgba(0, 0, 0, 0.1),
349
+ 0 4px 6px -2px rgba(0, 0, 0, 0.05);
350
+ animation: slideDownAndFade 0.2s ease-out;
351
+
352
+ @keyframes slideDownAndFade {
353
+ from {
354
+ opacity: 0;
355
+ transform: translateY(-2px);
356
+ }
357
+ to {
358
+ opacity: 1;
359
+ transform: translateY(0);
360
+ }
361
+ }
362
+ `,qg=Cc(Tg)`
363
+ padding: 0.375rem 0.75rem;
364
+ padding-left: 2rem;
365
+ font-size: 0.875rem;
366
+ font-weight: 600;
367
+ color: #374151;
368
+ `,Zg=Cc(Dg)`
369
+ position: relative;
370
+ display: flex;
371
+ cursor: default;
372
+ user-select: none;
373
+ align-items: center;
374
+ padding: 0.375rem 0.75rem;
375
+ padding-left: 2rem;
376
+ font-size: 0.875rem;
377
+ outline: none;
378
+ transition: all 0.2s ease-in-out;
379
+
380
+ &:focus {
381
+ background-color: #f3f4f6;
382
+ color: #1f2937;
383
+ }
384
+
385
+ &[data-disabled] {
386
+ pointer-events: none;
387
+ opacity: 0.5;
388
+ }
389
+
390
+ &[data-state="checked"] {
391
+ background-color: #f3f4f6;
392
+ color: #1f2937;
393
+ }
394
+ `,Gg=Cc.span`
395
+ position: absolute;
396
+ left: 0.5rem;
397
+ display: flex;
398
+ height: 0.875rem;
399
+ width: 0.875rem;
400
+ align-items: center;
401
+ justify-content: center;
402
+ `,Qg=Cc(ms)`
403
+ height: 1rem;
404
+ width: 1rem;
405
+ `,Jg=Cc(Bg)`
406
+ margin: 0.25rem -0.25rem;
407
+ height: 1px;
408
+ background-color: #e5e7eb;
409
+ `,ey=o.forwardRef(({children:e,...t},n)=>o.createElement(Hg,{ref:n,...t},e,o.createElement(Rg,{asChild:!0},o.createElement(Vg,null))));ey.displayName=Mg.displayName;const ty=o.forwardRef(({...e},t)=>o.createElement(Wg,{ref:t,...e},o.createElement(Yg,null)));ty.displayName=zg.displayName;const ny=o.forwardRef(({...e},t)=>o.createElement(Xg,{ref:t,...e},o.createElement(Kg,null)));ny.displayName=Lg.displayName;const ry=o.forwardRef(({children:e,position:t="popper",...n},r)=>o.createElement(Og,null,o.createElement(Ug,{ref:r,position:t,...n},o.createElement(ty,null),o.createElement(Ag,{style:{padding:"4px"}},e),o.createElement(ny,null))));ry.displayName=Pg.displayName;o.forwardRef(({...e},t)=>o.createElement(qg,{ref:t,...e})).displayName=Tg.displayName;const oy=o.forwardRef(({children:e,...t},n)=>o.createElement(Zg,{ref:n,...t},o.createElement(Gg,null,o.createElement(Ig,null,o.createElement(Qg,null))),o.createElement($g,null,e)));oy.displayName=Dg.displayName;o.forwardRef(({...e},t)=>o.createElement(Jg,{ref:t,...e})).displayName=Bg.displayName;const ay=Cc.div`
410
+ display: flex;
411
+ align-items: center;
412
+ gap: 0.5rem;
413
+ min-width: 300px;
414
+ `,iy=Cc.div`
415
+ padding: 0.5rem 1rem;
416
+ color: ${e=>e.theme.colors.mutedForeground};
417
+ font-size: 0.875rem;
418
+ background-color: ${e=>e.theme.colors.muted};
419
+ border-radius: 0.375rem;
420
+ border: 1px solid ${e=>e.theme.colors.border};
421
+ `,sy=Cc.div`
422
+ flex: 1;
423
+ min-width: 0;
424
+ `,ly=Cc.div`
425
+ display: flex;
426
+ align-items: center;
427
+ justify-content: space-between;
428
+ width: 100%;
429
+ `,cy=Cc.div`
430
+ padding: 0.5rem 1rem;
431
+ color: ${e=>e.theme.colors.mutedForeground};
432
+ font-size: 0.875rem;
433
+ text-align: center;
434
+ `,uy=Cc.button`
435
+ display: flex;
436
+ align-items: center;
437
+ justify-content: center;
438
+ padding: 0.5rem;
439
+ border: none;
440
+ border-radius: 0.375rem;
441
+ border: 1px solid ${e=>e.theme.colors.border};
442
+ background-color: ${e=>e.theme.colors.card};
443
+ color: ${e=>e.theme.colors.cardForeground};
444
+ transition: all 0.2s ease-in-out;
445
+ opacity: ${e=>e.loading||e.disabled?.5:1};
446
+ cursor: ${e=>e.loading||e.disabled?"not-allowed":"pointer"};
447
+
448
+ &:hover:not(:disabled) {
449
+ background-color: ${e=>e.theme.colors.muted};
450
+ color: ${e=>e.theme.colors.cardForeground};
451
+ }
452
+ `,dy=Cc(bs)`
453
+ height: 1rem;
454
+ width: 1rem;
455
+ animation: spin 1s linear infinite;
456
+ color: ${e=>e.theme.colors.mutedForeground};
457
+
458
+ @keyframes spin {
459
+ from {
460
+ transform: rotate(0deg);
461
+ }
462
+ to {
463
+ transform: rotate(360deg);
464
+ }
465
+ }
466
+ `,fy=Cc(xs)`
467
+ height: 1rem;
468
+ width: 1rem;
469
+ `;var py="Checkbox",[hy,my]=Ou(py),[gy,yy]=hy(py);function vy(e){const{__scopeCheckbox:t,checked:r,children:a,defaultChecked:i,disabled:s,form:l,name:c,onCheckedChange:u,required:d,value:f="on",internal_do_not_use_render:p}=e,[h,m]=zu({prop:r,defaultProp:i??!1,onChange:u,caller:py}),[g,y]=o.useState(null),[v,b]=o.useState(null),w=o.useRef(!1),x=!g||(!!l||!!g.closest("form")),E={checked:h,disabled:s,setChecked:m,control:g,setControl:y,name:c,form:l,value:f,hasConsumerStoppedPropagationRef:w,required:d,defaultChecked:!Ny(i)&&i,isFormControl:x,bubbleInput:v,setBubbleInput:b};return n.jsx(gy,{scope:t,...E,children:ky(p)?p(E):a})}var by="CheckboxTrigger",wy=o.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...a},i)=>{const{control:s,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:g}=yy(by,e),y=Ru(i,f),v=o.useRef(u);return o.useEffect(()=>{const e=s?.form;if(e){const t=()=>p(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[s,p]),n.jsx(Hu.button,{type:"button",role:"checkbox","aria-checked":Ny(u)?"mixed":u,"aria-required":d,"data-state":My(u),"data-disabled":c?"":void 0,disabled:c,value:l,...a,ref:y,onKeyDown:ku(t,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:ku(r,e=>{p(e=>!!Ny(e)||!e),g&&m&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})})});wy.displayName=by;var xy=o.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:o,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return n.jsx(vy,{__scopeCheckbox:r,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:u,name:o,form:d,value:c,internal_do_not_use_render:({isFormControl:e})=>n.jsxs(n.Fragment,{children:[n.jsx(wy,{...f,ref:t,__scopeCheckbox:r}),e&&n.jsx(Cy,{__scopeCheckbox:r})]})})});xy.displayName=py;var Ey="CheckboxIndicator",Sy=o.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:o,...a}=e,i=yy(Ey,r);return n.jsx(ud,{present:o||Ny(i.checked)||!0===i.checked,children:n.jsx(Hu.span,{"data-state":My(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});Sy.displayName=Ey;var _y="CheckboxBubbleInput",Cy=o.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:a,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:l,required:c,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:m}=yy(_y,e),g=Ru(r,m),y=Sm(s),v=em(a);o.useEffect(()=>{const e=h;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,r=!i.current;if(y!==s&&n){const t=new Event("click",{bubbles:r});e.indeterminate=Ny(s),n.call(e,!Ny(s)&&s),e.dispatchEvent(t)}},[h,y,s,i]);const b=o.useRef(!Ny(s)&&s);return n.jsx(Hu.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??b.current,required:c,disabled:u,name:d,value:f,form:p,...t,tabIndex:-1,ref:g,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function ky(e){return"function"==typeof e}function Ny(e){return"indeterminate"===e}function My(e){return Ny(e)?"indeterminate":e?"checked":"unchecked"}Cy.displayName=_y;const Ry=Cc(xy)`
470
+ display: flex;
471
+ align-items: center;
472
+ justify-content: center;
473
+ height: 1rem;
474
+ width: 1rem;
475
+ flex-shrink: 0;
476
+ border-radius: 0.125rem;
477
+ border: 1px solid #6366f1;
478
+ background-color: transparent;
479
+ outline: none;
480
+ transition: all 0.2s ease-in-out;
481
+
482
+ &:focus-visible {
483
+ outline: none;
484
+ box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
485
+ }
486
+
487
+ &:disabled {
488
+ cursor: not-allowed;
489
+ opacity: 0.5;
490
+ }
491
+
492
+ &[data-state="checked"] {
493
+ background-color: #6366f1;
494
+ color: white;
495
+ }
496
+ `,Oy=Cc(Sy)`
497
+ display: flex;
498
+ align-items: center;
499
+ justify-content: center;
500
+ color: currentColor;
501
+ `,Py=Cc(ms)`
502
+ height: 1rem;
503
+ width: 1rem;
504
+ `,Ay=o.forwardRef(({className:e,...t},n)=>o.createElement(Ry,{ref:n,...t},o.createElement(Oy,null,o.createElement(Py,null))));Ay.displayName=xy.displayName;const Ty=e.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Dy=()=>{const t=e.useContext(Ty);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};function $y(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Iy(){return Ly(/^iPad/)||Ly(/^Mac/)&&navigator.maxTouchPoints>1}function zy(){return Ly(/^iPhone/)||Iy()}function Ly(e){return"undefined"!=typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");const By="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;function Fy(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const jy="undefined"!=typeof document&&window.visualViewport;function Hy(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Vy(e){for(Hy(e)&&(e=e.parentElement);e&&!Hy(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Wy=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Yy,Xy=0;function Ky(e={}){let{isDisabled:t}=e;By(()=>{if(!t)return Xy++,1===Xy&&zy()&&(Yy=function(){let e,t=0,n=n=>{e=Vy(n.target),e===document.documentElement&&e===document.body||(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body)return void n.preventDefault();let r=n.changedTouches[0].pageY,o=e.scrollTop,a=e.scrollHeight-e.clientHeight;0!==a&&((o<=0&&r>t||o>=a&&r<t)&&n.preventDefault(),t=r)},o=e=>{let t=e.target;Zy(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},a=e=>{let t=e.target;Zy(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",jy&&(jy.height<window.innerHeight?requestAnimationFrame(()=>{qy(t)}):jy.addEventListener("resize",()=>qy(t),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=Fy(function(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let u=Fy(Uy(document,"touchstart",n,{passive:!1,capture:!0}),Uy(document,"touchmove",r,{passive:!1,capture:!0}),Uy(document,"touchend",o,{passive:!1,capture:!0}),Uy(document,"focus",a,!0),Uy(window,"scroll",i));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{Xy--,0===Xy&&(null==Yy||Yy())}},[t])}function Uy(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function qy(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=Vy(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function Zy(e){return e instanceof HTMLInputElement&&!Wy.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Gy(...e){return o.useCallback(function(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}(...e),e)}const Qy=new WeakMap;function Jy(e,t,n=!1){if(!(e&&e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||Qy.set(e,r)}const ev=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function tv(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[ev(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[ev(t)?5:4]):null)}function nv(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const rv={DURATION:.5,EASE:[.32,.72,0,1]},ov=16,av="vaul-dragging";function iv(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>null==n.current?void 0:n.current.call(n,...e),[])}function sv({prop:t,defaultProp:n,onChange:r=()=>{}}){const[o,a]=function({defaultProp:t,onChange:n}){const r=e.useState(t),[o]=r,a=e.useRef(o),i=iv(n);return e.useEffect(()=>{a.current!==o&&(i(o),a.current=o)},[o,a,i]),r}({defaultProp:n,onChange:r}),i=void 0!==t,s=i?t:o,l=iv(r),c=e.useCallback(e=>{if(i){const n="function"==typeof e?e(t):e;n!==t&&l(n)}else a(e)},[i,t,a,l]);return[s,c]}let lv=null;function cv({open:t,onOpenChange:n,children:r,onDrag:o,onRelease:a,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=.25,scrollLockTimeout:u=100,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:m,fixed:g,modal:y=!0,onClose:v,nested:b,noBodyStyles:w=!1,direction:x="bottom",defaultOpen:E=!1,disablePreventScroll:S=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:C=!1,repositionInputs:k=!0,onAnimationEnd:N,container:M,autoFocus:R=!1}){var O,P;const[A=!1,T]=sv({defaultProp:E,prop:t,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==N||N(e)},1e3*rv.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[D,$]=e.useState(!1),[I,z]=e.useState(!1),[L,B]=e.useState(!1),F=e.useRef(null),j=e.useRef(null),H=e.useRef(null),V=e.useRef(null),W=e.useRef(null),Y=e.useRef(!1),X=e.useRef(null),K=e.useRef(0),U=e.useRef(!1),q=e.useRef(!E),Z=e.useRef(0),G=e.useRef(null),Q=e.useRef((null==(O=G.current)?void 0:O.getBoundingClientRect().height)||0),J=e.useRef((null==(P=G.current)?void 0:P.getBoundingClientRect().width)||0),ee=e.useRef(0),te=e.useCallback(e=>{i&&e===ie.length-1&&(j.current=new Date)},[]),{activeSnapPoint:ne,activeSnapPointIndex:re,setActiveSnapPoint:oe,onRelease:ae,snapPointsOffset:ie,onDrag:se,shouldFade:le,getPercentageDragged:ce}=function({activeSnapPointProp:t,setActiveSnapPointProp:n,snapPoints:r,drawerRef:o,overlayRef:a,fadeFromIndex:i,onSnapPointChange:s,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=sv({prop:t,defaultProp:null==r?void 0:r[0],onChange:n}),[p,h]=e.useState("undefined"!=typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);e.useEffect(()=>{function e(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const m=e.useMemo(()=>d===(null==r?void 0:r[r.length-1])||null,[r,d]),g=e.useMemo(()=>{var e;return null!=(e=null==r?void 0:r.findIndex(e=>e===d))?e:null},[r,d]),y=r&&r.length>0&&(i||0===i)&&!Number.isNaN(i)&&r[i]===d||!r,v=e.useMemo(()=>{const e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:"undefined"!=typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var t;return null!=(t=null==r?void 0:r.map(t=>{const n="string"==typeof t;let r=0;if(n&&(r=parseInt(t,10)),ev(l)){const o=n?r:p?t*e.height:0;return p?"bottom"===l?e.height-o:-e.height+o:o}const o=n?r:p?t*e.width:0;return p?"right"===l?e.width-o:-e.width+o:o}))?t:[]},[r,p,c]),b=e.useMemo(()=>null!==g?null==v?void 0:v[g]:null,[v,g]),w=e.useCallback(e=>{var t;const n=null!=(t=null==v?void 0:v.findIndex(t=>t===e))?t:null;s(n),Jy(o.current,{transition:`transform ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,transform:ev(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==i&&n!==i&&n<i?Jy(a.current,{transition:`opacity ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,opacity:"0"}):Jy(a.current,{transition:`opacity ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,opacity:"1"}),f(null==r?void 0:r[Math.max(n,0)])},[o.current,r,v,i,a,f]);return e.useEffect(()=>{if(d||t){var e;const n=null!=(e=null==r?void 0:r.findIndex(e=>e===t||e===d))?e:-1;v&&-1!==n&&"number"==typeof v[n]&&w(v[n])}},[d,t,r,v,w]),{isLastSnapPoint:m,activeSnapPoint:d,shouldFade:y,getPercentageDragged:function(e,t){if(!r||"number"!=typeof g||!v||void 0===i)return null;const n=g===i-1;if(g>=i&&t)return 0;if(n&&!t)return 1;if(!y&&!n)return null;const o=n?g+1:g-1,a=n?v[o]-v[o-1]:v[o+1]-v[o],s=e/Math.abs(a);return n?1-s:s},setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:o}){if(void 0===i)return;const s="bottom"===l||"right"===l?(null!=b?b:0)-e:(null!=b?b:0)+e,c=0===g,d=e>0;if(g===i-1&&Jy(a.current,{transition:`opacity ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`}),!u&&n>2&&!d)return void(o?t():w(v[0]));if(!u&&n>2&&d&&v&&r)return void w(v[r.length-1]);const f=null==v?void 0:v.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-s)<Math.abs(e-s)?t:e),p=ev(l)?window.innerHeight:window.innerWidth;if(n>.4&&Math.abs(e)<.4*p){const e=d?1:-1;if(e>0&&m&&r)return void w(v[r.length-1]);if(c&&e<0&&o&&t(),null===g)return;return void w(v[g+e])}w(f)},onDrag:function({draggedDistance:e}){if(null===b)return;const t="bottom"===l||"right"===l?b-e:b+e;("bottom"===l||"right"===l)&&t<v[v.length-1]||("top"===l||"left"===l)&&t>v[v.length-1]||Jy(o.current,{transform:ev(l)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:v}}({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:G,fadeFromIndex:p,overlayRef:F,onSnapPointChange:te,direction:x,container:M,snapToSequentialPoint:_});Ky({isDisabled:!A||I||!y||L||!D||!k||!S});const{restorePositionSetting:ue}=function({isOpen:t,modal:n,nested:r,hasBeenOpened:o,preventScrollRestoration:a,noBodyStyles:i}){const[s,l]=e.useState(()=>"undefined"!=typeof window?window.location.href:""),c=e.useRef(0),u=e.useCallback(()=>{if($y()&&null===lv&&t&&!i){lv={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:-c.current+"px",left:-e+"px",right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=-(c.current+e)+"px")}),300)}},[t]),d=e.useCallback(()=>{if($y()&&null!==lv&&!i){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,lv),window.requestAnimationFrame(()=>{a&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),lv=null}},[s]);return e.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),e.useEffect(()=>{if(n)return()=>{"undefined"!=typeof document&&(document.querySelector("[data-vaul-drawer]")||d())}},[n,d]),e.useEffect(()=>{!r&&o&&(t?(!window.matchMedia("(display-mode: standalone)").matches&&u(),n||window.setTimeout(()=>{d()},500)):d())},[t,o,s,n,r,u,d]),{restorePositionSetting:d}}({isOpen:A,modal:y,nested:null!=b&&b,hasBeenOpened:D,preventScrollRestoration:C,noBodyStyles:w});function de(){return(window.innerWidth-26)/window.innerWidth}function fe(e,t){var n;let r=e;const o=null==(n=window.getSelection())?void 0:n.toString(),a=G.current?tv(G.current,x):null,i=new Date;if("SELECT"===r.tagName)return!1;if(r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===x||"left"===x)return!0;if(j.current&&i.getTime()-j.current.getTime()<500)return!1;if(null!==a&&("bottom"===x?a>0:a<0))return!0;if(o&&o.length>0)return!1;if(W.current&&i.getTime()-W.current.getTime()<u&&0===a)return W.current=i,!1;if(t)return W.current=i,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return W.current=new Date,!1;if("dialog"===r.getAttribute("role"))return!0}r=r.parentNode}return!0}function pe(e){!function(){if(!I||!G.current)return;G.current.classList.remove(av),Y.current=!1,z(!1),V.current=new Date}(),null==v||v(),e||T(!1),setTimeout(()=>{i&&oe(i[0])},1e3*rv.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=tv(G.current,x);Jy(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`}),Jy(F.current,{transition:`opacity ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&A&&Jy(e,{borderRadius:"8px",overflow:"hidden",...ev(x)?{transform:`scale(${de()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${de()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${rv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${rv.EASE.join(",")})`},!0)}return e.useEffect(()=>{window.requestAnimationFrame(()=>{q.current=!0})},[]),e.useEffect(()=>{var e;function t(){if(!G.current||!k)return;if(Zy(document.activeElement)||U.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight;let r=n-t;const o=G.current.getBoundingClientRect().height||0,a=o>.8*n;ee.current||(ee.current=o);const s=G.current.getBoundingClientRect().top;if(Math.abs(Z.current-r)>60&&(U.current=!U.current),i&&i.length>0&&ie&&re){r+=ie[re]||0}if(Z.current=r,o>t||U.current){const e=G.current.getBoundingClientRect().height;let n=e;e>t&&(n=t-(a?s:26)),G.current.style.height=g?e-Math.max(r,0)+"px":`${Math.max(n,t-s)}px`}else(function(){const e=navigator.userAgent;return"undefined"!=typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))})()||(G.current.style.height=`${ee.current}px`);i&&i.length>0&&!U.current?G.current.style.bottom="0px":G.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[re,i,ie]),e.useEffect(()=>(A&&(Jy(document.documentElement,{scrollBehavior:"auto"}),j.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=Qy.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[A]),e.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),e.createElement(Wf,{defaultOpen:E,onOpenChange:e=>{(d||e)&&(e?$(!0):pe(!0),T(e))},open:A},e.createElement(Ty.Provider,{value:{activeSnapPoint:ne,snapPoints:i,setActiveSnapPoint:oe,drawerRef:G,overlayRef:F,onOpenChange:n,onPress:function(e){var t,n;(d||i)&&(G.current&&!G.current.contains(e.target)||(Q.current=(null==(t=G.current)?void 0:t.getBoundingClientRect().height)||0,J.current=(null==(n=G.current)?void 0:n.getBoundingClientRect().width)||0,z(!0),H.current=new Date,zy()&&window.addEventListener("touchend",()=>Y.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=ev(x)?e.pageY:e.pageX))},onRelease:function(e){if(!I||!G.current)return;G.current.classList.remove(av),Y.current=!1,z(!1),V.current=new Date;const t=tv(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===H.current)return;const n=V.current.getTime()-H.current.getTime(),r=K.current-(ev(x)?e.pageY:e.pageX),o=Math.abs(r)/n;if(o>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),i){return ae({draggedDistance:r*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:o,dismissible:d}),void(null==a||a(e,!0))}if("bottom"===x||"right"===x?r>0:r<0)return he(),void(null==a||a(e,!0));if(o>.4)return pe(),void(null==a||a(e,!1));var s;const l=Math.min(null!=(s=G.current.getBoundingClientRect().height)?s:0,window.innerHeight);var u;const f=Math.min(null!=(u=G.current.getBoundingClientRect().width)?u:0,window.innerWidth),p="left"===x||"right"===x;if(Math.abs(t)>=(p?f:l)*c)return pe(),void(null==a||a(e,!1));null==a||a(e,!0),he()},onDrag:function(e){var t;if(G.current&&I){const n="bottom"===x||"right"===x?1:-1,r=(K.current-(ev(x)?e.pageY:e.pageX))*n,a=r>0,l=i&&!d&&!a;if(l&&0===re)return;const c=Math.abs(r),u=document.querySelector("[data-vaul-drawer-wrapper]");let f=c/("bottom"===x||"top"===x?Q.current:J.current);const h=ce(c,a);if(null!==h&&(f=h),l&&f>=1)return;if(!Y.current&&!fe(e.target,a))return;if(G.current.classList.add(av),Y.current=!0,Jy(G.current,{transition:"none"}),Jy(F.current,{transition:"none"}),i&&se({draggedDistance:r}),a&&!i){const e=(t=r,8*(Math.log(t+1)-2)),o=Math.min(-1*e,0)*n;return void Jy(G.current,{transform:ev(x)?`translate3d(0, ${o}px, 0)`:`translate3d(${o}px, 0, 0)`})}const m=1-f;if((le||p&&re===p-1)&&(null==o||o(e,f),Jy(F.current,{opacity:`${m}`,transition:"none"},!0)),u&&F.current&&s){const e=Math.min(de()+f*(1-de()),1),t=8-8*f,n=Math.max(0,14-14*f);Jy(u,{borderRadius:`${t}px`,transform:ev(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){const e=c*n;Jy(G.current,{transform:ev(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:q,handleOnly:f,isOpen:A,isDragging:I,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-ov)/window.innerWidth,r=n+t*(1-n),o=t*ov-16;Jy(G.current,{transform:ev(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-ov)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),Jy(G.current,{transition:`transform ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,transform:ev(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&G.current&&(X.current=setTimeout(()=>{const e=tv(G.current,x);Jy(G.current,{transition:"none",transform:ev(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=ev(x)?window.innerHeight:window.innerWidth,r=t?(n-ov)/n:1,o=t?-16:0;t&&Jy(G.current,{transition:`transform ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,transform:ev(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`})},keyboardIsOpen:U,modal:y,snapPointsOffset:ie,activeSnapPointIndex:re,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:l,noBodyStyles:w,container:M,autoFocus:R}},r))}const uv=e.forwardRef(function({...t},n){const{overlayRef:r,snapPoints:o,onRelease:a,shouldFade:i,isOpen:s,modal:l,shouldAnimate:c}=Dy(),u=Gy(n,r),d=o&&o.length>0;if(!l)return null;const f=e.useCallback(e=>a(e),[a]);return e.createElement(Kf,{onMouseUp:f,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&d?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":(null==c?void 0:c.current)?"true":"false",...t})});uv.displayName="Drawer.Overlay";const dv=e.forwardRef(function({onPointerDownOutside:t,style:n,onOpenAutoFocus:r,...o},a){const{drawerRef:i,onPress:s,onRelease:l,onDrag:c,keyboardIsOpen:u,snapPointsOffset:d,activeSnapPointIndex:f,modal:p,isOpen:h,direction:m,snapPoints:g,container:y,handleOnly:v,shouldAnimate:b,autoFocus:w}=Dy(),[x,E]=e.useState(!1),S=Gy(a,i),_=e.useRef(null),C=e.useRef(null),k=e.useRef(!1),N=g&&g.length>0;!function(){const{direction:t,isOpen:n,shouldScaleBackground:r,setBackgroundColorOnScale:o,noBodyStyles:a}=Dy(),i=e.useRef(null),s=e.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-26)/window.innerWidth}e.useEffect(()=>{if(n&&r){i.current&&clearTimeout(i.current);const e=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!e)return;o&&!a&&nv(document.body,{background:"black"}),nv(e,{transformOrigin:ev(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${rv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${rv.EASE.join(",")})`});const n=nv(e,{borderRadius:"8px",overflow:"hidden",...ev(t)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),i.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},1e3*rv.DURATION)}}},[n,r,s])}();function M(e){_.current=null,k.current=!1,l(e)}return e.useEffect(()=>{N&&window.requestAnimationFrame(()=>{E(!0)})},[]),e.createElement(Uf,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":x?"true":"false","data-vaul-snap-points":h&&N?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":(null==b?void 0:b.current)?"true":"false",...o,ref:S,style:d&&d.length>0?{"--snap-point-height":`${d[null!=f?f:0]}px`,...n}:n,onPointerDown:e=>{v||(null==o.onPointerDown||o.onPointerDown.call(o,e),_.current={x:e.pageX,y:e.pageY},s(e))},onOpenAutoFocus:e=>{null==r||r(e),w||e.preventDefault()},onPointerDownOutside:e=>{null==t||t(e),p&&!e.defaultPrevented?u.current&&(u.current=!1):e.preventDefault()},onFocusOutside:e=>{p||e.preventDefault()},onPointerMove:e=>{if(C.current=e,v)return;if(null==o.onPointerMove||o.onPointerMove.call(o,e),!_.current)return;const t=e.pageY-_.current.y,n=e.pageX-_.current.x,r="touch"===e.pointerType?10:2,a=((e,t,n=0)=>{if(k.current)return!0;const r=Math.abs(e.y),o=Math.abs(e.x),a=o>r,i=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*i<0)&&o>=0&&o<=n)return a}else if(!(e.y*i<0)&&r>=0&&r<=n)return!a;return k.current=!0,!0})({x:n,y:t},m,r);a?c(e):(Math.abs(n)>r||Math.abs(t)>r)&&(_.current=null)},onPointerUp:e=>{null==o.onPointerUp||o.onPointerUp.call(o,e),_.current=null,k.current=!1,l(e)},onPointerOut:e=>{null==o.onPointerOut||o.onPointerOut.call(o,e),M(C.current)},onContextMenu:e=>{null==o.onContextMenu||o.onContextMenu.call(o,e),C.current&&M(C.current)}})});dv.displayName="Drawer.Content";const fv=e.forwardRef(function({preventCycle:t=!1,children:n,...r},o){const{closeDrawer:a,isDragging:i,snapPoints:s,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:u,handleOnly:d,isOpen:f,onPress:p,onDrag:h}=Dy(),m=e.useRef(null),g=e.useRef(!1);function y(){m.current&&window.clearTimeout(m.current),g.current=!1}return e.createElement("div",{onClick:function(){g.current?y():window.setTimeout(()=>{!function(){if(i||t||g.current)return void y();if(y(),!s||0===s.length)return void(u||a());if(l===s[s.length-1]&&u)return void a();const e=s.findIndex(e=>e===l);if(-1===e)return;const n=s[e+1];c(n)}()},120)},onPointerCancel:y,onPointerDown:e=>{d&&p(e),m.current=window.setTimeout(()=>{g.current=!0},250)},onPointerMove:e=>{d&&h(e)},ref:o,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},e.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});fv.displayName="Drawer.Handle";const pv={Root:cv,NestedRoot:function({onDrag:t,onOpenChange:n,open:r,...o}){const{onNestedDrag:a,onNestedOpenChange:i,onNestedRelease:s}=Dy();if(!a)throw new Error("Drawer.NestedRoot must be placed in another drawer");return e.createElement(cv,{nested:!0,open:r,onClose:()=>{i(!1)},onDrag:(e,n)=>{a(e,n),null==t||t(e,n)},onOpenChange:e=>{e&&i(e),null==n||n(e)},onRelease:s,...o})},Content:dv,Overlay:uv,Trigger:Yf,Portal:function(t){const n=Dy(),{container:r=n.container,...o}=t;return e.createElement(Xf,{container:r,...o})},Handle:fv,Close:Gf,Title:qf,Description:Zf},hv=({shouldScaleBackground:e=!0,...t})=>o.createElement(pv.Root,{shouldScaleBackground:e,...t});hv.displayName="Drawer";const mv=pv.Portal,gv=o.forwardRef(({className:e,...t},n)=>o.createElement(pv.Overlay,{ref:n,style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"rgba(0, 0, 0, 0.8)"},className:e,...t}));gv.displayName=pv.Overlay.displayName;const yv=o.forwardRef(({className:e,children:t,...n},r)=>o.createElement(mv,null,o.createElement(gv,null),o.createElement(pv.Content,{ref:r,style:{position:"fixed",left:0,right:0,top:0,zIndex:50,marginTop:"96px",display:"flex",height:"auto",flexDirection:"column",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",border:"1px solid hsl(var(--border))",backgroundColor:"hsl(var(--background))"},className:e,...n},o.createElement("div",{style:{margin:"16px auto 0",height:"8px",width:"100px",borderRadius:"9999px",backgroundColor:"hsl(var(--muted))"}}),t)));yv.displayName="DrawerContent";o.forwardRef(({className:e,...t},n)=>o.createElement(pv.Title,{ref:n,style:{fontSize:"18px",fontWeight:600,lineHeight:1,letterSpacing:"-0.025em"},className:e,...t})).displayName=pv.Title.displayName;o.forwardRef(({className:e,...t},n)=>o.createElement(pv.Description,{ref:n,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:e,...t})).displayName=pv.Description.displayName;exports.AgenticFlowVisualizer=ip,exports.AnthropicIcon=Jc,exports.Badge=Ac,exports.Checkbox=Ay,exports.Drawer=hv,exports.Edge=vc,exports.FileSelector=({files:t,currentFile:n,onFileSelect:r,onRefresh:o,loading:a=!1,disabled:i=!1})=>e.createElement(ay,null,0!==t.length||a?e.createElement(Fg,{value:n||"",onValueChange:r,disabled:i||a},e.createElement(sy,{disabled:i,loading:a},e.createElement(ey,null,e.createElement(ly,null,e.createElement(jg,{placeholder:a?"Loading sessions...":0===t.length?"No sessions found":"Select an Agent Session..."})))),e.createElement(ry,null,0!==t.length||a?t.map(t=>e.createElement(oy,{key:t.name,value:t.name},t.name)):e.createElement(cy,null,"No agent sessions available"))):e.createElement(iy,null,"No agent sessions available"),t.length>0&&e.createElement(uy,{onClick:e=>{e.stopPropagation(),o()},disabled:a||i,loading:a,title:a?"Loading...":"Refresh files"},a?e.createElement(dy,null):e.createElement(fy,null))),exports.GlobalStyles=()=>e.createElement(uc,{styles:dc`
505
+ * {
506
+ box-sizing: border-box;
507
+ border-color: #e5e7eb;
508
+ }
509
+
510
+ html,
511
+ body {
512
+ margin: 0;
513
+ padding: 0;
514
+ background-color: #ffffff;
515
+ color: #1f2937;
516
+ font-family:
517
+ ui-sans-serif,
518
+ system-ui,
519
+ -apple-system,
520
+ BlinkMacSystemFont,
521
+ "Segoe UI",
522
+ Roboto,
523
+ "Helvetica Neue",
524
+ Arial,
525
+ "Noto Sans",
526
+ sans-serif;
527
+ line-height: 1.5;
528
+ -webkit-font-smoothing: antialiased;
529
+ -moz-osx-font-smoothing: grayscale;
530
+ transition:
531
+ background-color 0.2s ease-in-out,
532
+ color 0.2s ease-in-out;
533
+ }
534
+
535
+ /* Dark theme styles */
536
+ html.dark,
537
+ html.dark body {
538
+ background-color: #0f172a;
539
+ color: #f1f5f9;
540
+ }
541
+
542
+ /* ReactFlow overrides */
543
+ .react-flow__edge {
544
+ cursor: default !important;
545
+ }
546
+
547
+ .react-flow__edge-path {
548
+ cursor: default !important;
549
+ }
550
+
551
+ .react-flow__edge-label {
552
+ font-size: 10px;
553
+ background: white;
554
+ padding: 2px 4px;
555
+ border-radius: 4px;
556
+ border: 1px solid #e5e7eb;
557
+ max-width: 150px;
558
+ overflow: hidden;
559
+ text-overflow: ellipsis;
560
+ white-space: nowrap;
561
+ }
562
+
563
+ /* Dark theme ReactFlow overrides */
564
+ html.dark .react-flow__edge-label {
565
+ background: #1e293b;
566
+ border: 1px solid #475569;
567
+ color: #f1f5f9;
568
+ }
569
+
570
+ /* Radix UI Select styles */
571
+ [data-radix-select-trigger],
572
+ .shadcn-select {
573
+ display: flex;
574
+ height: 2.5rem;
575
+ width: 100%;
576
+ align-items: center;
577
+ justify-content: space-between;
578
+ border-radius: 0.375rem;
579
+ border: 1px solid #e5e7eb;
580
+ background-color: #ffffff;
581
+ padding: 0.5rem 0.75rem;
582
+ font-size: 0.875rem;
583
+ line-height: 1.25rem;
584
+ outline: none;
585
+ transition: all 0.2s ease-in-out;
586
+ }
587
+
588
+ /* Dark theme select styles */
589
+ html.dark [data-radix-select-trigger],
590
+ html.dark .shadcn-select {
591
+ border: 1px solid #475569;
592
+ background-color: #1e293b;
593
+ color: #f1f5f9;
594
+ }
595
+
596
+ [data-radix-select-trigger]:focus,
597
+ .shadcn-select:focus {
598
+ outline: none;
599
+ box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
600
+ }
601
+
602
+ [data-radix-select-trigger]:disabled,
603
+ .shadcn-select:disabled {
604
+ cursor: not-allowed;
605
+ opacity: 0.5;
606
+ }
607
+
608
+ /* File selector refresh button styles */
609
+ .file-selector-refresh-btn {
610
+ padding: 0.5rem;
611
+ border-radius: 0.375rem;
612
+ border: 1px solid #e5e7eb;
613
+ background-color: #ffffff;
614
+ transition: all 0.2s ease-in-out;
615
+ }
616
+
617
+ .file-selector-refresh-btn:hover {
618
+ background-color: #f3f4f6;
619
+ color: #374151;
620
+ }
621
+
622
+ .file-selector-refresh-btn:disabled {
623
+ opacity: 0.5;
624
+ cursor: not-allowed;
625
+ }
626
+
627
+ /* Dark theme file selector refresh button */
628
+ html.dark .file-selector-refresh-btn {
629
+ border: 1px solid #475569;
630
+ background-color: #1e293b;
631
+ color: #f1f5f9;
632
+ }
633
+
634
+ html.dark .file-selector-refresh-btn:hover {
635
+ background-color: #334155;
636
+ color: #f1f5f9;
637
+ }
638
+
639
+ /* CSS Variables for backward compatibility */
640
+ :root {
641
+ --background: #ffffff;
642
+ --foreground: #1f2937;
643
+ --card: #ffffff;
644
+ --card-foreground: #1f2937;
645
+ --popover: #ffffff;
646
+ --popover-foreground: #1f2937;
647
+ --primary: #6366f1;
648
+ --primary-foreground: #ffffff;
649
+ --secondary: #f3f4f6;
650
+ --secondary-foreground: #1f2937;
651
+ --muted: #f3f4f6;
652
+ --muted-foreground: #6b7280;
653
+ --accent: #f3f4f6;
654
+ --accent-foreground: #1f2937;
655
+ --destructive: #ef4444;
656
+ --destructive-foreground: #ffffff;
657
+ --border: #e5e7eb;
658
+ --input: #e5e7eb;
659
+ --ring: #6366f1;
660
+ --radius: 0.5rem;
661
+ }
662
+
663
+ /* Dark theme CSS variables */
664
+ html.dark {
665
+ --background: #0f172a;
666
+ --foreground: #f1f5f9;
667
+ --card: #1e293b;
668
+ --card-foreground: #f1f5f9;
669
+ --popover: #1e293b;
670
+ --popover-foreground: #f1f5f9;
671
+ --primary: #6366f1;
672
+ --primary-foreground: #ffffff;
673
+ --secondary: #334155;
674
+ --secondary-foreground: #f1f5f9;
675
+ --muted: #334155;
676
+ --muted-foreground: #94a3b8;
677
+ --accent: #334155;
678
+ --accent-foreground: #f1f5f9;
679
+ --destructive: #ef4444;
680
+ --destructive-foreground: #ffffff;
681
+ --border: #475569;
682
+ --input: #475569;
683
+ --ring: #6366f1;
684
+ --radius: 0.5rem;
685
+ }
686
+ `}),exports.GoogleIcon=Qc,exports.JsonTreeViewer=Zc,exports.Node=tu,exports.OpenAIIcon=Gc,exports.Select=Fg,exports.Sheet=Qf,exports.ThemeProvider=gc,exports.Timeline=Cu,exports.Visualizer=t=>e.createElement(gc,null,e.createElement(Vi,null,e.createElement(ip,t))),exports.calculateAutoLayout=op,exports.cn=function(...e){return function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=kc(e))&&(r&&(r+=" "),r+=t);return r}(e)},exports.conditionalStyle=function(e,t,n=""){return e?t:n},exports.darkTheme=pc,exports.defaultTheme=hc,exports.formatCurrency=Mc,exports.formatLatency=Rc,exports.getColor=function(e,t){return e.colors[t]||e.colors.foreground},exports.getSpacing=function(e,t){return e.spacing[t]||e.spacing.md},exports.lightTheme=fc,exports.toTitleCase=Nc,exports.truncateText=Oc,exports.useTheme=yc,exports.useThemeValue=()=>{const{theme:e}=yc();return e};