@volter/world-console 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var bQ=Object.create;var{getPrototypeOf:DQ,defineProperty:U8,getOwnPropertyNames:hQ}=Object;var EQ=Object.prototype.hasOwnProperty;function xQ(_){return this[_]}var mQ,gQ,h1=(_,Q,J)=>{var q=_!=null&&typeof _==="object";if(q){var U=Q?mQ??=new WeakMap:gQ??=new WeakMap,G=U.get(_);if(G)return G}J=_!=null?bQ(DQ(_)):{};let Z=Q||!_||!_.__esModule?U8(J,"default",{value:_,enumerable:!0}):J;for(let F of hQ(_))if(!EQ.call(Z,F))U8(Z,F,{get:xQ.bind(_,F),enumerable:!0});if(q)U.set(_,Z);return Z};var i0=(_,Q)=>()=>(Q||_((Q={exports:{}}).exports,Q),Q.exports);var X0=i0((pQ,k5)=>{(function(){function _(M,m){Object.defineProperty(q.prototype,M,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",m[0],m[1])}})}function Q(M){if(M===null||typeof M!=="object")return null;return M=Q1&&M[Q1]||M["@@iterator"],typeof M==="function"?M:null}function J(M,m){M=(M=M.constructor)&&(M.displayName||M.name)||"ReactClass";var n=M+"."+m;G1[n]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",m,M),G1[n]=!0)}function q(M,m,n){this.props=M,this.context=m,this.refs=Y1,this.updater=n||$1}function U(){}function G(M,m,n){this.props=M,this.context=m,this.refs=Y1,this.updater=n||$1}function Z(){}function F(M){return""+M}function X(M){try{F(M);var m=!1}catch(U1){m=!0}if(m){m=console;var n=m.error,_1=typeof Symbol==="function"&&Symbol.toStringTag&&M[Symbol.toStringTag]||M.constructor.name||"Object";return n.call(m,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",_1),F(M)}}function Y(M){if(M==null)return null;if(typeof M==="function")return M.$$typeof===z1?null:M.displayName||M.name||null;if(typeof M==="string")return M;switch(M){case D:return"Fragment";case y:return"Profiler";case f:return"StrictMode";case t:return"Suspense";case a:return"SuspenseList";case e:return"Activity"}if(typeof M==="object")switch(typeof M.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),M.$$typeof){case V:return"Portal";case u:return M.displayName||"Context";case p:return(M._context.displayName||"Context")+".Consumer";case s:var m=M.render;return M=M.displayName,M||(M=m.displayName||m.name||"",M=M!==""?"ForwardRef("+M+")":"ForwardRef"),M;case d:return m=M.displayName||null,m!==null?m:Y(M.type)||"Memo";case c:m=M._payload,M=M._init;try{return Y(M(m))}catch(n){}}return null}function H(M){if(M===D)return"<>";if(typeof M==="object"&&M!==null&&M.$$typeof===c)return"<...>";try{var m=Y(M);return m?"<"+m+">":"<...>"}catch(n){return"<...>"}}function K(){var M=q1.A;return M===null?null:M.getOwner()}function L(){return Error("react-stack-top-frame")}function z(M){if(y1.call(M,"key")){var m=Object.getOwnPropertyDescriptor(M,"key").get;if(m&&m.isReactWarning)return!1}return M.key!==void 0}function W(M,m){function n(){l1||(l1=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",m))}n.isReactWarning=!0,Object.defineProperty(M,"key",{get:n,configurable:!0})}function O(){var M=Y(this.type);return F0[M]||(F0[M]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),M=this.props.ref,M!==void 0?M:null}function T(M,m,n,_1,U1,W1){var L1=n.ref;return M={$$typeof:x,type:M,key:m,props:n,_owner:_1},(L1!==void 0?L1:null)!==null?Object.defineProperty(M,"ref",{enumerable:!1,get:O}):Object.defineProperty(M,"ref",{enumerable:!1,value:null}),M._store={},Object.defineProperty(M._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(M,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(M,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U1}),Object.defineProperty(M,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:W1}),Object.freeze&&(Object.freeze(M.props),Object.freeze(M)),M}function B(M,m){return m=T(M.type,m,M.props,M._owner,M._debugStack,M._debugTask),M._store&&(m._store.validated=M._store.validated),m}function w(M){A(M)?M._store&&(M._store.validated=1):typeof M==="object"&&M!==null&&M.$$typeof===c&&(M._payload.status==="fulfilled"?A(M._payload.value)&&M._payload.value._store&&(M._payload.value._store.validated=1):M._store&&(M._store.validated=1))}function A(M){return typeof M==="object"&&M!==null&&M.$$typeof===x}function R(M){var m={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(n){return m[n]})}function I(M,m){return typeof M==="object"&&M!==null&&M.key!=null?(X(M.key),R(""+M.key)):m.toString(36)}function C(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status==="string"?M.then(Z,Z):(M.status="pending",M.then(function(m){M.status==="pending"&&(M.status="fulfilled",M.value=m)},function(m){M.status==="pending"&&(M.status="rejected",M.reason=m)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function P(M,m,n,_1,U1){var W1=typeof M;if(W1==="undefined"||W1==="boolean")M=null;var L1=!1;if(M===null)L1=!0;else switch(W1){case"bigint":case"string":case"number":L1=!0;break;case"object":switch(M.$$typeof){case x:case V:L1=!0;break;case c:return L1=M._init,P(L1(M._payload),m,n,_1,U1)}}if(L1){L1=M,U1=U1(L1);var f1=_1===""?"."+I(L1,0):_1;return o(U1)?(n="",f1!=null&&(n=f1.replace(n1,"$&/")+"/"),P(U1,m,n,"",function(H0){return H0})):U1!=null&&(A(U1)&&(U1.key!=null&&(L1&&L1.key===U1.key||X(U1.key)),n=B(U1,n+(U1.key==null||L1&&L1.key===U1.key?"":(""+U1.key).replace(n1,"$&/")+"/")+f1),_1!==""&&L1!=null&&A(L1)&&L1.key==null&&L1._store&&!L1._store.validated&&(n._store.validated=2),U1=n),m.push(U1)),1}if(L1=0,f1=_1===""?".":_1+":",o(M))for(var A1=0;A1<M.length;A1++)_1=M[A1],W1=f1+I(_1,A1),L1+=P(_1,m,n,W1,U1);else if(A1=Q(M),typeof A1==="function")for(A1===M.entries&&(o1||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),o1=!0),M=A1.call(M),A1=0;!(_1=M.next()).done;)_1=_1.value,W1=f1+I(_1,A1++),L1+=P(_1,m,n,W1,U1);else if(W1==="object"){if(typeof M.then==="function")return P(C(M),m,n,_1,U1);throw m=String(M),Error("Objects are not valid as a React child (found: "+(m==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":m)+"). If you meant to render a collection of children, use an array instead.")}return L1}function k(M,m,n){if(M==null)return M;var _1=[],U1=0;return P(M,_1,"","",function(W1){return m.call(n,W1,U1++)}),_1}function N(M){if(M._status===-1){var m=M._ioInfo;m!=null&&(m.start=m.end=performance.now()),m=M._result;var n=m();if(n.then(function(U1){if(M._status===0||M._status===-1){M._status=1,M._result=U1;var W1=M._ioInfo;W1!=null&&(W1.end=performance.now()),n.status===void 0&&(n.status="fulfilled",n.value=U1)}},function(U1){if(M._status===0||M._status===-1){M._status=2,M._result=U1;var W1=M._ioInfo;W1!=null&&(W1.end=performance.now()),n.status===void 0&&(n.status="rejected",n.reason=U1)}}),m=M._ioInfo,m!=null){m.value=n;var _1=n.displayName;typeof _1==="string"&&(m.name=_1)}M._status===-1&&(M._status=0,M._result=n)}if(M._status===1)return m=M._result,m===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
1
+ var bQ=Object.create;var{getPrototypeOf:DQ,defineProperty:U8,getOwnPropertyNames:hQ}=Object;var EQ=Object.prototype.hasOwnProperty;function xQ(_){return this[_]}var mQ,gQ,h1=(_,Q,J)=>{var q=_!=null&&typeof _==="object";if(q){var U=Q?mQ??=new WeakMap:gQ??=new WeakMap,G=U.get(_);if(G)return G}J=_!=null?bQ(DQ(_)):{};let Z=Q||!_||!_.__esModule?U8(J,"default",{value:_,enumerable:!0}):J;for(let F of hQ(_))if(!EQ.call(Z,F))U8(Z,F,{get:xQ.bind(_,F),enumerable:!0});if(q)U.set(_,Z);return Z};var i0=(_,Q)=>()=>(Q||_((Q={exports:{}}).exports,Q),Q.exports);var X0=i0((pQ,k5)=>{(function(){function _(M,m){Object.defineProperty(q.prototype,M,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",m[0],m[1])}})}function Q(M){if(M===null||typeof M!=="object")return null;return M=Q1&&M[Q1]||M["@@iterator"],typeof M==="function"?M:null}function J(M,m){M=(M=M.constructor)&&(M.displayName||M.name)||"ReactClass";var n=M+"."+m;G1[n]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",m,M),G1[n]=!0)}function q(M,m,n){this.props=M,this.context=m,this.refs=Y1,this.updater=n||$1}function U(){}function G(M,m,n){this.props=M,this.context=m,this.refs=Y1,this.updater=n||$1}function Z(){}function F(M){return""+M}function H(M){try{F(M);var m=!1}catch(U1){m=!0}if(m){m=console;var n=m.error,_1=typeof Symbol==="function"&&Symbol.toStringTag&&M[Symbol.toStringTag]||M.constructor.name||"Object";return n.call(m,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",_1),F(M)}}function Y(M){if(M==null)return null;if(typeof M==="function")return M.$$typeof===z1?null:M.displayName||M.name||null;if(typeof M==="string")return M;switch(M){case D:return"Fragment";case y:return"Profiler";case f:return"StrictMode";case t:return"Suspense";case a:return"SuspenseList";case e:return"Activity"}if(typeof M==="object")switch(typeof M.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),M.$$typeof){case V:return"Portal";case u:return M.displayName||"Context";case p:return(M._context.displayName||"Context")+".Consumer";case s:var m=M.render;return M=M.displayName,M||(M=m.displayName||m.name||"",M=M!==""?"ForwardRef("+M+")":"ForwardRef"),M;case d:return m=M.displayName||null,m!==null?m:Y(M.type)||"Memo";case c:m=M._payload,M=M._init;try{return Y(M(m))}catch(n){}}return null}function X(M){if(M===D)return"<>";if(typeof M==="object"&&M!==null&&M.$$typeof===c)return"<...>";try{var m=Y(M);return m?"<"+m+">":"<...>"}catch(n){return"<...>"}}function K(){var M=q1.A;return M===null?null:M.getOwner()}function L(){return Error("react-stack-top-frame")}function z(M){if(y1.call(M,"key")){var m=Object.getOwnPropertyDescriptor(M,"key").get;if(m&&m.isReactWarning)return!1}return M.key!==void 0}function W(M,m){function n(){l1||(l1=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",m))}n.isReactWarning=!0,Object.defineProperty(M,"key",{get:n,configurable:!0})}function O(){var M=Y(this.type);return F0[M]||(F0[M]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),M=this.props.ref,M!==void 0?M:null}function T(M,m,n,_1,U1,W1){var L1=n.ref;return M={$$typeof:x,type:M,key:m,props:n,_owner:_1},(L1!==void 0?L1:null)!==null?Object.defineProperty(M,"ref",{enumerable:!1,get:O}):Object.defineProperty(M,"ref",{enumerable:!1,value:null}),M._store={},Object.defineProperty(M._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(M,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(M,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U1}),Object.defineProperty(M,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:W1}),Object.freeze&&(Object.freeze(M.props),Object.freeze(M)),M}function B(M,m){return m=T(M.type,m,M.props,M._owner,M._debugStack,M._debugTask),M._store&&(m._store.validated=M._store.validated),m}function w(M){A(M)?M._store&&(M._store.validated=1):typeof M==="object"&&M!==null&&M.$$typeof===c&&(M._payload.status==="fulfilled"?A(M._payload.value)&&M._payload.value._store&&(M._payload.value._store.validated=1):M._store&&(M._store.validated=1))}function A(M){return typeof M==="object"&&M!==null&&M.$$typeof===x}function R(M){var m={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(n){return m[n]})}function I(M,m){return typeof M==="object"&&M!==null&&M.key!=null?(H(M.key),R(""+M.key)):m.toString(36)}function C(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status==="string"?M.then(Z,Z):(M.status="pending",M.then(function(m){M.status==="pending"&&(M.status="fulfilled",M.value=m)},function(m){M.status==="pending"&&(M.status="rejected",M.reason=m)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function P(M,m,n,_1,U1){var W1=typeof M;if(W1==="undefined"||W1==="boolean")M=null;var L1=!1;if(M===null)L1=!0;else switch(W1){case"bigint":case"string":case"number":L1=!0;break;case"object":switch(M.$$typeof){case x:case V:L1=!0;break;case c:return L1=M._init,P(L1(M._payload),m,n,_1,U1)}}if(L1){L1=M,U1=U1(L1);var f1=_1===""?"."+I(L1,0):_1;return o(U1)?(n="",f1!=null&&(n=f1.replace(n1,"$&/")+"/"),P(U1,m,n,"",function(H0){return H0})):U1!=null&&(A(U1)&&(U1.key!=null&&(L1&&L1.key===U1.key||H(U1.key)),n=B(U1,n+(U1.key==null||L1&&L1.key===U1.key?"":(""+U1.key).replace(n1,"$&/")+"/")+f1),_1!==""&&L1!=null&&A(L1)&&L1.key==null&&L1._store&&!L1._store.validated&&(n._store.validated=2),U1=n),m.push(U1)),1}if(L1=0,f1=_1===""?".":_1+":",o(M))for(var A1=0;A1<M.length;A1++)_1=M[A1],W1=f1+I(_1,A1),L1+=P(_1,m,n,W1,U1);else if(A1=Q(M),typeof A1==="function")for(A1===M.entries&&(o1||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),o1=!0),M=A1.call(M),A1=0;!(_1=M.next()).done;)_1=_1.value,W1=f1+I(_1,A1++),L1+=P(_1,m,n,W1,U1);else if(W1==="object"){if(typeof M.then==="function")return P(C(M),m,n,_1,U1);throw m=String(M),Error("Objects are not valid as a React child (found: "+(m==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":m)+"). If you meant to render a collection of children, use an array instead.")}return L1}function k(M,m,n){if(M==null)return M;var _1=[],U1=0;return P(M,_1,"","",function(W1){return m.call(n,W1,U1++)}),_1}function N(M){if(M._status===-1){var m=M._ioInfo;m!=null&&(m.start=m.end=performance.now()),m=M._result;var n=m();if(n.then(function(U1){if(M._status===0||M._status===-1){M._status=1,M._result=U1;var W1=M._ioInfo;W1!=null&&(W1.end=performance.now()),n.status===void 0&&(n.status="fulfilled",n.value=U1)}},function(U1){if(M._status===0||M._status===-1){M._status=2,M._result=U1;var W1=M._ioInfo;W1!=null&&(W1.end=performance.now()),n.status===void 0&&(n.status="rejected",n.reason=U1)}}),m=M._ioInfo,m!=null){m.value=n;var _1=n.displayName;typeof _1==="string"&&(m.name=_1)}M._status===-1&&(M._status=0,M._result=n)}if(M._status===1)return m=M._result,m===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
2
2
 
3
3
  Your code should look like:
4
4
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -10,28 +10,28 @@ Your code should look like:
10
10
  1. You might have mismatching versions of React and the renderer (such as React DOM)
11
11
  2. You might be breaking the Rules of Hooks
12
12
  3. You might have more than one copy of React in the same app
13
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),M}function E(){q1.asyncTransitions--}function g(M){if(y0===null)try{var m=("require"+Math.random()).slice(0,7);y0=(k5&&k5[m]).call(k5,"timers").setImmediate}catch(n){y0=function(_1){B2===!1&&(B2=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var U1=new MessageChannel;U1.port1.onmessage=_1,U1.port2.postMessage(void 0)}}return y0(M)}function h(M){return 1<M.length&&typeof AggregateError==="function"?AggregateError(M):M[0]}function S(M,m){m!==M2-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),M2=m}function b(M,m,n){var _1=q1.actQueue;if(_1!==null)if(_1.length!==0)try{j(_1),g(function(){return b(M,m,n)});return}catch(U1){q1.thrownErrors.push(U1)}else q1.actQueue=null;0<q1.thrownErrors.length?(_1=h(q1.thrownErrors),q1.thrownErrors.length=0,n(_1)):m(M)}function j(M){if(!m2){m2=!0;var m=0;try{for(;m<M.length;m++){var n=M[m];do{q1.didUsePromise=!1;var _1=n(!1);if(_1!==null){if(q1.didUsePromise){M[m]=n,M.splice(0,m);return}n=_1}else break}while(1)}M.length=0}catch(U1){M.splice(0,m+1),q1.thrownErrors.push(U1)}finally{m2=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var x=Symbol.for("react.transitional.element"),V=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),t=Symbol.for("react.suspense"),a=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),e=Symbol.for("react.activity"),Q1=Symbol.iterator,G1={},$1={isMounted:function(){return!1},enqueueForceUpdate:function(M){J(M,"forceUpdate")},enqueueReplaceState:function(M){J(M,"replaceState")},enqueueSetState:function(M){J(M,"setState")}},Z1=Object.assign,Y1={};Object.freeze(Y1),q.prototype.isReactComponent={},q.prototype.setState=function(M,m){if(typeof M!=="object"&&typeof M!=="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,m,"setState")},q.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};var K1={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(r0 in K1)K1.hasOwnProperty(r0)&&_(r0,K1[r0]);U.prototype=q.prototype,K1=G.prototype=new U,K1.constructor=G,Z1(K1,q.prototype),K1.isPureReactComponent=!0;var o=Array.isArray,z1=Symbol.for("react.client.reference"),q1={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},y1=Object.prototype.hasOwnProperty,c1=console.createTask?console.createTask:function(){return null};K1={react_stack_bottom_frame:function(M){return M()}};var l1,k0,F0={},M0=K1.react_stack_bottom_frame.bind(K1,L)(),a1=c1(H(L)),o1=!1,n1=/\/+/g,K0=typeof reportError==="function"?reportError:function(M){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var m=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M==="object"&&M!==null&&typeof M.message==="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(m))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",M);return}console.error(M)},B2=!1,y0=null,M2=0,T2=!1,m2=!1,S5=typeof queueMicrotask==="function"?function(M){queueMicrotask(function(){return queueMicrotask(M)})}:g;K1=Object.freeze({__proto__:null,c:function(M){return v().useMemoCache(M)}});var r0={map:k,forEach:function(M,m,n){k(M,function(){m.apply(this,arguments)},n)},count:function(M){var m=0;return k(M,function(){m++}),m},toArray:function(M){return k(M,function(m){return m})||[]},only:function(M){if(!A(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};pQ.Activity=e,pQ.Children=r0,pQ.Component=q,pQ.Fragment=D,pQ.Profiler=y,pQ.PureComponent=G,pQ.StrictMode=f,pQ.Suspense=t,pQ.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q1,pQ.__COMPILER_RUNTIME=K1,pQ.act=function(M){var m=q1.actQueue,n=M2;M2++;var _1=q1.actQueue=m!==null?m:[],U1=!1;try{var W1=M()}catch(A1){q1.thrownErrors.push(A1)}if(0<q1.thrownErrors.length)throw S(m,n),M=h(q1.thrownErrors),q1.thrownErrors.length=0,M;if(W1!==null&&typeof W1==="object"&&typeof W1.then==="function"){var L1=W1;return S5(function(){U1||T2||(T2=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(A1,H0){U1=!0,L1.then(function(v0){if(S(m,n),n===0){try{j(_1),g(function(){return b(v0,A1,H0)})}catch(v4){q1.thrownErrors.push(v4)}if(0<q1.thrownErrors.length){var y4=h(q1.thrownErrors);q1.thrownErrors.length=0,H0(y4)}}else A1(v0)},function(v0){S(m,n),0<q1.thrownErrors.length?(v0=h(q1.thrownErrors),q1.thrownErrors.length=0,H0(v0)):H0(v0)})}}}var f1=W1;if(S(m,n),n===0&&(j(_1),_1.length!==0&&S5(function(){U1||T2||(T2=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),q1.actQueue=null),0<q1.thrownErrors.length)throw M=h(q1.thrownErrors),q1.thrownErrors.length=0,M;return{then:function(A1,H0){U1=!0,n===0?(q1.actQueue=_1,g(function(){return b(f1,A1,H0)})):A1(f1)}}},pQ.cache=function(M){return function(){return M.apply(null,arguments)}},pQ.cacheSignal=function(){return null},pQ.captureOwnerStack=function(){var M=q1.getCurrentStack;return M===null?null:M()},pQ.cloneElement=function(M,m,n){if(M===null||M===void 0)throw Error("The argument must be a React element, but you passed "+M+".");var _1=Z1({},M.props),U1=M.key,W1=M._owner;if(m!=null){var L1;_:{if(y1.call(m,"ref")&&(L1=Object.getOwnPropertyDescriptor(m,"ref").get)&&L1.isReactWarning){L1=!1;break _}L1=m.ref!==void 0}L1&&(W1=K()),z(m)&&(X(m.key),U1=""+m.key);for(f1 in m)!y1.call(m,f1)||f1==="key"||f1==="__self"||f1==="__source"||f1==="ref"&&m.ref===void 0||(_1[f1]=m[f1])}var f1=arguments.length-2;if(f1===1)_1.children=n;else if(1<f1){L1=Array(f1);for(var A1=0;A1<f1;A1++)L1[A1]=arguments[A1+2];_1.children=L1}_1=T(M.type,U1,_1,W1,M._debugStack,M._debugTask);for(U1=2;U1<arguments.length;U1++)w(arguments[U1]);return _1},pQ.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:p,_context:M},M._currentRenderer=null,M._currentRenderer2=null,M},pQ.createElement=function(M,m,n){for(var _1=2;_1<arguments.length;_1++)w(arguments[_1]);_1={};var U1=null;if(m!=null)for(A1 in k0||!("__self"in m)||"key"in m||(k0=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),z(m)&&(X(m.key),U1=""+m.key),m)y1.call(m,A1)&&A1!=="key"&&A1!=="__self"&&A1!=="__source"&&(_1[A1]=m[A1]);var W1=arguments.length-2;if(W1===1)_1.children=n;else if(1<W1){for(var L1=Array(W1),f1=0;f1<W1;f1++)L1[f1]=arguments[f1+2];Object.freeze&&Object.freeze(L1),_1.children=L1}if(M&&M.defaultProps)for(A1 in W1=M.defaultProps,W1)_1[A1]===void 0&&(_1[A1]=W1[A1]);U1&&W(_1,typeof M==="function"?M.displayName||M.name||"Unknown":M);var A1=1e4>q1.recentlyCreatedOwnerStacks++;return T(M,U1,_1,K(),A1?Error("react-stack-top-frame"):M0,A1?c1(H(M)):a1)},pQ.createRef=function(){var M={current:null};return Object.seal(M),M},pQ.forwardRef=function(M){M!=null&&M.$$typeof===d?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof M!=="function"?console.error("forwardRef requires a render function but was given %s.",M===null?"null":typeof M):M.length!==0&&M.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",M.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),M!=null&&M.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var m={$$typeof:s,render:M},n;return Object.defineProperty(m,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(_1){n=_1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:_1}),M.displayName=_1)}}),m},pQ.isValidElement=A,pQ.lazy=function(M){M={_status:-1,_result:M};var m={$$typeof:c,_payload:M,_init:N},n={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return M._ioInfo=n,m._debugInfo=[{awaited:n}],m},pQ.memo=function(M,m){M==null&&console.error("memo: The first argument must be a component. Instead received: %s",M===null?"null":typeof M),m={$$typeof:d,type:M,compare:m===void 0?null:m};var n;return Object.defineProperty(m,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(_1){n=_1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:_1}),M.displayName=_1)}}),m},pQ.startTransition=function(M){var m=q1.T,n={};n._updatedFibers=new Set,q1.T=n;try{var _1=M(),U1=q1.S;U1!==null&&U1(n,_1),typeof _1==="object"&&_1!==null&&typeof _1.then==="function"&&(q1.asyncTransitions++,_1.then(E,E),_1.then(Z,K0))}catch(W1){K0(W1)}finally{m===null&&n._updatedFibers&&(M=n._updatedFibers.size,n._updatedFibers.clear(),10<M&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),m!==null&&n.types!==null&&(m.types!==null&&m.types!==n.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),m.types=n.types),q1.T=m}},pQ.unstable_useCacheRefresh=function(){return v().useCacheRefresh()},pQ.use=function(M){return v().use(M)},pQ.useActionState=function(M,m,n){return v().useActionState(M,m,n)},pQ.useCallback=function(M,m){return v().useCallback(M,m)},pQ.useContext=function(M){var m=v();return M.$$typeof===p&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),m.useContext(M)},pQ.useDebugValue=function(M,m){return v().useDebugValue(M,m)},pQ.useDeferredValue=function(M,m){return v().useDeferredValue(M,m)},pQ.useEffect=function(M,m){return M==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),v().useEffect(M,m)},pQ.useEffectEvent=function(M){return v().useEffectEvent(M)},pQ.useId=function(){return v().useId()},pQ.useImperativeHandle=function(M,m,n){return v().useImperativeHandle(M,m,n)},pQ.useInsertionEffect=function(M,m){return M==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),v().useInsertionEffect(M,m)},pQ.useLayoutEffect=function(M,m){return M==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),v().useLayoutEffect(M,m)},pQ.useMemo=function(M,m){return v().useMemo(M,m)},pQ.useOptimistic=function(M,m){return v().useOptimistic(M,m)},pQ.useReducer=function(M,m,n){return v().useReducer(M,m,n)},pQ.useRef=function(M){return v().useRef(M)},pQ.useState=function(M){return v().useState(M)},pQ.useSyncExternalStore=function(M,m,n){return v().useSyncExternalStore(M,m,n)},pQ.useTransition=function(){return v().useTransition()},pQ.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var G8=i0((cQ)=>{var d0=h1(X0());(function(){function _(f){if(f==null)return null;if(typeof f==="function")return f.$$typeof===v?null:f.displayName||f.name||null;if(typeof f==="string")return f;switch(f){case O:return"Fragment";case B:return"Profiler";case T:return"StrictMode";case I:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof f==="object")switch(typeof f.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case W:return"Portal";case A:return f.displayName||"Context";case w:return(f._context.displayName||"Context")+".Consumer";case R:var y=f.render;return f=f.displayName,f||(f=y.displayName||y.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case P:return y=f.displayName||null,y!==null?y:_(f.type)||"Memo";case k:y=f._payload,f=f._init;try{return _(f(y))}catch(p){}}return null}function Q(f){return""+f}function J(f){try{Q(f);var y=!1}catch(s){y=!0}if(y){y=console;var p=y.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return p.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(f)}}function q(f){if(f===O)return"<>";if(typeof f==="object"&&f!==null&&f.$$typeof===k)return"<...>";try{var y=_(f);return y?"<"+y+">":"<...>"}catch(p){return"<...>"}}function U(){var f=E.A;return f===null?null:f.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(f){if(g.call(f,"key")){var y=Object.getOwnPropertyDescriptor(f,"key").get;if(y&&y.isReactWarning)return!1}return f.key!==void 0}function F(f,y){function p(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}p.isReactWarning=!0,Object.defineProperty(f,"key",{get:p,configurable:!0})}function X(){var f=_(this.type);return j[f]||(j[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function Y(f,y,p,u,s,t){var a=p.ref;return f={$$typeof:z,type:f,key:y,props:p,_owner:u},(a!==void 0?a:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:X}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function H(f,y,p,u,s,t){var a=y.children;if(a!==void 0)if(u)if(h(a)){for(u=0;u<a.length;u++)K(a[u]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else K(a);if(g.call(y,"key")){a=_(f);var d=Object.keys(y).filter(function(e){return e!=="key"});u=0<d.length?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}",D[a+u]||(d=0<d.length?"{"+d.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
13
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),M}function E(){q1.asyncTransitions--}function g(M){if(y0===null)try{var m=("require"+Math.random()).slice(0,7);y0=(k5&&k5[m]).call(k5,"timers").setImmediate}catch(n){y0=function(_1){B2===!1&&(B2=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var U1=new MessageChannel;U1.port1.onmessage=_1,U1.port2.postMessage(void 0)}}return y0(M)}function h(M){return 1<M.length&&typeof AggregateError==="function"?AggregateError(M):M[0]}function S(M,m){m!==M2-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),M2=m}function b(M,m,n){var _1=q1.actQueue;if(_1!==null)if(_1.length!==0)try{j(_1),g(function(){return b(M,m,n)});return}catch(U1){q1.thrownErrors.push(U1)}else q1.actQueue=null;0<q1.thrownErrors.length?(_1=h(q1.thrownErrors),q1.thrownErrors.length=0,n(_1)):m(M)}function j(M){if(!g2){g2=!0;var m=0;try{for(;m<M.length;m++){var n=M[m];do{q1.didUsePromise=!1;var _1=n(!1);if(_1!==null){if(q1.didUsePromise){M[m]=n,M.splice(0,m);return}n=_1}else break}while(1)}M.length=0}catch(U1){M.splice(0,m+1),q1.thrownErrors.push(U1)}finally{g2=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var x=Symbol.for("react.transitional.element"),V=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),t=Symbol.for("react.suspense"),a=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),e=Symbol.for("react.activity"),Q1=Symbol.iterator,G1={},$1={isMounted:function(){return!1},enqueueForceUpdate:function(M){J(M,"forceUpdate")},enqueueReplaceState:function(M){J(M,"replaceState")},enqueueSetState:function(M){J(M,"setState")}},Z1=Object.assign,Y1={};Object.freeze(Y1),q.prototype.isReactComponent={},q.prototype.setState=function(M,m){if(typeof M!=="object"&&typeof M!=="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,m,"setState")},q.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};var K1={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(r0 in K1)K1.hasOwnProperty(r0)&&_(r0,K1[r0]);U.prototype=q.prototype,K1=G.prototype=new U,K1.constructor=G,Z1(K1,q.prototype),K1.isPureReactComponent=!0;var o=Array.isArray,z1=Symbol.for("react.client.reference"),q1={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},y1=Object.prototype.hasOwnProperty,c1=console.createTask?console.createTask:function(){return null};K1={react_stack_bottom_frame:function(M){return M()}};var l1,k0,F0={},M0=K1.react_stack_bottom_frame.bind(K1,L)(),a1=c1(X(L)),o1=!1,n1=/\/+/g,K0=typeof reportError==="function"?reportError:function(M){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var m=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M==="object"&&M!==null&&typeof M.message==="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(m))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",M);return}console.error(M)},B2=!1,y0=null,M2=0,T2=!1,g2=!1,S5=typeof queueMicrotask==="function"?function(M){queueMicrotask(function(){return queueMicrotask(M)})}:g;K1=Object.freeze({__proto__:null,c:function(M){return v().useMemoCache(M)}});var r0={map:k,forEach:function(M,m,n){k(M,function(){m.apply(this,arguments)},n)},count:function(M){var m=0;return k(M,function(){m++}),m},toArray:function(M){return k(M,function(m){return m})||[]},only:function(M){if(!A(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};pQ.Activity=e,pQ.Children=r0,pQ.Component=q,pQ.Fragment=D,pQ.Profiler=y,pQ.PureComponent=G,pQ.StrictMode=f,pQ.Suspense=t,pQ.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q1,pQ.__COMPILER_RUNTIME=K1,pQ.act=function(M){var m=q1.actQueue,n=M2;M2++;var _1=q1.actQueue=m!==null?m:[],U1=!1;try{var W1=M()}catch(A1){q1.thrownErrors.push(A1)}if(0<q1.thrownErrors.length)throw S(m,n),M=h(q1.thrownErrors),q1.thrownErrors.length=0,M;if(W1!==null&&typeof W1==="object"&&typeof W1.then==="function"){var L1=W1;return S5(function(){U1||T2||(T2=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(A1,H0){U1=!0,L1.then(function(v0){if(S(m,n),n===0){try{j(_1),g(function(){return b(v0,A1,H0)})}catch(v4){q1.thrownErrors.push(v4)}if(0<q1.thrownErrors.length){var y4=h(q1.thrownErrors);q1.thrownErrors.length=0,H0(y4)}}else A1(v0)},function(v0){S(m,n),0<q1.thrownErrors.length?(v0=h(q1.thrownErrors),q1.thrownErrors.length=0,H0(v0)):H0(v0)})}}}var f1=W1;if(S(m,n),n===0&&(j(_1),_1.length!==0&&S5(function(){U1||T2||(T2=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),q1.actQueue=null),0<q1.thrownErrors.length)throw M=h(q1.thrownErrors),q1.thrownErrors.length=0,M;return{then:function(A1,H0){U1=!0,n===0?(q1.actQueue=_1,g(function(){return b(f1,A1,H0)})):A1(f1)}}},pQ.cache=function(M){return function(){return M.apply(null,arguments)}},pQ.cacheSignal=function(){return null},pQ.captureOwnerStack=function(){var M=q1.getCurrentStack;return M===null?null:M()},pQ.cloneElement=function(M,m,n){if(M===null||M===void 0)throw Error("The argument must be a React element, but you passed "+M+".");var _1=Z1({},M.props),U1=M.key,W1=M._owner;if(m!=null){var L1;_:{if(y1.call(m,"ref")&&(L1=Object.getOwnPropertyDescriptor(m,"ref").get)&&L1.isReactWarning){L1=!1;break _}L1=m.ref!==void 0}L1&&(W1=K()),z(m)&&(H(m.key),U1=""+m.key);for(f1 in m)!y1.call(m,f1)||f1==="key"||f1==="__self"||f1==="__source"||f1==="ref"&&m.ref===void 0||(_1[f1]=m[f1])}var f1=arguments.length-2;if(f1===1)_1.children=n;else if(1<f1){L1=Array(f1);for(var A1=0;A1<f1;A1++)L1[A1]=arguments[A1+2];_1.children=L1}_1=T(M.type,U1,_1,W1,M._debugStack,M._debugTask);for(U1=2;U1<arguments.length;U1++)w(arguments[U1]);return _1},pQ.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:p,_context:M},M._currentRenderer=null,M._currentRenderer2=null,M},pQ.createElement=function(M,m,n){for(var _1=2;_1<arguments.length;_1++)w(arguments[_1]);_1={};var U1=null;if(m!=null)for(A1 in k0||!("__self"in m)||"key"in m||(k0=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),z(m)&&(H(m.key),U1=""+m.key),m)y1.call(m,A1)&&A1!=="key"&&A1!=="__self"&&A1!=="__source"&&(_1[A1]=m[A1]);var W1=arguments.length-2;if(W1===1)_1.children=n;else if(1<W1){for(var L1=Array(W1),f1=0;f1<W1;f1++)L1[f1]=arguments[f1+2];Object.freeze&&Object.freeze(L1),_1.children=L1}if(M&&M.defaultProps)for(A1 in W1=M.defaultProps,W1)_1[A1]===void 0&&(_1[A1]=W1[A1]);U1&&W(_1,typeof M==="function"?M.displayName||M.name||"Unknown":M);var A1=1e4>q1.recentlyCreatedOwnerStacks++;return T(M,U1,_1,K(),A1?Error("react-stack-top-frame"):M0,A1?c1(X(M)):a1)},pQ.createRef=function(){var M={current:null};return Object.seal(M),M},pQ.forwardRef=function(M){M!=null&&M.$$typeof===d?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof M!=="function"?console.error("forwardRef requires a render function but was given %s.",M===null?"null":typeof M):M.length!==0&&M.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",M.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),M!=null&&M.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var m={$$typeof:s,render:M},n;return Object.defineProperty(m,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(_1){n=_1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:_1}),M.displayName=_1)}}),m},pQ.isValidElement=A,pQ.lazy=function(M){M={_status:-1,_result:M};var m={$$typeof:c,_payload:M,_init:N},n={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return M._ioInfo=n,m._debugInfo=[{awaited:n}],m},pQ.memo=function(M,m){M==null&&console.error("memo: The first argument must be a component. Instead received: %s",M===null?"null":typeof M),m={$$typeof:d,type:M,compare:m===void 0?null:m};var n;return Object.defineProperty(m,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(_1){n=_1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:_1}),M.displayName=_1)}}),m},pQ.startTransition=function(M){var m=q1.T,n={};n._updatedFibers=new Set,q1.T=n;try{var _1=M(),U1=q1.S;U1!==null&&U1(n,_1),typeof _1==="object"&&_1!==null&&typeof _1.then==="function"&&(q1.asyncTransitions++,_1.then(E,E),_1.then(Z,K0))}catch(W1){K0(W1)}finally{m===null&&n._updatedFibers&&(M=n._updatedFibers.size,n._updatedFibers.clear(),10<M&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),m!==null&&n.types!==null&&(m.types!==null&&m.types!==n.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),m.types=n.types),q1.T=m}},pQ.unstable_useCacheRefresh=function(){return v().useCacheRefresh()},pQ.use=function(M){return v().use(M)},pQ.useActionState=function(M,m,n){return v().useActionState(M,m,n)},pQ.useCallback=function(M,m){return v().useCallback(M,m)},pQ.useContext=function(M){var m=v();return M.$$typeof===p&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),m.useContext(M)},pQ.useDebugValue=function(M,m){return v().useDebugValue(M,m)},pQ.useDeferredValue=function(M,m){return v().useDeferredValue(M,m)},pQ.useEffect=function(M,m){return M==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),v().useEffect(M,m)},pQ.useEffectEvent=function(M){return v().useEffectEvent(M)},pQ.useId=function(){return v().useId()},pQ.useImperativeHandle=function(M,m,n){return v().useImperativeHandle(M,m,n)},pQ.useInsertionEffect=function(M,m){return M==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),v().useInsertionEffect(M,m)},pQ.useLayoutEffect=function(M,m){return M==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),v().useLayoutEffect(M,m)},pQ.useMemo=function(M,m){return v().useMemo(M,m)},pQ.useOptimistic=function(M,m){return v().useOptimistic(M,m)},pQ.useReducer=function(M,m,n){return v().useReducer(M,m,n)},pQ.useRef=function(M){return v().useRef(M)},pQ.useState=function(M){return v().useState(M)},pQ.useSyncExternalStore=function(M,m,n){return v().useSyncExternalStore(M,m,n)},pQ.useTransition=function(){return v().useTransition()},pQ.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var G8=i0((cQ)=>{var d0=h1(X0());(function(){function _(f){if(f==null)return null;if(typeof f==="function")return f.$$typeof===v?null:f.displayName||f.name||null;if(typeof f==="string")return f;switch(f){case O:return"Fragment";case B:return"Profiler";case T:return"StrictMode";case I:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof f==="object")switch(typeof f.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case W:return"Portal";case A:return f.displayName||"Context";case w:return(f._context.displayName||"Context")+".Consumer";case R:var y=f.render;return f=f.displayName,f||(f=y.displayName||y.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case P:return y=f.displayName||null,y!==null?y:_(f.type)||"Memo";case k:y=f._payload,f=f._init;try{return _(f(y))}catch(p){}}return null}function Q(f){return""+f}function J(f){try{Q(f);var y=!1}catch(s){y=!0}if(y){y=console;var p=y.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return p.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(f)}}function q(f){if(f===O)return"<>";if(typeof f==="object"&&f!==null&&f.$$typeof===k)return"<...>";try{var y=_(f);return y?"<"+y+">":"<...>"}catch(p){return"<...>"}}function U(){var f=E.A;return f===null?null:f.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(f){if(g.call(f,"key")){var y=Object.getOwnPropertyDescriptor(f,"key").get;if(y&&y.isReactWarning)return!1}return f.key!==void 0}function F(f,y){function p(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}p.isReactWarning=!0,Object.defineProperty(f,"key",{get:p,configurable:!0})}function H(){var f=_(this.type);return j[f]||(j[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function Y(f,y,p,u,s,t){var a=p.ref;return f={$$typeof:z,type:f,key:y,props:p,_owner:u},(a!==void 0?a:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:H}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function X(f,y,p,u,s,t){var a=y.children;if(a!==void 0)if(u)if(h(a)){for(u=0;u<a.length;u++)K(a[u]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else K(a);if(g.call(y,"key")){a=_(f);var d=Object.keys(y).filter(function(e){return e!=="key"});u=0<d.length?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}",D[a+u]||(d=0<d.length?"{"+d.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
14
14
  let props = %s;
15
15
  <%s {...props} />
16
16
  React keys must be passed directly to JSX without using spread:
17
17
  let props = %s;
18
- <%s key={someKey} {...props} />`,u,a,d,a),D[a+u]=!0)}if(a=null,p!==void 0&&(J(p),a=""+p),Z(y)&&(J(y.key),a=""+y.key),"key"in y){p={};for(var c in y)c!=="key"&&(p[c]=y[c])}else p=y;return a&&F(p,typeof f==="function"?f.displayName||f.name||"Unknown":f),Y(f,a,p,U(),s,t)}function K(f){L(f)?f._store&&(f._store.validated=1):typeof f==="object"&&f!==null&&f.$$typeof===k&&(f._payload.status==="fulfilled"?L(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function L(f){return typeof f==="object"&&f!==null&&f.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),v=Symbol.for("react.client.reference"),E=d0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,g=Object.prototype.hasOwnProperty,h=Array.isArray,S=console.createTask?console.createTask:function(){return null};d0={react_stack_bottom_frame:function(f){return f()}};var b,j={},x=d0.react_stack_bottom_frame.bind(d0,G)(),V=S(q(G)),D={};cQ.Fragment=O,cQ.jsx=function(f,y,p){var u=1e4>E.recentlyCreatedOwnerStacks++;return H(f,y,p,!1,u?Error("react-stack-top-frame"):x,u?S(q(f)):V)},cQ.jsxs=function(f,y,p){var u=1e4>E.recentlyCreatedOwnerStacks++;return H(f,y,p,!0,u?Error("react-stack-top-frame"):x,u?S(q(f)):V)}})()});var h7=i0((Eq)=>{var s1=h1(X0());(function(){function _(L,z){return L===z&&(L!==0||1/L===1/z)||L!==L&&z!==z}function Q(L,z){Y||s1.startTransition===void 0||(Y=!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 W=z();if(!H){var O=z();U(W,O)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),H=!0)}O=G({inst:{value:W,getSnapshot:z}});var T=O[0].inst,B=O[1];return F(function(){T.value=W,T.getSnapshot=z,J(T)&&B({inst:T})},[L,W,z]),Z(function(){return J(T)&&B({inst:T}),L(function(){J(T)&&B({inst:T})})},[L]),X(W),W}function J(L){var z=L.getSnapshot;L=L.value;try{var W=z();return!U(L,W)}catch(O){return!0}}function q(L,z){return z()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var U=typeof Object.is==="function"?Object.is:_,G=s1.useState,Z=s1.useEffect,F=s1.useLayoutEffect,X=s1.useDebugValue,Y=!1,H=!1,K=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?q:Q;Eq.useSyncExternalStore=s1.useSyncExternalStore!==void 0?s1.useSyncExternalStore:K,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var E7=i0((xq)=>{var w0=h1(X0());(function(){function _(X,Y){return X===Y&&(X!==0||1/X===1/Y)||X!==X&&Y!==Y}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Q=h7(),J=typeof Object.is==="function"?Object.is:_,q=Q.useSyncExternalStore,U=w0.useRef,G=w0.useEffect,Z=w0.useMemo,F=w0.useDebugValue;xq.useSyncExternalStoreWithSelector=function(X,Y,H,K,L){var z=U(null);if(z.current===null){var W={hasValue:!1,value:null};z.current=W}else W=z.current;z=Z(function(){function T(I){if(!B){if(B=!0,w=I,I=K(I),L!==void 0&&W.hasValue){var C=W.value;if(L(C,I))return A=C}return A=I}if(C=A,J(w,I))return C;var P=K(I);if(L!==void 0&&L(C,P))return w=I,C;return w=I,A=P}var B=!1,w,A,R=H===void 0?null:H;return[function(){return T(Y())},R===null?void 0:function(){return T(R())}]},[Y,H,K,L]);var O=q(X,z[0],z[1]);return G(function(){W.hasValue=!0,W.value=O},[O]),F(O),O},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var r7=i0((cq)=>{var k6=h1(X0());(function(){function _(){}function Q(H){return""+H}function J(H,K,L){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{Q(z);var W=!1}catch(O){W=!0}return W&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol==="function"&&Symbol.toStringTag&&z[Symbol.toStringTag]||z.constructor.name||"Object"),Q(z)),{$$typeof:X,key:z==null?null:""+z,children:H,containerInfo:K,implementation:L}}function q(H,K){if(H==="font")return"";if(typeof K==="string")return K==="use-credentials"?K:""}function U(H){return H===null?"`null`":H===void 0?"`undefined`":H===""?"an empty string":'something with type "'+typeof H+'"'}function G(H){return H===null?"`null`":H===void 0?"`undefined`":H===""?"an empty string":typeof H==="string"?JSON.stringify(H):typeof H==="number"?"`"+H+"`":'something with type "'+typeof H+'"'}function Z(){var H=Y.H;return H===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
18
+ <%s key={someKey} {...props} />`,u,a,d,a),D[a+u]=!0)}if(a=null,p!==void 0&&(J(p),a=""+p),Z(y)&&(J(y.key),a=""+y.key),"key"in y){p={};for(var c in y)c!=="key"&&(p[c]=y[c])}else p=y;return a&&F(p,typeof f==="function"?f.displayName||f.name||"Unknown":f),Y(f,a,p,U(),s,t)}function K(f){L(f)?f._store&&(f._store.validated=1):typeof f==="object"&&f!==null&&f.$$typeof===k&&(f._payload.status==="fulfilled"?L(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function L(f){return typeof f==="object"&&f!==null&&f.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),v=Symbol.for("react.client.reference"),E=d0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,g=Object.prototype.hasOwnProperty,h=Array.isArray,S=console.createTask?console.createTask:function(){return null};d0={react_stack_bottom_frame:function(f){return f()}};var b,j={},x=d0.react_stack_bottom_frame.bind(d0,G)(),V=S(q(G)),D={};cQ.Fragment=O,cQ.jsx=function(f,y,p){var u=1e4>E.recentlyCreatedOwnerStacks++;return X(f,y,p,!1,u?Error("react-stack-top-frame"):x,u?S(q(f)):V)},cQ.jsxs=function(f,y,p){var u=1e4>E.recentlyCreatedOwnerStacks++;return X(f,y,p,!0,u?Error("react-stack-top-frame"):x,u?S(q(f)):V)}})()});var h7=i0((Eq)=>{var s1=h1(X0());(function(){function _(L,z){return L===z&&(L!==0||1/L===1/z)||L!==L&&z!==z}function Q(L,z){Y||s1.startTransition===void 0||(Y=!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 W=z();if(!X){var O=z();U(W,O)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),X=!0)}O=G({inst:{value:W,getSnapshot:z}});var T=O[0].inst,B=O[1];return F(function(){T.value=W,T.getSnapshot=z,J(T)&&B({inst:T})},[L,W,z]),Z(function(){return J(T)&&B({inst:T}),L(function(){J(T)&&B({inst:T})})},[L]),H(W),W}function J(L){var z=L.getSnapshot;L=L.value;try{var W=z();return!U(L,W)}catch(O){return!0}}function q(L,z){return z()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var U=typeof Object.is==="function"?Object.is:_,G=s1.useState,Z=s1.useEffect,F=s1.useLayoutEffect,H=s1.useDebugValue,Y=!1,X=!1,K=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?q:Q;Eq.useSyncExternalStore=s1.useSyncExternalStore!==void 0?s1.useSyncExternalStore:K,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var E7=i0((xq)=>{var w0=h1(X0());(function(){function _(H,Y){return H===Y&&(H!==0||1/H===1/Y)||H!==H&&Y!==Y}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Q=h7(),J=typeof Object.is==="function"?Object.is:_,q=Q.useSyncExternalStore,U=w0.useRef,G=w0.useEffect,Z=w0.useMemo,F=w0.useDebugValue;xq.useSyncExternalStoreWithSelector=function(H,Y,X,K,L){var z=U(null);if(z.current===null){var W={hasValue:!1,value:null};z.current=W}else W=z.current;z=Z(function(){function T(I){if(!B){if(B=!0,w=I,I=K(I),L!==void 0&&W.hasValue){var C=W.value;if(L(C,I))return A=C}return A=I}if(C=A,J(w,I))return C;var P=K(I);if(L!==void 0&&L(C,P))return w=I,C;return w=I,A=P}var B=!1,w,A,R=X===void 0?null:X;return[function(){return T(Y())},R===null?void 0:function(){return T(R())}]},[Y,X,K,L]);var O=q(H,z[0],z[1]);return G(function(){W.hasValue=!0,W.value=O},[O]),F(O),O},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var r7=i0((cq)=>{var k6=h1(X0());(function(){function _(){}function Q(X){return""+X}function J(X,K,L){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{Q(z);var W=!1}catch(O){W=!0}return W&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol==="function"&&Symbol.toStringTag&&z[Symbol.toStringTag]||z.constructor.name||"Object"),Q(z)),{$$typeof:H,key:z==null?null:""+z,children:X,containerInfo:K,implementation:L}}function q(X,K){if(X==="font")return"";if(typeof K==="string")return K==="use-credentials"?K:""}function U(X){return X===null?"`null`":X===void 0?"`undefined`":X===""?"an empty string":'something with type "'+typeof X+'"'}function G(X){return X===null?"`null`":X===void 0?"`undefined`":X===""?"an empty string":typeof X==="string"?JSON.stringify(X):typeof X==="number"?"`"+X+"`":'something with type "'+typeof X+'"'}function Z(){var X=Y.H;return X===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
19
19
  1. You might have mismatching versions of React and the renderer (such as React DOM)
20
20
  2. You might be breaking the Rules of Hooks
21
21
  3. You might have more than one copy of React in the same app
22
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),H}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var F={d:{f:_,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:_,C:_,L:_,m:_,X:_,S:_,M:_},p:0,findDOMNode:null},X=Symbol.for("react.portal"),Y=k6.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),cq.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,cq.createPortal=function(H,K){var L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!K||K.nodeType!==1&&K.nodeType!==9&&K.nodeType!==11)throw Error("Target container is not a DOM element.");return J(H,K,null,L)},cq.flushSync=function(H){var K=Y.T,L=F.p;try{if(Y.T=null,F.p=2,H)return H()}finally{Y.T=K,F.p=L,F.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},cq.preconnect=function(H,K){typeof H==="string"&&H?K!=null&&typeof K!=="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",G(K)):K!=null&&typeof K.crossOrigin!=="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",U(K.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(H)),typeof H==="string"&&(K?(K=K.crossOrigin,K=typeof K==="string"?K==="use-credentials"?K:"":void 0):K=null,F.d.C(H,K))},cq.prefetchDNS=function(H){if(typeof H!=="string"||!H)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(H));else if(1<arguments.length){var K=arguments[1];typeof K==="object"&&K.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",G(K)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",G(K))}typeof H==="string"&&F.d.D(H)},cq.preinit=function(H,K){if(typeof H==="string"&&H?K==null||typeof K!=="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",G(K)):K.as!=="style"&&K.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',G(K.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(H)),typeof H==="string"&&K&&typeof K.as==="string"){var L=K.as,z=q(L,K.crossOrigin),W=typeof K.integrity==="string"?K.integrity:void 0,O=typeof K.fetchPriority==="string"?K.fetchPriority:void 0;L==="style"?F.d.S(H,typeof K.precedence==="string"?K.precedence:void 0,{crossOrigin:z,integrity:W,fetchPriority:O}):L==="script"&&F.d.X(H,{crossOrigin:z,integrity:W,fetchPriority:O,nonce:typeof K.nonce==="string"?K.nonce:void 0})}},cq.preinitModule=function(H,K){var L="";if(typeof H==="string"&&H||(L+=" The `href` argument encountered was "+U(H)+"."),K!==void 0&&typeof K!=="object"?L+=" The `options` argument encountered was "+U(K)+".":K&&("as"in K)&&K.as!=="script"&&(L+=" The `as` option encountered was "+G(K.as)+"."),L)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",L);else switch(L=K&&typeof K.as==="string"?K.as:"script",L){case"script":break;default:L=G(L),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',L,H)}if(typeof H==="string")if(typeof K==="object"&&K!==null){if(K.as==null||K.as==="script")L=q(K.as,K.crossOrigin),F.d.M(H,{crossOrigin:L,integrity:typeof K.integrity==="string"?K.integrity:void 0,nonce:typeof K.nonce==="string"?K.nonce:void 0})}else K==null&&F.d.M(H)},cq.preload=function(H,K){var L="";if(typeof H==="string"&&H||(L+=" The `href` argument encountered was "+U(H)+"."),K==null||typeof K!=="object"?L+=" The `options` argument encountered was "+U(K)+".":typeof K.as==="string"&&K.as||(L+=" The `as` option encountered was "+U(K.as)+"."),L&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',L),typeof H==="string"&&typeof K==="object"&&K!==null&&typeof K.as==="string"){L=K.as;var z=q(L,K.crossOrigin);F.d.L(H,L,{crossOrigin:z,integrity:typeof K.integrity==="string"?K.integrity:void 0,nonce:typeof K.nonce==="string"?K.nonce:void 0,type:typeof K.type==="string"?K.type:void 0,fetchPriority:typeof K.fetchPriority==="string"?K.fetchPriority:void 0,referrerPolicy:typeof K.referrerPolicy==="string"?K.referrerPolicy:void 0,imageSrcSet:typeof K.imageSrcSet==="string"?K.imageSrcSet:void 0,imageSizes:typeof K.imageSizes==="string"?K.imageSizes:void 0,media:typeof K.media==="string"?K.media:void 0})}},cq.preloadModule=function(H,K){var L="";typeof H==="string"&&H||(L+=" The `href` argument encountered was "+U(H)+"."),K!==void 0&&typeof K!=="object"?L+=" The `options` argument encountered was "+U(K)+".":K&&("as"in K)&&typeof K.as!=="string"&&(L+=" The `as` option encountered was "+U(K.as)+"."),L&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',L),typeof H==="string"&&(K?(L=q(K.as,K.crossOrigin),F.d.m(H,{as:typeof K.as==="string"&&K.as!=="script"?K.as:void 0,crossOrigin:L,integrity:typeof K.integrity==="string"?K.integrity:void 0})):F.d.m(H))},cq.requestFormReset=function(H){F.d.r(H)},cq.unstable_batchedUpdates=function(H,K){return H(K)},cq.useFormState=function(H,K,L){return Z().useFormState(H,K,L)},cq.useFormStatus=function(){return Z().useHostTransitionStatus()},cq.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var d7=i0((FB,i7)=>{var lq=h1(r7());i7.exports=lq});var R5=i0((XZ)=>{var H2=h1(X0());(function(){function _(f){if(f==null)return null;if(typeof f==="function")return f.$$typeof===v?null:f.displayName||f.name||null;if(typeof f==="string")return f;switch(f){case O:return"Fragment";case B:return"Profiler";case T:return"StrictMode";case I:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof f==="object")switch(typeof f.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case W:return"Portal";case A:return f.displayName||"Context";case w:return(f._context.displayName||"Context")+".Consumer";case R:var y=f.render;return f=f.displayName,f||(f=y.displayName||y.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case P:return y=f.displayName||null,y!==null?y:_(f.type)||"Memo";case k:y=f._payload,f=f._init;try{return _(f(y))}catch(p){}}return null}function Q(f){return""+f}function J(f){try{Q(f);var y=!1}catch(s){y=!0}if(y){y=console;var p=y.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return p.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(f)}}function q(f){if(f===O)return"<>";if(typeof f==="object"&&f!==null&&f.$$typeof===k)return"<...>";try{var y=_(f);return y?"<"+y+">":"<...>"}catch(p){return"<...>"}}function U(){var f=E.A;return f===null?null:f.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(f){if(g.call(f,"key")){var y=Object.getOwnPropertyDescriptor(f,"key").get;if(y&&y.isReactWarning)return!1}return f.key!==void 0}function F(f,y){function p(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}p.isReactWarning=!0,Object.defineProperty(f,"key",{get:p,configurable:!0})}function X(){var f=_(this.type);return j[f]||(j[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function Y(f,y,p,u,s,t){var a=p.ref;return f={$$typeof:z,type:f,key:y,props:p,_owner:u},(a!==void 0?a:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:X}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function H(f,y,p,u,s,t){var a=y.children;if(a!==void 0)if(u)if(h(a)){for(u=0;u<a.length;u++)K(a[u]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else K(a);if(g.call(y,"key")){a=_(f);var d=Object.keys(y).filter(function(e){return e!=="key"});u=0<d.length?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}",D[a+u]||(d=0<d.length?"{"+d.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
22
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),X}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var F={d:{f:_,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:_,C:_,L:_,m:_,X:_,S:_,M:_},p:0,findDOMNode:null},H=Symbol.for("react.portal"),Y=k6.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),cq.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,cq.createPortal=function(X,K){var L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!K||K.nodeType!==1&&K.nodeType!==9&&K.nodeType!==11)throw Error("Target container is not a DOM element.");return J(X,K,null,L)},cq.flushSync=function(X){var K=Y.T,L=F.p;try{if(Y.T=null,F.p=2,X)return X()}finally{Y.T=K,F.p=L,F.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},cq.preconnect=function(X,K){typeof X==="string"&&X?K!=null&&typeof K!=="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",G(K)):K!=null&&typeof K.crossOrigin!=="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",U(K.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(X)),typeof X==="string"&&(K?(K=K.crossOrigin,K=typeof K==="string"?K==="use-credentials"?K:"":void 0):K=null,F.d.C(X,K))},cq.prefetchDNS=function(X){if(typeof X!=="string"||!X)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(X));else if(1<arguments.length){var K=arguments[1];typeof K==="object"&&K.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",G(K)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",G(K))}typeof X==="string"&&F.d.D(X)},cq.preinit=function(X,K){if(typeof X==="string"&&X?K==null||typeof K!=="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",G(K)):K.as!=="style"&&K.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',G(K.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(X)),typeof X==="string"&&K&&typeof K.as==="string"){var L=K.as,z=q(L,K.crossOrigin),W=typeof K.integrity==="string"?K.integrity:void 0,O=typeof K.fetchPriority==="string"?K.fetchPriority:void 0;L==="style"?F.d.S(X,typeof K.precedence==="string"?K.precedence:void 0,{crossOrigin:z,integrity:W,fetchPriority:O}):L==="script"&&F.d.X(X,{crossOrigin:z,integrity:W,fetchPriority:O,nonce:typeof K.nonce==="string"?K.nonce:void 0})}},cq.preinitModule=function(X,K){var L="";if(typeof X==="string"&&X||(L+=" The `href` argument encountered was "+U(X)+"."),K!==void 0&&typeof K!=="object"?L+=" The `options` argument encountered was "+U(K)+".":K&&("as"in K)&&K.as!=="script"&&(L+=" The `as` option encountered was "+G(K.as)+"."),L)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",L);else switch(L=K&&typeof K.as==="string"?K.as:"script",L){case"script":break;default:L=G(L),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',L,X)}if(typeof X==="string")if(typeof K==="object"&&K!==null){if(K.as==null||K.as==="script")L=q(K.as,K.crossOrigin),F.d.M(X,{crossOrigin:L,integrity:typeof K.integrity==="string"?K.integrity:void 0,nonce:typeof K.nonce==="string"?K.nonce:void 0})}else K==null&&F.d.M(X)},cq.preload=function(X,K){var L="";if(typeof X==="string"&&X||(L+=" The `href` argument encountered was "+U(X)+"."),K==null||typeof K!=="object"?L+=" The `options` argument encountered was "+U(K)+".":typeof K.as==="string"&&K.as||(L+=" The `as` option encountered was "+U(K.as)+"."),L&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',L),typeof X==="string"&&typeof K==="object"&&K!==null&&typeof K.as==="string"){L=K.as;var z=q(L,K.crossOrigin);F.d.L(X,L,{crossOrigin:z,integrity:typeof K.integrity==="string"?K.integrity:void 0,nonce:typeof K.nonce==="string"?K.nonce:void 0,type:typeof K.type==="string"?K.type:void 0,fetchPriority:typeof K.fetchPriority==="string"?K.fetchPriority:void 0,referrerPolicy:typeof K.referrerPolicy==="string"?K.referrerPolicy:void 0,imageSrcSet:typeof K.imageSrcSet==="string"?K.imageSrcSet:void 0,imageSizes:typeof K.imageSizes==="string"?K.imageSizes:void 0,media:typeof K.media==="string"?K.media:void 0})}},cq.preloadModule=function(X,K){var L="";typeof X==="string"&&X||(L+=" The `href` argument encountered was "+U(X)+"."),K!==void 0&&typeof K!=="object"?L+=" The `options` argument encountered was "+U(K)+".":K&&("as"in K)&&typeof K.as!=="string"&&(L+=" The `as` option encountered was "+U(K.as)+"."),L&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',L),typeof X==="string"&&(K?(L=q(K.as,K.crossOrigin),F.d.m(X,{as:typeof K.as==="string"&&K.as!=="script"?K.as:void 0,crossOrigin:L,integrity:typeof K.integrity==="string"?K.integrity:void 0})):F.d.m(X))},cq.requestFormReset=function(X){F.d.r(X)},cq.unstable_batchedUpdates=function(X,K){return X(K)},cq.useFormState=function(X,K,L){return Z().useFormState(X,K,L)},cq.useFormStatus=function(){return Z().useHostTransitionStatus()},cq.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var d7=i0((KB,i7)=>{var lq=h1(r7());i7.exports=lq});var O5=i0((XZ)=>{var H2=h1(X0());(function(){function _(f){if(f==null)return null;if(typeof f==="function")return f.$$typeof===v?null:f.displayName||f.name||null;if(typeof f==="string")return f;switch(f){case O:return"Fragment";case B:return"Profiler";case T:return"StrictMode";case I:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof f==="object")switch(typeof f.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case W:return"Portal";case A:return f.displayName||"Context";case w:return(f._context.displayName||"Context")+".Consumer";case R:var y=f.render;return f=f.displayName,f||(f=y.displayName||y.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case P:return y=f.displayName||null,y!==null?y:_(f.type)||"Memo";case k:y=f._payload,f=f._init;try{return _(f(y))}catch(p){}}return null}function Q(f){return""+f}function J(f){try{Q(f);var y=!1}catch(s){y=!0}if(y){y=console;var p=y.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return p.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(f)}}function q(f){if(f===O)return"<>";if(typeof f==="object"&&f!==null&&f.$$typeof===k)return"<...>";try{var y=_(f);return y?"<"+y+">":"<...>"}catch(p){return"<...>"}}function U(){var f=E.A;return f===null?null:f.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(f){if(g.call(f,"key")){var y=Object.getOwnPropertyDescriptor(f,"key").get;if(y&&y.isReactWarning)return!1}return f.key!==void 0}function F(f,y){function p(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}p.isReactWarning=!0,Object.defineProperty(f,"key",{get:p,configurable:!0})}function H(){var f=_(this.type);return j[f]||(j[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function Y(f,y,p,u,s,t){var a=p.ref;return f={$$typeof:z,type:f,key:y,props:p,_owner:u},(a!==void 0?a:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:H}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function X(f,y,p,u,s,t){var a=y.children;if(a!==void 0)if(u)if(h(a)){for(u=0;u<a.length;u++)K(a[u]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else K(a);if(g.call(y,"key")){a=_(f);var d=Object.keys(y).filter(function(e){return e!=="key"});u=0<d.length?"{key: someKey, "+d.join(": ..., ")+": ...}":"{key: someKey}",D[a+u]||(d=0<d.length?"{"+d.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
23
23
  let props = %s;
24
24
  <%s {...props} />
25
25
  React keys must be passed directly to JSX without using spread:
26
26
  let props = %s;
27
- <%s key={someKey} {...props} />`,u,a,d,a),D[a+u]=!0)}if(a=null,p!==void 0&&(J(p),a=""+p),Z(y)&&(J(y.key),a=""+y.key),"key"in y){p={};for(var c in y)c!=="key"&&(p[c]=y[c])}else p=y;return a&&F(p,typeof f==="function"?f.displayName||f.name||"Unknown":f),Y(f,a,p,U(),s,t)}function K(f){L(f)?f._store&&(f._store.validated=1):typeof f==="object"&&f!==null&&f.$$typeof===k&&(f._payload.status==="fulfilled"?L(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function L(f){return typeof f==="object"&&f!==null&&f.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),v=Symbol.for("react.client.reference"),E=H2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,g=Object.prototype.hasOwnProperty,h=Array.isArray,S=console.createTask?console.createTask:function(){return null};H2={react_stack_bottom_frame:function(f){return f()}};var b,j={},x=H2.react_stack_bottom_frame.bind(H2,G)(),V=S(q(G)),D={};XZ.Fragment=O,XZ.jsxDEV=function(f,y,p,u){var s=1e4>E.recentlyCreatedOwnerStacks++;return H(f,y,p,u,s?Error("react-stack-top-frame"):x,s?S(q(f)):V)}})()});var i=h1(X0(),1);var l=h1(G8(),1),r=h1(X0(),1);function C1(_){if(typeof _==="string"||typeof _==="number")return""+_;let Q="";if(Array.isArray(_)){for(let J=0,q;J<_.length;J++)if((q=C1(_[J]))!=="")Q+=(Q&&" ")+q}else for(let J in _)if(_[J])Q+=(Q&&" ")+J;return Q}var lQ={value:()=>{}};function F8(){for(var _=0,Q=arguments.length,J={},q;_<Q;++_){if(!(q=arguments[_]+"")||q in J||/[\s.]/.test(q))throw Error("illegal type: "+q);J[q]=[]}return new y5(J)}function y5(_){this._=_}function rQ(_,Q){return _.trim().split(/^|\s+/).map(function(J){var q="",U=J.indexOf(".");if(U>=0)q=J.slice(U+1),J=J.slice(0,U);if(J&&!Q.hasOwnProperty(J))throw Error("unknown type: "+J);return{type:J,name:q}})}y5.prototype=F8.prototype={constructor:y5,on:function(_,Q){var J=this._,q=rQ(_+"",J),U,G=-1,Z=q.length;if(arguments.length<2){while(++G<Z)if((U=(_=q[G]).type)&&(U=iQ(J[U],_.name)))return U;return}if(Q!=null&&typeof Q!=="function")throw Error("invalid callback: "+Q);while(++G<Z)if(U=(_=q[G]).type)J[U]=Z8(J[U],_.name,Q);else if(Q==null)for(U in J)J[U]=Z8(J[U],_.name,null);return this},copy:function(){var _={},Q=this._;for(var J in Q)_[J]=Q[J].slice();return new y5(_)},call:function(_,Q){if((U=arguments.length-2)>0)for(var J=Array(U),q=0,U,G;q<U;++q)J[q]=arguments[q+2];if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(G=this._[_],q=0,U=G.length;q<U;++q)G[q].value.apply(Q,J)},apply:function(_,Q,J){if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(var q=this._[_],U=0,G=q.length;U<G;++U)q[U].value.apply(Q,J)}};function iQ(_,Q){for(var J=0,q=_.length,U;J<q;++J)if((U=_[J]).name===Q)return U.value}function Z8(_,Q,J){for(var q=0,U=_.length;q<U;++q)if(_[q].name===Q){_[q]=lQ,_=_.slice(0,q).concat(_.slice(q+1));break}if(J!=null)_.push({name:Q,value:J});return _}var a0=F8;function R2(_){return function(){return this.matches(_)}}function v5(_){return function(Q){return Q.matches(_)}}var j5="http://www.w3.org/1999/xhtml",V4={svg:"http://www.w3.org/2000/svg",xhtml:j5,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Y0(_){var Q=_+="",J=Q.indexOf(":");if(J>=0&&(Q=_.slice(0,J))!=="xmlns")_=_.slice(J+1);return V4.hasOwnProperty(Q)?{space:V4[Q],local:_}:_}function u4(_){let Q;while(Q=_.sourceEvent)_=Q;return _}function x1(_,Q){if(_=u4(_),Q===void 0)Q=_.currentTarget;if(Q){var J=Q.ownerSVGElement||Q;if(J.createSVGPoint){var q=J.createSVGPoint();return q.x=_.clientX,q.y=_.clientY,q=q.matrixTransform(Q.getScreenCTM().inverse()),[q.x,q.y]}if(Q.getBoundingClientRect){var U=Q.getBoundingClientRect();return[_.clientX-U.left-Q.clientLeft,_.clientY-U.top-Q.clientTop]}}return[_.pageX,_.pageY]}function dQ(){}function j0(_){return _==null?dQ:function(){return this.querySelector(_)}}function b4(_){if(typeof _!=="function")_=j0(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=Array(Z),X,Y,H=0;H<Z;++H)if((X=G[H])&&(Y=_.call(X,X.__data__,H,G))){if("__data__"in X)Y.__data__=X.__data__;F[H]=Y}return new S1(q,this._parents)}function D4(_){return _==null?[]:Array.isArray(_)?_:Array.from(_)}function aQ(){return[]}function O2(_){return _==null?aQ:function(){return this.querySelectorAll(_)}}function sQ(_){return function(){return D4(_.apply(this,arguments))}}function h4(_){if(typeof _==="function")_=sQ(_);else _=O2(_);for(var Q=this._groups,J=Q.length,q=[],U=[],G=0;G<J;++G)for(var Z=Q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y])q.push(_.call(X,X.__data__,Y,Z)),U.push(X);return new S1(q,U)}var tQ=Array.prototype.find;function oQ(_){return function(){return tQ.call(this.children,_)}}function nQ(){return this.firstElementChild}function E4(_){return this.select(_==null?nQ:oQ(typeof _==="function"?_:v5(_)))}var eQ=Array.prototype.filter;function _J(){return Array.from(this.children)}function QJ(_){return function(){return eQ.call(this.children,_)}}function x4(_){return this.selectAll(_==null?_J:QJ(typeof _==="function"?_:v5(_)))}function m4(_){if(typeof _!=="function")_=R2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],X,Y=0;Y<Z;++Y)if((X=G[Y])&&_.call(X,X.__data__,Y,G))F.push(X);return new S1(q,this._parents)}function g2(_){return Array(_.length)}function g4(){return new S1(this._enter||this._groups.map(g2),this._parents)}function p2(_,Q){this.ownerDocument=_.ownerDocument,this.namespaceURI=_.namespaceURI,this._next=null,this._parent=_,this.__data__=Q}p2.prototype={constructor:p2,appendChild:function(_){return this._parent.insertBefore(_,this._next)},insertBefore:function(_,Q){return this._parent.insertBefore(_,Q)},querySelector:function(_){return this._parent.querySelector(_)},querySelectorAll:function(_){return this._parent.querySelectorAll(_)}};function p4(_){return function(){return _}}function JJ(_,Q,J,q,U,G){var Z=0,F,X=Q.length,Y=G.length;for(;Z<Y;++Z)if(F=Q[Z])F.__data__=G[Z],q[Z]=F;else J[Z]=new p2(_,G[Z]);for(;Z<X;++Z)if(F=Q[Z])U[Z]=F}function $J(_,Q,J,q,U,G,Z){var F,X,Y=new Map,H=Q.length,K=G.length,L=Array(H),z;for(F=0;F<H;++F)if(X=Q[F])if(L[F]=z=Z.call(X,X.__data__,F,Q)+"",Y.has(z))U[F]=X;else Y.set(z,X);for(F=0;F<K;++F)if(z=Z.call(_,G[F],F,G)+"",X=Y.get(z))q[F]=X,X.__data__=G[F],Y.delete(z);else J[F]=new p2(_,G[F]);for(F=0;F<H;++F)if((X=Q[F])&&Y.get(L[F])===X)U[F]=X}function qJ(_){return _.__data__}function c4(_,Q){if(!arguments.length)return Array.from(this,qJ);var J=Q?$J:JJ,q=this._parents,U=this._groups;if(typeof _!=="function")_=p4(_);for(var G=U.length,Z=Array(G),F=Array(G),X=Array(G),Y=0;Y<G;++Y){var H=q[Y],K=U[Y],L=K.length,z=UJ(_.call(H,H&&H.__data__,Y,q)),W=z.length,O=F[Y]=Array(W),T=Z[Y]=Array(W),B=X[Y]=Array(L);J(H,K,O,T,B,z,Q);for(var w=0,A=0,R,I;w<W;++w)if(R=O[w]){if(w>=A)A=w+1;while(!(I=T[A])&&++A<W);R._next=I||null}}return Z=new S1(Z,q),Z._enter=F,Z._exit=X,Z}function UJ(_){return typeof _==="object"&&"length"in _?_:Array.from(_)}function l4(){return new S1(this._exit||this._groups.map(g2),this._parents)}function r4(_,Q,J){var q=this.enter(),U=this,G=this.exit();if(typeof _==="function"){if(q=_(q),q)q=q.selection()}else q=q.append(_+"");if(Q!=null){if(U=Q(U),U)U=U.selection()}if(J==null)G.remove();else J(G);return q&&U?q.merge(U).order():U}function i4(_){var Q=_.selection?_.selection():_;for(var J=this._groups,q=Q._groups,U=J.length,G=q.length,Z=Math.min(U,G),F=Array(U),X=0;X<Z;++X)for(var Y=J[X],H=q[X],K=Y.length,L=F[X]=Array(K),z,W=0;W<K;++W)if(z=Y[W]||H[W])L[W]=z;for(;X<U;++X)F[X]=J[X];return new S1(F,this._parents)}function d4(){for(var _=this._groups,Q=-1,J=_.length;++Q<J;)for(var q=_[Q],U=q.length-1,G=q[U],Z;--U>=0;)if(Z=q[U]){if(G&&Z.compareDocumentPosition(G)^4)G.parentNode.insertBefore(Z,G);G=Z}return this}function a4(_){if(!_)_=GJ;function Q(K,L){return K&&L?_(K.__data__,L.__data__):!K-!L}for(var J=this._groups,q=J.length,U=Array(q),G=0;G<q;++G){for(var Z=J[G],F=Z.length,X=U[G]=Array(F),Y,H=0;H<F;++H)if(Y=Z[H])X[H]=Y;X.sort(Q)}return new S1(U,this._parents).order()}function GJ(_,Q){return _<Q?-1:_>Q?1:_>=Q?0:NaN}function s4(){var _=arguments[0];return arguments[0]=this,_.apply(null,arguments),this}function t4(){return Array.from(this)}function o4(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length;U<G;++U){var Z=q[U];if(Z)return Z}return null}function n4(){let _=0;for(let Q of this)++_;return _}function e4(){return!this.node()}function _3(_){for(var Q=this._groups,J=0,q=Q.length;J<q;++J)for(var U=Q[J],G=0,Z=U.length,F;G<Z;++G)if(F=U[G])_.call(F,F.__data__,G,U);return this}function ZJ(_){return function(){this.removeAttribute(_)}}function FJ(_){return function(){this.removeAttributeNS(_.space,_.local)}}function KJ(_,Q){return function(){this.setAttribute(_,Q)}}function HJ(_,Q){return function(){this.setAttributeNS(_.space,_.local,Q)}}function XJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttribute(_);else this.setAttribute(_,J)}}function YJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttributeNS(_.space,_.local);else this.setAttributeNS(_.space,_.local,J)}}function Q3(_,Q){var J=Y0(_);if(arguments.length<2){var q=this.node();return J.local?q.getAttributeNS(J.space,J.local):q.getAttribute(J)}return this.each((Q==null?J.local?FJ:ZJ:typeof Q==="function"?J.local?YJ:XJ:J.local?HJ:KJ)(J,Q))}function c2(_){return _.ownerDocument&&_.ownerDocument.defaultView||_.document&&_||_.defaultView}function LJ(_){return function(){this.style.removeProperty(_)}}function zJ(_,Q,J){return function(){this.style.setProperty(_,Q,J)}}function WJ(_,Q,J){return function(){var q=Q.apply(this,arguments);if(q==null)this.style.removeProperty(_);else this.style.setProperty(_,q,J)}}function J3(_,Q,J){return arguments.length>1?this.each((Q==null?LJ:typeof Q==="function"?WJ:zJ)(_,Q,J==null?"":J)):V0(this.node(),_)}function V0(_,Q){return _.style.getPropertyValue(Q)||c2(_).getComputedStyle(_,null).getPropertyValue(Q)}function AJ(_){return function(){delete this[_]}}function BJ(_,Q){return function(){this[_]=Q}}function MJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)delete this[_];else this[_]=J}}function $3(_,Q){return arguments.length>1?this.each((Q==null?AJ:typeof Q==="function"?MJ:BJ)(_,Q)):this.node()[_]}function K8(_){return _.trim().split(/^|\s+/)}function q3(_){return _.classList||new H8(_)}function H8(_){this._node=_,this._names=K8(_.getAttribute("class")||"")}H8.prototype={add:function(_){var Q=this._names.indexOf(_);if(Q<0)this._names.push(_),this._node.setAttribute("class",this._names.join(" "))},remove:function(_){var Q=this._names.indexOf(_);if(Q>=0)this._names.splice(Q,1),this._node.setAttribute("class",this._names.join(" "))},contains:function(_){return this._names.indexOf(_)>=0}};function X8(_,Q){var J=q3(_),q=-1,U=Q.length;while(++q<U)J.add(Q[q])}function Y8(_,Q){var J=q3(_),q=-1,U=Q.length;while(++q<U)J.remove(Q[q])}function TJ(_){return function(){X8(this,_)}}function RJ(_){return function(){Y8(this,_)}}function OJ(_,Q){return function(){(Q.apply(this,arguments)?X8:Y8)(this,_)}}function U3(_,Q){var J=K8(_+"");if(arguments.length<2){var q=q3(this.node()),U=-1,G=J.length;while(++U<G)if(!q.contains(J[U]))return!1;return!0}return this.each((typeof Q==="function"?OJ:Q?TJ:RJ)(J,Q))}function fJ(){this.textContent=""}function IJ(_){return function(){this.textContent=_}}function wJ(_){return function(){var Q=_.apply(this,arguments);this.textContent=Q==null?"":Q}}function G3(_){return arguments.length?this.each(_==null?fJ:(typeof _==="function"?wJ:IJ)(_)):this.node().textContent}function PJ(){this.innerHTML=""}function NJ(_){return function(){this.innerHTML=_}}function CJ(_){return function(){var Q=_.apply(this,arguments);this.innerHTML=Q==null?"":Q}}function Z3(_){return arguments.length?this.each(_==null?PJ:(typeof _==="function"?CJ:NJ)(_)):this.node().innerHTML}function SJ(){if(this.nextSibling)this.parentNode.appendChild(this)}function F3(){return this.each(SJ)}function kJ(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function K3(){return this.each(kJ)}function yJ(_){return function(){var Q=this.ownerDocument,J=this.namespaceURI;return J===j5&&Q.documentElement.namespaceURI===j5?Q.createElement(_):Q.createElementNS(J,_)}}function vJ(_){return function(){return this.ownerDocument.createElementNS(_.space,_.local)}}function l2(_){var Q=Y0(_);return(Q.local?vJ:yJ)(Q)}function H3(_){var Q=typeof _==="function"?_:l2(_);return this.select(function(){return this.appendChild(Q.apply(this,arguments))})}function jJ(){return null}function X3(_,Q){var J=typeof _==="function"?_:l2(_),q=Q==null?jJ:typeof Q==="function"?Q:j0(Q);return this.select(function(){return this.insertBefore(J.apply(this,arguments),q.apply(this,arguments)||null)})}function VJ(){var _=this.parentNode;if(_)_.removeChild(this)}function Y3(){return this.each(VJ)}function uJ(){var _=this.cloneNode(!1),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function bJ(){var _=this.cloneNode(!0),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function L3(_){return this.select(_?bJ:uJ)}function z3(_){return arguments.length?this.property("__data__",_):this.node().__data__}function DJ(_){return function(Q){_.call(this,Q,this.__data__)}}function hJ(_){return _.trim().split(/^|\s+/).map(function(Q){var J="",q=Q.indexOf(".");if(q>=0)J=Q.slice(q+1),Q=Q.slice(0,q);return{type:Q,name:J}})}function EJ(_){return function(){var Q=this.__on;if(!Q)return;for(var J=0,q=-1,U=Q.length,G;J<U;++J)if(G=Q[J],(!_.type||G.type===_.type)&&G.name===_.name)this.removeEventListener(G.type,G.listener,G.options);else Q[++q]=G;if(++q)Q.length=q;else delete this.__on}}function xJ(_,Q,J){return function(){var q=this.__on,U,G=DJ(Q);if(q){for(var Z=0,F=q.length;Z<F;++Z)if((U=q[Z]).type===_.type&&U.name===_.name){this.removeEventListener(U.type,U.listener,U.options),this.addEventListener(U.type,U.listener=G,U.options=J),U.value=Q;return}}if(this.addEventListener(_.type,G,J),U={type:_.type,name:_.name,value:Q,listener:G,options:J},!q)this.__on=[U];else q.push(U)}}function W3(_,Q,J){var q=hJ(_+""),U,G=q.length,Z;if(arguments.length<2){var F=this.node().__on;if(F){for(var X=0,Y=F.length,H;X<Y;++X)for(U=0,H=F[X];U<G;++U)if((Z=q[U]).type===H.type&&Z.name===H.name)return H.value}return}F=Q?xJ:EJ;for(U=0;U<G;++U)this.each(F(q[U],Q,J));return this}function L8(_,Q,J){var q=c2(_),U=q.CustomEvent;if(typeof U==="function")U=new U(Q,J);else if(U=q.document.createEvent("Event"),J)U.initEvent(Q,J.bubbles,J.cancelable),U.detail=J.detail;else U.initEvent(Q,!1,!1);_.dispatchEvent(U)}function mJ(_,Q){return function(){return L8(this,_,Q)}}function gJ(_,Q){return function(){return L8(this,_,Q.apply(this,arguments))}}function A3(_,Q){return this.each((typeof Q==="function"?gJ:mJ)(_,Q))}function*B3(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length,Z;U<G;++U)if(Z=q[U])yield Z}var M3=[null];function S1(_,Q){this._groups=_,this._parents=Q}function z8(){return new S1([[document.documentElement]],M3)}function pJ(){return this}S1.prototype=z8.prototype={constructor:S1,select:b4,selectAll:h4,selectChild:E4,selectChildren:x4,filter:m4,data:c4,enter:g4,exit:l4,join:r4,merge:i4,selection:pJ,order:d4,sort:a4,call:s4,nodes:t4,node:o4,size:n4,empty:e4,each:_3,attr:Q3,style:J3,property:$3,classed:U3,text:G3,html:Z3,raise:F3,lower:K3,append:H3,insert:X3,remove:Y3,clone:L3,datum:z3,on:W3,dispatch:A3,[Symbol.iterator]:B3};var T0=z8;function j1(_){return typeof _==="string"?new S1([[document.querySelector(_)]],[document.documentElement]):new S1([[_]],M3)}var W8={passive:!1},s0={capture:!0,passive:!1};function V5(_){_.stopImmediatePropagation()}function R0(_){_.preventDefault(),_.stopImmediatePropagation()}function f2(_){var Q=_.document.documentElement,J=j1(_).on("dragstart.drag",R0,s0);if("onselectstart"in Q)J.on("selectstart.drag",R0,s0);else Q.__noselect=Q.style.MozUserSelect,Q.style.MozUserSelect="none"}function r2(_,Q){var J=_.document.documentElement,q=j1(_).on("dragstart.drag",null);if(Q)q.on("click.drag",R0,s0),setTimeout(function(){q.on("click.drag",null)},0);if("onselectstart"in J)q.on("selectstart.drag",null);else J.style.MozUserSelect=J.__noselect,delete J.__noselect}var i2=(_)=>()=>_;function d2(_,{sourceEvent:Q,subject:J,target:q,identifier:U,active:G,x:Z,y:F,dx:X,dy:Y,dispatch:H}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},subject:{value:J,enumerable:!0,configurable:!0},target:{value:q,enumerable:!0,configurable:!0},identifier:{value:U,enumerable:!0,configurable:!0},active:{value:G,enumerable:!0,configurable:!0},x:{value:Z,enumerable:!0,configurable:!0},y:{value:F,enumerable:!0,configurable:!0},dx:{value:X,enumerable:!0,configurable:!0},dy:{value:Y,enumerable:!0,configurable:!0},_:{value:H}})}d2.prototype.on=function(){var _=this._.on.apply(this._,arguments);return _===this._?this:_};function cJ(_){return!_.ctrlKey&&!_.button}function lJ(){return this.parentNode}function rJ(_,Q){return Q==null?{x:_.x,y:_.y}:Q}function iJ(){return navigator.maxTouchPoints||"ontouchstart"in this}function a2(){var _=cJ,Q=lJ,J=rJ,q=iJ,U={},G=a0("start","drag","end"),Z=0,F,X,Y,H,K=0;function L(R){R.on("mousedown.drag",z).filter(q).on("touchstart.drag",T).on("touchmove.drag",B,W8).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function z(R,I){if(H||!_.call(this,R,I))return;var C=A(this,Q.call(this,R,I),R,I,"mouse");if(!C)return;j1(R.view).on("mousemove.drag",W,s0).on("mouseup.drag",O,s0),f2(R.view),V5(R),Y=!1,F=R.clientX,X=R.clientY,C("start",R)}function W(R){if(R0(R),!Y){var I=R.clientX-F,C=R.clientY-X;Y=I*I+C*C>K}U.mouse("drag",R)}function O(R){j1(R.view).on("mousemove.drag mouseup.drag",null),r2(R.view,Y),R0(R),U.mouse("end",R)}function T(R,I){if(!_.call(this,R,I))return;var C=R.changedTouches,P=Q.call(this,R,I),k=C.length,N,v;for(N=0;N<k;++N)if(v=A(this,P,R,I,C[N].identifier,C[N]))V5(R),v("start",R,C[N])}function B(R){var I=R.changedTouches,C=I.length,P,k;for(P=0;P<C;++P)if(k=U[I[P].identifier])R0(R),k("drag",R,I[P])}function w(R){var I=R.changedTouches,C=I.length,P,k;if(H)clearTimeout(H);H=setTimeout(function(){H=null},500);for(P=0;P<C;++P)if(k=U[I[P].identifier])V5(R),k("end",R,I[P])}function A(R,I,C,P,k,N){var v=G.copy(),E=x1(N||C,I),g,h,S;if((S=J.call(R,new d2("beforestart",{sourceEvent:C,target:L,identifier:k,active:Z,x:E[0],y:E[1],dx:0,dy:0,dispatch:v}),P))==null)return;return g=S.x-E[0]||0,h=S.y-E[1]||0,function b(j,x,V){var D=E,f;switch(j){case"start":U[k]=b,f=Z++;break;case"end":delete U[k],--Z;case"drag":E=x1(V||x,I),f=Z;break}v.call(j,R,new d2(j,{sourceEvent:x,subject:S,target:L,identifier:k,active:f,x:E[0]+g,y:E[1]+h,dx:E[0]-D[0],dy:E[1]-D[1],dispatch:v}),P)}}return L.filter=function(R){return arguments.length?(_=typeof R==="function"?R:i2(!!R),L):_},L.container=function(R){return arguments.length?(Q=typeof R==="function"?R:i2(R),L):Q},L.subject=function(R){return arguments.length?(J=typeof R==="function"?R:i2(R),L):J},L.touchable=function(R){return arguments.length?(q=typeof R==="function"?R:i2(!!R),L):q},L.on=function(){var R=G.on.apply(G,arguments);return R===G?L:R},L.clickDistance=function(R){return arguments.length?(K=(R=+R)*R,L):Math.sqrt(K)},L}function s2(_,Q,J){_.prototype=Q.prototype=J,J.constructor=_}function T3(_,Q){var J=Object.create(_.prototype);for(var q in Q)J[q]=Q[q];return J}function n2(){}var t2=0.7,D5=1/t2,I2="\\s*([+-]?\\d+)\\s*",o2="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",L0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dJ=/^#([0-9a-f]{3,8})$/,aJ=new RegExp(`^rgb\\(${I2},${I2},${I2}\\)$`),sJ=new RegExp(`^rgb\\(${L0},${L0},${L0}\\)$`),tJ=new RegExp(`^rgba\\(${I2},${I2},${I2},${o2}\\)$`),oJ=new RegExp(`^rgba\\(${L0},${L0},${L0},${o2}\\)$`),nJ=new RegExp(`^hsl\\(${o2},${L0},${L0}\\)$`),eJ=new RegExp(`^hsla\\(${o2},${L0},${L0},${o2}\\)$`),A8={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};s2(n2,q0,{copy(_){return Object.assign(new this.constructor,this,_)},displayable(){return this.rgb().displayable()},hex:B8,formatHex:B8,formatHex8:_$,formatHsl:Q$,formatRgb:M8,toString:M8});function B8(){return this.rgb().formatHex()}function _$(){return this.rgb().formatHex8()}function Q$(){return w8(this).formatHsl()}function M8(){return this.rgb().formatRgb()}function q0(_){var Q,J;return _=(_+"").trim().toLowerCase(),(Q=dJ.exec(_))?(J=Q[1].length,Q=parseInt(Q[1],16),J===6?T8(Q):J===3?new d1(Q>>8&15|Q>>4&240,Q>>4&15|Q&240,(Q&15)<<4|Q&15,1):J===8?u5(Q>>24&255,Q>>16&255,Q>>8&255,(Q&255)/255):J===4?u5(Q>>12&15|Q>>8&240,Q>>8&15|Q>>4&240,Q>>4&15|Q&240,((Q&15)<<4|Q&15)/255):null):(Q=aJ.exec(_))?new d1(Q[1],Q[2],Q[3],1):(Q=sJ.exec(_))?new d1(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,1):(Q=tJ.exec(_))?u5(Q[1],Q[2],Q[3],Q[4]):(Q=oJ.exec(_))?u5(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,Q[4]):(Q=nJ.exec(_))?f8(Q[1],Q[2]/100,Q[3]/100,1):(Q=eJ.exec(_))?f8(Q[1],Q[2]/100,Q[3]/100,Q[4]):A8.hasOwnProperty(_)?T8(A8[_]):_==="transparent"?new d1(NaN,NaN,NaN,0):null}function T8(_){return new d1(_>>16&255,_>>8&255,_&255,1)}function u5(_,Q,J,q){if(q<=0)_=Q=J=NaN;return new d1(_,Q,J,q)}function J$(_){if(!(_ instanceof n2))_=q0(_);if(!_)return new d1;return _=_.rgb(),new d1(_.r,_.g,_.b,_.opacity)}function w2(_,Q,J,q){return arguments.length===1?J$(_):new d1(_,Q,J,q==null?1:q)}function d1(_,Q,J,q){this.r=+_,this.g=+Q,this.b=+J,this.opacity=+q}s2(d1,w2,T3(n2,{brighter(_){return _=_==null?D5:Math.pow(D5,_),new d1(this.r*_,this.g*_,this.b*_,this.opacity)},darker(_){return _=_==null?t2:Math.pow(t2,_),new d1(this.r*_,this.g*_,this.b*_,this.opacity)},rgb(){return this},clamp(){return new d1(o0(this.r),o0(this.g),o0(this.b),h5(this.opacity))},displayable(){return-0.5<=this.r&&this.r<255.5&&(-0.5<=this.g&&this.g<255.5)&&(-0.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:R8,formatHex:R8,formatHex8:$$,formatRgb:O8,toString:O8}));function R8(){return`#${t0(this.r)}${t0(this.g)}${t0(this.b)}`}function $$(){return`#${t0(this.r)}${t0(this.g)}${t0(this.b)}${t0((isNaN(this.opacity)?1:this.opacity)*255)}`}function O8(){let _=h5(this.opacity);return`${_===1?"rgb(":"rgba("}${o0(this.r)}, ${o0(this.g)}, ${o0(this.b)}${_===1?")":`, ${_})`}`}function h5(_){return isNaN(_)?1:Math.max(0,Math.min(1,_))}function o0(_){return Math.max(0,Math.min(255,Math.round(_)||0))}function t0(_){return _=o0(_),(_<16?"0":"")+_.toString(16)}function f8(_,Q,J,q){if(q<=0)_=Q=J=NaN;else if(J<=0||J>=1)_=Q=NaN;else if(Q<=0)_=NaN;return new $0(_,Q,J,q)}function w8(_){if(_ instanceof $0)return new $0(_.h,_.s,_.l,_.opacity);if(!(_ instanceof n2))_=q0(_);if(!_)return new $0;if(_ instanceof $0)return _;_=_.rgb();var Q=_.r/255,J=_.g/255,q=_.b/255,U=Math.min(Q,J,q),G=Math.max(Q,J,q),Z=NaN,F=G-U,X=(G+U)/2;if(F){if(Q===G)Z=(J-q)/F+(J<q)*6;else if(J===G)Z=(q-Q)/F+2;else Z=(Q-J)/F+4;F/=X<0.5?G+U:2-G-U,Z*=60}else F=X>0&&X<1?0:Z;return new $0(Z,F,X,_.opacity)}function P8(_,Q,J,q){return arguments.length===1?w8(_):new $0(_,Q,J,q==null?1:q)}function $0(_,Q,J,q){this.h=+_,this.s=+Q,this.l=+J,this.opacity=+q}s2($0,P8,T3(n2,{brighter(_){return _=_==null?D5:Math.pow(D5,_),new $0(this.h,this.s,this.l*_,this.opacity)},darker(_){return _=_==null?t2:Math.pow(t2,_),new $0(this.h,this.s,this.l*_,this.opacity)},rgb(){var _=this.h%360+(this.h<0)*360,Q=isNaN(_)||isNaN(this.s)?0:this.s,J=this.l,q=J+(J<0.5?J:1-J)*Q,U=2*J-q;return new d1(R3(_>=240?_-240:_+120,U,q),R3(_,U,q),R3(_<120?_+240:_-120,U,q),this.opacity)},clamp(){return new $0(I8(this.h),b5(this.s),b5(this.l),h5(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)},formatHsl(){let _=h5(this.opacity);return`${_===1?"hsl(":"hsla("}${I8(this.h)}, ${b5(this.s)*100}%, ${b5(this.l)*100}%${_===1?")":`, ${_})`}`}}));function I8(_){return _=(_||0)%360,_<0?_+360:_}function b5(_){return Math.max(0,Math.min(1,_||0))}function R3(_,Q,J){return(_<60?Q+(J-Q)*_/60:_<180?J:_<240?Q+(J-Q)*(240-_)/60:Q)*255}function O3(_,Q,J,q,U){var G=_*_,Z=G*_;return((1-3*_+3*G-Z)*Q+(4-6*G+3*Z)*J+(1+3*_+3*G-3*Z)*q+Z*U)/6}function f3(_){var Q=_.length-1;return function(J){var q=J<=0?J=0:J>=1?(J=1,Q-1):Math.floor(J*Q),U=_[q],G=_[q+1],Z=q>0?_[q-1]:2*U-G,F=q<Q-1?_[q+2]:2*G-U;return O3((J-q/Q)*Q,Z,U,G,F)}}function I3(_){var Q=_.length;return function(J){var q=Math.floor(((J%=1)<0?++J:J)*Q),U=_[(q+Q-1)%Q],G=_[q%Q],Z=_[(q+1)%Q],F=_[(q+2)%Q];return O3((J-q/Q)*Q,U,G,Z,F)}}var e2=(_)=>()=>_;function q$(_,Q){return function(J){return _+J*Q}}function U$(_,Q,J){return _=Math.pow(_,J),Q=Math.pow(Q,J)-_,J=1/J,function(q){return Math.pow(_+q*Q,J)}}function N8(_){return(_=+_)===1?E5:function(Q,J){return J-Q?U$(Q,J,_):e2(isNaN(Q)?J:Q)}}function E5(_,Q){var J=Q-_;return J?q$(_,J):e2(isNaN(_)?Q:_)}var n0=function _(Q){var J=N8(Q);function q(U,G){var Z=J((U=w2(U)).r,(G=w2(G)).r),F=J(U.g,G.g),X=J(U.b,G.b),Y=E5(U.opacity,G.opacity);return function(H){return U.r=Z(H),U.g=F(H),U.b=X(H),U.opacity=Y(H),U+""}}return q.gamma=_,q}(1);function C8(_){return function(Q){var J=Q.length,q=Array(J),U=Array(J),G=Array(J),Z,F;for(Z=0;Z<J;++Z)F=w2(Q[Z]),q[Z]=F.r||0,U[Z]=F.g||0,G[Z]=F.b||0;return q=_(q),U=_(U),G=_(G),F.opacity=1,function(X){return F.r=q(X),F.g=U(X),F.b=G(X),F+""}}}var G$=C8(f3),Z$=C8(I3);function w3(_,Q){if(!Q)Q=[];var J=_?Math.min(Q.length,_.length):0,q=Q.slice(),U;return function(G){for(U=0;U<J;++U)q[U]=_[U]*(1-G)+Q[U]*G;return q}}function S8(_){return ArrayBuffer.isView(_)&&!(_ instanceof DataView)}function k8(_,Q){var J=Q?Q.length:0,q=_?Math.min(J,_.length):0,U=Array(q),G=Array(J),Z;for(Z=0;Z<q;++Z)U[Z]=z0(_[Z],Q[Z]);for(;Z<J;++Z)G[Z]=Q[Z];return function(F){for(Z=0;Z<q;++Z)G[Z]=U[Z](F);return G}}function P3(_,Q){var J=new Date;return _=+_,Q=+Q,function(q){return J.setTime(_*(1-q)+Q*q),J}}function m1(_,Q){return _=+_,Q=+Q,function(J){return _*(1-J)+Q*J}}function N3(_,Q){var J={},q={},U;if(_===null||typeof _!=="object")_={};if(Q===null||typeof Q!=="object")Q={};for(U in Q)if(U in _)J[U]=z0(_[U],Q[U]);else q[U]=Q[U];return function(G){for(U in J)q[U]=J[U](G);return q}}var S3=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,C3=new RegExp(S3.source,"g");function F$(_){return function(){return _}}function K$(_){return function(Q){return _(Q)+""}}function P2(_,Q){var J=S3.lastIndex=C3.lastIndex=0,q,U,G,Z=-1,F=[],X=[];_=_+"",Q=Q+"";while((q=S3.exec(_))&&(U=C3.exec(Q))){if((G=U.index)>J)if(G=Q.slice(J,G),F[Z])F[Z]+=G;else F[++Z]=G;if((q=q[0])===(U=U[0]))if(F[Z])F[Z]+=U;else F[++Z]=U;else F[++Z]=null,X.push({i:Z,x:m1(q,U)});J=C3.lastIndex}if(J<Q.length)if(G=Q.slice(J),F[Z])F[Z]+=G;else F[++Z]=G;return F.length<2?X[0]?K$(X[0].x):F$(Q):(Q=X.length,function(Y){for(var H=0,K;H<Q;++H)F[(K=X[H]).i]=K.x(Y);return F.join("")})}function z0(_,Q){var J=typeof Q,q;return Q==null||J==="boolean"?e2(Q):(J==="number"?m1:J==="string"?(q=q0(Q))?(Q=q,n0):P2:Q instanceof q0?n0:Q instanceof Date?P3:S8(Q)?w3:Array.isArray(Q)?k8:typeof Q.valueOf!=="function"&&typeof Q.toString!=="function"||isNaN(Q)?N3:m1)(_,Q)}var y8=180/Math.PI,x5={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function m5(_,Q,J,q,U,G){var Z,F,X;if(Z=Math.sqrt(_*_+Q*Q))_/=Z,Q/=Z;if(X=_*J+Q*q)J-=_*X,q-=Q*X;if(F=Math.sqrt(J*J+q*q))J/=F,q/=F,X/=F;if(_*q<Q*J)_=-_,Q=-Q,X=-X,Z=-Z;return{translateX:U,translateY:G,rotate:Math.atan2(Q,_)*y8,skewX:Math.atan(X)*y8,scaleX:Z,scaleY:F}}var g5;function v8(_){let Q=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(_+"");return Q.isIdentity?x5:m5(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)}function j8(_){if(_==null)return x5;if(!g5)g5=document.createElementNS("http://www.w3.org/2000/svg","g");if(g5.setAttribute("transform",_),!(_=g5.transform.baseVal.consolidate()))return x5;return _=_.matrix,m5(_.a,_.b,_.c,_.d,_.e,_.f)}function V8(_,Q,J,q){function U(Y){return Y.length?Y.pop()+" ":""}function G(Y,H,K,L,z,W){if(Y!==K||H!==L){var O=z.push("translate(",null,Q,null,J);W.push({i:O-4,x:m1(Y,K)},{i:O-2,x:m1(H,L)})}else if(K||L)z.push("translate("+K+Q+L+J)}function Z(Y,H,K,L){if(Y!==H){if(Y-H>180)H+=360;else if(H-Y>180)Y+=360;L.push({i:K.push(U(K)+"rotate(",null,q)-2,x:m1(Y,H)})}else if(H)K.push(U(K)+"rotate("+H+q)}function F(Y,H,K,L){if(Y!==H)L.push({i:K.push(U(K)+"skewX(",null,q)-2,x:m1(Y,H)});else if(H)K.push(U(K)+"skewX("+H+q)}function X(Y,H,K,L,z,W){if(Y!==K||H!==L){var O=z.push(U(z)+"scale(",null,",",null,")");W.push({i:O-4,x:m1(Y,K)},{i:O-2,x:m1(H,L)})}else if(K!==1||L!==1)z.push(U(z)+"scale("+K+","+L+")")}return function(Y,H){var K=[],L=[];return Y=_(Y),H=_(H),G(Y.translateX,Y.translateY,H.translateX,H.translateY,K,L),Z(Y.rotate,H.rotate,K,L),F(Y.skewX,H.skewX,K,L),X(Y.scaleX,Y.scaleY,H.scaleX,H.scaleY,K,L),Y=H=null,function(z){var W=-1,O=L.length,T;while(++W<O)K[(T=L[W]).i]=T.x(z);return K.join("")}}}var k3=V8(v8,"px, ","px)","deg)"),y3=V8(j8,", ",")",")");var H$=0.000000000001;function u8(_){return((_=Math.exp(_))+1/_)/2}function X$(_){return((_=Math.exp(_))-1/_)/2}function Y$(_){return((_=Math.exp(2*_))-1)/(_+1)}var e0=function _(Q,J,q){function U(G,Z){var F=G[0],X=G[1],Y=G[2],H=Z[0],K=Z[1],L=Z[2],z=H-F,W=K-X,O=z*z+W*W,T,B;if(O<H$)B=Math.log(L/Y)/Q,T=function(P){return[F+P*z,X+P*W,Y*Math.exp(Q*P*B)]};else{var w=Math.sqrt(O),A=(L*L-Y*Y+q*O)/(2*Y*J*w),R=(L*L-Y*Y-q*O)/(2*L*J*w),I=Math.log(Math.sqrt(A*A+1)-A),C=Math.log(Math.sqrt(R*R+1)-R);B=(C-I)/Q,T=function(P){var k=P*B,N=u8(I),v=Y/(J*w)*(N*Y$(Q*k+I)-X$(I));return[F+v*z,X+v*W,Y*N/u8(Q*k+I)]}}return T.duration=B*1000*Q/Math.SQRT2,T}return U.rho=function(G){var Z=Math.max(0.001,+G),F=Z*Z,X=F*F;return _(Z,F,X)},U}(Math.SQRT2,2,4);var N2=0,Q5=0,_5=0,D8=1000,p5,J5,c5=0,_2=0,l5=0,$5=typeof performance==="object"&&performance.now?performance:Date,h8=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(_){setTimeout(_,17)};function U5(){return _2||(h8(L$),_2=$5.now()+l5)}function L$(){_2=0}function q5(){this._call=this._time=this._next=null}q5.prototype=r5.prototype={constructor:q5,restart:function(_,Q,J){if(typeof _!=="function")throw TypeError("callback is not a function");if(J=(J==null?U5():+J)+(Q==null?0:+Q),!this._next&&J5!==this){if(J5)J5._next=this;else p5=this;J5=this}this._call=_,this._time=J,v3()},stop:function(){if(this._call)this._call=null,this._time=1/0,v3()}};function r5(_,Q,J){var q=new q5;return q.restart(_,Q,J),q}function E8(){U5(),++N2;var _=p5,Q;while(_){if((Q=_2-_._time)>=0)_._call.call(void 0,Q);_=_._next}--N2}function b8(){_2=(c5=$5.now())+l5,N2=Q5=0;try{E8()}finally{N2=0,W$(),_2=0}}function z$(){var _=$5.now(),Q=_-c5;if(Q>D8)l5-=Q,c5=_}function W$(){var _,Q=p5,J,q=1/0;while(Q)if(Q._call){if(q>Q._time)q=Q._time;_=Q,Q=Q._next}else J=Q._next,Q._next=null,Q=_?_._next=J:p5=J;J5=_,v3(q)}function v3(_){if(N2)return;if(Q5)Q5=clearTimeout(Q5);var Q=_-_2;if(Q>24){if(_<1/0)Q5=setTimeout(b8,_-$5.now()-l5);if(_5)_5=clearInterval(_5)}else{if(!_5)c5=$5.now(),_5=setInterval(z$,D8);N2=1,h8(b8)}}function G5(_,Q,J){var q=new q5;return Q=Q==null?0:+Q,q.restart((U)=>{q.stop(),_(U+Q)},Q,J),q}var A$=a0("start","end","cancel","interrupt"),B$=[],g8=0,x8=1,d5=2,i5=3,m8=4,a5=5,Z5=6;function O0(_,Q,J,q,U,G){var Z=_.__transition;if(!Z)_.__transition={};else if(J in Z)return;M$(_,J,{name:Q,index:q,group:U,on:A$,tween:B$,time:G.time,delay:G.delay,duration:G.duration,ease:G.ease,timer:null,state:g8})}function F5(_,Q){var J=V1(_,Q);if(J.state>g8)throw Error("too late; already scheduled");return J}function E1(_,Q){var J=V1(_,Q);if(J.state>i5)throw Error("too late; already running");return J}function V1(_,Q){var J=_.__transition;if(!J||!(J=J[Q]))throw Error("transition not found");return J}function M$(_,Q,J){var q=_.__transition,U;q[Q]=J,J.timer=r5(G,0,J.time);function G(Y){if(J.state=x8,J.timer.restart(Z,J.delay,J.time),J.delay<=Y)Z(Y-J.delay)}function Z(Y){var H,K,L,z;if(J.state!==x8)return X();for(H in q){if(z=q[H],z.name!==J.name)continue;if(z.state===i5)return G5(Z);if(z.state===m8)z.state=Z5,z.timer.stop(),z.on.call("interrupt",_,_.__data__,z.index,z.group),delete q[H];else if(+H<Q)z.state=Z5,z.timer.stop(),z.on.call("cancel",_,_.__data__,z.index,z.group),delete q[H]}if(G5(function(){if(J.state===i5)J.state=m8,J.timer.restart(F,J.delay,J.time),F(Y)}),J.state=d5,J.on.call("start",_,_.__data__,J.index,J.group),J.state!==d5)return;J.state=i5,U=Array(L=J.tween.length);for(H=0,K=-1;H<L;++H)if(z=J.tween[H].value.call(_,_.__data__,J.index,J.group))U[++K]=z;U.length=K+1}function F(Y){var H=Y<J.duration?J.ease.call(null,Y/J.duration):(J.timer.restart(X),J.state=a5,1),K=-1,L=U.length;while(++K<L)U[K].call(_,H);if(J.state===a5)J.on.call("end",_,_.__data__,J.index,J.group),X()}function X(){J.state=Z5,J.timer.stop(),delete q[Q];for(var Y in q)return;delete _.__transition}}function u0(_,Q){var J=_.__transition,q,U,G=!0,Z;if(!J)return;Q=Q==null?null:Q+"";for(Z in J){if((q=J[Z]).name!==Q){G=!1;continue}U=q.state>d5&&q.state<a5,q.state=Z5,q.timer.stop(),q.on.call(U?"interrupt":"cancel",_,_.__data__,q.index,q.group),delete J[Z]}if(G)delete _.__transition}function j3(_){return this.each(function(){u0(this,_)})}function T$(_,Q){var J,q;return function(){var U=E1(this,_),G=U.tween;if(G!==J){q=J=G;for(var Z=0,F=q.length;Z<F;++Z)if(q[Z].name===Q){q=q.slice(),q.splice(Z,1);break}}U.tween=q}}function R$(_,Q,J){var q,U;if(typeof J!=="function")throw Error();return function(){var G=E1(this,_),Z=G.tween;if(Z!==q){U=(q=Z).slice();for(var F={name:Q,value:J},X=0,Y=U.length;X<Y;++X)if(U[X].name===Q){U[X]=F;break}if(X===Y)U.push(F)}G.tween=U}}function V3(_,Q){var J=this._id;if(_+="",arguments.length<2){var q=V1(this.node(),J).tween;for(var U=0,G=q.length,Z;U<G;++U)if((Z=q[U]).name===_)return Z.value;return null}return this.each((Q==null?T$:R$)(J,_,Q))}function C2(_,Q,J){var q=_._id;return _.each(function(){var U=E1(this,q);(U.value||(U.value={}))[Q]=J.apply(this,arguments)}),function(U){return V1(U,q).value[Q]}}function K5(_,Q){var J;return(typeof Q==="number"?m1:Q instanceof q0?n0:(J=q0(Q))?(Q=J,n0):P2)(_,Q)}function O$(_){return function(){this.removeAttribute(_)}}function f$(_){return function(){this.removeAttributeNS(_.space,_.local)}}function I$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttribute(_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function w$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttributeNS(_.space,_.local);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function P$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),X;if(F==null)return void this.removeAttribute(_);return Z=this.getAttribute(_),X=F+"",Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function N$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),X;if(F==null)return void this.removeAttributeNS(_.space,_.local);return Z=this.getAttributeNS(_.space,_.local),X=F+"",Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function u3(_,Q){var J=Y0(_),q=J==="transform"?y3:K5;return this.attrTween(_,typeof Q==="function"?(J.local?N$:P$)(J,q,C2(this,"attr."+_,Q)):Q==null?(J.local?f$:O$)(J):(J.local?w$:I$)(J,q,Q))}function C$(_,Q){return function(J){this.setAttribute(_,Q.call(this,J))}}function S$(_,Q){return function(J){this.setAttributeNS(_.space,_.local,Q.call(this,J))}}function k$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&S$(_,G);return J}return U._value=Q,U}function y$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&C$(_,G);return J}return U._value=Q,U}function b3(_,Q){var J="attr."+_;if(arguments.length<2)return(J=this.tween(J))&&J._value;if(Q==null)return this.tween(J,null);if(typeof Q!=="function")throw Error();var q=Y0(_);return this.tween(J,(q.local?k$:y$)(q,Q))}function v$(_,Q){return function(){F5(this,_).delay=+Q.apply(this,arguments)}}function j$(_,Q){return Q=+Q,function(){F5(this,_).delay=Q}}function D3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?v$:j$)(Q,_)):V1(this.node(),Q).delay}function V$(_,Q){return function(){E1(this,_).duration=+Q.apply(this,arguments)}}function u$(_,Q){return Q=+Q,function(){E1(this,_).duration=Q}}function h3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?V$:u$)(Q,_)):V1(this.node(),Q).duration}function b$(_,Q){if(typeof Q!=="function")throw Error();return function(){E1(this,_).ease=Q}}function E3(_){var Q=this._id;return arguments.length?this.each(b$(Q,_)):V1(this.node(),Q).ease}function D$(_,Q){return function(){var J=Q.apply(this,arguments);if(typeof J!=="function")throw Error();E1(this,_).ease=J}}function x3(_){if(typeof _!=="function")throw Error();return this.each(D$(this._id,_))}function m3(_){if(typeof _!=="function")_=R2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],X,Y=0;Y<Z;++Y)if((X=G[Y])&&_.call(X,X.__data__,Y,G))F.push(X);return new r1(q,this._parents,this._name,this._id)}function g3(_){if(_._id!==this._id)throw Error();for(var Q=this._groups,J=_._groups,q=Q.length,U=J.length,G=Math.min(q,U),Z=Array(q),F=0;F<G;++F)for(var X=Q[F],Y=J[F],H=X.length,K=Z[F]=Array(H),L,z=0;z<H;++z)if(L=X[z]||Y[z])K[z]=L;for(;F<q;++F)Z[F]=Q[F];return new r1(Z,this._parents,this._name,this._id)}function h$(_){return(_+"").trim().split(/^|\s+/).every(function(Q){var J=Q.indexOf(".");if(J>=0)Q=Q.slice(0,J);return!Q||Q==="start"})}function E$(_,Q,J){var q,U,G=h$(Q)?F5:E1;return function(){var Z=G(this,_),F=Z.on;if(F!==q)(U=(q=F).copy()).on(Q,J);Z.on=U}}function p3(_,Q){var J=this._id;return arguments.length<2?V1(this.node(),J).on.on(_):this.each(E$(J,_,Q))}function x$(_){return function(){var Q=this.parentNode;for(var J in this.__transition)if(+J!==_)return;if(Q)Q.removeChild(this)}}function c3(){return this.on("end.remove",x$(this._id))}function l3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=j0(_);for(var q=this._groups,U=q.length,G=Array(U),Z=0;Z<U;++Z)for(var F=q[Z],X=F.length,Y=G[Z]=Array(X),H,K,L=0;L<X;++L)if((H=F[L])&&(K=_.call(H,H.__data__,L,F))){if("__data__"in H)K.__data__=H.__data__;Y[L]=K,O0(Y[L],Q,J,L,Y,V1(H,J))}return new r1(G,this._parents,Q,J)}function r3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=O2(_);for(var q=this._groups,U=q.length,G=[],Z=[],F=0;F<U;++F)for(var X=q[F],Y=X.length,H,K=0;K<Y;++K)if(H=X[K]){for(var L=_.call(H,H.__data__,K,X),z,W=V1(H,J),O=0,T=L.length;O<T;++O)if(z=L[O])O0(z,Q,J,O,L,W);G.push(L),Z.push(H)}return new r1(G,Z,Q,J)}var m$=T0.prototype.constructor;function i3(){return new m$(this._groups,this._parents)}function g$(_,Q){var J,q,U;return function(){var G=V0(this,_),Z=(this.style.removeProperty(_),V0(this,_));return G===Z?null:G===J&&Z===q?U:U=Q(J=G,q=Z)}}function p8(_){return function(){this.style.removeProperty(_)}}function p$(_,Q,J){var q,U=J+"",G;return function(){var Z=V0(this,_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function c$(_,Q,J){var q,U,G;return function(){var Z=V0(this,_),F=J(this),X=F+"";if(F==null)X=F=(this.style.removeProperty(_),V0(this,_));return Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function l$(_,Q){var J,q,U,G="style."+Q,Z="end."+G,F;return function(){var X=E1(this,_),Y=X.on,H=X.value[G]==null?F||(F=p8(Q)):void 0;if(Y!==J||U!==H)(q=(J=Y).copy()).on(Z,U=H);X.on=q}}function d3(_,Q,J){var q=(_+="")==="transform"?k3:K5;return Q==null?this.styleTween(_,g$(_,q)).on("end.style."+_,p8(_)):typeof Q==="function"?this.styleTween(_,c$(_,q,C2(this,"style."+_,Q))).each(l$(this._id,_)):this.styleTween(_,p$(_,q,Q),J).on("end.style."+_,null)}function r$(_,Q,J){return function(q){this.style.setProperty(_,Q.call(this,q),J)}}function i$(_,Q,J){var q,U;function G(){var Z=Q.apply(this,arguments);if(Z!==U)q=(U=Z)&&r$(_,Z,J);return q}return G._value=Q,G}function a3(_,Q,J){var q="style."+(_+="");if(arguments.length<2)return(q=this.tween(q))&&q._value;if(Q==null)return this.tween(q,null);if(typeof Q!=="function")throw Error();return this.tween(q,i$(_,Q,J==null?"":J))}function d$(_){return function(){this.textContent=_}}function a$(_){return function(){var Q=_(this);this.textContent=Q==null?"":Q}}function s3(_){return this.tween("text",typeof _==="function"?a$(C2(this,"text",_)):d$(_==null?"":_+""))}function s$(_){return function(Q){this.textContent=_.call(this,Q)}}function t$(_){var Q,J;function q(){var U=_.apply(this,arguments);if(U!==J)Q=(J=U)&&s$(U);return Q}return q._value=_,q}function t3(_){var Q="text";if(arguments.length<1)return(Q=this.tween(Q))&&Q._value;if(_==null)return this.tween(Q,null);if(typeof _!=="function")throw Error();return this.tween(Q,t$(_))}function o3(){var _=this._name,Q=this._id,J=s5();for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y]){var H=V1(X,Q);O0(X,_,J,Y,Z,{time:H.time+H.delay+H.duration,delay:0,duration:H.duration,ease:H.ease})}return new r1(q,this._parents,_,J)}function n3(){var _,Q,J=this,q=J._id,U=J.size();return new Promise(function(G,Z){var F={value:Z},X={value:function(){if(--U===0)G()}};if(J.each(function(){var Y=E1(this,q),H=Y.on;if(H!==_)Q=(_=H).copy(),Q._.cancel.push(F),Q._.interrupt.push(F),Q._.end.push(X);Y.on=Q}),U===0)G()})}var o$=0;function r1(_,Q,J,q){this._groups=_,this._parents=Q,this._name=J,this._id=q}function c8(_){return T0().transition(_)}function s5(){return++o$}var f0=T0.prototype;r1.prototype=c8.prototype={constructor:r1,select:l3,selectAll:r3,selectChild:f0.selectChild,selectChildren:f0.selectChildren,filter:m3,merge:g3,selection:i3,transition:o3,call:f0.call,nodes:f0.nodes,node:f0.node,size:f0.size,empty:f0.empty,each:f0.each,on:p3,attr:u3,attrTween:b3,style:d3,styleTween:a3,text:s3,textTween:t3,remove:c3,tween:V3,delay:D3,duration:h3,ease:E3,easeVarying:x3,end:n3,[Symbol.iterator]:f0[Symbol.iterator]};function t5(_){return((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2}var n$={time:null,delay:0,duration:250,ease:t5};function e$(_,Q){var J;while(!(J=_.__transition)||!(J=J[Q]))if(!(_=_.parentNode))throw Error(`transition ${Q} not found`);return J}function e3(_){var Q,J;if(_ instanceof r1)Q=_._id,_=_._name;else Q=s5(),(J=n$).time=U5(),_=_==null?null:_+"";for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,X,Y=0;Y<F;++Y)if(X=Z[Y])O0(X,_,Q,Y,Z,J||e$(X,Q));return new r1(q,this._parents,_,Q)}T0.prototype.interrupt=j3;T0.prototype.transition=e3;var H5=(_)=>()=>_;function _6(_,{sourceEvent:Q,target:J,transform:q,dispatch:U}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},target:{value:J,enumerable:!0,configurable:!0},transform:{value:q,enumerable:!0,configurable:!0},_:{value:U}})}function U0(_,Q,J){this.k=_,this.x=Q,this.y=J}U0.prototype={constructor:U0,scale:function(_){return _===1?this:new U0(this.k*_,this.x,this.y)},translate:function(_,Q){return _===0&Q===0?this:new U0(this.k,this.x+this.k*_,this.y+this.k*Q)},apply:function(_){return[_[0]*this.k+this.x,_[1]*this.k+this.y]},applyX:function(_){return _*this.k+this.x},applyY:function(_){return _*this.k+this.y},invert:function(_){return[(_[0]-this.x)/this.k,(_[1]-this.y)/this.k]},invertX:function(_){return(_-this.x)/this.k},invertY:function(_){return(_-this.y)/this.k},rescaleX:function(_){return _.copy().domain(_.range().map(this.invertX,this).map(_.invert,_))},rescaleY:function(_){return _.copy().domain(_.range().map(this.invertY,this).map(_.invert,_))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Q2=new U0(1,0,0);X5.prototype=U0.prototype;function X5(_){while(!_.__zoom)if(!(_=_.parentNode))return Q2;return _.__zoom}function o5(_){_.stopImmediatePropagation()}function J2(_){_.preventDefault(),_.stopImmediatePropagation()}function _q(_){return(!_.ctrlKey||_.type==="wheel")&&!_.button}function Qq(){var _=this;if(_ instanceof SVGElement){if(_=_.ownerSVGElement||_,_.hasAttribute("viewBox"))return _=_.viewBox.baseVal,[[_.x,_.y],[_.x+_.width,_.y+_.height]];return[[0,0],[_.width.baseVal.value,_.height.baseVal.value]]}return[[0,0],[_.clientWidth,_.clientHeight]]}function l8(){return this.__zoom||Q2}function Jq(_){return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*(_.ctrlKey?10:1)}function $q(){return navigator.maxTouchPoints||"ontouchstart"in this}function qq(_,Q,J){var q=_.invertX(Q[0][0])-J[0][0],U=_.invertX(Q[1][0])-J[1][0],G=_.invertY(Q[0][1])-J[0][1],Z=_.invertY(Q[1][1])-J[1][1];return _.translate(U>q?(q+U)/2:Math.min(0,q)||Math.max(0,U),Z>G?(G+Z)/2:Math.min(0,G)||Math.max(0,Z))}function Y5(){var _=_q,Q=Qq,J=qq,q=Jq,U=$q,G=[0,1/0],Z=[[-1/0,-1/0],[1/0,1/0]],F=250,X=e0,Y=a0("start","zoom","end"),H,K,L,z=500,W=150,O=0,T=10;function B(S){S.property("__zoom",l8).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",v).filter(U).on("touchstart.zoom",E).on("touchmove.zoom",g).on("touchend.zoom touchcancel.zoom",h).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}B.transform=function(S,b,j,x){var V=S.selection?S.selection():S;if(V.property("__zoom",l8),S!==V)I(S,b,j,x);else V.interrupt().each(function(){C(this,arguments).event(x).start().zoom(null,typeof b==="function"?b.apply(this,arguments):b).end()})},B.scaleBy=function(S,b,j,x){B.scaleTo(S,function(){var V=this.__zoom.k,D=typeof b==="function"?b.apply(this,arguments):b;return V*D},j,x)},B.scaleTo=function(S,b,j,x){B.transform(S,function(){var V=Q.apply(this,arguments),D=this.__zoom,f=j==null?R(V):typeof j==="function"?j.apply(this,arguments):j,y=D.invert(f),p=typeof b==="function"?b.apply(this,arguments):b;return J(A(w(D,p),f,y),V,Z)},j,x)},B.translateBy=function(S,b,j,x){B.transform(S,function(){return J(this.__zoom.translate(typeof b==="function"?b.apply(this,arguments):b,typeof j==="function"?j.apply(this,arguments):j),Q.apply(this,arguments),Z)},null,x)},B.translateTo=function(S,b,j,x,V){B.transform(S,function(){var D=Q.apply(this,arguments),f=this.__zoom,y=x==null?R(D):typeof x==="function"?x.apply(this,arguments):x;return J(Q2.translate(y[0],y[1]).scale(f.k).translate(typeof b==="function"?-b.apply(this,arguments):-b,typeof j==="function"?-j.apply(this,arguments):-j),D,Z)},x,V)};function w(S,b){return b=Math.max(G[0],Math.min(G[1],b)),b===S.k?S:new U0(b,S.x,S.y)}function A(S,b,j){var x=b[0]-j[0]*S.k,V=b[1]-j[1]*S.k;return x===S.x&&V===S.y?S:new U0(S.k,x,V)}function R(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function I(S,b,j,x){S.on("start.zoom",function(){C(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(x).end()}).tween("zoom",function(){var V=this,D=arguments,f=C(V,D).event(x),y=Q.apply(V,D),p=j==null?R(y):typeof j==="function"?j.apply(V,D):j,u=Math.max(y[1][0]-y[0][0],y[1][1]-y[0][1]),s=V.__zoom,t=typeof b==="function"?b.apply(V,D):b,a=X(s.invert(p).concat(u/s.k),t.invert(p).concat(u/t.k));return function(d){if(d===1)d=t;else{var c=a(d),e=u/c[2];d=new U0(e,p[0]-c[0]*e,p[1]-c[1]*e)}f.zoom(null,d)}})}function C(S,b,j){return!j&&S.__zooming||new P(S,b)}function P(S,b){this.that=S,this.args=b,this.active=0,this.sourceEvent=null,this.extent=Q.apply(S,b),this.taps=0}P.prototype={event:function(S){if(S)this.sourceEvent=S;return this},start:function(){if(++this.active===1)this.that.__zooming=this,this.emit("start");return this},zoom:function(S,b){if(this.mouse&&S!=="mouse")this.mouse[1]=b.invert(this.mouse[0]);if(this.touch0&&S!=="touch")this.touch0[1]=b.invert(this.touch0[0]);if(this.touch1&&S!=="touch")this.touch1[1]=b.invert(this.touch1[0]);return this.that.__zoom=b,this.emit("zoom"),this},end:function(){if(--this.active===0)delete this.that.__zooming,this.emit("end");return this},emit:function(S){var b=j1(this.that).datum();Y.call(S,this.that,new _6(S,{sourceEvent:this.sourceEvent,target:B,type:S,transform:this.that.__zoom,dispatch:Y}),b)}};function k(S,...b){if(!_.apply(this,arguments))return;var j=C(this,b).event(S),x=this.__zoom,V=Math.max(G[0],Math.min(G[1],x.k*Math.pow(2,q.apply(this,arguments)))),D=x1(S);if(j.wheel){if(j.mouse[0][0]!==D[0]||j.mouse[0][1]!==D[1])j.mouse[1]=x.invert(j.mouse[0]=D);clearTimeout(j.wheel)}else if(x.k===V)return;else j.mouse=[D,x.invert(D)],u0(this),j.start();J2(S),j.wheel=setTimeout(f,W),j.zoom("mouse",J(A(w(x,V),j.mouse[0],j.mouse[1]),j.extent,Z));function f(){j.wheel=null,j.end()}}function N(S,...b){if(L||!_.apply(this,arguments))return;var j=S.currentTarget,x=C(this,b,!0).event(S),V=j1(S.view).on("mousemove.zoom",p,!0).on("mouseup.zoom",u,!0),D=x1(S,j),f=S.clientX,y=S.clientY;f2(S.view),o5(S),x.mouse=[D,this.__zoom.invert(D)],u0(this),x.start();function p(s){if(J2(s),!x.moved){var t=s.clientX-f,a=s.clientY-y;x.moved=t*t+a*a>O}x.event(s).zoom("mouse",J(A(x.that.__zoom,x.mouse[0]=x1(s,j),x.mouse[1]),x.extent,Z))}function u(s){V.on("mousemove.zoom mouseup.zoom",null),r2(s.view,x.moved),J2(s),x.event(s).end()}}function v(S,...b){if(!_.apply(this,arguments))return;var j=this.__zoom,x=x1(S.changedTouches?S.changedTouches[0]:S,this),V=j.invert(x),D=j.k*(S.shiftKey?0.5:2),f=J(A(w(j,D),x,V),Q.apply(this,b),Z);if(J2(S),F>0)j1(this).transition().duration(F).call(I,f,x,S);else j1(this).call(B.transform,f,x,S)}function E(S,...b){if(!_.apply(this,arguments))return;var j=S.touches,x=j.length,V=C(this,b,S.changedTouches.length===x).event(S),D,f,y,p;o5(S);for(f=0;f<x;++f)if(y=j[f],p=x1(y,this),p=[p,this.__zoom.invert(p),y.identifier],!V.touch0)V.touch0=p,D=!0,V.taps=1+!!H;else if(!V.touch1&&V.touch0[2]!==p[2])V.touch1=p,V.taps=0;if(H)H=clearTimeout(H);if(D){if(V.taps<2)K=p[0],H=setTimeout(function(){H=null},z);u0(this),V.start()}}function g(S,...b){if(!this.__zooming)return;var j=C(this,b).event(S),x=S.changedTouches,V=x.length,D,f,y,p;J2(S);for(D=0;D<V;++D)if(f=x[D],y=x1(f,this),j.touch0&&j.touch0[2]===f.identifier)j.touch0[0]=y;else if(j.touch1&&j.touch1[2]===f.identifier)j.touch1[0]=y;if(f=j.that.__zoom,j.touch1){var u=j.touch0[0],s=j.touch0[1],t=j.touch1[0],a=j.touch1[1],d=(d=t[0]-u[0])*d+(d=t[1]-u[1])*d,c=(c=a[0]-s[0])*c+(c=a[1]-s[1])*c;f=w(f,Math.sqrt(d/c)),y=[(u[0]+t[0])/2,(u[1]+t[1])/2],p=[(s[0]+a[0])/2,(s[1]+a[1])/2]}else if(j.touch0)y=j.touch0[0],p=j.touch0[1];else return;j.zoom("touch",J(A(f,y,p),j.extent,Z))}function h(S,...b){if(!this.__zooming)return;var j=C(this,b).event(S),x=S.changedTouches,V=x.length,D,f;if(o5(S),L)clearTimeout(L);L=setTimeout(function(){L=null},z);for(D=0;D<V;++D)if(f=x[D],j.touch0&&j.touch0[2]===f.identifier)delete j.touch0;else if(j.touch1&&j.touch1[2]===f.identifier)delete j.touch1;if(j.touch1&&!j.touch0)j.touch0=j.touch1,delete j.touch1;if(j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2){if(f=x1(f,this),Math.hypot(K[0]-f[0],K[1]-f[1])<T){var y=j1(this).on("dblclick.zoom");if(y)y.apply(this,arguments)}}}return B.wheelDelta=function(S){return arguments.length?(q=typeof S==="function"?S:H5(+S),B):q},B.filter=function(S){return arguments.length?(_=typeof S==="function"?S:H5(!!S),B):_},B.touchable=function(S){return arguments.length?(U=typeof S==="function"?S:H5(!!S),B):U},B.extent=function(S){return arguments.length?(Q=typeof S==="function"?S:H5([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),B):Q},B.scaleExtent=function(S){return arguments.length?(G[0]=+S[0],G[1]=+S[1],B):[G[0],G[1]]},B.translateExtent=function(S){return arguments.length?(Z[0][0]=+S[0][0],Z[1][0]=+S[1][0],Z[0][1]=+S[0][1],Z[1][1]=+S[1][1],B):[[Z[0][0],Z[0][1]],[Z[1][0],Z[1][1]]]},B.constrain=function(S){return arguments.length?(J=S,B):J},B.duration=function(S){return arguments.length?(F=+S,B):F},B.interpolate=function(S){return arguments.length?(X=S,B):X},B.on=function(){var S=Y.on.apply(Y,arguments);return S===Y?B:S},B.clickDistance=function(S){return arguments.length?(O=(S=+S)*S,B):Math.sqrt(O)},B.tapDistance=function(S){return arguments.length?(T=+S,B):T},B}var i1={error001:(_="react")=>`Seems like you have not used ${_==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${_}flow.dev/error#001`,error002:()=>"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.",error003:(_)=>`Node type "${_}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:(_)=>`The old edge with id=${_} does not exist.`,error009:(_)=>`Marker type "${_}" doesn't exist.`,error008:(_,{id:Q,sourceHandle:J,targetHandle:q})=>`Couldn't create edge for ${_} handle id: "${_==="source"?J:q}", edge id: ${Q}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:(_)=>`Edge type "${_}" not found. Using fallback type "default".`,error012:(_)=>`Node with id "${_}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(_="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${_}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:(_)=>`Edge with id "${_}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},v2=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],U6=["Enter"," ","Escape"],G6={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:_,x:Q,y:J})=>`Moved selected node ${_}. New position, x: ${Q}, y: ${J}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},E0;(function(_){_.Strict="strict",_.Loose="loose"})(E0||(E0={}));var I0;(function(_){_.Free="free",_.Vertical="vertical",_.Horizontal="horizontal"})(I0||(I0={}));var $2;(function(_){_.Partial="partial",_.Full="full"})($2||($2={}));var Z6={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},W0;(function(_){_.Bezier="default",_.Straight="straight",_.Step="step",_.SmoothStep="smoothstep",_.SimpleBezier="simplebezier"})(W0||(W0={}));var k2;(function(_){_.Arrow="arrow",_.ArrowClosed="arrowclosed"})(k2||(k2={}));var J1;(function(_){_.Left="left",_.Top="top",_.Right="right",_.Bottom="bottom"})(J1||(J1={}));var r8={[J1.Left]:J1.Right,[J1.Right]:J1.Left,[J1.Top]:J1.Bottom,[J1.Bottom]:J1.Top},F6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("source"in _)&&("target"in _),U7=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("position"in _)&&!("source"in _)&&!("target"in _),K6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("internals"in _)&&!("source"in _)&&!("target"in _);var z5=(_,Q=[0,0])=>{let{width:J,height:q}=Q0(_),U=_.origin??Q,G=J*U[0],Z=q*U[1];return{x:_.position.x-G,y:_.position.y-Z}},H6=(_,Q={nodeOrigin:[0,0]})=>{if(!Q.nodeLookup)console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.");if(_.length===0)return{x:0,y:0,width:0,height:0};let J=!1,q=_.reduce((U,G)=>{let Z=typeof G==="string",F=!Q.nodeLookup&&!Z?G:void 0;if(Q.nodeLookup)F=Z?Q.nodeLookup.get(G):!K6(G)?Q.nodeLookup.get(G.id):G;if(!F)return U;return J=!0,$4(U,_4(F,Q.nodeOrigin))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return J?q4(q):{x:0,y:0,width:0,height:0}},Z2=(_,Q={})=>{let J={x:1/0,y:1/0,x2:-1/0,y2:-1/0},q=!1;return _.forEach((U)=>{if(Q.filter===void 0||Q.filter(U))J=$4(J,_4(U)),q=!0}),q?q4(J):{x:0,y:0,width:0,height:0}},Q4=(_,Q,[J,q,U]=[0,0,1],G=!1,Z=!1)=>{let F=(Q.x-J)/U,X=(Q.y-q)/U,Y=Q.width/U,H=Q.height/U,K=[];for(let L of _.values()){let{measured:z,selectable:W=!0,hidden:O=!1}=L;if(Z&&!W||O)continue;let T=z.width??L.width??L.initialWidth??0,B=z.height??L.height??L.initialHeight??0,{x:w,y:A}=L.internals.positionAbsolute,R=H7(F,X,Y,H,w,A,T,B),I=T*B,C=G&&R>0;if(!L.internals.handleBounds||C||R>=I||L.dragging)K.push(L)}return K},G7=(_,Q)=>{let J=new Set;return _.forEach((q)=>{J.add(q.id)}),Q.filter((q)=>J.has(q.source)||J.has(q.target))};function Uq(_,Q){let J=new Map,q=Q?.nodes?new Set(Q.nodes.map((U)=>U.id)):null;return _.forEach((U)=>{let G;if(Q?.includeHiddenNodes){let{width:Z,height:F}=Q0(U);G=Z>0&&F>0}else G=Boolean(U.measured.width&&U.measured.height&&!U.hidden);if(G&&(!q||q.has(U.id)))J.set(U.id,U)}),J}async function Z7({nodes:_,width:Q,height:J,panZoom:q,minZoom:U,maxZoom:G},Z){if(_.size===0)return!0;let F=Uq(_,Z),X=Z2(F),Y=A5(X,Q,J,Z?.minZoom??U,Z?.maxZoom??G,Z?.padding??0.1);return await q.setViewport(Y,{duration:Z?.duration,ease:Z?.ease,interpolate:Z?.interpolate}),!0}function X6({nodeId:_,nextPosition:Q,nodeLookup:J,nodeOrigin:q=[0,0],nodeExtent:U,onError:G}){let Z=J.get(_),F=Z.parentId?J.get(Z.parentId):void 0,{x:X,y:Y}=F?F.internals.positionAbsolute:{x:0,y:0},H=Z.origin??q,K=Z.extent||U;if(Z.extent==="parent"&&!Z.expandParent)if(!F)G?.("005",i1.error005());else{let{width:z,height:W}=Q0(F);if(z&&W)K=[[X,Y],[X+z,Y+W]]}else if(F&&G2(Z.extent))K=[[Z.extent[0][0]+X,Z.extent[0][1]+Y],[Z.extent[1][0]+X,Z.extent[1][1]+Y]];let L=G2(K)?q2(Q,K,Z.measured):Q;if(Z.measured.width===void 0||Z.measured.height===void 0)G?.("015",i1.error015());return{position:{x:L.x-X+(Z.measured.width??0)*H[0],y:L.y-Y+(Z.measured.height??0)*H[1]},positionAbsolute:L}}async function F7({nodesToRemove:_=[],edgesToRemove:Q=[],nodes:J,edges:q,onBeforeDelete:U}){let G=new Set(_.map((L)=>L.id)),Z=[];for(let L of J){if(L.deletable===!1)continue;let z=G.has(L.id),W=!z&&L.parentId&&Z.find((O)=>O.id===L.parentId);if(z||W)Z.push(L)}let F=new Set(Q.map((L)=>L.id)),X=q.filter((L)=>L.deletable!==!1),H=G7(Z,X);for(let L of X)if(F.has(L.id)&&!H.find((W)=>W.id===L.id))H.push(L);if(!U)return{edges:H,nodes:Z};let K=await U({nodes:Z,edges:H});if(typeof K==="boolean")return K?{edges:H,nodes:Z}:{edges:[],nodes:[]};return K}var y2=(_,Q=0,J=1)=>Math.min(Math.max(_,Q),J),q2=(_={x:0,y:0},Q,J)=>({x:y2(_.x,Q[0][0],Q[1][0]-(J?.width??0)),y:y2(_.y,Q[0][1],Q[1][1]-(J?.height??0))});function K7(_,Q,J){let{width:q,height:U}=Q0(J),{x:G,y:Z}=J.internals.positionAbsolute;return q2(_,[[G,Z],[G+q,Z+U]],Q)}var i8=(_,Q,J)=>{if(_<Q)return y2(Math.abs(_-Q),1,Q)/Q;else if(_>J)return-y2(Math.abs(_-J),1,Q)/Q;return 0},J4=(_,Q,J=15,q=40)=>{let U=i8(_.x,q,Q.width-q)*J,G=i8(_.y,q,Q.height-q)*J;return[U,G]},$4=(_,Q)=>({x:Math.min(_.x,Q.x),y:Math.min(_.y,Q.y),x2:Math.max(_.x2,Q.x2),y2:Math.max(_.y2,Q.y2)}),q6=({x:_,y:Q,width:J,height:q})=>({x:_,y:Q,x2:_+J,y2:Q+q}),q4=({x:_,y:Q,x2:J,y2:q})=>({x:_,y:Q,width:J-_,height:q-Q}),j2=(_,Q=[0,0])=>{let{x:J,y:q}=K6(_)?_.internals.positionAbsolute:z5(_,Q);return{x:J,y:q,width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}},_4=(_,Q=[0,0])=>{let{x:J,y:q}=K6(_)?_.internals.positionAbsolute:z5(_,Q);return{x:J,y:q,x2:J+(_.measured?.width??_.width??_.initialWidth??0),y2:q+(_.measured?.height??_.height??_.initialHeight??0)}},Y6=(_,Q)=>q4($4(q6(_),q6(Q))),H7=(_,Q,J,q,U,G,Z,F)=>{let X=Math.max(0,Math.min(_+J,U+Z)-Math.max(_,U)),Y=Math.max(0,Math.min(Q+q,G+F)-Math.max(Q,G));return Math.ceil(X*Y)},W5=(_,Q)=>H7(_.x,_.y,_.width,_.height,Q.x,Q.y,Q.width,Q.height),L6=(_)=>e1(_.width)&&e1(_.height)&&e1(_.x)&&e1(_.y),e1=(_)=>!isNaN(_)&&isFinite(_),z6=(_,Q)=>(J,q)=>{console.warn(`[${_}]: ${q} Help: ${Q}error#${J}`)},V2=(_,Q=[1,1])=>{return{x:Q[0]*Math.round(_.x/Q[0]),y:Q[1]*Math.round(_.y/Q[1])}},u2=({x:_,y:Q},[J,q,U],G=!1,Z=[1,1])=>{let F={x:(_-J)/U,y:(Q-q)/U};return G?V2(F,Z):F},U2=({x:_,y:Q},[J,q,U])=>{return{x:_*U+J,y:Q*U+q}};function S2(_,Q){if(typeof _==="number")return Math.floor((Q-Q/(1+_))*0.5);if(typeof _==="string"&&_.endsWith("px")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(J)}if(typeof _==="string"&&_.endsWith("%")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(Q*J*0.01)}return console.error(`The padding value "${_}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Gq(_,Q,J){if(typeof _==="string"||typeof _==="number"){let q=S2(_,J),U=S2(_,Q);return{top:q,right:U,bottom:q,left:U,x:U*2,y:q*2}}if(typeof _==="object"){let q=S2(_.top??_.y??0,J),U=S2(_.bottom??_.y??0,J),G=S2(_.left??_.x??0,Q),Z=S2(_.right??_.x??0,Q);return{top:q,right:Z,bottom:U,left:G,x:G+Z,y:q+U}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Zq(_,Q,J,q,U,G){let{x:Z,y:F}=U2(_,[Q,J,q]),{x:X,y:Y}=U2({x:_.x+_.width,y:_.y+_.height},[Q,J,q]),H=U-X,K=G-Y;return{left:Math.floor(Z),top:Math.floor(F),right:Math.floor(H),bottom:Math.floor(K)}}var A5=(_,Q,J,q,U,G)=>{let Z=Gq(G,Q,J),F=(Q-Z.x)/_.width,X=(J-Z.y)/_.height,Y=Math.min(F,X),H=y2(Y,q,U),K=_.x+_.width/2,L=_.y+_.height/2,z=Q/2-K*H,W=J/2-L*H,O=Zq(_,z,W,H,Q,J),T={left:Math.min(O.left-Z.left,0),top:Math.min(O.top-Z.top,0),right:Math.min(O.right-Z.right,0),bottom:Math.min(O.bottom-Z.bottom,0)};return{x:z-T.left+T.right,y:W-T.top+T.bottom,zoom:H}},b2=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function G2(_){return _!==void 0&&_!==null&&_!=="parent"}function Q0(_){return{width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}}function W6(_){return(_.measured?.width??_.width??_.initialWidth)!==void 0&&(_.measured?.height??_.height??_.initialHeight)!==void 0}function A6(_,Q={width:0,height:0},J,q,U){let G={..._},Z=q.get(J);if(Z){let F=Z.origin||U;G.x+=Z.internals.positionAbsolute.x-(Q.width??0)*F[0],G.y+=Z.internals.positionAbsolute.y-(Q.height??0)*F[1]}return G}function B6(_,Q){if(_.size!==Q.size)return!1;for(let J of _)if(!Q.has(J))return!1;return!0}function X7(){let _,Q;return{promise:new Promise((q,U)=>{_=q,Q=U}),resolve:_,reject:Q}}function Y7(_){return{...G6,..._||{}}}function Fq(_){if(typeof document>"u")return!0;let Q=document.querySelector(`.${_}-flow__pane`);if(!Q||!Q.isConnected)return!0;let J=getComputedStyle(Q);if(J.display==="none")return!0;if(J.visibility==="hidden"||J.visibility==="collapse")return!0;if(J.opacity==="0")return!0;if(J.width==="0"&&J.height==="0")return!0;let q=Q.getBoundingClientRect();if(q.width===0&&q.height===0)return!0;let U=document.querySelector(`.${_}-flow__attribution`);if(!U||!U.isConnected)return!1;let G=getComputedStyle(U);if(G.display==="none")return!1;if(G.visibility==="hidden"||G.visibility==="collapse")return!1;if(G.opacity==="0")return!1;let Z=U.getBoundingClientRect();if(Z.width===0&&Z.height===0)return!1;return!0}var d8=!1;function L7(_){if(d8)return;d8=!0;let Q=`${_.charAt(0).toUpperCase()+_.slice(1)} Flow`;setTimeout(()=>{if(!Fq(_))console.warn(`${Q}: It seems like you are hiding the attribution. Please only do this when you are subscribed to ${Q} Pro: https://${_}flow.dev/remove-attr
28
- %cYou can ignore this warning if you are subscribed.`,"font-style: italic;")},1000)}function M6(_){return _===null?null:_?"valid":"invalid"}function L5(_,{snapGrid:Q=[0,0],snapToGrid:J=!1,transform:q,containerBounds:U}){let{x:G,y:Z}=_0(_),F=u2({x:G-(U?.left??0),y:Z-(U?.top??0)},q),{x:X,y:Y}=J?V2(F,Q):F;return{xSnapped:X,ySnapped:Y,...F}}var U4=(_)=>({width:_.offsetWidth,height:_.offsetHeight}),T6=(_)=>_?.getRootNode?.()||window?.document,Kq=["INPUT","SELECT","TEXTAREA"];function R6(_){let Q=_.composedPath?.()?.[0]||_.target;if(Q?.nodeType!==1)return!1;return Kq.includes(Q.nodeName)||Q.hasAttribute("contenteditable")||!!Q.closest(".nokey")}var O6=(_)=>("clientX"in _),_0=(_,Q)=>{let J=O6(_),q=J?_.clientX:_.touches?.[0].clientX,U=J?_.clientY:_.touches?.[0].clientY;return{x:q-(Q?.left??0),y:U-(Q?.top??0)}},a8=(_,Q,J,q,U)=>{let G=Q.querySelectorAll(`.${_}`);if(!G||!G.length)return null;return Array.from(G).map((Z)=>{let F=Z.getBoundingClientRect();return{id:Z.getAttribute("data-handleid"),type:_,nodeId:U,position:Z.getAttribute("data-handlepos"),x:(F.left-J.left)/q,y:(F.top-J.top)/q,...U4(Z)}})};function G4({sourceX:_,sourceY:Q,targetX:J,targetY:q,sourceControlX:U,sourceControlY:G,targetControlX:Z,targetControlY:F}){let X=_*0.125+U*0.375+Z*0.375+J*0.125,Y=Q*0.125+G*0.375+F*0.375+q*0.125,H=Math.abs(X-_),K=Math.abs(Y-Q);return[X,Y,H,K]}function n5(_,Q){if(_>=0)return 0.5*_;return Q*25*Math.sqrt(-_)}function s8({pos:_,x1:Q,y1:J,x2:q,y2:U,c:G}){switch(_){case J1.Left:return[Q-n5(Q-q,G),J];case J1.Right:return[Q+n5(q-Q,G),J];case J1.Top:return[Q,J-n5(J-U,G)];case J1.Bottom:return[Q,J+n5(U-J,G)]}}function Z4({sourceX:_,sourceY:Q,sourcePosition:J=J1.Bottom,targetX:q,targetY:U,targetPosition:G=J1.Top,curvature:Z=0.25}){let[F,X]=s8({pos:J,x1:_,y1:Q,x2:q,y2:U,c:Z}),[Y,H]=s8({pos:G,x1:q,y1:U,x2:_,y2:Q,c:Z}),[K,L,z,W]=G4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:F,sourceControlY:X,targetControlX:Y,targetControlY:H});return[`M${_},${Q} C${F},${X} ${Y},${H} ${q},${U}`,K,L,z,W]}function f6({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let U=Math.abs(J-_)/2,G=J<_?J+U:J-U,Z=Math.abs(q-Q)/2,F=q<Q?q+Z:q-Z;return[G,F,U,Z]}function z7({sourceNode:_,targetNode:Q,selected:J=!1,zIndex:q=0,elevateOnSelect:U=!1,zIndexMode:G="basic"}){if(G==="manual")return q;let Z=U&&J?q+1000:q,F=Math.max(_.parentId||U&&_.selected?_.internals.z:0,Q.parentId||U&&Q.selected?Q.internals.z:0);return Z+F}function W7({sourceNode:_,targetNode:Q,width:J,height:q,transform:U}){let G=$4(_4(_),_4(Q));if(G.x===G.x2)G.x2+=1;if(G.y===G.y2)G.y2+=1;let Z={x:-U[0]/U[2],y:-U[1]/U[2],width:J/U[2],height:q/U[2]};return W5(Z,q4(G))>0}var Hq=({source:_,sourceHandle:Q,target:J,targetHandle:q})=>`xy-edge__${_}${Q||""}-${J}${q||""}`,Xq=(_,Q)=>{return Q.some((J)=>J.source===_.source&&J.target===_.target&&(J.sourceHandle===_.sourceHandle||!J.sourceHandle&&!_.sourceHandle)&&(J.targetHandle===_.targetHandle||!J.targetHandle&&!_.targetHandle))},A7=(_,Q,J={})=>{if(!_.source||!_.target)return J.onError?.("006",i1.error006()),Q;let q=J.getEdgeId||Hq,U;if(F6(_))U={..._};else U={..._,id:q(_)};if(Xq(U,Q))return Q;if(U.sourceHandle===null)delete U.sourceHandle;if(U.targetHandle===null)delete U.targetHandle;return Q.concat(U)};function F4({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let[U,G,Z,F]=f6({sourceX:_,sourceY:Q,targetX:J,targetY:q});return[`M ${_},${Q}L ${J},${q}`,U,G,Z,F]}var t8={[J1.Left]:{x:-1,y:0},[J1.Right]:{x:1,y:0},[J1.Top]:{x:0,y:-1},[J1.Bottom]:{x:0,y:1}},Yq=({source:_,sourcePosition:Q=J1.Bottom,target:J})=>{if(Q===J1.Left||Q===J1.Right)return _.x<J.x?{x:1,y:0}:{x:-1,y:0};return _.y<J.y?{x:0,y:1}:{x:0,y:-1}},o8=(_,Q)=>Math.sqrt(Math.pow(Q.x-_.x,2)+Math.pow(Q.y-_.y,2));function Lq({source:_,sourcePosition:Q=J1.Bottom,target:J,targetPosition:q=J1.Top,center:U,offset:G,stepPosition:Z}){let F=t8[Q],X=t8[q],Y={x:_.x+F.x*G,y:_.y+F.y*G},H={x:J.x+X.x*G,y:J.y+X.y*G},K=Yq({source:Y,sourcePosition:Q,target:H}),L=K.x!==0?"x":"y",z=K[L],W=[],O,T,B={x:0,y:0},w={x:0,y:0},[,,A,R]=f6({sourceX:_.x,sourceY:_.y,targetX:J.x,targetY:J.y});if(F[L]*X[L]===-1){if(L==="x")O=U.x??Y.x+(H.x-Y.x)*Z,T=U.y??(Y.y+H.y)/2;else O=U.x??(Y.x+H.x)/2,T=U.y??Y.y+(H.y-Y.y)*Z;let k=[{x:O,y:Y.y},{x:O,y:H.y}],N=[{x:Y.x,y:T},{x:H.x,y:T}];if(F[L]===z)W=L==="x"?k:N;else W=L==="x"?N:k}else{let k=[{x:Y.x,y:H.y}],N=[{x:H.x,y:Y.y}];if(L==="x")W=F.x===z?N:k;else W=F.y===z?k:N;if(Q===q){let S=Math.abs(_[L]-J[L]);if(S<=G){let b=Math.min(G-1,G-S);if(F[L]===z)B[L]=(Y[L]>_[L]?-1:1)*b;else w[L]=(H[L]>J[L]?-1:1)*b}}if(Q!==q){let S=L==="x"?"y":"x",b=F[L]===X[S],j=Y[S]>H[S],x=Y[S]<H[S];if(F[L]===1&&(!b&&j||b&&x)||F[L]!==1&&(!b&&x||b&&j))W=L==="x"?k:N}let v={x:Y.x+B.x,y:Y.y+B.y},E={x:H.x+w.x,y:H.y+w.y},g=Math.max(Math.abs(v.x-W[0].x),Math.abs(E.x-W[0].x)),h=Math.max(Math.abs(v.y-W[0].y),Math.abs(E.y-W[0].y));if(g>=h)O=(v.x+E.x)/2,T=W[0].y;else O=W[0].x,T=(v.y+E.y)/2}let I={x:Y.x+B.x,y:Y.y+B.y},C={x:H.x+w.x,y:H.y+w.y};return[[_,...I.x!==W[0].x||I.y!==W[0].y?[I]:[],...W,...C.x!==W[W.length-1].x||C.y!==W[W.length-1].y?[C]:[],J],O,T,A,R]}function zq(_,Q,J,q){let U=Math.min(o8(_,Q)/2,o8(Q,J)/2,q),{x:G,y:Z}=Q;if(_.x===G&&G===J.x||_.y===Z&&Z===J.y)return`L${G} ${Z}`;if(_.y===Z){let Y=_.x<J.x?-1:1,H=_.y<J.y?1:-1;return`L ${G+U*Y},${Z}Q ${G},${Z} ${G},${Z+U*H}`}let F=_.x<J.x?1:-1,X=_.y<J.y?-1:1;return`L ${G},${Z+U*X}Q ${G},${Z} ${G+U*F},${Z}`}function B5({sourceX:_,sourceY:Q,sourcePosition:J=J1.Bottom,targetX:q,targetY:U,targetPosition:G=J1.Top,borderRadius:Z=5,centerX:F,centerY:X,offset:Y=20,stepPosition:H=0.5}){let[K,L,z,W,O]=Lq({source:{x:_,y:Q},sourcePosition:J,target:{x:q,y:U},targetPosition:G,center:{x:F,y:X},offset:Y,stepPosition:H}),T=`M${K[0].x} ${K[0].y}`;for(let B=1;B<K.length-1;B++)T+=zq(K[B-1],K[B],K[B+1],Z);return T+=`L${K[K.length-1].x} ${K[K.length-1].y}`,[T,L,z,W,O]}function n8(_){return _&&!!(_.internals.handleBounds||_.handles?.length)&&!!(_.measured.width||_.width||_.initialWidth)}function B7(_){let{sourceNode:Q,targetNode:J}=_;if(!n8(Q)||!n8(J))return null;let q=Q.internals.handleBounds||e8(Q.handles),U=J.internals.handleBounds||e8(J.handles),G=_7(q?.source??[],_.sourceHandle),Z=_7(_.connectionMode===E0.Strict?U?.target??[]:(U?.target??[]).concat(U?.source??[]),_.targetHandle);if(!G||!Z)return _.onError?.("008",i1.error008(!G?"source":"target",{id:_.id,sourceHandle:_.sourceHandle,targetHandle:_.targetHandle})),null;let F=G?.position||J1.Bottom,X=Z?.position||J1.Top,Y=x0(Q,G,F),H=x0(J,Z,X);return{sourceX:Y.x,sourceY:Y.y,targetX:H.x,targetY:H.y,sourcePosition:F,targetPosition:X}}function e8(_){if(!_)return null;let Q=[],J=[];for(let q of _)if(q.width=q.width??1,q.height=q.height??1,q.type==="source")Q.push(q);else if(q.type==="target")J.push(q);return{source:Q,target:J}}function x0(_,Q,J=J1.Left,q=!1){let U=(Q?.x??0)+_.internals.positionAbsolute.x,G=(Q?.y??0)+_.internals.positionAbsolute.y,{width:Z,height:F}=Q??Q0(_);if(q)return{x:U+Z/2,y:G+F/2};switch(Q?.position??J){case J1.Top:return{x:U+Z/2,y:G};case J1.Right:return{x:U+Z,y:G+F/2};case J1.Bottom:return{x:U+Z/2,y:G+F};case J1.Left:return{x:U,y:G+F/2}}}function _7(_,Q){if(!_)return null;return(!Q?_[0]:_.find((J)=>J.id===Q))||null}function K4(_,Q){if(!_)return"";if(typeof _==="string")return _;return`${Q?`${Q}__`:""}${Object.keys(_).sort().map((q)=>`${q}=${_[q]}`).join("&")}`}function M7(_,{id:Q,defaultColor:J,defaultMarkerStart:q,defaultMarkerEnd:U}){let G=new Set;return _.reduce((Z,F)=>{return[F.markerStart||q,F.markerEnd||U].forEach((X)=>{if(X&&typeof X==="object"){let Y=K4(X,Q);if(!G.has(Y))Z.push({id:Y,color:X.color||J,...X}),G.add(Y)}}),Z},[]).sort((Z,F)=>Z.id.localeCompare(F.id))}function T7(_,Q,J,q,U){let G=0.5;if(U==="start")G=0;else if(U==="end")G=1;let Z=[(_.x+_.width*G)*Q.zoom+Q.x,_.y*Q.zoom+Q.y-q],F=[-100*G,-100];switch(J){case J1.Right:Z=[(_.x+_.width)*Q.zoom+Q.x+q,(_.y+_.height*G)*Q.zoom+Q.y],F=[0,-100*G];break;case J1.Bottom:Z[1]=(_.y+_.height)*Q.zoom+Q.y+q,F[1]=0;break;case J1.Left:Z=[_.x*Q.zoom+Q.x-q,(_.y+_.height*G)*Q.zoom+Q.y],F=[-100,-100*G];break}return`translate(${Z[0]}px, ${Z[1]}px) translate(${F[0]}%, ${F[1]}%)`}var R7=1000,Wq=10,I6={nodeOrigin:[0,0],nodeExtent:v2,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Aq={...I6,checkEquality:!0};function w6(_,Q){let J={..._};for(let q in Q)if(Q[q]!==void 0)J[q]=Q[q];return J}function O7(_,Q,J){let q=w6(I6,J);for(let U of _.values())if(U.parentId)N6(U,_,Q,q);else{let G=z5(U,q.nodeOrigin),Z=G2(U.extent)?U.extent:q.nodeExtent,F=q2(G,Z,Q0(U));U.internals.positionAbsolute=F}}function Bq(_,Q){if(!_.handles)return!_.measured?void 0:Q?.internals.handleBounds;let J=[],q=[];for(let U of _.handles){let G={id:U.id,width:U.width??1,height:U.height??1,nodeId:_.id,x:U.x,y:U.y,position:U.position,type:U.type};if(U.type==="source")J.push(G);else if(U.type==="target")q.push(G)}return{source:J,target:q}}function P6(_){return _==="manual"}function H4(_,Q,J,q={}){let U=w6(Aq,q),G={i:0},Z=new Map(Q),F=U?.elevateNodesOnSelect&&!P6(U.zIndexMode)?R7:0,X=_.length>0,Y=!1;Q.clear(),J.clear();for(let H of _){let K=Z.get(H.id);if(U.checkEquality&&H===K?.internals.userNode)Q.set(H.id,K);else{let L=z5(H,U.nodeOrigin),z=G2(H.extent)?H.extent:U.nodeExtent,W=q2(L,z,Q0(H));K={...U.defaults,...H,measured:{width:H.measured?.width,height:H.measured?.height},internals:{positionAbsolute:W,handleBounds:Bq(H,K),z:f7(H,F,U.zIndexMode),userNode:H}},Q.set(H.id,K)}if((K.measured===void 0||K.measured.width===void 0||K.measured.height===void 0)&&!K.hidden)X=!1;if(H.parentId)N6(K,Q,J,q,G);Y||=H.selected??!1}return{nodesInitialized:X,hasSelectedNodes:Y}}function Mq(_,Q){if(!_.parentId)return;let J=Q.get(_.parentId);if(J)J.set(_.id,_);else Q.set(_.parentId,new Map([[_.id,_]]))}function N6(_,Q,J,q,U){let{elevateNodesOnSelect:G,nodeOrigin:Z,nodeExtent:F,zIndexMode:X}=w6(I6,q),Y=_.parentId,H=Q.get(Y);if(!H){console.warn(`Parent node ${Y} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}if(Mq(_,J),U&&!H.parentId&&H.internals.rootParentIndex===void 0&&X==="auto")H.internals.rootParentIndex=++U.i,H.internals.z=H.internals.z+U.i*Wq;if(U&&H.internals.rootParentIndex!==void 0)U.i=H.internals.rootParentIndex;let K=G&&!P6(X)?R7:0,{x:L,y:z,z:W}=Tq(_,H,Z,F,K,X),{positionAbsolute:O}=_.internals,T=L!==O.x||z!==O.y;if(T||W!==_.internals.z)Q.set(_.id,{..._,internals:{..._.internals,positionAbsolute:T?{x:L,y:z}:O,z:W}})}function f7(_,Q,J){let q=e1(_.zIndex)?_.zIndex:0;if(P6(J))return q;return q+(_.selected?Q:0)}function Tq(_,Q,J,q,U,G){let{x:Z,y:F}=Q.internals.positionAbsolute,X=Q0(_),Y=z5(_,J),H=G2(_.extent)?q2(Y,_.extent,X):Y,K=q2({x:Z+H.x,y:F+H.y},q,X);if(_.extent==="parent")K=K7(K,X,Q);let L=f7(_,U,G),z=Q.internals.z??0;return{x:K.x,y:K.y,z:z>=L?z+1:L}}function X4(_,Q,J,q=[0,0]){let U=[],G=new Map;for(let Z of _){let F=Q.get(Z.parentId);if(!F)continue;let X=G.get(Z.parentId)?.expandedRect??j2(F),Y=Y6(X,Z.rect);G.set(Z.parentId,{expandedRect:Y,parent:F})}if(G.size>0)G.forEach(({expandedRect:Z,parent:F},X)=>{let Y=F.internals.positionAbsolute,H=Q0(F),K=F.origin??q,L=Z.x<Y.x?Math.round(Math.abs(Y.x-Z.x)):0,z=Z.y<Y.y?Math.round(Math.abs(Y.y-Z.y)):0,W=Math.max(H.width,Math.round(Z.width)),O=Math.max(H.height,Math.round(Z.height)),T=(W-H.width)*K[0],B=(O-H.height)*K[1];if(L>0||z>0||T||B)U.push({id:X,type:"position",position:{x:F.position.x-L+T,y:F.position.y-z+B}}),J.get(X)?.forEach((w)=>{if(!_.some((A)=>A.id===w.id))U.push({id:w.id,type:"position",position:{x:w.position.x+L,y:w.position.y+z}})});if(H.width<Z.width||H.height<Z.height||L||z)U.push({id:X,type:"dimensions",setAttributes:!0,dimensions:{width:W+(L?K[0]*L-T:0),height:O+(z?K[1]*z-B:0)}})});return U}function I7(_,Q,J,q,U,G,Z){let F=q?.querySelector(".xyflow__viewport"),X=!1;if(!F)return{changes:[],updatedInternals:X};let Y=[],H=window.getComputedStyle(F),{m22:K}=new window.DOMMatrixReadOnly(H.transform),L=[];for(let z of _.values()){let W=Q.get(z.id);if(!W)continue;if(W.hidden){Q.set(W.id,{...W,internals:{...W.internals,handleBounds:void 0}}),X=!0;continue}let O=U4(z.nodeElement),T=W.measured.width!==O.width||W.measured.height!==O.height;if(!!(O.width&&O.height&&(T||!W.internals.handleBounds||z.force))){let w=z.nodeElement.getBoundingClientRect(),A=G2(W.extent)?W.extent:G,{positionAbsolute:R}=W.internals;if(W.parentId&&W.extent==="parent"){let C=Q.get(W.parentId);if(C)R=K7(R,O,C)}else if(A)R=q2(R,A,O);let I={...W,measured:O,internals:{...W.internals,positionAbsolute:R,handleBounds:{source:a8("source",z.nodeElement,w,K,W.id),target:a8("target",z.nodeElement,w,K,W.id)}}};if(Q.set(W.id,I),W.parentId)N6(I,Q,J,{nodeOrigin:U,zIndexMode:Z});if(X=!0,T){if(Y.push({id:W.id,type:"dimensions",dimensions:O}),W.expandParent&&W.parentId)L.push({id:W.id,parentId:W.parentId,rect:j2(I,U)})}}}if(L.length>0){let z=X4(L,Q,J,U);Y.push(...z)}return{changes:Y,updatedInternals:X}}async function w7({delta:_,panZoom:Q,transform:J,translateExtent:q,width:U,height:G}){if(!Q||!_.x&&!_.y)return!1;let Z=await Q.setViewportConstrained({x:J[0]+_.x,y:J[1]+_.y,zoom:J[2]},[[0,0],[U,G]],q);return!!Z&&(Z.x!==J[0]||Z.y!==J[1]||Z.k!==J[2])}function Q7(_,Q,J,q,U,G){let Z=U,F=q.get(Z)||new Map;q.set(Z,F.set(J,Q)),Z=`${U}-${_}`;let X=q.get(Z)||new Map;if(q.set(Z,X.set(J,Q)),G){Z=`${U}-${_}-${G}`;let Y=q.get(Z)||new Map;q.set(Z,Y.set(J,Q))}}function C6(_,Q,J){_.clear(),Q.clear();for(let q of J){let{source:U,target:G,sourceHandle:Z=null,targetHandle:F=null}=q,X={edgeId:q.id,source:U,target:G,sourceHandle:Z,targetHandle:F},Y=`${U}-${Z}--${G}-${F}`,H=`${G}-${F}--${U}-${Z}`;Q7("source",X,H,_,U,Z),Q7("target",X,Y,_,G,F),Q.set(q.id,q)}}function P7(_,Q){if(!_.parentId)return!1;let J=Q.get(_.parentId);if(!J)return!1;if(J.selected)return!0;return P7(J,Q)}function J7(_,Q,J){let q=_;do{if(q?.matches?.(Q))return!0;if(q===J)return!1;q=q?.parentElement}while(q);return!1}function Rq(_,Q,J,q){let U=new Map;for(let[G,Z]of _)if((Z.selected||Z.id===q)&&(!Z.parentId||!P7(Z,_))&&(Z.draggable||Q&&typeof Z.draggable>"u")){let F=_.get(G);if(F)U.set(G,{id:G,position:F.position||{x:0,y:0},distance:{x:J.x-F.internals.positionAbsolute.x,y:J.y-F.internals.positionAbsolute.y},extent:F.extent,parentId:F.parentId,origin:F.origin,expandParent:F.expandParent,internals:{positionAbsolute:F.internals.positionAbsolute||{x:0,y:0}},measured:{width:F.measured.width??0,height:F.measured.height??0}})}return U}function Q6({nodeId:_,dragItems:Q,nodeLookup:J,dragging:q=!0}){let U=[];for(let[Z,F]of Q){let X=J.get(Z)?.internals.userNode;if(X)U.push({...X,position:F.position,dragging:q})}if(!_)return[U[0],U];let G=J.get(_)?.internals.userNode;return[!G?U[0]:{...G,position:Q.get(_)?.position||G.position,dragging:q},U]}function Oq({dragItems:_,snapGrid:Q,x:J,y:q}){let U=_.values().next().value;if(!U)return null;let G={x:J-U.distance.x,y:q-U.distance.y},Z=V2(G,Q);return{x:Z.x-G.x,y:Z.y-G.y}}function N7({onNodeMouseDown:_,getStoreItems:Q,onDragStart:J,onDrag:q,onDragStop:U}){let G={x:null,y:null},Z=0,F=new Map,X=!1,Y={x:0,y:0},H=null,K=!1,L=null,z=!1,W=!1,O=null;function T({noDragClassName:w,handleSelector:A,domNode:R,isSelectable:I,nodeId:C,nodeClickDistance:P=0}){L=j1(R);function k({x:g,y:h}){let{nodeLookup:S,nodeExtent:b,snapGrid:j,snapToGrid:x,nodeOrigin:V,onNodeDrag:D,onSelectionDrag:f,onError:y,updateNodePositions:p}=Q();G={x:g,y:h};let u=!1,s=F.size>1,t=s&&b?q6(Z2(F)):null,a=s&&x?Oq({dragItems:F,snapGrid:j,x:g,y:h}):null;for(let[d,c]of F){if(!S.has(d))continue;let e={x:g-c.distance.x,y:h-c.distance.y};if(x)e=a?{x:Math.round(e.x+a.x),y:Math.round(e.y+a.y)}:V2(e,j);let Q1=null;if(s&&b&&!c.extent&&t){let{positionAbsolute:Z1}=c.internals,Y1=Z1.x-t.x+b[0][0],K1=Z1.x+c.measured.width-t.x2+b[1][0],o=Z1.y-t.y+b[0][1],z1=Z1.y+c.measured.height-t.y2+b[1][1];Q1=[[Y1,o],[K1,z1]]}let{position:G1,positionAbsolute:$1}=X6({nodeId:d,nextPosition:e,nodeLookup:S,nodeExtent:Q1?Q1:b,nodeOrigin:V,onError:y});u=u||c.position.x!==G1.x||c.position.y!==G1.y,c.position=G1,c.internals.positionAbsolute=$1}if(W=W||u,!u)return;if(p(F,!0),O&&(q||D||!C&&f)){let[d,c]=Q6({nodeId:C,dragItems:F,nodeLookup:S});if(q?.(O,F,d,c),D?.(O,d,c),!C)f?.(O,c)}}async function N(){if(!H)return;let{transform:g,panBy:h,autoPanSpeed:S,autoPanOnNodeDrag:b}=Q();if(!b){X=!1,cancelAnimationFrame(Z);return}let[j,x]=J4(Y,H,S);if(j!==0||x!==0){if(G.x=(G.x??0)-j/g[2],G.y=(G.y??0)-x/g[2],await h({x:j,y:x}))k(G)}Z=requestAnimationFrame(N)}function v(g){let{nodeLookup:h,multiSelectionActive:S,nodesDraggable:b,transform:j,snapGrid:x,snapToGrid:V,selectNodesOnDrag:D,onNodeDragStart:f,onSelectionDragStart:y,unselectNodesAndEdges:p}=Q();if(K=!0,(!D||!I)&&!S&&C){if(!h.get(C)?.selected)p()}if(I&&D&&C)_?.(C);let u=L5(g.sourceEvent,{transform:j,snapGrid:x,snapToGrid:V,containerBounds:H});if(G=u,F=Rq(h,b,u,C),F.size>0&&(J||f||!C&&y)){let[s,t]=Q6({nodeId:C,dragItems:F,nodeLookup:h});if(J?.(g.sourceEvent,F,s,t),f?.(g.sourceEvent,s,t),!C)y?.(g.sourceEvent,t)}}let E=a2().clickDistance(P).on("start",(g)=>{let{domNode:h,nodeDragThreshold:S,transform:b,snapGrid:j,snapToGrid:x}=Q();if(H=h?.getBoundingClientRect()||null,z=!1,W=!1,O=g.sourceEvent,S===0)v(g);G=L5(g.sourceEvent,{transform:b,snapGrid:j,snapToGrid:x,containerBounds:H}),Y=_0(g.sourceEvent,H)}).on("drag",(g)=>{let{autoPanOnNodeDrag:h,transform:S,snapGrid:b,snapToGrid:j,nodeDragThreshold:x,nodeLookup:V}=Q(),D=L5(g.sourceEvent,{transform:S,snapGrid:b,snapToGrid:j,containerBounds:H});if(O=g.sourceEvent,g.sourceEvent.type==="touchmove"&&g.sourceEvent.touches.length>1||C&&!V.has(C))z=!0;if(z)return;if(!X&&h&&K)X=!0,N();if(!K){let f=_0(g.sourceEvent,H),y=f.x-Y.x,p=f.y-Y.y;if(Math.sqrt(y*y+p*p)>x)v(g)}if((G.x!==D.xSnapped||G.y!==D.ySnapped)&&F&&K)Y=_0(g.sourceEvent,H),k(D)}).on("end",(g)=>{if(!K||z){if(z&&F.size>0)Q().updateNodePositions(F,!1);return}if(X=!1,K=!1,cancelAnimationFrame(Z),F.size>0){let{nodeLookup:h,updateNodePositions:S,onNodeDragStop:b,onSelectionDragStop:j}=Q();if(W)S(F,!1),W=!1;if(U||b||!C&&j){let[x,V]=Q6({nodeId:C,dragItems:F,nodeLookup:h,dragging:!1});if(U?.(g.sourceEvent,F,x,V),b?.(g.sourceEvent,x,V),!C)j?.(g.sourceEvent,V)}}}).filter((g)=>{let h=g.target;return!g.button&&(!w||!J7(h,`.${w}`,R))&&(!A||J7(h,A,R))});L.call(E)}function B(){L?.on(".drag",null)}return{update:T,destroy:B}}function fq(_,Q,J){let q=[],U={x:_.x-J,y:_.y-J,width:J*2,height:J*2};for(let G of Q.values())if(W5(U,j2(G))>0)q.push(G);return q}var Iq=250;function wq(_,Q,J,q){let U=[],G=1/0,Z=fq(_,J,Q+Iq);for(let F of Z){let X=[...F.internals.handleBounds?.source??[],...F.internals.handleBounds?.target??[]];for(let Y of X){if(q.nodeId===Y.nodeId&&q.type===Y.type&&q.id===Y.id)continue;let{x:H,y:K}=x0(F,Y,Y.position,!0),L=Math.sqrt(Math.pow(H-_.x,2)+Math.pow(K-_.y,2));if(L>Q)continue;if(L<G)U=[{...Y,x:H,y:K}],G=L;else if(L===G)U.push({...Y,x:H,y:K})}}if(!U.length)return null;if(U.length>1){let F=q.type==="source"?"target":"source";return U.find((X)=>X.type===F)??U[0]}return U[0]}function C7(_,Q,J,q,U,G=!1){let Z=q.get(_);if(!Z)return null;let F=U==="strict"?Z.internals.handleBounds?.[Q]:[...Z.internals.handleBounds?.source??[],...Z.internals.handleBounds?.target??[]],X=(J?F?.find((Y)=>Y.id===J):F?.[0])??null;return X&&G?{...X,...x0(Z,X,X.position,!0)}:X}function S7(_,Q){if(_)return _;else if(Q?.classList.contains("target"))return"target";else if(Q?.classList.contains("source"))return"source";return null}function Pq(_,Q){let J=null;if(Q)J=!0;else if(_&&!Q)J=!1;return J}var k7=()=>!0;function Nq(_,{connectionMode:Q,connectionRadius:J,handleId:q,nodeId:U,edgeUpdaterType:G,isTarget:Z,domNode:F,nodeLookup:X,lib:Y,autoPanOnConnect:H,flowId:K,panBy:L,cancelConnection:z,onConnectStart:W,onConnect:O,onConnectEnd:T,isValidConnection:B=k7,onReconnectEnd:w,updateConnection:A,getTransform:R,getFromHandle:I,autoPanSpeed:C,dragThreshold:P=1,handleDomNode:k}){let N=T6(_.target),v=0,E,{x:g,y:h}=_0(_),S=S7(G,k),b=F?.getBoundingClientRect(),j=!1;if(!b||!S)return;let x=C7(U,S,q,X,Q);if(!x)return;let V=_0(_,b),D=!1,f=null,y=!1,p=null;function u(){if(!H||!b)return;let[G1,$1]=J4(V,b,C);L({x:G1,y:$1}),v=requestAnimationFrame(u)}let s={...x,nodeId:U,type:S,position:x.position},t=X.get(U),d={inProgress:!0,isValid:null,from:x0(t,s,J1.Left,!0),fromHandle:s,fromPosition:s.position,fromNode:t,to:V,toHandle:null,toPosition:r8[s.position],toNode:null,pointer:V};function c(){j=!0,A(d),W?.(_,{nodeId:U,handleId:q,handleType:S})}if(P===0)c();function e(G1){if(!j){let{x:z1,y:q1}=_0(G1),y1=z1-g,c1=q1-h;if(!(y1*y1+c1*c1>P*P))return;c()}if(!I()||!s){Q1(G1);return}let $1=R();if(V=_0(G1,b),E=wq(u2(V,$1,!1,[1,1]),J,X,s),!D)u(),D=!0;let Z1=y7(G1,{handle:E,connectionMode:Q,fromNodeId:U,fromHandleId:q,fromType:Z?"target":"source",isValidConnection:B,doc:N,lib:Y,flowId:K,nodeLookup:X});p=Z1.handleDomNode,f=Z1.connection,y=Pq(!!E,Z1.isValid);let Y1=X.get(U),K1=Y1?x0(Y1,s,J1.Left,!0):d.from,o={...d,from:K1,isValid:y,to:Z1.toHandle&&y?U2({x:Z1.toHandle.x,y:Z1.toHandle.y},$1):V,toHandle:Z1.toHandle,toPosition:y&&Z1.toHandle?Z1.toHandle.position:r8[s.position],toNode:Z1.toHandle?X.get(Z1.toHandle.nodeId):null,pointer:V};A(o),d=o}function Q1(G1){if("touches"in G1&&G1.touches.length>0)return;if(j){if((E||p)&&f&&y)O?.(f);let{inProgress:$1,...Z1}=d,Y1={...Z1,toPosition:d.toHandle?d.toPosition:null};if(T?.(G1,Y1),G)w?.(G1,Y1)}z(),cancelAnimationFrame(v),D=!1,y=!1,f=null,p=null,N.removeEventListener("mousemove",e),N.removeEventListener("mouseup",Q1),N.removeEventListener("touchmove",e),N.removeEventListener("touchend",Q1)}N.addEventListener("mousemove",e),N.addEventListener("mouseup",Q1),N.addEventListener("touchmove",e),N.addEventListener("touchend",Q1)}function y7(_,{handle:Q,connectionMode:J,fromNodeId:q,fromHandleId:U,fromType:G,doc:Z,lib:F,flowId:X,isValidConnection:Y=k7,nodeLookup:H}){let K=G==="target",L=Q?Z.querySelector(`.${F}-flow__handle[data-id="${X}-${Q?.nodeId}-${Q?.id}-${Q?.type}"]`):null,{x:z,y:W}=_0(_),O=Z.elementFromPoint(z,W),T=O?.classList.contains(`${F}-flow__handle`)?O:L,B={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){let w=S7(void 0,T),A=T.getAttribute("data-nodeid"),R=T.getAttribute("data-handleid"),I=T.classList.contains("connectable"),C=T.classList.contains("connectableend");if(!A||!w)return B;let P={source:K?A:q,sourceHandle:K?R:U,target:K?q:A,targetHandle:K?U:R};B.connection=P;let N=I&&C&&(J===E0.Strict?K&&w==="source"||!K&&w==="target":A!==q||R!==U);B.isValid=N&&Y(P),B.toHandle=C7(A,w,R,H,J,!0)}return B}var Y4={onPointerDown:Nq,isValid:y7};function v7({domNode:_,panZoom:Q,getTransform:J,getViewScale:q}){let U=j1(_);function G({translateExtent:F,width:X,height:Y,zoomStep:H=1,pannable:K=!0,zoomable:L=!0,inversePan:z=!1}){let W=(A)=>{if(A.sourceEvent.type!=="wheel"||!Q)return;let R=J(),I=A.sourceEvent.ctrlKey&&b2()?10:1,C=-A.sourceEvent.deltaY*(A.sourceEvent.deltaMode===1?0.05:A.sourceEvent.deltaMode?1:0.002)*H,P=R[2]*Math.pow(2,C*I);Q.scaleTo(P)},O=[0,0],T=(A)=>{if(A.sourceEvent.type==="mousedown"||A.sourceEvent.type==="touchstart")O=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY]},B=(A)=>{let R=J();if(A.sourceEvent.type!=="mousemove"&&A.sourceEvent.type!=="touchmove"||!Q)return;let I=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY],C=[I[0]-O[0],I[1]-O[1]];O=I;let P=q()*Math.max(R[2],Math.log(R[2]))*(z?-1:1),k={x:R[0]-C[0]*P,y:R[1]-C[1]*P},N=[[0,0],[X,Y]];Q.setViewportConstrained({x:k.x,y:k.y,zoom:R[2]},N,F)},w=Y5().on("start",T).on("zoom",K?B:null).on("zoom.wheel",L?W:null);U.call(w,{})}function Z(){U.on("zoom",null)}return{update:G,destroy:Z,pointer:x1}}var L4=(_)=>({x:_.x,y:_.y,zoom:_.k}),J6=({x:_,y:Q,zoom:J})=>Q2.translate(_,Q).scale(J),h0=(_,Q)=>_.target.closest(`.${Q}`),j7=(_,Q)=>Q===2&&Array.isArray(_)&&_.includes(2),Cq=(_)=>((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2,$6=(_,Q=0,J=Cq,q=()=>{})=>{let U=typeof Q==="number"&&Q>0;if(!U)q();return U?_.transition().duration(Q).ease(J).on("end",q):_},V7=(_)=>{let Q=_.ctrlKey&&b2()?10:1;return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*Q};function Sq({zoomPanValues:_,noWheelClassName:Q,d3Selection:J,d3Zoom:q,panOnScrollMode:U,panOnScrollSpeed:G,zoomOnPinch:Z,onPanZoomStart:F,onPanZoom:X,onPanZoomEnd:Y}){return(H)=>{if(h0(H,Q)){if(H.ctrlKey)H.preventDefault();return!1}H.preventDefault(),H.stopImmediatePropagation();let K=J.property("__zoom").k||1;if(H.ctrlKey&&Z){let T=x1(H),B=V7(H),w=K*Math.pow(2,B);q.scaleTo(J,w,T,H);return}let L=H.deltaMode===1?20:1,z=U===I0.Vertical?0:H.deltaX*L,W=U===I0.Horizontal?0:H.deltaY*L;if(!b2()&&H.shiftKey&&U!==I0.Vertical)z=H.deltaY*L,W=0;q.translateBy(J,-(z/K)*G,-(W/K)*G,{internal:!0});let O=L4(J.property("__zoom"));if(clearTimeout(_.panScrollTimeout),!_.isPanScrolling)_.isPanScrolling=!0,F?.(H,O);else X?.(H,O);_.panScrollTimeout=setTimeout(()=>{Y?.(H,O),_.isPanScrolling=!1},150)}}function kq({noWheelClassName:_,preventScrolling:Q,d3ZoomHandler:J}){return function(q,U){let G=q.type==="wheel",Z=!Q&&G&&!q.ctrlKey,F=h0(q,_);if(q.ctrlKey&&G&&F)q.preventDefault();if(Z||F)return null;q.preventDefault(),J.call(this,q,U)}}function yq({zoomPanValues:_,onDraggingChange:Q,onPanZoomStart:J}){return(q)=>{if(q.sourceEvent?.internal)return;let U=L4(q.transform);if(_.mouseButton=q.sourceEvent?.button||0,_.isZoomingOrPanning=!0,_.prevViewport=U,q.sourceEvent?.type==="mousedown")Q(!0);if(J)J?.(q.sourceEvent,U)}}function vq({zoomPanValues:_,panOnDrag:Q,onPaneContextMenu:J,onTransformChange:q,onPanZoom:U}){return(G)=>{if(_.usedRightMouseButton=!!(J&&j7(Q,_.mouseButton??0)),!G.sourceEvent?.sync)q([G.transform.x,G.transform.y,G.transform.k]);if(U&&!G.sourceEvent?.internal)U?.(G.sourceEvent,L4(G.transform))}}function jq({zoomPanValues:_,panOnDrag:Q,panOnScroll:J,onDraggingChange:q,onPanZoomEnd:U,onPaneContextMenu:G}){return(Z)=>{if(Z.sourceEvent?.internal)return;if(_.isZoomingOrPanning=!1,G&&j7(Q,_.mouseButton??0)&&!_.usedRightMouseButton&&Z.sourceEvent)G(Z.sourceEvent);if(_.usedRightMouseButton=!1,q(!1),U){let F=L4(Z.transform);_.prevViewport=F,clearTimeout(_.timerId),_.timerId=setTimeout(()=>{U?.(Z.sourceEvent,F)},J?150:0)}}}function Vq({panActivationKeyPressed:_,zoomActivationKeyPressed:Q,zoomOnScroll:J,zoomOnPinch:q,panOnDrag:U,panOnScroll:G,zoomOnDoubleClick:Z,userSelectionActive:F,noWheelClassName:X,noPanClassName:Y,lib:H,connectionInProgress:K}){return(L)=>{let z=Q||J,W=q&&L.ctrlKey,O=L.type==="wheel";if(L.button===1&&L.type==="mousedown"&&(h0(L,`${H}-flow__node`)||h0(L,`${H}-flow__edge`)||h0(L,`${H}-flow__selection`)||h0(L,`${H}-flow__nodesselection`)))return!0;if(!U&&!z&&!G&&!Z&&!q)return!1;if(F)return!1;if(K&&!O)return!1;if(h0(L,X)&&O)return!1;if(h0(L,Y)&&(!O||G&&O&&!Q))return!1;if(!q&&L.ctrlKey&&O)return!1;if(!q&&L.type==="touchstart"&&L.touches?.length>1)return L.preventDefault(),!1;if(!z&&!G&&!W&&O)return!1;if(!U&&(L.type==="mousedown"||L.type==="touchstart"))return!1;if(Array.isArray(U)&&!U.includes(L.button)&&L.type==="mousedown")return!1;let T=Array.isArray(U)&&U.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||O||_)&&T}}function u7({domNode:_,minZoom:Q,maxZoom:J,translateExtent:q,viewport:U,onPanZoom:G,onPanZoomStart:Z,onPanZoomEnd:F,onDraggingChange:X}){let Y={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},H=_.getBoundingClientRect(),K=[[0,0],[H.width,H.height]];(typeof ResizeObserver<"u"?new ResizeObserver((h)=>{let S=h[0];if(S)K=[[0,0],[S.contentRect.width,S.contentRect.height]]}):null)?.observe(_);let z=Y5().extent(()=>K).scaleExtent([Q,J]).translateExtent(q),W=j1(_).call(z);R({x:U.x,y:U.y,zoom:y2(U.zoom,Q,J)},[[0,0],[H.width,H.height]],q);let O=W.on("wheel.zoom"),T=W.on("dblclick.zoom");z.wheelDelta(V7);async function B(h,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?z0:e0).transform($6(W,S?.duration,S?.ease,()=>b(!0)),h)});return!1}function w({noWheelClassName:h,noPanClassName:S,onPaneContextMenu:b,userSelectionActive:j,panOnScroll:x,panOnDrag:V,panOnScrollMode:D,panOnScrollSpeed:f,preventScrolling:y,zoomOnPinch:p,zoomOnScroll:u,zoomOnDoubleClick:s,panActivationKeyPressed:t=!1,zoomActivationKeyPressed:a,lib:d,onTransformChange:c,connectionInProgress:e,paneClickDistance:Q1,selectionOnDrag:G1}){if(j&&!Y.isZoomingOrPanning)A();let $1=x&&!a&&!j;z.clickDistance(G1?1/0:!e1(Q1)||Q1<0?0:Q1);let Z1=$1?Sq({zoomPanValues:Y,noWheelClassName:h,d3Selection:W,d3Zoom:z,panOnScrollMode:D,panOnScrollSpeed:f,zoomOnPinch:p,onPanZoomStart:Z,onPanZoom:G,onPanZoomEnd:F}):kq({noWheelClassName:h,preventScrolling:y,d3ZoomHandler:O});W.on("wheel.zoom",Z1,{passive:!1});let Y1=yq({zoomPanValues:Y,onDraggingChange:X,onPanZoomStart:Z});z.on("start",Y1);let K1=vq({zoomPanValues:Y,panOnDrag:V,onPaneContextMenu:!!b,onPanZoom:G,onTransformChange:c});z.on("zoom",K1);let o=jq({zoomPanValues:Y,panOnDrag:V,panOnScroll:x,onPaneContextMenu:b,onPanZoomEnd:F,onDraggingChange:X});z.on("end",o);let z1=Vq({panActivationKeyPressed:t,zoomActivationKeyPressed:a,panOnDrag:V,zoomOnScroll:u,panOnScroll:x,zoomOnDoubleClick:s,zoomOnPinch:p,userSelectionActive:j,noPanClassName:S,noWheelClassName:h,lib:d,connectionInProgress:e});if(z.filter(z1),s)W.on("dblclick.zoom",T);else W.on("dblclick.zoom",null)}function A(){z.on("zoom",null)}async function R(h,S,b){let j=J6(h),x=z?.constrain()(j,S,b);if(x)await B(x);return x}async function I(h,S){let b=J6(h);return await B(b,S),b}function C(h){if(W){let S=J6(h),b=W.property("__zoom");if(b.k!==h.zoom||b.x!==h.x||b.y!==h.y)z?.transform(W,S,null,{sync:!0})}}function P(){let h=W?X5(W.node()):{x:0,y:0,k:1};return{x:h.x,y:h.y,zoom:h.k}}async function k(h,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?z0:e0).scaleTo($6(W,S?.duration,S?.ease,()=>b(!0)),h)});return!1}async function N(h,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?z0:e0).scaleBy($6(W,S?.duration,S?.ease,()=>b(!0)),h)});return!1}function v(h){z?.scaleExtent(h)}function E(h){z?.translateExtent(h)}function g(h){let S=!e1(h)||h<0?0:h;z?.clickDistance(S)}return{update:w,destroy:A,setViewport:I,setViewportConstrained:R,getViewport:P,scaleTo:k,scaleBy:N,setScaleExtent:v,setTranslateExtent:E,syncViewport:C,setClickDistance:g}}var m0;(function(_){_.Line="line",_.Handle="handle"})(m0||(m0={}));function uq({width:_,prevWidth:Q,height:J,prevHeight:q,affectsX:U,affectsY:G}){let Z=_-Q,F=J-q,X=[Z>0?1:Z<0?-1:0,F>0?1:F<0?-1:0];if(Z&&U)X[0]=X[0]*-1;if(F&&G)X[1]=X[1]*-1;return X}function $7(_){let Q=_.includes("right")||_.includes("left"),J=_.includes("bottom")||_.includes("top"),q=_.includes("left"),U=_.includes("top");return{isHorizontal:Q,isVertical:J,affectsX:q,affectsY:U}}function b0(_,Q){return Math.max(0,Q-_)}function D0(_,Q){return Math.max(0,_-Q)}function e5(_,Q,J){return Math.max(0,Q-_,_-J)}function q7(_,Q){return _?!Q:Q}function bq(_,Q,J,q,U,G,Z,F){let{affectsX:X,affectsY:Y}=Q,{isHorizontal:H,isVertical:K}=Q,L=H&&K,{xSnapped:z,ySnapped:W}=J,{minWidth:O,maxWidth:T,minHeight:B,maxHeight:w}=q,{x:A,y:R,width:I,height:C,aspectRatio:P}=_,k=Math.floor(H?z-_.pointerX:0),N=Math.floor(K?W-_.pointerY:0),v=I+(X?-k:k),E=C+(Y?-N:N),g=-G[0]*I,h=-G[1]*C,S=e5(v,O,T),b=e5(E,B,w);if(Z){let V=0,D=0;if(X&&k<0)V=b0(A+k+g,Z[0][0]);else if(!X&&k>0)V=D0(A+v+g,Z[1][0]);if(Y&&N<0)D=b0(R+N+h,Z[0][1]);else if(!Y&&N>0)D=D0(R+E+h,Z[1][1]);S=Math.max(S,V),b=Math.max(b,D)}if(F){let V=0,D=0;if(X&&k>0)V=D0(A+k,F[0][0]);else if(!X&&k<0)V=b0(A+v,F[1][0]);if(Y&&N>0)D=D0(R+N,F[0][1]);else if(!Y&&N<0)D=b0(R+E,F[1][1]);S=Math.max(S,V),b=Math.max(b,D)}if(U){if(H){let V=e5(v/P,B,w)*P;if(S=Math.max(S,V),Z){let D=0;if(!X&&!Y||X&&!Y&&L)D=D0(R+h+v/P,Z[1][1])*P;else D=b0(R+h+(X?k:-k)/P,Z[0][1])*P;S=Math.max(S,D)}if(F){let D=0;if(!X&&!Y||X&&!Y&&L)D=b0(R+v/P,F[1][1])*P;else D=D0(R+(X?k:-k)/P,F[0][1])*P;S=Math.max(S,D)}}if(K){let V=e5(E*P,O,T)/P;if(b=Math.max(b,V),Z){let D=0;if(!X&&!Y||Y&&!X&&L)D=D0(A+E*P+g,Z[1][0])/P;else D=b0(A+(Y?N:-N)*P+g,Z[0][0])/P;b=Math.max(b,D)}if(F){let D=0;if(!X&&!Y||Y&&!X&&L)D=b0(A+E*P,F[1][0])/P;else D=D0(A+(Y?N:-N)*P,F[0][0])/P;b=Math.max(b,D)}}}if(N=N+(N<0?b:-b),k=k+(k<0?S:-S),U)if(L)if(v>E*P)N=(q7(X,Y)?-k:k)/P;else k=(q7(X,Y)?-N:N)*P;else if(H)N=k/P,Y=X;else k=N*P,X=Y;let j=X?A+k:A,x=Y?R+N:R;return{width:I+(X?-k:k),height:C+(Y?-N:N),x:G[0]*k*(!X?1:-1)+j,y:G[1]*N*(!Y?1:-1)+x}}var b7={width:0,height:0,x:0,y:0},Dq={...b7,pointerX:0,pointerY:0,aspectRatio:1};function hq(_,Q,J){let q=Q.position.x+_.position.x,U=Q.position.y+_.position.y,G=_.measured.width??0,Z=_.measured.height??0,F=J[0]*G,X=J[1]*Z;return[[q-F,U-X],[q+G-F,U+Z-X]]}function D7({domNode:_,nodeId:Q,getStoreItems:J,onChange:q,onEnd:U}){let G=j1(_),Z={controlDirection:$7("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function F({controlPosition:Y,boundaries:H,keepAspectRatio:K,resizeDirection:L,onResizeStart:z,onResize:W,onResizeEnd:O,shouldResize:T}){let B={...b7},w={...Dq};Z={boundaries:H,resizeDirection:L,keepAspectRatio:K,controlDirection:$7(Y)};let A=void 0,R=null,I=[],C=void 0,P=void 0,k=void 0,N=a2().on("start",(v)=>{let{nodeLookup:E,transform:g,snapGrid:h,snapToGrid:S,nodeOrigin:b,paneDomNode:j}=J();if(A=E.get(Q),!A)return;R=j?.getBoundingClientRect()??null;let{xSnapped:x,ySnapped:V}=L5(v.sourceEvent,{transform:g,snapGrid:h,snapToGrid:S,containerBounds:R});if(B={width:A.measured.width??0,height:A.measured.height??0,x:A.position.x??0,y:A.position.y??0},w={...B,pointerX:x,pointerY:V,aspectRatio:B.width/B.height},C=void 0,P=G2(A.extent)?A.extent:void 0,A.parentId&&(A.extent==="parent"||A.expandParent))C=E.get(A.parentId);if(C&&A.extent==="parent")P=[[0,0],[C.measured.width,C.measured.height]];I=[],k=void 0;for(let[D,f]of E)if(f.parentId===Q){if(I.push({id:D,position:{...f.position},extent:f.extent}),f.extent==="parent"||f.expandParent){let y=hq(f,A,f.origin??b);if(k)k=[[Math.min(y[0][0],k[0][0]),Math.min(y[0][1],k[0][1])],[Math.max(y[1][0],k[1][0]),Math.max(y[1][1],k[1][1])]];else k=y}}z?.(v,{...B})}).on("drag",(v)=>{let{transform:E,snapGrid:g,snapToGrid:h,nodeOrigin:S}=J(),b=L5(v.sourceEvent,{transform:E,snapGrid:g,snapToGrid:h,containerBounds:R}),j=[];if(!A)return;let{x,y:V,width:D,height:f}=B,y={},p=A.origin??S,{width:u,height:s,x:t,y:a}=bq(w,Z.controlDirection,b,Z.boundaries,Z.keepAspectRatio,p,P,k),d=u!==D,c=s!==f,e=t!==x&&d,Q1=a!==V&&c;if(!e&&!Q1&&!d&&!c)return;let G1={prevValues:{...B},startX:w.x,startY:w.y,childNodes:I.map((K1)=>({...K1,position:{...K1.position}}))};if(e||Q1||p[0]===1||p[1]===1){if(y.x=e?t:B.x,y.y=Q1?a:B.y,B.x=y.x,B.y=y.y,I.length>0){let K1=t-x,o=a-V;for(let z1 of I)z1.position={x:z1.position.x-K1+p[0]*(u-D),y:z1.position.y-o+p[1]*(s-f)},j.push(z1)}}if(d||c)y.width=d&&(!Z.resizeDirection||Z.resizeDirection==="horizontal")?u:B.width,y.height=c&&(!Z.resizeDirection||Z.resizeDirection==="vertical")?s:B.height,B.width=y.width,B.height=y.height;if(C&&A.expandParent){let K1=p[0]*(y.width??0);if(y.x&&y.x<K1)B.x=K1,w.x=w.x-(y.x-K1);let o=p[1]*(y.height??0);if(y.y&&y.y<o)B.y=o,w.y=w.y-(y.y-o)}let $1=uq({width:B.width,prevWidth:D,height:B.height,prevHeight:f,affectsX:Z.controlDirection.affectsX,affectsY:Z.controlDirection.affectsY}),Z1={...B,direction:$1};if(T?.(v,Z1)===!1){B=G1.prevValues,w.x=G1.startX,w.y=G1.startY,I.forEach((K1,o)=>{K1.position=G1.childNodes[o].position});return}W?.(v,Z1),q(y,j)}).on("end",(v)=>{O?.(v,{...B}),U?.({...B})});G.call(N)}function X(){G.on(".drag",null)}return{update:F,destroy:X}}var p7=h1(X0(),1),c7=h1(E7(),1);var x7=(_)=>{let Q,J=new Set,q=(H,K)=>{let L=typeof H==="function"?H(Q):H;if(!Object.is(L,Q)){let z=Q;Q=(K!=null?K:typeof L!=="object"||L===null)?L:Object.assign({},Q,L),J.forEach((W)=>W(Q,z))}},U=()=>Q,X={setState:q,getState:U,getInitialState:()=>Y,subscribe:(H)=>{return J.add(H),()=>J.delete(H)},destroy:()=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production")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.");J.clear()}},Y=Q=_(q,U,X);return X},m7=(_)=>_?x7(_):x7;var{useDebugValue:mq}=p7.default,{useSyncExternalStoreWithSelector:gq}=c7.default,pq=(_)=>_;function S6(_,Q=pq,J){let q=gq(_.subscribe,_.getState,_.getServerState||_.getInitialState,Q,J);return mq(q),q}var g7=(_,Q)=>{let J=m7(_),q=(U,G=Q)=>S6(J,U,G);return Object.assign(q,J),q},l7=(_,Q)=>_?g7(_,Q):g7;function P1(_,Q){if(Object.is(_,Q))return!0;if(typeof _!=="object"||_===null||typeof Q!=="object"||Q===null)return!1;if(_ instanceof Map&&Q instanceof Map){if(_.size!==Q.size)return!1;for(let[q,U]of _)if(!Object.is(U,Q.get(q)))return!1;return!0}if(_ instanceof Set&&Q instanceof Set){if(_.size!==Q.size)return!1;for(let q of _)if(!Q.has(q))return!1;return!0}let J=Object.keys(_);if(J.length!==Object.keys(Q).length)return!1;for(let q of J)if(!Object.prototype.hasOwnProperty.call(Q,q)||!Object.is(_[q],Q[q]))return!1;return!0}var R9=h1(d7(),1),M4=r.createContext(null),rq=M4.Provider,O9=i1.error001("react");function M1(_,Q){let J=r.useContext(M4);if(J===null)throw Error(O9);return S6(J,_,Q)}function N1(){let _=r.useContext(M4);if(_===null)throw Error(O9);return r.useMemo(()=>({getState:_.getState,setState:_.setState,subscribe:_.subscribe}),[_])}var a7={display:"none"},iq={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},f9="react-flow__node-desc",I9="react-flow__edge-desc",dq="react-flow__aria-live",aq=(_)=>_.ariaLiveMessage,sq=(_)=>_.ariaLabelConfig;function tq({rfId:_}){let Q=M1(aq);return l.jsx("div",{id:`${dq}-${_}`,"aria-live":"assertive","aria-atomic":"true",style:iq,children:Q})}function oq({rfId:_,disableKeyboardA11y:Q}){let J=M1(sq);return l.jsxs(l.Fragment,{children:[l.jsx("div",{id:`${f9}-${_}`,style:a7,children:Q?J["node.a11yDescription.default"]:J["node.a11yDescription.keyboardDisabled"]}),l.jsx("div",{id:`${I9}-${_}`,style:a7,children:J["edge.a11yDescription.default"]}),!Q&&l.jsx(tq,{rfId:_})]})}var K2=r.forwardRef(({position:_="top-left",children:Q,className:J,style:q,...U},G)=>{let Z=`${_}`.split("-");return l.jsx("div",{className:C1(["react-flow__panel",J,...Z]),style:q,ref:G,...U,children:Q})});K2.displayName="Panel";var s7="https://reactflow.dev/attribution";function nq({proOptions:_,position:Q="bottom-right"}){if(r.useEffect(()=>{L7("react")},[]),_?.hideAttribution)return null;return l.jsx(K2,{position:Q,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${s7}`,children:l.jsx("a",{href:s7,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var eq=(_)=>{let Q=[],J=[];for(let[,q]of _.nodeLookup)if(q.selected)Q.push(q.internals.userNode);for(let[,q]of _.edgeLookup)if(q.selected)J.push(q);return{selectedNodes:Q,selectedEdges:J}},z4=(_)=>_.id;function _U(_,Q){return P1(_.selectedNodes.map(z4),Q.selectedNodes.map(z4))&&P1(_.selectedEdges.map(z4),Q.selectedEdges.map(z4))}function QU({onSelectionChange:_}){let Q=N1(),{selectedNodes:J,selectedEdges:q}=M1(eq,_U);return r.useEffect(()=>{let U={nodes:J,edges:q};_?.(U),Q.getState().onSelectionChangeHandlers.forEach((G)=>G(U))},[J,q,_]),null}var JU=(_)=>!!_.onSelectionChangeHandlers;function $U({onSelectionChange:_}){let Q=M1(JU);if(_||Q)return l.jsx(QU,{onSelectionChange:_});return null}var w9=[0,0],qU={x:0,y:0,zoom:1},UU=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],t7=[...UU,"rfId"],GU=(_)=>({setNodes:_.setNodes,setEdges:_.setEdges,setMinZoom:_.setMinZoom,setMaxZoom:_.setMaxZoom,setTranslateExtent:_.setTranslateExtent,setNodeExtent:_.setNodeExtent,reset:_.reset,setDefaultNodesAndEdges:_.setDefaultNodesAndEdges}),o7={translateExtent:v2,nodeOrigin:w9,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function ZU(_){let{setNodes:Q,setEdges:J,setMinZoom:q,setMaxZoom:U,setTranslateExtent:G,setNodeExtent:Z,reset:F,setDefaultNodesAndEdges:X}=M1(GU,P1),Y=N1();r.useEffect(()=>{return X(_.defaultNodes,_.defaultEdges),()=>{H.current=o7,F()}},[]);let H=r.useRef(o7);return r.useEffect(()=>{for(let K of t7){let L=_[K],z=H.current[K];if(L===z)continue;if(typeof _[K]>"u")continue;if(K==="nodes")Q(L);else if(K==="edges")J(L);else if(K==="minZoom")q(L);else if(K==="maxZoom")U(L);else if(K==="translateExtent")G(L);else if(K==="nodeExtent")Z(L);else if(K==="ariaLabelConfig")Y.setState({ariaLabelConfig:Y7(L)});else if(K==="fitView")Y.setState({fitViewQueued:L});else if(K==="fitViewOptions")Y.setState({fitViewOptions:L});else Y.setState({[K]:L})}H.current=_},t7.map((K)=>_[K])),null}function n7(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function FU(_){let[Q,J]=r.useState(_==="system"?null:_);return r.useEffect(()=>{if(_!=="system"){J(_);return}let q=n7(),U=()=>J(q?.matches?"dark":"light");return U(),q?.addEventListener("change",U),()=>{q?.removeEventListener("change",U)}},[_]),Q!==null?Q:n7()?.matches?"dark":"light"}var e7=typeof document<"u"?document:null;function M5(_=null,Q={target:e7,actInsideInputWithModifier:!0}){let[J,q]=r.useState(!1),U=r.useRef(!1),G=r.useRef(new Set([])),[Z,F]=r.useMemo(()=>{if(_!==null){let Y=(Array.isArray(_)?_:[_]).filter((K)=>typeof K==="string").map((K)=>K.replace(/\+/g,`
27
+ <%s key={someKey} {...props} />`,u,a,d,a),D[a+u]=!0)}if(a=null,p!==void 0&&(J(p),a=""+p),Z(y)&&(J(y.key),a=""+y.key),"key"in y){p={};for(var c in y)c!=="key"&&(p[c]=y[c])}else p=y;return a&&F(p,typeof f==="function"?f.displayName||f.name||"Unknown":f),Y(f,a,p,U(),s,t)}function K(f){L(f)?f._store&&(f._store.validated=1):typeof f==="object"&&f!==null&&f.$$typeof===k&&(f._payload.status==="fulfilled"?L(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function L(f){return typeof f==="object"&&f!==null&&f.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),v=Symbol.for("react.client.reference"),E=H2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,g=Object.prototype.hasOwnProperty,h=Array.isArray,S=console.createTask?console.createTask:function(){return null};H2={react_stack_bottom_frame:function(f){return f()}};var b,j={},x=H2.react_stack_bottom_frame.bind(H2,G)(),V=S(q(G)),D={};XZ.Fragment=O,XZ.jsxDEV=function(f,y,p,u){var s=1e4>E.recentlyCreatedOwnerStacks++;return X(f,y,p,u,s?Error("react-stack-top-frame"):x,s?S(q(f)):V)}})()});var i=h1(X0(),1);var l=h1(G8(),1),r=h1(X0(),1);function C1(_){if(typeof _==="string"||typeof _==="number")return""+_;let Q="";if(Array.isArray(_)){for(let J=0,q;J<_.length;J++)if((q=C1(_[J]))!=="")Q+=(Q&&" ")+q}else for(let J in _)if(_[J])Q+=(Q&&" ")+J;return Q}var lQ={value:()=>{}};function F8(){for(var _=0,Q=arguments.length,J={},q;_<Q;++_){if(!(q=arguments[_]+"")||q in J||/[\s.]/.test(q))throw Error("illegal type: "+q);J[q]=[]}return new y5(J)}function y5(_){this._=_}function rQ(_,Q){return _.trim().split(/^|\s+/).map(function(J){var q="",U=J.indexOf(".");if(U>=0)q=J.slice(U+1),J=J.slice(0,U);if(J&&!Q.hasOwnProperty(J))throw Error("unknown type: "+J);return{type:J,name:q}})}y5.prototype=F8.prototype={constructor:y5,on:function(_,Q){var J=this._,q=rQ(_+"",J),U,G=-1,Z=q.length;if(arguments.length<2){while(++G<Z)if((U=(_=q[G]).type)&&(U=iQ(J[U],_.name)))return U;return}if(Q!=null&&typeof Q!=="function")throw Error("invalid callback: "+Q);while(++G<Z)if(U=(_=q[G]).type)J[U]=Z8(J[U],_.name,Q);else if(Q==null)for(U in J)J[U]=Z8(J[U],_.name,null);return this},copy:function(){var _={},Q=this._;for(var J in Q)_[J]=Q[J].slice();return new y5(_)},call:function(_,Q){if((U=arguments.length-2)>0)for(var J=Array(U),q=0,U,G;q<U;++q)J[q]=arguments[q+2];if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(G=this._[_],q=0,U=G.length;q<U;++q)G[q].value.apply(Q,J)},apply:function(_,Q,J){if(!this._.hasOwnProperty(_))throw Error("unknown type: "+_);for(var q=this._[_],U=0,G=q.length;U<G;++U)q[U].value.apply(Q,J)}};function iQ(_,Q){for(var J=0,q=_.length,U;J<q;++J)if((U=_[J]).name===Q)return U.value}function Z8(_,Q,J){for(var q=0,U=_.length;q<U;++q)if(_[q].name===Q){_[q]=lQ,_=_.slice(0,q).concat(_.slice(q+1));break}if(J!=null)_.push({name:Q,value:J});return _}var a0=F8;function R2(_){return function(){return this.matches(_)}}function v5(_){return function(Q){return Q.matches(_)}}var j5="http://www.w3.org/1999/xhtml",V4={svg:"http://www.w3.org/2000/svg",xhtml:j5,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Y0(_){var Q=_+="",J=Q.indexOf(":");if(J>=0&&(Q=_.slice(0,J))!=="xmlns")_=_.slice(J+1);return V4.hasOwnProperty(Q)?{space:V4[Q],local:_}:_}function u4(_){let Q;while(Q=_.sourceEvent)_=Q;return _}function x1(_,Q){if(_=u4(_),Q===void 0)Q=_.currentTarget;if(Q){var J=Q.ownerSVGElement||Q;if(J.createSVGPoint){var q=J.createSVGPoint();return q.x=_.clientX,q.y=_.clientY,q=q.matrixTransform(Q.getScreenCTM().inverse()),[q.x,q.y]}if(Q.getBoundingClientRect){var U=Q.getBoundingClientRect();return[_.clientX-U.left-Q.clientLeft,_.clientY-U.top-Q.clientTop]}}return[_.pageX,_.pageY]}function dQ(){}function j0(_){return _==null?dQ:function(){return this.querySelector(_)}}function b4(_){if(typeof _!=="function")_=j0(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=Array(Z),H,Y,X=0;X<Z;++X)if((H=G[X])&&(Y=_.call(H,H.__data__,X,G))){if("__data__"in H)Y.__data__=H.__data__;F[X]=Y}return new S1(q,this._parents)}function D4(_){return _==null?[]:Array.isArray(_)?_:Array.from(_)}function aQ(){return[]}function O2(_){return _==null?aQ:function(){return this.querySelectorAll(_)}}function sQ(_){return function(){return D4(_.apply(this,arguments))}}function h4(_){if(typeof _==="function")_=sQ(_);else _=O2(_);for(var Q=this._groups,J=Q.length,q=[],U=[],G=0;G<J;++G)for(var Z=Q[G],F=Z.length,H,Y=0;Y<F;++Y)if(H=Z[Y])q.push(_.call(H,H.__data__,Y,Z)),U.push(H);return new S1(q,U)}var tQ=Array.prototype.find;function oQ(_){return function(){return tQ.call(this.children,_)}}function nQ(){return this.firstElementChild}function E4(_){return this.select(_==null?nQ:oQ(typeof _==="function"?_:v5(_)))}var eQ=Array.prototype.filter;function _J(){return Array.from(this.children)}function QJ(_){return function(){return eQ.call(this.children,_)}}function x4(_){return this.selectAll(_==null?_J:QJ(typeof _==="function"?_:v5(_)))}function m4(_){if(typeof _!=="function")_=R2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],H,Y=0;Y<Z;++Y)if((H=G[Y])&&_.call(H,H.__data__,Y,G))F.push(H);return new S1(q,this._parents)}function p2(_){return Array(_.length)}function g4(){return new S1(this._enter||this._groups.map(p2),this._parents)}function c2(_,Q){this.ownerDocument=_.ownerDocument,this.namespaceURI=_.namespaceURI,this._next=null,this._parent=_,this.__data__=Q}c2.prototype={constructor:c2,appendChild:function(_){return this._parent.insertBefore(_,this._next)},insertBefore:function(_,Q){return this._parent.insertBefore(_,Q)},querySelector:function(_){return this._parent.querySelector(_)},querySelectorAll:function(_){return this._parent.querySelectorAll(_)}};function p4(_){return function(){return _}}function JJ(_,Q,J,q,U,G){var Z=0,F,H=Q.length,Y=G.length;for(;Z<Y;++Z)if(F=Q[Z])F.__data__=G[Z],q[Z]=F;else J[Z]=new c2(_,G[Z]);for(;Z<H;++Z)if(F=Q[Z])U[Z]=F}function $J(_,Q,J,q,U,G,Z){var F,H,Y=new Map,X=Q.length,K=G.length,L=Array(X),z;for(F=0;F<X;++F)if(H=Q[F])if(L[F]=z=Z.call(H,H.__data__,F,Q)+"",Y.has(z))U[F]=H;else Y.set(z,H);for(F=0;F<K;++F)if(z=Z.call(_,G[F],F,G)+"",H=Y.get(z))q[F]=H,H.__data__=G[F],Y.delete(z);else J[F]=new c2(_,G[F]);for(F=0;F<X;++F)if((H=Q[F])&&Y.get(L[F])===H)U[F]=H}function qJ(_){return _.__data__}function c4(_,Q){if(!arguments.length)return Array.from(this,qJ);var J=Q?$J:JJ,q=this._parents,U=this._groups;if(typeof _!=="function")_=p4(_);for(var G=U.length,Z=Array(G),F=Array(G),H=Array(G),Y=0;Y<G;++Y){var X=q[Y],K=U[Y],L=K.length,z=UJ(_.call(X,X&&X.__data__,Y,q)),W=z.length,O=F[Y]=Array(W),T=Z[Y]=Array(W),B=H[Y]=Array(L);J(X,K,O,T,B,z,Q);for(var w=0,A=0,R,I;w<W;++w)if(R=O[w]){if(w>=A)A=w+1;while(!(I=T[A])&&++A<W);R._next=I||null}}return Z=new S1(Z,q),Z._enter=F,Z._exit=H,Z}function UJ(_){return typeof _==="object"&&"length"in _?_:Array.from(_)}function l4(){return new S1(this._exit||this._groups.map(p2),this._parents)}function r4(_,Q,J){var q=this.enter(),U=this,G=this.exit();if(typeof _==="function"){if(q=_(q),q)q=q.selection()}else q=q.append(_+"");if(Q!=null){if(U=Q(U),U)U=U.selection()}if(J==null)G.remove();else J(G);return q&&U?q.merge(U).order():U}function i4(_){var Q=_.selection?_.selection():_;for(var J=this._groups,q=Q._groups,U=J.length,G=q.length,Z=Math.min(U,G),F=Array(U),H=0;H<Z;++H)for(var Y=J[H],X=q[H],K=Y.length,L=F[H]=Array(K),z,W=0;W<K;++W)if(z=Y[W]||X[W])L[W]=z;for(;H<U;++H)F[H]=J[H];return new S1(F,this._parents)}function d4(){for(var _=this._groups,Q=-1,J=_.length;++Q<J;)for(var q=_[Q],U=q.length-1,G=q[U],Z;--U>=0;)if(Z=q[U]){if(G&&Z.compareDocumentPosition(G)^4)G.parentNode.insertBefore(Z,G);G=Z}return this}function a4(_){if(!_)_=GJ;function Q(K,L){return K&&L?_(K.__data__,L.__data__):!K-!L}for(var J=this._groups,q=J.length,U=Array(q),G=0;G<q;++G){for(var Z=J[G],F=Z.length,H=U[G]=Array(F),Y,X=0;X<F;++X)if(Y=Z[X])H[X]=Y;H.sort(Q)}return new S1(U,this._parents).order()}function GJ(_,Q){return _<Q?-1:_>Q?1:_>=Q?0:NaN}function s4(){var _=arguments[0];return arguments[0]=this,_.apply(null,arguments),this}function t4(){return Array.from(this)}function o4(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length;U<G;++U){var Z=q[U];if(Z)return Z}return null}function n4(){let _=0;for(let Q of this)++_;return _}function e4(){return!this.node()}function _3(_){for(var Q=this._groups,J=0,q=Q.length;J<q;++J)for(var U=Q[J],G=0,Z=U.length,F;G<Z;++G)if(F=U[G])_.call(F,F.__data__,G,U);return this}function ZJ(_){return function(){this.removeAttribute(_)}}function FJ(_){return function(){this.removeAttributeNS(_.space,_.local)}}function KJ(_,Q){return function(){this.setAttribute(_,Q)}}function HJ(_,Q){return function(){this.setAttributeNS(_.space,_.local,Q)}}function XJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttribute(_);else this.setAttribute(_,J)}}function YJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttributeNS(_.space,_.local);else this.setAttributeNS(_.space,_.local,J)}}function Q3(_,Q){var J=Y0(_);if(arguments.length<2){var q=this.node();return J.local?q.getAttributeNS(J.space,J.local):q.getAttribute(J)}return this.each((Q==null?J.local?FJ:ZJ:typeof Q==="function"?J.local?YJ:XJ:J.local?HJ:KJ)(J,Q))}function l2(_){return _.ownerDocument&&_.ownerDocument.defaultView||_.document&&_||_.defaultView}function LJ(_){return function(){this.style.removeProperty(_)}}function zJ(_,Q,J){return function(){this.style.setProperty(_,Q,J)}}function WJ(_,Q,J){return function(){var q=Q.apply(this,arguments);if(q==null)this.style.removeProperty(_);else this.style.setProperty(_,q,J)}}function J3(_,Q,J){return arguments.length>1?this.each((Q==null?LJ:typeof Q==="function"?WJ:zJ)(_,Q,J==null?"":J)):V0(this.node(),_)}function V0(_,Q){return _.style.getPropertyValue(Q)||l2(_).getComputedStyle(_,null).getPropertyValue(Q)}function AJ(_){return function(){delete this[_]}}function BJ(_,Q){return function(){this[_]=Q}}function MJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)delete this[_];else this[_]=J}}function $3(_,Q){return arguments.length>1?this.each((Q==null?AJ:typeof Q==="function"?MJ:BJ)(_,Q)):this.node()[_]}function K8(_){return _.trim().split(/^|\s+/)}function q3(_){return _.classList||new H8(_)}function H8(_){this._node=_,this._names=K8(_.getAttribute("class")||"")}H8.prototype={add:function(_){var Q=this._names.indexOf(_);if(Q<0)this._names.push(_),this._node.setAttribute("class",this._names.join(" "))},remove:function(_){var Q=this._names.indexOf(_);if(Q>=0)this._names.splice(Q,1),this._node.setAttribute("class",this._names.join(" "))},contains:function(_){return this._names.indexOf(_)>=0}};function X8(_,Q){var J=q3(_),q=-1,U=Q.length;while(++q<U)J.add(Q[q])}function Y8(_,Q){var J=q3(_),q=-1,U=Q.length;while(++q<U)J.remove(Q[q])}function TJ(_){return function(){X8(this,_)}}function RJ(_){return function(){Y8(this,_)}}function OJ(_,Q){return function(){(Q.apply(this,arguments)?X8:Y8)(this,_)}}function U3(_,Q){var J=K8(_+"");if(arguments.length<2){var q=q3(this.node()),U=-1,G=J.length;while(++U<G)if(!q.contains(J[U]))return!1;return!0}return this.each((typeof Q==="function"?OJ:Q?TJ:RJ)(J,Q))}function fJ(){this.textContent=""}function IJ(_){return function(){this.textContent=_}}function wJ(_){return function(){var Q=_.apply(this,arguments);this.textContent=Q==null?"":Q}}function G3(_){return arguments.length?this.each(_==null?fJ:(typeof _==="function"?wJ:IJ)(_)):this.node().textContent}function PJ(){this.innerHTML=""}function NJ(_){return function(){this.innerHTML=_}}function CJ(_){return function(){var Q=_.apply(this,arguments);this.innerHTML=Q==null?"":Q}}function Z3(_){return arguments.length?this.each(_==null?PJ:(typeof _==="function"?CJ:NJ)(_)):this.node().innerHTML}function SJ(){if(this.nextSibling)this.parentNode.appendChild(this)}function F3(){return this.each(SJ)}function kJ(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function K3(){return this.each(kJ)}function yJ(_){return function(){var Q=this.ownerDocument,J=this.namespaceURI;return J===j5&&Q.documentElement.namespaceURI===j5?Q.createElement(_):Q.createElementNS(J,_)}}function vJ(_){return function(){return this.ownerDocument.createElementNS(_.space,_.local)}}function r2(_){var Q=Y0(_);return(Q.local?vJ:yJ)(Q)}function H3(_){var Q=typeof _==="function"?_:r2(_);return this.select(function(){return this.appendChild(Q.apply(this,arguments))})}function jJ(){return null}function X3(_,Q){var J=typeof _==="function"?_:r2(_),q=Q==null?jJ:typeof Q==="function"?Q:j0(Q);return this.select(function(){return this.insertBefore(J.apply(this,arguments),q.apply(this,arguments)||null)})}function VJ(){var _=this.parentNode;if(_)_.removeChild(this)}function Y3(){return this.each(VJ)}function uJ(){var _=this.cloneNode(!1),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function bJ(){var _=this.cloneNode(!0),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function L3(_){return this.select(_?bJ:uJ)}function z3(_){return arguments.length?this.property("__data__",_):this.node().__data__}function DJ(_){return function(Q){_.call(this,Q,this.__data__)}}function hJ(_){return _.trim().split(/^|\s+/).map(function(Q){var J="",q=Q.indexOf(".");if(q>=0)J=Q.slice(q+1),Q=Q.slice(0,q);return{type:Q,name:J}})}function EJ(_){return function(){var Q=this.__on;if(!Q)return;for(var J=0,q=-1,U=Q.length,G;J<U;++J)if(G=Q[J],(!_.type||G.type===_.type)&&G.name===_.name)this.removeEventListener(G.type,G.listener,G.options);else Q[++q]=G;if(++q)Q.length=q;else delete this.__on}}function xJ(_,Q,J){return function(){var q=this.__on,U,G=DJ(Q);if(q){for(var Z=0,F=q.length;Z<F;++Z)if((U=q[Z]).type===_.type&&U.name===_.name){this.removeEventListener(U.type,U.listener,U.options),this.addEventListener(U.type,U.listener=G,U.options=J),U.value=Q;return}}if(this.addEventListener(_.type,G,J),U={type:_.type,name:_.name,value:Q,listener:G,options:J},!q)this.__on=[U];else q.push(U)}}function W3(_,Q,J){var q=hJ(_+""),U,G=q.length,Z;if(arguments.length<2){var F=this.node().__on;if(F){for(var H=0,Y=F.length,X;H<Y;++H)for(U=0,X=F[H];U<G;++U)if((Z=q[U]).type===X.type&&Z.name===X.name)return X.value}return}F=Q?xJ:EJ;for(U=0;U<G;++U)this.each(F(q[U],Q,J));return this}function L8(_,Q,J){var q=l2(_),U=q.CustomEvent;if(typeof U==="function")U=new U(Q,J);else if(U=q.document.createEvent("Event"),J)U.initEvent(Q,J.bubbles,J.cancelable),U.detail=J.detail;else U.initEvent(Q,!1,!1);_.dispatchEvent(U)}function mJ(_,Q){return function(){return L8(this,_,Q)}}function gJ(_,Q){return function(){return L8(this,_,Q.apply(this,arguments))}}function A3(_,Q){return this.each((typeof Q==="function"?gJ:mJ)(_,Q))}function*B3(){for(var _=this._groups,Q=0,J=_.length;Q<J;++Q)for(var q=_[Q],U=0,G=q.length,Z;U<G;++U)if(Z=q[U])yield Z}var M3=[null];function S1(_,Q){this._groups=_,this._parents=Q}function z8(){return new S1([[document.documentElement]],M3)}function pJ(){return this}S1.prototype=z8.prototype={constructor:S1,select:b4,selectAll:h4,selectChild:E4,selectChildren:x4,filter:m4,data:c4,enter:g4,exit:l4,join:r4,merge:i4,selection:pJ,order:d4,sort:a4,call:s4,nodes:t4,node:o4,size:n4,empty:e4,each:_3,attr:Q3,style:J3,property:$3,classed:U3,text:G3,html:Z3,raise:F3,lower:K3,append:H3,insert:X3,remove:Y3,clone:L3,datum:z3,on:W3,dispatch:A3,[Symbol.iterator]:B3};var T0=z8;function j1(_){return typeof _==="string"?new S1([[document.querySelector(_)]],[document.documentElement]):new S1([[_]],M3)}var W8={passive:!1},s0={capture:!0,passive:!1};function V5(_){_.stopImmediatePropagation()}function R0(_){_.preventDefault(),_.stopImmediatePropagation()}function f2(_){var Q=_.document.documentElement,J=j1(_).on("dragstart.drag",R0,s0);if("onselectstart"in Q)J.on("selectstart.drag",R0,s0);else Q.__noselect=Q.style.MozUserSelect,Q.style.MozUserSelect="none"}function i2(_,Q){var J=_.document.documentElement,q=j1(_).on("dragstart.drag",null);if(Q)q.on("click.drag",R0,s0),setTimeout(function(){q.on("click.drag",null)},0);if("onselectstart"in J)q.on("selectstart.drag",null);else J.style.MozUserSelect=J.__noselect,delete J.__noselect}var d2=(_)=>()=>_;function a2(_,{sourceEvent:Q,subject:J,target:q,identifier:U,active:G,x:Z,y:F,dx:H,dy:Y,dispatch:X}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},subject:{value:J,enumerable:!0,configurable:!0},target:{value:q,enumerable:!0,configurable:!0},identifier:{value:U,enumerable:!0,configurable:!0},active:{value:G,enumerable:!0,configurable:!0},x:{value:Z,enumerable:!0,configurable:!0},y:{value:F,enumerable:!0,configurable:!0},dx:{value:H,enumerable:!0,configurable:!0},dy:{value:Y,enumerable:!0,configurable:!0},_:{value:X}})}a2.prototype.on=function(){var _=this._.on.apply(this._,arguments);return _===this._?this:_};function cJ(_){return!_.ctrlKey&&!_.button}function lJ(){return this.parentNode}function rJ(_,Q){return Q==null?{x:_.x,y:_.y}:Q}function iJ(){return navigator.maxTouchPoints||"ontouchstart"in this}function s2(){var _=cJ,Q=lJ,J=rJ,q=iJ,U={},G=a0("start","drag","end"),Z=0,F,H,Y,X,K=0;function L(R){R.on("mousedown.drag",z).filter(q).on("touchstart.drag",T).on("touchmove.drag",B,W8).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function z(R,I){if(X||!_.call(this,R,I))return;var C=A(this,Q.call(this,R,I),R,I,"mouse");if(!C)return;j1(R.view).on("mousemove.drag",W,s0).on("mouseup.drag",O,s0),f2(R.view),V5(R),Y=!1,F=R.clientX,H=R.clientY,C("start",R)}function W(R){if(R0(R),!Y){var I=R.clientX-F,C=R.clientY-H;Y=I*I+C*C>K}U.mouse("drag",R)}function O(R){j1(R.view).on("mousemove.drag mouseup.drag",null),i2(R.view,Y),R0(R),U.mouse("end",R)}function T(R,I){if(!_.call(this,R,I))return;var C=R.changedTouches,P=Q.call(this,R,I),k=C.length,N,v;for(N=0;N<k;++N)if(v=A(this,P,R,I,C[N].identifier,C[N]))V5(R),v("start",R,C[N])}function B(R){var I=R.changedTouches,C=I.length,P,k;for(P=0;P<C;++P)if(k=U[I[P].identifier])R0(R),k("drag",R,I[P])}function w(R){var I=R.changedTouches,C=I.length,P,k;if(X)clearTimeout(X);X=setTimeout(function(){X=null},500);for(P=0;P<C;++P)if(k=U[I[P].identifier])V5(R),k("end",R,I[P])}function A(R,I,C,P,k,N){var v=G.copy(),E=x1(N||C,I),g,h,S;if((S=J.call(R,new a2("beforestart",{sourceEvent:C,target:L,identifier:k,active:Z,x:E[0],y:E[1],dx:0,dy:0,dispatch:v}),P))==null)return;return g=S.x-E[0]||0,h=S.y-E[1]||0,function b(j,x,V){var D=E,f;switch(j){case"start":U[k]=b,f=Z++;break;case"end":delete U[k],--Z;case"drag":E=x1(V||x,I),f=Z;break}v.call(j,R,new a2(j,{sourceEvent:x,subject:S,target:L,identifier:k,active:f,x:E[0]+g,y:E[1]+h,dx:E[0]-D[0],dy:E[1]-D[1],dispatch:v}),P)}}return L.filter=function(R){return arguments.length?(_=typeof R==="function"?R:d2(!!R),L):_},L.container=function(R){return arguments.length?(Q=typeof R==="function"?R:d2(R),L):Q},L.subject=function(R){return arguments.length?(J=typeof R==="function"?R:d2(R),L):J},L.touchable=function(R){return arguments.length?(q=typeof R==="function"?R:d2(!!R),L):q},L.on=function(){var R=G.on.apply(G,arguments);return R===G?L:R},L.clickDistance=function(R){return arguments.length?(K=(R=+R)*R,L):Math.sqrt(K)},L}function t2(_,Q,J){_.prototype=Q.prototype=J,J.constructor=_}function T3(_,Q){var J=Object.create(_.prototype);for(var q in Q)J[q]=Q[q];return J}function e2(){}var o2=0.7,D5=1/o2,I2="\\s*([+-]?\\d+)\\s*",n2="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",L0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dJ=/^#([0-9a-f]{3,8})$/,aJ=new RegExp(`^rgb\\(${I2},${I2},${I2}\\)$`),sJ=new RegExp(`^rgb\\(${L0},${L0},${L0}\\)$`),tJ=new RegExp(`^rgba\\(${I2},${I2},${I2},${n2}\\)$`),oJ=new RegExp(`^rgba\\(${L0},${L0},${L0},${n2}\\)$`),nJ=new RegExp(`^hsl\\(${n2},${L0},${L0}\\)$`),eJ=new RegExp(`^hsla\\(${n2},${L0},${L0},${n2}\\)$`),A8={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};t2(e2,q0,{copy(_){return Object.assign(new this.constructor,this,_)},displayable(){return this.rgb().displayable()},hex:B8,formatHex:B8,formatHex8:_$,formatHsl:Q$,formatRgb:M8,toString:M8});function B8(){return this.rgb().formatHex()}function _$(){return this.rgb().formatHex8()}function Q$(){return w8(this).formatHsl()}function M8(){return this.rgb().formatRgb()}function q0(_){var Q,J;return _=(_+"").trim().toLowerCase(),(Q=dJ.exec(_))?(J=Q[1].length,Q=parseInt(Q[1],16),J===6?T8(Q):J===3?new d1(Q>>8&15|Q>>4&240,Q>>4&15|Q&240,(Q&15)<<4|Q&15,1):J===8?u5(Q>>24&255,Q>>16&255,Q>>8&255,(Q&255)/255):J===4?u5(Q>>12&15|Q>>8&240,Q>>8&15|Q>>4&240,Q>>4&15|Q&240,((Q&15)<<4|Q&15)/255):null):(Q=aJ.exec(_))?new d1(Q[1],Q[2],Q[3],1):(Q=sJ.exec(_))?new d1(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,1):(Q=tJ.exec(_))?u5(Q[1],Q[2],Q[3],Q[4]):(Q=oJ.exec(_))?u5(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,Q[4]):(Q=nJ.exec(_))?f8(Q[1],Q[2]/100,Q[3]/100,1):(Q=eJ.exec(_))?f8(Q[1],Q[2]/100,Q[3]/100,Q[4]):A8.hasOwnProperty(_)?T8(A8[_]):_==="transparent"?new d1(NaN,NaN,NaN,0):null}function T8(_){return new d1(_>>16&255,_>>8&255,_&255,1)}function u5(_,Q,J,q){if(q<=0)_=Q=J=NaN;return new d1(_,Q,J,q)}function J$(_){if(!(_ instanceof e2))_=q0(_);if(!_)return new d1;return _=_.rgb(),new d1(_.r,_.g,_.b,_.opacity)}function w2(_,Q,J,q){return arguments.length===1?J$(_):new d1(_,Q,J,q==null?1:q)}function d1(_,Q,J,q){this.r=+_,this.g=+Q,this.b=+J,this.opacity=+q}t2(d1,w2,T3(e2,{brighter(_){return _=_==null?D5:Math.pow(D5,_),new d1(this.r*_,this.g*_,this.b*_,this.opacity)},darker(_){return _=_==null?o2:Math.pow(o2,_),new d1(this.r*_,this.g*_,this.b*_,this.opacity)},rgb(){return this},clamp(){return new d1(o0(this.r),o0(this.g),o0(this.b),h5(this.opacity))},displayable(){return-0.5<=this.r&&this.r<255.5&&(-0.5<=this.g&&this.g<255.5)&&(-0.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:R8,formatHex:R8,formatHex8:$$,formatRgb:O8,toString:O8}));function R8(){return`#${t0(this.r)}${t0(this.g)}${t0(this.b)}`}function $$(){return`#${t0(this.r)}${t0(this.g)}${t0(this.b)}${t0((isNaN(this.opacity)?1:this.opacity)*255)}`}function O8(){let _=h5(this.opacity);return`${_===1?"rgb(":"rgba("}${o0(this.r)}, ${o0(this.g)}, ${o0(this.b)}${_===1?")":`, ${_})`}`}function h5(_){return isNaN(_)?1:Math.max(0,Math.min(1,_))}function o0(_){return Math.max(0,Math.min(255,Math.round(_)||0))}function t0(_){return _=o0(_),(_<16?"0":"")+_.toString(16)}function f8(_,Q,J,q){if(q<=0)_=Q=J=NaN;else if(J<=0||J>=1)_=Q=NaN;else if(Q<=0)_=NaN;return new $0(_,Q,J,q)}function w8(_){if(_ instanceof $0)return new $0(_.h,_.s,_.l,_.opacity);if(!(_ instanceof e2))_=q0(_);if(!_)return new $0;if(_ instanceof $0)return _;_=_.rgb();var Q=_.r/255,J=_.g/255,q=_.b/255,U=Math.min(Q,J,q),G=Math.max(Q,J,q),Z=NaN,F=G-U,H=(G+U)/2;if(F){if(Q===G)Z=(J-q)/F+(J<q)*6;else if(J===G)Z=(q-Q)/F+2;else Z=(Q-J)/F+4;F/=H<0.5?G+U:2-G-U,Z*=60}else F=H>0&&H<1?0:Z;return new $0(Z,F,H,_.opacity)}function P8(_,Q,J,q){return arguments.length===1?w8(_):new $0(_,Q,J,q==null?1:q)}function $0(_,Q,J,q){this.h=+_,this.s=+Q,this.l=+J,this.opacity=+q}t2($0,P8,T3(e2,{brighter(_){return _=_==null?D5:Math.pow(D5,_),new $0(this.h,this.s,this.l*_,this.opacity)},darker(_){return _=_==null?o2:Math.pow(o2,_),new $0(this.h,this.s,this.l*_,this.opacity)},rgb(){var _=this.h%360+(this.h<0)*360,Q=isNaN(_)||isNaN(this.s)?0:this.s,J=this.l,q=J+(J<0.5?J:1-J)*Q,U=2*J-q;return new d1(R3(_>=240?_-240:_+120,U,q),R3(_,U,q),R3(_<120?_+240:_-120,U,q),this.opacity)},clamp(){return new $0(I8(this.h),b5(this.s),b5(this.l),h5(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)},formatHsl(){let _=h5(this.opacity);return`${_===1?"hsl(":"hsla("}${I8(this.h)}, ${b5(this.s)*100}%, ${b5(this.l)*100}%${_===1?")":`, ${_})`}`}}));function I8(_){return _=(_||0)%360,_<0?_+360:_}function b5(_){return Math.max(0,Math.min(1,_||0))}function R3(_,Q,J){return(_<60?Q+(J-Q)*_/60:_<180?J:_<240?Q+(J-Q)*(240-_)/60:Q)*255}function O3(_,Q,J,q,U){var G=_*_,Z=G*_;return((1-3*_+3*G-Z)*Q+(4-6*G+3*Z)*J+(1+3*_+3*G-3*Z)*q+Z*U)/6}function f3(_){var Q=_.length-1;return function(J){var q=J<=0?J=0:J>=1?(J=1,Q-1):Math.floor(J*Q),U=_[q],G=_[q+1],Z=q>0?_[q-1]:2*U-G,F=q<Q-1?_[q+2]:2*G-U;return O3((J-q/Q)*Q,Z,U,G,F)}}function I3(_){var Q=_.length;return function(J){var q=Math.floor(((J%=1)<0?++J:J)*Q),U=_[(q+Q-1)%Q],G=_[q%Q],Z=_[(q+1)%Q],F=_[(q+2)%Q];return O3((J-q/Q)*Q,U,G,Z,F)}}var _5=(_)=>()=>_;function q$(_,Q){return function(J){return _+J*Q}}function U$(_,Q,J){return _=Math.pow(_,J),Q=Math.pow(Q,J)-_,J=1/J,function(q){return Math.pow(_+q*Q,J)}}function N8(_){return(_=+_)===1?E5:function(Q,J){return J-Q?U$(Q,J,_):_5(isNaN(Q)?J:Q)}}function E5(_,Q){var J=Q-_;return J?q$(_,J):_5(isNaN(_)?Q:_)}var n0=function _(Q){var J=N8(Q);function q(U,G){var Z=J((U=w2(U)).r,(G=w2(G)).r),F=J(U.g,G.g),H=J(U.b,G.b),Y=E5(U.opacity,G.opacity);return function(X){return U.r=Z(X),U.g=F(X),U.b=H(X),U.opacity=Y(X),U+""}}return q.gamma=_,q}(1);function C8(_){return function(Q){var J=Q.length,q=Array(J),U=Array(J),G=Array(J),Z,F;for(Z=0;Z<J;++Z)F=w2(Q[Z]),q[Z]=F.r||0,U[Z]=F.g||0,G[Z]=F.b||0;return q=_(q),U=_(U),G=_(G),F.opacity=1,function(H){return F.r=q(H),F.g=U(H),F.b=G(H),F+""}}}var G$=C8(f3),Z$=C8(I3);function w3(_,Q){if(!Q)Q=[];var J=_?Math.min(Q.length,_.length):0,q=Q.slice(),U;return function(G){for(U=0;U<J;++U)q[U]=_[U]*(1-G)+Q[U]*G;return q}}function S8(_){return ArrayBuffer.isView(_)&&!(_ instanceof DataView)}function k8(_,Q){var J=Q?Q.length:0,q=_?Math.min(J,_.length):0,U=Array(q),G=Array(J),Z;for(Z=0;Z<q;++Z)U[Z]=z0(_[Z],Q[Z]);for(;Z<J;++Z)G[Z]=Q[Z];return function(F){for(Z=0;Z<q;++Z)G[Z]=U[Z](F);return G}}function P3(_,Q){var J=new Date;return _=+_,Q=+Q,function(q){return J.setTime(_*(1-q)+Q*q),J}}function m1(_,Q){return _=+_,Q=+Q,function(J){return _*(1-J)+Q*J}}function N3(_,Q){var J={},q={},U;if(_===null||typeof _!=="object")_={};if(Q===null||typeof Q!=="object")Q={};for(U in Q)if(U in _)J[U]=z0(_[U],Q[U]);else q[U]=Q[U];return function(G){for(U in J)q[U]=J[U](G);return q}}var S3=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,C3=new RegExp(S3.source,"g");function F$(_){return function(){return _}}function K$(_){return function(Q){return _(Q)+""}}function P2(_,Q){var J=S3.lastIndex=C3.lastIndex=0,q,U,G,Z=-1,F=[],H=[];_=_+"",Q=Q+"";while((q=S3.exec(_))&&(U=C3.exec(Q))){if((G=U.index)>J)if(G=Q.slice(J,G),F[Z])F[Z]+=G;else F[++Z]=G;if((q=q[0])===(U=U[0]))if(F[Z])F[Z]+=U;else F[++Z]=U;else F[++Z]=null,H.push({i:Z,x:m1(q,U)});J=C3.lastIndex}if(J<Q.length)if(G=Q.slice(J),F[Z])F[Z]+=G;else F[++Z]=G;return F.length<2?H[0]?K$(H[0].x):F$(Q):(Q=H.length,function(Y){for(var X=0,K;X<Q;++X)F[(K=H[X]).i]=K.x(Y);return F.join("")})}function z0(_,Q){var J=typeof Q,q;return Q==null||J==="boolean"?_5(Q):(J==="number"?m1:J==="string"?(q=q0(Q))?(Q=q,n0):P2:Q instanceof q0?n0:Q instanceof Date?P3:S8(Q)?w3:Array.isArray(Q)?k8:typeof Q.valueOf!=="function"&&typeof Q.toString!=="function"||isNaN(Q)?N3:m1)(_,Q)}var y8=180/Math.PI,x5={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function m5(_,Q,J,q,U,G){var Z,F,H;if(Z=Math.sqrt(_*_+Q*Q))_/=Z,Q/=Z;if(H=_*J+Q*q)J-=_*H,q-=Q*H;if(F=Math.sqrt(J*J+q*q))J/=F,q/=F,H/=F;if(_*q<Q*J)_=-_,Q=-Q,H=-H,Z=-Z;return{translateX:U,translateY:G,rotate:Math.atan2(Q,_)*y8,skewX:Math.atan(H)*y8,scaleX:Z,scaleY:F}}var g5;function v8(_){let Q=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(_+"");return Q.isIdentity?x5:m5(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)}function j8(_){if(_==null)return x5;if(!g5)g5=document.createElementNS("http://www.w3.org/2000/svg","g");if(g5.setAttribute("transform",_),!(_=g5.transform.baseVal.consolidate()))return x5;return _=_.matrix,m5(_.a,_.b,_.c,_.d,_.e,_.f)}function V8(_,Q,J,q){function U(Y){return Y.length?Y.pop()+" ":""}function G(Y,X,K,L,z,W){if(Y!==K||X!==L){var O=z.push("translate(",null,Q,null,J);W.push({i:O-4,x:m1(Y,K)},{i:O-2,x:m1(X,L)})}else if(K||L)z.push("translate("+K+Q+L+J)}function Z(Y,X,K,L){if(Y!==X){if(Y-X>180)X+=360;else if(X-Y>180)Y+=360;L.push({i:K.push(U(K)+"rotate(",null,q)-2,x:m1(Y,X)})}else if(X)K.push(U(K)+"rotate("+X+q)}function F(Y,X,K,L){if(Y!==X)L.push({i:K.push(U(K)+"skewX(",null,q)-2,x:m1(Y,X)});else if(X)K.push(U(K)+"skewX("+X+q)}function H(Y,X,K,L,z,W){if(Y!==K||X!==L){var O=z.push(U(z)+"scale(",null,",",null,")");W.push({i:O-4,x:m1(Y,K)},{i:O-2,x:m1(X,L)})}else if(K!==1||L!==1)z.push(U(z)+"scale("+K+","+L+")")}return function(Y,X){var K=[],L=[];return Y=_(Y),X=_(X),G(Y.translateX,Y.translateY,X.translateX,X.translateY,K,L),Z(Y.rotate,X.rotate,K,L),F(Y.skewX,X.skewX,K,L),H(Y.scaleX,Y.scaleY,X.scaleX,X.scaleY,K,L),Y=X=null,function(z){var W=-1,O=L.length,T;while(++W<O)K[(T=L[W]).i]=T.x(z);return K.join("")}}}var k3=V8(v8,"px, ","px)","deg)"),y3=V8(j8,", ",")",")");var H$=0.000000000001;function u8(_){return((_=Math.exp(_))+1/_)/2}function X$(_){return((_=Math.exp(_))-1/_)/2}function Y$(_){return((_=Math.exp(2*_))-1)/(_+1)}var e0=function _(Q,J,q){function U(G,Z){var F=G[0],H=G[1],Y=G[2],X=Z[0],K=Z[1],L=Z[2],z=X-F,W=K-H,O=z*z+W*W,T,B;if(O<H$)B=Math.log(L/Y)/Q,T=function(P){return[F+P*z,H+P*W,Y*Math.exp(Q*P*B)]};else{var w=Math.sqrt(O),A=(L*L-Y*Y+q*O)/(2*Y*J*w),R=(L*L-Y*Y-q*O)/(2*L*J*w),I=Math.log(Math.sqrt(A*A+1)-A),C=Math.log(Math.sqrt(R*R+1)-R);B=(C-I)/Q,T=function(P){var k=P*B,N=u8(I),v=Y/(J*w)*(N*Y$(Q*k+I)-X$(I));return[F+v*z,H+v*W,Y*N/u8(Q*k+I)]}}return T.duration=B*1000*Q/Math.SQRT2,T}return U.rho=function(G){var Z=Math.max(0.001,+G),F=Z*Z,H=F*F;return _(Z,F,H)},U}(Math.SQRT2,2,4);var N2=0,J5=0,Q5=0,D8=1000,p5,$5,c5=0,_2=0,l5=0,q5=typeof performance==="object"&&performance.now?performance:Date,h8=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(_){setTimeout(_,17)};function G5(){return _2||(h8(L$),_2=q5.now()+l5)}function L$(){_2=0}function U5(){this._call=this._time=this._next=null}U5.prototype=r5.prototype={constructor:U5,restart:function(_,Q,J){if(typeof _!=="function")throw TypeError("callback is not a function");if(J=(J==null?G5():+J)+(Q==null?0:+Q),!this._next&&$5!==this){if($5)$5._next=this;else p5=this;$5=this}this._call=_,this._time=J,v3()},stop:function(){if(this._call)this._call=null,this._time=1/0,v3()}};function r5(_,Q,J){var q=new U5;return q.restart(_,Q,J),q}function E8(){G5(),++N2;var _=p5,Q;while(_){if((Q=_2-_._time)>=0)_._call.call(void 0,Q);_=_._next}--N2}function b8(){_2=(c5=q5.now())+l5,N2=J5=0;try{E8()}finally{N2=0,W$(),_2=0}}function z$(){var _=q5.now(),Q=_-c5;if(Q>D8)l5-=Q,c5=_}function W$(){var _,Q=p5,J,q=1/0;while(Q)if(Q._call){if(q>Q._time)q=Q._time;_=Q,Q=Q._next}else J=Q._next,Q._next=null,Q=_?_._next=J:p5=J;$5=_,v3(q)}function v3(_){if(N2)return;if(J5)J5=clearTimeout(J5);var Q=_-_2;if(Q>24){if(_<1/0)J5=setTimeout(b8,_-q5.now()-l5);if(Q5)Q5=clearInterval(Q5)}else{if(!Q5)c5=q5.now(),Q5=setInterval(z$,D8);N2=1,h8(b8)}}function Z5(_,Q,J){var q=new U5;return Q=Q==null?0:+Q,q.restart((U)=>{q.stop(),_(U+Q)},Q,J),q}var A$=a0("start","end","cancel","interrupt"),B$=[],g8=0,x8=1,d5=2,i5=3,m8=4,a5=5,F5=6;function O0(_,Q,J,q,U,G){var Z=_.__transition;if(!Z)_.__transition={};else if(J in Z)return;M$(_,J,{name:Q,index:q,group:U,on:A$,tween:B$,time:G.time,delay:G.delay,duration:G.duration,ease:G.ease,timer:null,state:g8})}function K5(_,Q){var J=V1(_,Q);if(J.state>g8)throw Error("too late; already scheduled");return J}function E1(_,Q){var J=V1(_,Q);if(J.state>i5)throw Error("too late; already running");return J}function V1(_,Q){var J=_.__transition;if(!J||!(J=J[Q]))throw Error("transition not found");return J}function M$(_,Q,J){var q=_.__transition,U;q[Q]=J,J.timer=r5(G,0,J.time);function G(Y){if(J.state=x8,J.timer.restart(Z,J.delay,J.time),J.delay<=Y)Z(Y-J.delay)}function Z(Y){var X,K,L,z;if(J.state!==x8)return H();for(X in q){if(z=q[X],z.name!==J.name)continue;if(z.state===i5)return Z5(Z);if(z.state===m8)z.state=F5,z.timer.stop(),z.on.call("interrupt",_,_.__data__,z.index,z.group),delete q[X];else if(+X<Q)z.state=F5,z.timer.stop(),z.on.call("cancel",_,_.__data__,z.index,z.group),delete q[X]}if(Z5(function(){if(J.state===i5)J.state=m8,J.timer.restart(F,J.delay,J.time),F(Y)}),J.state=d5,J.on.call("start",_,_.__data__,J.index,J.group),J.state!==d5)return;J.state=i5,U=Array(L=J.tween.length);for(X=0,K=-1;X<L;++X)if(z=J.tween[X].value.call(_,_.__data__,J.index,J.group))U[++K]=z;U.length=K+1}function F(Y){var X=Y<J.duration?J.ease.call(null,Y/J.duration):(J.timer.restart(H),J.state=a5,1),K=-1,L=U.length;while(++K<L)U[K].call(_,X);if(J.state===a5)J.on.call("end",_,_.__data__,J.index,J.group),H()}function H(){J.state=F5,J.timer.stop(),delete q[Q];for(var Y in q)return;delete _.__transition}}function u0(_,Q){var J=_.__transition,q,U,G=!0,Z;if(!J)return;Q=Q==null?null:Q+"";for(Z in J){if((q=J[Z]).name!==Q){G=!1;continue}U=q.state>d5&&q.state<a5,q.state=F5,q.timer.stop(),q.on.call(U?"interrupt":"cancel",_,_.__data__,q.index,q.group),delete J[Z]}if(G)delete _.__transition}function j3(_){return this.each(function(){u0(this,_)})}function T$(_,Q){var J,q;return function(){var U=E1(this,_),G=U.tween;if(G!==J){q=J=G;for(var Z=0,F=q.length;Z<F;++Z)if(q[Z].name===Q){q=q.slice(),q.splice(Z,1);break}}U.tween=q}}function R$(_,Q,J){var q,U;if(typeof J!=="function")throw Error();return function(){var G=E1(this,_),Z=G.tween;if(Z!==q){U=(q=Z).slice();for(var F={name:Q,value:J},H=0,Y=U.length;H<Y;++H)if(U[H].name===Q){U[H]=F;break}if(H===Y)U.push(F)}G.tween=U}}function V3(_,Q){var J=this._id;if(_+="",arguments.length<2){var q=V1(this.node(),J).tween;for(var U=0,G=q.length,Z;U<G;++U)if((Z=q[U]).name===_)return Z.value;return null}return this.each((Q==null?T$:R$)(J,_,Q))}function C2(_,Q,J){var q=_._id;return _.each(function(){var U=E1(this,q);(U.value||(U.value={}))[Q]=J.apply(this,arguments)}),function(U){return V1(U,q).value[Q]}}function H5(_,Q){var J;return(typeof Q==="number"?m1:Q instanceof q0?n0:(J=q0(Q))?(Q=J,n0):P2)(_,Q)}function O$(_){return function(){this.removeAttribute(_)}}function f$(_){return function(){this.removeAttributeNS(_.space,_.local)}}function I$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttribute(_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function w$(_,Q,J){var q,U=J+"",G;return function(){var Z=this.getAttributeNS(_.space,_.local);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function P$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),H;if(F==null)return void this.removeAttribute(_);return Z=this.getAttribute(_),H=F+"",Z===H?null:Z===q&&H===U?G:(U=H,G=Q(q=Z,F))}}function N$(_,Q,J){var q,U,G;return function(){var Z,F=J(this),H;if(F==null)return void this.removeAttributeNS(_.space,_.local);return Z=this.getAttributeNS(_.space,_.local),H=F+"",Z===H?null:Z===q&&H===U?G:(U=H,G=Q(q=Z,F))}}function u3(_,Q){var J=Y0(_),q=J==="transform"?y3:H5;return this.attrTween(_,typeof Q==="function"?(J.local?N$:P$)(J,q,C2(this,"attr."+_,Q)):Q==null?(J.local?f$:O$)(J):(J.local?w$:I$)(J,q,Q))}function C$(_,Q){return function(J){this.setAttribute(_,Q.call(this,J))}}function S$(_,Q){return function(J){this.setAttributeNS(_.space,_.local,Q.call(this,J))}}function k$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&S$(_,G);return J}return U._value=Q,U}function y$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&C$(_,G);return J}return U._value=Q,U}function b3(_,Q){var J="attr."+_;if(arguments.length<2)return(J=this.tween(J))&&J._value;if(Q==null)return this.tween(J,null);if(typeof Q!=="function")throw Error();var q=Y0(_);return this.tween(J,(q.local?k$:y$)(q,Q))}function v$(_,Q){return function(){K5(this,_).delay=+Q.apply(this,arguments)}}function j$(_,Q){return Q=+Q,function(){K5(this,_).delay=Q}}function D3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?v$:j$)(Q,_)):V1(this.node(),Q).delay}function V$(_,Q){return function(){E1(this,_).duration=+Q.apply(this,arguments)}}function u$(_,Q){return Q=+Q,function(){E1(this,_).duration=Q}}function h3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?V$:u$)(Q,_)):V1(this.node(),Q).duration}function b$(_,Q){if(typeof Q!=="function")throw Error();return function(){E1(this,_).ease=Q}}function E3(_){var Q=this._id;return arguments.length?this.each(b$(Q,_)):V1(this.node(),Q).ease}function D$(_,Q){return function(){var J=Q.apply(this,arguments);if(typeof J!=="function")throw Error();E1(this,_).ease=J}}function x3(_){if(typeof _!=="function")throw Error();return this.each(D$(this._id,_))}function m3(_){if(typeof _!=="function")_=R2(_);for(var Q=this._groups,J=Q.length,q=Array(J),U=0;U<J;++U)for(var G=Q[U],Z=G.length,F=q[U]=[],H,Y=0;Y<Z;++Y)if((H=G[Y])&&_.call(H,H.__data__,Y,G))F.push(H);return new r1(q,this._parents,this._name,this._id)}function g3(_){if(_._id!==this._id)throw Error();for(var Q=this._groups,J=_._groups,q=Q.length,U=J.length,G=Math.min(q,U),Z=Array(q),F=0;F<G;++F)for(var H=Q[F],Y=J[F],X=H.length,K=Z[F]=Array(X),L,z=0;z<X;++z)if(L=H[z]||Y[z])K[z]=L;for(;F<q;++F)Z[F]=Q[F];return new r1(Z,this._parents,this._name,this._id)}function h$(_){return(_+"").trim().split(/^|\s+/).every(function(Q){var J=Q.indexOf(".");if(J>=0)Q=Q.slice(0,J);return!Q||Q==="start"})}function E$(_,Q,J){var q,U,G=h$(Q)?K5:E1;return function(){var Z=G(this,_),F=Z.on;if(F!==q)(U=(q=F).copy()).on(Q,J);Z.on=U}}function p3(_,Q){var J=this._id;return arguments.length<2?V1(this.node(),J).on.on(_):this.each(E$(J,_,Q))}function x$(_){return function(){var Q=this.parentNode;for(var J in this.__transition)if(+J!==_)return;if(Q)Q.removeChild(this)}}function c3(){return this.on("end.remove",x$(this._id))}function l3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=j0(_);for(var q=this._groups,U=q.length,G=Array(U),Z=0;Z<U;++Z)for(var F=q[Z],H=F.length,Y=G[Z]=Array(H),X,K,L=0;L<H;++L)if((X=F[L])&&(K=_.call(X,X.__data__,L,F))){if("__data__"in X)K.__data__=X.__data__;Y[L]=K,O0(Y[L],Q,J,L,Y,V1(X,J))}return new r1(G,this._parents,Q,J)}function r3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=O2(_);for(var q=this._groups,U=q.length,G=[],Z=[],F=0;F<U;++F)for(var H=q[F],Y=H.length,X,K=0;K<Y;++K)if(X=H[K]){for(var L=_.call(X,X.__data__,K,H),z,W=V1(X,J),O=0,T=L.length;O<T;++O)if(z=L[O])O0(z,Q,J,O,L,W);G.push(L),Z.push(X)}return new r1(G,Z,Q,J)}var m$=T0.prototype.constructor;function i3(){return new m$(this._groups,this._parents)}function g$(_,Q){var J,q,U;return function(){var G=V0(this,_),Z=(this.style.removeProperty(_),V0(this,_));return G===Z?null:G===J&&Z===q?U:U=Q(J=G,q=Z)}}function p8(_){return function(){this.style.removeProperty(_)}}function p$(_,Q,J){var q,U=J+"",G;return function(){var Z=V0(this,_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function c$(_,Q,J){var q,U,G;return function(){var Z=V0(this,_),F=J(this),H=F+"";if(F==null)H=F=(this.style.removeProperty(_),V0(this,_));return Z===H?null:Z===q&&H===U?G:(U=H,G=Q(q=Z,F))}}function l$(_,Q){var J,q,U,G="style."+Q,Z="end."+G,F;return function(){var H=E1(this,_),Y=H.on,X=H.value[G]==null?F||(F=p8(Q)):void 0;if(Y!==J||U!==X)(q=(J=Y).copy()).on(Z,U=X);H.on=q}}function d3(_,Q,J){var q=(_+="")==="transform"?k3:H5;return Q==null?this.styleTween(_,g$(_,q)).on("end.style."+_,p8(_)):typeof Q==="function"?this.styleTween(_,c$(_,q,C2(this,"style."+_,Q))).each(l$(this._id,_)):this.styleTween(_,p$(_,q,Q),J).on("end.style."+_,null)}function r$(_,Q,J){return function(q){this.style.setProperty(_,Q.call(this,q),J)}}function i$(_,Q,J){var q,U;function G(){var Z=Q.apply(this,arguments);if(Z!==U)q=(U=Z)&&r$(_,Z,J);return q}return G._value=Q,G}function a3(_,Q,J){var q="style."+(_+="");if(arguments.length<2)return(q=this.tween(q))&&q._value;if(Q==null)return this.tween(q,null);if(typeof Q!=="function")throw Error();return this.tween(q,i$(_,Q,J==null?"":J))}function d$(_){return function(){this.textContent=_}}function a$(_){return function(){var Q=_(this);this.textContent=Q==null?"":Q}}function s3(_){return this.tween("text",typeof _==="function"?a$(C2(this,"text",_)):d$(_==null?"":_+""))}function s$(_){return function(Q){this.textContent=_.call(this,Q)}}function t$(_){var Q,J;function q(){var U=_.apply(this,arguments);if(U!==J)Q=(J=U)&&s$(U);return Q}return q._value=_,q}function t3(_){var Q="text";if(arguments.length<1)return(Q=this.tween(Q))&&Q._value;if(_==null)return this.tween(Q,null);if(typeof _!=="function")throw Error();return this.tween(Q,t$(_))}function o3(){var _=this._name,Q=this._id,J=s5();for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,H,Y=0;Y<F;++Y)if(H=Z[Y]){var X=V1(H,Q);O0(H,_,J,Y,Z,{time:X.time+X.delay+X.duration,delay:0,duration:X.duration,ease:X.ease})}return new r1(q,this._parents,_,J)}function n3(){var _,Q,J=this,q=J._id,U=J.size();return new Promise(function(G,Z){var F={value:Z},H={value:function(){if(--U===0)G()}};if(J.each(function(){var Y=E1(this,q),X=Y.on;if(X!==_)Q=(_=X).copy(),Q._.cancel.push(F),Q._.interrupt.push(F),Q._.end.push(H);Y.on=Q}),U===0)G()})}var o$=0;function r1(_,Q,J,q){this._groups=_,this._parents=Q,this._name=J,this._id=q}function c8(_){return T0().transition(_)}function s5(){return++o$}var f0=T0.prototype;r1.prototype=c8.prototype={constructor:r1,select:l3,selectAll:r3,selectChild:f0.selectChild,selectChildren:f0.selectChildren,filter:m3,merge:g3,selection:i3,transition:o3,call:f0.call,nodes:f0.nodes,node:f0.node,size:f0.size,empty:f0.empty,each:f0.each,on:p3,attr:u3,attrTween:b3,style:d3,styleTween:a3,text:s3,textTween:t3,remove:c3,tween:V3,delay:D3,duration:h3,ease:E3,easeVarying:x3,end:n3,[Symbol.iterator]:f0[Symbol.iterator]};function t5(_){return((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2}var n$={time:null,delay:0,duration:250,ease:t5};function e$(_,Q){var J;while(!(J=_.__transition)||!(J=J[Q]))if(!(_=_.parentNode))throw Error(`transition ${Q} not found`);return J}function e3(_){var Q,J;if(_ instanceof r1)Q=_._id,_=_._name;else Q=s5(),(J=n$).time=G5(),_=_==null?null:_+"";for(var q=this._groups,U=q.length,G=0;G<U;++G)for(var Z=q[G],F=Z.length,H,Y=0;Y<F;++Y)if(H=Z[Y])O0(H,_,Q,Y,Z,J||e$(H,Q));return new r1(q,this._parents,_,Q)}T0.prototype.interrupt=j3;T0.prototype.transition=e3;var X5=(_)=>()=>_;function _6(_,{sourceEvent:Q,target:J,transform:q,dispatch:U}){Object.defineProperties(this,{type:{value:_,enumerable:!0,configurable:!0},sourceEvent:{value:Q,enumerable:!0,configurable:!0},target:{value:J,enumerable:!0,configurable:!0},transform:{value:q,enumerable:!0,configurable:!0},_:{value:U}})}function U0(_,Q,J){this.k=_,this.x=Q,this.y=J}U0.prototype={constructor:U0,scale:function(_){return _===1?this:new U0(this.k*_,this.x,this.y)},translate:function(_,Q){return _===0&Q===0?this:new U0(this.k,this.x+this.k*_,this.y+this.k*Q)},apply:function(_){return[_[0]*this.k+this.x,_[1]*this.k+this.y]},applyX:function(_){return _*this.k+this.x},applyY:function(_){return _*this.k+this.y},invert:function(_){return[(_[0]-this.x)/this.k,(_[1]-this.y)/this.k]},invertX:function(_){return(_-this.x)/this.k},invertY:function(_){return(_-this.y)/this.k},rescaleX:function(_){return _.copy().domain(_.range().map(this.invertX,this).map(_.invert,_))},rescaleY:function(_){return _.copy().domain(_.range().map(this.invertY,this).map(_.invert,_))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Q2=new U0(1,0,0);Y5.prototype=U0.prototype;function Y5(_){while(!_.__zoom)if(!(_=_.parentNode))return Q2;return _.__zoom}function o5(_){_.stopImmediatePropagation()}function J2(_){_.preventDefault(),_.stopImmediatePropagation()}function _q(_){return(!_.ctrlKey||_.type==="wheel")&&!_.button}function Qq(){var _=this;if(_ instanceof SVGElement){if(_=_.ownerSVGElement||_,_.hasAttribute("viewBox"))return _=_.viewBox.baseVal,[[_.x,_.y],[_.x+_.width,_.y+_.height]];return[[0,0],[_.width.baseVal.value,_.height.baseVal.value]]}return[[0,0],[_.clientWidth,_.clientHeight]]}function l8(){return this.__zoom||Q2}function Jq(_){return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*(_.ctrlKey?10:1)}function $q(){return navigator.maxTouchPoints||"ontouchstart"in this}function qq(_,Q,J){var q=_.invertX(Q[0][0])-J[0][0],U=_.invertX(Q[1][0])-J[1][0],G=_.invertY(Q[0][1])-J[0][1],Z=_.invertY(Q[1][1])-J[1][1];return _.translate(U>q?(q+U)/2:Math.min(0,q)||Math.max(0,U),Z>G?(G+Z)/2:Math.min(0,G)||Math.max(0,Z))}function L5(){var _=_q,Q=Qq,J=qq,q=Jq,U=$q,G=[0,1/0],Z=[[-1/0,-1/0],[1/0,1/0]],F=250,H=e0,Y=a0("start","zoom","end"),X,K,L,z=500,W=150,O=0,T=10;function B(S){S.property("__zoom",l8).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",v).filter(U).on("touchstart.zoom",E).on("touchmove.zoom",g).on("touchend.zoom touchcancel.zoom",h).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}B.transform=function(S,b,j,x){var V=S.selection?S.selection():S;if(V.property("__zoom",l8),S!==V)I(S,b,j,x);else V.interrupt().each(function(){C(this,arguments).event(x).start().zoom(null,typeof b==="function"?b.apply(this,arguments):b).end()})},B.scaleBy=function(S,b,j,x){B.scaleTo(S,function(){var V=this.__zoom.k,D=typeof b==="function"?b.apply(this,arguments):b;return V*D},j,x)},B.scaleTo=function(S,b,j,x){B.transform(S,function(){var V=Q.apply(this,arguments),D=this.__zoom,f=j==null?R(V):typeof j==="function"?j.apply(this,arguments):j,y=D.invert(f),p=typeof b==="function"?b.apply(this,arguments):b;return J(A(w(D,p),f,y),V,Z)},j,x)},B.translateBy=function(S,b,j,x){B.transform(S,function(){return J(this.__zoom.translate(typeof b==="function"?b.apply(this,arguments):b,typeof j==="function"?j.apply(this,arguments):j),Q.apply(this,arguments),Z)},null,x)},B.translateTo=function(S,b,j,x,V){B.transform(S,function(){var D=Q.apply(this,arguments),f=this.__zoom,y=x==null?R(D):typeof x==="function"?x.apply(this,arguments):x;return J(Q2.translate(y[0],y[1]).scale(f.k).translate(typeof b==="function"?-b.apply(this,arguments):-b,typeof j==="function"?-j.apply(this,arguments):-j),D,Z)},x,V)};function w(S,b){return b=Math.max(G[0],Math.min(G[1],b)),b===S.k?S:new U0(b,S.x,S.y)}function A(S,b,j){var x=b[0]-j[0]*S.k,V=b[1]-j[1]*S.k;return x===S.x&&V===S.y?S:new U0(S.k,x,V)}function R(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function I(S,b,j,x){S.on("start.zoom",function(){C(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(x).end()}).tween("zoom",function(){var V=this,D=arguments,f=C(V,D).event(x),y=Q.apply(V,D),p=j==null?R(y):typeof j==="function"?j.apply(V,D):j,u=Math.max(y[1][0]-y[0][0],y[1][1]-y[0][1]),s=V.__zoom,t=typeof b==="function"?b.apply(V,D):b,a=H(s.invert(p).concat(u/s.k),t.invert(p).concat(u/t.k));return function(d){if(d===1)d=t;else{var c=a(d),e=u/c[2];d=new U0(e,p[0]-c[0]*e,p[1]-c[1]*e)}f.zoom(null,d)}})}function C(S,b,j){return!j&&S.__zooming||new P(S,b)}function P(S,b){this.that=S,this.args=b,this.active=0,this.sourceEvent=null,this.extent=Q.apply(S,b),this.taps=0}P.prototype={event:function(S){if(S)this.sourceEvent=S;return this},start:function(){if(++this.active===1)this.that.__zooming=this,this.emit("start");return this},zoom:function(S,b){if(this.mouse&&S!=="mouse")this.mouse[1]=b.invert(this.mouse[0]);if(this.touch0&&S!=="touch")this.touch0[1]=b.invert(this.touch0[0]);if(this.touch1&&S!=="touch")this.touch1[1]=b.invert(this.touch1[0]);return this.that.__zoom=b,this.emit("zoom"),this},end:function(){if(--this.active===0)delete this.that.__zooming,this.emit("end");return this},emit:function(S){var b=j1(this.that).datum();Y.call(S,this.that,new _6(S,{sourceEvent:this.sourceEvent,target:B,type:S,transform:this.that.__zoom,dispatch:Y}),b)}};function k(S,...b){if(!_.apply(this,arguments))return;var j=C(this,b).event(S),x=this.__zoom,V=Math.max(G[0],Math.min(G[1],x.k*Math.pow(2,q.apply(this,arguments)))),D=x1(S);if(j.wheel){if(j.mouse[0][0]!==D[0]||j.mouse[0][1]!==D[1])j.mouse[1]=x.invert(j.mouse[0]=D);clearTimeout(j.wheel)}else if(x.k===V)return;else j.mouse=[D,x.invert(D)],u0(this),j.start();J2(S),j.wheel=setTimeout(f,W),j.zoom("mouse",J(A(w(x,V),j.mouse[0],j.mouse[1]),j.extent,Z));function f(){j.wheel=null,j.end()}}function N(S,...b){if(L||!_.apply(this,arguments))return;var j=S.currentTarget,x=C(this,b,!0).event(S),V=j1(S.view).on("mousemove.zoom",p,!0).on("mouseup.zoom",u,!0),D=x1(S,j),f=S.clientX,y=S.clientY;f2(S.view),o5(S),x.mouse=[D,this.__zoom.invert(D)],u0(this),x.start();function p(s){if(J2(s),!x.moved){var t=s.clientX-f,a=s.clientY-y;x.moved=t*t+a*a>O}x.event(s).zoom("mouse",J(A(x.that.__zoom,x.mouse[0]=x1(s,j),x.mouse[1]),x.extent,Z))}function u(s){V.on("mousemove.zoom mouseup.zoom",null),i2(s.view,x.moved),J2(s),x.event(s).end()}}function v(S,...b){if(!_.apply(this,arguments))return;var j=this.__zoom,x=x1(S.changedTouches?S.changedTouches[0]:S,this),V=j.invert(x),D=j.k*(S.shiftKey?0.5:2),f=J(A(w(j,D),x,V),Q.apply(this,b),Z);if(J2(S),F>0)j1(this).transition().duration(F).call(I,f,x,S);else j1(this).call(B.transform,f,x,S)}function E(S,...b){if(!_.apply(this,arguments))return;var j=S.touches,x=j.length,V=C(this,b,S.changedTouches.length===x).event(S),D,f,y,p;o5(S);for(f=0;f<x;++f)if(y=j[f],p=x1(y,this),p=[p,this.__zoom.invert(p),y.identifier],!V.touch0)V.touch0=p,D=!0,V.taps=1+!!X;else if(!V.touch1&&V.touch0[2]!==p[2])V.touch1=p,V.taps=0;if(X)X=clearTimeout(X);if(D){if(V.taps<2)K=p[0],X=setTimeout(function(){X=null},z);u0(this),V.start()}}function g(S,...b){if(!this.__zooming)return;var j=C(this,b).event(S),x=S.changedTouches,V=x.length,D,f,y,p;J2(S);for(D=0;D<V;++D)if(f=x[D],y=x1(f,this),j.touch0&&j.touch0[2]===f.identifier)j.touch0[0]=y;else if(j.touch1&&j.touch1[2]===f.identifier)j.touch1[0]=y;if(f=j.that.__zoom,j.touch1){var u=j.touch0[0],s=j.touch0[1],t=j.touch1[0],a=j.touch1[1],d=(d=t[0]-u[0])*d+(d=t[1]-u[1])*d,c=(c=a[0]-s[0])*c+(c=a[1]-s[1])*c;f=w(f,Math.sqrt(d/c)),y=[(u[0]+t[0])/2,(u[1]+t[1])/2],p=[(s[0]+a[0])/2,(s[1]+a[1])/2]}else if(j.touch0)y=j.touch0[0],p=j.touch0[1];else return;j.zoom("touch",J(A(f,y,p),j.extent,Z))}function h(S,...b){if(!this.__zooming)return;var j=C(this,b).event(S),x=S.changedTouches,V=x.length,D,f;if(o5(S),L)clearTimeout(L);L=setTimeout(function(){L=null},z);for(D=0;D<V;++D)if(f=x[D],j.touch0&&j.touch0[2]===f.identifier)delete j.touch0;else if(j.touch1&&j.touch1[2]===f.identifier)delete j.touch1;if(j.touch1&&!j.touch0)j.touch0=j.touch1,delete j.touch1;if(j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2){if(f=x1(f,this),Math.hypot(K[0]-f[0],K[1]-f[1])<T){var y=j1(this).on("dblclick.zoom");if(y)y.apply(this,arguments)}}}return B.wheelDelta=function(S){return arguments.length?(q=typeof S==="function"?S:X5(+S),B):q},B.filter=function(S){return arguments.length?(_=typeof S==="function"?S:X5(!!S),B):_},B.touchable=function(S){return arguments.length?(U=typeof S==="function"?S:X5(!!S),B):U},B.extent=function(S){return arguments.length?(Q=typeof S==="function"?S:X5([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),B):Q},B.scaleExtent=function(S){return arguments.length?(G[0]=+S[0],G[1]=+S[1],B):[G[0],G[1]]},B.translateExtent=function(S){return arguments.length?(Z[0][0]=+S[0][0],Z[1][0]=+S[1][0],Z[0][1]=+S[0][1],Z[1][1]=+S[1][1],B):[[Z[0][0],Z[0][1]],[Z[1][0],Z[1][1]]]},B.constrain=function(S){return arguments.length?(J=S,B):J},B.duration=function(S){return arguments.length?(F=+S,B):F},B.interpolate=function(S){return arguments.length?(H=S,B):H},B.on=function(){var S=Y.on.apply(Y,arguments);return S===Y?B:S},B.clickDistance=function(S){return arguments.length?(O=(S=+S)*S,B):Math.sqrt(O)},B.tapDistance=function(S){return arguments.length?(T=+S,B):T},B}var i1={error001:(_="react")=>`Seems like you have not used ${_==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${_}flow.dev/error#001`,error002:()=>"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.",error003:(_)=>`Node type "${_}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:(_)=>`The old edge with id=${_} does not exist.`,error009:(_)=>`Marker type "${_}" doesn't exist.`,error008:(_,{id:Q,sourceHandle:J,targetHandle:q})=>`Couldn't create edge for ${_} handle id: "${_==="source"?J:q}", edge id: ${Q}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:(_)=>`Edge type "${_}" not found. Using fallback type "default".`,error012:(_)=>`Node with id "${_}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(_="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${_}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:(_)=>`Edge with id "${_}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},v2=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],U6=["Enter"," ","Escape"],G6={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:_,x:Q,y:J})=>`Moved selected node ${_}. New position, x: ${Q}, y: ${J}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},E0;(function(_){_.Strict="strict",_.Loose="loose"})(E0||(E0={}));var I0;(function(_){_.Free="free",_.Vertical="vertical",_.Horizontal="horizontal"})(I0||(I0={}));var $2;(function(_){_.Partial="partial",_.Full="full"})($2||($2={}));var Z6={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},W0;(function(_){_.Bezier="default",_.Straight="straight",_.Step="step",_.SmoothStep="smoothstep",_.SimpleBezier="simplebezier"})(W0||(W0={}));var k2;(function(_){_.Arrow="arrow",_.ArrowClosed="arrowclosed"})(k2||(k2={}));var J1;(function(_){_.Left="left",_.Top="top",_.Right="right",_.Bottom="bottom"})(J1||(J1={}));var r8={[J1.Left]:J1.Right,[J1.Right]:J1.Left,[J1.Top]:J1.Bottom,[J1.Bottom]:J1.Top},F6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("source"in _)&&("target"in _),U7=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("position"in _)&&!("source"in _)&&!("target"in _),K6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("internals"in _)&&!("source"in _)&&!("target"in _);var W5=(_,Q=[0,0])=>{let{width:J,height:q}=Q0(_),U=_.origin??Q,G=J*U[0],Z=q*U[1];return{x:_.position.x-G,y:_.position.y-Z}},H6=(_,Q={nodeOrigin:[0,0]})=>{if(!Q.nodeLookup)console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.");if(_.length===0)return{x:0,y:0,width:0,height:0};let J=!1,q=_.reduce((U,G)=>{let Z=typeof G==="string",F=!Q.nodeLookup&&!Z?G:void 0;if(Q.nodeLookup)F=Z?Q.nodeLookup.get(G):!K6(G)?Q.nodeLookup.get(G.id):G;if(!F)return U;return J=!0,$4(U,_4(F,Q.nodeOrigin))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return J?q4(q):{x:0,y:0,width:0,height:0}},Z2=(_,Q={})=>{let J={x:1/0,y:1/0,x2:-1/0,y2:-1/0},q=!1;return _.forEach((U)=>{if(Q.filter===void 0||Q.filter(U))J=$4(J,_4(U)),q=!0}),q?q4(J):{x:0,y:0,width:0,height:0}},Q4=(_,Q,[J,q,U]=[0,0,1],G=!1,Z=!1)=>{let F=(Q.x-J)/U,H=(Q.y-q)/U,Y=Q.width/U,X=Q.height/U,K=[];for(let L of _.values()){let{measured:z,selectable:W=!0,hidden:O=!1}=L;if(Z&&!W||O)continue;let T=z.width??L.width??L.initialWidth??0,B=z.height??L.height??L.initialHeight??0,{x:w,y:A}=L.internals.positionAbsolute,R=H7(F,H,Y,X,w,A,T,B),I=T*B,C=G&&R>0;if(!L.internals.handleBounds||C||R>=I||L.dragging)K.push(L)}return K},G7=(_,Q)=>{let J=new Set;return _.forEach((q)=>{J.add(q.id)}),Q.filter((q)=>J.has(q.source)||J.has(q.target))};function Uq(_,Q){let J=new Map,q=Q?.nodes?new Set(Q.nodes.map((U)=>U.id)):null;return _.forEach((U)=>{let G;if(Q?.includeHiddenNodes){let{width:Z,height:F}=Q0(U);G=Z>0&&F>0}else G=Boolean(U.measured.width&&U.measured.height&&!U.hidden);if(G&&(!q||q.has(U.id)))J.set(U.id,U)}),J}async function Z7({nodes:_,width:Q,height:J,panZoom:q,minZoom:U,maxZoom:G},Z){if(_.size===0)return!0;let F=Uq(_,Z),H=Z2(F),Y=B5(H,Q,J,Z?.minZoom??U,Z?.maxZoom??G,Z?.padding??0.1);return await q.setViewport(Y,{duration:Z?.duration,ease:Z?.ease,interpolate:Z?.interpolate}),!0}function X6({nodeId:_,nextPosition:Q,nodeLookup:J,nodeOrigin:q=[0,0],nodeExtent:U,onError:G}){let Z=J.get(_),F=Z.parentId?J.get(Z.parentId):void 0,{x:H,y:Y}=F?F.internals.positionAbsolute:{x:0,y:0},X=Z.origin??q,K=Z.extent||U;if(Z.extent==="parent"&&!Z.expandParent)if(!F)G?.("005",i1.error005());else{let{width:z,height:W}=Q0(F);if(z&&W)K=[[H,Y],[H+z,Y+W]]}else if(F&&G2(Z.extent))K=[[Z.extent[0][0]+H,Z.extent[0][1]+Y],[Z.extent[1][0]+H,Z.extent[1][1]+Y]];let L=G2(K)?q2(Q,K,Z.measured):Q;if(Z.measured.width===void 0||Z.measured.height===void 0)G?.("015",i1.error015());return{position:{x:L.x-H+(Z.measured.width??0)*X[0],y:L.y-Y+(Z.measured.height??0)*X[1]},positionAbsolute:L}}async function F7({nodesToRemove:_=[],edgesToRemove:Q=[],nodes:J,edges:q,onBeforeDelete:U}){let G=new Set(_.map((L)=>L.id)),Z=[];for(let L of J){if(L.deletable===!1)continue;let z=G.has(L.id),W=!z&&L.parentId&&Z.find((O)=>O.id===L.parentId);if(z||W)Z.push(L)}let F=new Set(Q.map((L)=>L.id)),H=q.filter((L)=>L.deletable!==!1),X=G7(Z,H);for(let L of H)if(F.has(L.id)&&!X.find((W)=>W.id===L.id))X.push(L);if(!U)return{edges:X,nodes:Z};let K=await U({nodes:Z,edges:X});if(typeof K==="boolean")return K?{edges:X,nodes:Z}:{edges:[],nodes:[]};return K}var y2=(_,Q=0,J=1)=>Math.min(Math.max(_,Q),J),q2=(_={x:0,y:0},Q,J)=>({x:y2(_.x,Q[0][0],Q[1][0]-(J?.width??0)),y:y2(_.y,Q[0][1],Q[1][1]-(J?.height??0))});function K7(_,Q,J){let{width:q,height:U}=Q0(J),{x:G,y:Z}=J.internals.positionAbsolute;return q2(_,[[G,Z],[G+q,Z+U]],Q)}var i8=(_,Q,J)=>{if(_<Q)return y2(Math.abs(_-Q),1,Q)/Q;else if(_>J)return-y2(Math.abs(_-J),1,Q)/Q;return 0},J4=(_,Q,J=15,q=40)=>{let U=i8(_.x,q,Q.width-q)*J,G=i8(_.y,q,Q.height-q)*J;return[U,G]},$4=(_,Q)=>({x:Math.min(_.x,Q.x),y:Math.min(_.y,Q.y),x2:Math.max(_.x2,Q.x2),y2:Math.max(_.y2,Q.y2)}),q6=({x:_,y:Q,width:J,height:q})=>({x:_,y:Q,x2:_+J,y2:Q+q}),q4=({x:_,y:Q,x2:J,y2:q})=>({x:_,y:Q,width:J-_,height:q-Q}),j2=(_,Q=[0,0])=>{let{x:J,y:q}=K6(_)?_.internals.positionAbsolute:W5(_,Q);return{x:J,y:q,width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}},_4=(_,Q=[0,0])=>{let{x:J,y:q}=K6(_)?_.internals.positionAbsolute:W5(_,Q);return{x:J,y:q,x2:J+(_.measured?.width??_.width??_.initialWidth??0),y2:q+(_.measured?.height??_.height??_.initialHeight??0)}},Y6=(_,Q)=>q4($4(q6(_),q6(Q))),H7=(_,Q,J,q,U,G,Z,F)=>{let H=Math.max(0,Math.min(_+J,U+Z)-Math.max(_,U)),Y=Math.max(0,Math.min(Q+q,G+F)-Math.max(Q,G));return Math.ceil(H*Y)},A5=(_,Q)=>H7(_.x,_.y,_.width,_.height,Q.x,Q.y,Q.width,Q.height),L6=(_)=>e1(_.width)&&e1(_.height)&&e1(_.x)&&e1(_.y),e1=(_)=>!isNaN(_)&&isFinite(_),z6=(_,Q)=>(J,q)=>{console.warn(`[${_}]: ${q} Help: ${Q}error#${J}`)},V2=(_,Q=[1,1])=>{return{x:Q[0]*Math.round(_.x/Q[0]),y:Q[1]*Math.round(_.y/Q[1])}},u2=({x:_,y:Q},[J,q,U],G=!1,Z=[1,1])=>{let F={x:(_-J)/U,y:(Q-q)/U};return G?V2(F,Z):F},U2=({x:_,y:Q},[J,q,U])=>{return{x:_*U+J,y:Q*U+q}};function S2(_,Q){if(typeof _==="number")return Math.floor((Q-Q/(1+_))*0.5);if(typeof _==="string"&&_.endsWith("px")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(J)}if(typeof _==="string"&&_.endsWith("%")){let J=parseFloat(_);if(!Number.isNaN(J))return Math.floor(Q*J*0.01)}return console.error(`The padding value "${_}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Gq(_,Q,J){if(typeof _==="string"||typeof _==="number"){let q=S2(_,J),U=S2(_,Q);return{top:q,right:U,bottom:q,left:U,x:U*2,y:q*2}}if(typeof _==="object"){let q=S2(_.top??_.y??0,J),U=S2(_.bottom??_.y??0,J),G=S2(_.left??_.x??0,Q),Z=S2(_.right??_.x??0,Q);return{top:q,right:Z,bottom:U,left:G,x:G+Z,y:q+U}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Zq(_,Q,J,q,U,G){let{x:Z,y:F}=U2(_,[Q,J,q]),{x:H,y:Y}=U2({x:_.x+_.width,y:_.y+_.height},[Q,J,q]),X=U-H,K=G-Y;return{left:Math.floor(Z),top:Math.floor(F),right:Math.floor(X),bottom:Math.floor(K)}}var B5=(_,Q,J,q,U,G)=>{let Z=Gq(G,Q,J),F=(Q-Z.x)/_.width,H=(J-Z.y)/_.height,Y=Math.min(F,H),X=y2(Y,q,U),K=_.x+_.width/2,L=_.y+_.height/2,z=Q/2-K*X,W=J/2-L*X,O=Zq(_,z,W,X,Q,J),T={left:Math.min(O.left-Z.left,0),top:Math.min(O.top-Z.top,0),right:Math.min(O.right-Z.right,0),bottom:Math.min(O.bottom-Z.bottom,0)};return{x:z-T.left+T.right,y:W-T.top+T.bottom,zoom:X}},b2=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function G2(_){return _!==void 0&&_!==null&&_!=="parent"}function Q0(_){return{width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}}function W6(_){return(_.measured?.width??_.width??_.initialWidth)!==void 0&&(_.measured?.height??_.height??_.initialHeight)!==void 0}function A6(_,Q={width:0,height:0},J,q,U){let G={..._},Z=q.get(J);if(Z){let F=Z.origin||U;G.x+=Z.internals.positionAbsolute.x-(Q.width??0)*F[0],G.y+=Z.internals.positionAbsolute.y-(Q.height??0)*F[1]}return G}function B6(_,Q){if(_.size!==Q.size)return!1;for(let J of _)if(!Q.has(J))return!1;return!0}function X7(){let _,Q;return{promise:new Promise((q,U)=>{_=q,Q=U}),resolve:_,reject:Q}}function Y7(_){return{...G6,..._||{}}}function Fq(_){if(typeof document>"u")return!0;let Q=document.querySelector(`.${_}-flow__pane`);if(!Q||!Q.isConnected)return!0;let J=getComputedStyle(Q);if(J.display==="none")return!0;if(J.visibility==="hidden"||J.visibility==="collapse")return!0;if(J.opacity==="0")return!0;if(J.width==="0"&&J.height==="0")return!0;let q=Q.getBoundingClientRect();if(q.width===0&&q.height===0)return!0;let U=document.querySelector(`.${_}-flow__attribution`);if(!U||!U.isConnected)return!1;let G=getComputedStyle(U);if(G.display==="none")return!1;if(G.visibility==="hidden"||G.visibility==="collapse")return!1;if(G.opacity==="0")return!1;let Z=U.getBoundingClientRect();if(Z.width===0&&Z.height===0)return!1;return!0}var d8=!1;function L7(_){if(d8)return;d8=!0;let Q=`${_.charAt(0).toUpperCase()+_.slice(1)} Flow`;setTimeout(()=>{if(!Fq(_))console.warn(`${Q}: It seems like you are hiding the attribution. Please only do this when you are subscribed to ${Q} Pro: https://${_}flow.dev/remove-attr
28
+ %cYou can ignore this warning if you are subscribed.`,"font-style: italic;")},1000)}function M6(_){return _===null?null:_?"valid":"invalid"}function z5(_,{snapGrid:Q=[0,0],snapToGrid:J=!1,transform:q,containerBounds:U}){let{x:G,y:Z}=_0(_),F=u2({x:G-(U?.left??0),y:Z-(U?.top??0)},q),{x:H,y:Y}=J?V2(F,Q):F;return{xSnapped:H,ySnapped:Y,...F}}var U4=(_)=>({width:_.offsetWidth,height:_.offsetHeight}),T6=(_)=>_?.getRootNode?.()||window?.document,Kq=["INPUT","SELECT","TEXTAREA"];function R6(_){let Q=_.composedPath?.()?.[0]||_.target;if(Q?.nodeType!==1)return!1;return Kq.includes(Q.nodeName)||Q.hasAttribute("contenteditable")||!!Q.closest(".nokey")}var O6=(_)=>("clientX"in _),_0=(_,Q)=>{let J=O6(_),q=J?_.clientX:_.touches?.[0].clientX,U=J?_.clientY:_.touches?.[0].clientY;return{x:q-(Q?.left??0),y:U-(Q?.top??0)}},a8=(_,Q,J,q,U)=>{let G=Q.querySelectorAll(`.${_}`);if(!G||!G.length)return null;return Array.from(G).map((Z)=>{let F=Z.getBoundingClientRect();return{id:Z.getAttribute("data-handleid"),type:_,nodeId:U,position:Z.getAttribute("data-handlepos"),x:(F.left-J.left)/q,y:(F.top-J.top)/q,...U4(Z)}})};function G4({sourceX:_,sourceY:Q,targetX:J,targetY:q,sourceControlX:U,sourceControlY:G,targetControlX:Z,targetControlY:F}){let H=_*0.125+U*0.375+Z*0.375+J*0.125,Y=Q*0.125+G*0.375+F*0.375+q*0.125,X=Math.abs(H-_),K=Math.abs(Y-Q);return[H,Y,X,K]}function n5(_,Q){if(_>=0)return 0.5*_;return Q*25*Math.sqrt(-_)}function s8({pos:_,x1:Q,y1:J,x2:q,y2:U,c:G}){switch(_){case J1.Left:return[Q-n5(Q-q,G),J];case J1.Right:return[Q+n5(q-Q,G),J];case J1.Top:return[Q,J-n5(J-U,G)];case J1.Bottom:return[Q,J+n5(U-J,G)]}}function Z4({sourceX:_,sourceY:Q,sourcePosition:J=J1.Bottom,targetX:q,targetY:U,targetPosition:G=J1.Top,curvature:Z=0.25}){let[F,H]=s8({pos:J,x1:_,y1:Q,x2:q,y2:U,c:Z}),[Y,X]=s8({pos:G,x1:q,y1:U,x2:_,y2:Q,c:Z}),[K,L,z,W]=G4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:F,sourceControlY:H,targetControlX:Y,targetControlY:X});return[`M${_},${Q} C${F},${H} ${Y},${X} ${q},${U}`,K,L,z,W]}function f6({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let U=Math.abs(J-_)/2,G=J<_?J+U:J-U,Z=Math.abs(q-Q)/2,F=q<Q?q+Z:q-Z;return[G,F,U,Z]}function z7({sourceNode:_,targetNode:Q,selected:J=!1,zIndex:q=0,elevateOnSelect:U=!1,zIndexMode:G="basic"}){if(G==="manual")return q;let Z=U&&J?q+1000:q,F=Math.max(_.parentId||U&&_.selected?_.internals.z:0,Q.parentId||U&&Q.selected?Q.internals.z:0);return Z+F}function W7({sourceNode:_,targetNode:Q,width:J,height:q,transform:U}){let G=$4(_4(_),_4(Q));if(G.x===G.x2)G.x2+=1;if(G.y===G.y2)G.y2+=1;let Z={x:-U[0]/U[2],y:-U[1]/U[2],width:J/U[2],height:q/U[2]};return A5(Z,q4(G))>0}var Hq=({source:_,sourceHandle:Q,target:J,targetHandle:q})=>`xy-edge__${_}${Q||""}-${J}${q||""}`,Xq=(_,Q)=>{return Q.some((J)=>J.source===_.source&&J.target===_.target&&(J.sourceHandle===_.sourceHandle||!J.sourceHandle&&!_.sourceHandle)&&(J.targetHandle===_.targetHandle||!J.targetHandle&&!_.targetHandle))},A7=(_,Q,J={})=>{if(!_.source||!_.target)return J.onError?.("006",i1.error006()),Q;let q=J.getEdgeId||Hq,U;if(F6(_))U={..._};else U={..._,id:q(_)};if(Xq(U,Q))return Q;if(U.sourceHandle===null)delete U.sourceHandle;if(U.targetHandle===null)delete U.targetHandle;return Q.concat(U)};function F4({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let[U,G,Z,F]=f6({sourceX:_,sourceY:Q,targetX:J,targetY:q});return[`M ${_},${Q}L ${J},${q}`,U,G,Z,F]}var t8={[J1.Left]:{x:-1,y:0},[J1.Right]:{x:1,y:0},[J1.Top]:{x:0,y:-1},[J1.Bottom]:{x:0,y:1}},Yq=({source:_,sourcePosition:Q=J1.Bottom,target:J})=>{if(Q===J1.Left||Q===J1.Right)return _.x<J.x?{x:1,y:0}:{x:-1,y:0};return _.y<J.y?{x:0,y:1}:{x:0,y:-1}},o8=(_,Q)=>Math.sqrt(Math.pow(Q.x-_.x,2)+Math.pow(Q.y-_.y,2));function Lq({source:_,sourcePosition:Q=J1.Bottom,target:J,targetPosition:q=J1.Top,center:U,offset:G,stepPosition:Z}){let F=t8[Q],H=t8[q],Y={x:_.x+F.x*G,y:_.y+F.y*G},X={x:J.x+H.x*G,y:J.y+H.y*G},K=Yq({source:Y,sourcePosition:Q,target:X}),L=K.x!==0?"x":"y",z=K[L],W=[],O,T,B={x:0,y:0},w={x:0,y:0},[,,A,R]=f6({sourceX:_.x,sourceY:_.y,targetX:J.x,targetY:J.y});if(F[L]*H[L]===-1){if(L==="x")O=U.x??Y.x+(X.x-Y.x)*Z,T=U.y??(Y.y+X.y)/2;else O=U.x??(Y.x+X.x)/2,T=U.y??Y.y+(X.y-Y.y)*Z;let k=[{x:O,y:Y.y},{x:O,y:X.y}],N=[{x:Y.x,y:T},{x:X.x,y:T}];if(F[L]===z)W=L==="x"?k:N;else W=L==="x"?N:k}else{let k=[{x:Y.x,y:X.y}],N=[{x:X.x,y:Y.y}];if(L==="x")W=F.x===z?N:k;else W=F.y===z?k:N;if(Q===q){let S=Math.abs(_[L]-J[L]);if(S<=G){let b=Math.min(G-1,G-S);if(F[L]===z)B[L]=(Y[L]>_[L]?-1:1)*b;else w[L]=(X[L]>J[L]?-1:1)*b}}if(Q!==q){let S=L==="x"?"y":"x",b=F[L]===H[S],j=Y[S]>X[S],x=Y[S]<X[S];if(F[L]===1&&(!b&&j||b&&x)||F[L]!==1&&(!b&&x||b&&j))W=L==="x"?k:N}let v={x:Y.x+B.x,y:Y.y+B.y},E={x:X.x+w.x,y:X.y+w.y},g=Math.max(Math.abs(v.x-W[0].x),Math.abs(E.x-W[0].x)),h=Math.max(Math.abs(v.y-W[0].y),Math.abs(E.y-W[0].y));if(g>=h)O=(v.x+E.x)/2,T=W[0].y;else O=W[0].x,T=(v.y+E.y)/2}let I={x:Y.x+B.x,y:Y.y+B.y},C={x:X.x+w.x,y:X.y+w.y};return[[_,...I.x!==W[0].x||I.y!==W[0].y?[I]:[],...W,...C.x!==W[W.length-1].x||C.y!==W[W.length-1].y?[C]:[],J],O,T,A,R]}function zq(_,Q,J,q){let U=Math.min(o8(_,Q)/2,o8(Q,J)/2,q),{x:G,y:Z}=Q;if(_.x===G&&G===J.x||_.y===Z&&Z===J.y)return`L${G} ${Z}`;if(_.y===Z){let Y=_.x<J.x?-1:1,X=_.y<J.y?1:-1;return`L ${G+U*Y},${Z}Q ${G},${Z} ${G},${Z+U*X}`}let F=_.x<J.x?1:-1,H=_.y<J.y?-1:1;return`L ${G},${Z+U*H}Q ${G},${Z} ${G+U*F},${Z}`}function M5({sourceX:_,sourceY:Q,sourcePosition:J=J1.Bottom,targetX:q,targetY:U,targetPosition:G=J1.Top,borderRadius:Z=5,centerX:F,centerY:H,offset:Y=20,stepPosition:X=0.5}){let[K,L,z,W,O]=Lq({source:{x:_,y:Q},sourcePosition:J,target:{x:q,y:U},targetPosition:G,center:{x:F,y:H},offset:Y,stepPosition:X}),T=`M${K[0].x} ${K[0].y}`;for(let B=1;B<K.length-1;B++)T+=zq(K[B-1],K[B],K[B+1],Z);return T+=`L${K[K.length-1].x} ${K[K.length-1].y}`,[T,L,z,W,O]}function n8(_){return _&&!!(_.internals.handleBounds||_.handles?.length)&&!!(_.measured.width||_.width||_.initialWidth)}function B7(_){let{sourceNode:Q,targetNode:J}=_;if(!n8(Q)||!n8(J))return null;let q=Q.internals.handleBounds||e8(Q.handles),U=J.internals.handleBounds||e8(J.handles),G=_7(q?.source??[],_.sourceHandle),Z=_7(_.connectionMode===E0.Strict?U?.target??[]:(U?.target??[]).concat(U?.source??[]),_.targetHandle);if(!G||!Z)return _.onError?.("008",i1.error008(!G?"source":"target",{id:_.id,sourceHandle:_.sourceHandle,targetHandle:_.targetHandle})),null;let F=G?.position||J1.Bottom,H=Z?.position||J1.Top,Y=x0(Q,G,F),X=x0(J,Z,H);return{sourceX:Y.x,sourceY:Y.y,targetX:X.x,targetY:X.y,sourcePosition:F,targetPosition:H}}function e8(_){if(!_)return null;let Q=[],J=[];for(let q of _)if(q.width=q.width??1,q.height=q.height??1,q.type==="source")Q.push(q);else if(q.type==="target")J.push(q);return{source:Q,target:J}}function x0(_,Q,J=J1.Left,q=!1){let U=(Q?.x??0)+_.internals.positionAbsolute.x,G=(Q?.y??0)+_.internals.positionAbsolute.y,{width:Z,height:F}=Q??Q0(_);if(q)return{x:U+Z/2,y:G+F/2};switch(Q?.position??J){case J1.Top:return{x:U+Z/2,y:G};case J1.Right:return{x:U+Z,y:G+F/2};case J1.Bottom:return{x:U+Z/2,y:G+F};case J1.Left:return{x:U,y:G+F/2}}}function _7(_,Q){if(!_)return null;return(!Q?_[0]:_.find((J)=>J.id===Q))||null}function K4(_,Q){if(!_)return"";if(typeof _==="string")return _;return`${Q?`${Q}__`:""}${Object.keys(_).sort().map((q)=>`${q}=${_[q]}`).join("&")}`}function M7(_,{id:Q,defaultColor:J,defaultMarkerStart:q,defaultMarkerEnd:U}){let G=new Set;return _.reduce((Z,F)=>{return[F.markerStart||q,F.markerEnd||U].forEach((H)=>{if(H&&typeof H==="object"){let Y=K4(H,Q);if(!G.has(Y))Z.push({id:Y,color:H.color||J,...H}),G.add(Y)}}),Z},[]).sort((Z,F)=>Z.id.localeCompare(F.id))}function T7(_,Q,J,q,U){let G=0.5;if(U==="start")G=0;else if(U==="end")G=1;let Z=[(_.x+_.width*G)*Q.zoom+Q.x,_.y*Q.zoom+Q.y-q],F=[-100*G,-100];switch(J){case J1.Right:Z=[(_.x+_.width)*Q.zoom+Q.x+q,(_.y+_.height*G)*Q.zoom+Q.y],F=[0,-100*G];break;case J1.Bottom:Z[1]=(_.y+_.height)*Q.zoom+Q.y+q,F[1]=0;break;case J1.Left:Z=[_.x*Q.zoom+Q.x-q,(_.y+_.height*G)*Q.zoom+Q.y],F=[-100,-100*G];break}return`translate(${Z[0]}px, ${Z[1]}px) translate(${F[0]}%, ${F[1]}%)`}var R7=1000,Wq=10,I6={nodeOrigin:[0,0],nodeExtent:v2,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Aq={...I6,checkEquality:!0};function w6(_,Q){let J={..._};for(let q in Q)if(Q[q]!==void 0)J[q]=Q[q];return J}function O7(_,Q,J){let q=w6(I6,J);for(let U of _.values())if(U.parentId)N6(U,_,Q,q);else{let G=W5(U,q.nodeOrigin),Z=G2(U.extent)?U.extent:q.nodeExtent,F=q2(G,Z,Q0(U));U.internals.positionAbsolute=F}}function Bq(_,Q){if(!_.handles)return!_.measured?void 0:Q?.internals.handleBounds;let J=[],q=[];for(let U of _.handles){let G={id:U.id,width:U.width??1,height:U.height??1,nodeId:_.id,x:U.x,y:U.y,position:U.position,type:U.type};if(U.type==="source")J.push(G);else if(U.type==="target")q.push(G)}return{source:J,target:q}}function P6(_){return _==="manual"}function H4(_,Q,J,q={}){let U=w6(Aq,q),G={i:0},Z=new Map(Q),F=U?.elevateNodesOnSelect&&!P6(U.zIndexMode)?R7:0,H=_.length>0,Y=!1;Q.clear(),J.clear();for(let X of _){let K=Z.get(X.id);if(U.checkEquality&&X===K?.internals.userNode)Q.set(X.id,K);else{let L=W5(X,U.nodeOrigin),z=G2(X.extent)?X.extent:U.nodeExtent,W=q2(L,z,Q0(X));K={...U.defaults,...X,measured:{width:X.measured?.width,height:X.measured?.height},internals:{positionAbsolute:W,handleBounds:Bq(X,K),z:f7(X,F,U.zIndexMode),userNode:X}},Q.set(X.id,K)}if((K.measured===void 0||K.measured.width===void 0||K.measured.height===void 0)&&!K.hidden)H=!1;if(X.parentId)N6(K,Q,J,q,G);Y||=X.selected??!1}return{nodesInitialized:H,hasSelectedNodes:Y}}function Mq(_,Q){if(!_.parentId)return;let J=Q.get(_.parentId);if(J)J.set(_.id,_);else Q.set(_.parentId,new Map([[_.id,_]]))}function N6(_,Q,J,q,U){let{elevateNodesOnSelect:G,nodeOrigin:Z,nodeExtent:F,zIndexMode:H}=w6(I6,q),Y=_.parentId,X=Q.get(Y);if(!X){console.warn(`Parent node ${Y} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}if(Mq(_,J),U&&!X.parentId&&X.internals.rootParentIndex===void 0&&H==="auto")X.internals.rootParentIndex=++U.i,X.internals.z=X.internals.z+U.i*Wq;if(U&&X.internals.rootParentIndex!==void 0)U.i=X.internals.rootParentIndex;let K=G&&!P6(H)?R7:0,{x:L,y:z,z:W}=Tq(_,X,Z,F,K,H),{positionAbsolute:O}=_.internals,T=L!==O.x||z!==O.y;if(T||W!==_.internals.z)Q.set(_.id,{..._,internals:{..._.internals,positionAbsolute:T?{x:L,y:z}:O,z:W}})}function f7(_,Q,J){let q=e1(_.zIndex)?_.zIndex:0;if(P6(J))return q;return q+(_.selected?Q:0)}function Tq(_,Q,J,q,U,G){let{x:Z,y:F}=Q.internals.positionAbsolute,H=Q0(_),Y=W5(_,J),X=G2(_.extent)?q2(Y,_.extent,H):Y,K=q2({x:Z+X.x,y:F+X.y},q,H);if(_.extent==="parent")K=K7(K,H,Q);let L=f7(_,U,G),z=Q.internals.z??0;return{x:K.x,y:K.y,z:z>=L?z+1:L}}function X4(_,Q,J,q=[0,0]){let U=[],G=new Map;for(let Z of _){let F=Q.get(Z.parentId);if(!F)continue;let H=G.get(Z.parentId)?.expandedRect??j2(F),Y=Y6(H,Z.rect);G.set(Z.parentId,{expandedRect:Y,parent:F})}if(G.size>0)G.forEach(({expandedRect:Z,parent:F},H)=>{let Y=F.internals.positionAbsolute,X=Q0(F),K=F.origin??q,L=Z.x<Y.x?Math.round(Math.abs(Y.x-Z.x)):0,z=Z.y<Y.y?Math.round(Math.abs(Y.y-Z.y)):0,W=Math.max(X.width,Math.round(Z.width)),O=Math.max(X.height,Math.round(Z.height)),T=(W-X.width)*K[0],B=(O-X.height)*K[1];if(L>0||z>0||T||B)U.push({id:H,type:"position",position:{x:F.position.x-L+T,y:F.position.y-z+B}}),J.get(H)?.forEach((w)=>{if(!_.some((A)=>A.id===w.id))U.push({id:w.id,type:"position",position:{x:w.position.x+L,y:w.position.y+z}})});if(X.width<Z.width||X.height<Z.height||L||z)U.push({id:H,type:"dimensions",setAttributes:!0,dimensions:{width:W+(L?K[0]*L-T:0),height:O+(z?K[1]*z-B:0)}})});return U}function I7(_,Q,J,q,U,G,Z){let F=q?.querySelector(".xyflow__viewport"),H=!1;if(!F)return{changes:[],updatedInternals:H};let Y=[],X=window.getComputedStyle(F),{m22:K}=new window.DOMMatrixReadOnly(X.transform),L=[];for(let z of _.values()){let W=Q.get(z.id);if(!W)continue;if(W.hidden){Q.set(W.id,{...W,internals:{...W.internals,handleBounds:void 0}}),H=!0;continue}let O=U4(z.nodeElement),T=W.measured.width!==O.width||W.measured.height!==O.height;if(!!(O.width&&O.height&&(T||!W.internals.handleBounds||z.force))){let w=z.nodeElement.getBoundingClientRect(),A=G2(W.extent)?W.extent:G,{positionAbsolute:R}=W.internals;if(W.parentId&&W.extent==="parent"){let C=Q.get(W.parentId);if(C)R=K7(R,O,C)}else if(A)R=q2(R,A,O);let I={...W,measured:O,internals:{...W.internals,positionAbsolute:R,handleBounds:{source:a8("source",z.nodeElement,w,K,W.id),target:a8("target",z.nodeElement,w,K,W.id)}}};if(Q.set(W.id,I),W.parentId)N6(I,Q,J,{nodeOrigin:U,zIndexMode:Z});if(H=!0,T){if(Y.push({id:W.id,type:"dimensions",dimensions:O}),W.expandParent&&W.parentId)L.push({id:W.id,parentId:W.parentId,rect:j2(I,U)})}}}if(L.length>0){let z=X4(L,Q,J,U);Y.push(...z)}return{changes:Y,updatedInternals:H}}async function w7({delta:_,panZoom:Q,transform:J,translateExtent:q,width:U,height:G}){if(!Q||!_.x&&!_.y)return!1;let Z=await Q.setViewportConstrained({x:J[0]+_.x,y:J[1]+_.y,zoom:J[2]},[[0,0],[U,G]],q);return!!Z&&(Z.x!==J[0]||Z.y!==J[1]||Z.k!==J[2])}function Q7(_,Q,J,q,U,G){let Z=U,F=q.get(Z)||new Map;q.set(Z,F.set(J,Q)),Z=`${U}-${_}`;let H=q.get(Z)||new Map;if(q.set(Z,H.set(J,Q)),G){Z=`${U}-${_}-${G}`;let Y=q.get(Z)||new Map;q.set(Z,Y.set(J,Q))}}function C6(_,Q,J){_.clear(),Q.clear();for(let q of J){let{source:U,target:G,sourceHandle:Z=null,targetHandle:F=null}=q,H={edgeId:q.id,source:U,target:G,sourceHandle:Z,targetHandle:F},Y=`${U}-${Z}--${G}-${F}`,X=`${G}-${F}--${U}-${Z}`;Q7("source",H,X,_,U,Z),Q7("target",H,Y,_,G,F),Q.set(q.id,q)}}function P7(_,Q){if(!_.parentId)return!1;let J=Q.get(_.parentId);if(!J)return!1;if(J.selected)return!0;return P7(J,Q)}function J7(_,Q,J){let q=_;do{if(q?.matches?.(Q))return!0;if(q===J)return!1;q=q?.parentElement}while(q);return!1}function Rq(_,Q,J,q){let U=new Map;for(let[G,Z]of _)if((Z.selected||Z.id===q)&&(!Z.parentId||!P7(Z,_))&&(Z.draggable||Q&&typeof Z.draggable>"u")){let F=_.get(G);if(F)U.set(G,{id:G,position:F.position||{x:0,y:0},distance:{x:J.x-F.internals.positionAbsolute.x,y:J.y-F.internals.positionAbsolute.y},extent:F.extent,parentId:F.parentId,origin:F.origin,expandParent:F.expandParent,internals:{positionAbsolute:F.internals.positionAbsolute||{x:0,y:0}},measured:{width:F.measured.width??0,height:F.measured.height??0}})}return U}function Q6({nodeId:_,dragItems:Q,nodeLookup:J,dragging:q=!0}){let U=[];for(let[Z,F]of Q){let H=J.get(Z)?.internals.userNode;if(H)U.push({...H,position:F.position,dragging:q})}if(!_)return[U[0],U];let G=J.get(_)?.internals.userNode;return[!G?U[0]:{...G,position:Q.get(_)?.position||G.position,dragging:q},U]}function Oq({dragItems:_,snapGrid:Q,x:J,y:q}){let U=_.values().next().value;if(!U)return null;let G={x:J-U.distance.x,y:q-U.distance.y},Z=V2(G,Q);return{x:Z.x-G.x,y:Z.y-G.y}}function N7({onNodeMouseDown:_,getStoreItems:Q,onDragStart:J,onDrag:q,onDragStop:U}){let G={x:null,y:null},Z=0,F=new Map,H=!1,Y={x:0,y:0},X=null,K=!1,L=null,z=!1,W=!1,O=null;function T({noDragClassName:w,handleSelector:A,domNode:R,isSelectable:I,nodeId:C,nodeClickDistance:P=0}){L=j1(R);function k({x:g,y:h}){let{nodeLookup:S,nodeExtent:b,snapGrid:j,snapToGrid:x,nodeOrigin:V,onNodeDrag:D,onSelectionDrag:f,onError:y,updateNodePositions:p}=Q();G={x:g,y:h};let u=!1,s=F.size>1,t=s&&b?q6(Z2(F)):null,a=s&&x?Oq({dragItems:F,snapGrid:j,x:g,y:h}):null;for(let[d,c]of F){if(!S.has(d))continue;let e={x:g-c.distance.x,y:h-c.distance.y};if(x)e=a?{x:Math.round(e.x+a.x),y:Math.round(e.y+a.y)}:V2(e,j);let Q1=null;if(s&&b&&!c.extent&&t){let{positionAbsolute:Z1}=c.internals,Y1=Z1.x-t.x+b[0][0],K1=Z1.x+c.measured.width-t.x2+b[1][0],o=Z1.y-t.y+b[0][1],z1=Z1.y+c.measured.height-t.y2+b[1][1];Q1=[[Y1,o],[K1,z1]]}let{position:G1,positionAbsolute:$1}=X6({nodeId:d,nextPosition:e,nodeLookup:S,nodeExtent:Q1?Q1:b,nodeOrigin:V,onError:y});u=u||c.position.x!==G1.x||c.position.y!==G1.y,c.position=G1,c.internals.positionAbsolute=$1}if(W=W||u,!u)return;if(p(F,!0),O&&(q||D||!C&&f)){let[d,c]=Q6({nodeId:C,dragItems:F,nodeLookup:S});if(q?.(O,F,d,c),D?.(O,d,c),!C)f?.(O,c)}}async function N(){if(!X)return;let{transform:g,panBy:h,autoPanSpeed:S,autoPanOnNodeDrag:b}=Q();if(!b){H=!1,cancelAnimationFrame(Z);return}let[j,x]=J4(Y,X,S);if(j!==0||x!==0){if(G.x=(G.x??0)-j/g[2],G.y=(G.y??0)-x/g[2],await h({x:j,y:x}))k(G)}Z=requestAnimationFrame(N)}function v(g){let{nodeLookup:h,multiSelectionActive:S,nodesDraggable:b,transform:j,snapGrid:x,snapToGrid:V,selectNodesOnDrag:D,onNodeDragStart:f,onSelectionDragStart:y,unselectNodesAndEdges:p}=Q();if(K=!0,(!D||!I)&&!S&&C){if(!h.get(C)?.selected)p()}if(I&&D&&C)_?.(C);let u=z5(g.sourceEvent,{transform:j,snapGrid:x,snapToGrid:V,containerBounds:X});if(G=u,F=Rq(h,b,u,C),F.size>0&&(J||f||!C&&y)){let[s,t]=Q6({nodeId:C,dragItems:F,nodeLookup:h});if(J?.(g.sourceEvent,F,s,t),f?.(g.sourceEvent,s,t),!C)y?.(g.sourceEvent,t)}}let E=s2().clickDistance(P).on("start",(g)=>{let{domNode:h,nodeDragThreshold:S,transform:b,snapGrid:j,snapToGrid:x}=Q();if(X=h?.getBoundingClientRect()||null,z=!1,W=!1,O=g.sourceEvent,S===0)v(g);G=z5(g.sourceEvent,{transform:b,snapGrid:j,snapToGrid:x,containerBounds:X}),Y=_0(g.sourceEvent,X)}).on("drag",(g)=>{let{autoPanOnNodeDrag:h,transform:S,snapGrid:b,snapToGrid:j,nodeDragThreshold:x,nodeLookup:V}=Q(),D=z5(g.sourceEvent,{transform:S,snapGrid:b,snapToGrid:j,containerBounds:X});if(O=g.sourceEvent,g.sourceEvent.type==="touchmove"&&g.sourceEvent.touches.length>1||C&&!V.has(C))z=!0;if(z)return;if(!H&&h&&K)H=!0,N();if(!K){let f=_0(g.sourceEvent,X),y=f.x-Y.x,p=f.y-Y.y;if(Math.sqrt(y*y+p*p)>x)v(g)}if((G.x!==D.xSnapped||G.y!==D.ySnapped)&&F&&K)Y=_0(g.sourceEvent,X),k(D)}).on("end",(g)=>{if(!K||z){if(z&&F.size>0)Q().updateNodePositions(F,!1);return}if(H=!1,K=!1,cancelAnimationFrame(Z),F.size>0){let{nodeLookup:h,updateNodePositions:S,onNodeDragStop:b,onSelectionDragStop:j}=Q();if(W)S(F,!1),W=!1;if(U||b||!C&&j){let[x,V]=Q6({nodeId:C,dragItems:F,nodeLookup:h,dragging:!1});if(U?.(g.sourceEvent,F,x,V),b?.(g.sourceEvent,x,V),!C)j?.(g.sourceEvent,V)}}}).filter((g)=>{let h=g.target;return!g.button&&(!w||!J7(h,`.${w}`,R))&&(!A||J7(h,A,R))});L.call(E)}function B(){L?.on(".drag",null)}return{update:T,destroy:B}}function fq(_,Q,J){let q=[],U={x:_.x-J,y:_.y-J,width:J*2,height:J*2};for(let G of Q.values())if(A5(U,j2(G))>0)q.push(G);return q}var Iq=250;function wq(_,Q,J,q){let U=[],G=1/0,Z=fq(_,J,Q+Iq);for(let F of Z){let H=[...F.internals.handleBounds?.source??[],...F.internals.handleBounds?.target??[]];for(let Y of H){if(q.nodeId===Y.nodeId&&q.type===Y.type&&q.id===Y.id)continue;let{x:X,y:K}=x0(F,Y,Y.position,!0),L=Math.sqrt(Math.pow(X-_.x,2)+Math.pow(K-_.y,2));if(L>Q)continue;if(L<G)U=[{...Y,x:X,y:K}],G=L;else if(L===G)U.push({...Y,x:X,y:K})}}if(!U.length)return null;if(U.length>1){let F=q.type==="source"?"target":"source";return U.find((H)=>H.type===F)??U[0]}return U[0]}function C7(_,Q,J,q,U,G=!1){let Z=q.get(_);if(!Z)return null;let F=U==="strict"?Z.internals.handleBounds?.[Q]:[...Z.internals.handleBounds?.source??[],...Z.internals.handleBounds?.target??[]],H=(J?F?.find((Y)=>Y.id===J):F?.[0])??null;return H&&G?{...H,...x0(Z,H,H.position,!0)}:H}function S7(_,Q){if(_)return _;else if(Q?.classList.contains("target"))return"target";else if(Q?.classList.contains("source"))return"source";return null}function Pq(_,Q){let J=null;if(Q)J=!0;else if(_&&!Q)J=!1;return J}var k7=()=>!0;function Nq(_,{connectionMode:Q,connectionRadius:J,handleId:q,nodeId:U,edgeUpdaterType:G,isTarget:Z,domNode:F,nodeLookup:H,lib:Y,autoPanOnConnect:X,flowId:K,panBy:L,cancelConnection:z,onConnectStart:W,onConnect:O,onConnectEnd:T,isValidConnection:B=k7,onReconnectEnd:w,updateConnection:A,getTransform:R,getFromHandle:I,autoPanSpeed:C,dragThreshold:P=1,handleDomNode:k}){let N=T6(_.target),v=0,E,{x:g,y:h}=_0(_),S=S7(G,k),b=F?.getBoundingClientRect(),j=!1;if(!b||!S)return;let x=C7(U,S,q,H,Q);if(!x)return;let V=_0(_,b),D=!1,f=null,y=!1,p=null;function u(){if(!X||!b)return;let[G1,$1]=J4(V,b,C);L({x:G1,y:$1}),v=requestAnimationFrame(u)}let s={...x,nodeId:U,type:S,position:x.position},t=H.get(U),d={inProgress:!0,isValid:null,from:x0(t,s,J1.Left,!0),fromHandle:s,fromPosition:s.position,fromNode:t,to:V,toHandle:null,toPosition:r8[s.position],toNode:null,pointer:V};function c(){j=!0,A(d),W?.(_,{nodeId:U,handleId:q,handleType:S})}if(P===0)c();function e(G1){if(!j){let{x:z1,y:q1}=_0(G1),y1=z1-g,c1=q1-h;if(!(y1*y1+c1*c1>P*P))return;c()}if(!I()||!s){Q1(G1);return}let $1=R();if(V=_0(G1,b),E=wq(u2(V,$1,!1,[1,1]),J,H,s),!D)u(),D=!0;let Z1=y7(G1,{handle:E,connectionMode:Q,fromNodeId:U,fromHandleId:q,fromType:Z?"target":"source",isValidConnection:B,doc:N,lib:Y,flowId:K,nodeLookup:H});p=Z1.handleDomNode,f=Z1.connection,y=Pq(!!E,Z1.isValid);let Y1=H.get(U),K1=Y1?x0(Y1,s,J1.Left,!0):d.from,o={...d,from:K1,isValid:y,to:Z1.toHandle&&y?U2({x:Z1.toHandle.x,y:Z1.toHandle.y},$1):V,toHandle:Z1.toHandle,toPosition:y&&Z1.toHandle?Z1.toHandle.position:r8[s.position],toNode:Z1.toHandle?H.get(Z1.toHandle.nodeId):null,pointer:V};A(o),d=o}function Q1(G1){if("touches"in G1&&G1.touches.length>0)return;if(j){if((E||p)&&f&&y)O?.(f);let{inProgress:$1,...Z1}=d,Y1={...Z1,toPosition:d.toHandle?d.toPosition:null};if(T?.(G1,Y1),G)w?.(G1,Y1)}z(),cancelAnimationFrame(v),D=!1,y=!1,f=null,p=null,N.removeEventListener("mousemove",e),N.removeEventListener("mouseup",Q1),N.removeEventListener("touchmove",e),N.removeEventListener("touchend",Q1)}N.addEventListener("mousemove",e),N.addEventListener("mouseup",Q1),N.addEventListener("touchmove",e),N.addEventListener("touchend",Q1)}function y7(_,{handle:Q,connectionMode:J,fromNodeId:q,fromHandleId:U,fromType:G,doc:Z,lib:F,flowId:H,isValidConnection:Y=k7,nodeLookup:X}){let K=G==="target",L=Q?Z.querySelector(`.${F}-flow__handle[data-id="${H}-${Q?.nodeId}-${Q?.id}-${Q?.type}"]`):null,{x:z,y:W}=_0(_),O=Z.elementFromPoint(z,W),T=O?.classList.contains(`${F}-flow__handle`)?O:L,B={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){let w=S7(void 0,T),A=T.getAttribute("data-nodeid"),R=T.getAttribute("data-handleid"),I=T.classList.contains("connectable"),C=T.classList.contains("connectableend");if(!A||!w)return B;let P={source:K?A:q,sourceHandle:K?R:U,target:K?q:A,targetHandle:K?U:R};B.connection=P;let N=I&&C&&(J===E0.Strict?K&&w==="source"||!K&&w==="target":A!==q||R!==U);B.isValid=N&&Y(P),B.toHandle=C7(A,w,R,X,J,!0)}return B}var Y4={onPointerDown:Nq,isValid:y7};function v7({domNode:_,panZoom:Q,getTransform:J,getViewScale:q}){let U=j1(_);function G({translateExtent:F,width:H,height:Y,zoomStep:X=1,pannable:K=!0,zoomable:L=!0,inversePan:z=!1}){let W=(A)=>{if(A.sourceEvent.type!=="wheel"||!Q)return;let R=J(),I=A.sourceEvent.ctrlKey&&b2()?10:1,C=-A.sourceEvent.deltaY*(A.sourceEvent.deltaMode===1?0.05:A.sourceEvent.deltaMode?1:0.002)*X,P=R[2]*Math.pow(2,C*I);Q.scaleTo(P)},O=[0,0],T=(A)=>{if(A.sourceEvent.type==="mousedown"||A.sourceEvent.type==="touchstart")O=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY]},B=(A)=>{let R=J();if(A.sourceEvent.type!=="mousemove"&&A.sourceEvent.type!=="touchmove"||!Q)return;let I=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY],C=[I[0]-O[0],I[1]-O[1]];O=I;let P=q()*Math.max(R[2],Math.log(R[2]))*(z?-1:1),k={x:R[0]-C[0]*P,y:R[1]-C[1]*P},N=[[0,0],[H,Y]];Q.setViewportConstrained({x:k.x,y:k.y,zoom:R[2]},N,F)},w=L5().on("start",T).on("zoom",K?B:null).on("zoom.wheel",L?W:null);U.call(w,{})}function Z(){U.on("zoom",null)}return{update:G,destroy:Z,pointer:x1}}var L4=(_)=>({x:_.x,y:_.y,zoom:_.k}),J6=({x:_,y:Q,zoom:J})=>Q2.translate(_,Q).scale(J),h0=(_,Q)=>_.target.closest(`.${Q}`),j7=(_,Q)=>Q===2&&Array.isArray(_)&&_.includes(2),Cq=(_)=>((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2,$6=(_,Q=0,J=Cq,q=()=>{})=>{let U=typeof Q==="number"&&Q>0;if(!U)q();return U?_.transition().duration(Q).ease(J).on("end",q):_},V7=(_)=>{let Q=_.ctrlKey&&b2()?10:1;return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*Q};function Sq({zoomPanValues:_,noWheelClassName:Q,d3Selection:J,d3Zoom:q,panOnScrollMode:U,panOnScrollSpeed:G,zoomOnPinch:Z,onPanZoomStart:F,onPanZoom:H,onPanZoomEnd:Y}){return(X)=>{if(h0(X,Q)){if(X.ctrlKey)X.preventDefault();return!1}X.preventDefault(),X.stopImmediatePropagation();let K=J.property("__zoom").k||1;if(X.ctrlKey&&Z){let T=x1(X),B=V7(X),w=K*Math.pow(2,B);q.scaleTo(J,w,T,X);return}let L=X.deltaMode===1?20:1,z=U===I0.Vertical?0:X.deltaX*L,W=U===I0.Horizontal?0:X.deltaY*L;if(!b2()&&X.shiftKey&&U!==I0.Vertical)z=X.deltaY*L,W=0;q.translateBy(J,-(z/K)*G,-(W/K)*G,{internal:!0});let O=L4(J.property("__zoom"));if(clearTimeout(_.panScrollTimeout),!_.isPanScrolling)_.isPanScrolling=!0,F?.(X,O);else H?.(X,O);_.panScrollTimeout=setTimeout(()=>{Y?.(X,O),_.isPanScrolling=!1},150)}}function kq({noWheelClassName:_,preventScrolling:Q,d3ZoomHandler:J}){return function(q,U){let G=q.type==="wheel",Z=!Q&&G&&!q.ctrlKey,F=h0(q,_);if(q.ctrlKey&&G&&F)q.preventDefault();if(Z||F)return null;q.preventDefault(),J.call(this,q,U)}}function yq({zoomPanValues:_,onDraggingChange:Q,onPanZoomStart:J}){return(q)=>{if(q.sourceEvent?.internal)return;let U=L4(q.transform);if(_.mouseButton=q.sourceEvent?.button||0,_.isZoomingOrPanning=!0,_.prevViewport=U,q.sourceEvent?.type==="mousedown")Q(!0);if(J)J?.(q.sourceEvent,U)}}function vq({zoomPanValues:_,panOnDrag:Q,onPaneContextMenu:J,onTransformChange:q,onPanZoom:U}){return(G)=>{if(_.usedRightMouseButton=!!(J&&j7(Q,_.mouseButton??0)),!G.sourceEvent?.sync)q([G.transform.x,G.transform.y,G.transform.k]);if(U&&!G.sourceEvent?.internal)U?.(G.sourceEvent,L4(G.transform))}}function jq({zoomPanValues:_,panOnDrag:Q,panOnScroll:J,onDraggingChange:q,onPanZoomEnd:U,onPaneContextMenu:G}){return(Z)=>{if(Z.sourceEvent?.internal)return;if(_.isZoomingOrPanning=!1,G&&j7(Q,_.mouseButton??0)&&!_.usedRightMouseButton&&Z.sourceEvent)G(Z.sourceEvent);if(_.usedRightMouseButton=!1,q(!1),U){let F=L4(Z.transform);_.prevViewport=F,clearTimeout(_.timerId),_.timerId=setTimeout(()=>{U?.(Z.sourceEvent,F)},J?150:0)}}}function Vq({panActivationKeyPressed:_,zoomActivationKeyPressed:Q,zoomOnScroll:J,zoomOnPinch:q,panOnDrag:U,panOnScroll:G,zoomOnDoubleClick:Z,userSelectionActive:F,noWheelClassName:H,noPanClassName:Y,lib:X,connectionInProgress:K}){return(L)=>{let z=Q||J,W=q&&L.ctrlKey,O=L.type==="wheel";if(L.button===1&&L.type==="mousedown"&&(h0(L,`${X}-flow__node`)||h0(L,`${X}-flow__edge`)||h0(L,`${X}-flow__selection`)||h0(L,`${X}-flow__nodesselection`)))return!0;if(!U&&!z&&!G&&!Z&&!q)return!1;if(F)return!1;if(K&&!O)return!1;if(h0(L,H)&&O)return!1;if(h0(L,Y)&&(!O||G&&O&&!Q))return!1;if(!q&&L.ctrlKey&&O)return!1;if(!q&&L.type==="touchstart"&&L.touches?.length>1)return L.preventDefault(),!1;if(!z&&!G&&!W&&O)return!1;if(!U&&(L.type==="mousedown"||L.type==="touchstart"))return!1;if(Array.isArray(U)&&!U.includes(L.button)&&L.type==="mousedown")return!1;let T=Array.isArray(U)&&U.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||O||_)&&T}}function u7({domNode:_,minZoom:Q,maxZoom:J,translateExtent:q,viewport:U,onPanZoom:G,onPanZoomStart:Z,onPanZoomEnd:F,onDraggingChange:H}){let Y={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},X=_.getBoundingClientRect(),K=[[0,0],[X.width,X.height]];(typeof ResizeObserver<"u"?new ResizeObserver((h)=>{let S=h[0];if(S)K=[[0,0],[S.contentRect.width,S.contentRect.height]]}):null)?.observe(_);let z=L5().extent(()=>K).scaleExtent([Q,J]).translateExtent(q),W=j1(_).call(z);R({x:U.x,y:U.y,zoom:y2(U.zoom,Q,J)},[[0,0],[X.width,X.height]],q);let O=W.on("wheel.zoom"),T=W.on("dblclick.zoom");z.wheelDelta(V7);async function B(h,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?z0:e0).transform($6(W,S?.duration,S?.ease,()=>b(!0)),h)});return!1}function w({noWheelClassName:h,noPanClassName:S,onPaneContextMenu:b,userSelectionActive:j,panOnScroll:x,panOnDrag:V,panOnScrollMode:D,panOnScrollSpeed:f,preventScrolling:y,zoomOnPinch:p,zoomOnScroll:u,zoomOnDoubleClick:s,panActivationKeyPressed:t=!1,zoomActivationKeyPressed:a,lib:d,onTransformChange:c,connectionInProgress:e,paneClickDistance:Q1,selectionOnDrag:G1}){if(j&&!Y.isZoomingOrPanning)A();let $1=x&&!a&&!j;z.clickDistance(G1?1/0:!e1(Q1)||Q1<0?0:Q1);let Z1=$1?Sq({zoomPanValues:Y,noWheelClassName:h,d3Selection:W,d3Zoom:z,panOnScrollMode:D,panOnScrollSpeed:f,zoomOnPinch:p,onPanZoomStart:Z,onPanZoom:G,onPanZoomEnd:F}):kq({noWheelClassName:h,preventScrolling:y,d3ZoomHandler:O});W.on("wheel.zoom",Z1,{passive:!1});let Y1=yq({zoomPanValues:Y,onDraggingChange:H,onPanZoomStart:Z});z.on("start",Y1);let K1=vq({zoomPanValues:Y,panOnDrag:V,onPaneContextMenu:!!b,onPanZoom:G,onTransformChange:c});z.on("zoom",K1);let o=jq({zoomPanValues:Y,panOnDrag:V,panOnScroll:x,onPaneContextMenu:b,onPanZoomEnd:F,onDraggingChange:H});z.on("end",o);let z1=Vq({panActivationKeyPressed:t,zoomActivationKeyPressed:a,panOnDrag:V,zoomOnScroll:u,panOnScroll:x,zoomOnDoubleClick:s,zoomOnPinch:p,userSelectionActive:j,noPanClassName:S,noWheelClassName:h,lib:d,connectionInProgress:e});if(z.filter(z1),s)W.on("dblclick.zoom",T);else W.on("dblclick.zoom",null)}function A(){z.on("zoom",null)}async function R(h,S,b){let j=J6(h),x=z?.constrain()(j,S,b);if(x)await B(x);return x}async function I(h,S){let b=J6(h);return await B(b,S),b}function C(h){if(W){let S=J6(h),b=W.property("__zoom");if(b.k!==h.zoom||b.x!==h.x||b.y!==h.y)z?.transform(W,S,null,{sync:!0})}}function P(){let h=W?Y5(W.node()):{x:0,y:0,k:1};return{x:h.x,y:h.y,zoom:h.k}}async function k(h,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?z0:e0).scaleTo($6(W,S?.duration,S?.ease,()=>b(!0)),h)});return!1}async function N(h,S){if(W)return new Promise((b)=>{z?.interpolate(S?.interpolate==="linear"?z0:e0).scaleBy($6(W,S?.duration,S?.ease,()=>b(!0)),h)});return!1}function v(h){z?.scaleExtent(h)}function E(h){z?.translateExtent(h)}function g(h){let S=!e1(h)||h<0?0:h;z?.clickDistance(S)}return{update:w,destroy:A,setViewport:I,setViewportConstrained:R,getViewport:P,scaleTo:k,scaleBy:N,setScaleExtent:v,setTranslateExtent:E,syncViewport:C,setClickDistance:g}}var m0;(function(_){_.Line="line",_.Handle="handle"})(m0||(m0={}));function uq({width:_,prevWidth:Q,height:J,prevHeight:q,affectsX:U,affectsY:G}){let Z=_-Q,F=J-q,H=[Z>0?1:Z<0?-1:0,F>0?1:F<0?-1:0];if(Z&&U)H[0]=H[0]*-1;if(F&&G)H[1]=H[1]*-1;return H}function $7(_){let Q=_.includes("right")||_.includes("left"),J=_.includes("bottom")||_.includes("top"),q=_.includes("left"),U=_.includes("top");return{isHorizontal:Q,isVertical:J,affectsX:q,affectsY:U}}function b0(_,Q){return Math.max(0,Q-_)}function D0(_,Q){return Math.max(0,_-Q)}function e5(_,Q,J){return Math.max(0,Q-_,_-J)}function q7(_,Q){return _?!Q:Q}function bq(_,Q,J,q,U,G,Z,F){let{affectsX:H,affectsY:Y}=Q,{isHorizontal:X,isVertical:K}=Q,L=X&&K,{xSnapped:z,ySnapped:W}=J,{minWidth:O,maxWidth:T,minHeight:B,maxHeight:w}=q,{x:A,y:R,width:I,height:C,aspectRatio:P}=_,k=Math.floor(X?z-_.pointerX:0),N=Math.floor(K?W-_.pointerY:0),v=I+(H?-k:k),E=C+(Y?-N:N),g=-G[0]*I,h=-G[1]*C,S=e5(v,O,T),b=e5(E,B,w);if(Z){let V=0,D=0;if(H&&k<0)V=b0(A+k+g,Z[0][0]);else if(!H&&k>0)V=D0(A+v+g,Z[1][0]);if(Y&&N<0)D=b0(R+N+h,Z[0][1]);else if(!Y&&N>0)D=D0(R+E+h,Z[1][1]);S=Math.max(S,V),b=Math.max(b,D)}if(F){let V=0,D=0;if(H&&k>0)V=D0(A+k,F[0][0]);else if(!H&&k<0)V=b0(A+v,F[1][0]);if(Y&&N>0)D=D0(R+N,F[0][1]);else if(!Y&&N<0)D=b0(R+E,F[1][1]);S=Math.max(S,V),b=Math.max(b,D)}if(U){if(X){let V=e5(v/P,B,w)*P;if(S=Math.max(S,V),Z){let D=0;if(!H&&!Y||H&&!Y&&L)D=D0(R+h+v/P,Z[1][1])*P;else D=b0(R+h+(H?k:-k)/P,Z[0][1])*P;S=Math.max(S,D)}if(F){let D=0;if(!H&&!Y||H&&!Y&&L)D=b0(R+v/P,F[1][1])*P;else D=D0(R+(H?k:-k)/P,F[0][1])*P;S=Math.max(S,D)}}if(K){let V=e5(E*P,O,T)/P;if(b=Math.max(b,V),Z){let D=0;if(!H&&!Y||Y&&!H&&L)D=D0(A+E*P+g,Z[1][0])/P;else D=b0(A+(Y?N:-N)*P+g,Z[0][0])/P;b=Math.max(b,D)}if(F){let D=0;if(!H&&!Y||Y&&!H&&L)D=b0(A+E*P,F[1][0])/P;else D=D0(A+(Y?N:-N)*P,F[0][0])/P;b=Math.max(b,D)}}}if(N=N+(N<0?b:-b),k=k+(k<0?S:-S),U)if(L)if(v>E*P)N=(q7(H,Y)?-k:k)/P;else k=(q7(H,Y)?-N:N)*P;else if(X)N=k/P,Y=H;else k=N*P,H=Y;let j=H?A+k:A,x=Y?R+N:R;return{width:I+(H?-k:k),height:C+(Y?-N:N),x:G[0]*k*(!H?1:-1)+j,y:G[1]*N*(!Y?1:-1)+x}}var b7={width:0,height:0,x:0,y:0},Dq={...b7,pointerX:0,pointerY:0,aspectRatio:1};function hq(_,Q,J){let q=Q.position.x+_.position.x,U=Q.position.y+_.position.y,G=_.measured.width??0,Z=_.measured.height??0,F=J[0]*G,H=J[1]*Z;return[[q-F,U-H],[q+G-F,U+Z-H]]}function D7({domNode:_,nodeId:Q,getStoreItems:J,onChange:q,onEnd:U}){let G=j1(_),Z={controlDirection:$7("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function F({controlPosition:Y,boundaries:X,keepAspectRatio:K,resizeDirection:L,onResizeStart:z,onResize:W,onResizeEnd:O,shouldResize:T}){let B={...b7},w={...Dq};Z={boundaries:X,resizeDirection:L,keepAspectRatio:K,controlDirection:$7(Y)};let A=void 0,R=null,I=[],C=void 0,P=void 0,k=void 0,N=s2().on("start",(v)=>{let{nodeLookup:E,transform:g,snapGrid:h,snapToGrid:S,nodeOrigin:b,paneDomNode:j}=J();if(A=E.get(Q),!A)return;R=j?.getBoundingClientRect()??null;let{xSnapped:x,ySnapped:V}=z5(v.sourceEvent,{transform:g,snapGrid:h,snapToGrid:S,containerBounds:R});if(B={width:A.measured.width??0,height:A.measured.height??0,x:A.position.x??0,y:A.position.y??0},w={...B,pointerX:x,pointerY:V,aspectRatio:B.width/B.height},C=void 0,P=G2(A.extent)?A.extent:void 0,A.parentId&&(A.extent==="parent"||A.expandParent))C=E.get(A.parentId);if(C&&A.extent==="parent")P=[[0,0],[C.measured.width,C.measured.height]];I=[],k=void 0;for(let[D,f]of E)if(f.parentId===Q){if(I.push({id:D,position:{...f.position},extent:f.extent}),f.extent==="parent"||f.expandParent){let y=hq(f,A,f.origin??b);if(k)k=[[Math.min(y[0][0],k[0][0]),Math.min(y[0][1],k[0][1])],[Math.max(y[1][0],k[1][0]),Math.max(y[1][1],k[1][1])]];else k=y}}z?.(v,{...B})}).on("drag",(v)=>{let{transform:E,snapGrid:g,snapToGrid:h,nodeOrigin:S}=J(),b=z5(v.sourceEvent,{transform:E,snapGrid:g,snapToGrid:h,containerBounds:R}),j=[];if(!A)return;let{x,y:V,width:D,height:f}=B,y={},p=A.origin??S,{width:u,height:s,x:t,y:a}=bq(w,Z.controlDirection,b,Z.boundaries,Z.keepAspectRatio,p,P,k),d=u!==D,c=s!==f,e=t!==x&&d,Q1=a!==V&&c;if(!e&&!Q1&&!d&&!c)return;let G1={prevValues:{...B},startX:w.x,startY:w.y,childNodes:I.map((K1)=>({...K1,position:{...K1.position}}))};if(e||Q1||p[0]===1||p[1]===1){if(y.x=e?t:B.x,y.y=Q1?a:B.y,B.x=y.x,B.y=y.y,I.length>0){let K1=t-x,o=a-V;for(let z1 of I)z1.position={x:z1.position.x-K1+p[0]*(u-D),y:z1.position.y-o+p[1]*(s-f)},j.push(z1)}}if(d||c)y.width=d&&(!Z.resizeDirection||Z.resizeDirection==="horizontal")?u:B.width,y.height=c&&(!Z.resizeDirection||Z.resizeDirection==="vertical")?s:B.height,B.width=y.width,B.height=y.height;if(C&&A.expandParent){let K1=p[0]*(y.width??0);if(y.x&&y.x<K1)B.x=K1,w.x=w.x-(y.x-K1);let o=p[1]*(y.height??0);if(y.y&&y.y<o)B.y=o,w.y=w.y-(y.y-o)}let $1=uq({width:B.width,prevWidth:D,height:B.height,prevHeight:f,affectsX:Z.controlDirection.affectsX,affectsY:Z.controlDirection.affectsY}),Z1={...B,direction:$1};if(T?.(v,Z1)===!1){B=G1.prevValues,w.x=G1.startX,w.y=G1.startY,I.forEach((K1,o)=>{K1.position=G1.childNodes[o].position});return}W?.(v,Z1),q(y,j)}).on("end",(v)=>{O?.(v,{...B}),U?.({...B})});G.call(N)}function H(){G.on(".drag",null)}return{update:F,destroy:H}}var p7=h1(X0(),1),c7=h1(E7(),1);var x7=(_)=>{let Q,J=new Set,q=(X,K)=>{let L=typeof X==="function"?X(Q):X;if(!Object.is(L,Q)){let z=Q;Q=(K!=null?K:typeof L!=="object"||L===null)?L:Object.assign({},Q,L),J.forEach((W)=>W(Q,z))}},U=()=>Q,H={setState:q,getState:U,getInitialState:()=>Y,subscribe:(X)=>{return J.add(X),()=>J.delete(X)},destroy:()=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production")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.");J.clear()}},Y=Q=_(q,U,H);return H},m7=(_)=>_?x7(_):x7;var{useDebugValue:mq}=p7.default,{useSyncExternalStoreWithSelector:gq}=c7.default,pq=(_)=>_;function S6(_,Q=pq,J){let q=gq(_.subscribe,_.getState,_.getServerState||_.getInitialState,Q,J);return mq(q),q}var g7=(_,Q)=>{let J=m7(_),q=(U,G=Q)=>S6(J,U,G);return Object.assign(q,J),q},l7=(_,Q)=>_?g7(_,Q):g7;function P1(_,Q){if(Object.is(_,Q))return!0;if(typeof _!=="object"||_===null||typeof Q!=="object"||Q===null)return!1;if(_ instanceof Map&&Q instanceof Map){if(_.size!==Q.size)return!1;for(let[q,U]of _)if(!Object.is(U,Q.get(q)))return!1;return!0}if(_ instanceof Set&&Q instanceof Set){if(_.size!==Q.size)return!1;for(let q of _)if(!Q.has(q))return!1;return!0}let J=Object.keys(_);if(J.length!==Object.keys(Q).length)return!1;for(let q of J)if(!Object.prototype.hasOwnProperty.call(Q,q)||!Object.is(_[q],Q[q]))return!1;return!0}var R9=h1(d7(),1),M4=r.createContext(null),rq=M4.Provider,O9=i1.error001("react");function M1(_,Q){let J=r.useContext(M4);if(J===null)throw Error(O9);return S6(J,_,Q)}function N1(){let _=r.useContext(M4);if(_===null)throw Error(O9);return r.useMemo(()=>({getState:_.getState,setState:_.setState,subscribe:_.subscribe}),[_])}var a7={display:"none"},iq={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},f9="react-flow__node-desc",I9="react-flow__edge-desc",dq="react-flow__aria-live",aq=(_)=>_.ariaLiveMessage,sq=(_)=>_.ariaLabelConfig;function tq({rfId:_}){let Q=M1(aq);return l.jsx("div",{id:`${dq}-${_}`,"aria-live":"assertive","aria-atomic":"true",style:iq,children:Q})}function oq({rfId:_,disableKeyboardA11y:Q}){let J=M1(sq);return l.jsxs(l.Fragment,{children:[l.jsx("div",{id:`${f9}-${_}`,style:a7,children:Q?J["node.a11yDescription.default"]:J["node.a11yDescription.keyboardDisabled"]}),l.jsx("div",{id:`${I9}-${_}`,style:a7,children:J["edge.a11yDescription.default"]}),!Q&&l.jsx(tq,{rfId:_})]})}var K2=r.forwardRef(({position:_="top-left",children:Q,className:J,style:q,...U},G)=>{let Z=`${_}`.split("-");return l.jsx("div",{className:C1(["react-flow__panel",J,...Z]),style:q,ref:G,...U,children:Q})});K2.displayName="Panel";var s7="https://reactflow.dev/attribution";function nq({proOptions:_,position:Q="bottom-right"}){if(r.useEffect(()=>{L7("react")},[]),_?.hideAttribution)return null;return l.jsx(K2,{position:Q,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${s7}`,children:l.jsx("a",{href:s7,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var eq=(_)=>{let Q=[],J=[];for(let[,q]of _.nodeLookup)if(q.selected)Q.push(q.internals.userNode);for(let[,q]of _.edgeLookup)if(q.selected)J.push(q);return{selectedNodes:Q,selectedEdges:J}},z4=(_)=>_.id;function _U(_,Q){return P1(_.selectedNodes.map(z4),Q.selectedNodes.map(z4))&&P1(_.selectedEdges.map(z4),Q.selectedEdges.map(z4))}function QU({onSelectionChange:_}){let Q=N1(),{selectedNodes:J,selectedEdges:q}=M1(eq,_U);return r.useEffect(()=>{let U={nodes:J,edges:q};_?.(U),Q.getState().onSelectionChangeHandlers.forEach((G)=>G(U))},[J,q,_]),null}var JU=(_)=>!!_.onSelectionChangeHandlers;function $U({onSelectionChange:_}){let Q=M1(JU);if(_||Q)return l.jsx(QU,{onSelectionChange:_});return null}var w9=[0,0],qU={x:0,y:0,zoom:1},UU=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],t7=[...UU,"rfId"],GU=(_)=>({setNodes:_.setNodes,setEdges:_.setEdges,setMinZoom:_.setMinZoom,setMaxZoom:_.setMaxZoom,setTranslateExtent:_.setTranslateExtent,setNodeExtent:_.setNodeExtent,reset:_.reset,setDefaultNodesAndEdges:_.setDefaultNodesAndEdges}),o7={translateExtent:v2,nodeOrigin:w9,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function ZU(_){let{setNodes:Q,setEdges:J,setMinZoom:q,setMaxZoom:U,setTranslateExtent:G,setNodeExtent:Z,reset:F,setDefaultNodesAndEdges:H}=M1(GU,P1),Y=N1();r.useEffect(()=>{return H(_.defaultNodes,_.defaultEdges),()=>{X.current=o7,F()}},[]);let X=r.useRef(o7);return r.useEffect(()=>{for(let K of t7){let L=_[K],z=X.current[K];if(L===z)continue;if(typeof _[K]>"u")continue;if(K==="nodes")Q(L);else if(K==="edges")J(L);else if(K==="minZoom")q(L);else if(K==="maxZoom")U(L);else if(K==="translateExtent")G(L);else if(K==="nodeExtent")Z(L);else if(K==="ariaLabelConfig")Y.setState({ariaLabelConfig:Y7(L)});else if(K==="fitView")Y.setState({fitViewQueued:L});else if(K==="fitViewOptions")Y.setState({fitViewOptions:L});else Y.setState({[K]:L})}X.current=_},t7.map((K)=>_[K])),null}function n7(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function FU(_){let[Q,J]=r.useState(_==="system"?null:_);return r.useEffect(()=>{if(_!=="system"){J(_);return}let q=n7(),U=()=>J(q?.matches?"dark":"light");return U(),q?.addEventListener("change",U),()=>{q?.removeEventListener("change",U)}},[_]),Q!==null?Q:n7()?.matches?"dark":"light"}var e7=typeof document<"u"?document:null;function T5(_=null,Q={target:e7,actInsideInputWithModifier:!0}){let[J,q]=r.useState(!1),U=r.useRef(!1),G=r.useRef(new Set([])),[Z,F]=r.useMemo(()=>{if(_!==null){let Y=(Array.isArray(_)?_:[_]).filter((K)=>typeof K==="string").map((K)=>K.replace(/\+/g,`
29
29
  `).replace(`
30
30
 
31
31
  `,`
32
32
  +`).split(`
33
- `)),H=Y.reduce((K,L)=>K.concat(...L),[]);return[Y,H]}return[[],[]]},[_]);return r.useEffect(()=>{let X=Q?.target??e7,Y=Q?.actInsideInputWithModifier??!0;if(_!==null){let H=(z)=>{if(U.current=z.ctrlKey||z.metaKey||z.shiftKey||z.altKey,(!U.current||U.current&&!Y)&&R6(z))return!1;let O=Q9(z.code,F);if(G.current.add(z[O]),_9(Z,G.current,!1)){let T=z.composedPath?.()?.[0]||z.target,B=T?.nodeName==="BUTTON"||T?.nodeName==="A";if(Q.preventDefault!==!1&&(U.current||!B))z.preventDefault();q(!0)}},K=(z)=>{let W=Q9(z.code,F);if(_9(Z,G.current,!0))q(!1),G.current.clear();else G.current.delete(z[W]);if(z.key==="Meta")G.current.clear();U.current=!1},L=()=>{G.current.clear(),q(!1)};return X?.addEventListener("keydown",H),X?.addEventListener("keyup",K),window.addEventListener("blur",L),window.addEventListener("contextmenu",L),()=>{X?.removeEventListener("keydown",H),X?.removeEventListener("keyup",K),window.removeEventListener("blur",L),window.removeEventListener("contextmenu",L)}}},[_,q]),J}function _9(_,Q,J){return _.filter((q)=>J||q.length===Q.size).some((q)=>q.every((U)=>Q.has(U)))}function Q9(_,Q){return Q.includes(_)?"code":"key"}var KU=()=>{let _=N1();return r.useMemo(()=>{return{zoomIn:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(1.2,Q):!1},zoomOut:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(0.8333333333333334,Q):!1},zoomTo:async(Q,J)=>{let{panZoom:q}=_.getState();return q?q.scaleTo(Q,J):!1},getZoom:()=>_.getState().transform[2],setViewport:async(Q,J)=>{let{transform:[q,U,G],panZoom:Z}=_.getState();if(!Z)return!1;return await Z.setViewport({x:Q.x??q,y:Q.y??U,zoom:Q.zoom??G},J),!0},getViewport:()=>{let[Q,J,q]=_.getState().transform;return{x:Q,y:J,zoom:q}},setCenter:async(Q,J,q)=>{return _.getState().setCenter(Q,J,q)},fitBounds:async(Q,J)=>{let{width:q,height:U,minZoom:G,maxZoom:Z,panZoom:F}=_.getState(),X=A5(Q,q,U,G,Z,J?.padding??0.1);if(!F)return!1;return await F.setViewport(X,{duration:J?.duration,ease:J?.ease,interpolate:J?.interpolate}),!0},screenToFlowPosition:(Q,J={})=>{let{transform:q,snapGrid:U,snapToGrid:G,domNode:Z}=_.getState();if(!Z)return Q;let{x:F,y:X}=Z.getBoundingClientRect(),Y={x:Q.x-F,y:Q.y-X},H=J.snapGrid??U,K=J.snapToGrid??G;return u2(Y,q,K,H)},flowToScreenPosition:(Q)=>{let{transform:J,domNode:q}=_.getState();if(!q)return Q;let{x:U,y:G}=q.getBoundingClientRect(),Z=U2(Q,J);return{x:Z.x+U,y:Z.y+G}}}},[])};function P9(_,Q){let J=[],q=new Map,U=[];for(let G of _)if(G.type==="add"){U.push(G);continue}else if(G.type==="remove"||G.type==="replace")q.set(G.id,[G]);else{let Z=q.get(G.id);if(Z)Z.push(G);else q.set(G.id,[G])}for(let G of Q){let Z=q.get(G.id);if(!Z){J.push(G);continue}if(Z[0].type==="remove")continue;if(Z[0].type==="replace"){J.push({...Z[0].item});continue}let F={...G};for(let X of Z)HU(X,F);J.push(F)}if(U.length)U.forEach((G)=>{if(G.index!==void 0)J.splice(G.index,0,{...G.item});else J.push({...G.item})});return J}function HU(_,Q){switch(_.type){case"select":{Q.selected=_.selected;break}case"position":{if(typeof _.position<"u")Q.position=_.position;if(typeof _.dragging<"u")Q.dragging=_.dragging;break}case"dimensions":{if(typeof _.dimensions<"u"){if(Q.measured={..._.dimensions},_.setAttributes){if(_.setAttributes===!0||_.setAttributes==="width")Q.width=_.dimensions.width;if(_.setAttributes===!0||_.setAttributes==="height")Q.height=_.dimensions.height}}if(typeof _.resizing==="boolean")Q.resizing=_.resizing;break}}}function N9(_,Q){return P9(_,Q)}function XU(_,Q){return P9(_,Q)}function F2(_,Q){return{id:_,type:"select",selected:Q}}function D2(_,Q=new Set,J=!1){let q=[];for(let[U,G]of _){let Z=Q.has(U);if(!(G.selected===void 0&&!Z)&&G.selected!==Z){if(J)G.selected=Z;q.push(F2(G.id,Z))}}return q}function J9({items:_=[],lookup:Q}){let J=[],q=new Map(_.map((U)=>[U.id,U]));for(let[U,G]of _.entries()){let Z=Q.get(G.id),F=Z?.internals?.userNode??Z;if(F!==void 0&&F!==G)J.push({id:G.id,item:G,type:"replace"});if(F===void 0)J.push({item:G,type:"add",index:U})}for(let[U]of Q)if(q.get(U)===void 0)J.push({id:U,type:"remove"});return J}function $9(_){return{id:_.id,type:"remove"}}var YU=z6("React Flow","https://reactflow.dev/");function LU(_,Q,J={}){return A7(_,Q,{...J,onError:J.onError??YU})}var q9=(_)=>U7(_),zU=(_)=>F6(_);function C9(_){return r.forwardRef(_)}var S9=typeof window<"u"?r.useLayoutEffect:r.useEffect;function U9(_){let[Q,J]=r.useState(BigInt(0)),[q]=r.useState(()=>WU(()=>J((U)=>U+BigInt(1))));return S9(()=>{let U=q.get();if(U.length)_(U),q.reset()},[Q]),q}function WU(_){let Q=[];return{get:()=>Q,reset:()=>{Q=[]},push:(J)=>{Q.push(J),_()}}}var k9=r.createContext(null);function AU({children:_}){let Q=N1(),J=r.useCallback((F)=>{let{nodes:X=[],setNodes:Y,hasDefaultNodes:H,onNodesChange:K,nodeLookup:L,fitViewQueued:z,onNodesChangeMiddlewareMap:W}=Q.getState(),O=X;for(let B of F)O=typeof B==="function"?B(O):B;let T=J9({items:O,lookup:L});for(let B of W.values())T=B(T);if(H)Y(O);if(T.length>0)K?.(T);else if(z)window.requestAnimationFrame(()=>{let{fitViewQueued:B,nodes:w,setNodes:A}=Q.getState();if(B)A(w)})},[]),q=U9(J),U=r.useCallback((F)=>{let{edges:X=[],setEdges:Y,hasDefaultEdges:H,onEdgesChange:K,edgeLookup:L}=Q.getState(),z=X;for(let W of F)z=typeof W==="function"?W(z):W;if(H)Y(z);else if(K)K(J9({items:z,lookup:L}))},[]),G=U9(U),Z=r.useMemo(()=>({nodeQueue:q,edgeQueue:G}),[]);return l.jsx(k9.Provider,{value:Z,children:_})}function BU(){let _=r.useContext(k9);if(!_)throw Error("useBatchContext must be used within a BatchProvider");return _}var MU=(_)=>!!_.panZoom;function T5(){let _=KU(),Q=N1(),J=BU(),q=M1(MU),U=r.useMemo(()=>{let G=(K)=>Q.getState().nodeLookup.get(K),Z=(K)=>{J.nodeQueue.push(K)},F=(K)=>{J.edgeQueue.push(K)},X=(K)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState(),W=q9(K)?K:L.get(K.id),O=W.parentId?A6(W.position,W.measured,W.parentId,L,z):W.position,T={...W,position:O,width:W.measured?.width??W.width,height:W.measured?.height??W.height};return j2(T)},Y=(K,L,z={replace:!1})=>{Z((W)=>W.map((O)=>{if(O.id===K){let T=typeof L==="function"?L(O):L;return z.replace&&q9(T)?T:{...O,...T}}return O}))},H=(K,L,z={replace:!1})=>{F((W)=>W.map((O)=>{if(O.id===K){let T=typeof L==="function"?L(O):L;return z.replace&&zU(T)?T:{...O,...T}}return O}))};return{getNodes:()=>Q.getState().nodes.map((K)=>({...K})),getNode:(K)=>G(K)?.internals.userNode,getInternalNode:G,getEdges:()=>{let{edges:K=[]}=Q.getState();return K.map((L)=>({...L}))},getEdge:(K)=>Q.getState().edgeLookup.get(K),setNodes:Z,setEdges:F,addNodes:(K)=>{let L=Array.isArray(K)?K:[K];J.nodeQueue.push((z)=>[...z,...L])},addEdges:(K)=>{let L=Array.isArray(K)?K:[K];J.edgeQueue.push((z)=>[...z,...L])},toObject:()=>{let{nodes:K=[],edges:L=[],transform:z}=Q.getState(),[W,O,T]=z;return{nodes:K.map((B)=>({...B})),edges:L.map((B)=>({...B})),viewport:{x:W,y:O,zoom:T}}},deleteElements:async({nodes:K=[],edges:L=[]})=>{let{nodes:z,edges:W,onNodesDelete:O,onEdgesDelete:T,triggerNodeChanges:B,triggerEdgeChanges:w,onDelete:A,onBeforeDelete:R}=Q.getState(),{nodes:I,edges:C}=await F7({nodesToRemove:K,edgesToRemove:L,nodes:z,edges:W,onBeforeDelete:R}),P=C.length>0,k=I.length>0;if(P){let N=C.map($9);T?.(C),w(N)}if(k){let N=I.map($9);O?.(I),B(N)}if(k||P)A?.({nodes:I,edges:C});return{deletedNodes:I,deletedEdges:C}},getIntersectingNodes:(K,L=!0,z)=>{let W=L6(K),O=W?K:X(K),T=z!==void 0;if(!O)return[];return(z||Q.getState().nodes).filter((B)=>{let w=Q.getState().nodeLookup.get(B.id);if(w&&!W&&(B.id===K.id||!w.internals.positionAbsolute))return!1;let A=j2(T?B:w),R=W5(A,O);return L&&R>0||R>=A.width*A.height||R>=O.width*O.height})},isNodeIntersecting:(K,L,z=!0)=>{let O=L6(K)?K:X(K);if(!O)return!1;let T=W5(O,L);return z&&T>0||T>=L.width*L.height||T>=O.width*O.height},updateNode:Y,updateNodeData:(K,L,z={replace:!1})=>{Y(K,(W)=>{let O=typeof L==="function"?L(W):L;return z.replace?{...W,data:O}:{...W,data:{...W.data,...O}}},z)},updateEdge:H,updateEdgeData:(K,L,z={replace:!1})=>{H(K,(W)=>{let O=typeof L==="function"?L(W):L;return z.replace?{...W,data:O}:{...W,data:{...W.data,...O}}},z)},getNodesBounds:(K)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState();return H6(K,{nodeLookup:L,nodeOrigin:z})},getHandleConnections:({type:K,id:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}-${K}${L?`-${L}`:""}`)?.values()??[]),getNodeConnections:({type:K,handleId:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}${K?L?`-${K}-${L}`:`-${K}`:""}`)?.values()??[]),fitView:async(K)=>{let L=Q.getState().fitViewResolver??X7();return Q.setState({fitViewQueued:!0,fitViewOptions:K,fitViewResolver:L}),J.nodeQueue.push((z)=>[...z]),L.promise}}},[]);return r.useMemo(()=>{return{...U,..._,viewportInitialized:q}},[q])}var G9=(_)=>_.selected,TU=typeof window<"u"?window:void 0;function RU({deleteKeyCode:_,multiSelectionKeyCode:Q}){let J=N1(),{deleteElements:q}=T5(),U=M5(_,{actInsideInputWithModifier:!1}),G=M5(Q,{target:TU});r.useEffect(()=>{if(U){let{edges:Z,nodes:F}=J.getState();q({nodes:F.filter(G9),edges:Z.filter(G9)}),J.setState({nodesSelectionActive:!1})}},[U]),r.useEffect(()=>{J.setState({multiSelectionActive:G})},[G])}function OU(_){let Q=N1();r.useEffect(()=>{let J=()=>{if(!_.current||!(_.current.checkVisibility?.()??!0))return!1;let q=U4(_.current);if(q.height===0||q.width===0)Q.getState().onError?.("004",i1.error004());Q.setState({width:q.width||500,height:q.height||500})};if(_.current){J(),window.addEventListener("resize",J);let q=new ResizeObserver(()=>J());return q.observe(_.current),()=>{if(window.removeEventListener("resize",J),q&&_.current)q.unobserve(_.current)}}},[])}var T4={position:"absolute",width:"100%",height:"100%",top:0,left:0},fU=(_)=>({userSelectionActive:_.userSelectionActive,lib:_.lib,connectionInProgress:_.connection.inProgress});function IU({onPaneContextMenu:_,zoomOnScroll:Q=!0,zoomOnPinch:J=!0,panOnScroll:q=!1,panActivationKeyPressed:U,panOnScrollSpeed:G=0.5,panOnScrollMode:Z=I0.Free,zoomOnDoubleClick:F=!0,panOnDrag:X=!0,defaultViewport:Y,translateExtent:H,minZoom:K,maxZoom:L,zoomActivationKeyCode:z,preventScrolling:W=!0,children:O,noWheelClassName:T,noPanClassName:B,onViewportChange:w,isControlledViewport:A,paneClickDistance:R,selectionOnDrag:I}){let C=N1(),P=r.useRef(null),{userSelectionActive:k,lib:N,connectionInProgress:v}=M1(fU,P1),E=M5(z),g=r.useRef();OU(P);let h=r.useCallback((S)=>{if(w?.({x:S[0],y:S[1],zoom:S[2]}),!A)C.setState({transform:S})},[w,A]);return r.useEffect(()=>{if(P.current){g.current=u7({domNode:P.current,minZoom:K,maxZoom:L,translateExtent:H,viewport:Y,onDraggingChange:(x)=>C.setState((V)=>V.paneDragging===x?V:{paneDragging:x}),onPanZoomStart:(x,V)=>{let{onViewportChangeStart:D,onMoveStart:f}=C.getState();f?.(x,V),D?.(V)},onPanZoom:(x,V)=>{let{onViewportChange:D,onMove:f}=C.getState();f?.(x,V),D?.(V)},onPanZoomEnd:(x,V)=>{let{onViewportChangeEnd:D,onMoveEnd:f}=C.getState();f?.(x,V),D?.(V)}});let{x:S,y:b,zoom:j}=g.current.getViewport();return C.setState({panZoom:g.current,transform:[S,b,j],domNode:P.current.closest(".react-flow")}),()=>{g.current?.destroy()}}},[]),r.useEffect(()=>{g.current?.update({onPaneContextMenu:_,zoomOnScroll:Q,zoomOnPinch:J,panOnScroll:q,panActivationKeyPressed:U,panOnScrollSpeed:G,panOnScrollMode:Z,zoomOnDoubleClick:F,panOnDrag:X,zoomActivationKeyPressed:E,preventScrolling:W,noPanClassName:B,userSelectionActive:k,noWheelClassName:T,lib:N,onTransformChange:h,connectionInProgress:v,selectionOnDrag:I,paneClickDistance:R})},[_,Q,J,q,U,G,Z,F,X,E,W,B,k,T,N,h,v,I,R]),l.jsx("div",{className:"react-flow__renderer",ref:P,style:T4,children:O})}var wU=(_)=>({userSelectionActive:_.userSelectionActive,userSelectionRect:_.userSelectionRect});function PU(){let{userSelectionActive:_,userSelectionRect:Q}=M1(wU,P1);if(!(_&&Q))return null;return l.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:Q.width,height:Q.height,transform:`translate(${Q.x}px, ${Q.y}px)`}})}var y6=(_,Q)=>{return(J)=>{if(J.target!==Q.current)return;_?.(J)}},NU=(_)=>({userSelectionActive:_.userSelectionActive,elementsSelectable:_.elementsSelectable,dragging:_.paneDragging,panBy:_.panBy,autoPanSpeed:_.autoPanSpeed});function CU({isSelecting:_,selectionKeyPressed:Q,selectionMode:J=$2.Full,panOnDrag:q,autoPanOnSelection:U,paneClickDistance:G,selectionOnDrag:Z,onSelectionStart:F,onSelectionEnd:X,onPaneClick:Y,onPaneContextMenu:H,onPaneScroll:K,onPaneMouseEnter:L,onPaneMouseMove:z,onPaneMouseLeave:W,children:O}){let T=r.useRef(0),B=N1(),{userSelectionActive:w,elementsSelectable:A,dragging:R,panBy:I,autoPanSpeed:C}=M1(NU,P1),P=A&&(_||w),k=r.useRef(null),N=r.useRef(),v=r.useRef(new Set),E=r.useRef(new Set),g=r.useRef(!1),h=r.useRef(!1),S=r.useRef({x:0,y:0}),b=r.useRef(!1),j=(c)=>{if(h.current||g.current||B.getState().connection.inProgress){h.current=!1,g.current=!1;return}Y?.(c),B.getState().resetSelectedElements(),B.setState({nodesSelectionActive:!1})},x=(c)=>{if(Array.isArray(q)&&q?.includes(2)){c.preventDefault();return}H?.(c)},V=K?(c)=>K(c):void 0,D=(c)=>{if(h.current)c.stopPropagation(),h.current=!1},f=(c)=>{if(c.pointerType==="touch"&&q!==!1&&!Q)return;let{domNode:e,transform:Q1}=B.getState();if(N.current=e?.getBoundingClientRect(),!N.current)return;let G1=c.target===k.current;if(!G1&&!!c.target.closest(".nokey")||!_||!(Z&&G1||Q)||c.button!==0||!c.isPrimary)return;c.target?.setPointerCapture?.(c.pointerId),h.current=!1;let{x:Y1,y:K1}=_0(c.nativeEvent,N.current),o=u2({x:Y1,y:K1},Q1);if(B.setState({userSelectionRect:{width:0,height:0,startX:o.x,startY:o.y,x:Y1,y:K1}}),!G1)c.stopPropagation(),c.preventDefault()};function y(c,e){let{userSelectionRect:Q1}=B.getState();if(!Q1)return;let{transform:G1,nodeLookup:$1,edgeLookup:Z1,connectionLookup:Y1,triggerNodeChanges:K1,triggerEdgeChanges:o,defaultEdgeOptions:z1}=B.getState(),q1={x:Q1.startX,y:Q1.startY},{x:y1,y:c1}=U2(q1,G1),l1={startX:q1.x,startY:q1.y,x:c<y1?c:y1,y:e<c1?e:c1,width:Math.abs(c-y1),height:Math.abs(e-c1)},k0=v.current,F0=E.current;v.current=new Set(Q4($1,l1,G1,J===$2.Partial,!0).map((a1)=>a1.id)),E.current=new Set;let M0=z1?.selectable??!0;for(let a1 of v.current){let o1=Y1.get(a1);if(!o1)continue;for(let{edgeId:n1}of o1.values()){let K0=Z1.get(n1);if(K0&&(K0.selectable??M0))E.current.add(n1)}}if(!B6(k0,v.current)){let a1=D2($1,v.current,!0);K1(a1)}if(!B6(F0,E.current)){let a1=D2(Z1,E.current);o(a1)}B.setState({userSelectionRect:l1,userSelectionActive:!0,nodesSelectionActive:!1})}function p(){if(!U||!N.current)return;let[c,e]=J4(S.current,N.current,C);I({x:c,y:e}).then((Q1)=>{if(!h.current||!Q1){T.current=requestAnimationFrame(p);return}let{x:G1,y:$1}=S.current;y(G1,$1),T.current=requestAnimationFrame(p)})}let u=()=>{cancelAnimationFrame(T.current),T.current=0,b.current=!1};r.useEffect(()=>{return()=>u()},[]);let s=(c)=>{let{userSelectionRect:e,transform:Q1,resetSelectedElements:G1}=B.getState();if(!N.current||!e)return;let{x:$1,y:Z1}=_0(c.nativeEvent,N.current);S.current={x:$1,y:Z1};let Y1=U2({x:e.startX,y:e.startY},Q1);if(!h.current){let K1=Q?0:G;if(Math.hypot($1-Y1.x,Z1-Y1.y)<=K1)return;G1(),F?.(c)}if(h.current=!0,!b.current)p(),b.current=!0;y($1,Z1)},t=(c)=>{if(!P){if(c.target===k.current&&B.getState().connection.inProgress)g.current=!0;return}if(c.button!==0)return;if(c.target?.releasePointerCapture?.(c.pointerId),!w&&c.target===k.current&&B.getState().userSelectionRect)j?.(c);if(B.setState({userSelectionActive:!1,userSelectionRect:null}),h.current)X?.(c),B.setState({nodesSelectionActive:v.current.size>0});u()},a=(c)=>{c.target?.releasePointerCapture?.(c.pointerId),u()},d=q===!0||Array.isArray(q)&&q.includes(0);return l.jsxs("div",{className:C1(["react-flow__pane",{draggable:d,dragging:R,selection:_}]),onClick:P?void 0:y6(j,k),onContextMenu:y6(x,k),onWheel:y6(V,k),onPointerEnter:P?void 0:L,onPointerMove:P?s:z,onPointerUp:t,onPointerCancel:P?a:void 0,onPointerDownCapture:P?f:void 0,onClickCapture:P?D:void 0,onPointerLeave:W,ref:k,style:T4,children:[O,l.jsx(PU,{})]})}function j6({id:_,store:Q,unselect:J=!1,nodeRef:q}){let{addSelectedNodes:U,unselectNodesAndEdges:G,multiSelectionActive:Z,nodeLookup:F,onError:X}=Q.getState(),Y=F.get(_);if(!Y){X?.("012",i1.error012(_));return}if(Q.setState({nodesSelectionActive:!1}),!Y.selected)U([_]);else if(J||Y.selected&&Z)G({nodes:[Y],edges:[]}),requestAnimationFrame(()=>q?.current?.blur())}function y9({nodeRef:_,disabled:Q=!1,noDragClassName:J,handleSelector:q,nodeId:U,isSelectable:G,nodeClickDistance:Z}){let F=N1(),[X,Y]=r.useState(!1),H=r.useRef();return r.useEffect(()=>{if(Q)return;return H.current=N7({getStoreItems:()=>F.getState(),onNodeMouseDown:(K)=>{j6({id:K,store:F,nodeRef:_})},onDragStart:()=>{Y(!0)},onDragStop:()=>{Y(!1)}}),()=>{H.current?.destroy(),H.current=void 0}},[Q,F,_]),r.useEffect(()=>{if(Q||!_.current||!H.current)return;H.current.update({noDragClassName:J,handleSelector:q,domNode:_.current,isSelectable:G,nodeId:U,nodeClickDistance:Z})},[J,q,Q,G,_,U,Z]),X}var SU=(_)=>(Q)=>Q.selected&&(Q.draggable||_&&typeof Q.draggable>"u");function v9(){let _=N1();return r.useCallback((J)=>{let{nodeExtent:q,snapToGrid:U,snapGrid:G,nodesDraggable:Z,onError:F,updateNodePositions:X,nodeLookup:Y,nodeOrigin:H}=_.getState(),K=new Map,L=SU(Z),z=U?G[0]:5,W=U?G[1]:5,O=J.direction.x*z*J.factor,T=J.direction.y*W*J.factor;for(let[,B]of Y){if(!L(B))continue;let w={x:B.internals.positionAbsolute.x+O,y:B.internals.positionAbsolute.y+T};if(U)w=V2(w,G);let{position:A,positionAbsolute:R}=X6({nodeId:B.id,nextPosition:w,nodeLookup:Y,nodeExtent:q,nodeOrigin:H,onError:F});B.position=A,B.internals.positionAbsolute=R,K.set(B.id,B)}X(K)},[])}var V6=r.createContext(null),kU=V6.Provider;V6.Consumer;var u6=()=>{return r.useContext(V6)},yU=(_)=>({connectOnClick:_.connectOnClick,noPanClassName:_.noPanClassName,rfId:_.rfId}),j9=r.createContext(null);function vU({children:_}){let Q=M1(yU,P1);return l.jsx(j9.Provider,{value:Q,children:_})}function jU(){let _=r.useContext(j9);if(!_)throw Error("useHandleConfig must be used within a HandleConfigProvider");return _}var VU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},uU=(_,Q,J)=>(q)=>{let{connectionClickStartHandle:U,connectionMode:G,connection:Z}=q,{fromHandle:F,toHandle:X,isValid:Y}=Z;if(!F&&!U)return VU;let H=X?.nodeId===_&&X?.id===Q&&X?.type===J;return{connectingFrom:F?.nodeId===_&&F?.id===Q&&F?.type===J,connectingTo:H,clickConnecting:U?.nodeId===_&&U?.id===Q&&U?.type===J,isPossibleEndHandle:G===E0.Strict?F?.type!==J:_!==F?.nodeId||Q!==F?.id,connectionInProcess:!!F,clickConnectionInProcess:!!U,valid:H&&Y}};function bU({type:_="source",position:Q=J1.Top,isValidConnection:J,isConnectable:q=!0,isConnectableStart:U=!0,isConnectableEnd:G=!0,id:Z,onConnect:F,children:X,className:Y,onMouseDown:H,onTouchStart:K,...L},z){let W=Z||null,O=_==="target",T=N1(),B=u6(),{connectOnClick:w,noPanClassName:A,rfId:R}=jU(),{connectingFrom:I,connectingTo:C,clickConnecting:P,isPossibleEndHandle:k,connectionInProcess:N,clickConnectionInProcess:v,valid:E}=M1(uU(B,W,_),P1);if(!B)T.getState().onError?.("010",i1.error010());let g=(b)=>{let{defaultEdgeOptions:j,onConnect:x,hasDefaultEdges:V}=T.getState(),D={...j,...b};if(V){let{edges:f,setEdges:y,onError:p}=T.getState();y(LU(D,f,{onError:p}))}x?.(D),F?.(D)},h=(b)=>{if(!B)return;let j=O6(b.nativeEvent);if(U&&(j&&b.button===0||!j)){let x=T.getState();Y4.onPointerDown(b.nativeEvent,{handleDomNode:b.currentTarget,autoPanOnConnect:x.autoPanOnConnect,connectionMode:x.connectionMode,connectionRadius:x.connectionRadius,domNode:x.domNode,nodeLookup:x.nodeLookup,lib:x.lib,isTarget:O,handleId:W,nodeId:B,flowId:x.rfId,panBy:x.panBy,cancelConnection:x.cancelConnection,onConnectStart:x.onConnectStart,onConnectEnd:(...V)=>T.getState().onConnectEnd?.(...V),updateConnection:x.updateConnection,onConnect:g,isValidConnection:J||((...V)=>T.getState().isValidConnection?.(...V)??!0),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:x.autoPanSpeed,dragThreshold:x.connectionDragThreshold})}if(j)H?.(b);else K?.(b)},S=(b)=>{let{onClickConnectStart:j,onClickConnectEnd:x,connectionClickStartHandle:V,connectionMode:D,isValidConnection:f,lib:y,rfId:p,nodeLookup:u,connection:s}=T.getState();if(!B||!V&&!U)return;if(!V){j?.(b.nativeEvent,{nodeId:B,handleId:W,handleType:_}),T.setState({connectionClickStartHandle:{nodeId:B,type:_,id:W}});return}let t=T6(b.target),a=J||f,{connection:d,isValid:c}=Y4.isValid(b.nativeEvent,{handle:{nodeId:B,id:W,type:_},connectionMode:D,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:a,flowId:p,doc:t,lib:y,nodeLookup:u});if(c&&d)g(d);let e=structuredClone(s);delete e.inProgress,e.toPosition=e.toHandle?e.toHandle.position:null,x?.(b,e),T.setState({connectionClickStartHandle:null})};return l.jsx("div",{"data-handleid":W,"data-nodeid":B,"data-handlepos":Q,"data-id":`${R}-${B}-${W}-${_}`,className:C1(["react-flow__handle",`react-flow__handle-${Q}`,"nodrag",A,Y,{source:!O,target:O,connectable:q,connectablestart:U,connectableend:G,clickconnecting:P,connectingfrom:I,connectingto:C,valid:E,connectionindicator:q&&(!N||k)&&(N||v?G:U)}]),onMouseDown:h,onTouchStart:h,onClick:w?S:void 0,ref:z,...L,children:X})}var A4=r.memo(C9(bU));function DU({data:_,isConnectable:Q,sourcePosition:J=J1.Bottom}){return l.jsxs(l.Fragment,{children:[_?.label,l.jsx(A4,{type:"source",position:J,isConnectable:Q})]})}function hU({data:_,isConnectable:Q,targetPosition:J=J1.Top,sourcePosition:q=J1.Bottom}){return l.jsxs(l.Fragment,{children:[l.jsx(A4,{type:"target",position:J,isConnectable:Q}),_?.label,l.jsx(A4,{type:"source",position:q,isConnectable:Q})]})}function EU(){return null}function xU({data:_,isConnectable:Q,targetPosition:J=J1.Top}){return l.jsxs(l.Fragment,{children:[l.jsx(A4,{type:"target",position:J,isConnectable:Q}),_?.label]})}var B4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Z9={input:DU,default:hU,output:xU,group:EU};function mU(_){if(_.internals.handleBounds===void 0)return{width:_.width??_.initialWidth??_.style?.width,height:_.height??_.initialHeight??_.style?.height};return{width:_.width??_.style?.width,height:_.height??_.style?.height}}var gU=(_)=>{let{width:Q,height:J,x:q,y:U}=Z2(_.nodeLookup,{filter:(G)=>!!G.selected});return{width:e1(Q)?Q:null,height:e1(J)?J:null,userSelectionActive:_.userSelectionActive,transformString:`translate(${_.transform[0]}px,${_.transform[1]}px) scale(${_.transform[2]}) translate(${q}px,${U}px)`}};function pU({onSelectionContextMenu:_,noPanClassName:Q,disableKeyboardA11y:J}){let q=N1(),{width:U,height:G,transformString:Z,userSelectionActive:F}=M1(gU,P1),X=v9(),Y=r.useRef(null);r.useEffect(()=>{if(!J)Y.current?.focus({preventScroll:!0})},[J]);let H=!F&&U!==null&&G!==null;if(y9({nodeRef:Y,disabled:!H}),!H)return null;let K=_?(z)=>{let W=q.getState().nodes.filter((O)=>O.selected);_(z,W)}:void 0,L=(z)=>{if(Object.prototype.hasOwnProperty.call(B4,z.key))z.preventDefault(),X({direction:B4[z.key],factor:z.shiftKey?4:1})};return l.jsx("div",{className:C1(["react-flow__nodesselection","react-flow__container",Q]),style:{transform:Z},children:l.jsx("div",{ref:Y,className:"react-flow__nodesselection-rect",onContextMenu:K,tabIndex:J?void 0:-1,onKeyDown:J?void 0:L,style:{width:U,height:G}})})}var F9=typeof window<"u"?window:void 0,cU=(_)=>{return{nodesSelectionActive:_.nodesSelectionActive,userSelectionActive:_.userSelectionActive}};function V9({children:_,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,paneClickDistance:F,deleteKeyCode:X,selectionKeyCode:Y,selectionOnDrag:H,selectionMode:K,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:W,panActivationKeyCode:O,zoomActivationKeyCode:T,elementsSelectable:B,zoomOnScroll:w,zoomOnPinch:A,panOnScroll:R,panOnScrollSpeed:I,panOnScrollMode:C,zoomOnDoubleClick:P,panOnDrag:k,autoPanOnSelection:N,defaultViewport:v,translateExtent:E,minZoom:g,maxZoom:h,preventScrolling:S,onSelectionContextMenu:b,noWheelClassName:j,noPanClassName:x,disableKeyboardA11y:V,onViewportChange:D,isControlledViewport:f}){let{nodesSelectionActive:y,userSelectionActive:p}=M1(cU,P1),u=M5(Y,{target:F9}),s=M5(O,{target:F9}),t=s||k,a=s||R,d=H&&t!==!0,c=u||p||d;return RU({deleteKeyCode:X,multiSelectionKeyCode:W}),l.jsx(IU,{onPaneContextMenu:G,elementsSelectable:B,zoomOnScroll:w,zoomOnPinch:A,panOnScroll:a,panActivationKeyPressed:s,panOnScrollSpeed:I,panOnScrollMode:C,zoomOnDoubleClick:P,panOnDrag:!u&&t,defaultViewport:v,translateExtent:E,minZoom:g,maxZoom:h,zoomActivationKeyCode:T,preventScrolling:S,noWheelClassName:j,noPanClassName:x,onViewportChange:D,isControlledViewport:f,paneClickDistance:F,selectionOnDrag:d,children:l.jsxs(CU,{onSelectionStart:L,onSelectionEnd:z,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,panOnDrag:t,autoPanOnSelection:N,isSelecting:!!c,selectionMode:K,selectionKeyPressed:u,paneClickDistance:F,selectionOnDrag:d,children:[_,y&&l.jsx(pU,{onSelectionContextMenu:b,noPanClassName:x,disableKeyboardA11y:V})]})})}V9.displayName="FlowRenderer";var lU=r.memo(V9),rU=(_)=>(Q)=>{return _?Q4(Q.nodeLookup,{x:0,y:0,width:Q.width,height:Q.height},Q.transform,!0).map((J)=>J.id):Array.from(Q.nodeLookup.keys())};function iU(_){return M1(r.useCallback(rU(_),[_]),P1)}var dU=(_)=>_.updateNodeInternals;function aU(){let _=M1(dU),[Q]=r.useState(()=>{if(typeof ResizeObserver>"u")return null;return new ResizeObserver((J)=>{let q=new Map;J.forEach((U)=>{let G=U.target.getAttribute("data-id");q.set(G,{id:G,nodeElement:U.target,force:!0})}),_(q)})});return r.useEffect(()=>{return()=>{Q?.disconnect()}},[Q]),Q}function sU({node:_,nodeType:Q,hasDimensions:J,resizeObserver:q}){let U=N1(),G=r.useRef(null),Z=r.useRef(null),F=r.useRef(_.sourcePosition),X=r.useRef(_.targetPosition),Y=r.useRef(Q),H=J&&!!_.internals.handleBounds;return r.useEffect(()=>{if(G.current&&!_.hidden&&(!H||Z.current!==G.current)){if(Z.current)q?.unobserve(Z.current);q?.observe(G.current),Z.current=G.current}},[H,_.hidden]),r.useEffect(()=>{return()=>{if(Z.current)q?.unobserve(Z.current),Z.current=null}},[]),r.useEffect(()=>{if(G.current){let K=Y.current!==Q,L=F.current!==_.sourcePosition,z=X.current!==_.targetPosition;if(K||L||z)Y.current=Q,F.current=_.sourcePosition,X.current=_.targetPosition,U.getState().updateNodeInternals(new Map([[_.id,{id:_.id,nodeElement:G.current,force:!0}]]))}},[_.id,Q,_.sourcePosition,_.targetPosition]),G}function tU({id:_,onClick:Q,onMouseEnter:J,onMouseMove:q,onMouseLeave:U,onContextMenu:G,onDoubleClick:Z,nodesDraggable:F,elementsSelectable:X,nodesConnectable:Y,nodesFocusable:H,resizeObserver:K,noDragClassName:L,noPanClassName:z,disableKeyboardA11y:W,rfId:O,nodeTypes:T,nodeClickDistance:B,onError:w}){let{node:A,internals:R,isParent:I}=M1((c)=>{let e=c.nodeLookup.get(_),Q1=c.parentLookup.has(_);return{node:e,internals:e.internals,isParent:Q1}},P1),C=A.type||"default",P=T?.[C]||Z9[C];if(P===void 0)w?.("003",i1.error003(C)),C="default",P=T?.default||Z9.default;let k=!!(A.draggable||F&&typeof A.draggable>"u"),N=!!(A.selectable||X&&typeof A.selectable>"u"),v=!!(A.connectable||Y&&typeof A.connectable>"u"),E=!!(A.focusable||H&&typeof A.focusable>"u"),g=N1(),h=W6(A),S=sU({node:A,nodeType:C,hasDimensions:h,resizeObserver:K}),b=y9({nodeRef:S,disabled:A.hidden||!k,noDragClassName:L,handleSelector:A.dragHandle,nodeId:_,isSelectable:N,nodeClickDistance:B}),j=v9();if(A.hidden)return null;let x=Q0(A),V=mU(A),D=N||k||Q||J||q||U,f=J?(c)=>J(c,{...R.userNode}):void 0,y=q?(c)=>q(c,{...R.userNode}):void 0,p=U?(c)=>U(c,{...R.userNode}):void 0,u=G?(c)=>G(c,{...R.userNode}):void 0,s=Z?(c)=>Z(c,{...R.userNode}):void 0,t=(c)=>{let{selectNodesOnDrag:e,nodeDragThreshold:Q1}=g.getState();if(N&&(!e||!k||Q1>0))j6({id:_,store:g,nodeRef:S});if(Q)Q(c,{...R.userNode})},a=(c)=>{if(R6(c.nativeEvent)||W)return;if(U6.includes(c.key)&&N){let e=c.key==="Escape";j6({id:_,store:g,unselect:e,nodeRef:S})}else if(k&&A.selected&&Object.prototype.hasOwnProperty.call(B4,c.key)){c.preventDefault();let{ariaLabelConfig:e}=g.getState();g.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:c.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),j({direction:B4[c.key],factor:c.shiftKey?4:1})}},d=()=>{if(W||!S.current?.matches(":focus-visible"))return;let{transform:c,width:e,height:Q1,autoPanOnNodeFocus:G1,setCenter:$1}=g.getState();if(!G1)return;if(!(Q4(new Map([[_,A]]),{x:0,y:0,width:e,height:Q1},c,!0).length>0))$1(A.position.x+x.width/2,A.position.y+x.height/2,{zoom:c[2]})};return l.jsx("div",{className:C1(["react-flow__node",`react-flow__node-${C}`,{[z]:k},A.className,{selected:A.selected,selectable:N,parent:I,draggable:k,dragging:b}]),ref:S,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:h?"visible":"hidden",...A.style,...V},"data-id":_,"data-testid":`rf__node-${_}`,onMouseEnter:f,onMouseMove:y,onMouseLeave:p,onContextMenu:u,onClick:t,onDoubleClick:s,onKeyDown:E?a:void 0,tabIndex:E?0:void 0,onFocus:E?d:void 0,role:A.ariaRole??(E?"group":void 0),"aria-roledescription":"node","aria-describedby":W?void 0:`${f9}-${O}`,"aria-label":A.ariaLabel,...A.domAttributes,children:l.jsx(kU,{value:_,children:l.jsx(P,{id:_,data:A.data,type:C,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:A.selected??!1,selectable:N,draggable:k,deletable:A.deletable??!0,isConnectable:v,sourcePosition:A.sourcePosition,targetPosition:A.targetPosition,dragging:b,dragHandle:A.dragHandle,zIndex:R.z,parentId:A.parentId,...x})})})}var oU=r.memo(tU),nU=(_)=>({nodesConnectable:_.nodesConnectable,nodesFocusable:_.nodesFocusable,elementsSelectable:_.elementsSelectable,onError:_.onError});function u9(_){let{nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,onError:U}=M1(nU,P1),G=iU(_.onlyRenderVisibleElements),Z=aU();return l.jsx("div",{className:"react-flow__nodes",style:T4,children:G.map((F)=>{return l.jsx(oU,{id:F,nodeTypes:_.nodeTypes,nodeExtent:_.nodeExtent,onClick:_.onNodeClick,onMouseEnter:_.onNodeMouseEnter,onMouseMove:_.onNodeMouseMove,onMouseLeave:_.onNodeMouseLeave,onContextMenu:_.onNodeContextMenu,onDoubleClick:_.onNodeDoubleClick,noDragClassName:_.noDragClassName,noPanClassName:_.noPanClassName,rfId:_.rfId,disableKeyboardA11y:_.disableKeyboardA11y,resizeObserver:Z,nodesDraggable:_.nodesDraggable??!0,nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,nodeClickDistance:_.nodeClickDistance,onError:U},F)})})}u9.displayName="NodeRenderer";var eU=r.memo(u9);function _G(_){return M1(r.useCallback((J)=>{if(!_)return J.edges.map((U)=>U.id);let q=[];if(J.width&&J.height)for(let U of J.edges){let G=J.nodeLookup.get(U.source),Z=J.nodeLookup.get(U.target);if(G&&Z&&W7({sourceNode:G,targetNode:Z,width:J.width,height:J.height,transform:J.transform}))q.push(U.id)}return q},[_]),P1)}var QG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_}};return l.jsx("polyline",{className:"arrow",style:J,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},JG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_,fill:_}};return l.jsx("polyline",{className:"arrowclosed",style:J,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},K9={[k2.Arrow]:QG,[k2.ArrowClosed]:JG};function $G(_){let Q=N1();return r.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(K9,_))return Q.getState().onError?.("009",i1.error009(_)),null;return K9[_]},[_])}var qG=({id:_,type:Q,color:J,width:q=12.5,height:U=12.5,markerUnits:G="strokeWidth",strokeWidth:Z,orient:F="auto-start-reverse"})=>{let X=$G(Q);if(!X)return null;return l.jsx("marker",{className:"react-flow__arrowhead",id:_,markerWidth:`${q}`,markerHeight:`${U}`,viewBox:"-10 -10 20 20",markerUnits:G,orient:F,refX:"0",refY:"0",children:l.jsx(X,{color:J,strokeWidth:Z})})},b9=({defaultColor:_,rfId:Q})=>{let J=M1((G)=>G.edges),q=M1((G)=>G.defaultEdgeOptions),U=r.useMemo(()=>{return M7(J,{id:Q,defaultColor:_,defaultMarkerStart:q?.markerStart,defaultMarkerEnd:q?.markerEnd})},[J,q,Q,_]);if(!U.length)return null;return l.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:l.jsx("defs",{children:U.map((G)=>l.jsx(qG,{id:G.id,type:G.type,color:G.color,width:G.width,height:G.height,markerUnits:G.markerUnits,strokeWidth:G.strokeWidth,orient:G.orient},G.id))})})};b9.displayName="MarkerDefinitions";var UG=r.memo(b9);function D9({x:_,y:Q,label:J,labelStyle:q,labelShowBg:U=!0,labelBgStyle:G,labelBgPadding:Z=[2,4],labelBgBorderRadius:F=2,children:X,className:Y,...H}){let[K,L]=r.useState({x:1,y:0,width:0,height:0}),z=C1(["react-flow__edge-textwrapper",Y]),W=r.useRef(null);if(r.useEffect(()=>{if(W.current){let O=W.current.getBBox();L({x:O.x,y:O.y,width:O.width,height:O.height})}},[J]),!J)return null;return l.jsxs("g",{transform:`translate(${_-K.width/2} ${Q-K.height/2})`,className:z,visibility:K.width?"visible":"hidden",...H,children:[U&&l.jsx("rect",{width:K.width+2*Z[0],x:-Z[0],y:-Z[1],height:K.height+2*Z[1],className:"react-flow__edge-textbg",style:G,rx:F,ry:F}),l.jsx("text",{className:"react-flow__edge-text",y:K.height/2,dy:"0.3em",ref:W,style:q,children:J}),X]})}D9.displayName="EdgeText";var GG=r.memo(D9);function R4({path:_,labelX:Q,labelY:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X,interactionWidth:Y=20,...H}){return l.jsxs(l.Fragment,{children:[l.jsx("path",{...H,d:_,fill:"none",className:C1(["react-flow__edge-path",H.className])}),Y?l.jsx("path",{d:_,fill:"none",strokeOpacity:0,strokeWidth:Y,className:"react-flow__edge-interaction"}):null,q&&e1(Q)&&e1(J)?l.jsx(GG,{x:Q,y:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X}):null]})}function H9({pos:_,x1:Q,y1:J,x2:q,y2:U}){if(_===J1.Left||_===J1.Right)return[0.5*(Q+q),J];return[Q,0.5*(J+U)]}function h9({sourceX:_,sourceY:Q,sourcePosition:J=J1.Bottom,targetX:q,targetY:U,targetPosition:G=J1.Top}){let[Z,F]=H9({pos:J,x1:_,y1:Q,x2:q,y2:U}),[X,Y]=H9({pos:G,x1:q,y1:U,x2:_,y2:Q}),[H,K,L,z]=G4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:Z,sourceControlY:F,targetControlX:X,targetControlY:Y});return[`M${_},${Q} C${Z},${F} ${X},${Y} ${q},${U}`,H,K,L,z]}function E9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z,targetPosition:F,label:X,labelStyle:Y,labelShowBg:H,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,interactionWidth:B})=>{let[w,A,R]=h9({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F}),I=_.isInternal?void 0:Q;return l.jsx(R4,{id:I,path:w,labelX:A,labelY:R,label:X,labelStyle:Y,labelShowBg:H,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,interactionWidth:B})})}var ZG=E9({isInternal:!1}),x9=E9({isInternal:!0});ZG.displayName="SimpleBezierEdge";x9.displayName="SimpleBezierEdgeInternal";function m9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:H,labelBgBorderRadius:K,style:L,sourcePosition:z=J1.Bottom,targetPosition:W=J1.Top,markerEnd:O,markerStart:T,pathOptions:B,interactionWidth:w})=>{let[A,R,I]=B5({sourceX:J,sourceY:q,sourcePosition:z,targetX:U,targetY:G,targetPosition:W,borderRadius:B?.borderRadius,offset:B?.offset,stepPosition:B?.stepPosition}),C=_.isInternal?void 0:Q;return l.jsx(R4,{id:C,path:A,labelX:R,labelY:I,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:H,labelBgBorderRadius:K,style:L,markerEnd:O,markerStart:T,interactionWidth:w})})}var g9=m9({isInternal:!1}),p9=m9({isInternal:!0});g9.displayName="SmoothStepEdge";p9.displayName="SmoothStepEdgeInternal";function c9(_){return r.memo(({id:Q,...J})=>{let q=_.isInternal?void 0:Q;return l.jsx(g9,{...J,id:q,pathOptions:r.useMemo(()=>({borderRadius:0,offset:J.pathOptions?.offset}),[J.pathOptions?.offset])})})}var FG=c9({isInternal:!1}),l9=c9({isInternal:!0});FG.displayName="StepEdge";l9.displayName="StepEdgeInternal";function r9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:H,labelBgBorderRadius:K,style:L,markerEnd:z,markerStart:W,interactionWidth:O})=>{let[T,B,w]=F4({sourceX:J,sourceY:q,targetX:U,targetY:G}),A=_.isInternal?void 0:Q;return l.jsx(R4,{id:A,path:T,labelX:B,labelY:w,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:H,labelBgBorderRadius:K,style:L,markerEnd:z,markerStart:W,interactionWidth:O})})}var KG=r9({isInternal:!1}),i9=r9({isInternal:!0});KG.displayName="StraightEdge";i9.displayName="StraightEdgeInternal";function d9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z=J1.Bottom,targetPosition:F=J1.Top,label:X,labelStyle:Y,labelShowBg:H,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,pathOptions:B,interactionWidth:w})=>{let[A,R,I]=Z4({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F,curvature:B?.curvature}),C=_.isInternal?void 0:Q;return l.jsx(R4,{id:C,path:A,labelX:R,labelY:I,label:X,labelStyle:Y,labelShowBg:H,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,interactionWidth:w})})}var HG=d9({isInternal:!1}),a9=d9({isInternal:!0});HG.displayName="BezierEdge";a9.displayName="BezierEdgeInternal";var X9={default:a9,straight:i9,step:l9,smoothstep:p9,simplebezier:x9},Y9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},XG=(_,Q,J)=>{if(J===J1.Left)return _-Q;if(J===J1.Right)return _+Q;return _},YG=(_,Q,J)=>{if(J===J1.Top)return _-Q;if(J===J1.Bottom)return _+Q;return _},L9="react-flow__edgeupdater";function z9({position:_,centerX:Q,centerY:J,radius:q=10,onMouseDown:U,onMouseEnter:G,onMouseOut:Z,type:F}){return l.jsx("circle",{onMouseDown:U,onMouseEnter:G,onMouseOut:Z,className:C1([L9,`${L9}-${F}`]),cx:XG(Q,q,_),cy:YG(J,q,_),r:q,stroke:"transparent",fill:"transparent"})}function LG({isReconnectable:_,reconnectRadius:Q,edge:J,sourceX:q,sourceY:U,targetX:G,targetY:Z,sourcePosition:F,targetPosition:X,onReconnect:Y,onReconnectStart:H,onReconnectEnd:K,setReconnecting:L,setUpdateHover:z}){let W=N1(),O=(R,I)=>{if(R.button!==0)return;let{autoPanOnConnect:C,domNode:P,connectionMode:k,connectionRadius:N,lib:v,onConnectStart:E,cancelConnection:g,nodeLookup:h,rfId:S,panBy:b,updateConnection:j}=W.getState(),x=I.type==="target",V=(y,p)=>{L(!1),K?.(y,J,I.type,p)},D=(y)=>Y?.(J,y),f=(y,p)=>{L(!0),H?.(R,J,I.type),E?.(y,p)};Y4.onPointerDown(R.nativeEvent,{autoPanOnConnect:C,connectionMode:k,connectionRadius:N,domNode:P,handleId:I.id,nodeId:I.nodeId,nodeLookup:h,isTarget:x,edgeUpdaterType:I.type,lib:v,flowId:S,cancelConnection:g,panBy:b,isValidConnection:(...y)=>W.getState().isValidConnection?.(...y)??!0,onConnect:D,onConnectStart:f,onConnectEnd:(...y)=>W.getState().onConnectEnd?.(...y),onReconnectEnd:V,updateConnection:j,getTransform:()=>W.getState().transform,getFromHandle:()=>W.getState().connection.fromHandle,dragThreshold:W.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},T=(R)=>O(R,{nodeId:J.target,id:J.targetHandle??null,type:"target"}),B=(R)=>O(R,{nodeId:J.source,id:J.sourceHandle??null,type:"source"}),w=()=>z(!0),A=()=>z(!1);return l.jsxs(l.Fragment,{children:[(_===!0||_==="source")&&l.jsx(z9,{position:F,centerX:q,centerY:U,radius:Q,onMouseDown:T,onMouseEnter:w,onMouseOut:A,type:"source"}),(_===!0||_==="target")&&l.jsx(z9,{position:X,centerX:G,centerY:Z,radius:Q,onMouseDown:B,onMouseEnter:w,onMouseOut:A,type:"target"})]})}function zG({id:_,edgesFocusable:Q,edgesReconnectable:J,elementsSelectable:q,onClick:U,onDoubleClick:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,reconnectRadius:H,onReconnect:K,onReconnectStart:L,onReconnectEnd:z,rfId:W,edgeTypes:O,noPanClassName:T,onError:B,disableKeyboardA11y:w}){let A=M1(($1)=>$1.edgeLookup.get(_)),R=M1(($1)=>$1.defaultEdgeOptions);A=R?{...R,...A}:A;let I=A.type||"default",C=O?.[I]||X9[I];if(C===void 0)B?.("011",i1.error011(I)),I="default",C=O?.default||X9.default;let P=!!(A.focusable||Q&&typeof A.focusable>"u"),k=typeof K<"u"&&(A.reconnectable||J&&typeof A.reconnectable>"u"),N=!!(A.selectable||q&&typeof A.selectable>"u"),v=r.useRef(null),[E,g]=r.useState(!1),[h,S]=r.useState(!1),b=N1(),{zIndex:j=A.zIndex,sourceX:x,sourceY:V,targetX:D,targetY:f,sourcePosition:y,targetPosition:p}=M1(r.useCallback(($1)=>{let Z1=$1.nodeLookup.get(A.source),Y1=$1.nodeLookup.get(A.target);if(!Z1||!Y1)return Y9;let K1=B7({id:_,sourceNode:Z1,targetNode:Y1,sourceHandle:A.sourceHandle||null,targetHandle:A.targetHandle||null,connectionMode:$1.connectionMode,onError:B}),o=z7({selected:A.selected,zIndex:A.zIndex,sourceNode:Z1,targetNode:Y1,elevateOnSelect:$1.elevateEdgesOnSelect,zIndexMode:$1.zIndexMode});return{...K1||Y9,zIndex:o}},[A.source,A.target,A.sourceHandle,A.targetHandle,A.selected,A.zIndex,B]),P1),u=r.useMemo(()=>A.markerStart?`url('#${K4(A.markerStart,W)}')`:void 0,[A.markerStart,W]),s=r.useMemo(()=>A.markerEnd?`url('#${K4(A.markerEnd,W)}')`:void 0,[A.markerEnd,W]);if(A.hidden||x===null||V===null||D===null||f===null)return null;let t=($1)=>{let{addSelectedEdges:Z1,unselectNodesAndEdges:Y1,multiSelectionActive:K1}=b.getState();if(N)if(b.setState({nodesSelectionActive:!1}),A.selected&&K1)Y1({nodes:[],edges:[A]}),v.current?.blur();else Z1([_]);if(U)U($1,A)},a=G?($1)=>{G($1,{...A})}:void 0,d=Z?($1)=>{Z($1,{...A})}:void 0,c=F?($1)=>{F($1,{...A})}:void 0,e=X?($1)=>{X($1,{...A})}:void 0,Q1=Y?($1)=>{Y($1,{...A})}:void 0,G1=($1)=>{if(!w&&U6.includes($1.key)&&N){let{unselectNodesAndEdges:Z1,addSelectedEdges:Y1}=b.getState();if($1.key==="Escape")v.current?.blur(),Z1({edges:[A]});else Y1([_])}};return l.jsx("svg",{style:{zIndex:j},children:l.jsxs("g",{className:C1(["react-flow__edge",`react-flow__edge-${I}`,A.className,T,{selected:A.selected,animated:A.animated,inactive:!N&&!U,updating:E,selectable:N}]),onClick:t,onDoubleClick:a,onContextMenu:d,onMouseEnter:c,onMouseMove:e,onMouseLeave:Q1,onKeyDown:P?G1:void 0,tabIndex:P?0:void 0,role:A.ariaRole??(P?"group":"img"),"aria-roledescription":"edge","data-id":_,"data-testid":`rf__edge-${_}`,"aria-label":A.ariaLabel===null?void 0:A.ariaLabel||`Edge from ${A.source} to ${A.target}`,"aria-describedby":P?`${I9}-${W}`:void 0,ref:v,...A.domAttributes,children:[!h&&l.jsx(C,{id:_,source:A.source,target:A.target,type:A.type,selected:A.selected,animated:A.animated,selectable:N,deletable:A.deletable??!0,label:A.label,labelStyle:A.labelStyle,labelShowBg:A.labelShowBg,labelBgStyle:A.labelBgStyle,labelBgPadding:A.labelBgPadding,labelBgBorderRadius:A.labelBgBorderRadius,sourceX:x,sourceY:V,targetX:D,targetY:f,sourcePosition:y,targetPosition:p,data:A.data,style:A.style,sourceHandleId:A.sourceHandle,targetHandleId:A.targetHandle,markerStart:u,markerEnd:s,pathOptions:"pathOptions"in A?A.pathOptions:void 0,interactionWidth:A.interactionWidth}),k&&l.jsx(LG,{edge:A,isReconnectable:k,reconnectRadius:H,onReconnect:K,onReconnectStart:L,onReconnectEnd:z,sourceX:x,sourceY:V,targetX:D,targetY:f,sourcePosition:y,targetPosition:p,setUpdateHover:g,setReconnecting:S})]})})}var WG=r.memo(zG),AG=(_)=>({edgesFocusable:_.edgesFocusable,edgesReconnectable:_.edgesReconnectable,elementsSelectable:_.elementsSelectable,connectionMode:_.connectionMode,onError:_.onError});function s9({defaultMarkerColor:_,onlyRenderVisibleElements:Q,rfId:J,edgeTypes:q,noPanClassName:U,onReconnect:G,onEdgeContextMenu:Z,onEdgeMouseEnter:F,onEdgeMouseMove:X,onEdgeMouseLeave:Y,onEdgeClick:H,reconnectRadius:K,onEdgeDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,disableKeyboardA11y:O}){let{edgesFocusable:T,edgesReconnectable:B,elementsSelectable:w,onError:A}=M1(AG,P1),R=_G(Q);return l.jsxs("div",{className:"react-flow__edges",children:[l.jsx(UG,{defaultColor:_,rfId:J}),R.map((I)=>{return l.jsx(WG,{id:I,edgesFocusable:T,edgesReconnectable:B,elementsSelectable:w,noPanClassName:U,onReconnect:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,onClick:H,reconnectRadius:K,onDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,rfId:J,onError:A,edgeTypes:q,disableKeyboardA11y:O},I)})]})}s9.displayName="EdgeRenderer";var BG=r.memo(s9),W9=(_)=>`translate(${_[0]}px,${_[1]}px) scale(${_[2]})`;function MG({children:_}){let Q=N1(),J=r.useRef(null),[q]=r.useState(()=>Q.getState().transform);return S9(()=>{let U=null,G=()=>{let Z=Q.getState().transform;if(U&&Z[0]===U[0]&&Z[1]===U[1]&&Z[2]===U[2])return;if(U=Z,J.current)J.current.style.transform=W9(Z)};return G(),Q.subscribe(G)},[Q]),l.jsx("div",{ref:J,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:W9(q)},children:_})}function TG(_){let Q=T5(),J=r.useRef(!1);r.useEffect(()=>{if(!J.current&&Q.viewportInitialized&&_)setTimeout(()=>_(Q),1),J.current=!0},[_,Q.viewportInitialized])}var RG=(_)=>_.panZoom?.syncViewport;function OG(_){let Q=M1(RG),J=N1();return r.useEffect(()=>{if(_)Q?.(_),J.setState({transform:[_.x,_.y,_.zoom]})},[_,Q]),null}function A9(_){return _.connection.inProgress?{..._.connection,to:u2(_.connection.to,_.transform)}:{..._.connection}}function fG(_){if(_)return(J)=>{let q=A9(J);return _(q)};return A9}function IG(_){let Q=fG(_);return M1(Q,P1)}var wG=(_)=>({nodesConnectable:_.nodesConnectable,isValid:_.connection.isValid,inProgress:_.connection.inProgress,width:_.width,height:_.height});function PG({containerStyle:_,style:Q,type:J,component:q}){let{nodesConnectable:U,width:G,height:Z,isValid:F,inProgress:X}=M1(wG,P1);if(!(G&&U&&X))return null;return l.jsx("svg",{style:_,width:G,height:Z,className:"react-flow__connectionline react-flow__container",children:l.jsx("g",{className:C1(["react-flow__connection",M6(F)]),children:l.jsx(t9,{style:Q,type:J,CustomComponent:q,isValid:F})})})}var t9=({style:_,type:Q=W0.Bezier,CustomComponent:J,isValid:q})=>{let{inProgress:U,from:G,fromNode:Z,fromHandle:F,fromPosition:X,to:Y,toNode:H,toHandle:K,toPosition:L,pointer:z}=IG();if(!U)return;if(J)return l.jsx(J,{connectionLineType:Q,connectionLineStyle:_,fromNode:Z,fromHandle:F,fromX:G.x,fromY:G.y,toX:Y.x,toY:Y.y,fromPosition:X,toPosition:L,connectionStatus:M6(q),toNode:H,toHandle:K,pointer:z});let W="",O={sourceX:G.x,sourceY:G.y,sourcePosition:X,targetX:Y.x,targetY:Y.y,targetPosition:L};switch(Q){case W0.Bezier:[W]=Z4(O);break;case W0.SimpleBezier:[W]=h9(O);break;case W0.Step:[W]=B5({...O,borderRadius:0});break;case W0.SmoothStep:[W]=B5(O);break;default:[W]=F4(O)}return l.jsx("path",{d:W,fill:"none",className:"react-flow__connection-path",style:_})};t9.displayName="ConnectionLine";var NG={};function B9(_=NG){let Q=r.useRef(_),J=N1();r.useEffect(()=>{{let q=new Set([...Object.keys(Q.current),...Object.keys(_)]);for(let U of q)if(Q.current[U]!==_[U]){J.getState().onError?.("002",i1.error002());break}Q.current=_}},[_])}function CG(){let _=N1(),Q=r.useRef(!1);r.useEffect(()=>{if(!Q.current){let J=document.querySelector(".react-flow__pane");if(J&&window.getComputedStyle(J).zIndex!=="1")_.getState().onError?.("013",i1.error013("react"));Q.current=!0}},[])}function o9({nodeTypes:_,edgeTypes:Q,onInit:J,onNodeClick:q,onEdgeClick:U,onNodeDoubleClick:G,onEdgeDoubleClick:Z,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:H,onSelectionContextMenu:K,onSelectionStart:L,onSelectionEnd:z,connectionLineType:W,connectionLineStyle:O,connectionLineComponent:T,connectionLineContainerStyle:B,selectionKeyCode:w,selectionOnDrag:A,selectionMode:R,multiSelectionKeyCode:I,panActivationKeyCode:C,zoomActivationKeyCode:P,deleteKeyCode:k,onlyRenderVisibleElements:N,elementsSelectable:v,defaultViewport:E,translateExtent:g,minZoom:h,maxZoom:S,preventScrolling:b,defaultMarkerColor:j,zoomOnScroll:x,zoomOnPinch:V,panOnScroll:D,panOnScrollSpeed:f,panOnScrollMode:y,zoomOnDoubleClick:p,panOnDrag:u,autoPanOnSelection:s,onPaneClick:t,onPaneMouseEnter:a,onPaneMouseMove:d,onPaneMouseLeave:c,onPaneScroll:e,onPaneContextMenu:Q1,paneClickDistance:G1,nodeClickDistance:$1,onEdgeContextMenu:Z1,onEdgeMouseEnter:Y1,onEdgeMouseMove:K1,onEdgeMouseLeave:o,reconnectRadius:z1,onReconnect:q1,onReconnectStart:y1,onReconnectEnd:c1,noDragClassName:l1,noWheelClassName:k0,noPanClassName:F0,disableKeyboardA11y:M0,nodeExtent:a1,rfId:o1,viewport:n1,onViewportChange:K0,nodesDraggable:B2}){return B9(_),B9(Q),CG(),TG(J),OG(n1),l.jsx(lU,{onPaneClick:t,onPaneMouseEnter:a,onPaneMouseMove:d,onPaneMouseLeave:c,onPaneContextMenu:Q1,onPaneScroll:e,paneClickDistance:G1,deleteKeyCode:k,selectionKeyCode:w,selectionOnDrag:A,selectionMode:R,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:I,panActivationKeyCode:C,zoomActivationKeyCode:P,elementsSelectable:v,zoomOnScroll:x,zoomOnPinch:V,zoomOnDoubleClick:p,panOnScroll:D,panOnScrollSpeed:f,panOnScrollMode:y,panOnDrag:u,autoPanOnSelection:s,defaultViewport:E,translateExtent:g,minZoom:h,maxZoom:S,onSelectionContextMenu:K,preventScrolling:b,noDragClassName:l1,noWheelClassName:k0,noPanClassName:F0,disableKeyboardA11y:M0,onViewportChange:K0,isControlledViewport:!!n1,children:l.jsxs(MG,{children:[l.jsx(BG,{edgeTypes:Q,onEdgeClick:U,onEdgeDoubleClick:Z,onReconnect:q1,onReconnectStart:y1,onReconnectEnd:c1,onlyRenderVisibleElements:N,onEdgeContextMenu:Z1,onEdgeMouseEnter:Y1,onEdgeMouseMove:K1,onEdgeMouseLeave:o,reconnectRadius:z1,defaultMarkerColor:j,noPanClassName:F0,disableKeyboardA11y:M0,rfId:o1}),l.jsx(PG,{style:O,type:W,component:T,containerStyle:B}),l.jsx("div",{className:"react-flow__edgelabel-renderer"}),l.jsx(eU,{nodeTypes:_,onNodeClick:q,onNodeDoubleClick:G,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:H,nodeClickDistance:$1,onlyRenderVisibleElements:N,noPanClassName:F0,noDragClassName:l1,disableKeyboardA11y:M0,nodeExtent:a1,rfId:o1,nodesDraggable:B2}),l.jsx("div",{className:"react-flow__viewport-portal"})]})})}o9.displayName="GraphView";var SG=r.memo(o9),kG=z6("React Flow","https://reactflow.dev/"),M9=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X=0.5,maxZoom:Y=2,nodeOrigin:H,nodeExtent:K,zIndexMode:L="basic"}={})=>{let z=new Map,W=new Map,O=new Map,T=new Map,B=q??Q??[],w=J??_??[],A=H??[0,0],R=K??v2;C6(O,T,B);let{nodesInitialized:I}=H4(w,z,W,{nodeOrigin:A,nodeExtent:R,zIndexMode:L}),C=[0,0,1];if(Z&&U&&G){let P=Z2(z,{filter:(E)=>!!((E.width||E.initialWidth)&&(E.height||E.initialHeight))}),{x:k,y:N,zoom:v}=A5(P,U,G,X,Y,F?.padding??0.1);C=[k,N,v]}return{rfId:"1",width:U??0,height:G??0,transform:C,nodes:w,nodesInitialized:I,nodeLookup:z,parentLookup:W,edges:B,edgeLookup:T,connectionLookup:O,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:J!==void 0,hasDefaultEdges:q!==void 0,panZoom:null,minZoom:X,maxZoom:Y,translateExtent:v2,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:E0.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:A,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:Z??!1,fitViewOptions:F,fitViewResolver:null,connection:{...Z6},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:kG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:G6,zIndexMode:L,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},yG=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:H,nodeExtent:K,zIndexMode:L})=>l7((z,W)=>{async function O(){let{nodeLookup:T,panZoom:B,fitViewOptions:w,fitViewResolver:A,width:R,height:I,minZoom:C,maxZoom:P}=W();if(!B)return;await Z7({nodes:T,width:R,height:I,panZoom:B,minZoom:C,maxZoom:P},w),A?.resolve(!0),z({fitViewResolver:null})}return{...M9({nodes:_,edges:Q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:H,nodeExtent:K,defaultNodes:J,defaultEdges:q,zIndexMode:L}),setNodes:(T)=>{let{nodeLookup:B,parentLookup:w,nodeOrigin:A,nodeExtent:R,elevateNodesOnSelect:I,fitViewQueued:C,zIndexMode:P,nodesSelectionActive:k}=W(),{nodesInitialized:N,hasSelectedNodes:v}=H4(T,B,w,{nodeOrigin:A,nodeExtent:R,elevateNodesOnSelect:I,checkEquality:!0,zIndexMode:P}),E=k&&v;if(C&&N)O(),z({nodes:T,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:E});else z({nodes:T,nodesInitialized:N,nodesSelectionActive:E})},setEdges:(T)=>{let{connectionLookup:B,edgeLookup:w}=W();C6(B,w,T),z({edges:T})},setDefaultNodesAndEdges:(T,B)=>{if(T){let{setNodes:w}=W();w(T),z({hasDefaultNodes:!0})}if(B){let{setEdges:w}=W();w(B),z({hasDefaultEdges:!0})}},updateNodeInternals:(T)=>{let{triggerNodeChanges:B,nodeLookup:w,parentLookup:A,domNode:R,nodeOrigin:I,nodeExtent:C,debug:P,fitViewQueued:k,zIndexMode:N}=W(),{changes:v,updatedInternals:E}=I7(T,w,A,R,I,C,N);if(!E)return;if(O7(w,A,{nodeOrigin:I,nodeExtent:C,zIndexMode:N}),k)O(),z({fitViewQueued:!1,fitViewOptions:void 0});else z({});if(v?.length>0){if(P)console.log("React Flow: trigger node changes",v);B?.(v)}},updateNodePositions:(T,B=!1)=>{let w=[],A=[],{nodeLookup:R,triggerNodeChanges:I,connection:C,updateConnection:P,onNodesChangeMiddlewareMap:k}=W();for(let[N,v]of T){let E=R.get(N),g=!!(E?.expandParent&&E?.parentId&&v?.position),h={id:N,type:"position",position:g?{x:Math.max(0,v.position.x),y:Math.max(0,v.position.y)}:v.position,dragging:B};if(E&&C.inProgress&&C.fromNode.id===E.id){let S=x0(E,C.fromHandle,J1.Left,!0);P({...C,from:S})}if(g&&E.parentId)w.push({id:N,parentId:E.parentId,rect:{...v.internals.positionAbsolute,width:v.measured.width??0,height:v.measured.height??0}});A.push(h)}if(w.length>0){let{parentLookup:N,nodeOrigin:v}=W(),E=X4(w,R,N,v);A.push(...E)}for(let N of k.values())A=N(A);I(A)},triggerNodeChanges:(T)=>{let{onNodesChange:B,setNodes:w,nodes:A,hasDefaultNodes:R,debug:I}=W();if(T?.length){if(R){let C=N9(T,A);w(C)}if(I)console.log("React Flow: trigger node changes",T);B?.(T)}},triggerEdgeChanges:(T)=>{let{onEdgesChange:B,setEdges:w,edges:A,hasDefaultEdges:R,debug:I}=W();if(T?.length){if(R){let C=XU(T,A);w(C)}if(I)console.log("React Flow: trigger edge changes",T);B?.(T)}},addSelectedNodes:(T)=>{let{multiSelectionActive:B,edgeLookup:w,nodeLookup:A,triggerNodeChanges:R,triggerEdgeChanges:I}=W();if(B){let C=T.map((P)=>F2(P,!0));R(C);return}R(D2(A,new Set([...T]),!0)),I(D2(w))},addSelectedEdges:(T)=>{let{multiSelectionActive:B,edgeLookup:w,nodeLookup:A,triggerNodeChanges:R,triggerEdgeChanges:I}=W();if(B){let C=T.map((P)=>F2(P,!0));I(C);return}I(D2(w,new Set([...T]))),R(D2(A,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:B}={})=>{let{edges:w,nodes:A,nodeLookup:R,triggerNodeChanges:I,triggerEdgeChanges:C}=W(),P=T?T:A,k=B?B:w,N=[];for(let E of P){if(!E.selected)continue;let g=R.get(E.id);if(g)g.selected=!1;N.push(F2(E.id,!1))}let v=[];for(let E of k){if(!E.selected)continue;v.push(F2(E.id,!1))}I(N),C(v)},setMinZoom:(T)=>{let{panZoom:B,maxZoom:w}=W();B?.setScaleExtent([T,w]),z({minZoom:T})},setMaxZoom:(T)=>{let{panZoom:B,minZoom:w}=W();B?.setScaleExtent([w,T]),z({maxZoom:T})},setTranslateExtent:(T)=>{W().panZoom?.setTranslateExtent(T),z({translateExtent:T})},resetSelectedElements:()=>{let{edges:T,nodes:B,triggerNodeChanges:w,triggerEdgeChanges:A,elementsSelectable:R}=W();if(!R)return;let I=B.reduce((P,k)=>k.selected?[...P,F2(k.id,!1)]:P,[]),C=T.reduce((P,k)=>k.selected?[...P,F2(k.id,!1)]:P,[]);w(I),A(C)},setNodeExtent:(T)=>{let{nodes:B,nodeLookup:w,parentLookup:A,nodeOrigin:R,elevateNodesOnSelect:I,nodeExtent:C,zIndexMode:P}=W();if(T[0][0]===C[0][0]&&T[0][1]===C[0][1]&&T[1][0]===C[1][0]&&T[1][1]===C[1][1])return;H4(B,w,A,{nodeOrigin:R,nodeExtent:T,elevateNodesOnSelect:I,checkEquality:!1,zIndexMode:P}),z({nodeExtent:T})},panBy:(T)=>{let{transform:B,width:w,height:A,panZoom:R,translateExtent:I}=W();return w7({delta:T,panZoom:R,transform:B,translateExtent:I,width:w,height:A})},setCenter:async(T,B,w)=>{let{width:A,height:R,maxZoom:I,panZoom:C}=W();if(!C)return!1;let P=typeof w?.zoom<"u"?w.zoom:I;return await C.setViewport({x:A/2-T*P,y:R/2-B*P,zoom:P},{duration:w?.duration,ease:w?.ease,interpolate:w?.interpolate}),!0},cancelConnection:()=>{z({connection:{...Z6}})},updateConnection:(T)=>{z({connection:T})},reset:()=>z({...M9()})}},Object.is);function b6({initialNodes:_,initialEdges:Q,defaultNodes:J,defaultEdges:q,initialWidth:U,initialHeight:G,initialMinZoom:Z,initialMaxZoom:F,initialFitViewOptions:X,fitView:Y,nodeOrigin:H,nodeExtent:K,zIndexMode:L,children:z}){let[W]=r.useState(()=>yG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Y,minZoom:Z,maxZoom:F,fitViewOptions:X,nodeOrigin:H,nodeExtent:K,zIndexMode:L}));return l.jsx(rq,{value:W,children:l.jsx(AU,{children:l.jsx(vU,{children:z})})})}function vG({children:_,nodes:Q,edges:J,defaultNodes:q,defaultEdges:U,width:G,height:Z,fitView:F,fitViewOptions:X,minZoom:Y,maxZoom:H,nodeOrigin:K,nodeExtent:L,zIndexMode:z}){if(r.useContext(M4))return l.jsx(l.Fragment,{children:_});return l.jsx(b6,{initialNodes:Q,initialEdges:J,defaultNodes:q,defaultEdges:U,initialWidth:G,initialHeight:Z,fitView:F,initialFitViewOptions:X,initialMinZoom:Y,initialMaxZoom:H,nodeOrigin:K,nodeExtent:L,zIndexMode:z,children:_})}var jG={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function VG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,className:U,nodeTypes:G,edgeTypes:Z,onNodeClick:F,onEdgeClick:X,onInit:Y,onMove:H,onMoveStart:K,onMoveEnd:L,onConnect:z,onConnectStart:W,onConnectEnd:O,onClickConnectStart:T,onClickConnectEnd:B,onNodeMouseEnter:w,onNodeMouseMove:A,onNodeMouseLeave:R,onNodeContextMenu:I,onNodeDoubleClick:C,onNodeDragStart:P,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:v,onEdgesDelete:E,onDelete:g,onSelectionChange:h,onSelectionDragStart:S,onSelectionDrag:b,onSelectionDragStop:j,onSelectionContextMenu:x,onSelectionStart:V,onSelectionEnd:D,onBeforeDelete:f,connectionMode:y,connectionLineType:p=W0.Bezier,connectionLineStyle:u,connectionLineComponent:s,connectionLineContainerStyle:t,deleteKeyCode:a="Backspace",selectionKeyCode:d="Shift",selectionOnDrag:c=!1,selectionMode:e=$2.Full,panActivationKeyCode:Q1="Space",multiSelectionKeyCode:G1=b2()?"Meta":"Control",zoomActivationKeyCode:$1=b2()?"Meta":"Control",snapToGrid:Z1,snapGrid:Y1,onlyRenderVisibleElements:K1=!1,selectNodesOnDrag:o,nodesDraggable:z1,autoPanOnNodeFocus:q1,nodesConnectable:y1,nodesFocusable:c1,nodeOrigin:l1=w9,edgesFocusable:k0,edgesReconnectable:F0,elementsSelectable:M0=!0,defaultViewport:a1=qU,minZoom:o1=0.5,maxZoom:n1=2,translateExtent:K0=v2,preventScrolling:B2=!0,nodeExtent:y0,defaultMarkerColor:M2="#b1b1b7",zoomOnScroll:T2=!0,zoomOnPinch:m2=!0,panOnScroll:S5=!1,panOnScrollSpeed:r0=0.5,panOnScrollMode:M=I0.Free,zoomOnDoubleClick:m=!0,panOnDrag:n=!0,onPaneClick:_1,onPaneMouseEnter:U1,onPaneMouseMove:W1,onPaneMouseLeave:L1,onPaneScroll:f1,onPaneContextMenu:A1,paneClickDistance:H0=1,nodeClickDistance:v0=0,children:y4,onReconnect:v4,onReconnectStart:t_,onReconnectEnd:o_,onEdgeContextMenu:n_,onEdgeDoubleClick:e_,onEdgeMouseEnter:_Q,onEdgeMouseMove:QQ,onEdgeMouseLeave:JQ,reconnectRadius:$Q=10,onNodesChange:qQ,onEdgesChange:UQ,noDragClassName:GQ="nodrag",noWheelClassName:ZQ="nowheel",noPanClassName:o6="nopan",fitView:n6,fitViewOptions:e6,connectOnClick:FQ,attributionPosition:KQ,proOptions:HQ,defaultEdgeOptions:XQ,elevateNodesOnSelect:YQ=!0,elevateEdgesOnSelect:LQ=!1,disableKeyboardA11y:_8=!1,autoPanOnConnect:zQ,autoPanOnNodeDrag:WQ,autoPanOnSelection:AQ=!0,autoPanSpeed:BQ,connectionRadius:MQ,isValidConnection:TQ,onError:RQ,style:OQ,id:Q8,nodeDragThreshold:fQ,connectionDragThreshold:IQ,viewport:wQ,onViewportChange:PQ,width:NQ,height:CQ,colorMode:SQ="light",debug:kQ,onScroll:J8,ariaLabelConfig:yQ,zIndexMode:$8="basic",...vQ},jQ){let j4=Q8||"1",VQ=FU(SQ),uQ=r.useCallback((q8)=>{q8.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),J8?.(q8)},[J8]);return l.jsx("div",{"data-testid":"rf__wrapper",...vQ,onScroll:uQ,style:{...OQ,...jG},ref:jQ,className:C1(["react-flow",U,VQ]),id:Q8,role:"application",children:l.jsxs(vG,{nodes:_,edges:Q,width:NQ,height:CQ,fitView:n6,fitViewOptions:e6,minZoom:o1,maxZoom:n1,nodeOrigin:l1,nodeExtent:y0,zIndexMode:$8,children:[l.jsx(ZU,{nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,onConnect:z,onConnectStart:W,onConnectEnd:O,onClickConnectStart:T,onClickConnectEnd:B,nodesDraggable:z1,autoPanOnNodeFocus:q1,nodesConnectable:y1,nodesFocusable:c1,edgesFocusable:k0,edgesReconnectable:F0,elementsSelectable:M0,elevateNodesOnSelect:YQ,elevateEdgesOnSelect:LQ,minZoom:o1,maxZoom:n1,nodeExtent:y0,onNodesChange:qQ,onEdgesChange:UQ,snapToGrid:Z1,snapGrid:Y1,connectionMode:y,translateExtent:K0,connectOnClick:FQ,defaultEdgeOptions:XQ,fitView:n6,fitViewOptions:e6,onNodesDelete:v,onEdgesDelete:E,onDelete:g,onNodeDragStart:P,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:b,onSelectionDragStart:S,onSelectionDragStop:j,onMove:H,onMoveStart:K,onMoveEnd:L,noPanClassName:o6,nodeOrigin:l1,rfId:j4,autoPanOnConnect:zQ,autoPanOnNodeDrag:WQ,autoPanSpeed:BQ,onError:RQ,connectionRadius:MQ,isValidConnection:TQ,selectNodesOnDrag:o,nodeDragThreshold:fQ,connectionDragThreshold:IQ,onBeforeDelete:f,debug:kQ,ariaLabelConfig:yQ,zIndexMode:$8}),l.jsx(SG,{onInit:Y,onNodeClick:F,onEdgeClick:X,onNodeMouseEnter:w,onNodeMouseMove:A,onNodeMouseLeave:R,onNodeContextMenu:I,onNodeDoubleClick:C,nodeTypes:G,edgeTypes:Z,connectionLineType:p,connectionLineStyle:u,connectionLineComponent:s,connectionLineContainerStyle:t,selectionKeyCode:d,selectionOnDrag:c,selectionMode:e,deleteKeyCode:a,multiSelectionKeyCode:G1,panActivationKeyCode:Q1,zoomActivationKeyCode:$1,onlyRenderVisibleElements:K1,defaultViewport:a1,translateExtent:K0,minZoom:o1,maxZoom:n1,preventScrolling:B2,zoomOnScroll:T2,zoomOnPinch:m2,zoomOnDoubleClick:m,panOnScroll:S5,panOnScrollSpeed:r0,panOnScrollMode:M,panOnDrag:n,autoPanOnSelection:AQ,onPaneClick:_1,onPaneMouseEnter:U1,onPaneMouseMove:W1,onPaneMouseLeave:L1,onPaneScroll:f1,onPaneContextMenu:A1,paneClickDistance:H0,nodeClickDistance:v0,onSelectionContextMenu:x,onSelectionStart:V,onSelectionEnd:D,onReconnect:v4,onReconnectStart:t_,onReconnectEnd:o_,onEdgeContextMenu:n_,onEdgeDoubleClick:e_,onEdgeMouseEnter:_Q,onEdgeMouseMove:QQ,onEdgeMouseLeave:JQ,reconnectRadius:$Q,defaultMarkerColor:M2,noDragClassName:GQ,noWheelClassName:ZQ,noPanClassName:o6,rfId:j4,disableKeyboardA11y:_8,nodeExtent:y0,viewport:wQ,onViewportChange:PQ,nodesDraggable:z1}),l.jsx($U,{onSelectionChange:h}),y4,l.jsx(nq,{proOptions:HQ,position:KQ}),l.jsx(oq,{rfId:j4,disableKeyboardA11y:_8})]})})}var n9=C9(VG);function e9(_){let[Q,J]=r.useState(_),q=r.useCallback((U)=>J((G)=>N9(U,G)),[]);return[Q,J,q]}var fB=i1.error014();function uG({dimensions:_,lineWidth:Q,variant:J,className:q}){return l.jsx("path",{strokeWidth:Q,d:`M${_[0]/2} 0 V${_[1]} M0 ${_[1]/2} H${_[0]}`,className:C1(["react-flow__background-pattern",J,q])})}function bG({radius:_,className:Q}){return l.jsx("circle",{cx:_,cy:_,r:_,className:C1(["react-flow__background-pattern","dots",Q])})}var A0;(function(_){_.Lines="lines",_.Dots="dots",_.Cross="cross"})(A0||(A0={}));var DG={[A0.Dots]:1,[A0.Lines]:1,[A0.Cross]:6},hG=(_)=>({transform:_.transform,patternId:`pattern-${_.rfId}`});function __({id:_,variant:Q=A0.Dots,gap:J=20,size:q,lineWidth:U=1,offset:G=0,color:Z,bgColor:F,style:X,className:Y,patternClassName:H}){let K=r.useRef(null),{transform:L,patternId:z}=M1(hG,P1),W=q||DG[Q],O=Q===A0.Dots,T=Q===A0.Cross,B=Array.isArray(J)?J:[J,J],w=[B[0]*L[2]||1,B[1]*L[2]||1],A=W*L[2],R=Array.isArray(G)?G:[G,G],I=T?[A,A]:w,C=[R[0]*L[2]+I[0]/2,R[1]*L[2]+I[1]/2],P=`${z}${_?_:""}`;return l.jsxs("svg",{className:C1(["react-flow__background",Y]),style:{...X,...T4,"--xy-background-color-props":F,"--xy-background-pattern-color-props":Z},ref:K,"data-testid":"rf__background",children:[l.jsx("pattern",{id:P,x:L[0]%w[0],y:L[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:O?l.jsx(bG,{radius:A/2,className:H}):l.jsx(uG,{dimensions:I,lineWidth:U,variant:Q,className:H})}),l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${P})`})]})}__.displayName="Background";var Q_=r.memo(__);function EG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:l.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function xG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:l.jsx("path",{d:"M0 0h32v4.2H0z"})})}function mG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:l.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function gG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function pG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function W4({children:_,className:Q,...J}){return l.jsx("button",{type:"button",className:C1(["react-flow__controls-button",Q]),...J,children:_})}var cG=(_)=>({isInteractive:_.nodesDraggable||_.nodesConnectable||_.elementsSelectable,minZoomReached:_.transform[2]<=_.minZoom,maxZoomReached:_.transform[2]>=_.maxZoom,ariaLabelConfig:_.ariaLabelConfig});function J_({style:_,showZoom:Q=!0,showFitView:J=!0,showInteractive:q=!0,fitViewOptions:U,onZoomIn:G,onZoomOut:Z,onFitView:F,onInteractiveChange:X,className:Y,children:H,position:K="bottom-left",orientation:L="vertical","aria-label":z}){let W=N1(),{isInteractive:O,minZoomReached:T,maxZoomReached:B,ariaLabelConfig:w}=M1(cG,P1),{zoomIn:A,zoomOut:R,fitView:I}=T5(),C=()=>{A(),G?.()},P=()=>{R(),Z?.()},k=()=>{I(U),F?.()},N=()=>{W.setState({nodesDraggable:!O,nodesConnectable:!O,elementsSelectable:!O}),X?.(!O)};return l.jsxs(K2,{className:C1(["react-flow__controls",L==="horizontal"?"horizontal":"vertical",Y]),position:K,style:_,"data-testid":"rf__controls","aria-label":z??w["controls.ariaLabel"],children:[Q&&l.jsxs(l.Fragment,{children:[l.jsx(W4,{onClick:C,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:B,children:l.jsx(EG,{})}),l.jsx(W4,{onClick:P,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:T,children:l.jsx(xG,{})})]}),J&&l.jsx(W4,{className:"react-flow__controls-fitview",onClick:k,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:l.jsx(mG,{})}),q&&l.jsx(W4,{className:"react-flow__controls-interactive",onClick:N,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:O?l.jsx(pG,{}):l.jsx(gG,{})}),H]})}J_.displayName="Controls";var $_=r.memo(J_);function lG({id:_,x:Q,y:J,width:q,height:U,style:G,color:Z,strokeColor:F,strokeWidth:X,className:Y,borderRadius:H,shapeRendering:K,selected:L,onClick:z}){let{background:W,backgroundColor:O}=G||{},T=Z||W||O;return l.jsx("rect",{className:C1(["react-flow__minimap-node",{selected:L},Y]),x:Q,y:J,rx:H,ry:H,width:q,height:U,style:{fill:T,stroke:F,strokeWidth:X},shapeRendering:K,onClick:z?(B)=>z(B,_):void 0})}var rG=r.memo(lG),iG=(_)=>_.nodes.map((Q)=>Q.id),v6=(_)=>_ instanceof Function?_:()=>_;function dG({nodeStrokeColor:_,nodeColor:Q,nodeClassName:J="",nodeBorderRadius:q=5,nodeStrokeWidth:U,nodeComponent:G=rG,onClick:Z}){let F=M1(iG,P1),X=v6(Q),Y=v6(_),H=v6(J),K=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return l.jsx(l.Fragment,{children:F.map((L)=>l.jsx(sG,{id:L,nodeColorFunc:X,nodeStrokeColorFunc:Y,nodeClassNameFunc:H,nodeBorderRadius:q,nodeStrokeWidth:U,NodeComponent:G,onClick:Z,shapeRendering:K},L))})}function aG({id:_,nodeColorFunc:Q,nodeStrokeColorFunc:J,nodeClassNameFunc:q,nodeBorderRadius:U,nodeStrokeWidth:G,shapeRendering:Z,NodeComponent:F,onClick:X}){let{node:Y,x:H,y:K,width:L,height:z}=M1((W)=>{let O=W.nodeLookup.get(_);if(!O)return{node:void 0,x:0,y:0,width:0,height:0};let T=O.internals.userNode,{x:B,y:w}=O.internals.positionAbsolute,{width:A,height:R}=Q0(T);return{node:T,x:B,y:w,width:A,height:R}},P1);if(!Y||Y.hidden||!W6(Y))return null;return l.jsx(F,{x:H,y:K,width:L,height:z,style:Y.style,selected:!!Y.selected,className:q(Y),color:Q(Y),borderRadius:U,strokeColor:J(Y),strokeWidth:G,shapeRendering:Z,onClick:X,id:Y.id})}var sG=r.memo(aG),tG=r.memo(dG),oG=200,nG=150,eG=(_)=>!_.hidden,_Z=(_)=>{let Q={x:-_.transform[0]/_.transform[2],y:-_.transform[1]/_.transform[2],width:_.width/_.transform[2],height:_.height/_.transform[2]},J=!1;for(let q of _.nodeLookup.values())if(!q.hidden){J=!0;break}return{viewBB:Q,boundingRect:J?Y6(Z2(_.nodeLookup,{filter:eG}),Q):Q,rfId:_.rfId,panZoom:_.panZoom,translateExtent:_.translateExtent,flowWidth:_.width,flowHeight:_.height,ariaLabelConfig:_.ariaLabelConfig}},T9=(_,Q)=>_.x===Q.x&&_.y===Q.y&&_.width===Q.width&&_.height===Q.height,QZ=(_,Q)=>T9(_.viewBB,Q.viewBB)&&T9(_.boundingRect,Q.boundingRect)&&_.rfId===Q.rfId&&_.panZoom===Q.panZoom&&_.translateExtent===Q.translateExtent&&_.flowWidth===Q.flowWidth&&_.flowHeight===Q.flowHeight&&_.ariaLabelConfig===Q.ariaLabelConfig,JZ="react-flow__minimap-desc";function q_({style:_,className:Q,nodeStrokeColor:J,nodeColor:q,nodeClassName:U="",nodeBorderRadius:G=5,nodeStrokeWidth:Z,nodeComponent:F,bgColor:X,maskColor:Y,maskStrokeColor:H,maskStrokeWidth:K,position:L="bottom-right",onClick:z,onNodeClick:W,pannable:O=!1,zoomable:T=!1,ariaLabel:B,inversePan:w,zoomStep:A=1,offsetScale:R=5}){let I=N1(),C=r.useRef(null),{boundingRect:P,panZoom:k,viewBB:N,rfId:v,translateExtent:E,flowWidth:g,flowHeight:h,ariaLabelConfig:S}=M1(_Z,QZ),b=_?.width??oG,j=_?.height??nG,x=P.width/b,V=P.height/j,D=Math.max(x,V),f=D*b,y=D*j,p=R*D,u=P.x-(f-P.width)/2-p,s=P.y-(y-P.height)/2-p,t=f+p*2,a=y+p*2,d=`${JZ}-${v}`,c=r.useRef(0),e=r.useRef();c.current=D,r.useEffect(()=>{let Y1=I.getState().panZoom;if(C.current&&Y1)return e.current=v7({domNode:C.current,panZoom:Y1,getTransform:()=>I.getState().transform,getViewScale:()=>c.current}),()=>{e.current?.destroy()}},[k]),r.useEffect(()=>{e.current?.update({translateExtent:E,width:g,height:h,inversePan:w,pannable:O,zoomStep:A,zoomable:T})},[O,T,w,A,E,g,h]);let Q1=z?(Y1)=>{let[K1,o]=e.current?.pointer(Y1)||[0,0];z(Y1,{x:K1,y:o})}:void 0,G1=r.useCallback((Y1,K1)=>{let o=I.getState().nodeLookup.get(K1).internals.userNode;W?.(Y1,o)},[W]),$1=W?G1:void 0,Z1=B??S["minimap.ariaLabel"];return l.jsx(K2,{position:L,style:{..._,"--xy-minimap-background-color-props":typeof X==="string"?X:void 0,"--xy-minimap-mask-background-color-props":typeof Y==="string"?Y:void 0,"--xy-minimap-mask-stroke-color-props":typeof H==="string"?H:void 0,"--xy-minimap-mask-stroke-width-props":typeof K==="number"?K*D:void 0,"--xy-minimap-node-background-color-props":typeof q==="string"?q:void 0,"--xy-minimap-node-stroke-color-props":typeof J==="string"?J:void 0,"--xy-minimap-node-stroke-width-props":typeof Z==="number"?Z:void 0},className:C1(["react-flow__minimap",Q]),"data-testid":"rf__minimap",children:l.jsxs("svg",{width:b,height:j,viewBox:`${u} ${s} ${t} ${a}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":d,ref:C,onClick:Q1,children:[Z1&&l.jsx("title",{id:d,children:Z1}),l.jsx(tG,{onClick:$1,nodeColor:q,nodeStrokeColor:J,nodeBorderRadius:G,nodeClassName:U,nodeStrokeWidth:Z,nodeComponent:F}),l.jsx("path",{className:"react-flow__minimap-mask",d:`M${u-p},${s-p}h${t+p*2}v${a+p*2}h${-t-p*2}z
34
- M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}q_.displayName="MiniMap";var U_=r.memo(q_),$Z=(_)=>(Q)=>_?`${Math.max(1/Q.transform[2],1)}`:void 0,qZ={[m0.Line]:"right",[m0.Handle]:"bottom-right"};function UZ({nodeId:_,position:Q,variant:J=m0.Handle,className:q,style:U=void 0,children:G,color:Z,minWidth:F=10,minHeight:X=10,maxWidth:Y=Number.MAX_VALUE,maxHeight:H=Number.MAX_VALUE,keepAspectRatio:K=!1,resizeDirection:L,autoScale:z=!0,shouldResize:W,onResizeStart:O,onResize:T,onResizeEnd:B}){let w=u6(),A=typeof _==="string"?_:w,R=N1(),I=r.useRef(null),C=J===m0.Handle,P=M1(r.useCallback($Z(C&&z),[C,z]),P1),k=r.useRef(null),N=Q??qZ[J];r.useEffect(()=>{if(!I.current||!A)return;if(!k.current)k.current=D7({domNode:I.current,nodeId:A,getStoreItems:()=>{let{nodeLookup:E,transform:g,snapGrid:h,snapToGrid:S,nodeOrigin:b,domNode:j}=R.getState();return{nodeLookup:E,transform:g,snapGrid:h,snapToGrid:S,nodeOrigin:b,paneDomNode:j}},onChange:(E,g)=>{let{triggerNodeChanges:h,nodeLookup:S,parentLookup:b,nodeOrigin:j}=R.getState(),x=[],V={x:E.x,y:E.y},D=S.get(A);if(D&&D.expandParent&&D.parentId){let f=D.origin??j,y=E.width??D.measured.width??0,p=E.height??D.measured.height??0,u={id:D.id,parentId:D.parentId,rect:{width:y,height:p,...A6({x:E.x??D.position.x,y:E.y??D.position.y},{width:y,height:p},D.parentId,S,f)}},s=X4([u],S,b,j);x.push(...s),V.x=E.x?Math.max(f[0]*y,E.x):void 0,V.y=E.y?Math.max(f[1]*p,E.y):void 0}if(V.x!==void 0&&V.y!==void 0){let f={id:A,type:"position",position:{...V}};x.push(f)}if(E.width!==void 0&&E.height!==void 0){let y={id:A,type:"dimensions",resizing:!0,setAttributes:!L?!0:L==="horizontal"?"width":"height",dimensions:{width:E.width,height:E.height}};x.push(y)}for(let f of g){let y={...f,type:"position"};x.push(y)}h(x)},onEnd:({width:E,height:g})=>{let h={id:A,type:"dimensions",resizing:!1,dimensions:{width:E,height:g}};R.getState().triggerNodeChanges([h])}});return k.current.update({controlPosition:N,boundaries:{minWidth:F,minHeight:X,maxWidth:Y,maxHeight:H},keepAspectRatio:K,resizeDirection:L,onResizeStart:O,onResize:T,onResizeEnd:B,shouldResize:W}),()=>{k.current?.destroy()}},[N,F,X,Y,H,K,O,T,B,W]);let v=N.split("-");return l.jsx("div",{className:C1(["react-flow__resize-control","nodrag",...v,J,q]),ref:I,style:{...U,scale:P,...Z&&{[C?"backgroundColor":"borderColor"]:Z}},children:G})}var IB=r.memo(UZ);var GZ=(_)=>_.domNode?.querySelector(".react-flow__renderer");function ZZ({children:_}){let Q=M1(GZ);if(!Q)return null;return R9.createPortal(_,Q)}var FZ=(_,Q)=>_?.internals.positionAbsolute.x!==Q?.internals.positionAbsolute.x||_?.internals.positionAbsolute.y!==Q?.internals.positionAbsolute.y||_?.measured.width!==Q?.measured.width||_?.measured.height!==Q?.measured.height||_?.selected!==Q?.selected||_?.internals.z!==Q?.internals.z,KZ=(_,Q)=>{if(_.size!==Q.size)return!1;for(let[J,q]of _)if(FZ(q,Q.get(J)))return!1;return!0},HZ=(_)=>({x:_.transform[0],y:_.transform[1],zoom:_.transform[2],selectedNodesCount:_.nodes.filter((Q)=>Q.selected).length});function G_({nodeId:_,children:Q,className:J,style:q,isVisible:U,position:G=J1.Top,offset:Z=10,align:F="center",...X}){let Y=u6(),H=r.useCallback((I)=>{return(Array.isArray(_)?_:[_||Y||""]).reduce((k,N)=>{let v=I.nodeLookup.get(N);if(v)k.set(v.id,v);return k},new Map)},[_,Y]),K=M1(H,KZ),{x:L,y:z,zoom:W,selectedNodesCount:O}=M1(HZ,P1);if(!(typeof U==="boolean"?U:K.size===1&&K.values().next().value?.selected&&O===1)||!K.size)return null;let B=Z2(K),w=Array.from(K.values()),A=Math.max(...w.map((I)=>I.internals.z+1)),R={position:"absolute",transform:T7(B,{x:L,y:z,zoom:W},G,Z,F),zIndex:A,...q};return l.jsx(ZZ,{children:l.jsx("div",{style:R,className:C1(["react-flow__node-toolbar",J]),...X,"data-id":w.reduce((I,C)=>`${I}${C.id} `,"").trim(),children:Q})})}var D1=h1(X0(),1);var Z_={x:{title:"X",fill:"currentColor",d:"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"},youtube:{title:"YouTube",fill:"#FF0000",d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"},tiktok:{title:"TikTok",fill:"currentColor",d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"},discord:{title:"Discord",fill:"#5865F2",d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},resend:{title:"Resend",fill:"currentColor",d:"M2.023 0v24h5.553v-8.434h2.998L15.326 24h6.65l-5.372-9.258a7.652 7.652 0 0 0 3.316-3.016c.709-1.21 1.062-2.57 1.062-4.08 0-1.462-.353-2.767-1.062-3.91-.709-1.165-1.692-2.079-2.95-2.742C15.737.331 14.355 0 12.823 0Zm5.553 4.87h4.219c.731 0 1.349.125 1.851.376.526.252.925.618 1.2 1.098.274.457.412.994.412 1.611S15.132 9.12 14.88 9.6c-.229.48-.572.856-1.03 1.13-.434.252-.948.38-1.542.38H7.576Z"},linkedin:{title:"LinkedIn",fill:"#0A66C2",d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"},reddit:{title:"Reddit",fill:"#FF4500",d:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},bluesky:{title:"Bluesky",fill:"#0285FF",d:"M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565.139 1.908 0 3.08 0 3.768c0 .69.378 5.65.624 6.479.815 2.736 3.713 3.66 6.383 3.364.136-.02.275-.039.415-.056-.138.022-.276.04-.415.056-3.912.58-7.387 2.005-2.83 7.078 5.013 5.19 6.87-1.113 7.823-4.308.953 3.195 2.05 9.271 7.733 4.308 4.267-4.308 1.172-6.498-2.74-7.078a8.741 8.741 0 0 1-.415-.056c.14.017.279.036.415.056 2.67.297 5.568-.628 6.383-3.364.246-.828.624-5.79.624-6.478 0-.69-.139-1.861-.902-2.206-.659-.298-1.664-.62-4.3 1.24C16.046 4.748 13.087 8.687 12 10.8Z"},instagram:{title:"Instagram",fill:"#FF0069",d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"},github:{title:"GitHub",fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},stripe:{title:"Stripe",fill:"#635BFF",d:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"},slack:{title:"Slack",fill:"#4A154B",d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},openai:{title:"OpenAI",fill:"#412991",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"},anthropic:{title:"Anthropic",fill:"currentColor",d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"},twilio:{title:"Twilio",fill:"#F22F46",d:"M12 0C5.381-.008.008 5.352 0 11.971V12c0 6.64 5.359 12 12 12 6.64 0 12-5.36 12-12 0-6.641-5.36-12-12-12zm0 20.801c-4.846.015-8.786-3.904-8.801-8.75V12c-.014-4.846 3.904-8.786 8.75-8.801H12c4.847-.014 8.786 3.904 8.801 8.75V12c.015 4.847-3.904 8.786-8.75 8.801H12zm5.44-11.76c0 1.359-1.12 2.479-2.481 2.479-1.366-.007-2.472-1.113-2.479-2.479 0-1.361 1.12-2.481 2.479-2.481 1.361 0 2.481 1.12 2.481 2.481zm0 5.919c0 1.36-1.12 2.48-2.481 2.48-1.367-.008-2.473-1.114-2.479-2.48 0-1.359 1.12-2.479 2.479-2.479 1.361-.001 2.481 1.12 2.481 2.479zm-5.919 0c0 1.36-1.12 2.48-2.479 2.48-1.368-.007-2.475-1.113-2.481-2.48 0-1.359 1.12-2.479 2.481-2.479 1.358-.001 2.479 1.12 2.479 2.479zm0-5.919c0 1.359-1.12 2.479-2.479 2.479-1.367-.007-2.475-1.112-2.481-2.479 0-1.361 1.12-2.481 2.481-2.481 1.358 0 2.479 1.12 2.479 2.481z"},sendgrid:{title:"SendGrid",fill:"#51A9E3",d:"M.8 24h13.6c.88 0 1.6-.72 1.6-1.6v-4.8c0-.88-.72-1.6-1.6-1.6H9.6c-.88 0-1.6-.72-1.6-1.6V9.6C8 8.72 7.28 8 6.4 8H1.6C.72 8 0 8.72 0 9.6v13.6c0 .44.36.8.8.8zM23.2 0H9.6C8.72 0 8 .72 8 1.6v4.8C8 7.28 8.72 8 9.6 8h4.8c.88 0 1.6.72 1.6 1.6v4.8c0 .88.72 1.6 1.6 1.6h4.8c.88 0 1.6-.72 1.6-1.6V.8c0-.44-.36-.8-.8-.8Z"},mailgun:{title:"Mailgun",fill:"#F06B66",d:"M11.837 0c6.602 0 11.984 5.381 11.984 11.994-.017 2.99-3.264 4.84-5.844 3.331a3.805 3.805 0 0 1-.06-.035l-.055-.033-.022.055c-2.554 4.63-9.162 4.758-11.894.232-2.732-4.527.46-10.313 5.746-10.416a6.868 6.868 0 0 1 7.002 6.866 1.265 1.265 0 0 0 2.52 0c0-5.18-4.197-9.38-9.377-9.387C4.611 2.594.081 10.41 3.683 16.673c3.238 5.632 11.08 6.351 15.289 1.402l1.997 1.686A11.95 11.95 0 0 1 11.837 24C2.6 23.72-2.87 13.543 1.992 5.684A12.006 12.006 0 0 1 11.837 0Zm0 7.745c-3.276-.163-5.5 3.281-4.003 6.2a4.26 4.26 0 0 0 4.014 2.31c3.276-.171 5.137-3.824 3.35-6.575a4.26 4.26 0 0 0-3.36-1.935Zm0 2.53c1.324 0 2.152 1.433 1.49 2.58a1.72 1.72 0 0 1-1.49.86 1.72 1.72 0 1 1 0-3.44Z"},notion:{title:"Notion",fill:"currentColor",d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},linear:{title:"Linear",fill:"#5E6AD2",d:"M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"},jira:{title:"Jira",fill:"#0052CC",d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"},hubspot:{title:"HubSpot",fill:"#FF7A59",d:"M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z"},paypal:{title:"PayPal",fill:"#003087",d:"M7.016 19.198h-4.2a.562.562 0 0 1-.555-.65L5.093.584A.692.692 0 0 1 5.776 0h7.222c3.417 0 5.904 2.488 5.846 5.5-.006.25-.027.5-.066.747A6.794 6.794 0 0 1 12.071 12H8.743a.69.69 0 0 0-.682.583l-.325 2.056-.013.083-.692 4.39-.015.087zM19.79 6.142c-.01.087-.01.175-.023.261a7.76 7.76 0 0 1-7.695 6.598H9.007l-.283 1.795-.013.083-.692 4.39-.134.843-.014.088H6.86l-.497 3.15a.562.562 0 0 0 .555.65h3.612c.34 0 .63-.249.683-.585l.952-6.031a.692.692 0 0 1 .683-.584h2.126a6.793 6.793 0 0 0 6.707-5.752c.306-1.95-.466-3.744-1.89-4.906z"},shopify:{title:"Shopify",fill:"#7AB55C",d:"M15.337 23.979l7.216-1.561s-2.604-17.613-2.625-17.73c-.018-.116-.114-.192-.211-.192s-1.929-.136-1.929-.136-1.275-1.274-1.439-1.411c-.045-.037-.075-.057-.121-.074l-.914 21.104h.023zM11.71 11.305s-.81-.424-1.774-.424c-1.447 0-1.504.906-1.504 1.141 0 1.232 3.24 1.715 3.24 4.629 0 2.295-1.44 3.76-3.406 3.76-2.354 0-3.54-1.465-3.54-1.465l.646-2.086s1.245 1.066 2.28 1.066c.675 0 .975-.545.975-.932 0-1.619-2.654-1.694-2.654-4.359-.034-2.237 1.571-4.416 4.827-4.416 1.257 0 1.875.361 1.875.361l-.945 2.715-.02.01zM11.17.83c.136 0 .271.038.405.135-.984.465-2.064 1.639-2.508 3.992-.656.213-1.293.405-1.889.578C7.697 3.75 8.951.84 11.17.84V.83zm1.235 2.949v.135c-.754.232-1.583.484-2.394.736.466-1.777 1.333-2.645 2.085-2.971.193.501.309 1.176.309 2.1zm.539-2.234c.694.074 1.141.867 1.429 1.755-.349.114-.735.231-1.158.366v-.252c0-.752-.096-1.371-.271-1.871v.002zm2.992 1.289c-.02 0-.06.021-.078.021s-.289.075-.714.21c-.423-1.233-1.176-2.37-2.508-2.37h-.115C12.135.209 11.669 0 11.265 0 8.159 0 6.675 3.877 6.21 5.846c-1.194.365-2.063.636-2.16.674-.675.213-.694.232-.772.87-.075.462-1.83 14.063-1.83 14.063L15.009 24l.927-21.166z"},sentry:{title:"Sentry",fill:"#362D59",d:"M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z"},vercel:{title:"Vercel",fill:"currentColor",d:"M24 22.525H0l12-21.05 12 21.05z"},supabase:{title:"Supabase",fill:"#3FCF8E",d:"M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z"},clerk:{title:"Clerk",fill:"#6C47FF",d:"m21.47 20.829-2.881-2.881a.572.572 0 0 0-.7-.084 6.854 6.854 0 0 1-7.081 0 .576.576 0 0 0-.7.084l-2.881 2.881a.576.576 0 0 0-.103.69.57.57 0 0 0 .166.186 12 12 0 0 0 14.113 0 .58.58 0 0 0 .239-.423.576.576 0 0 0-.172-.453Zm.002-17.668-2.88 2.88a.569.569 0 0 1-.701.084A6.857 6.857 0 0 0 8.724 8.08a6.862 6.862 0 0 0-1.222 3.692 6.86 6.86 0 0 0 .978 3.764.573.573 0 0 1-.083.699l-2.881 2.88a.567.567 0 0 1-.864-.063A11.993 11.993 0 0 1 6.771 2.7a11.99 11.99 0 0 1 14.637-.405.566.566 0 0 1 .232.418.57.57 0 0 1-.168.448Zm-7.118 12.261a3.427 3.427 0 1 0 0-6.854 3.427 3.427 0 0 0 0 6.854Z"},aws:{title:"Amazon Web Services",fill:"#232F3E",d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zM22.792 14.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z"},figma:{title:"Figma",fill:"#F24E1E",d:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},airtable:{title:"Airtable",fill:"#18BFFF",d:"M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z"},intercom:{title:"Intercom",fill:"#6AFDEF",d:"M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z"},posthog:{title:"PostHog",fill:"currentColor",d:"M9.854 14.5 5 9.647.854 5.5A.5.5 0 0 0 0 5.854V8.44a.5.5 0 0 0 .146.353L5 13.647l.147.146L9.854 18.5l.146.147v-.049c.065.03.134.049.207.049h2.586a.5.5 0 0 0 .353-.854L9.854 14.5zm0-5-4-4a.487.487 0 0 0-.409-.144.515.515 0 0 0-.356.21.493.493 0 0 0-.089.288V8.44a.5.5 0 0 0 .147.353l9 9a.5.5 0 0 0 .853-.354v-2.585a.5.5 0 0 0-.146-.354l-5-5zm1-4a.5.5 0 0 0-.854.354V8.44a.5.5 0 0 0 .147.353l4 4a.5.5 0 0 0 .853-.354V9.854a.5.5 0 0 0-.146-.354l-4-4zm12.647 11.515a3.863 3.863 0 0 1-2.232-1.1l-4.708-4.707a.5.5 0 0 0-.854.354v6.585a.5.5 0 0 0 .5.5H23.5a.5.5 0 0 0 .5-.5v-.6c0-.276-.225-.497-.499-.532zm-5.394.032a.8.8 0 1 1 0-1.6.8.8 0 0 1 0 1.6zM.854 15.5a.5.5 0 0 0-.854.354v2.293a.5.5 0 0 0 .5.5h2.293c.222 0 .39-.135.462-.309a.493.493 0 0 0-.109-.545L.854 15.501zM5 14.647.854 10.5a.5.5 0 0 0-.854.353v2.586a.5.5 0 0 0 .146.353L4.854 18.5l.146.147h2.793a.5.5 0 0 0 .353-.854L5 14.647z"},datadog:{title:"Datadog",fill:"#632CA6",d:"M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"},algolia:{title:"Algolia",fill:"#003DFF",d:"M12 0C5.445 0 .103 5.285.01 11.817c-.097 6.634 5.285 12.131 11.92 12.17a11.91 11.91 0 0 0 5.775-1.443.281.281 0 0 0 .052-.457l-1.122-.994a.79.79 0 0 0-.833-.14 9.693 9.693 0 0 1-3.923.77c-5.36-.067-9.692-4.527-9.607-9.888.084-5.293 4.417-9.573 9.73-9.573h9.73v17.296l-5.522-4.907a.407.407 0 0 0-.596.063 4.52 4.52 0 0 1-3.934 1.793 4.538 4.538 0 0 1-4.192-4.168 4.53 4.53 0 0 1 4.512-4.872 4.532 4.532 0 0 1 4.509 4.126c.018.205.11.397.265.533l1.438 1.275a.28.28 0 0 0 .462-.158 6.82 6.82 0 0 0 .099-1.725c-.232-3.376-2.966-6.092-6.345-6.3-3.873-.24-7.11 2.79-7.214 6.588-.1 3.7 2.933 6.892 6.634 6.974a6.75 6.75 0 0 0 4.136-1.294l7.212 6.394a.48.48 0 0 0 .797-.36V.456A.456.456 0 0 0 23.54 0Z"},cloudflare:{title:"Cloudflare",fill:"#F38020",d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"},upstash:{title:"Upstash",fill:"#00E9A3",d:"M13.8027 0C11.193 0 8.583.9952 6.5918 2.9863c-3.9823 3.9823-3.9823 10.4396 0 14.4219 1.9911 1.9911 5.2198 1.9911 7.211 0 1.991-1.9911 1.991-5.2198 0-7.211L12 12c.9956.9956.9956 2.6098 0 3.6055-.9956.9955-2.6099.9955-3.6055 0-2.9866-2.9868-2.9866-7.8297 0-10.8164 2.9868-2.9868 7.8297-2.9868 10.8164 0l1.8028-1.8028C19.0225.9952 16.4125 0 13.8027 0zM12 12c-.9956-.9956-.9956-2.6098 0-3.6055.9956-.9955 2.6098-.9955 3.6055 0 2.9867 2.9868 2.9867 7.8297 0 10.8164-2.9867 2.9868-7.8297 2.9868-10.8164 0l-1.8028 1.8028c3.9823 3.9822 10.4396 3.9822 14.4219 0 3.9823-3.9824 3.9823-10.4396 0-14.4219-.9956-.9956-2.3006-1.4922-3.6055-1.4922-1.3048 0-2.6099.4966-3.6054 1.4922-1.9912 1.9912-1.9912 5.2198 0 7.211z"},mixpanel:{title:"Mixpanel",fill:"#7856FF",d:"M6.967 9.996h3.053c-.763-.477-1.048-1.145-1.431-2.384L7.443 3.366C6.919 1.458 6.49.551 4.39.551H.004v1.145h.621c1.286 0 1.431.477 1.814 1.908L3.44 7.326c.524 1.814 1.337 2.67 3.53 2.67h-.003Zm7.06 0h3.053c2.194 0 2.956-.86 3.484-2.67l1.001-3.722c.382-1.431.57-1.908 1.814-1.908H24V.551h-4.34c-2.146 0-2.576.86-3.053 2.815l-1.145 4.246c-.384 1.286-.673 1.907-1.435 2.384Zm-4.007 4.008h4.007V9.996H10.02v4.008ZM0 23.449h4.39c2.1 0 2.529-.907 3.053-2.815l1.146-4.246c.383-1.239.668-1.907 1.431-2.384H6.967c-2.194 0-3.007.86-3.531 2.67l-1.001 3.722c-.383 1.431-.524 1.907-1.814 1.907H0v1.146Zm19.65 0h4.343v-1.146h-.622c-1.239 0-1.431-.476-1.814-1.907l-1.001-3.722c-.524-1.814-1.286-2.67-3.483-2.67h-3.046c.762.477 1.041 1.098 1.424 2.384l1.145 4.246c.477 1.955.907 2.815 3.054 2.815Z"},gemini:{title:"Google Gemini",fill:"#8E75B2",d:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"}};var F1=h1(R5(),1),YZ="https://brand.volter.ai/logo/twin-world/svg?size=64&variant=mono";function O5({href:_,onClick:Q}){return F1.jsxDEV("h1",{children:F1.jsxDEV("a",{href:_,onClick:Q,children:[F1.jsxDEV("img",{src:YZ,alt:"",width:24,height:24,style:{verticalAlign:"middle"}},void 0,!1,void 0,this),F1.jsxDEV("span",{className:"brand-name",children:" Volter World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}async function P0(_){return(await _.json().catch(()=>({}))).error??`answered ${_.status}`}function K_(_,Q,J=0,q=""){let[U,G]=D1.useState({state:"loading"});return D1.useEffect(()=>{G({state:"loading"})},[q,Q]),D1.useEffect(()=>{if(!Q)return;let Z=!0;return(async()=>{try{let F=await _(Q),X=F.ok?{state:"ok",data:await F.json()}:{state:"error",status:F.status,error:await P0(F)};if(Z)G(X)}catch(F){if(Z)G({state:"error",status:0,error:String(F)})}})(),()=>{Z=!1}},[q,Q,J]),U}function g1({load:_,what:Q,retry:J,lines:q=3}){if(_.state==="loading")return F1.jsxDEV(LZ,{lines:q,label:`Loading ${Q}…`},void 0,!1,void 0,this);if(_.state==="error")return F1.jsxDEV("div",{role:"alert",className:"error-state",children:[F1.jsxDEV("span",{children:["Could not read ",Q,": ",_.error]},void 0,!0,void 0,this),J?F1.jsxDEV("button",{type:"button",onClick:J,children:"Try again"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);return null}function LZ({lines:_=3,label:Q="Loading…"}){return F1.jsxDEV("div",{className:"skeleton",role:"status","aria-label":Q,children:Array.from({length:_},(J,q)=>F1.jsxDEV("span",{style:{width:`${[92,76,84,64,88][q%5]}%`}},q,!1,void 0,this))},void 0,!1,void 0,this)}function O1({iso:_,time:Q}){if(!_)return F1.jsxDEV("span",{children:"—"},void 0,!1,void 0,this);let J=new Date(_);return F1.jsxDEV("time",{dateTime:_,title:_,children:Number.isNaN(J.getTime())?_:Q?J.toLocaleTimeString():J.toLocaleString()},void 0,!1,void 0,this)}var E6=(_)=>_?new Date(_).toLocaleString():"—";function x6(_){let Q=_?Date.parse(_):Number.NaN;if(Number.isNaN(Q))return"—";let J=Math.max(0,Math.round((Date.now()-Q)/1000));return J<60?"just now":J<3600?`${Math.round(J/60)}m ago`:J<86400?`${Math.round(J/3600)}h ago`:`${Math.round(J/86400)}d ago`}function k1(_,Q){let J=Q.replace(/[_-]+/g," "),q=J.endsWith("s")?J:/[^aeiou]y$/.test(J)?`${J.slice(0,-1)}ies`:/(ch|sh|x)$/.test(J)?`${J}es`:`${J}s`;return`${_} ${_===1?J:q}`}var X2=(_)=>_.length<=1?_.join(""):`${_.slice(0,-1).join(", ")} and ${_[_.length-1]}`,zZ={github:"GitHub",openai:"OpenAI",aws:"AWS",hubspot:"HubSpot",paypal:"PayPal",youtube:"YouTube",tiktok:"TikTok",linkedin:"LinkedIn",xai:"xAI",sendgrid:"SendGrid",elevenlabs:"ElevenLabs",assemblyai:"AssemblyAI",planetscale:"PlanetScale",googleoauth:"Google sign-in",npm:"npm","npm-registry":"npm registry",posthog:"PostHog",mongodb:"MongoDB",pagerduty:"PagerDuty",mailgun:"Mailgun",turbopuffer:"turbopuffer"},H1=(_)=>zZ[_]??_.charAt(0).toUpperCase()+_.slice(1);function b1({vendor:_}){let Q=Z_[_];return F1.jsxDEV("span",{className:Q?"mark logo":"mark","aria-hidden":"true",children:Q?F1.jsxDEV("svg",{viewBox:"0 0 24 24",children:F1.jsxDEV("path",{d:Q.d,fill:Q.fill},void 0,!1,void 0,this)},void 0,!1,void 0,this):H1(_).charAt(0)},void 0,!1,void 0,this)}var F_=(_)=>{_.currentTarget.closest("details")?.removeAttribute("open")},WZ="volter.theme",m6=()=>{try{let _=localStorage.getItem(WZ);return _==="light"||_==="dark"?_:"system"}catch{return"system"}};function H_(_=m6()){let Q=document.documentElement;if(_==="system")Q.removeAttribute("data-theme");else Q.setAttribute("data-theme",_)}function X_(){return D1.useEffect(()=>{let _=()=>[...document.querySelectorAll("details.menu[open], details.clock-more[open]")],Q=(q)=>{if(q.key!=="Escape"||document.querySelector("dialog[open]"))return;let U=_();if(!U.length)return;for(let G of U)G.removeAttribute("open");U[U.length-1].querySelector("summary")?.focus()},J=(q)=>{let U=q.target;for(let G of _())if(!U||!G.contains(U))G.removeAttribute("open")};return document.addEventListener("keydown",Q),document.addEventListener("click",J),()=>{document.removeEventListener("keydown",Q),document.removeEventListener("click",J)}},[]),null}function t1({open:_,onClose:Q,title:J,children:q,footer:U,wide:G}){let Z=D1.useRef(null),F=D1.useId();return D1.useEffect(()=>{let X=Z.current;if(!X)return;if(_&&!X.open){X.showModal();let Y=X.querySelector(".dialog-body :is(input:not([type=hidden]):not([disabled]), select, textarea)");if(Y?.focus(),Y instanceof HTMLInputElement&&Y.value&&/^(text|search|email|url)$/.test(Y.type))Y.select()}if(!_&&X.open)X.close()},[_]),F1.jsxDEV("dialog",{ref:Z,className:G==="window"?"dialog window":G?"dialog wide":"dialog","aria-labelledby":F,onClose:Q,onCancel:(X)=>{X.preventDefault(),Q()},onMouseDown:(X)=>{if(X.target===Z.current)Q()},children:_?F1.jsxDEV(F1.Fragment,{children:[F1.jsxDEV("div",{className:"dialog-head",children:[F1.jsxDEV("h2",{id:F,children:J},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Close",onClick:Q,children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F1.jsxDEV("div",{className:"dialog-body",children:q},void 0,!1,void 0,this),U?F1.jsxDEV("div",{className:"dialog-foot",children:U},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null},void 0,!1,void 0,this)}var D6="volter:confirm";function B0(_){return new Promise((Q)=>{window.dispatchEvent(new CustomEvent(D6,{detail:{ask:_,resolve:Q}}))})}function Y_(){let[_,Q]=D1.useState(null),[J,q]=D1.useState("");D1.useEffect(()=>{let F=(X)=>{q(""),Q(X.detail)};return window.addEventListener(D6,F),()=>window.removeEventListener(D6,F)},[]);let U=(F)=>{_?.resolve(F),Q(null)},G=_?.ask,Z=!G?.typed||J===G.typed;return F1.jsxDEV(t1,{open:Boolean(_),onClose:()=>U(!1),title:G?.title??"",footer:F1.jsxDEV(F1.Fragment,{children:[F1.jsxDEV("button",{type:"button",onClick:()=>U(!1),children:"Cancel"},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",className:G?.danger?"danger-button":"primary",disabled:!Z,onClick:()=>U(!0),children:G?.action},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[G?.body?F1.jsxDEV("div",{className:"confirm-body",children:G.body},void 0,!1,void 0,this):null,G?.typed?F1.jsxDEV("div",{className:"typed-confirm",children:[F1.jsxDEV("p",{children:["Type ",F1.jsxDEV("code",{children:G.typed},void 0,!1,void 0,this)," to confirm."]},void 0,!0,void 0,this),F1.jsxDEV("input",{autoFocus:!0,"aria-label":`Type ${G.typed} to confirm`,value:J,onChange:(F)=>q(F.target.value),onKeyDown:(F)=>{if(F.key==="Enter"&&Z)U(!0)},autoComplete:"off",spellCheck:!1},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}var h6="volter:toast";function u1(_,Q="ok"){window.dispatchEvent(new CustomEvent(h6,{detail:{text:_,kind:Q}}))}function L_(){let[_,Q]=D1.useState([]);return D1.useEffect(()=>{let J=0,q=(U)=>{let{text:G,kind:Z}=U.detail,F=++J;if(Q((X)=>[...X.slice(-3),{id:F,text:G,kind:Z}]),Z!=="error")setTimeout(()=>Q((X)=>X.filter((Y)=>Y.id!==F)),4500)};return window.addEventListener(h6,q),()=>window.removeEventListener(h6,q)},[]),F1.jsxDEV("div",{className:"toasts",role:"region","aria-label":"Notifications",children:_.map((J)=>F1.jsxDEV("div",{className:`toast ${J.kind}`,role:J.kind==="error"?"alert":"status",children:[F1.jsxDEV("span",{children:J.text},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Dismiss",onClick:()=>Q((q)=>q.filter((U)=>U.id!==J.id)),children:"✕"},void 0,!1,void 0,this)]},J.id,!0,void 0,this))},void 0,!1,void 0,this)}function g6({value:_,label:Q,secret:J}){let[q,U]=D1.useState(!1);return F1.jsxDEV("div",{className:"copy-field",children:[Q?F1.jsxDEV("span",{className:"copy-label",children:Q},void 0,!1,void 0,this):null,F1.jsxDEV("div",{className:"copy-row",children:[F1.jsxDEV("input",{readOnly:!0,value:_,"aria-label":Q??"Value",onFocus:(Z)=>Z.currentTarget.select(),spellCheck:!1},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>{U(!0),setTimeout(()=>U(!1),1600),u1(J?"Copied. Keep it somewhere safe":"Copied")}).catch(()=>u1("Your browser would not copy it: select it and copy","error"))},children:q?"Copied":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function z_({label:_,items:Q}){return F1.jsxDEV("details",{className:"menu row-menu",children:[F1.jsxDEV("summary",{className:"icon-button",role:"button","aria-haspopup":"menu","aria-label":_,title:_,children:"⋯"},void 0,!1,void 0,this),F1.jsxDEV("div",{className:"popover menu-list",role:"menu",children:Q.filter((J)=>Boolean(J)).map((J)=>J.href?F1.jsxDEV("a",{role:"menuitem",href:J.href,className:J.danger?"danger-item":void 0,onClick:F_,children:J.label},J.label,!1,void 0,this):F1.jsxDEV("button",{type:"button",role:"menuitem",disabled:J.disabled,className:J.danger?"danger-item":void 0,onClick:(q)=>{F_(q),J.onSelect?.()},children:J.label},J.label,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function f5({title:_,children:Q,action:J}){return F1.jsxDEV("div",{className:"empty-state",children:[F1.jsxDEV("p",{className:"empty-title",children:_},void 0,!1,void 0,this),Q?F1.jsxDEV("div",{className:"empty-body",children:Q},void 0,!1,void 0,this):null,J?F1.jsxDEV("div",{className:"empty-action",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function W_(){return D1.useEffect(()=>{let _=(J)=>{let q=document.querySelector("main.app"),U=J.target;if(q?.hasAttribute("data-drawer")&&U&&!U.closest(".side")&&!U.closest(".drawer-button"))q.removeAttribute("data-drawer")},Q=(J)=>{if(J.key==="Escape")AZ()};return document.addEventListener("click",_),document.addEventListener("keydown",Q),()=>{document.removeEventListener("click",_),document.removeEventListener("keydown",Q)}},[]),F1.jsxDEV("button",{type:"button",className:"icon-button drawer-button","aria-label":"Menu",onClick:()=>{document.querySelector("main.app")?.toggleAttribute("data-drawer")},children:"☰"},void 0,!1,void 0,this)}var AZ=()=>{document.querySelector("main.app")?.removeAttribute("data-drawer")};function O4(_={}){let Q=(q,U)=>_.tools?`${U} (\`${q}\`)`:`\`${q}\``,J=["Set up Volter World for this app, so its calls to Stripe, Slack, GitHub, OpenAI and the other services it uses go to local twins instead of the real APIs. The app keeps its real SDKs and code.","",_.tools?"1. You have the Volter World tools (volter mcp). If the `volter` command is missing, install it: `npm install -g @volter/world`.":"1. Install the command and your agent tooling: `npm install -g @volter/world`, then `volter agents install --yes`.",`2. In the app's folder, ${Q("volter world init --install","world_init")}: it detects the vendors the app calls and installs their twins. Show me the vendors it detected and why, before keeping them.`,`3. ${_.tools?"Start it with world_up":"Start it: `volter world up`"}, then run the tests inside it: ${Q("volter world run -- <the test command>","world_run")}. Fix anything that fails because a call went to the real service.`,`4. Tell me what the app did at each vendor (${Q("volter world log","world_log")}), and give me the dashboard link (${_.tools?"world_view":"`volter world view --no-open`, started in the background: it keeps running"}).`];if(_.platform){let q=_.world??"<org>/<world>";J.push(`5. Share it with my team on ${_.platform}: ${Q(`volter login ${_.platform}`,"platform_login")} gives a link and a code for me to approve in my browser. Once I have, link it with ${Q(`volter remote add origin ${q} --create`,"remote_link with create: true")}${_.world?"":" (ask me for <org>/<world>)"}, then send what the app did: ${Q('volter world changeset -m "<what and why>"',"world_changeset")} and ${Q("volter world push","world_push")}.`)}return J.push("","The guide: https://world.volter.ai/docs/guides/use-with-a-coding-agent.md"),J.join(`
35
- `)}var A_={"git-commit-horizontal":[["rect",{x:"9",y:"9",width:"6",height:"6"}],["path",{d:"M3 12h6M15 12h6"}]],"arrow-down-to-line":[["path",{d:"M12 17V3"}],["path",{d:"m6 11 6 6 6-6"}],["path",{d:"M19 21H5"}]],"arrow-up-from-line":[["path",{d:"m18 9-6-6-6 6"}],["path",{d:"M12 3v14"}],["path",{d:"M5 21h14"}]],"git-branch":[["rect",{x:"4",y:"3",width:"4",height:"4"}],["rect",{x:"4",y:"17",width:"4",height:"4"}],["rect",{x:"16",y:"5",width:"4",height:"4"}],["path",{d:"M6 7v10M18 9v2a4 4 0 0 1-4 4H6"}]],monitor:[["rect",{x:"3",y:"4",width:"18",height:"13"}],["path",{d:"M8 21h8M12 17v4"}]],vault:[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"6.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 7.9 2.7 2.7"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 10.6 2.7-2.7"}],["rect",{x:"6.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 16.1 2.7-2.7"}],["rect",{x:"15.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 13.4 2.7 2.7"}],["circle",{cx:"12",cy:"12",r:"2"}]],settings:[["circle",{cx:"12",cy:"12",r:"3"}],["circle",{cx:"12",cy:"12",r:"7"}],["path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9L7 7M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1"}]],history:[["path",{d:"M3 12a9 9 0 1 0 3-6.7"}],["path",{d:"M3 4v5h5"}],["path",{d:"M12 7v5l3 3"}]],activity:[["path",{d:"M2 12h4l3-8 6 16 3-8h4"}]],"file-diff":[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M9 10h6"}],["path",{d:"M12 13V7"}],["path",{d:"M9 17h6"}]],"square-plus":[["rect",{x:"4",y:"4",width:"16",height:"16"}],["path",{d:"M12 8v8M8 12h8"}]],"square-minus":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["path",{d:"M8 12h8"}]],"square-dot":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"10.8",y:"10.8",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],cloud:[["path",{d:"M7 19a5 5 0 0 1-.5-10A6 6 0 0 1 18 8a4.5 4.5 0 0 1 .5 11z"}]],"refresh-cw":[["path",{d:"M20 12a8 8 0 0 1-14.3 4.9M4 12a8 8 0 0 1 14.3-4.9"}],["path",{d:"M19 3v5h-5M5 21v-5h5"}]],clock:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M12 7v5l3 3"}]],"key-round":[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],plug:[["path",{d:"M9 3v5M15 3v5M6 8h12v4a6 6 0 0 1-12 0zM12 18v3"}]],"list-checks":[["path",{d:"M11 6h9M11 12h9M11 18h9"}],["path",{d:"M3 6l1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17"}]],palette:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"}],["rect",{x:"12.3",y:"5.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"16.3",y:"9.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"5.3",y:"11.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"7.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],check:[["path",{d:"M4 12l5 5L20 6"}]],plus:[["path",{d:"M12 4v16M4 12h16"}]],"chevron-down":[["path",{d:"M5 9l7 7 7-7"}]],"external-link":[["path",{d:"M14 4h6v6M20 4l-9 9"}],["path",{d:"M18 14v6H4V6h6"}]],"table-2":[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18"}]],"scroll-text":[["path",{d:"M15 12h-5"}],["path",{d:"M15 8h-5"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3"}]],"layout-grid":[["rect",{x:"4",y:"4",width:"7",height:"7"}],["rect",{x:"13",y:"4",width:"7",height:"7"}],["rect",{x:"4",y:"13",width:"7",height:"7"}],["rect",{x:"13",y:"13",width:"7",height:"7"}]],globe:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"}]],"arrow-left":[["path",{d:"M20 12H5M11 6l-6 6 6 6"}]],link:[["path",{d:"M9 15l6-6"}],["path",{d:"M11 6l2-2a4.2 4.2 0 0 1 6 6l-2 2M13 18l-2 2a4.2 4.2 0 0 1-6-6l2-2"}]],user:[["circle",{cx:"12",cy:"8",r:"4"}],["path",{d:"M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1"}]],"log-out":[["path",{d:"M10 4H4v16h6M9 12h11M16 8l4 4-4 4"}]]};var $=h1(R5(),1),f4="volter.console.token",P5=document.getElementById("root"),X1=P5.dataset.base??"/-/console",T1=window.location.origin,W2=(P5.dataset.worlds??T1).replace(/\/+$/,""),P_=(P5.dataset.names??"").split(",").filter((_)=>_!==""),g0=P5.dataset.worldOrigin==="1",z2=window.fetch.bind(window),p0="(session)",N_="(pass)",I5=(_)=>{try{if(_&&!g0)sessionStorage.setItem(f4,_);else sessionStorage.removeItem(f4);localStorage.removeItem(f4)}catch{}},C_="volter.console.portal",S_=(_)=>{try{if(typeof _==="string"&&/^https?:$/.test(new URL(_).protocol))sessionStorage.setItem(C_,new URL(_).origin)}catch{}},BZ=()=>{return A2.get("token")??""},p1=()=>{try{let _=sessionStorage.getItem(C_)??"";return _&&/^https?:$/.test(new URL(_).protocol)?new URL(_).origin:""}catch{return""}},MZ=()=>{let _=BZ();if(g0){if(I5(""),A2.get("pass"))return N_;let Q=new URLSearchParams(window.location.search).has("signin");if(Q)try{window.history.replaceState(null,"",window.location.pathname+window.location.hash)}catch{}return _||(Q?"":p0)}if(_)return I5(_),_;try{return sessionStorage.getItem(f4)??""}catch{return""}};function v1(_){let Q=_.trim();if(/not ready/i.test(Q)&&/(never verified|not verified|no approvals)/i.test(Q)){let G=[],Z=[];if(/(never verified|not verified)/i.test(Q))G.push("it is not verified yet"),Z.push("verify");if(/no approvals/i.test(Q))G.push("no one has approved it"),Z.push("approve");return{text:`Not ready to deploy: ${X2(G)}.`,acts:Z}}let J=/no credential (?:is )?sealed for ([a-z0-9_-]+)/i.exec(Q);if(J)return{text:`No credential is sealed for ${H1(J[1])}: seal one in Settings › Vault.`,acts:["vault"]};if(/has no origin/i.test(Q))return{text:"This World has no remote: name one in Settings › Remote.",acts:["remote"]};let q=/the ([a-z0-9_-]+) twin has no root/i.exec(Q)??/:\s*([a-z0-9_, -]+?) (?:has|have) no root/i.exec(Q);if(q){let G=q[1].split(/,\s*/).filter(Boolean).map(H1);return{text:`${X2(G)} ${G.length===1?"is":"are"} not connected to ${G.length===1?"its":"their"} real service: Settings › Real services.`,acts:["settings"]}}if(/opening a seal is/i.test(Q))return{text:"A key cannot seal a credential: open the World as yourself.",acts:[]};if(/a key manages no keys/i.test(Q))return{text:"A key cannot manage keys: open the World as yourself.",acts:[]};if(/^PUT origin:/i.test(Q))return{text:"That is not a World's address: https://<host>/<org>/<world>",acts:[]};if(/^clock: \{/i.test(Q))return{text:"Pick a date and time.",acts:[]};if(/^advance: \{/i.test(Q))return{text:"Advance by a number and a unit: 90m, 12h, 3d.",acts:[]};if(/^branches: \{/i.test(Q))return{text:"That branch could not be made: pick now, or an instant before it.",acts:[]};if(/^approve: \{/i.test(Q))return{text:"Name who approves.",acts:[]};if(/a browser deploys only what it names/i.test(Q))return{text:"A deploy is confirmed by its name: use Deploy again.",acts:[]};if(/^no such door/i.test(Q))return{text:"This World does not answer that here.",acts:[]};return{text:Q.replace(/\s*[—–-]+\s*(?:run\s+)?`[^`]*`/g,"").replace(/\s*[—–-]+\s*(?:PUT|POST|GET|DELETE)\s+\/-\/\S+(?:\s*\{[^}]*\})?/g,"").replace(/\s*\(\s*`[^`]*`\s*\)/g,"").replace(/`(?:volter|printf|curl|npm|bun)[^`]*`/g,"").replace(/:\s*\{[^}]*\}/g,"").replace(/\(\s*\)/g,"").replace(/\s*;\s*(?=[;.]|$)/g,"").replace(/\s+([,.;:])/g,"$1").trim()||_,acts:[]}}var J0=async(_)=>v1(await P0(_)).text,TZ={vault:["vault","Open Vault"],remote:["remote","Open Remote"],settings:["settings/services","Open Real services"]};function k_({name:_,acts:Q}){let J=Q.map((q)=>TZ[q]).filter((q)=>Boolean(q));if(J.length===0)return null;return $.jsxDEV($.Fragment,{children:J.map(([q,U])=>$.jsxDEV(i.default.Fragment,{children:[" ",$.jsxDEV("a",{href:`${X1}/${_}/~/${q}`,onClick:(G)=>{G.preventDefault(),R1([..._.split("/"),"~",...q.split("/")])},children:U},void 0,!1,void 0,this)]},q,!0,void 0,this))},void 0,!1,void 0,this)}async function I1(_,Q,J={}){return z2(`${T1}${Q}`,{...J,headers:{...J.headers??{},..._===p0?{}:{"x-volter-token":_},...J.body&&!J.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function w1(_,Q,J=0){let q=K_((U)=>I1(_,U),Q,J,_);return q.state==="error"?{...q,error:v1(q.error).text}:q}var x2=(_)=>{let Q=new Date(_),J=(q)=>String(q).padStart(2,"0");return`${Q.getFullYear()}-${J(Q.getMonth()+1)}-${J(Q.getDate())}T${J(Q.getHours())}:${J(Q.getMinutes())}`},B_=(_)=>new Date(Math.ceil(Date.parse(_)/60000)*60000).toISOString(),y_=(_)=>_.operation==="observed"?`observed${_.provenance==="placeholder"?" (default data)":" (vendor)"}`:_.receipt?`${_.receipt.status??""} ${_.receipt.externalId??""} ${_.receipt.reason??""}`.trim():_.provenance==="placeholder"?"default data":"unpushed",RZ=(_)=>{let Q=/^[0-9a-f]{2}-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(_??"");return Q?{trace:Q[1],span:Q[2]}:null},r6="volter.console.snapshots",C0=()=>{try{return JSON.parse(sessionStorage.getItem(r6)??"{}")}catch{return{}}},v_=new Map,i6=(_)=>{if(g0){if(_.token||_.readToken)v_.set(_.name,{token:_.token,readToken:_.readToken});_={..._,token:"",readToken:""}}try{sessionStorage.setItem(r6,JSON.stringify({...C0(),[_.name]:_}))}catch{}},d6=(_)=>v_.get(_)?.readToken||C0()[_]?.readToken||"",I4=(_)=>{try{let Q=C0();delete Q[_],sessionStorage.setItem(r6,JSON.stringify(Q))}catch{}},A2=new URLSearchParams(window.location.hash.slice(1)),h2=A2.get("close")??"";function N5(_){if(typeof _!=="string")return null;let Q;try{Q=new URL(_)}catch{return null}return(Q.protocol==="http:"||Q.protocol==="https:")&&Q.origin===_.replace(/\/+$/,"")?Q:null}function a6(_){let Q=N5(_);if(!Q)return null;let J=new URL(T1);if(Q.protocol!==J.protocol||Q.port!==J.port)return null;if(Q.hostname===J.hostname)return Q.origin;let q=/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./;if(!q.test(Q.hostname))return null;let U=Q.hostname.replace(q,"");return U===J.hostname||q.test(J.hostname)&&U===J.hostname.replace(q,"")?Q.origin:null}function OZ(_){let Q;try{Q=JSON.parse(_)}catch{return null}let J=/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/i;if(typeof Q.name!=="string"||!J.test(Q.name)||typeof Q.parent!=="string"||!J.test(Q.parent)||typeof Q.at!=="string")return null;let q=Q.parentOrigin===void 0?void 0:a6(Q.parentOrigin);return{name:Q.name,parent:Q.parent,token:typeof Q.token==="string"?Q.token:"",readToken:typeof Q.readToken==="string"?Q.readToken:"",at:Q.at,expiresAt:typeof Q.expiresAt==="string"?Q.expiresAt:null,...q?{parentOrigin:q}:{}}}{let _=A2.get("snapshot");if(_){let Q=OZ(_);if(Q&&!C0()[Q.name])i6(Q)}}var j_="volter.console.home",V_=(_)=>{let Q=N5(_);if(!Q)return null;let J=new URL(T1).hostname,q=J.replace(/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./,"");return Q.hostname===J||Q.hostname===q?Q.origin:null};{let _=V_(A2.get("home"));if(_)try{sessionStorage.setItem(j_,_)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((_)=>A2.has(_)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var G0=()=>{try{return V_(sessionStorage.getItem(j_))??""}catch{return""}};function s6(_,Q,J,q){let U=new URLSearchParams({token:Q,home:G0()||T1}),G=C0()[J];if(G)U.set("snapshot",JSON.stringify(G));window.location.replace(`${_}${q??`${window.location.pathname}${window.location.search}`}#${U.toString()}`)}var C4=P5.dataset.route==="memory"?"":null;function gB(_){C4=_,window.dispatchEvent(new PopStateEvent("popstate"))}function Y2(){return(C4??window.location.pathname.slice(X1.length)).split("/").filter(Boolean).map((_)=>{try{return decodeURIComponent(_)}catch{return""}})}var M_=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,N0=(_,Q)=>_&&Q&&M_.test(_)&&M_.test(Q)?`${_}/${Q}`:"";function R1(_){let Q=`/${_.map(encodeURIComponent).join("/")}`;if(C4!==null)C4=Q;else window.history.pushState(null,"",`${X1}${Q}`);window.dispatchEvent(new PopStateEvent("popstate"))}function u_(_,Q){let J=a6(C0()[_]?.origin);if(J&&J!==T1){s6(J,d6(_),_,`${X1}/${Q.map(encodeURIComponent).join("/")}`);return}R1(Q)}async function T_(){let[_,Q]=Y2(),J=N0(_,Q),q=J?[J]:P_;if(q.length===0){let U=await z2(`${T1}/-/ping`).catch(()=>null);q=U?.ok?(await U.json().catch(()=>({}))).worlds??[]:[]}q=q.filter((U)=>{let[G,Z,...F]=U.split("/");return F.length===0&&N0(G,Z)===U});for(let U of q){let G=await z2(`${T1}/-/${U}/session`,{method:"POST"}).catch(()=>null);if(!G)continue;let Z=await G.json().catch(()=>({})),F=N5(Z.origin)?.origin;if(G.status===409&&F&&F!==T1)return window.location.replace(`${F}${X1}/${U}`),"moved";if(G.ok&&Z.local)return{token:typeof Z.token==="string"&&Z.token?Z.token:p0}}return null}function fZ(){let[_,Q]=i.useState(m6),J=(q)=>()=>{try{if(q==="system")localStorage.removeItem("volter.theme");else localStorage.setItem("volter.theme",q)}catch{}H_(q),Q(q)};return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"theme-choice",role:"radiogroup","aria-label":"Appearance",children:["system","light","dark"].map((q)=>$.jsxDEV("button",{type:"button",role:"radio","aria-checked":_===q,onClick:J(q),children:q==="system"?"System":q==="light"?"Light":"Dark"},q,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function IZ(){let[_,Q]=i.useState(MZ()),[J,q]=i.useState(!1),[U,G]=i.useState(!1),[Z,F]=i.useState(""),[X,Y]=i.useState(null),[H,K]=i.useState(null),[L,z]=i.useState(Y2());i.useEffect(()=>{let y=()=>z(Y2());return window.addEventListener("popstate",y),()=>window.removeEventListener("popstate",y)},[]),i.useEffect(()=>{let[y,p]=Y2(),u=N0(y,p),[s,t]=u?u.split("/"):[],a=C0()[h2];if(!h2||!_||!s||!t||!a?.made||a.parent!==`${s}/${t}`||N0(...h2.split("/"))!==h2)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}I1(_,`/-/${s}/${t}/branches/${h2}`,{method:"DELETE"}).catch(()=>null).then(()=>I4(h2))},[_]);let W=i.useCallback(async(y)=>{if(K(null),!y){let t=await T_();if(t==="moved")return;if(t){if(q(!0),t.token!==p0)I5(t.token);Q(t.token);return}Y(null),G(!0);return}if(g0&&y===p0){let t=await T_();if(t==="moved")return;if(t)q(!0)}if(g0&&y===N_){let[t,a]=Y2(),d=N0(t,a),[c,e]=d?d.split("/"):[],Q1=c&&e?await z2(`${T1}/-/${c}/${e}/session`,{method:"POST",headers:{"x-volter-pass":A2.get("pass")??""}}).catch(()=>null):null;if(!Q1){K(`${T1} did not answer: no session was opened`),Y(null);return}if(!Q1.ok){K(`${await J0(Q1)}. Open it again from the platform.`),Y(null);return}S_((await Q1.json().catch(()=>({}))).issuer),Q(p0);return}if(g0&&y!==p0){let[t,a]=Y2(),d=N0(t,a),[c,e]=d?d.split("/"):[],Q1=c&&e?await z2(`${T1}/-/${c}/${e}/session`,{method:"POST",headers:{"x-volter-token":y}}).catch(()=>null):null;if(!Q1){K(`${T1} did not answer: no session was opened`),Y(null);return}if(!Q1.ok){let G1=await J0(Q1);K(Q1.status===401||Q1.status===403?`That token does not open ${c}/${e}.`:Q1.status===409?`${c}/${e}'s session lives at another origin: ${G1}`:`The World could not open a session (${Q1.status}): ${G1}`),Y(null);return}Q(p0);return}let p=g0?new Response(null,{status:404}):await I1(y,"/-/worlds");if(p.ok){let{worlds:t}=await p.json();Y({kind:"admin",worlds:t});return}if(p.status===429){K("You are asking faster than the platform allows — wait a moment and reload."),Y(null);return}if(p.status>=500){let t=await p.json().catch(()=>({}));K(`The platform could not list your worlds${t.error?`: ${t.error}`:""}. Reload; if it stays, the status page says what is wrong.`),Y(null);return}let u=P_;if(u.length===0){let t=await z2(`${T1}/-/ping`);if(!t.ok){K(`${T1} does not answer as a host`),Y(null);return}if(u=(await t.json()).worlds??[],u.length===0){K(`${T1} does not list its Worlds: open a World at its own address, ${T1}${X1}/<org>/<world>`),Y(null);return}}let s=[];for(let t of u){let a=await I1(y,`/-/${t}/twins`);if(a.ok){let d=await a.json();s.push({name:t,base:`${W2}/${t}`,twins:(d.twins??[]).map((c)=>({vendor:c.twin,protocol:c.protocol??null,root:c.root??null}))})}}if(s.length===0){K("This link or key opens no World here: it was revoked, or it has ended."),Y(null);return}Y({kind:"world",worlds:s})},[]);i.useEffect(()=>{W(_)},[_,W]);let O=(y)=>X?.kind==="admin"?X.worlds.find((p)=>p.name===y)?.token??_:_,[T,B]=i.useState("");if(!_||!X&&!H)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(O5,{href:`${X1}/`},void 0,!1,void 0,this),_&&!X&&!H||!_&&!U?$.jsxDEV("p",{className:"mode",children:"Opening…"},void 0,!1,void 0,this):$.jsxDEV("form",{onSubmit:(y)=>{y.preventDefault(),I5(Z.trim()),Q(Z.trim())},className:"stack",children:[$.jsxDEV("h2",{children:"Open a World"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"A World's token opens that World. A host's admin token opens every World it serves."},void 0,!1,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Token"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"token",type:"password",value:Z,onChange:(y)=>F(y.target.value),autoFocus:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",children:"Open"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let w=()=>{if(J){window.location.reload();return}if(g0){let[y,p]=Y2(),u=N0(y,p),[s,t]=u?u.split("/"):[],a=()=>window.location.replace(p1()?`${p1()}/`:`${T1}${X1}/${s&&t?`${s}/${t}`:""}?signin`);if(setTimeout(a,2000),s&&t)z2(`${T1}/-/${s}/${t}/session/end`,{method:"POST"}).catch(()=>null).then(a);else a();return}if(X)for(let y of X.worlds)navigator.sendBeacon(`${y.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${y.name}/session/end`);I5(""),Q(""),F(""),Y(null),R1([])};if(H||!X)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(O5,{href:`${X1}/`},void 0,!1,void 0,this),$.jsxDEV("h2",{children:"Could not open it"},void 0,!1,void 0,this),$.jsxDEV("p",{role:"alert",children:H??"nothing answered"},void 0,!1,void 0,this),p1()?$.jsxDEV("a",{className:"button primary",href:`${p1()}/`,children:["Back to ",new URL(p1()).host]},void 0,!0,void 0,this):$.jsxDEV("button",{type:"button",className:"primary",onClick:w,children:J?"Try again":"Use another token"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let[A,R,I,C,P,k,N]=L,v=I==="~",E=/^[A-Za-z0-9_-]+$/,g=/^[^\u0000-\u001f\u007f]{1,200}$/,h=v||!I||!E.test(I)?void 0:I,S=P&&E.test(P)?k!==void 0&&C!=="changes"&&C!=="screens"?N0(P,k)||void 0:P:void 0,b=C==="changes"&&P==="changesets"&&k&&E.test(k)?k:C==="screens"&&k&&N&&/^[A-Za-z0-9_.-]+$/.test(k)&&g.test(N)?`${k}:${N}`:void 0,j=N0(A,R),x=j?C0()[j]??null:null,V=(y)=>d6(y)||O(y),D=x?X.kind==="admin"?X.worlds.find((y)=>y.name===x.parent)?.token??null:X.worlds.some((y)=>y.name===x.parent)?_:null:null,f=async(y)=>{let p=a6(y.parentOrigin);if(p&&p!==T1){I4(y.name),window.location.assign(`${p}${X1}/${y.parent}#close=${encodeURIComponent(y.name)}`);return}if(y.made)await I1(O(y.parent),`/-/${y.parent}/branches/${y.name}`,{method:"DELETE"}).catch(()=>null),I4(y.name);R1(y.parent.split("/"))};return $.jsxDEV("main",{className:j?"app workspace":"app home",children:[j?null:$.jsxDEV("header",{children:[j?$.jsxDEV(W_,{},void 0,!1,void 0,this):null,$.jsxDEV(O5,{href:`${G0()&&G0()!==T1?G0():""}${X1}/`,onClick:(y)=>{if(G0()&&G0()!==T1)return;y.preventDefault(),R1([])}},void 0,!1,void 0,this),$.jsxDEV("nav",{"aria-label":"breadcrumb",className:"crumbs",children:[j?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("span",{children:j.split("/")[0]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${j}`,className:"crumb-world",onClick:(y)=>{y.preventDefault(),R1(j.split("/"))},children:j.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,h?$.jsxDEV("span",{children:[" / ",h]},void 0,!0,void 0,this):null,v&&C==="trace"?$.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),p1()?$.jsxDEV("a",{href:`${p1()}/${j?encodeURIComponent(j.split("/")[0]):""}`,title:`Back to the platform at ${new URL(p1()).host}`,className:"back-link",children:["← ",$.jsxDEV("span",{className:"back-text",children:j?`${j.split("/")[0]}'s Worlds`:new URL(p1()).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,j?null:$.jsxDEV("span",{className:"mode",children:J?"on this machine":T?`signed in as ${T}`:X.kind==="admin"?"host: admin":"opened with a link or key"},void 0,!1,void 0,this),j||J?null:$.jsxDEV("button",{onClick:w,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j?$.jsxDEV(NZ,{name:j,token:V(j),twin:h,tab:v?C??"overview":"overview",arg:v?S:void 0,...v&&b?{sub:b}:{},admin:x?null:X.kind==="admin"?_:null,snapshot:x,parentToken:D,who:{local:J,person:T||null,admin:X.kind==="admin"},onSignOut:w,onReturn:f,opens:(y)=>!!C0()[y]||X.kind==="admin"&&X.worlds.some((p)=>p.name===y),onRemoved:()=>{W(_),R1([])},onWho:B,worlds:X.worlds.map((y)=>y.name)},j,!1,void 0,this):$.jsxDEV(wZ,{mode:X,admin:X.kind==="admin"?_:null,reload:()=>W(_)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function wZ({mode:_,admin:Q,reload:J}){let[q,U]=i.useState(""),[G,Z]=i.useState(""),[F,X]=i.useState(""),[Y,H]=i.useState(null),K=async(P)=>{if(!await B0({title:`Rotate the tokens of ${P}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let k=await I1(Q,`/-/worlds/${P}/rotate`,{method:"POST"}),N=await k.json().catch(()=>({}));H(k.ok?`rotated ${P}: the new tokens are shown once — token ${N.token} · read token ${N.readToken}`:N.error?v1(N.error).text:`answered ${k.status}`),await J()},L=async(P)=>{let k=await I1(Q,`/-/worlds/${P}`,{method:"DELETE"}),N=await k.json().catch(()=>({}));H(k.ok?`removed ${P}`:N.error?v1(N.error).text:`answered ${k.status}`),await J()},[z,W]=i.useState(!1),[O,T]=i.useState(!1),[B,w]=i.useState(""),A=async(P)=>{P.preventDefault(),H(null),W(!0);try{let k=await I1(Q,"/-/worlds",{method:"POST",body:JSON.stringify({org:q,world:G,vendors:F.split(",").map((v)=>v.trim()).filter(Boolean)})}),N=await k.json();if(!k.ok){H(N.error?v1(N.error).text:`the host answered ${k.status}`);return}H(`provisioned ${N.name}`),Z(""),X(""),T(!1),await J()}finally{W(!1)}},R=B.trim().toLowerCase(),I=_.worlds.filter((P)=>!R||P.name.toLowerCase().includes(R)||P.twins.some((k)=>k.vendor.includes(R))),C=[...new Set(I.map((P)=>P.name.split("/")[0]))];return $.jsxDEV("section",{className:"home-window","aria-labelledby":"worlds",children:[$.jsxDEV("div",{className:"home-head",children:[$.jsxDEV("h2",{id:"worlds",children:"Worlds"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[k1(_.worlds.length,"World")," ",Q?"this host serves":"this key opens"]},void 0,!0,void 0,this),Q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{H(null),T(!0)},children:[$.jsxDEV(B1,{name:"plus",size:16},void 0,!1,void 0,this),"New World"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"home-find",children:$.jsxDEV("input",{type:"search",placeholder:"Filter by World or vendor","aria-label":"Filter Worlds",value:B,onChange:(P)=>w(P.target.value)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&!O?$.jsxDEV("p",{role:"status",className:"home-note",children:Y},void 0,!1,void 0,this):null,C.map((P)=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("p",{className:"menu-label home-org",children:P},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"home-list",children:I.filter((k)=>k.name.split("/")[0]===P).map((k)=>$.jsxDEV("li",{children:[$.jsxDEV("a",{href:`${X1}/${k.name}`,onClick:(N)=>{N.preventDefault(),R1(k.name.split("/"))},children:[$.jsxDEV(B1,{name:"globe",size:20},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:k.name.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("small",{children:$.jsxDEV("code",{children:k.base},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"home-vendors",children:k.twins.map((N)=>$.jsxDEV("span",{title:H1(N.vendor),children:$.jsxDEV(b1,{vendor:N.vendor},void 0,!1,void 0,this)},N.vendor,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q?$.jsxDEV("details",{className:"menu home-more",children:[$.jsxDEV("summary",{"aria-label":`More for ${k.name}`,children:"⋯"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"popover menu-list",children:[$.jsxDEV("button",{type:"button",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),K(k.name)},children:"Rotate tokens…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"danger-item",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),B0({title:`Remove ${k.name}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:k.name}).then((v)=>{if(v)L(k.name)})},children:"Remove World…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},k.name,!0,void 0,this))},void 0,!1,void 0,this)]},P,!0,void 0,this)),I.length===0?$.jsxDEV("p",{className:"mode home-note",children:R?`No World matches ${B}.`:"No Worlds here yet."},void 0,!1,void 0,this):null,$.jsxDEV(t1,{open:O,onClose:()=>{if(!z)T(!1)},title:"New World",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>T(!1),disabled:z,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"provision",className:"primary",disabled:z,children:z?"Making… (ten seconds or so)":"Make World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"provision",onSubmit:A,className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Org"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"org",value:q,onChange:(P)=>U(P.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"world",value:G,onChange:(P)=>Z(P.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Vendors"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"vendors",value:F,onChange:(P)=>X(P.target.value),placeholder:"stripe, slack",required:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"A twin of each, with its default data."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y?$.jsxDEV("p",{role:"status",children:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var PZ=["changes","events","trace","vendors","screens","canvas","branches","settings","remote","vault"],b_=(_,Q)=>{let J=Q?.screens?.find((q)=>!/[{<]/.test(q.path));return Q&&J?`${W2}/${_}/${Q.twin}${J.path.startsWith("/")?J.path:`/${J.path}`}`:null},R_={verify:"verified",use:"used",issue:"issued",revoke:"revoked",rotate:"rotated",seed:"seeded",upsert:"saved",set:"set",start:"started",finish:"finished",fail:"failed",schedule:"scheduled",deliver:"delivered",like:"liked",follow:"followed",reply:"replied",create:"created",update:"updated",delete:"deleted",record:"recorded",remove:"removed",add:"added",send:"sent",post:"posted",postmessage:"posted",cancel:"canceled",close:"closed",open:"opened",publish:"published",upload:"uploaded",invite:"invited",archive:"archived",merge:"merged",refund:"refunded",capture:"captured",confirm:"confirmed",pay:"paid"};function Z0(_){let Q=_.operation??_.op,J=(Q.includes(".")?Q.slice(Q.lastIndexOf(".")+1):Q).toLowerCase(),q=_.subject.type.replace(/[_-]+/g," ").trim(),U=`${q.charAt(0).toUpperCase()}${q.slice(1)}`,G=/(^|\.)twin\./.test(Q)||/^seed_/.test(J),Z=Q.replace(/[._]+/g," ").trim(),F=G?`${U} seeded`:R_[J]?`${U} ${R_[J]}`:`${Z.charAt(0).toUpperCase()}${Z.slice(1)}`,X=_.fields??{},Y=["title","name","email","text","subject","summary","description"].map((K)=>X[K]).find((K)=>typeof K==="string"&&K.trim()!=="")??null,H=Y===null?null:Y.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(K,L,z)=>`${L==="!"?"@":L}${z}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:F,label:H===null?null:H.length>80?`${H.slice(0,79)}…`:H}}var c0=(_)=>/token|password|secret|key|credential/i.test(_.subject.type)&&_.subject.id.length>6?`••••${_.subject.id.slice(-4)}`:_.subject.id;function NZ({name:_,token:Q,twin:J,tab:q,arg:U,sub:G,admin:Z,snapshot:F,parentToken:X,who:Y,onSignOut:H,onReturn:K,opens:L,onRemoved:z,onWho:W,worlds:O=[]}){let[T,B]=i.useState("pending"),[w,A]=i.useState(null),[R,I]=i.useState(0),[C,P]=i.useState(null);i.useEffect(()=>{let d=!0;return A(null),I1(Q,`/-/${_}/session`,{method:"POST"}).then(async(c)=>{let e=await c.json().catch(()=>({}));if(S_(e.issuer),e.who)W?.(e.who);P(typeof e.signsAs==="string"?e.signsAs:null);let Q1=N5(e.origin)?.origin;if(c.status===409&&Q1&&Q1!==T1){s6(Q1,Q,_);return}if(!d)return;if(B(!c.ok?"unknown":e.scope==="read"?"read":e.scope==="write"?"write":"unknown"),!c.ok)A(e.error?v1(e.error).text:`answered ${c.status}`)}).catch((c)=>{if(d)B("unknown"),A(`the World did not answer: ${c instanceof Error?c.message:String(c)}`)}),()=>{d=!1}},[_,Q,R]);let k=w?{state:"error",error:w}:T==="pending"?{state:"pending"}:{state:"ok",scope:T},N=T==="write",v=(d)=>{if(d.status!==403)return;d.clone().json().then((c)=>{if(/read token|opens only reads|write access|reads only/i.test(c?.error??""))B("read")},()=>null)},[E,g]=i.useState(0);i.useEffect(()=>{let d=setInterval(()=>{if(!document.hidden)g((c)=>c+1)},5000);return()=>clearInterval(d)},[]);let[h,S]=i.useState(0),b=w1(Q,`/-/${_}/clock`,E+h),j=w1(Q,`/-/${_}/twins`),x=w1(Q,`/-/${_}/branches`,h),V=w1(Q,`/-/${_}/map`,Math.floor(E/2)),D=!(x.state==="error"&&(x.status===404||x.status===405)),f=PZ.includes(q)?q:"overview",y=j.state==="ok"?j.data.twins.map((d)=>d.twin):[],p=f==="vendors"&&U?U:void 0,u=()=>{B("pending"),I((d)=>d+1)};if(f==="canvas"||f==="vendors"&&!p||q==="screens"&&!U)return $.jsxDEV(oZ,{name:_,token:Q,twins:j,session:k,retry:u,snapshot:F,back:()=>R1(_.split("/"))},void 0,!1,void 0,this);let t=q==="settings"?{kind:"settings",tab:((d)=>D_.find(([c])=>c===d)?.[0]??"account")(U)}:q==="remote"?{kind:"settings",tab:"remote"}:q==="vault"?{kind:"settings",tab:"vault"}:q==="branches"?{kind:"branches",...U?{open:U}:{}}:null,a=J?"vendor":q==="screens"&&U?"screen":f==="vendors"&&p?"vendor":q==="trace"?"trace":q==="events"?"events":q==="changes"&&U==="changesets"?"history":"changes";return $.jsxDEV(DZ,{name:_,token:Q,view:a,win:t,who:Y,snapshot:F,onReturn:K,onSignOut:H,worlds:O,session:k,retry:u,...a==="vendor"?{arg:J??p}:a==="events"||a==="trace"||a==="screen"?U?{arg:U}:{}:{},...G?{sub:G}:{},twins:j,map:V,branches:D?x:null,clock:b,canWrite:N&&!F,refused:v,signsAs:C,opens:L,tick:E,admin:Z,onRemoved:z,onClock:()=>S((d)=>d+1),scope:F?"read":T},void 0,!1,void 0,this)}function B1({name:_,size:Q=20}){return $.jsxDEV("svg",{className:"icon",viewBox:"0 0 24 24",width:Q,height:Q,fill:"none",stroke:"currentColor",strokeWidth:Q<=16?1.75:1.5,strokeLinecap:"square",strokeLinejoin:"miter","aria-hidden":"true",children:(A_[_]??[]).map(([J,q],U)=>i.default.createElement(J,{key:U,...q}))},void 0,!1,void 0,this)}function S4(_){let Q=(J)=>{let q=(J.operation??J.op).toLowerCase();return q.includes(".")?q.slice(q.lastIndexOf(".")+1):q};if(_.some((J)=>/^(delete|remove|archive|revoke)/.test(Q(J))||J.fields?.deleted===!0))return{icon:"square-minus",word:"removed",tone:"removed"};if(/^(create|add|insert|issue|send|post|upload|invite|record|seed)/.test(Q(_[0])))return{icon:"square-plus",word:"made",tone:"added"};return{icon:"square-dot",word:"changed",tone:"changed"}}var D_=[["account","Account","user"],["changesets","Changesets","git-commit-horizontal"],["remote","Remote","cloud"],["access","Access","key-round"],["services","Real services","plug"],["vault","Vault","vault"],["checks","Checks","list-checks"],["clock","Clock","clock"],["appearance","Appearance","palette"]],CZ=(_,Q)=>{let J=Q.split("/").pop()??Q,q=_.split("/").pop()??"";return J.startsWith(`${q}-`)?J.slice(q.length+1):J},L2=(_)=>_.replace(/^_+/,"").replace(/[_-]+/g," ");function h_({record:_,history:Q}){let J=_.writes[_.writes.length-1],q=Z0(J),U=S4(_.writes),G=new Set(_.writes.map((K)=>K.id)),Z=_.writes[0].occurredAt,F={};if(Q){for(let K of Q)if(!G.has(K.id)&&!K.landsId&&!K.aliasOf&&K.subject.type===J.subject.type&&K.subject.id===J.subject.id&&K.occurredAt<=Z)Object.assign(F,K.fields??{})}let X={...F};for(let K of _.writes)Object.assign(X,K.fields??{});let Y=U.tone==="added"&&Object.keys(F).length===0,H=[...new Set([...Object.keys(F),...Object.keys(X)])].filter((K)=>!a_(F[K],X[K]));return $.jsxDEV("div",{className:"ws-diff","aria-label":`${q.label??c0(J)}: its changes`,children:[$.jsxDEV("div",{className:"ws-diff-head",children:[$.jsxDEV("span",{className:`ws-kind ${U.tone}`,title:U.word,children:$.jsxDEV(B1,{name:U.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(b1,{vendor:_.twin},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:q.label??c0(J)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[H1(_.twin)," · ",J.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")," ",$.jsxDEV("code",{children:c0(J)},void 0,!1,void 0,this)," · ",U.word," here"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ol",{className:"ws-writes",children:_.writes.map((K)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:Z0(K).what},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(O1,{iso:K.occurredAt},void 0,!1,void 0,this)," · ",w5(K)]},void 0,!0,void 0,this)]},K.id,!0,void 0,this))},void 0,!1,void 0,this),Q===null?$.jsxDEV("p",{className:"mode pad",children:"Reading its history…"},void 0,!1,void 0,this):H.length===0?$.jsxDEV("p",{className:"mode pad",children:"No field holds a new value."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"ws-fields","aria-label":"Fields before and after",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Field"},void 0,!1,void 0,this),Y?null:$.jsxDEV("th",{children:"Before"},void 0,!1,void 0,this),$.jsxDEV("th",{children:U.tone==="removed"?"After":"Now"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:H.map((K)=>$.jsxDEV("tr",{children:[$.jsxDEV("th",{scope:"row",children:$.jsxDEV("code",{children:K},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y?null:$.jsxDEV("td",{className:K in F?"was":"none",children:K in F?$.jsxDEV(S0,{v:F[K]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:K in X?"now":"none",children:K in X?$.jsxDEV(S0,{v:X[K]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},K,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function E_({records:_,selected:Q,onPick:J,label:q}){let[U,G]=i.useState(()=>{try{return localStorage.getItem("volter.console.records")==="tree"}catch{return!1}}),Z=(Y)=>{G(Y);try{localStorage.setItem("volter.console.records",Y?"tree":"path")}catch{}},F=(Y,H)=>{let K=Y.writes[Y.writes.length-1],L=Z0(K),z=S4(Y.writes);return $.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:[Q===Y.key?"on":"",H?"nested":""].join(" ").trim()||void 0,"aria-pressed":Q===Y.key,onClick:()=>J(Y.key),children:[H?null:$.jsxDEV(b1,{vendor:Y.twin},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:L.label??c0(K)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[L2(K.subject.type)," · ",L.what.split(" ").slice(-1)[0],Y.writes.length>1?` · ${k1(Y.writes.length,"write")}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:`ws-kind ${z.tone}`,title:z.word,"aria-label":z.word,children:$.jsxDEV(B1,{name:z.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Y.key,!1,void 0,this)},X=[...new Set(_.map((Y)=>Y.twin))];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-view-switch",role:"group","aria-label":"List the records by",children:[$.jsxDEV("button",{type:"button","aria-pressed":!U,className:U?void 0:"on",onClick:()=>Z(!1),children:"Path"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button","aria-pressed":U,className:U?"on":void 0,onClick:()=>Z(!0),children:"Tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"ws-list","aria-label":q,children:U?X.map((Y)=>{let H=_.filter((K)=>K.twin===Y);return $.jsxDEV("li",{className:"ws-group",children:[$.jsxDEV("p",{className:"ws-group-head",children:[$.jsxDEV(b1,{vendor:Y},void 0,!1,void 0,this),$.jsxDEV("b",{children:H1(Y)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:H.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:H.map((K)=>F(K,!0))},void 0,!1,void 0,this)]},Y,!0,void 0,this)}):_.map((Y)=>F(Y,!1))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function SZ({name:_,token:Q,branches:J,opens:q,refused:U,onChanged:G}){let[Z,F]=i.useState(""),[X,Y]=i.useState(!1),H=J?.state==="ok"&&J.data.checkedOut||_.split("/")[1],K=J?.state==="ok"&&J.data.named?.length?J.data.named:[{name:H,running:!0}],L=J?.state==="ok"?J.data.branches:[],z=Z.trim().toLowerCase(),W=(T)=>!z||T.toLowerCase().includes(z),O=(T)=>{T.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"The branch served here",children:[$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("b",{children:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(B1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover ws-branch-menu",children:[$.jsxDEV("div",{className:"ws-branch-find",children:[$.jsxDEV("input",{type:"search",placeholder:"Filter","aria-label":"Filter branches",value:Z,onChange:(T)=>F(T.target.value)},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:(T)=>{O(T),Y(!0)},disabled:!J,children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"This World"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-branch-list",children:K.filter((T)=>W(T.name)).map((T)=>$.jsxDEV("li",{className:T.name===H?"current":void 0,children:[$.jsxDEV("span",{className:"tick",children:T.name===H?$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:T.name},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:T.name===H?"served here":T.running?"running":"stopped"},void 0,!1,void 0,this)]},T.name,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Branches of it"},void 0,!1,void 0,this),L.length===0?$.jsxDEV("p",{className:"mode ws-branch-none",children:"None yet. New branch makes one, from now or as the World was."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"ws-branch-list",children:L.filter((T)=>W(T.name)).map((T)=>{let B=$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"tick",children:$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:CZ(_,T.name)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:T.at?.instant?$.jsxDEV($.Fragment,{children:["as of ",$.jsxDEV(O1,{iso:T.at.instant,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w=T.expiresAt?`Goes away ${new Date(T.expiresAt).toLocaleString()}`:"Kept";return $.jsxDEV("li",{children:q(T.name)?$.jsxDEV("a",{href:`${X1}/${T.name}`,title:w,onClick:(A)=>{A.preventDefault(),O(A),u_(T.name,T.name.split("/"))},children:B},void 0,!1,void 0,this):$.jsxDEV("span",{title:`${w}. Its tokens went to whoever made it; it opens from their page.`,children:B},void 0,!1,void 0,this)},T.name,!1,void 0,this)})},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-branch-foot",children:$.jsxDEV("a",{href:`${X1}/${_}/~/branches`,onClick:(T)=>{T.preventDefault(),O(T),R1([..._.split("/"),"~","branches"])},children:"Manage branches…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g_,{name:_,token:Q,open:X,onClose:()=>Y(!1),onMade:G,refused:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function x_({name:_,view:Q,changes:J,changesets:q}){let U=(G)=>(Z)=>{Z.preventDefault(),R1([..._.split("/"),"~",...G])};return $.jsxDEV("nav",{className:"tabs ws-pane-tabs","aria-label":"Changes and history",children:[$.jsxDEV("a",{href:`${X1}/${_}/~/changes`,className:Q==="changes"?"on":void 0,"aria-current":Q==="changes"?"page":void 0,onClick:U(["changes"]),children:["Changes",J?$.jsxDEV("span",{className:"count",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/changes/changesets`,className:Q==="history"?"on":void 0,"aria-current":Q==="history"?"page":void 0,onClick:U(["changes","changesets"]),children:["History",q?$.jsxDEV("span",{className:"count",children:q},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function kZ({name:_,token:Q,sets:J,sub:q,signsAs:U,canWrite:G,rooted:Z,refused:F,onChanged:X,changes:Y,withScreens:H,required:K}){let[L,z]=i.useState(null),[W,O]=i.useState(!1),T=J.state==="ok"?[...J.data.changesets].sort((k,N)=>N.createdAt.localeCompare(k.createdAt)):[],B=T.find((k)=>k.name===q)??T[0],w=i.useMemo(()=>{let k=new Map;for(let N of B?i_(B):[]){let v=`${N.twin}:${N.entry.subject.type}:${N.entry.subject.id}`,E=k.get(v)??{key:v,twin:N.twin,writes:[]};E.writes.push(N.entry),k.set(v,E)}return[...k.values()]},[B]),A=w.find((k)=>k.key===L)??w[0],R=w1(Q,A?`/-/${_}/log/${A.twin}`:null),I={added:0,removed:0,changed:0};for(let k of w)I[S4(k.writes).tone]=(I[S4(k.writes).tone]??0)+1;let C=B?k4(B):null,P=B?d_(B,K):null;return $.jsxDEV("div",{className:"ws-two",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(x_,{name:_,view:"history",changes:Y,changesets:T.length},void 0,!1,void 0,this),$.jsxDEV(g1,{load:J,what:"the changesets",lines:4},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-list ws-commits","aria-label":"Changesets",children:T.map((k)=>{let N=B?.name===k.name,v=k4(k).label==="Not sent";return $.jsxDEV("li",{children:$.jsxDEV("a",{href:`${X1}/${_}/~/changes/changesets/${k.name}`,className:N?"on":void 0,"aria-current":N?"true":void 0,onClick:(E)=>{E.preventDefault(),z(null),R1([..._.split("/"),"~","changes","changesets",k.name])},children:[$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:l6(k)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[k.owner??(k.cutBy?w4(k.cutBy):"unrecorded")," • ",$.jsxDEV(O1,{iso:k.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),v?$.jsxDEV("span",{className:"ws-unpushed",title:"Not pushed to the remote yet",children:$.jsxDEV(B1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},k.name,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-pane-right",children:[J.state==="ok"&&!B?$.jsxDEV(f5,{title:"No changesets yet",children:$.jsxDEV("p",{children:"Cut one from Changes: the cut box is at its foot."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,B&&C&&P?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-commit-head",children:[$.jsxDEV("div",{className:"ws-commit-title",children:[$.jsxDEV("h3",{children:l6(B)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-commit-stat",children:[$.jsxDEV(B1,{name:"file-diff",size:16},void 0,!1,void 0,this)," ",k1(w.length,"changed record"),I.added?$.jsxDEV("span",{className:"plus",children:[" +",I.added]},void 0,!0,void 0,this):null,I.removed?$.jsxDEV("span",{className:"minus",children:[" −",I.removed]},void 0,!0,void 0,this):null,I.changed?$.jsxDEV("span",{className:"dot",children:[" •",I.changed]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode ws-commit-meta",children:[$.jsxDEV("code",{children:B.name},void 0,!1,void 0,this)," · ",$.jsxDEV(O1,{iso:B.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"ws-commit-who",children:[["Owner",B.owner??(B.cutBy&&/^(token|token:read)$|^key:(?!.* for:)/.test(B.cutBy)?"no person: a service’s":"unrecorded")],["Cut by",B.cutBy?B.pushedBy&&B.applied===null&&B.cutBy==="machine"?"the machine it was cut on":w4(B.cutBy):"unrecorded"],...B.pushedBy?[["Pushed by",w4(B.pushedBy)]]:[]].map(([k,N])=>$.jsxDEV("span",{children:[$.jsxDEV("span",{className:"mode",children:k},void 0,!1,void 0,this)," ",N]},k,!0,void 0,this))},void 0,!1,void 0,this),B.pushedBy?$.jsxDEV("p",{className:"mode ws-commit-meta",children:B.applied===null?"Owner and cut by are as the World it was cut in recorded them; pushed by is this World's own record.":"Owner and cut by are this World’s record; pushed by is as the remote recorded it."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>O(!0),title:"Where it went, the checks, the approvals; Verify, Approve and Deploy",children:[$.jsxDEV("span",{className:`badge cs-${C.tone}`,children:C.label},void 0,!1,void 0,this),$.jsxDEV("span",{className:`badge cs-${P.tone}`,children:P.label},void 0,!1,void 0,this),"Review…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-two inner",children:[$.jsxDEV("div",{className:"ws-files",children:$.jsxDEV(E_,{records:w,...A?{selected:A.key}:{},onPick:z,label:"Records it changed"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:A?$.jsxDEV(h_,{record:A,history:R.state==="ok"?R.data.entries:R.state==="error"?[]:null},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"It changes nothing."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:W,onClose:()=>O(!1),title:`Review: ${l6(B)}`,wide:!0,children:[$.jsxDEV(w_,{name:_,token:Q,signsAs:U,c:B,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"head",required:K},`h:${B.name}`,!1,void 0,this),$.jsxDEV(w_,{name:_,token:Q,signsAs:U,c:B,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"review",required:K},`r:${B.name}`,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function yZ({name:_,token:Q,vendors:J,vendor:q,tick:U}){let[G,Z]=i.useState(O_*4),[F,X]=i.useState(""),[Y,H]=i.useState(null),K=w1(Q,`/-/${_}/timeline?limit=${G}${q?`&twin=${encodeURIComponent(q)}`:""}`,Math.floor(U/2)),L=K.state==="ok"?aZ(K.data.entries):[],z=[...new Set(L.map((I)=>Z0(I.entry).what))].sort(),W=L.filter((I)=>!F||Z0(I.entry).what===F),O=W.find((I)=>E2(I)===Y)??W[0],T=(I)=>(C)=>{C.preventDefault(),H(null),R1([..._.split("/"),"~","events",...I?[I]:[]])},B=O?.entry.input&&typeof O.entry.input==="object"?O.entry.input.body:void 0,w=O?RZ(O.entry.traceparent):null,A=O?f_(O):null,R=O?lZ(O.entry):[];return $.jsxDEV("div",{className:"ws-events",children:[$.jsxDEV("div",{className:"ws-filterbar",children:[$.jsxDEV("nav",{className:"ws-seg","aria-label":"Vendor",children:[$.jsxDEV("a",{href:`${X1}/${_}/~/events`,className:!q?"on":void 0,"aria-current":!q?"page":void 0,onClick:T(),children:"All"},void 0,!1,void 0,this),J.map((I)=>$.jsxDEV("a",{href:`${X1}/${_}/~/events/${I}`,className:q===I?"on":void 0,"aria-current":q===I?"page":void 0,onClick:T(I),children:[$.jsxDEV(b1,{vendor:I},void 0,!1,void 0,this),H1(I)]},I,!0,void 0,this))]},void 0,!0,void 0,this),$.jsxDEV("select",{"aria-label":"Operation",value:F,onChange:(I)=>{X(I.target.value),H(null)},children:[$.jsxDEV("option",{value:"",children:"Every operation"},void 0,!1,void 0,this),z.map((I)=>$.jsxDEV("option",{value:I,children:I},I,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[$.jsxDEV(g1,{load:K,what:"the events",lines:6},void 0,!1,void 0,this),$.jsxDEV("table",{className:"ws-grid","aria-label":"Events",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Time"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"What"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Record"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"By"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Receipt"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:W.map((I)=>{let C=Z0(I.entry),P=f_(I),k=O&&E2(I)===E2(O);return $.jsxDEV("tr",{className:k?"on":void 0,"aria-selected":k,onClick:()=>H(E2(I)),children:[$.jsxDEV("td",{className:"mono",children:$.jsxDEV(O1,{iso:I.entry.occurredAt,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:I.twin},void 0,!1,void 0,this),H1(I.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("b",{children:C.what},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"ws-cell-clip",children:C.label?`“${C.label}”`:$.jsxDEV("code",{children:c0(I.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:w5(I.entry,I.caller)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P?$.jsxDEV("span",{className:P.bad?"badge cs-bad":P.status==="deployed"?"badge cs-done":"badge",children:P.status},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:y_(I.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},E2(I),!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-detail",children:O?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-event-line",children:[$.jsxDEV("span",{className:"badge",children:c_(O.entry)},void 0,!1,void 0,this),A?$.jsxDEV("span",{className:A.bad?"badge cs-bad":"badge cs-good",children:A.status},void 0,!1,void 0,this):null,$.jsxDEV("code",{children:[O.entry.subject.type,":",c0(O.entry)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(O1,{iso:O.entry.occurredAt},void 0,!1,void 0,this)," · ",w5(O.entry,O.caller)]},void 0,!0,void 0,this),w?$.jsxDEV("a",{href:`${X1}/${_}/~/trace/${w.trace}`,onClick:(I)=>{I.preventDefault(),R1([..._.split("/"),"~","trace",w.trace])},children:"Its trace →"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-panes",children:[$.jsxDEV("div",{role:"region","aria-label":"The request",children:[$.jsxDEV("h4",{children:"Request"},void 0,!1,void 0,this),B!==void 0?$.jsxDEV(iZ,{body:B},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"No request body: the World or the vendor wrote it."},void 0,!1,void 0,this),R.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Usage"},void 0,!1,void 0,this),$.jsxDEV("dl",{className:"fields",children:R.map(([I,C])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:I},void 0,!1,void 0,this),$.jsxDEV("dd",{children:C},void 0,!1,void 0,this)]},I,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{role:"region","aria-label":"What it wrote",children:[$.jsxDEV("h4",{children:"Written"},void 0,!1,void 0,this),$.jsxDEV(r_,{fields:O.entry.fields},void 0,!1,void 0,this),$.jsxDEV("h4",{children:O.copies.length?"Receipts":"Receipt"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:O.copies.length?O.copies.map((I)=>I.entry.receipt?.status??"landed copy").join(" · "):dZ(O.entry)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"Nothing written here yet."},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:[$.jsxDEV("span",{children:[O?`${W.indexOf(O)+1} of ${W.length}`:W.length," events",q?` at ${H1(q)}`:""]},void 0,!0,void 0,this),K.state==="ok"&&K.data.next?$.jsxDEV("button",{type:"button",onClick:()=>Z((I)=>I+O_*4),children:"Load older"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function vZ({name:_,token:Q,id:J}){let q=/^[0-9a-f]{32}$/.test(J),U=w1(Q,q?`/-/${_}/timeline?trace=${J}&limit=500`:null),G=U.state==="ok"?[...U.data.entries].sort((K,L)=>-p_(K,L)):[],[Z,F]=i.useState(null),X=G[0]?Date.parse(G[0].entry.occurredAt):0,Y=G.length?Math.max(1,Date.parse(G[G.length-1].entry.occurredAt)-X):1,H=[...new Set(G.map((K)=>K.twin))];return $.jsxDEV("div",{className:"ws-sheet ws-trace",children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${X1}/${_}/~/events`,onClick:(K)=>{K.preventDefault(),R1([..._.split("/"),"~","events"])},children:[$.jsxDEV(B1,{name:"arrow-left",size:16},void 0,!1,void 0,this)," Events"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("h2",{children:[G[0]?`${Z0(G[0].entry).what} …`:"Trace"," ",$.jsxDEV("code",{className:"mode",children:J.slice(0,12)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!q?$.jsxDEV("p",{role:"alert",children:[J?`${J} is not a trace id`:"No trace named",": a W3C trace id is 32 hex characters."]},void 0,!0,void 0,this):$.jsxDEV(g1,{load:U,what:"the trace"},void 0,!1,void 0,this),G.length?$.jsxDEV("p",{className:"ws-trace-meta",children:["Started ",$.jsxDEV("b",{children:$.jsxDEV(O1,{iso:G[0].entry.occurredAt},void 0,!1,void 0,this)},void 0,!1,void 0,this)," · Took ",$.jsxDEV("b",{children:[Y," ms"]},void 0,!0,void 0,this)," · Vendors ",$.jsxDEV("b",{children:H.map(H1).join(", ")},void 0,!1,void 0,this)," · Writes ",$.jsxDEV("b",{children:G.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,U.state==="ok"&&G.length===0?$.jsxDEV(f5,{title:"Nothing in this World carries this trace",children:$.jsxDEV("p",{children:["An app instrumented with OpenTelemetry sends a ",$.jsxDEV("code",{children:"traceparent"},void 0,!1,void 0,this)," with each call, and every write that call makes keeps it, so one click reads across every vendor."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,G.length?$.jsxDEV("div",{className:"ws-spans",role:"table","aria-label":"The trace's writes",children:[$.jsxDEV("div",{className:"ws-span head",role:"row",children:[$.jsxDEV("span",{role:"columnheader",children:"Vendor and what"},void 0,!1,void 0,this),$.jsxDEV("span",{role:"columnheader",className:"ws-ticks",children:[$.jsxDEV("span",{children:"0 ms"},void 0,!1,void 0,this),$.jsxDEV("span",{children:[Math.round(Y/2)," ms"]},void 0,!0,void 0,this),$.jsxDEV("span",{children:[Y," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.map((K)=>{let L=Date.parse(K.entry.occurredAt)-X,z=E2(K),W=Z0(K.entry);return $.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("div",{className:Z===z?"ws-span on":"ws-span",role:"row",onClick:()=>F(Z===z?null:z),children:[$.jsxDEV("span",{role:"cell",className:"ws-span-name",children:[$.jsxDEV(b1,{vendor:K.twin},void 0,!1,void 0,this),$.jsxDEV("b",{children:H1(K.twin)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[W.what,W.label?` “${W.label}”`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{role:"cell",className:"ws-span-track",children:[$.jsxDEV("span",{className:"ws-span-dot",style:{left:`${L/Y*100}%`}},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-span-at mode",style:{left:`${L/Y*100}%`},children:["+",L," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z===z?$.jsxDEV("div",{className:"ws-span-detail",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:c_(K.entry)},void 0,!1,void 0,this)," on ",$.jsxDEV("code",{children:[K.entry.subject.type,":",c0(K.entry)]},void 0,!0,void 0,this)," · ",w5(K.entry,K.caller)," · ",y_(K.entry)]},void 0,!0,void 0,this),$.jsxDEV(r_,{fields:K.entry.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},z,!0,void 0,this)})]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function jZ({name:_,token:Q,vendor:J,withScreens:q,tick:U}){let G=w1(Q,`/-/${_}/checkpoint/${J}`,Math.floor(U/6)),Z=G.state==="ok"?G.data.tree.filter((R)=>R.deleted!==!0):[],F=[...new Set(Z.map((R)=>R.type))].map((R)=>({type:R,count:Z.filter((I)=>I.type===R).length})).sort((R,I)=>Number(R.type.startsWith("_"))-Number(I.type.startsWith("_"))||L2(R.type).localeCompare(L2(I.type))),[X,Y]=i.useState(null),[H,K]=i.useState(null),L=F.some((R)=>R.type===X)?X:F[0]?.type,z=Z.filter((R)=>R.type===L),W=z.find((R)=>R.id===H)??z[0],O=["name","email","title","text","description","subject","amount","percent_off","unit_amount","currency","status","channel","customer","product"],T=new Set(["id","type","object","livemode","created","updated","updatedAt","deleted"]),B=(R)=>!T.has(R)&&z.some((I)=>I[R]!==void 0&&I[R]!==null&&typeof I[R]!=="object"),w=[...new Set(z.flatMap((R)=>Object.keys(R)))],A=[...O.filter(B),...w.filter((R)=>!O.includes(R)&&B(R))].slice(0,4);return $.jsxDEV("div",{className:"ws-table-app",children:[$.jsxDEV("nav",{className:"ws-tables","aria-label":`${H1(J)}'s records`,children:[$.jsxDEV("div",{className:"ws-list-head",children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:J},void 0,!1,void 0,this),H1(J)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(g1,{load:G,what:"what it stores",lines:4},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Stores"},void 0,!1,void 0,this),F.map((R)=>$.jsxDEV("a",{href:`#${R.type}`,className:L===R.type?"on":void 0,"aria-current":L===R.type?"true":void 0,onClick:(I)=>{I.preventDefault(),Y(R.type),K(null)},children:[$.jsxDEV(B1,{name:"table-2",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:L2(R.type)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"count",children:R.count},void 0,!1,void 0,this)]},R.type,!0,void 0,this)),$.jsxDEV("p",{className:"menu-label",children:"Also"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/events/${J}`,onClick:(R)=>{R.preventDefault(),R1([..._.split("/"),"~","events",J])},children:[$.jsxDEV(B1,{name:"activity",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its events"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q?$.jsxDEV("a",{href:`${X1}/${_}/~/screens/${J}`,onClick:(R)=>{R.preventDefault(),R1([..._.split("/"),"~","screens",J])},children:[$.jsxDEV(B1,{name:"monitor",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[G.state==="ok"&&F.length===0?$.jsxDEV(f5,{title:`${H1(J)} stores nothing yet`,children:$.jsxDEV("p",{children:"What your app makes there shows here, by type."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,z.length?$.jsxDEV("table",{className:"ws-grid","aria-label":`${L2(L??"")} records`,children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"id"},void 0,!1,void 0,this),A.map((R)=>$.jsxDEV("th",{children:R},R,!1,void 0,this)),$.jsxDEV("th",{children:"updated"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:z.map((R)=>$.jsxDEV("tr",{className:W?.id===R.id?"on":void 0,"aria-selected":W?.id===R.id,onClick:()=>K(R.id),children:[$.jsxDEV("td",{children:$.jsxDEV("code",{children:R.id},void 0,!1,void 0,this)},void 0,!1,void 0,this),A.map((I)=>$.jsxDEV("td",{className:"ws-cell-clip",children:R[I]===void 0||R[I]===null?$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this):String(R[I])},I,!1,void 0,this)),$.jsxDEV("td",{className:"mode",children:typeof R.updatedAt==="string"?$.jsxDEV(O1,{iso:R.updatedAt},void 0,!1,void 0,this):"—"},void 0,!1,void 0,this)]},R.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("aside",{className:"ws-record","aria-label":"The selected record",children:W?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:L2(W.type)},void 0,!1,void 0,this),$.jsxDEV("code",{children:W.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("dl",{className:"ws-record-fields",children:Object.entries(W).filter(([R])=>R!=="type"&&R!=="id").map(([R,I])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:R},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(S0,{v:I},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},R,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:W?`${z.indexOf(W)+1} of ${k1(z.length,L2(L??"record"))}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function VZ({name:_,vendor:Q,url:J,mapError:q,holding:U,session:G,retry:Z}){return $.jsxDEV("div",{className:"ws-screen",children:[$.jsxDEV("div",{className:"ws-screen-bar",children:[$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:Q},void 0,!1,void 0,this),$.jsxDEV("b",{children:H1(Q)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:U},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/vendors/${Q}`,onClick:(F)=>{F.preventDefault(),R1([..._.split("/"),"~","vendors",Q])},children:[$.jsxDEV(B1,{name:"table-2",size:16},void 0,!1,void 0,this),"Its records"]},void 0,!0,void 0,this),J?$.jsxDEV("a",{href:J,target:"_blank",rel:"noopener noreferrer",children:[$.jsxDEV(B1,{name:"external-link",size:16},void 0,!1,void 0,this),"New tab"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),G.state==="ok"&&G.scope==="read"?$.jsxDEV("p",{className:"mode ws-screens-note",children:"You are looking read only: the screens browse, and refuse changes."},void 0,!1,void 0,this):null,q?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not say where its screens are: ",q]},void 0,!0,void 0,this):G.state==="pending"||J===void 0?$.jsxDEV("p",{className:"mode ws-screens-note",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,G.state==="error"?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not open its screens: ",G.error," ",$.jsxDEV("button",{type:"button",onClick:Z,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,G.state==="ok"&&J===null?$.jsxDEV("p",{className:"mode ws-screens-note",children:[H1(Q),"'s pack lists no screens."]},void 0,!0,void 0,this):null,G.state==="ok"&&J?$.jsxDEV("iframe",{title:`${H1(Q)}, as this World shows it`,src:J},Q,!1,void 0,this):null]},void 0,!0,void 0,this)}function uZ({name:_,token:Q,who:J,scope:q}){let[U,G]=i.useState(0),Z=w1(Q,`/-/${_}/twins`),F=w1(Q,`/-/${_}/rules`,U),X=F.state==="ok"?F.data.changesets:null,[Y,H]=i.useState(null),[K,L]=i.useState(null),[z,W]=i.useState(!1),[O,T]=i.useState([]),B=Y??X?.approvals??1,w=K??X?.summary??"required",A=X!==null&&(B!==(X.approvals??1)||w!==(X.summary??"required")),R=(v,E)=>{if(T((g)=>[{ok:v,text:E,at:new Date().toISOString(),n:++C5},...g].slice(0,3)),!v)u1(E,"error")},I=async(v)=>{v.preventDefault(),W(!0);try{let E=await I1(Q,`/-/${_}/rules`,{method:"PUT",body:JSON.stringify({changesets:{approvals:B,summary:w}})});if(!E.ok){R(!1,`Save: ${await J0(E)}`);return}R(!0,`Saved: ${B===0?"no approval":k1(B,"approval")} before a deploy; a summary ${w==="required"?"required":"generated when none is given"}.`),H(null),L(null),G((g)=>g+1)}finally{W(!1)}},C={gated:"a person deploys an approved changeset",auto:"a push deploys at once",hold:"nothing deploys"},P=J.person?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:J.person},void 0,!1,void 0,this),J.local?", signed in on this machine":""]},void 0,!0,void 0,this):J.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this machine"},void 0,!1,void 0,this),": no one is signed in here, so no person owns them until they are pushed by one"]},void 0,!0,void 0,this):J.admin?$.jsxDEV($.Fragment,{children:$.jsxDEV("b",{children:"the host's admin"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this token"},void 0,!1,void 0,this),", a service"]},void 0,!0,void 0,this),k=Z.state==="ok"?Z.data.twins.filter((v)=>v.root?.url):[],N=q!=="write"?"This session reads the World; it changes no rules":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Changesets"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"This World's rules, kept with it and shared by everyone who works in it. A person or the World's token changes them; a key never does, so an agent cannot relax the review its own changes go through."},void 0,!1,void 0,this),$.jsxDEV(g1,{load:F,what:"the rules",lines:2},void 0,!1,void 0,this),$.jsxDEV("form",{className:"ws-rules",onSubmit:(v)=>void I(v),"aria-label":"Changeset rules",children:[$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Recorded as"},void 0,!1,void 0,this),$.jsxDEV("p",{children:["What you cut here is recorded as ",P,". An agent's or an app's key cuts as itself, for the person it was made for; a World's token cuts as a service."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"A cut's summary"},void 0,!1,void 0,this),$.jsxDEV("fieldset",{className:"choice",disabled:Boolean(N)||X===null,children:[$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:w==="required",onChange:()=>L("required")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Required: whoever cuts says what it does and why"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:w==="generated",onChange:()=>L("generated")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Generated from its changes when none is given"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Either way a cut takes every change not yet in a changeset: there is no staging."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Ready to deploy"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-rule-list",children:$.jsxDEV("li",{children:[$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this),"Verified: replayed in a throwaway World, the World's checks passing"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("label",{className:"ws-rule-row",children:[$.jsxDEV("span",{children:"Approved by"},void 0,!1,void 0,this),$.jsxDEV("select",{value:B,onChange:(v)=>H(Number(v.target.value)),disabled:Boolean(N)||X===null,"aria-label":"Approvals required",children:[0,1,2,3,4,5].map((v)=>$.jsxDEV("option",{value:v,children:v===0?"no one: verified is enough":v===1?"1 person":`${v} different people`},v,!1,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"for its contents as they stand"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Deploys to"},void 0,!1,void 0,this),Z.state==="ok"&&k.length===0?$.jsxDEV("p",{className:"mode",children:"No vendor here is connected to its real service, so nothing deploys from this World."},void 0,!1,void 0,this):null,k.length?$.jsxDEV("ul",{className:"ws-rule-list",children:k.map((v)=>$.jsxDEV("li",{children:[$.jsxDEV(b1,{vendor:v.twin},void 0,!1,void 0,this),H1(v.twin),": ",C[v.root.deploy??"gated"]??"gated"]},v.twin,!0,void 0,this))},void 0,!1,void 0,this):null,$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("a",{href:`${X1}/${_}/~/settings/services`,onClick:(v)=>{v.preventDefault(),R1([..._.split("/"),"~","settings","services"])},children:"Real services"},void 0,!1,void 0,this)," sets each vendor's deploy policy."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(l0,{log:O,name:_},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(N)||z||!A,title:N??void 0,children:z?"Saving…":"Save"},void 0,!1,void 0,this),A?$.jsxDEV("button",{type:"button",onClick:()=>{H(null),L(null)},children:"Cancel"},void 0,!1,void 0,this):null,N?$.jsxDEV("span",{className:"mode",children:[N,"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function bZ({who:_,scope:Q,snapshot:J,portal:q,onSignOut:U}){let G=Q==="write"?"Reads and changes this World":Q==="read"?"Reads this World; changes nothing":"…",[Z,F]=J?["A snapshot",`of ${J.parent}, read only`]:_.local&&_.person?[_.person,"Signed in on this machine: this World is served here, and acts as you"]:_.local?["This machine","Served here, with no one signed in: what you do is recorded as this machine"]:_.person?[_.person,q?`Signed in through ${new URL(q).host}`:"Signed in"]:_.admin?["The host's admin","Opened with the host admin token: every World it serves"]:["A link or key","Opened with a token for this World"];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Account"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-account",children:[$.jsxDEV("span",{className:"ws-account-face","aria-hidden":"true",children:$.jsxDEV(B1,{name:_.person?"user":_.local?"monitor":J?"clock":"key-round",size:20},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:Z},void 0,!1,void 0,this),$.jsxDEV("small",{children:F},void 0,!1,void 0,this),$.jsxDEV("small",{children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_.local||J?null:$.jsxDEV("p",{children:$.jsxDEV("button",{type:"button",onClick:U,children:[$.jsxDEV(B1,{name:"log-out",size:16},void 0,!1,void 0,this),_.person?"Sign out":_.admin?"Sign out of the host":"Use another token"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q&&_.person?$.jsxDEV("p",{className:"mode",children:["Your profile, orgs and keys are on ",$.jsxDEV("a",{href:`${q}/`,children:new URL(q).host},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function DZ({name:_,token:Q,view:J,sub:q,arg:U,win:G,who:Z,snapshot:F,onReturn:X,onSignOut:Y,worlds:H,session:K,retry:L,twins:z,map:W,branches:O,clock:T,canWrite:B,refused:w,signsAs:A,opens:R,tick:I,admin:C,onRemoved:P,onClock:k,scope:N}){let v=s_(_,Q,I,w),[E,g]=i.useState(0),h=E*1e5+Math.floor(I/2),S=w1(Q,`/-/${_}/diff`,h),b=w1(Q,`/-/${_}/changesets`,h),j=w1(Q,`/-/${_}/rules`,h),[x,V]=i.useState(null),D=(o)=>(z1)=>{z1?.preventDefault(),R1([..._.split("/"),"~",...o])},f=z.state==="ok"?z.data.twins.map((o)=>o.twin):[],y=new Map((W.state==="ok"?W.data.twins:[]).flatMap((o)=>{let z1=b_(_,o);return z1?[[o.twin,z1]]:[]})),p=[...y.keys()],u=W.state==="ok"?W.data.twins.filter((o)=>o.root).map((o)=>o.twin):[],s=(o)=>W.state==="ok"?(W.data.twins.find((z1)=>z1.twin===o)?.resources??[]).reduce((z1,q1)=>z1+q1.count,0):0,t=O?.state==="ok"&&O.data.checkedOut||_.split("/")[1],a=i.useMemo(()=>{if(S.state!=="ok")return[];let o=new Map;for(let z1 of S.data.changes){let q1=`${z1.twin}:${z1.entry.subject.type}:${z1.entry.subject.id}`,y1=o.get(q1)??{key:q1,twin:z1.twin,writes:[]};y1.writes.push(z1.entry),o.set(q1,y1)}return[...o.values()]},[S]),d=a.find((o)=>o.key===x)??a[0],c=w1(Q,J==="changes"&&d?`/-/${_}/log/${d.twin}`:null,h),e=S.state==="ok"?S.data.changes.length:0,Q1=v.waiting.length,G1=v.there,$1=v.origin.state==="ok"?v.origin.data.origin:null,Z1=!B?"This session reads the World; it changes nothing":!G1?"No remote: name one in Settings › Remote":null,Y1=(o,z1,q1,y1,c1,l1)=>$.jsxDEV("a",{href:`${X1}/${_}/~/${y1}`,className:o?"on":void 0,"aria-current":o?"page":void 0,onClick:c1,children:[z1,$.jsxDEV("span",{children:q1},void 0,!1,void 0,this),l1?$.jsxDEV("span",{className:"count",children:l1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),K1=(o)=>{o.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("div",{className:"ws",children:[$.jsxDEV("div",{className:"ws-bar",role:"toolbar","aria-label":`${_} toolbar`,children:[$.jsxDEV("div",{className:"ws-left",children:[$.jsxDEV(O5,{href:`${X1}/${_}`,onClick:(o)=>{o.preventDefault(),D(["changes"])()}},void 0,!1,void 0,this),$.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"This World",children:[$.jsxDEV(B1,{name:"globe",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("b",{children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(B1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover menu-list ws-world-menu",children:[Z.local?null:$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Worlds"},void 0,!1,void 0,this),H.map((o)=>$.jsxDEV("a",{href:`${X1}/${o}`,className:o===_?"on":void 0,onClick:(z1)=>{z1.preventDefault(),K1(z1),R1(o.split("/"))},children:[o===_?$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(B1,{name:"globe",size:16},void 0,!1,void 0,this),o]},o,!0,void 0,this)),$.jsxDEV("a",{href:`${G0()&&G0()!==T1?G0():""}${X1}/`,onClick:(o)=>{if(G0()&&G0()!==T1)return;o.preventDefault(),K1(o),R1([])},children:[$.jsxDEV(B1,{name:"layout-grid",size:16},void 0,!1,void 0,this),"All Worlds",p1()?` on ${new URL(p1()).host}`:""]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Connect an app"},void 0,!1,void 0,this),p1()?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Point your app's SDKs here with a key made on the platform; its calls to these vendors land in this World:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:[W2,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(p6,{text:O4({platform:p1(),world:_})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!Z.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Point your app's SDKs here with a key from Settings › Access; its calls to these vendors land in this World:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:[W2,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(p6,{text:O4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Run it in this World; its calls to these vendors land here:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:"volter world run -- npm start"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-menu-text mode",children:["Or point an SDK at ",$.jsxDEV("code",{children:[W2,"/",_,"/<vendor>"]},void 0,!0,void 0,this)," with the token in ",$.jsxDEV("code",{children:".volter/token"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),$.jsxDEV(p6,{text:O4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/settings`,onClick:(o)=>{K1(o),D(["settings"])(o)},children:[$.jsxDEV(B1,{name:"settings",size:16},void 0,!1,void 0,this),"Settings…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(SZ,{name:_,token:Q,branches:O,opens:R,refused:w,onChanged:k},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-where",title:"Where this is",children:[$.jsxDEV("span",{children:_},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("span",{children:t},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$1?$.jsxDEV("a",{href:`${X1}/${_}/~/remote`,onClick:D(["remote"]),children:["origin ",$1.namespace,Q1?$.jsxDEV("b",{children:[" ↑",Q1]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("a",{href:`${X1}/${_}/~/remote`,onClick:D(["remote"]),children:"no remote"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/settings/clock`,onClick:D(["settings","clock"]),children:T.state==="ok"?$.jsxDEV($.Fragment,{children:[T.data.frozen?"stopped at ":"",$.jsxDEV(O1,{iso:T.data.at,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-right",children:[$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void v.pull(),disabled:Boolean(Z1)||v.busy!==null,title:Z1??`Fetch what ${G1} has and move this branch onto it`,children:[$.jsxDEV(B1,{name:"arrow-down-to-line",size:16},void 0,!1,void 0,this),v.busy==="Pull"?"Pulling…":"Pull"]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void v.push(),disabled:Boolean(Z1)||v.busy!==null||Q1===0,title:Z1??(Q1?`Push ${k1(Q1,"changeset")} to ${G1}`:`Every changeset is at ${G1}`),children:[$.jsxDEV(B1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this),v.busy==="Push"?"Pushing…":"Push",Q1?$.jsxDEV("span",{className:"ws-btn-count",children:Q1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn icon-only","aria-label":"Settings",title:"Settings",onClick:()=>D(["settings"])(),children:$.jsxDEV(B1,{name:"settings",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F?$.jsxDEV("div",{className:"ws-banner",role:"region","aria-label":"Snapshot",children:[$.jsxDEV(B1,{name:"clock",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:["You are looking at ",$.jsxDEV("b",{children:F.parent},void 0,!1,void 0,this)," as it was at ",$.jsxDEV(O1,{iso:F.at},void 0,!1,void 0,this),": a read-only snapshot",F.expiresAt?$.jsxDEV($.Fragment,{children:[", gone ",$.jsxDEV(O1,{iso:F.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,"."]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void X(F),children:"Return to live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,v.log.length?$.jsxDEV("div",{className:"ws-said",children:$.jsxDEV(l0,{log:v.log.slice(0,1),name:_},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV("div",{className:"ws-body",children:[$.jsxDEV("nav",{className:"ws-side","aria-label":`${_} places`,children:[p.length?$.jsxDEV("a",{href:`${X1}/${_}/~/screens`,className:J==="screen"?"ws-screens-entry on":"ws-screens-entry",onClick:D(["screens"]),title:`${k1(p.length,"screen")}: ${X2(p.map(H1))}`,children:[$.jsxDEV(B1,{name:"layout-grid",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Screens"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-screens-marks",children:[p.slice(0,3).map((o)=>$.jsxDEV(b1,{vendor:o},o,!1,void 0,this)),p.length>3?$.jsxDEV("span",{className:"more",children:["+",p.length-3]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"count",children:p.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{className:"side-group",children:"Workspace"},void 0,!1,void 0,this),Y1(J==="changes"||J==="history",$.jsxDEV(B1,{name:"file-diff",size:16},void 0,!1,void 0,this),"Changes","changes",D(["changes"]),a.length?String(a.length):void 0),Y1(J==="events"&&!U||J==="trace",$.jsxDEV(B1,{name:"activity",size:16},void 0,!1,void 0,this),"Events","events",D(["events"])),$.jsxDEV("p",{className:"side-group",children:"Records"},void 0,!1,void 0,this),f.map((o)=>$.jsxDEV(i.default.Fragment,{children:Y1(J==="vendor"&&U===o,$.jsxDEV(b1,{vendor:o},void 0,!1,void 0,this),H1(o),`vendors/${o}`,D(["vendors",o]),s(o)?String(s(o)):void 0)},o,!1,void 0,this)),$.jsxDEV("p",{className:"side-group",children:"Remote"},void 0,!1,void 0,this),Y1(!1,$.jsxDEV(B1,{name:"cloud",size:16},void 0,!1,void 0,this),G1?"origin":"Name a remote…","remote",D(["remote"]),Q1?`↑${Q1}`:void 0)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-main",role:"main",children:[J==="changes"?$.jsxDEV("div",{className:"ws-status",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(x_,{name:_,view:"changes",changes:a.length,changesets:b.state==="ok"?b.data.changesets.length:0},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:"Not in a changeset"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:S.state==="ok"?`${k1(a.length,"record")} · ${k1(e,"write")}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:S,what:"the changes",lines:4},void 0,!1,void 0,this),$.jsxDEV(E_,{records:a,...d?{selected:d.key}:{},onPick:V,label:"Changed records"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:[S.state==="ok"&&!d?$.jsxDEV(f5,{title:"No changes on this branch",action:Q1>0&&G1?$.jsxDEV("button",{type:"button",className:"primary",disabled:Boolean(Z1)||v.busy!==null,onClick:()=>void v.push(),children:["Push ",k1(Q1,"changeset")," to origin"]},void 0,!0,void 0,this):void 0,children:$.jsxDEV("p",{children:["What your app writes to this World lands here, record by record, to cut into a changeset. Everything since ",S.data.base.at?$.jsxDEV(O1,{iso:S.data.base.at},void 0,!1,void 0,this):$.jsxDEV("code",{children:S.data.base.id},void 0,!1,void 0,this)," is in one already."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,d?$.jsxDEV(h_,{record:d,history:c.state==="ok"?c.data.entries:c.state==="error"?[]:null},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(_F,{pinned:!0,generated:j.state==="ok"&&j.data.changesets.summary==="generated",author:{face:$.jsxDEV(B1,{name:Z.person?"user":Z.local?"monitor":"key-round",size:18},void 0,!1,void 0,this),who:Z.person??(Z.local?"This machine":Z.admin?"The host's admin":"A token"),account:`${X1}/${_}/~/settings/account`,branch:t},name:_,token:Q,changes:e,canWrite:B,refused:w,onCut:()=>{g((o)=>o+1),V(null)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,J==="history"?$.jsxDEV(kZ,{name:_,token:Q,sets:b,changes:a.length,withScreens:p,required:j.state==="ok"?j.data.changesets.approvals??1:1,...q?{sub:q}:{},signsAs:A,canWrite:B,rooted:u,refused:w,onChanged:()=>g((o)=>o+1)},void 0,!1,void 0,this):null,J==="events"?$.jsxDEV(yZ,{name:_,token:Q,vendors:f,...U&&f.includes(U)?{vendor:U}:{},tick:I},U??"",!1,void 0,this):null,J==="trace"?$.jsxDEV(vZ,{name:_,token:Q,id:U??""},void 0,!1,void 0,this):null,J==="vendor"&&U?$.jsxDEV(jZ,{name:_,token:Q,vendor:U,withScreens:p.includes(U),tick:I},U,!1,void 0,this):null,J==="screen"&&U?$.jsxDEV(VZ,{name:_,vendor:U,url:W.state==="ok"?y.get(U)??null:void 0,...W.state==="error"?{mapError:W.error}:{},holding:EZ(W.state==="ok"?W.data.twins.find((o)=>o.twin===U)?.resources??[]:[]),session:K,retry:L},U,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:G?.kind==="settings",onClose:()=>D(["changes"])(),title:"Settings",wide:"window",children:G?.kind==="settings"?$.jsxDEV("div",{className:"ws-settings",children:[$.jsxDEV("nav",{"aria-label":"Settings",children:D_.map(([o,z1,q1])=>$.jsxDEV("a",{href:`${X1}/${_}/~/settings/${o}`,className:G.tab===o?"on":void 0,"aria-current":G.tab===o?"page":void 0,onClick:D(["settings",o]),children:[$.jsxDEV(B1,{name:q1,size:16},void 0,!1,void 0,this),z1]},o,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-settings-pane",children:[N==="read"?$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"badge read-only",children:"Read only"},void 0,!1,void 0,this)," This session reads the World; it changes nothing."]},void 0,!0,void 0,this):null,G.tab==="account"?$.jsxDEV(bZ,{who:Z,scope:N,snapshot:F,portal:p1(),onSignOut:Y},void 0,!1,void 0,this):null,G.tab==="changesets"?$.jsxDEV(uZ,{name:_,token:Q,who:Z,scope:N},void 0,!1,void 0,this):null,G.tab==="remote"?$.jsxDEV(JF,{name:_,token:Q,canWrite:B,tick:I,refused:w},void 0,!1,void 0,this):null,G.tab==="access"||G.tab==="services"||G.tab==="checks"||G.tab==="clock"?$.jsxDEV(qF,{name:_,token:Q,admin:C,canWrite:B,refused:w,onRemoved:P,only:G.tab},void 0,!1,void 0,this):null,G.tab==="vault"?$.jsxDEV($F,{name:_,token:Q,canWrite:B,refused:w},void 0,!1,void 0,this):null,G.tab==="appearance"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV(fZ,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),$.jsxDEV(t1,{open:G?.kind==="branches",onClose:()=>D(["changes"])(),title:"Branches",wide:!0,children:G?.kind==="branches"?$.jsxDEV(gZ,{name:_,token:Q,canWrite:B,branches:O,opens:R,...G.open?{open:G.open}:{},onChanged:k,refused:w},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function p6({text:_}){return $.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>u1("Copied the prompt: paste it into your coding agent"),()=>u1("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}var t6=(_)=>`${_.url.replace(/\/+$/,"")}/${_.namespace}`,hZ=(_)=>_.filter((Q)=>Q.applied===null||Q.applied.outcome==="refused"),EZ=(_,Q=4)=>{let J=[..._].filter((q)=>q.count>0).sort((q,U)=>U.count-q.count);return J.length?J.slice(0,Q).map((q)=>k1(q.count,q.type.replace(/^_+/,""))).join(" · ")+(J.length>Q?` · +${J.length-Q} more`:""):"nothing yet"},m_=$.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:$.jsxDEV("path",{fill:"currentColor",d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm0 2.122a2.25 2.25 0 1 0-1.5 0v5.256a2.25 2.25 0 1 0 1.5 0V9.5h4.25A2.25 2.25 0 0 0 11.5 7.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75H5V5.372ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm6.5-9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this);function xZ({name:_,token:Q,clock:J,canWrite:q,onChanged:U,refused:G,open:Z}){let[F,X]=i.useState(!1),[Y,H]=i.useState(""),[K,L]=i.useState(""),[z,W]=i.useState(null),[O,T]=i.useState(!1),B=J.state==="ok"?J.data:null,w=async(C,P,k)=>{T(!0),W(null);try{let N=await I1(Q,`/-/${_}/${P}`,{method:P==="clock"?"PUT":"POST",body:JSON.stringify(k)});if(!N.ok){G(N),W({ok:!1,text:await J0(N)});return}let v=await N.json();W({ok:!0,text:`${C} — the World is at ${new Date(v.at).toLocaleString()}`}),X(!1),U()}catch(N){W({ok:!1,text:`the World did not answer: ${N instanceof Error?N.message:String(N)}`})}finally{T(!1)}},A=(C)=>{C.preventDefault();let P=new Date(Y);if(Number.isNaN(P.getTime())){W({ok:!1,text:"Pick a date and time."});return}if(B&&P.getTime()<Date.parse(B.at)){W({ok:!1,text:`The World's clock only moves forward: pick a time after ${new Date(B.at).toLocaleString()}.`});return}w("Clock set","clock",{at:P.toISOString()})},R=(C,P)=>{w(`Advanced ${P}`,"clock/advance",{by:C})},I=[["1h","1 hour"],["1d","1 day"],["7d","1 week"],["30d","30 days"]];return $.jsxDEV("div",{className:`clock${B?.frozen?" frozen":""}`,role:"region","aria-label":"World clock",children:[$.jsxDEV("p",{className:"clock-now",children:J.state==="loading"?$.jsxDEV("span",{className:"mode",children:"clock…"},void 0,!1,void 0,this):J.state==="error"?$.jsxDEV("span",{className:"mode",children:["Clock: ",J.error]},void 0,!0,void 0,this):B.frozen?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge",children:"Simulation"},void 0,!1,void 0,this)," World time ",$.jsxDEV("strong",{children:$.jsxDEV(O1,{iso:B.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:["World time ",$.jsxDEV("strong",{children:$.jsxDEV(O1,{iso:B.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"· real time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q&&B?$.jsxDEV("details",{className:Z?"clock-more inline":"clock-more",open:Z||void 0,children:[$.jsxDEV("summary",{children:"Simulate time…"},void 0,!1,void 0,this),$.jsxDEV("div",{className:Z?void 0:"popover",children:[$.jsxDEV("p",{className:"mode",children:"Move this World's clock forward to see what happens later: renewals, expiries, scheduled sends. Like a test clock, it only moves forward; to look back, the branch picker’s Manage branches… views an earlier moment."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"clock-controls",children:[$.jsxDEV("button",{type:"button","aria-expanded":F,onClick:()=>{X(!F),H(x2(B_(B.at))),W(null)},children:"Set time…"},void 0,!1,void 0,this),$.jsxDEV("div",{role:"group","aria-label":"Advance the clock",className:"advance",children:[$.jsxDEV("span",{className:"mode",children:"Advance"},void 0,!1,void 0,this),I.map(([C,P])=>$.jsxDEV("button",{type:"button","aria-label":`Advance ${P}`,disabled:O||!B.frozen,title:B.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>R(C,P),children:P},C,!1,void 0,this)),$.jsxDEV("form",{className:"inline",onSubmit:(C)=>{if(C.preventDefault(),!/^\d+[smhd]$/.test(K.trim())){W({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}R(K.trim(),`by ${K.trim()}`)},children:[$.jsxDEV("label",{className:"sr",children:["Advance by ",$.jsxDEV("input",{name:"advanceBy",value:K,onChange:(C)=>L(C.target.value),placeholder:"90m, 12h, 3d",size:9,disabled:!B.frozen},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:O||!B.frozen,children:"Advance"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!B.frozen?$.jsxDEV("p",{className:"mode",children:"The World runs on real time. Set a time to start simulating; then advance it."},void 0,!1,void 0,this):null,F?$.jsxDEV("form",{className:"inline","aria-label":"Set the World time",onSubmit:A,noValidate:!0,children:[$.jsxDEV("label",{children:["World time ",$.jsxDEV("input",{name:"worldTime",type:"datetime-local",value:Y,min:x2(B_(B.at)),onChange:(C)=>H(C.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:Intl.DateTimeFormat().resolvedOptions().timeZone},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",disabled:O,children:"Set time"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>X(!1),children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,z?$.jsxDEV("p",{role:z.ok?"status":"alert",children:z.text},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function mZ({name:_,token:Q,clock:J,refused:q}){let[U,G]=i.useState(!1),[Z,F]=i.useState(""),[X,Y]=i.useState(null),[H,K]=i.useState(!1),L=J.state==="ok"?J.data.at:new Date().toISOString(),z=i.useRef(null);return i.useEffect(()=>{if(!U)return;let O=(B)=>{if(B.key==="Escape"&&!document.querySelector("dialog[open]"))G(!1),z.current?.querySelector("button")?.focus()},T=(B)=>{if(!z.current?.contains(B.target))G(!1)};return document.addEventListener("keydown",O),document.addEventListener("click",T),()=>{document.removeEventListener("keydown",O),document.removeEventListener("click",T)}},[U]),$.jsxDEV("div",{className:"as-of",ref:z,children:[$.jsxDEV("button",{type:"button","aria-expanded":U,title:"Open a read-only copy of this World as it was at a moment you pick",onClick:()=>{G(!U),F(x2(L)),Y(null)},children:"View an earlier moment…"},void 0,!1,void 0,this),U?$.jsxDEV("form",{className:"inline","aria-label":"View the World as of a past moment",onSubmit:async(O)=>{O.preventDefault(),Y(null);let T=new Date(Z);if(Number.isNaN(T.getTime())){Y("Pick a date and time.");return}if(T.getTime()>Date.parse(L)){Y(`That is after the World's present (${new Date(L).toLocaleString()}); a snapshot looks back.`);return}K(!0);try{let B=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({at:{instant:T.toISOString()},ttl:3600})});if(!B.ok){q(B),Y(await J0(B));return}let w=await B.json();i6({name:w.name,parent:_,token:w.token,readToken:w.readToken,at:T.toISOString(),expiresAt:w.expiresAt??null,parentOrigin:T1,made:!0});let A=N5(w.origin)?.origin;if(A&&A!==T1){s6(A,w.readToken,w.name,`${X1}/${w.name}`);return}R1(w.name.split("/"))}catch(B){Y(`the World did not answer: ${B instanceof Error?B.message:String(B)}`)}finally{K(!1)}},noValidate:!0,children:[$.jsxDEV("label",{children:["As of ",$.jsxDEV("input",{name:"asOf",type:"datetime-local",value:Z,max:x2(L),onChange:(O)=>F(O.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:H,children:H?"Opening…":"Open snapshot"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Opens a read-only copy of this World as it was then; the copy goes away within the hour."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,X?$.jsxDEV("p",{role:"alert",children:X},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function g_({name:_,token:Q,open:J,onClose:q,onMade:U,refused:G}){let Z=(P)=>P.split("/").pop()??P,[F,X]=i.useState(!1),[Y,H]=i.useState(null),[K,L]=i.useState(""),[z,W]=i.useState("now"),[O,T]=i.useState(""),[B,w]=i.useState("24"),[A,R]=i.useState(!0);i.useEffect(()=>{if(J)H(null),T(x2(new Date().toISOString()))},[J]);let I=async(P)=>{P.preventDefault(),H(null);let k=z==="at"?new Date(O):null;if(k&&Number.isNaN(k.getTime())){H("Pick a date and time, or make it as of now.");return}if(k&&k.getTime()>Date.now()){H("A branch is made as of now or a moment before it.");return}X(!0);let N=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({ttl:Math.round(Number(B)*3600),...k?{at:{instant:k.toISOString()}}:A?{live:!0}:{},...K.trim()?{label:K.trim()}:{}})}).catch(()=>null);if(X(!1),!N){H(`${T1} did not answer`);return}if(!N.ok){G(N),H(await J0(N));return}let v=await N.json();i6({name:v.name,parent:_,token:v.token??"",readToken:v.readToken,at:(k??new Date).toISOString(),expiresAt:v.expiresAt??null,parentOrigin:T1,...v.origin?{origin:v.origin}:{}}),q(),L(""),u1(`Made ${Z(v.name)}`),U()};return $.jsxDEV(t1,{open:J,onClose:()=>{if(!F)q()},title:`New branch of ${Z(_)}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>q(),disabled:F,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"new-branch",className:"primary",disabled:F,children:F?"Making…":"Make branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"new-branch",onSubmit:(P)=>void I(P),className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Label ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"branchLabel",value:K,onChange:(P)=>L(P.target.value.toLowerCase()),placeholder:"checkout-flow",pattern:"[a-z0-9][a-z0-9\\-]{0,23}",maxLength:24},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("fieldset",{className:"choice",children:[$.jsxDEV("legend",{children:"From"},void 0,!1,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="now",onChange:()=>W("now")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Now: the World as it is"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="now"?$.jsxDEV("label",{className:"check sub",children:[$.jsxDEV("input",{type:"checkbox",name:"branchLive",checked:A,onChange:(P)=>R(P.target.checked)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Live: its clock keeps this World's time, as a pull request's preview does (else it stops now)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="at",onChange:()=>W("at")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"An instant before now: the World as it was then, its clock stopped there"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="at"?$.jsxDEV("input",{type:"datetime-local","aria-label":"As of",value:O,max:x2(new Date().toISOString()),onChange:(P)=>T(P.target.value)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Goes away after"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"branchLife",value:B,onChange:(P)=>w(P.target.value),children:[$.jsxDEV("option",{value:"1",children:"1 hour"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"24",children:"1 day"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"72",children:"3 days"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"168",children:"7 days"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y?$.jsxDEV("p",{role:"alert",children:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function gZ({name:_,token:Q,canWrite:J,branches:q,opens:U,open:G,onChanged:Z,refused:F,snapshotOf:X}){let Y=w1(Q,`/-/${_}/clock`),H=(w)=>w.split("/").pop()??w,[K,L]=i.useState(!1),z=(w)=>(A)=>{A.preventDefault(),R1([..._.split("/"),"~","branches",...w?w.split("/"):[]])};if(!q)return $.jsxDEV("p",{className:"mode",children:"This host makes no branches of a World."},void 0,!1,void 0,this);let W=q.state==="ok"?q.data.branches:[],O=q.state==="ok"&&(q.data.named?.length??0)>0?q.data.named:[{name:H(_),running:!0}],T=q.state==="ok"?q.data.checkedOut??H(_):H(_),B=async(w)=>{if(!await B0({title:`Remove the branch ${H(w)}?`,body:"Whoever holds its tokens loses it, and its history goes with it.",action:"Remove branch",danger:!0}))return;let A=await I1(Q,`/-/${_}/branches/${w}`,{method:"DELETE"}).catch((R)=>R);if(A instanceof Error){u1(`Remove ${H(w)}: the World did not answer (${A.message})`,"error");return}if(!A.ok){F(A),u1(`Remove ${H(w)}: ${await J0(A)}`,"error");return}I4(w),u1(`Removed ${H(w)}`),Z(),R1([..._.split("/"),"~","branches"])};if(G){let w=G.includes("/")?W.find((R)=>R.name===G):void 0,A=G.includes("/")?void 0:O.find((R)=>R.name===G);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${X1}/${_}/~/branches`,onClick:z(),children:"← Branches"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(g1,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"&&!w&&!A?$.jsxDEV("p",{className:"mode",children:["This World has no branch named ",G,"."]},void 0,!0,void 0,this):null,w?$.jsxDEV(pZ,{name:_,b:w,canWrite:J,opens:U(w.name),remove:()=>void B(w.name)},void 0,!1,void 0,this):null,A&&!w?$.jsxDEV(cZ,{name:_,token:Q,b:A,served:A.name===T,canWrite:J,canServe:q.state==="ok"&&Boolean(q.data.canServe)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}return $.jsxDEV("div",{"aria-labelledby":"branches",children:[$.jsxDEV("div",{className:"branches-head",children:[$.jsxDEV("p",{className:"lede",children:["Branch this World to look at it as it was, or to change it without touching ",$.jsxDEV("b",{children:T},void 0,!1,void 0,this),". Each branch's name opens its page."]},void 0,!0,void 0,this),J?$.jsxDEV("div",{className:"head-actions",children:[X?null:$.jsxDEV(mZ,{name:_,token:Q,clock:Y,refused:F},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>L(!0),children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Branches",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{id:"branches",children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Goes away"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:[O.map((w)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:[$.jsxDEV("a",{href:`${X1}/${_}/~/branches/${w.name}`,onClick:z(w.name),children:$.jsxDEV("b",{children:w.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),w.name===T?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):w.running?null:$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge",children:"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"live"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"kept"},void 0,!1,void 0,this)]},`own:${w.name}`,!0,void 0,this)),W.map((w)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("a",{href:`${X1}/${_}/~/branches/${w.name}`,onClick:z(w.name),children:$.jsxDEV("b",{children:H(w.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:H(w.from??_)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w.at?.instant?$.jsxDEV(O1,{iso:w.at.instant},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"live"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV(O1,{iso:w.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w.expiresAt?$.jsxDEV(O1,{iso:w.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},w.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV(g_,{name:_,token:Q,open:K,onClose:()=>L(!1),onMade:Z,refused:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function pZ({name:_,b:Q,canWrite:J,opens:q,remove:U}){let G=(X)=>X.split("/").pop()??X,Z=d6(Q.name),F=w1(Z,Z?`/-/${Q.name}/diff`:null);return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[m_," ",G(Q.name)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>u_(Q.name,Q.name.split("/")),children:"Open"},void 0,!1,void 0,this):null,J?$.jsxDEV("button",{type:"button",className:"danger-button",onClick:U,children:"Remove…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:Q.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:G(Q.from??_)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.at?.instant?$.jsxDEV(O1,{iso:Q.at.instant},void 0,!1,void 0,this):"live: it keeps its parent's time"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(O1,{iso:Q.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Goes away"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.expiresAt?$.jsxDEV(O1,{iso:Q.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),!q?$.jsxDEV("p",{className:"mode",children:"Its tokens were handed to whoever made it: it opens, and shows its own changes, in their tab."},void 0,!1,void 0,this):null,F.state==="ok"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Its changes"},void 0,!1,void 0,this),F.data.changes.length===0?$.jsxDEV("p",{className:"mode",children:"Nothing written on it since it branched."},void 0,!1,void 0,this):$.jsxDEV(eZ,{changes:F.data.changes,idPrefix:`branch-${G(Q.name)}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function cZ({name:_,token:Q,b:J,served:q,canWrite:U,canServe:G}){let[Z,F]=i.useState(!1),[X,Y]=i.useState(null),H=async()=>{F(!0),Y(null);let K=await I1(Q,`/-/${_}/branches/${encodeURIComponent(J.name)}/serve`,{method:"POST"}).catch(()=>null);if(K?.ok){location.reload();return}F(!1),Y(K?await J0(K):`${T1} did not answer`)};return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[m_," ",J.name," ",q?$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:U&&G&&!q?$.jsxDEV("button",{type:"button",className:"primary",disabled:Z,onClick:()=>void H(),children:Z?"Switching…":"Serve here"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:J.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Kind"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:"one of this World's own branches"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"State"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:J.running?"running":"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("p",{className:"mode",children:["This is the branch these pages show: its changes are on ",$.jsxDEV("a",{href:`${X1}/${_}/~/changes`,onClick:(K)=>{K.preventDefault(),R1([..._.split("/"),"~","changes"])},children:"Changes"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):G?$.jsxDEV("p",{className:"mode",children:["“Serve here” stops this one's twins and serves ",J.name," in its place."]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode",children:"This host serves one of the World's own branches at a time, and does not switch them from this page."},void 0,!1,void 0,this),X?$.jsxDEV("p",{role:"alert",children:X},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var O_=50,E2=(_)=>`${_.twin}:${_.position}`,p_=(_,Q)=>Date.parse(Q.entry.occurredAt)-Date.parse(_.entry.occurredAt)||_.twin.localeCompare(Q.twin)||Q.position-_.position,w4=(_)=>{if(!_)return"someone";if(_.startsWith("key:")){let[Q,J]=_.slice(4).split(" for:");return J?`${Q}, for ${J}`:Q||"a key"}if(_.startsWith("person:"))return _.slice(7);return _==="machine"?"this machine":_==="person"?"a session with no name":_==="token:read"?"the read-only token":_==="token"?"the World's token":_},w5=(_,Q)=>{let J=typeof Q==="string"?Q:typeof _.caller==="string"?_.caller:"";if(J.startsWith("key:")&&J.length>4)return`by ${w4(J)}`;if(J.startsWith("person:")&&J.length>7)return`by ${J.slice(7)}`;if(J==="machine")return"by this machine";if(J==="person")return"by a session with no name";if(J==="key")return"by a key";if(J==="token:read")return"by the read-only token";if(J==="token")return"by the World's token";return _.actor?.kind==="system"?"by the vendor":_.actor?.id?`by ${_.actor.id}`:"by an app"},c_=(_)=>_.operation??_.op;function lZ(_){let Q=_.fields??{},J=Q.usage!==null&&typeof Q.usage==="object"?Q.usage:Q,q=(...Y)=>Y.map((H)=>J[H]??Q[H]).find((H)=>typeof H==="number"),U=[],G=q("prompt_tokens","input_tokens"),Z=q("completion_tokens","output_tokens"),F=q("total_tokens");if(G!==void 0)U.push(["tokens in",G.toLocaleString()]);if(Z!==void 0)U.push(["tokens out",Z.toLocaleString()]);if(F!==void 0)U.push(["tokens in all",F.toLocaleString()]);let X=q("cost_usd","cost");if(X!==void 0)U.push(["cost",`$${X<0.01?X.toPrecision(2):X.toFixed(2)}`]);return U}function l_({text:_,at:Q=280}){if(_.length<=Q)return $.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this);return $.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:[$.jsxDEV("span",{className:"text",children:[_.slice(0,Q),"…"]},void 0,!0,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:["show all ",_.length.toLocaleString()," characters"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function S0({v:_}){if(typeof _==="string")return $.jsxDEV(l_,{text:_},void 0,!1,void 0,this);if(_===null||typeof _!=="object")return $.jsxDEV("code",{children:String(_)},void 0,!1,void 0,this);let Q=JSON.stringify(_,null,2);return Q.length<=160?$.jsxDEV("code",{children:JSON.stringify(_)},void 0,!1,void 0,this):$.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:$.jsxDEV("code",{children:[JSON.stringify(_).slice(0,120),"…"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("pre",{children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var rZ=(_)=>typeof _==="string"?_:Array.isArray(_)?_.map((Q)=>Q&&typeof Q==="object"&&typeof Q.text==="string"?Q.text:"").filter(Boolean).join(`
36
- `):JSON.stringify(_??"");function iZ({body:_}){if(_===null||typeof _!=="object"||Array.isArray(_))return $.jsxDEV(S0,{v:_},void 0,!1,void 0,this);let Q=_,J=Array.isArray(Q.messages)?Q.messages:null,q=Object.entries(Q).filter(([U])=>!(J&&U==="messages"));return $.jsxDEV($.Fragment,{children:[q.length?$.jsxDEV("dl",{className:"fields",children:q.map(([U,G])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:U},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(S0,{v:G},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},U,!0,void 0,this))},void 0,!1,void 0,this):null,J?$.jsxDEV("ol",{className:"messages",children:J.map((U,G)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:"role",children:typeof U.role==="string"?U.role:"message"},void 0,!1,void 0,this),$.jsxDEV(l_,{text:rZ(U.content)},void 0,!1,void 0,this)]},G,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function r_({fields:_}){let Q=Object.entries(_??{});if(Q.length===0)return $.jsxDEV("p",{className:"mode",children:"No fields."},void 0,!1,void 0,this);return $.jsxDEV("dl",{className:"fields",children:Q.map(([J,q])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:J},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(S0,{v:q},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},J,!0,void 0,this))},void 0,!1,void 0,this)}var dZ=(_)=>_.receipt?`${_.receipt.status??""}${_.receipt.externalId?` · ${_.receipt.externalId}`:""}${_.receipt.reason?` · ${_.receipt.reason}`:""}`:_.operation==="observed"?"observed from the vendor":_.provenance==="placeholder"?"default data":"none: it has not left this World";function aZ(_){let Q=new Map,J=[],q=[],U=new Map;for(let G of _){if(G.entry.landsId||G.entry.aliasOf){q.push(G);continue}let Z={...G,copies:[]};if(J.push(Z),!Q.has(`${G.twin}:${G.entry.id}`))Q.set(`${G.twin}:${G.entry.id}`,Z);if(!U.has(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`))U.set(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`,Z)}for(let G of q){let Z=G.entry.landsId?Q.get(`${G.twin}:${G.entry.landsId}`):G.entry.aliasOf?U.get(`${G.twin}:${G.entry.subject.type}:${G.entry.aliasOf}`):void 0;if(Z)Z.copies.push(G);else J.push({...G,copies:[]})}return J.sort(p_)}var c6={deployed:5,confirmed:4,landed:3,replayed:2,skipped:1};function f_(_){let Q=[_.entry.receipt,..._.copies.map((U)=>U.entry.receipt)].filter((U)=>Boolean(U?.status));if(Q.length===0)return null;let J=Q.find((U)=>U.status==="failed"||U.status==="refused"),q=[...Q].sort((U,G)=>(c6[G.status]??0)-(c6[U.status]??0))[0];return J&&!(c6[q.status]>=5)?{status:J.status,bad:!0}:{status:q.status,bad:!1}}var P4=1280,N4=820,I_=160;function sZ({data:_}){let{world:Q,vendor:J,url:q,active:U,open:G,changed:Z}=_;return $.jsxDEV($.Fragment,{children:[$.jsxDEV(G_,{isVisible:!0,position:J1.Top,align:"start",className:"frame-label",children:[$.jsxDEV(b1,{vendor:J},void 0,!1,void 0,this),$.jsxDEV("span",{children:H1(J)},void 0,!1,void 0,this),Z?$.jsxDEV("a",{className:"frame-changed nodrag",href:`${X1}/${Q}/~/changes`,onClick:(F)=>{F.preventDefault(),R1([...Q.split("/"),"~","changes"])},title:`${k1(Z,"record")} changed here, not in a changeset: see them in Changes`,children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),Z]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:U?"frame on":"frame",style:{width:P4,height:N4},children:[$.jsxDEV("div",{className:"frame-bar",title:"Drag to move",children:[$.jsxDEV(b1,{vendor:J},void 0,!1,void 0,this),$.jsxDEV("strong",{children:H1(J)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"frame-url",children:q.replace(/^https?:\/\//,"")},void 0,!1,void 0,this),$.jsxDEV("a",{className:"nodrag",href:`${X1}/${Q}/~/screens/${J}`,onClick:(F)=>{F.preventDefault(),G(J)},children:"Open"},void 0,!1,void 0,this),$.jsxDEV("a",{className:"nodrag",href:q,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${H1(J)} in a new tab`,children:"↗"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:U?"frame-body nodrag nopan nowheel":"frame-body",children:$.jsxDEV("iframe",{title:`${J} screens`,src:q,loading:"lazy",style:{pointerEvents:U?"auto":"none"}},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var tZ={screen:sZ};function oZ(_){return $.jsxDEV(b6,{children:$.jsxDEV(nZ,{..._},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function nZ({name:_,token:Q,twins:J,session:q,retry:U,snapshot:G,back:Z}){let F=w1(Q,`/-/${_}/diff`),X=i.useMemo(()=>{let g={};if(F.state==="ok")for(let h of F.data.changes)(g[h.twin]??=new Set).add(`${h.entry.subject.type}:${h.entry.subject.id}`);return Object.fromEntries(Object.entries(g).map(([h,S])=>[h,S.size]))},[F]),Y=(g)=>X[g]??0,H=new Map((J.state==="ok"?J.data.twins:[]).flatMap((g)=>{let h=b_(_,g);return h?[[g.twin,h]]:[]})),K=[...H.keys()],L=`volter.canvas.${_}`,[z,W]=i.useState(null),[O,T]=i.useState(!0),B=T5(),w=i.useCallback((g)=>R1([..._.split("/"),"~","screens",g]),[_]),A=Math.max(1,Math.ceil(Math.sqrt(K.length))),R=i.useCallback(()=>{let g={};try{g=JSON.parse(localStorage.getItem(L)??"{}")}catch{}return K.map((h,S)=>({id:h,type:"screen",dragHandle:".frame-bar",position:g[h]??{x:S%A*(P4+I_),y:Math.floor(S/A)*(N4+I_)},data:{world:_,vendor:h,url:H.get(h),active:!1,open:w,changed:X[h]??0}}))},[K.join(","),_,A,w,X]),[I,C,P]=e9([]);i.useEffect(()=>{C(R())},[R,C]),i.useEffect(()=>{C((g)=>g.map((h)=>h.data.active===(h.id===z)?h:{...h,data:{...h.data,active:h.id===z}}))},[z,C]),i.useEffect(()=>{let g=(h)=>{if(h.key==="Escape")W(null)};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[]);let k=()=>{try{localStorage.setItem(L,JSON.stringify(Object.fromEntries(I.map((g)=>[g.id,g.position]))))}catch{}},N=(g)=>{W(g);let h=B.getNode(g);if(!h)return;let S=Math.min((window.innerWidth-300)/P4,(window.innerHeight-120)/N4,1);B.setCenter(h.position.x+P4/2-130/S,h.position.y+N4/2,{zoom:S,duration:400})},v=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,E=q.state==="ok"&&J.state==="ok";return $.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"Every vendor's screens",children:$.jsxDEV(n9,{nodes:E?I:[],onNodesChange:P,nodeTypes:tZ,onNodeDragStop:k,onNodeClick:(g,h)=>W(h.id),onPaneClick:()=>W(null),fitView:!0,fitViewOptions:{padding:{top:"64px",left:"272px",right:"32px",bottom:"32px"}},minZoom:0.05,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!1,zoomOnDoubleClick:!1,colorMode:v?"dark":"light",proOptions:{hideAttribution:!0},children:[$.jsxDEV(Q_,{variant:A0.Dots,gap:28,size:1.4},void 0,!1,void 0,this),$.jsxDEV(K2,{position:"top-left",className:"float layers",children:[$.jsxDEV("div",{className:"float-head",children:[$.jsxDEV("button",{type:"button",className:"back",onClick:Z,"aria-label":`Back to ${_}`,children:"←"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"float-title",children:[$.jsxDEV("strong",{children:_.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[_.split("/")[0],G?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ghost","aria-expanded":O,"aria-label":O?"Hide the screens list":"Show the screens list",onClick:()=>T(!O),children:O?"▾":"▸"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O?$.jsxDEV("ul",{className:"layer-list","aria-label":"Screens",children:K.map((g)=>$.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:z===g?"on":void 0,onClick:()=>N(g),children:[$.jsxDEV(b1,{vendor:g},void 0,!1,void 0,this),$.jsxDEV("span",{children:H1(g)},void 0,!1,void 0,this),Y(g)?$.jsxDEV("span",{className:"layer-changed",title:`${k1(Y(g),"record")} changed, not in a changeset`,children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),Y(g)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},g,!1,void 0,this))},void 0,!1,void 0,this):null,$.jsxDEV(g1,{load:J,what:"the vendors"},void 0,!1,void 0,this),q.state==="pending"?$.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,q.state==="error"?$.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",q.error," ",$.jsxDEV("button",{type:"button",onClick:U,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(K2,{position:"top-center",className:"float hint mode",children:z?`Using ${H1(z)} · Esc to leave`:"Drag to pan · scroll to zoom · click a screen to use it"},void 0,!1,void 0,this),$.jsxDEV($_,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),$.jsxDEV(U_,{pannable:!0,zoomable:!0,nodeBorderRadius:8,position:"bottom-right"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var i_=(_)=>_.actions.map((Q)=>({twin:Q.service,entry:{...Q.action,service:Q.service,op:Q.action.op??Q.action.operation??""}}));function k4(_){let Q=_.actions.length,J=_.applied?.receipts??[],q=_.deployed??[],U=new Set([...q.filter((F)=>F.status==="deployed"),...J.filter((F)=>F.status==="confirmed")].map((F)=>F.actionId)).size,G=new Set([...q.filter((F)=>F.status==="refused"||F.status==="failed"),...J.filter((F)=>F.status==="failed")].map((F)=>F.actionId)).size,Z={performed:U,failed:G,total:Q};if(Q>0&&U>=Q)return{label:"Deployed",tone:"done",...Z};if(U>0)return{label:`Partly deployed: ${U} of ${Q}`,tone:"warn",...Z};if(G>0)return{label:`${G} refused or failed`,tone:"bad",...Z};if(J.some((F)=>F.status==="replayed")&&J.every((F)=>F.status==="replayed"||F.status==="skipped"))return{label:"Pushed",tone:"good",...Z};return{label:"Not sent",tone:"plain",...Z}}var l6=(_)=>_.message??_.narration?.split(`
37
- `)[0]?.replace(/ setting .*$/,"")??_.name;function d_(_,Q=1){let J=_.currentHash??_.contentHash,q=_.readiness?.approvers??new Set(_.approvals.filter((G)=>G.contentHash===J).map((G)=>G.principal)).size,U=_.verification&&_.verification.contentHash===J?_.verification:null;if(U&&!U.passed)return{label:"Checks failed",tone:"bad"};if(q>0&&q<Q)return{label:`Approved by ${q} of ${Q}`,tone:"plain"};if(q>0)return{label:`Approved by ${q}`,tone:"good"};if(U)return{label:"Verified",tone:"good"};return{label:"Not verified",tone:"plain"}}function w_({name:_,token:Q,signsAs:J,c:q,canWrite:U,rooted:G,refused:Z,onChanged:F,part:X,required:Y}){let H=X==="head",K=X==="review",[L,z]=i.useState(null),[W,O]=i.useState(!1),[T,B]=i.useState(""),[w,A]=i.useState(""),[R,I]=i.useState(null),C=w1(Q,`/-/${_}/origin`),P=k4(q),k=d_(q,Y),N=i_(q),v=[...new Set(N.map((u)=>u.twin))],E=v.some((u)=>G.includes(u)),g=(u)=>u===(q.currentHash??q.contentHash),h=q.applied?.receipts??[],S=(q.deployed??[]).filter((u)=>u.status!=="landed"),b=h.filter((u)=>u.status==="confirmed").length,j=S.filter((u)=>u.status==="deployed"),x=async(u,s,t,a)=>{z(u),I(null);try{let d=await I1(Q,s,{method:"POST",...t===void 0?{}:{body:JSON.stringify(t)}});if(!d.ok)return Z(d),I({what:u,...v1(await P0(d))}),!1;if(a)u1(a);return F(),!0}catch(d){return I({what:u,text:`the World did not answer (${d instanceof Error?d.message:String(d)})`,acts:[]}),!1}finally{z(null)}},V=()=>{x("Verify",`/-/${_}/changesets/${q.name}/verify`,void 0,"Verified: the checks ran over it")},D=async(u)=>{if(u.preventDefault(),await x("Approve",`/-/${_}/changesets/${q.name}/approve`,{...T.trim()?{note:T.trim()}:{},...J===null&&w.trim()?{as:w.trim()}:{}},"Approved"))O(!1),B("")},f=async()=>{let u=v.filter((s)=>G.includes(s));if(!await B0({title:`Deploy ${q.name} to the real vendors?`,body:$.jsxDEV($.Fragment,{children:["It performs its ",q.actions.length," change",q.actions.length===1?"":"s"," against the real account",u.length===1?"":"s"," behind ",X2(u.map(H1)),". This cannot be taken back here."]},void 0,!0,void 0,this),action:"Deploy",danger:!0,typed:q.name}))return;z("Deploy"),I(null);try{let s=await I1(Q,`/-/${_}/deploy/${q.name}`,{method:"POST",body:JSON.stringify({confirm:q.name})});if(!s.ok){Z(s),I({what:"Deploy",...v1(await P0(s))});return}let t=await I1(Q,`/-/${_}/changesets/${q.name}`),a=t.ok?await t.json():null;if(!a){u1("Deploy: sent; reading its receipts failed","info"),F();return}let d=k4(a);u1(`Deploy: ${d.performed} of ${d.total} change${d.total===1?"":"s"} performed at the vendor${d.failed?`; ${d.failed} refused or failed`:""}`,d.failed?"error":d.performed?"ok":"info"),F()}catch(s){I({what:"Deploy",text:`the World did not answer (${s instanceof Error?s.message:String(s)})`,acts:[]})}finally{z(null)}},y=!U?"This session reads the World; it changes nothing":P.label==="Deployed"?"Already deployed: every change was performed at the vendor":null,p=C.state==="ok"&&C.data.origin?t6(C.data.origin):null;return $.jsxDEV("div",{className:"changeset","aria-labelledby":"changeset-title",children:[H?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"changeset-title",children:[q.message??q.name," ",$.jsxDEV("span",{className:`badge cs-${P.tone}`,children:P.label},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:`badge cs-${k.tone}`,children:k.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:q.name},void 0,!1,void 0,this)," · made ",$.jsxDEV(O1,{iso:q.createdAt},void 0,!1,void 0,this)," · ",q.actions.length," change",q.actions.length===1?"":"s"," at ",X2(v.map(H1))||"no vendor"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[$.jsxDEV("button",{type:"button",onClick:V,disabled:Boolean(y)||L!==null,title:y??"Replay it in a throwaway World and run the World's checks",children:L==="Verify"?"Verifying…":"Verify"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>O(!0),disabled:Boolean(y)||L!==null,title:y??"Sign its current contents as yourself",children:"Approve…"},void 0,!1,void 0,this),E?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>void f(),disabled:Boolean(y)||L!==null,title:y??"Perform it against the real accounts behind this World",children:L==="Deploy"?"Deploying…":"Deploy…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),y&&P.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:[y,"."]},void 0,!0,void 0,this):null,R?$.jsxDEV("div",{role:"alert",className:"refusal",children:[$.jsxDEV("span",{children:[$.jsxDEV("b",{children:R.what},void 0,!1,void 0,this),": ",R.text]},void 0,!0,void 0,this),R.acts.includes("verify")&&U?$.jsxDEV("button",{type:"button",onClick:V,disabled:L!==null,children:"Verify"},void 0,!1,void 0,this):null,R.acts.includes("approve")&&U?$.jsxDEV("button",{type:"button",onClick:()=>O(!0),disabled:L!==null,children:"Approve…"},void 0,!1,void 0,this):null,$.jsxDEV(k_,{name:_,acts:R.acts},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):null,K?$.jsxDEV($.Fragment,{children:[q.narration?$.jsxDEV("p",{className:"narration",children:q.narration},void 0,!1,void 0,this):null,$.jsxDEV("h4",{children:"Where it went"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"block where",children:[P.performed>0?$.jsxDEV("p",{className:"pad",children:[P.performed>=P.total?"Deployed":"Partly deployed",": ",P.performed," of ",P.total," change",P.total===1?"":"s"," performed at ",X2([...new Set([...j.map((u)=>u.service),...h.filter((u)=>u.status==="confirmed").map((u)=>u.service)].map(H1))]),j.length?` (${j.length} from here`:" (",j.length&&b?", ":"",b?`${b} by the remote`:"",")."]},void 0,!0,void 0,this):P.label==="Pushed"?$.jsxDEV("p",{className:"pad",children:["Pushed to the remote",p?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:p},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,q.applied?$.jsxDEV($.Fragment,{children:[" · ",$.jsxDEV(O1,{iso:q.applied.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,": every change was replayed there. No vendor has performed any of it."]},void 0,!0,void 0,this):P.failed===0?$.jsxDEV("p",{className:"pad",children:["Not sent: it is only in this World.",q.applied?.outcome==="refused"?" A push was refused (below); Push sends it again.":$.jsxDEV($.Fragment,{children:[" Push sends it to the remote World",E?"; Deploy, to the real vendors behind it":"","."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,P.failed>0?$.jsxDEV("p",{className:"pad failed",role:"alert",children:[P.failed," change",P.failed===1?" was":"s were"," refused or failed at the vendor",[...S.filter((u)=>u.reason&&(u.status==="refused"||u.status==="failed")).map((u)=>u.reason),...h.filter((u)=>u.status==="failed"&&u.error).map((u)=>u.error)].slice(0,3).map((u)=>`: ${v1(u).text}`).join(""),"."]},void 0,!0,void 0,this):null,q.applied?.refusal?.length?$.jsxDEV("ul",{className:"checks pad",children:q.applied.refusal.map((u,s)=>$.jsxDEV("li",{className:"mode",children:v1(u).text},s,!1,void 0,this))},void 0,!1,void 0,this):null,S.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the vendor"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:S.map((u)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:u.status==="refused"||u.status==="failed"?"badge cs-bad":u.status==="deployed"?"badge cs-done":"badge",children:u.status},void 0,!1,void 0,this)," ",H1(u.service)," ",u.status==="deployed"?u.url?$.jsxDEV("a",{href:u.url,target:"_blank",rel:"noopener noreferrer",children:u.externalId??u.url},void 0,!1,void 0,this):u.externalId?$.jsxDEV("code",{children:u.externalId},void 0,!1,void 0,this):null:null,u.reason?$.jsxDEV("span",{className:"mode",children:[" · ",v1(u.reason).text]},void 0,!0,void 0,this):null," ",$.jsxDEV("span",{className:"mode",children:["· ",$.jsxDEV(O1,{iso:u.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},`v:${u.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,h.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the remote"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:h.map((u)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:u.status==="failed"?"badge cs-bad":u.status==="confirmed"?"badge cs-done":"badge",children:u.status},void 0,!1,void 0,this)," ",H1(u.service)," ",$.jsxDEV("span",{className:"mode",children:u.status==="replayed"?"replayed at the remote World":u.status==="confirmed"?"performed at the vendor by the remote":""},void 0,!1,void 0,this),u.status==="confirmed"&&u.externalId?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:u.externalId},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,u.error?$.jsxDEV("span",{className:"mode",children:[" · ",v1(u.error).text]},void 0,!0,void 0,this):null]},`r:${u.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),!E&&P.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:["No vendor it changes is connected to its real service here, so it does not deploy from this World. ",$.jsxDEV("a",{href:`${X1}/${_}/~/settings/services`,onClick:(u)=>{u.preventDefault(),R1([..._.split("/"),"~","settings","services"])},children:"Connect a vendor in Settings › Real services"},void 0,!1,void 0,this)," to deploy."]},void 0,!0,void 0,this):null,$.jsxDEV("h4",{children:"Checks"},void 0,!1,void 0,this),!q.verification?$.jsxDEV("p",{className:"mode",children:"Not verified yet. Verify replays it in a throwaway World and runs this World's checks over the result."},void 0,!1,void 0,this):$.jsxDEV("div",{className:g(q.verification.contentHash)?"":"stale",children:[$.jsxDEV("p",{children:[q.verification.passed?"✓ Passed":"✗ Failed"," · ",$.jsxDEV(O1,{iso:q.verification.at},void 0,!1,void 0,this),g(q.verification.contentHash)?null:$.jsxDEV("span",{className:"mode",children:" · on an earlier version of it: verify again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.verification.results.length?$.jsxDEV("ul",{className:"checks",children:q.verification.results.map((u)=>$.jsxDEV("li",{children:[u.passed?"✓":"✗"," ",$.jsxDEV("code",{children:u.id},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:H1(u.service)},void 0,!1,void 0,this)]},u.id,!0,void 0,this))},void 0,!1,void 0,this):null,q.verification.refusals?.length?$.jsxDEV("ul",{className:"checks",children:q.verification.refusals.map((u,s)=>$.jsxDEV("li",{children:["✗ ",$.jsxDEV("code",{children:u.check},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[H1(u.service),": ",u.reason]},void 0,!0,void 0,this)]},s,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("h4",{children:"Approvals"},void 0,!1,void 0,this),q.approvals.length===0?$.jsxDEV("p",{className:"mode",children:"No one has approved it."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"approvals",children:q.approvals.map((u,s)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:u.principal},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(O1,{iso:u.at},void 0,!1,void 0,this),g(u.contentHash)?"":" · signed an earlier version"]},void 0,!0,void 0,this),u.note?$.jsxDEV("div",{className:"mode",children:["“",u.note,"”"]},void 0,!0,void 0,this):null]},s,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(t1,{open:W,onClose:()=>{if(!L)O(!1)},title:`Approve ${q.name}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>O(!1),disabled:L!==null,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"approve-changeset",className:"primary",disabled:L!==null,children:L==="Approve"?"Approving…":"Approve"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"approve-changeset",onSubmit:(u)=>void D(u),className:"stack",children:[$.jsxDEV("p",{className:"mode",children:["You sign its contents as they stand now",J?$.jsxDEV($.Fragment,{children:[", recorded as ",$.jsxDEV("b",{children:J},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,". A later change to it shows your approval as for an earlier version."]},void 0,!0,void 0,this),J===null?$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Approving as"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"approveAs",value:w,onChange:(u)=>A(u.target.value),maxLength:80,required:!0,placeholder:"your name or email",autoComplete:"off"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"This World was opened with its token, which names no person: the approval records the name you give."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Note ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("textarea",{name:"approveNote",value:T,onChange:(u)=>B(u.target.value),rows:3,maxLength:500},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var a_=(_,Q)=>JSON.stringify(_)===JSON.stringify(Q);function eZ({changes:_,idPrefix:Q}){let J=[...new Set(_.map((q)=>q.twin))];return $.jsxDEV($.Fragment,{children:J.map((q)=>{let U=_.filter((Z)=>Z.twin===q).map((Z)=>Z.entry),G=[...new Set(U.map((Z)=>`${Z.subject.type}:${Z.subject.id}`))];return $.jsxDEV("div",{className:"compare",role:"group","aria-labelledby":`${Q}-${q}`,children:[$.jsxDEV("h3",{id:`${Q}-${q}`,className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:q},void 0,!1,void 0,this),H1(q)," ",$.jsxDEV("span",{className:"mode",children:["· ",k1(G.length,"record"),", ",k1(U.length,"write")]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:G.map((Z)=>{let F=U.filter((K)=>`${K.subject.type}:${K.subject.id}`===Z),X=F[F.length-1],Y=Z0(X),H={};return $.jsxDEV("li",{className:"record",children:[$.jsxDEV("p",{className:"record-head",children:[$.jsxDEV("span",{className:"kind",children:X.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")},void 0,!1,void 0,this)," ",Y.label?$.jsxDEV("span",{className:"label",children:["“",Y.label,"”"]},void 0,!0,void 0,this):null," ",$.jsxDEV("code",{children:c0(X)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.map((K)=>{let L=K.fields??{},z=Object.entries(L).filter(([O,T])=>!(O in H)||!a_(H[O],T)),W=H;return H={...H,...L},$.jsxDEV("div",{className:"write",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"op",children:Z0(K).what},void 0,!1,void 0,this)," · ",$.jsxDEV(O1,{iso:K.occurredAt},void 0,!1,void 0,this)," · ",w5(K)]},void 0,!0,void 0,this),z.length===0?$.jsxDEV("p",{className:"mode",children:"It set no field to a new value."},void 0,!1,void 0,this):$.jsxDEV("dl",{className:"fields field-diff","aria-label":`Fields ${Z0(K).what} set`,children:z.map(([O,T])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:O},void 0,!1,void 0,this),$.jsxDEV("dd",{children:O in W?$.jsxDEV("span",{className:"changed",children:[$.jsxDEV("del",{children:$.jsxDEV(S0,{v:W[O]},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"arrow","aria-label":"becomes",children:"→"},void 0,!1,void 0,this),$.jsxDEV("ins",{children:$.jsxDEV(S0,{v:T},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV(S0,{v:T},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},O,!0,void 0,this))},void 0,!1,void 0,this)]},K.id,!0,void 0,this)})]},Z,!0,void 0,this)})},void 0,!1,void 0,this)]},q,!0,void 0,this)})},void 0,!1,void 0,this)}function _F({name:_,token:Q,changes:J,canWrite:q,refused:U,onCut:G,pinned:Z,generated:F,inputRef:X,author:Y}){let[H,K]=i.useState(""),[L,z]=i.useState(!1),[W,O]=i.useState([]),T=(w,A,R)=>{O((I)=>[{ok:w,text:A,at:new Date().toISOString(),n:++C5,...R?.length?{acts:R}:{}},...I].slice(0,4))},B=async(w)=>{w.preventDefault(),z(!0);try{let A=await I1(Q,`/-/${_}/changesets`,{method:"POST",body:JSON.stringify(H.trim()?{message:H.trim()}:{})});if(!A.ok){U(A);let I=v1(await P0(A));T(!1,`Cut a changeset: ${I.text}`,I.acts);return}let R=await A.json();T(!0,`Cut ${R.name??"a changeset"}: ${k1(R.actions?.length??0,"change")}, ready to review in History and push.`),K(""),G()}catch(A){T(!1,`Cut a changeset: the World did not answer (${A instanceof Error?A.message:String(A)})`)}finally{z(!1)}};if(Z){let w=!q?"This session reads the World; it changes nothing":J===0?"Nothing to cut: no change is outside a changeset":null;return $.jsxDEV("div",{className:"ws-cut",children:[$.jsxDEV(l0,{log:W,name:_},void 0,!1,void 0,this),$.jsxDEV("form",{onSubmit:(A)=>void B(A),"aria-label":"Cut a changeset",children:[Y?$.jsxDEV("a",{className:"ws-author",href:Y.account,title:`${Y.who}: your account`,onClick:(A)=>{A.preventDefault(),R1(Y.account.slice(X1.length+1).split("/"))},children:Y.face},void 0,!1,void 0,this):null,$.jsxDEV("input",{ref:X,name:"changesetMessage","aria-label":"Summary",value:H,onChange:(A)=>K(A.target.value),placeholder:J===0?"Nothing to cut":F?"Summary (optional)":"Summary (required)",required:!F,maxLength:200,disabled:Boolean(w),title:w??void 0},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(w)||L,title:w??void 0,children:L?"Cutting…":J===0?"Cut a changeset":$.jsxDEV($.Fragment,{children:["Cut ",k1(J,"change"),Y?$.jsxDEV($.Fragment,{children:[" on ",$.jsxDEV("b",{children:Y.branch},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}if(!q||J===0)return $.jsxDEV(l0,{log:W,name:_},void 0,!1,void 0,this);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("form",{className:"block cut pad",onSubmit:(w)=>void B(w),"aria-label":"Cut a changeset",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Cut ",J===1?"this change":`these ${J} changes`," into a changeset: what it does and why"]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"changesetMessage",value:H,onChange:(w)=>K(w.target.value),placeholder:"Welcome email for new sign-ups",required:!0,maxLength:200,disabled:J===0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:L||J===0,children:L?"Cutting…":"Cut a changeset"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(l0,{log:W,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function QF({name:_,token:Q}){let[J,q]=i.useState(0),U=w1(Q,`/-/${_}/keys`,J),[G,Z]=i.useState(!1),[F,X]=i.useState(""),[Y,H]=i.useState("write"),[K,L]=i.useState(!1),[z,W]=i.useState(null),[O,T]=i.useState(null),[B,w]=i.useState(null),A=async()=>{let C=`Read-only link · ${new Date().toLocaleDateString(void 0,{month:"short",day:"numeric"})}`,P=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:C,scope:"read"})}).catch(()=>null),k=P?await P.json().catch(()=>({})):{error:`${T1} did not answer`};if(!P?.ok||!k.key){u1(k.error?v1(k.error).text:"refused","error");return}w(`${window.location.origin}${X1}/${_}#${new URLSearchParams({token:k.key}).toString()}`),q((N)=>N+1)},R=async(C)=>{C.preventDefault(),L(!0),W(null);let P=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:F.trim(),scope:Y})}).catch(()=>null);L(!1);let k=P?await P.json().catch(()=>({})):{error:`${T1} did not answer`};if(!P?.ok||!k.key){W(k.error?v1(k.error).text:"refused");return}Z(!1),T({key:k.key,name:F.trim()}),X(""),q((N)=>N+1)},I=async(C)=>{if(!await B0({title:`Revoke ${C.name}?`,body:"Whatever holds it loses this World at once.",action:"Revoke key",danger:!0}))return;let P=await I1(Q,`/-/${_}/keys/${C.id}`,{method:"DELETE"});if(P.ok)u1(`Revoked ${C.name}`);else u1(await J0(P),"error");q((k)=>k+1)};return $.jsxDEV("section",{"aria-labelledby":"keys-head",className:"keys",children:[$.jsxDEV("div",{className:"keys-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"keys-head",children:"Keys"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"What an app, a script or a CI job holds to reach this World: each named for what holds it and revoked alone. People open the World as themselves; keys are for software."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),p1()?$.jsxDEV("a",{className:"button primary",href:`${p1()}/${encodeURIComponent(_.split("/")[0]??"")}`,children:"Make a key on the platform"},void 0,!1,void 0,this):$.jsxDEV("div",{className:"head-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>void A(),children:"Share a read-only link"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{W(null),Z(!0)},children:"Make a key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:U,what:"the keys",retry:()=>q((C)=>C+1)},void 0,!1,void 0,this),U.state==="ok"?U.data.keys.length===0?$.jsxDEV("p",{className:"mode",children:"No keys yet. The World's own token opens it too."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"dense","aria-label":"Keys",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"For"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Access"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last used"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:U.data.keys.map((C)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:C.name},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.person??$.jsxDEV("span",{className:"mode",title:"It acts as itself: a service",children:"no one: a service"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.scope==="write"?"Read and write":"Read only"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:$.jsxDEV("span",{title:E6(C.createdAt),children:x6(C.createdAt)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:C.lastUsedAt?x6(C.lastUsedAt):"never"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:$.jsxDEV(z_,{label:`More for ${C.name}`,items:[{label:"Revoke…",danger:!0,onSelect:()=>void I(C)}]},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},C.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(t1,{open:G,onClose:()=>{if(!K)Z(!1)},title:"Make a key",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>Z(!1),disabled:K,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"make-key",disabled:K||!F.trim(),children:K?"Making…":"Make key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"make-key",onSubmit:R,"aria-label":"Make a key",children:[$.jsxDEV("label",{children:["Name ",$.jsxDEV("input",{autoFocus:!0,name:"keyName",value:F,onChange:(C)=>X(C.target.value),placeholder:"ci, staging app…",maxLength:80,required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:["Access ",$.jsxDEV("select",{value:Y,onChange:(C)=>H(C.target.value==="read"?"read":"write"),children:[$.jsxDEV("option",{value:"write",children:"Read and write"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"read",children:"Read only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z?$.jsxDEV("p",{role:"alert",children:z},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(t1,{open:Boolean(O),onClose:()=>T(null),title:`${O?.name??"The key"} is ready`,footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>T(null),children:"Done"},void 0,!1,void 0,this),children:[$.jsxDEV("p",{className:"mode",children:"Copy it now: it is shown this once. Put it where the app reads its secrets."},void 0,!1,void 0,this),O?$.jsxDEV(g6,{label:"Key",value:O.key,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:Boolean(B),onClose:()=>w(null),title:"A read-only link",footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>w(null),children:"Done"},void 0,!1,void 0,this),children:[$.jsxDEV("p",{className:"mode",children:"Whoever opens it sees this World's pages and changes nothing. Copy it now: it is shown this once. It is listed under Keys, where revoking it closes the link at once."},void 0,!1,void 0,this),B?$.jsxDEV(g6,{label:"Link",value:B,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var C5=0;function l0({log:_,name:Q}){if(_.length===0)return null;return $.jsxDEV("ul",{className:"narration-log",role:"status","aria-live":"polite",children:_.map((J)=>$.jsxDEV("li",{className:J.ok?"ok":"bad",children:[$.jsxDEV("span",{className:"mode",children:$.jsxDEV(O1,{iso:J.at,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",J.text,J.acts?$.jsxDEV(k_,{name:Q,acts:J.acts},void 0,!1,void 0,this):null]},J.n,!0,void 0,this))},void 0,!1,void 0,this)}function s_(_,Q,J,q){let[U,G]=i.useState(0),Z=U*1e5+Math.floor(J/2),F=w1(Q,`/-/${_}/origin`,Z),X=w1(Q,`/-/${_}/diff`,Z),Y=w1(Q,`/-/${_}/changesets`,Z),[H,K]=i.useState([]),[L,z]=i.useState(null),W=(I,C,P)=>{if(K((k)=>[{ok:I,text:C,at:new Date().toISOString(),n:++C5,...P?.length?{acts:P}:{}},...k].slice(0,8)),!I)u1(C,"error")},O=async(I,C,P)=>{z(I);try{let k=await I1(Q,`/-/${_}/${C}`,P);if(!k.ok){q(k);let N=v1(await P0(k));return W(!1,`${I}: ${N.text}`,N.acts),null}return await k.json()}catch(k){return W(!1,`${I}: the World did not answer (${k instanceof Error?k.message:String(k)})`),null}finally{z(null),G((k)=>k+1)}},T=F.state==="ok"&&F.data.origin?t6(F.data.origin):null,B=X.state==="ok"?X.data.changes.length:null,w=Y.state==="ok"?hZ(Y.data.changesets).sort((I,C)=>I.createdAt.localeCompare(C.createdAt)):[];return{origin:F,diff:X,sets:Y,there:T,changes:B,waiting:w,log:H,busy:L,say:W,send:O,push:async()=>{let I=await O("Push","origin/push",{method:"POST"});if(!I)return;if(I.pushed.length===0){W(!0,"Nothing to push: every changeset is already at the remote.");return}for(let C of I.pushed){let P=C.receipts??[],k=P.filter((h)=>h.status==="replayed").length,N=P.filter((h)=>h.status==="confirmed").length,v=P.filter((h)=>h.status==="failed").length,E=C.outcome==="applied"&&v===0;if(C.outcome==="refused"){W(!1,`Push of ${C.changeset} was refused${C.refusal?.length?`: ${C.refusal.map((h)=>v1(h).text).join("; ")}`:""}.`);continue}let g=[`${k} of ${k1(P.length,"change")} replayed there`,...N?[`${N} performed at the vendor by the remote`]:[],...v?[`${v} failed`]:[]];W(E,`${C.outcome==="partial"?"Partly pushed":"Pushed"} ${C.changeset} to ${T??"the remote"}: ${g.join("; ")}${C.refusal?.length?` (${C.refusal.map((h)=>v1(h).text).join("; ")})`:""}.`)}},pull:async()=>{let I=await O("Pull","origin/pull",{method:"POST"});if(!I)return;let C=Object.entries(I.appended).filter(([,k])=>k>0),P=I.rebased.flatMap((k)=>k.conflicts.map((N)=>`${H1(k.twin)} ${N.subject.type}:${N.subject.id} ${N.field}`));W(P.length===0,`Pulled from ${T??"the remote"}: ${C.length?C.map(([k,N])=>`${k1(N,"entry")} at ${H1(k)}`).join(", "):"nothing new"}${P.length?`; conflicts at ${P.join(", ")}`:""}.`)}}}function JF({name:_,token:Q,canWrite:J,tick:q,refused:U}){let{origin:G,there:Z,changes:F,log:X,busy:Y,say:H,send:K,push:L,pull:z}=s_(_,Q,q,U),[W,O]=i.useState(""),[T,B]=i.useState(""),[w,A]=i.useState(!1),R=async(C)=>{C.preventDefault();let P=await K("Name the remote","origin",{method:"PUT",body:JSON.stringify({url:W.trim(),token:T.trim()})});if(P){let k=Object.values(P.appended??{}).reduce((N,v)=>N+v,0);H(!0,`The remote is ${t6(P.origin)}: its history came in (${k1(k,"entry")}).`),B(""),A(!1)}},I=!J?"This session reads the World; it changes nothing":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"block remote",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{children:"Origin"},void 0,!1,void 0,this),J?$.jsxDEV("button",{type:"button",onClick:()=>{O(Z??""),A(!w)},"aria-expanded":w,children:Z?"Change the remote…":"Name a remote…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"pad",children:[G.state==="ok"?Z?$.jsxDEV("p",{children:[$.jsxDEV("code",{className:"big",children:Z},void 0,!1,void 0,this),G.data.origin?.fetchedAt?$.jsxDEV("span",{className:"mode",children:[" · last fetched ",$.jsxDEV(O1,{iso:G.data.origin.fetchedAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("p",{children:"No remote — this World keeps its default data. Name one to push its changesets to a shared World and pull what others pushed there."},void 0,!1,void 0,this):$.jsxDEV(g1,{load:G,what:"the remote",lines:1},void 0,!1,void 0,this),w?$.jsxDEV("form",{className:"stack origin-form",onSubmit:(C)=>void R(C),"aria-label":"Name the remote",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The World's address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originUrl",value:W,onChange:(C)=>O(C.target.value),placeholder:"https://worlds.example.com/acme/team",required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"A key or token that opens it"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originToken",type:"password",value:T,onChange:(C)=>B(C.target.value),required:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Naming it brings its history in. Your pushes are recorded there as whoever this key was made for, or as the key itself."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Y!==null,children:Y==="Name the remote"?"Bringing its history in…":"Save the remote"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>A(!1),children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(l0,{log:X,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function $F({name:_,token:Q,canWrite:J,refused:q}){let[U,G]=i.useState(0),Z=w1(Q,`/-/${_}/twins`,U),F=w1(Q,`/-/${_}/links`,U),X=w1(Q,`/-/${_}/requests?hours=24`,U),[Y,H]=i.useState({}),[K,L]=i.useState(null),[z,W]=i.useState(""),[O,T]=i.useState(!1),[B,w]=i.useState([]),A=(N,v,E)=>{if(w((g)=>[{ok:N,text:v,at:new Date().toISOString(),n:++C5,...E?.length?{acts:E}:{}},...g].slice(0,6)),!N)u1(v,"error")},R=F.state==="ok"?Object.keys(F.data.links).sort():[];i.useEffect(()=>{let N=!0;return Promise.all(R.map(async(v)=>{let E=await I1(Q,`/-/${_}/twins/${v}/credential`).catch(()=>null),g=E?.ok?await E.json():null;return[v,g?.credential??null]})).then((v)=>{if(N)H(Object.fromEntries(v))}),()=>{N=!1}},[_,Q,R.join(","),U]);let I=async(N)=>{if(N.preventDefault(),!K||!z)return;T(!0);let v=await I1(Q,`/-/${_}/twins/${K.vendor}/credential`,{method:"PUT",body:z,headers:{"content-type":"text/plain"}}).catch(()=>null);if(T(!1),!v){A(!1,`Seal ${K.vendor}: ${T1} did not answer`);return}if(!v.ok){q(v);let g=v1(await P0(v));A(!1,`Seal ${H1(K.vendor)}: ${g.text}`,g.acts);return}let E=await v.json().catch(()=>({}));A(!0,`Sealed a credential for ${H1(K.vendor)}${E.fingerprint?` (${E.fingerprint})`:""}: it opens for ${E.boundTo??K.to} only, and is never shown again.`),W(""),L(null),G((g)=>g+1)},C=async(N)=>{if(!await B0({title:`Remove the link ${N}?`,body:`Requests to ${W2}/${_}/${N}/… stop being forwarded to ${F.state==="ok"?F.data.links[N]?.origin:"its origin"}.`,action:"Remove link",danger:!0}))return;let v=await I1(Q,`/-/${_}/links/${N}`,{method:"DELETE"}).catch(()=>null);if(!v?.ok){if(v)q(v);A(!1,`Remove ${N}: ${v?await J0(v):"the World did not answer"}`);return}A(!0,`Removed the link ${N}.`),G((E)=>E+1)},P=(N)=>N?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge rooted",children:"sealed"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[N.fingerprint?$.jsxDEV("code",{children:N.fingerprint},void 0,!1,void 0,this):null," · ",$.jsxDEV(O1,{iso:N.placedAt},void 0,!1,void 0,this),N.sealedBy?` · by ${N.sealedBy==="vault"?"the vault":"the host's key"}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("span",{className:"mode",children:"none"},void 0,!1,void 0,this),k=Z.state==="ok"?Z.data.twins:[];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"lede",children:"A real vendor's credential lives in one place, sealed: beside this World, bound to where it goes. It is never readable back; this page says only that one is sealed, when, by what, and for where."},void 0,!1,void 0,this),$.jsxDEV(l0,{log:B,name:_},void 0,!1,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"creds-head",children:[$.jsxDEV("div",{className:"block-head",children:$.jsxDEV("h3",{id:"creds-head",children:"Vendors"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(g1,{load:Z,what:"the vendors"},void 0,!1,void 0,this),Z.state==="ok"?$.jsxDEV("table",{className:"dense","aria-label":"Credentials by vendor",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Bound to"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:k.map((N)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:N.twin},void 0,!1,void 0,this),H1(N.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P(N.credential)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.credential?.boundTo?$.jsxDEV("code",{children:N.credential.boundTo},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.root?.url?$.jsxDEV("code",{children:N.root.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"none: a stand-in"},void 0,!1,void 0,this)},void 0,!1,void 0,this),J?$.jsxDEV("td",{className:"num",children:$.jsxDEV("button",{type:"button",disabled:!N.root?.url,title:N.root?.url?`Seal ${H1(N.twin)}'s real credential for ${N.root.url}`:"Connect it to its real service first (Settings › Real services): a credential is sealed for where it goes",onClick:()=>{W(""),L({vendor:N.twin,to:N.root.url})},children:N.credential?"Replace…":"Seal a credential…"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},N.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Z.state==="ok"&&k.every((N)=>!N.root?.url)?$.jsxDEV("p",{className:"mode pad",children:"No vendor here has a real service behind it, so none holds a credential. Connect one in Settings › Real services; its credential is sealed here."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"links-head",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{id:"links-head",children:"Links"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"a vendor with no twin, forwarded with its sealed credential"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:F,what:"the links"},void 0,!1,void 0,this),X.state==="ok"&&(X.data.journalFailures??0)>0?$.jsxDEV("p",{className:"mode pad",role:"alert",children:[X.data.journalFailures," request ",X.data.journalFailures===1?"line was":"lines were"," not kept by this World's server since it started (its links, and the twins it runs in its own process): those requests are missing from what this page counts."]},void 0,!0,void 0,this):null,F.state==="ok"&&R.length===0?$.jsxDEV("p",{className:"mode pad",children:["No links. A link forwards requests for a vendor with no twin here, at ",$.jsxDEV("code",{children:[W2,"/",_,"/<link>/…"]},void 0,!0,void 0,this),", to that vendor's real API with the credential sealed for it."]},void 0,!0,void 0,this):null,R.length?$.jsxDEV("table",{className:"dense","aria-label":"Links",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Link"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Origin"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:"Requests, 24h"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:R.map((N)=>{let v=F.state==="ok"?F.data.links[N].origin:"",E=X.state==="ok"?X.data.twins.find((g)=>g.twin===N):void 0;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("b",{children:N},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("code",{children:v},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:E?$.jsxDEV("span",{title:Object.entries(E.byStatus).map(([g,h])=>`${g}: ${h}`).join(" · "),children:E.requests},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:[P(Y[N]??null),Y[N]?.boundTo?$.jsxDEV("div",{className:"mode",children:["bound to ",$.jsxDEV("code",{children:Y[N].boundTo},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),J?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{W(""),L({vendor:N,to:v})},children:Y[N]?"Replace…":"Seal a credential…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void C(N),children:"Remove…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},N,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:Boolean(K),onClose:()=>{if(!O)L(null)},title:`Seal ${K?H1(K.vendor):""}'s credential`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>L(null),disabled:O,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"seal-credential",className:"primary",disabled:O||!z,children:O?"Sealing…":"Seal it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"seal-credential",className:"stack",onSubmit:(N)=>void I(N),children:[$.jsxDEV("p",{className:"mode",children:["It is sealed for ",$.jsxDEV("code",{children:K?.to},void 0,!1,void 0,this)," and opens there only. It is never shown again, here or anywhere."]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real key"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"credential",type:"password",value:z,onChange:(N)=>W(N.target.value),autoComplete:"off",required:!0,autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function qF({name:_,token:Q,admin:J,canWrite:q,refused:U,onRemoved:G,only:Z}){let F=(V)=>!Z||Z===V,[X,Y]=i.useState(0),H=w1(Q,`/-/${_}/twins`,X),K=w1(Q,`/-/${_}/checks`,X),[L,z]=i.useState(0),W=w1(Q,`/-/${_}/clock`,L),[O,T]=i.useState([]),[B,w]=i.useState(null),[A,R]=i.useState(null),[I,C]=i.useState(""),[P,k]=i.useState("gated"),[N,v]=i.useState(!1),E=(V,D,f)=>{if(T((y)=>[{ok:V,text:D,at:new Date().toISOString(),n:++C5,...f?.length?{acts:f}:{}},...y].slice(0,6)),!V)u1(D,"error")},g=async(V,D,f)=>{let y=await I1(Q,D,f).catch(()=>null);if(!y)return E(!1,`${V}: the World did not answer`),!1;if(!y.ok){U(y);let p=v1(await P0(y));return E(!1,`${V}: ${p.text}`,p.acts),!1}return E(!0,`${V}: done.`),Y((p)=>p+1),!0},h=async(V)=>{if(V.preventDefault(),!A)return;v(!0);let D=A.root??{},f=await g(I.trim()?`Connect ${H1(A.twin)} to ${I.trim()}`:`Disconnect ${H1(A.twin)}`,`/-/${_}/twins/${A.twin}/root`,{method:"PUT",body:JSON.stringify(I.trim()?{...D,url:I.trim(),deploy:P}:null)});if(v(!1),f)R(null)},S=async()=>{if(!await B0({title:`Rotate the tokens of ${_}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let V=await I1(J,`/-/worlds/${_}/rotate`,{method:"POST"});if(V.ok)w(await V.json()),E(!0,"Rotated: the new tokens are shown once, below.");else E(!1,`Rotate: ${await J0(V)}`)},b=async()=>{if(!await B0({title:`Remove ${_}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:_}))return;let V=await I1(J,`/-/worlds/${_}`,{method:"DELETE"}).catch((D)=>D);if(V instanceof Error){E(!1,`Remove: the host did not answer (${V.message})`);return}if(V.ok)G();else E(!1,`Remove: ${await J0(V)}`)},j=H.state==="ok"?H.data.twins:[],x={gated:"gated: a person deploys an approved changeset",auto:"auto: a push deploys at once",hold:"hold: nothing deploys"};return $.jsxDEV($.Fragment,{children:[$.jsxDEV(l0,{log:O,name:_},void 0,!1,void 0,this),F("access")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Access"},void 0,!1,void 0,this),q?$.jsxDEV(QF,{name:_,token:Q},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"This session reads the World: its keys are managed by whoever holds its token."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("services")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Real services"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:[j.some((V)=>V.root?.url)?null:"Every vendor here is a stand-in. ","Connect a vendor to its real service to read the real state into this World; its real credential is sealed in the Vault, and an approved changeset deploys there by its policy."]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:H,what:"the vendors"},void 0,!1,void 0,this),H.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Real services",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last read from it"},void 0,!1,void 0,this),q?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:j.map((V)=>{let D=V.root;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:V.twin},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/${V.twin}`,title:`Its log and stored state · ${V.position??0} entries`,onClick:(f)=>{f.preventDefault(),R1([..._.split("/"),V.twin])},children:H1(V.twin)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:D?.url?$.jsxDEV("code",{children:D.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"not connected"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:D?.url?x[D.deploy??""]??D.deploy??"—":"—"},void 0,!1,void 0,this),$.jsxDEV("td",{children:V.refresh?.failed?$.jsxDEV("span",{role:"alert",children:["failed ×",V.refresh.failed.count??1,": ",V.refresh.failed.reason??""]},void 0,!0,void 0,this):D?.url?E6(V.refresh?.observedAt??V.refresh?.at):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{C(D?.url??""),k(D?.deploy==="auto"||D?.deploy==="hold"?D.deploy:"gated"),R(V)},children:D?.url?"Change…":"Connect…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",disabled:!D?.url,title:D?.url?"Read the real service's current state into this World":"Connect it first",onClick:()=>void B0({title:`Read ${H1(V.twin)} now?`,body:`The real ${H1(V.twin)}'s current state is read into this World. Nothing is written to ${H1(V.twin)}.`,action:"Read from it"}).then((f)=>{if(f)g(`Read from ${H1(V.twin)}`,`/-/${_}/twins/${V.twin}/refresh`,{method:"POST"})}),children:"Read from it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},V.twin,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,F("clock")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Clock"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"The instant every vendor here stamps from. Set it and move it forward to see what happens later: renewals, expiries, scheduled sends."},void 0,!1,void 0,this),$.jsxDEV(xZ,{name:_,token:Q,clock:W,canWrite:q,onChanged:()=>z((V)=>V+1),refused:U,open:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("checks")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Checks"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"JavaScript the World runs over every change before it is performed (a changeset's Verify runs them too)."},void 0,!1,void 0,this),$.jsxDEV(g1,{load:K,what:"the checks"},void 0,!1,void 0,this),K.state==="ok"?K.data.checks.length===0?$.jsxDEV("p",{className:"mode",children:"No checks: every change is performed as it comes."},void 0,!1,void 0,this):$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Checks",children:$.jsxDEV("tbody",{children:K.data.checks.map((V)=>$.jsxDEV("tr",{children:$.jsxDEV("td",{children:$.jsxDEV("code",{children:V},void 0,!1,void 0,this)},void 0,!1,void 0,this)},V,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,J&&!Z?$.jsxDEV("div",{className:"danger",role:"region","aria-label":"Danger zone",children:[$.jsxDEV("h3",{children:"Danger zone"},void 0,!1,void 0,this),B?$.jsxDEV("p",{role:"status",children:["token ",$.jsxDEV("code",{children:B.token},void 0,!1,void 0,this)," · read token ",$.jsxDEV("code",{children:B.readToken},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void S(),children:"Rotate tokens"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"New tokens for this World; every app, script and browser using the old ones is signed out."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void b(),children:"Remove world"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"Deletes this World and everything in it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(t1,{open:Boolean(A),onClose:()=>{if(!N)R(null)},title:`Connect ${A?H1(A.twin):""} to its real service`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>R(null),disabled:N,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"connect-root",className:"primary",disabled:N,children:N?"Saving…":I.trim()?"Connect":"Disconnect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"connect-root",className:"stack",onSubmit:(V)=>void h(V),children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real service's API address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"rootUrl",value:I,onChange:(V)=>C(V.target.value),placeholder:"https://api.openai.com",autoFocus:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Empty disconnects it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"rootDeploy",value:P,onChange:(V)=>k(V.target.value==="auto"?"auto":V.target.value==="hold"?"hold":"gated"),children:["gated","auto","hold"].map((V)=>$.jsxDEV("option",{value:V,children:x[V]},V,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function pB(){return $.jsxDEV($.Fragment,{children:[$.jsxDEV(IZ,{},void 0,!1,void 0,this),$.jsxDEV(L_,{},void 0,!1,void 0,this),$.jsxDEV(Y_,{},void 0,!1,void 0,this),$.jsxDEV(X_,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{gB as openAt,P5 as ROOT,pB as ConsolePage};
33
+ `)),X=Y.reduce((K,L)=>K.concat(...L),[]);return[Y,X]}return[[],[]]},[_]);return r.useEffect(()=>{let H=Q?.target??e7,Y=Q?.actInsideInputWithModifier??!0;if(_!==null){let X=(z)=>{if(U.current=z.ctrlKey||z.metaKey||z.shiftKey||z.altKey,(!U.current||U.current&&!Y)&&R6(z))return!1;let O=Q9(z.code,F);if(G.current.add(z[O]),_9(Z,G.current,!1)){let T=z.composedPath?.()?.[0]||z.target,B=T?.nodeName==="BUTTON"||T?.nodeName==="A";if(Q.preventDefault!==!1&&(U.current||!B))z.preventDefault();q(!0)}},K=(z)=>{let W=Q9(z.code,F);if(_9(Z,G.current,!0))q(!1),G.current.clear();else G.current.delete(z[W]);if(z.key==="Meta")G.current.clear();U.current=!1},L=()=>{G.current.clear(),q(!1)};return H?.addEventListener("keydown",X),H?.addEventListener("keyup",K),window.addEventListener("blur",L),window.addEventListener("contextmenu",L),()=>{H?.removeEventListener("keydown",X),H?.removeEventListener("keyup",K),window.removeEventListener("blur",L),window.removeEventListener("contextmenu",L)}}},[_,q]),J}function _9(_,Q,J){return _.filter((q)=>J||q.length===Q.size).some((q)=>q.every((U)=>Q.has(U)))}function Q9(_,Q){return Q.includes(_)?"code":"key"}var KU=()=>{let _=N1();return r.useMemo(()=>{return{zoomIn:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(1.2,Q):!1},zoomOut:async(Q)=>{let{panZoom:J}=_.getState();return J?J.scaleBy(0.8333333333333334,Q):!1},zoomTo:async(Q,J)=>{let{panZoom:q}=_.getState();return q?q.scaleTo(Q,J):!1},getZoom:()=>_.getState().transform[2],setViewport:async(Q,J)=>{let{transform:[q,U,G],panZoom:Z}=_.getState();if(!Z)return!1;return await Z.setViewport({x:Q.x??q,y:Q.y??U,zoom:Q.zoom??G},J),!0},getViewport:()=>{let[Q,J,q]=_.getState().transform;return{x:Q,y:J,zoom:q}},setCenter:async(Q,J,q)=>{return _.getState().setCenter(Q,J,q)},fitBounds:async(Q,J)=>{let{width:q,height:U,minZoom:G,maxZoom:Z,panZoom:F}=_.getState(),H=B5(Q,q,U,G,Z,J?.padding??0.1);if(!F)return!1;return await F.setViewport(H,{duration:J?.duration,ease:J?.ease,interpolate:J?.interpolate}),!0},screenToFlowPosition:(Q,J={})=>{let{transform:q,snapGrid:U,snapToGrid:G,domNode:Z}=_.getState();if(!Z)return Q;let{x:F,y:H}=Z.getBoundingClientRect(),Y={x:Q.x-F,y:Q.y-H},X=J.snapGrid??U,K=J.snapToGrid??G;return u2(Y,q,K,X)},flowToScreenPosition:(Q)=>{let{transform:J,domNode:q}=_.getState();if(!q)return Q;let{x:U,y:G}=q.getBoundingClientRect(),Z=U2(Q,J);return{x:Z.x+U,y:Z.y+G}}}},[])};function P9(_,Q){let J=[],q=new Map,U=[];for(let G of _)if(G.type==="add"){U.push(G);continue}else if(G.type==="remove"||G.type==="replace")q.set(G.id,[G]);else{let Z=q.get(G.id);if(Z)Z.push(G);else q.set(G.id,[G])}for(let G of Q){let Z=q.get(G.id);if(!Z){J.push(G);continue}if(Z[0].type==="remove")continue;if(Z[0].type==="replace"){J.push({...Z[0].item});continue}let F={...G};for(let H of Z)HU(H,F);J.push(F)}if(U.length)U.forEach((G)=>{if(G.index!==void 0)J.splice(G.index,0,{...G.item});else J.push({...G.item})});return J}function HU(_,Q){switch(_.type){case"select":{Q.selected=_.selected;break}case"position":{if(typeof _.position<"u")Q.position=_.position;if(typeof _.dragging<"u")Q.dragging=_.dragging;break}case"dimensions":{if(typeof _.dimensions<"u"){if(Q.measured={..._.dimensions},_.setAttributes){if(_.setAttributes===!0||_.setAttributes==="width")Q.width=_.dimensions.width;if(_.setAttributes===!0||_.setAttributes==="height")Q.height=_.dimensions.height}}if(typeof _.resizing==="boolean")Q.resizing=_.resizing;break}}}function N9(_,Q){return P9(_,Q)}function XU(_,Q){return P9(_,Q)}function F2(_,Q){return{id:_,type:"select",selected:Q}}function D2(_,Q=new Set,J=!1){let q=[];for(let[U,G]of _){let Z=Q.has(U);if(!(G.selected===void 0&&!Z)&&G.selected!==Z){if(J)G.selected=Z;q.push(F2(G.id,Z))}}return q}function J9({items:_=[],lookup:Q}){let J=[],q=new Map(_.map((U)=>[U.id,U]));for(let[U,G]of _.entries()){let Z=Q.get(G.id),F=Z?.internals?.userNode??Z;if(F!==void 0&&F!==G)J.push({id:G.id,item:G,type:"replace"});if(F===void 0)J.push({item:G,type:"add",index:U})}for(let[U]of Q)if(q.get(U)===void 0)J.push({id:U,type:"remove"});return J}function $9(_){return{id:_.id,type:"remove"}}var YU=z6("React Flow","https://reactflow.dev/");function LU(_,Q,J={}){return A7(_,Q,{...J,onError:J.onError??YU})}var q9=(_)=>U7(_),zU=(_)=>F6(_);function C9(_){return r.forwardRef(_)}var S9=typeof window<"u"?r.useLayoutEffect:r.useEffect;function U9(_){let[Q,J]=r.useState(BigInt(0)),[q]=r.useState(()=>WU(()=>J((U)=>U+BigInt(1))));return S9(()=>{let U=q.get();if(U.length)_(U),q.reset()},[Q]),q}function WU(_){let Q=[];return{get:()=>Q,reset:()=>{Q=[]},push:(J)=>{Q.push(J),_()}}}var k9=r.createContext(null);function AU({children:_}){let Q=N1(),J=r.useCallback((F)=>{let{nodes:H=[],setNodes:Y,hasDefaultNodes:X,onNodesChange:K,nodeLookup:L,fitViewQueued:z,onNodesChangeMiddlewareMap:W}=Q.getState(),O=H;for(let B of F)O=typeof B==="function"?B(O):B;let T=J9({items:O,lookup:L});for(let B of W.values())T=B(T);if(X)Y(O);if(T.length>0)K?.(T);else if(z)window.requestAnimationFrame(()=>{let{fitViewQueued:B,nodes:w,setNodes:A}=Q.getState();if(B)A(w)})},[]),q=U9(J),U=r.useCallback((F)=>{let{edges:H=[],setEdges:Y,hasDefaultEdges:X,onEdgesChange:K,edgeLookup:L}=Q.getState(),z=H;for(let W of F)z=typeof W==="function"?W(z):W;if(X)Y(z);else if(K)K(J9({items:z,lookup:L}))},[]),G=U9(U),Z=r.useMemo(()=>({nodeQueue:q,edgeQueue:G}),[]);return l.jsx(k9.Provider,{value:Z,children:_})}function BU(){let _=r.useContext(k9);if(!_)throw Error("useBatchContext must be used within a BatchProvider");return _}var MU=(_)=>!!_.panZoom;function R5(){let _=KU(),Q=N1(),J=BU(),q=M1(MU),U=r.useMemo(()=>{let G=(K)=>Q.getState().nodeLookup.get(K),Z=(K)=>{J.nodeQueue.push(K)},F=(K)=>{J.edgeQueue.push(K)},H=(K)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState(),W=q9(K)?K:L.get(K.id),O=W.parentId?A6(W.position,W.measured,W.parentId,L,z):W.position,T={...W,position:O,width:W.measured?.width??W.width,height:W.measured?.height??W.height};return j2(T)},Y=(K,L,z={replace:!1})=>{Z((W)=>W.map((O)=>{if(O.id===K){let T=typeof L==="function"?L(O):L;return z.replace&&q9(T)?T:{...O,...T}}return O}))},X=(K,L,z={replace:!1})=>{F((W)=>W.map((O)=>{if(O.id===K){let T=typeof L==="function"?L(O):L;return z.replace&&zU(T)?T:{...O,...T}}return O}))};return{getNodes:()=>Q.getState().nodes.map((K)=>({...K})),getNode:(K)=>G(K)?.internals.userNode,getInternalNode:G,getEdges:()=>{let{edges:K=[]}=Q.getState();return K.map((L)=>({...L}))},getEdge:(K)=>Q.getState().edgeLookup.get(K),setNodes:Z,setEdges:F,addNodes:(K)=>{let L=Array.isArray(K)?K:[K];J.nodeQueue.push((z)=>[...z,...L])},addEdges:(K)=>{let L=Array.isArray(K)?K:[K];J.edgeQueue.push((z)=>[...z,...L])},toObject:()=>{let{nodes:K=[],edges:L=[],transform:z}=Q.getState(),[W,O,T]=z;return{nodes:K.map((B)=>({...B})),edges:L.map((B)=>({...B})),viewport:{x:W,y:O,zoom:T}}},deleteElements:async({nodes:K=[],edges:L=[]})=>{let{nodes:z,edges:W,onNodesDelete:O,onEdgesDelete:T,triggerNodeChanges:B,triggerEdgeChanges:w,onDelete:A,onBeforeDelete:R}=Q.getState(),{nodes:I,edges:C}=await F7({nodesToRemove:K,edgesToRemove:L,nodes:z,edges:W,onBeforeDelete:R}),P=C.length>0,k=I.length>0;if(P){let N=C.map($9);T?.(C),w(N)}if(k){let N=I.map($9);O?.(I),B(N)}if(k||P)A?.({nodes:I,edges:C});return{deletedNodes:I,deletedEdges:C}},getIntersectingNodes:(K,L=!0,z)=>{let W=L6(K),O=W?K:H(K),T=z!==void 0;if(!O)return[];return(z||Q.getState().nodes).filter((B)=>{let w=Q.getState().nodeLookup.get(B.id);if(w&&!W&&(B.id===K.id||!w.internals.positionAbsolute))return!1;let A=j2(T?B:w),R=A5(A,O);return L&&R>0||R>=A.width*A.height||R>=O.width*O.height})},isNodeIntersecting:(K,L,z=!0)=>{let O=L6(K)?K:H(K);if(!O)return!1;let T=A5(O,L);return z&&T>0||T>=L.width*L.height||T>=O.width*O.height},updateNode:Y,updateNodeData:(K,L,z={replace:!1})=>{Y(K,(W)=>{let O=typeof L==="function"?L(W):L;return z.replace?{...W,data:O}:{...W,data:{...W.data,...O}}},z)},updateEdge:X,updateEdgeData:(K,L,z={replace:!1})=>{X(K,(W)=>{let O=typeof L==="function"?L(W):L;return z.replace?{...W,data:O}:{...W,data:{...W.data,...O}}},z)},getNodesBounds:(K)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState();return H6(K,{nodeLookup:L,nodeOrigin:z})},getHandleConnections:({type:K,id:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}-${K}${L?`-${L}`:""}`)?.values()??[]),getNodeConnections:({type:K,handleId:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}${K?L?`-${K}-${L}`:`-${K}`:""}`)?.values()??[]),fitView:async(K)=>{let L=Q.getState().fitViewResolver??X7();return Q.setState({fitViewQueued:!0,fitViewOptions:K,fitViewResolver:L}),J.nodeQueue.push((z)=>[...z]),L.promise}}},[]);return r.useMemo(()=>{return{...U,..._,viewportInitialized:q}},[q])}var G9=(_)=>_.selected,TU=typeof window<"u"?window:void 0;function RU({deleteKeyCode:_,multiSelectionKeyCode:Q}){let J=N1(),{deleteElements:q}=R5(),U=T5(_,{actInsideInputWithModifier:!1}),G=T5(Q,{target:TU});r.useEffect(()=>{if(U){let{edges:Z,nodes:F}=J.getState();q({nodes:F.filter(G9),edges:Z.filter(G9)}),J.setState({nodesSelectionActive:!1})}},[U]),r.useEffect(()=>{J.setState({multiSelectionActive:G})},[G])}function OU(_){let Q=N1();r.useEffect(()=>{let J=()=>{if(!_.current||!(_.current.checkVisibility?.()??!0))return!1;let q=U4(_.current);if(q.height===0||q.width===0)Q.getState().onError?.("004",i1.error004());Q.setState({width:q.width||500,height:q.height||500})};if(_.current){J(),window.addEventListener("resize",J);let q=new ResizeObserver(()=>J());return q.observe(_.current),()=>{if(window.removeEventListener("resize",J),q&&_.current)q.unobserve(_.current)}}},[])}var T4={position:"absolute",width:"100%",height:"100%",top:0,left:0},fU=(_)=>({userSelectionActive:_.userSelectionActive,lib:_.lib,connectionInProgress:_.connection.inProgress});function IU({onPaneContextMenu:_,zoomOnScroll:Q=!0,zoomOnPinch:J=!0,panOnScroll:q=!1,panActivationKeyPressed:U,panOnScrollSpeed:G=0.5,panOnScrollMode:Z=I0.Free,zoomOnDoubleClick:F=!0,panOnDrag:H=!0,defaultViewport:Y,translateExtent:X,minZoom:K,maxZoom:L,zoomActivationKeyCode:z,preventScrolling:W=!0,children:O,noWheelClassName:T,noPanClassName:B,onViewportChange:w,isControlledViewport:A,paneClickDistance:R,selectionOnDrag:I}){let C=N1(),P=r.useRef(null),{userSelectionActive:k,lib:N,connectionInProgress:v}=M1(fU,P1),E=T5(z),g=r.useRef();OU(P);let h=r.useCallback((S)=>{if(w?.({x:S[0],y:S[1],zoom:S[2]}),!A)C.setState({transform:S})},[w,A]);return r.useEffect(()=>{if(P.current){g.current=u7({domNode:P.current,minZoom:K,maxZoom:L,translateExtent:X,viewport:Y,onDraggingChange:(x)=>C.setState((V)=>V.paneDragging===x?V:{paneDragging:x}),onPanZoomStart:(x,V)=>{let{onViewportChangeStart:D,onMoveStart:f}=C.getState();f?.(x,V),D?.(V)},onPanZoom:(x,V)=>{let{onViewportChange:D,onMove:f}=C.getState();f?.(x,V),D?.(V)},onPanZoomEnd:(x,V)=>{let{onViewportChangeEnd:D,onMoveEnd:f}=C.getState();f?.(x,V),D?.(V)}});let{x:S,y:b,zoom:j}=g.current.getViewport();return C.setState({panZoom:g.current,transform:[S,b,j],domNode:P.current.closest(".react-flow")}),()=>{g.current?.destroy()}}},[]),r.useEffect(()=>{g.current?.update({onPaneContextMenu:_,zoomOnScroll:Q,zoomOnPinch:J,panOnScroll:q,panActivationKeyPressed:U,panOnScrollSpeed:G,panOnScrollMode:Z,zoomOnDoubleClick:F,panOnDrag:H,zoomActivationKeyPressed:E,preventScrolling:W,noPanClassName:B,userSelectionActive:k,noWheelClassName:T,lib:N,onTransformChange:h,connectionInProgress:v,selectionOnDrag:I,paneClickDistance:R})},[_,Q,J,q,U,G,Z,F,H,E,W,B,k,T,N,h,v,I,R]),l.jsx("div",{className:"react-flow__renderer",ref:P,style:T4,children:O})}var wU=(_)=>({userSelectionActive:_.userSelectionActive,userSelectionRect:_.userSelectionRect});function PU(){let{userSelectionActive:_,userSelectionRect:Q}=M1(wU,P1);if(!(_&&Q))return null;return l.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:Q.width,height:Q.height,transform:`translate(${Q.x}px, ${Q.y}px)`}})}var y6=(_,Q)=>{return(J)=>{if(J.target!==Q.current)return;_?.(J)}},NU=(_)=>({userSelectionActive:_.userSelectionActive,elementsSelectable:_.elementsSelectable,dragging:_.paneDragging,panBy:_.panBy,autoPanSpeed:_.autoPanSpeed});function CU({isSelecting:_,selectionKeyPressed:Q,selectionMode:J=$2.Full,panOnDrag:q,autoPanOnSelection:U,paneClickDistance:G,selectionOnDrag:Z,onSelectionStart:F,onSelectionEnd:H,onPaneClick:Y,onPaneContextMenu:X,onPaneScroll:K,onPaneMouseEnter:L,onPaneMouseMove:z,onPaneMouseLeave:W,children:O}){let T=r.useRef(0),B=N1(),{userSelectionActive:w,elementsSelectable:A,dragging:R,panBy:I,autoPanSpeed:C}=M1(NU,P1),P=A&&(_||w),k=r.useRef(null),N=r.useRef(),v=r.useRef(new Set),E=r.useRef(new Set),g=r.useRef(!1),h=r.useRef(!1),S=r.useRef({x:0,y:0}),b=r.useRef(!1),j=(c)=>{if(h.current||g.current||B.getState().connection.inProgress){h.current=!1,g.current=!1;return}Y?.(c),B.getState().resetSelectedElements(),B.setState({nodesSelectionActive:!1})},x=(c)=>{if(Array.isArray(q)&&q?.includes(2)){c.preventDefault();return}X?.(c)},V=K?(c)=>K(c):void 0,D=(c)=>{if(h.current)c.stopPropagation(),h.current=!1},f=(c)=>{if(c.pointerType==="touch"&&q!==!1&&!Q)return;let{domNode:e,transform:Q1}=B.getState();if(N.current=e?.getBoundingClientRect(),!N.current)return;let G1=c.target===k.current;if(!G1&&!!c.target.closest(".nokey")||!_||!(Z&&G1||Q)||c.button!==0||!c.isPrimary)return;c.target?.setPointerCapture?.(c.pointerId),h.current=!1;let{x:Y1,y:K1}=_0(c.nativeEvent,N.current),o=u2({x:Y1,y:K1},Q1);if(B.setState({userSelectionRect:{width:0,height:0,startX:o.x,startY:o.y,x:Y1,y:K1}}),!G1)c.stopPropagation(),c.preventDefault()};function y(c,e){let{userSelectionRect:Q1}=B.getState();if(!Q1)return;let{transform:G1,nodeLookup:$1,edgeLookup:Z1,connectionLookup:Y1,triggerNodeChanges:K1,triggerEdgeChanges:o,defaultEdgeOptions:z1}=B.getState(),q1={x:Q1.startX,y:Q1.startY},{x:y1,y:c1}=U2(q1,G1),l1={startX:q1.x,startY:q1.y,x:c<y1?c:y1,y:e<c1?e:c1,width:Math.abs(c-y1),height:Math.abs(e-c1)},k0=v.current,F0=E.current;v.current=new Set(Q4($1,l1,G1,J===$2.Partial,!0).map((a1)=>a1.id)),E.current=new Set;let M0=z1?.selectable??!0;for(let a1 of v.current){let o1=Y1.get(a1);if(!o1)continue;for(let{edgeId:n1}of o1.values()){let K0=Z1.get(n1);if(K0&&(K0.selectable??M0))E.current.add(n1)}}if(!B6(k0,v.current)){let a1=D2($1,v.current,!0);K1(a1)}if(!B6(F0,E.current)){let a1=D2(Z1,E.current);o(a1)}B.setState({userSelectionRect:l1,userSelectionActive:!0,nodesSelectionActive:!1})}function p(){if(!U||!N.current)return;let[c,e]=J4(S.current,N.current,C);I({x:c,y:e}).then((Q1)=>{if(!h.current||!Q1){T.current=requestAnimationFrame(p);return}let{x:G1,y:$1}=S.current;y(G1,$1),T.current=requestAnimationFrame(p)})}let u=()=>{cancelAnimationFrame(T.current),T.current=0,b.current=!1};r.useEffect(()=>{return()=>u()},[]);let s=(c)=>{let{userSelectionRect:e,transform:Q1,resetSelectedElements:G1}=B.getState();if(!N.current||!e)return;let{x:$1,y:Z1}=_0(c.nativeEvent,N.current);S.current={x:$1,y:Z1};let Y1=U2({x:e.startX,y:e.startY},Q1);if(!h.current){let K1=Q?0:G;if(Math.hypot($1-Y1.x,Z1-Y1.y)<=K1)return;G1(),F?.(c)}if(h.current=!0,!b.current)p(),b.current=!0;y($1,Z1)},t=(c)=>{if(!P){if(c.target===k.current&&B.getState().connection.inProgress)g.current=!0;return}if(c.button!==0)return;if(c.target?.releasePointerCapture?.(c.pointerId),!w&&c.target===k.current&&B.getState().userSelectionRect)j?.(c);if(B.setState({userSelectionActive:!1,userSelectionRect:null}),h.current)H?.(c),B.setState({nodesSelectionActive:v.current.size>0});u()},a=(c)=>{c.target?.releasePointerCapture?.(c.pointerId),u()},d=q===!0||Array.isArray(q)&&q.includes(0);return l.jsxs("div",{className:C1(["react-flow__pane",{draggable:d,dragging:R,selection:_}]),onClick:P?void 0:y6(j,k),onContextMenu:y6(x,k),onWheel:y6(V,k),onPointerEnter:P?void 0:L,onPointerMove:P?s:z,onPointerUp:t,onPointerCancel:P?a:void 0,onPointerDownCapture:P?f:void 0,onClickCapture:P?D:void 0,onPointerLeave:W,ref:k,style:T4,children:[O,l.jsx(PU,{})]})}function j6({id:_,store:Q,unselect:J=!1,nodeRef:q}){let{addSelectedNodes:U,unselectNodesAndEdges:G,multiSelectionActive:Z,nodeLookup:F,onError:H}=Q.getState(),Y=F.get(_);if(!Y){H?.("012",i1.error012(_));return}if(Q.setState({nodesSelectionActive:!1}),!Y.selected)U([_]);else if(J||Y.selected&&Z)G({nodes:[Y],edges:[]}),requestAnimationFrame(()=>q?.current?.blur())}function y9({nodeRef:_,disabled:Q=!1,noDragClassName:J,handleSelector:q,nodeId:U,isSelectable:G,nodeClickDistance:Z}){let F=N1(),[H,Y]=r.useState(!1),X=r.useRef();return r.useEffect(()=>{if(Q)return;return X.current=N7({getStoreItems:()=>F.getState(),onNodeMouseDown:(K)=>{j6({id:K,store:F,nodeRef:_})},onDragStart:()=>{Y(!0)},onDragStop:()=>{Y(!1)}}),()=>{X.current?.destroy(),X.current=void 0}},[Q,F,_]),r.useEffect(()=>{if(Q||!_.current||!X.current)return;X.current.update({noDragClassName:J,handleSelector:q,domNode:_.current,isSelectable:G,nodeId:U,nodeClickDistance:Z})},[J,q,Q,G,_,U,Z]),H}var SU=(_)=>(Q)=>Q.selected&&(Q.draggable||_&&typeof Q.draggable>"u");function v9(){let _=N1();return r.useCallback((J)=>{let{nodeExtent:q,snapToGrid:U,snapGrid:G,nodesDraggable:Z,onError:F,updateNodePositions:H,nodeLookup:Y,nodeOrigin:X}=_.getState(),K=new Map,L=SU(Z),z=U?G[0]:5,W=U?G[1]:5,O=J.direction.x*z*J.factor,T=J.direction.y*W*J.factor;for(let[,B]of Y){if(!L(B))continue;let w={x:B.internals.positionAbsolute.x+O,y:B.internals.positionAbsolute.y+T};if(U)w=V2(w,G);let{position:A,positionAbsolute:R}=X6({nodeId:B.id,nextPosition:w,nodeLookup:Y,nodeExtent:q,nodeOrigin:X,onError:F});B.position=A,B.internals.positionAbsolute=R,K.set(B.id,B)}H(K)},[])}var V6=r.createContext(null),kU=V6.Provider;V6.Consumer;var u6=()=>{return r.useContext(V6)},yU=(_)=>({connectOnClick:_.connectOnClick,noPanClassName:_.noPanClassName,rfId:_.rfId}),j9=r.createContext(null);function vU({children:_}){let Q=M1(yU,P1);return l.jsx(j9.Provider,{value:Q,children:_})}function jU(){let _=r.useContext(j9);if(!_)throw Error("useHandleConfig must be used within a HandleConfigProvider");return _}var VU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},uU=(_,Q,J)=>(q)=>{let{connectionClickStartHandle:U,connectionMode:G,connection:Z}=q,{fromHandle:F,toHandle:H,isValid:Y}=Z;if(!F&&!U)return VU;let X=H?.nodeId===_&&H?.id===Q&&H?.type===J;return{connectingFrom:F?.nodeId===_&&F?.id===Q&&F?.type===J,connectingTo:X,clickConnecting:U?.nodeId===_&&U?.id===Q&&U?.type===J,isPossibleEndHandle:G===E0.Strict?F?.type!==J:_!==F?.nodeId||Q!==F?.id,connectionInProcess:!!F,clickConnectionInProcess:!!U,valid:X&&Y}};function bU({type:_="source",position:Q=J1.Top,isValidConnection:J,isConnectable:q=!0,isConnectableStart:U=!0,isConnectableEnd:G=!0,id:Z,onConnect:F,children:H,className:Y,onMouseDown:X,onTouchStart:K,...L},z){let W=Z||null,O=_==="target",T=N1(),B=u6(),{connectOnClick:w,noPanClassName:A,rfId:R}=jU(),{connectingFrom:I,connectingTo:C,clickConnecting:P,isPossibleEndHandle:k,connectionInProcess:N,clickConnectionInProcess:v,valid:E}=M1(uU(B,W,_),P1);if(!B)T.getState().onError?.("010",i1.error010());let g=(b)=>{let{defaultEdgeOptions:j,onConnect:x,hasDefaultEdges:V}=T.getState(),D={...j,...b};if(V){let{edges:f,setEdges:y,onError:p}=T.getState();y(LU(D,f,{onError:p}))}x?.(D),F?.(D)},h=(b)=>{if(!B)return;let j=O6(b.nativeEvent);if(U&&(j&&b.button===0||!j)){let x=T.getState();Y4.onPointerDown(b.nativeEvent,{handleDomNode:b.currentTarget,autoPanOnConnect:x.autoPanOnConnect,connectionMode:x.connectionMode,connectionRadius:x.connectionRadius,domNode:x.domNode,nodeLookup:x.nodeLookup,lib:x.lib,isTarget:O,handleId:W,nodeId:B,flowId:x.rfId,panBy:x.panBy,cancelConnection:x.cancelConnection,onConnectStart:x.onConnectStart,onConnectEnd:(...V)=>T.getState().onConnectEnd?.(...V),updateConnection:x.updateConnection,onConnect:g,isValidConnection:J||((...V)=>T.getState().isValidConnection?.(...V)??!0),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:x.autoPanSpeed,dragThreshold:x.connectionDragThreshold})}if(j)X?.(b);else K?.(b)},S=(b)=>{let{onClickConnectStart:j,onClickConnectEnd:x,connectionClickStartHandle:V,connectionMode:D,isValidConnection:f,lib:y,rfId:p,nodeLookup:u,connection:s}=T.getState();if(!B||!V&&!U)return;if(!V){j?.(b.nativeEvent,{nodeId:B,handleId:W,handleType:_}),T.setState({connectionClickStartHandle:{nodeId:B,type:_,id:W}});return}let t=T6(b.target),a=J||f,{connection:d,isValid:c}=Y4.isValid(b.nativeEvent,{handle:{nodeId:B,id:W,type:_},connectionMode:D,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:a,flowId:p,doc:t,lib:y,nodeLookup:u});if(c&&d)g(d);let e=structuredClone(s);delete e.inProgress,e.toPosition=e.toHandle?e.toHandle.position:null,x?.(b,e),T.setState({connectionClickStartHandle:null})};return l.jsx("div",{"data-handleid":W,"data-nodeid":B,"data-handlepos":Q,"data-id":`${R}-${B}-${W}-${_}`,className:C1(["react-flow__handle",`react-flow__handle-${Q}`,"nodrag",A,Y,{source:!O,target:O,connectable:q,connectablestart:U,connectableend:G,clickconnecting:P,connectingfrom:I,connectingto:C,valid:E,connectionindicator:q&&(!N||k)&&(N||v?G:U)}]),onMouseDown:h,onTouchStart:h,onClick:w?S:void 0,ref:z,...L,children:H})}var A4=r.memo(C9(bU));function DU({data:_,isConnectable:Q,sourcePosition:J=J1.Bottom}){return l.jsxs(l.Fragment,{children:[_?.label,l.jsx(A4,{type:"source",position:J,isConnectable:Q})]})}function hU({data:_,isConnectable:Q,targetPosition:J=J1.Top,sourcePosition:q=J1.Bottom}){return l.jsxs(l.Fragment,{children:[l.jsx(A4,{type:"target",position:J,isConnectable:Q}),_?.label,l.jsx(A4,{type:"source",position:q,isConnectable:Q})]})}function EU(){return null}function xU({data:_,isConnectable:Q,targetPosition:J=J1.Top}){return l.jsxs(l.Fragment,{children:[l.jsx(A4,{type:"target",position:J,isConnectable:Q}),_?.label]})}var B4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Z9={input:DU,default:hU,output:xU,group:EU};function mU(_){if(_.internals.handleBounds===void 0)return{width:_.width??_.initialWidth??_.style?.width,height:_.height??_.initialHeight??_.style?.height};return{width:_.width??_.style?.width,height:_.height??_.style?.height}}var gU=(_)=>{let{width:Q,height:J,x:q,y:U}=Z2(_.nodeLookup,{filter:(G)=>!!G.selected});return{width:e1(Q)?Q:null,height:e1(J)?J:null,userSelectionActive:_.userSelectionActive,transformString:`translate(${_.transform[0]}px,${_.transform[1]}px) scale(${_.transform[2]}) translate(${q}px,${U}px)`}};function pU({onSelectionContextMenu:_,noPanClassName:Q,disableKeyboardA11y:J}){let q=N1(),{width:U,height:G,transformString:Z,userSelectionActive:F}=M1(gU,P1),H=v9(),Y=r.useRef(null);r.useEffect(()=>{if(!J)Y.current?.focus({preventScroll:!0})},[J]);let X=!F&&U!==null&&G!==null;if(y9({nodeRef:Y,disabled:!X}),!X)return null;let K=_?(z)=>{let W=q.getState().nodes.filter((O)=>O.selected);_(z,W)}:void 0,L=(z)=>{if(Object.prototype.hasOwnProperty.call(B4,z.key))z.preventDefault(),H({direction:B4[z.key],factor:z.shiftKey?4:1})};return l.jsx("div",{className:C1(["react-flow__nodesselection","react-flow__container",Q]),style:{transform:Z},children:l.jsx("div",{ref:Y,className:"react-flow__nodesselection-rect",onContextMenu:K,tabIndex:J?void 0:-1,onKeyDown:J?void 0:L,style:{width:U,height:G}})})}var F9=typeof window<"u"?window:void 0,cU=(_)=>{return{nodesSelectionActive:_.nodesSelectionActive,userSelectionActive:_.userSelectionActive}};function V9({children:_,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,paneClickDistance:F,deleteKeyCode:H,selectionKeyCode:Y,selectionOnDrag:X,selectionMode:K,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:W,panActivationKeyCode:O,zoomActivationKeyCode:T,elementsSelectable:B,zoomOnScroll:w,zoomOnPinch:A,panOnScroll:R,panOnScrollSpeed:I,panOnScrollMode:C,zoomOnDoubleClick:P,panOnDrag:k,autoPanOnSelection:N,defaultViewport:v,translateExtent:E,minZoom:g,maxZoom:h,preventScrolling:S,onSelectionContextMenu:b,noWheelClassName:j,noPanClassName:x,disableKeyboardA11y:V,onViewportChange:D,isControlledViewport:f}){let{nodesSelectionActive:y,userSelectionActive:p}=M1(cU,P1),u=T5(Y,{target:F9}),s=T5(O,{target:F9}),t=s||k,a=s||R,d=X&&t!==!0,c=u||p||d;return RU({deleteKeyCode:H,multiSelectionKeyCode:W}),l.jsx(IU,{onPaneContextMenu:G,elementsSelectable:B,zoomOnScroll:w,zoomOnPinch:A,panOnScroll:a,panActivationKeyPressed:s,panOnScrollSpeed:I,panOnScrollMode:C,zoomOnDoubleClick:P,panOnDrag:!u&&t,defaultViewport:v,translateExtent:E,minZoom:g,maxZoom:h,zoomActivationKeyCode:T,preventScrolling:S,noWheelClassName:j,noPanClassName:x,onViewportChange:D,isControlledViewport:f,paneClickDistance:F,selectionOnDrag:d,children:l.jsxs(CU,{onSelectionStart:L,onSelectionEnd:z,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,panOnDrag:t,autoPanOnSelection:N,isSelecting:!!c,selectionMode:K,selectionKeyPressed:u,paneClickDistance:F,selectionOnDrag:d,children:[_,y&&l.jsx(pU,{onSelectionContextMenu:b,noPanClassName:x,disableKeyboardA11y:V})]})})}V9.displayName="FlowRenderer";var lU=r.memo(V9),rU=(_)=>(Q)=>{return _?Q4(Q.nodeLookup,{x:0,y:0,width:Q.width,height:Q.height},Q.transform,!0).map((J)=>J.id):Array.from(Q.nodeLookup.keys())};function iU(_){return M1(r.useCallback(rU(_),[_]),P1)}var dU=(_)=>_.updateNodeInternals;function aU(){let _=M1(dU),[Q]=r.useState(()=>{if(typeof ResizeObserver>"u")return null;return new ResizeObserver((J)=>{let q=new Map;J.forEach((U)=>{let G=U.target.getAttribute("data-id");q.set(G,{id:G,nodeElement:U.target,force:!0})}),_(q)})});return r.useEffect(()=>{return()=>{Q?.disconnect()}},[Q]),Q}function sU({node:_,nodeType:Q,hasDimensions:J,resizeObserver:q}){let U=N1(),G=r.useRef(null),Z=r.useRef(null),F=r.useRef(_.sourcePosition),H=r.useRef(_.targetPosition),Y=r.useRef(Q),X=J&&!!_.internals.handleBounds;return r.useEffect(()=>{if(G.current&&!_.hidden&&(!X||Z.current!==G.current)){if(Z.current)q?.unobserve(Z.current);q?.observe(G.current),Z.current=G.current}},[X,_.hidden]),r.useEffect(()=>{return()=>{if(Z.current)q?.unobserve(Z.current),Z.current=null}},[]),r.useEffect(()=>{if(G.current){let K=Y.current!==Q,L=F.current!==_.sourcePosition,z=H.current!==_.targetPosition;if(K||L||z)Y.current=Q,F.current=_.sourcePosition,H.current=_.targetPosition,U.getState().updateNodeInternals(new Map([[_.id,{id:_.id,nodeElement:G.current,force:!0}]]))}},[_.id,Q,_.sourcePosition,_.targetPosition]),G}function tU({id:_,onClick:Q,onMouseEnter:J,onMouseMove:q,onMouseLeave:U,onContextMenu:G,onDoubleClick:Z,nodesDraggable:F,elementsSelectable:H,nodesConnectable:Y,nodesFocusable:X,resizeObserver:K,noDragClassName:L,noPanClassName:z,disableKeyboardA11y:W,rfId:O,nodeTypes:T,nodeClickDistance:B,onError:w}){let{node:A,internals:R,isParent:I}=M1((c)=>{let e=c.nodeLookup.get(_),Q1=c.parentLookup.has(_);return{node:e,internals:e.internals,isParent:Q1}},P1),C=A.type||"default",P=T?.[C]||Z9[C];if(P===void 0)w?.("003",i1.error003(C)),C="default",P=T?.default||Z9.default;let k=!!(A.draggable||F&&typeof A.draggable>"u"),N=!!(A.selectable||H&&typeof A.selectable>"u"),v=!!(A.connectable||Y&&typeof A.connectable>"u"),E=!!(A.focusable||X&&typeof A.focusable>"u"),g=N1(),h=W6(A),S=sU({node:A,nodeType:C,hasDimensions:h,resizeObserver:K}),b=y9({nodeRef:S,disabled:A.hidden||!k,noDragClassName:L,handleSelector:A.dragHandle,nodeId:_,isSelectable:N,nodeClickDistance:B}),j=v9();if(A.hidden)return null;let x=Q0(A),V=mU(A),D=N||k||Q||J||q||U,f=J?(c)=>J(c,{...R.userNode}):void 0,y=q?(c)=>q(c,{...R.userNode}):void 0,p=U?(c)=>U(c,{...R.userNode}):void 0,u=G?(c)=>G(c,{...R.userNode}):void 0,s=Z?(c)=>Z(c,{...R.userNode}):void 0,t=(c)=>{let{selectNodesOnDrag:e,nodeDragThreshold:Q1}=g.getState();if(N&&(!e||!k||Q1>0))j6({id:_,store:g,nodeRef:S});if(Q)Q(c,{...R.userNode})},a=(c)=>{if(R6(c.nativeEvent)||W)return;if(U6.includes(c.key)&&N){let e=c.key==="Escape";j6({id:_,store:g,unselect:e,nodeRef:S})}else if(k&&A.selected&&Object.prototype.hasOwnProperty.call(B4,c.key)){c.preventDefault();let{ariaLabelConfig:e}=g.getState();g.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:c.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),j({direction:B4[c.key],factor:c.shiftKey?4:1})}},d=()=>{if(W||!S.current?.matches(":focus-visible"))return;let{transform:c,width:e,height:Q1,autoPanOnNodeFocus:G1,setCenter:$1}=g.getState();if(!G1)return;if(!(Q4(new Map([[_,A]]),{x:0,y:0,width:e,height:Q1},c,!0).length>0))$1(A.position.x+x.width/2,A.position.y+x.height/2,{zoom:c[2]})};return l.jsx("div",{className:C1(["react-flow__node",`react-flow__node-${C}`,{[z]:k},A.className,{selected:A.selected,selectable:N,parent:I,draggable:k,dragging:b}]),ref:S,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:h?"visible":"hidden",...A.style,...V},"data-id":_,"data-testid":`rf__node-${_}`,onMouseEnter:f,onMouseMove:y,onMouseLeave:p,onContextMenu:u,onClick:t,onDoubleClick:s,onKeyDown:E?a:void 0,tabIndex:E?0:void 0,onFocus:E?d:void 0,role:A.ariaRole??(E?"group":void 0),"aria-roledescription":"node","aria-describedby":W?void 0:`${f9}-${O}`,"aria-label":A.ariaLabel,...A.domAttributes,children:l.jsx(kU,{value:_,children:l.jsx(P,{id:_,data:A.data,type:C,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:A.selected??!1,selectable:N,draggable:k,deletable:A.deletable??!0,isConnectable:v,sourcePosition:A.sourcePosition,targetPosition:A.targetPosition,dragging:b,dragHandle:A.dragHandle,zIndex:R.z,parentId:A.parentId,...x})})})}var oU=r.memo(tU),nU=(_)=>({nodesConnectable:_.nodesConnectable,nodesFocusable:_.nodesFocusable,elementsSelectable:_.elementsSelectable,onError:_.onError});function u9(_){let{nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,onError:U}=M1(nU,P1),G=iU(_.onlyRenderVisibleElements),Z=aU();return l.jsx("div",{className:"react-flow__nodes",style:T4,children:G.map((F)=>{return l.jsx(oU,{id:F,nodeTypes:_.nodeTypes,nodeExtent:_.nodeExtent,onClick:_.onNodeClick,onMouseEnter:_.onNodeMouseEnter,onMouseMove:_.onNodeMouseMove,onMouseLeave:_.onNodeMouseLeave,onContextMenu:_.onNodeContextMenu,onDoubleClick:_.onNodeDoubleClick,noDragClassName:_.noDragClassName,noPanClassName:_.noPanClassName,rfId:_.rfId,disableKeyboardA11y:_.disableKeyboardA11y,resizeObserver:Z,nodesDraggable:_.nodesDraggable??!0,nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,nodeClickDistance:_.nodeClickDistance,onError:U},F)})})}u9.displayName="NodeRenderer";var eU=r.memo(u9);function _G(_){return M1(r.useCallback((J)=>{if(!_)return J.edges.map((U)=>U.id);let q=[];if(J.width&&J.height)for(let U of J.edges){let G=J.nodeLookup.get(U.source),Z=J.nodeLookup.get(U.target);if(G&&Z&&W7({sourceNode:G,targetNode:Z,width:J.width,height:J.height,transform:J.transform}))q.push(U.id)}return q},[_]),P1)}var QG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_}};return l.jsx("polyline",{className:"arrow",style:J,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},JG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_,fill:_}};return l.jsx("polyline",{className:"arrowclosed",style:J,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},K9={[k2.Arrow]:QG,[k2.ArrowClosed]:JG};function $G(_){let Q=N1();return r.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(K9,_))return Q.getState().onError?.("009",i1.error009(_)),null;return K9[_]},[_])}var qG=({id:_,type:Q,color:J,width:q=12.5,height:U=12.5,markerUnits:G="strokeWidth",strokeWidth:Z,orient:F="auto-start-reverse"})=>{let H=$G(Q);if(!H)return null;return l.jsx("marker",{className:"react-flow__arrowhead",id:_,markerWidth:`${q}`,markerHeight:`${U}`,viewBox:"-10 -10 20 20",markerUnits:G,orient:F,refX:"0",refY:"0",children:l.jsx(H,{color:J,strokeWidth:Z})})},b9=({defaultColor:_,rfId:Q})=>{let J=M1((G)=>G.edges),q=M1((G)=>G.defaultEdgeOptions),U=r.useMemo(()=>{return M7(J,{id:Q,defaultColor:_,defaultMarkerStart:q?.markerStart,defaultMarkerEnd:q?.markerEnd})},[J,q,Q,_]);if(!U.length)return null;return l.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:l.jsx("defs",{children:U.map((G)=>l.jsx(qG,{id:G.id,type:G.type,color:G.color,width:G.width,height:G.height,markerUnits:G.markerUnits,strokeWidth:G.strokeWidth,orient:G.orient},G.id))})})};b9.displayName="MarkerDefinitions";var UG=r.memo(b9);function D9({x:_,y:Q,label:J,labelStyle:q,labelShowBg:U=!0,labelBgStyle:G,labelBgPadding:Z=[2,4],labelBgBorderRadius:F=2,children:H,className:Y,...X}){let[K,L]=r.useState({x:1,y:0,width:0,height:0}),z=C1(["react-flow__edge-textwrapper",Y]),W=r.useRef(null);if(r.useEffect(()=>{if(W.current){let O=W.current.getBBox();L({x:O.x,y:O.y,width:O.width,height:O.height})}},[J]),!J)return null;return l.jsxs("g",{transform:`translate(${_-K.width/2} ${Q-K.height/2})`,className:z,visibility:K.width?"visible":"hidden",...X,children:[U&&l.jsx("rect",{width:K.width+2*Z[0],x:-Z[0],y:-Z[1],height:K.height+2*Z[1],className:"react-flow__edge-textbg",style:G,rx:F,ry:F}),l.jsx("text",{className:"react-flow__edge-text",y:K.height/2,dy:"0.3em",ref:W,style:q,children:J}),H]})}D9.displayName="EdgeText";var GG=r.memo(D9);function R4({path:_,labelX:Q,labelY:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:H,interactionWidth:Y=20,...X}){return l.jsxs(l.Fragment,{children:[l.jsx("path",{...X,d:_,fill:"none",className:C1(["react-flow__edge-path",X.className])}),Y?l.jsx("path",{d:_,fill:"none",strokeOpacity:0,strokeWidth:Y,className:"react-flow__edge-interaction"}):null,q&&e1(Q)&&e1(J)?l.jsx(GG,{x:Q,y:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:H}):null]})}function H9({pos:_,x1:Q,y1:J,x2:q,y2:U}){if(_===J1.Left||_===J1.Right)return[0.5*(Q+q),J];return[Q,0.5*(J+U)]}function h9({sourceX:_,sourceY:Q,sourcePosition:J=J1.Bottom,targetX:q,targetY:U,targetPosition:G=J1.Top}){let[Z,F]=H9({pos:J,x1:_,y1:Q,x2:q,y2:U}),[H,Y]=H9({pos:G,x1:q,y1:U,x2:_,y2:Q}),[X,K,L,z]=G4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:Z,sourceControlY:F,targetControlX:H,targetControlY:Y});return[`M${_},${Q} C${Z},${F} ${H},${Y} ${q},${U}`,X,K,L,z]}function E9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z,targetPosition:F,label:H,labelStyle:Y,labelShowBg:X,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,interactionWidth:B})=>{let[w,A,R]=h9({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F}),I=_.isInternal?void 0:Q;return l.jsx(R4,{id:I,path:w,labelX:A,labelY:R,label:H,labelStyle:Y,labelShowBg:X,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,interactionWidth:B})})}var ZG=E9({isInternal:!1}),x9=E9({isInternal:!0});ZG.displayName="SimpleBezierEdge";x9.displayName="SimpleBezierEdgeInternal";function m9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:H,labelBgStyle:Y,labelBgPadding:X,labelBgBorderRadius:K,style:L,sourcePosition:z=J1.Bottom,targetPosition:W=J1.Top,markerEnd:O,markerStart:T,pathOptions:B,interactionWidth:w})=>{let[A,R,I]=M5({sourceX:J,sourceY:q,sourcePosition:z,targetX:U,targetY:G,targetPosition:W,borderRadius:B?.borderRadius,offset:B?.offset,stepPosition:B?.stepPosition}),C=_.isInternal?void 0:Q;return l.jsx(R4,{id:C,path:A,labelX:R,labelY:I,label:Z,labelStyle:F,labelShowBg:H,labelBgStyle:Y,labelBgPadding:X,labelBgBorderRadius:K,style:L,markerEnd:O,markerStart:T,interactionWidth:w})})}var g9=m9({isInternal:!1}),p9=m9({isInternal:!0});g9.displayName="SmoothStepEdge";p9.displayName="SmoothStepEdgeInternal";function c9(_){return r.memo(({id:Q,...J})=>{let q=_.isInternal?void 0:Q;return l.jsx(g9,{...J,id:q,pathOptions:r.useMemo(()=>({borderRadius:0,offset:J.pathOptions?.offset}),[J.pathOptions?.offset])})})}var FG=c9({isInternal:!1}),l9=c9({isInternal:!0});FG.displayName="StepEdge";l9.displayName="StepEdgeInternal";function r9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:H,labelBgStyle:Y,labelBgPadding:X,labelBgBorderRadius:K,style:L,markerEnd:z,markerStart:W,interactionWidth:O})=>{let[T,B,w]=F4({sourceX:J,sourceY:q,targetX:U,targetY:G}),A=_.isInternal?void 0:Q;return l.jsx(R4,{id:A,path:T,labelX:B,labelY:w,label:Z,labelStyle:F,labelShowBg:H,labelBgStyle:Y,labelBgPadding:X,labelBgBorderRadius:K,style:L,markerEnd:z,markerStart:W,interactionWidth:O})})}var KG=r9({isInternal:!1}),i9=r9({isInternal:!0});KG.displayName="StraightEdge";i9.displayName="StraightEdgeInternal";function d9(_){return r.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z=J1.Bottom,targetPosition:F=J1.Top,label:H,labelStyle:Y,labelShowBg:X,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,pathOptions:B,interactionWidth:w})=>{let[A,R,I]=Z4({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F,curvature:B?.curvature}),C=_.isInternal?void 0:Q;return l.jsx(R4,{id:C,path:A,labelX:R,labelY:I,label:H,labelStyle:Y,labelShowBg:X,labelBgStyle:K,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:T,interactionWidth:w})})}var HG=d9({isInternal:!1}),a9=d9({isInternal:!0});HG.displayName="BezierEdge";a9.displayName="BezierEdgeInternal";var X9={default:a9,straight:i9,step:l9,smoothstep:p9,simplebezier:x9},Y9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},XG=(_,Q,J)=>{if(J===J1.Left)return _-Q;if(J===J1.Right)return _+Q;return _},YG=(_,Q,J)=>{if(J===J1.Top)return _-Q;if(J===J1.Bottom)return _+Q;return _},L9="react-flow__edgeupdater";function z9({position:_,centerX:Q,centerY:J,radius:q=10,onMouseDown:U,onMouseEnter:G,onMouseOut:Z,type:F}){return l.jsx("circle",{onMouseDown:U,onMouseEnter:G,onMouseOut:Z,className:C1([L9,`${L9}-${F}`]),cx:XG(Q,q,_),cy:YG(J,q,_),r:q,stroke:"transparent",fill:"transparent"})}function LG({isReconnectable:_,reconnectRadius:Q,edge:J,sourceX:q,sourceY:U,targetX:G,targetY:Z,sourcePosition:F,targetPosition:H,onReconnect:Y,onReconnectStart:X,onReconnectEnd:K,setReconnecting:L,setUpdateHover:z}){let W=N1(),O=(R,I)=>{if(R.button!==0)return;let{autoPanOnConnect:C,domNode:P,connectionMode:k,connectionRadius:N,lib:v,onConnectStart:E,cancelConnection:g,nodeLookup:h,rfId:S,panBy:b,updateConnection:j}=W.getState(),x=I.type==="target",V=(y,p)=>{L(!1),K?.(y,J,I.type,p)},D=(y)=>Y?.(J,y),f=(y,p)=>{L(!0),X?.(R,J,I.type),E?.(y,p)};Y4.onPointerDown(R.nativeEvent,{autoPanOnConnect:C,connectionMode:k,connectionRadius:N,domNode:P,handleId:I.id,nodeId:I.nodeId,nodeLookup:h,isTarget:x,edgeUpdaterType:I.type,lib:v,flowId:S,cancelConnection:g,panBy:b,isValidConnection:(...y)=>W.getState().isValidConnection?.(...y)??!0,onConnect:D,onConnectStart:f,onConnectEnd:(...y)=>W.getState().onConnectEnd?.(...y),onReconnectEnd:V,updateConnection:j,getTransform:()=>W.getState().transform,getFromHandle:()=>W.getState().connection.fromHandle,dragThreshold:W.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},T=(R)=>O(R,{nodeId:J.target,id:J.targetHandle??null,type:"target"}),B=(R)=>O(R,{nodeId:J.source,id:J.sourceHandle??null,type:"source"}),w=()=>z(!0),A=()=>z(!1);return l.jsxs(l.Fragment,{children:[(_===!0||_==="source")&&l.jsx(z9,{position:F,centerX:q,centerY:U,radius:Q,onMouseDown:T,onMouseEnter:w,onMouseOut:A,type:"source"}),(_===!0||_==="target")&&l.jsx(z9,{position:H,centerX:G,centerY:Z,radius:Q,onMouseDown:B,onMouseEnter:w,onMouseOut:A,type:"target"})]})}function zG({id:_,edgesFocusable:Q,edgesReconnectable:J,elementsSelectable:q,onClick:U,onDoubleClick:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:H,onMouseLeave:Y,reconnectRadius:X,onReconnect:K,onReconnectStart:L,onReconnectEnd:z,rfId:W,edgeTypes:O,noPanClassName:T,onError:B,disableKeyboardA11y:w}){let A=M1(($1)=>$1.edgeLookup.get(_)),R=M1(($1)=>$1.defaultEdgeOptions);A=R?{...R,...A}:A;let I=A.type||"default",C=O?.[I]||X9[I];if(C===void 0)B?.("011",i1.error011(I)),I="default",C=O?.default||X9.default;let P=!!(A.focusable||Q&&typeof A.focusable>"u"),k=typeof K<"u"&&(A.reconnectable||J&&typeof A.reconnectable>"u"),N=!!(A.selectable||q&&typeof A.selectable>"u"),v=r.useRef(null),[E,g]=r.useState(!1),[h,S]=r.useState(!1),b=N1(),{zIndex:j=A.zIndex,sourceX:x,sourceY:V,targetX:D,targetY:f,sourcePosition:y,targetPosition:p}=M1(r.useCallback(($1)=>{let Z1=$1.nodeLookup.get(A.source),Y1=$1.nodeLookup.get(A.target);if(!Z1||!Y1)return Y9;let K1=B7({id:_,sourceNode:Z1,targetNode:Y1,sourceHandle:A.sourceHandle||null,targetHandle:A.targetHandle||null,connectionMode:$1.connectionMode,onError:B}),o=z7({selected:A.selected,zIndex:A.zIndex,sourceNode:Z1,targetNode:Y1,elevateOnSelect:$1.elevateEdgesOnSelect,zIndexMode:$1.zIndexMode});return{...K1||Y9,zIndex:o}},[A.source,A.target,A.sourceHandle,A.targetHandle,A.selected,A.zIndex,B]),P1),u=r.useMemo(()=>A.markerStart?`url('#${K4(A.markerStart,W)}')`:void 0,[A.markerStart,W]),s=r.useMemo(()=>A.markerEnd?`url('#${K4(A.markerEnd,W)}')`:void 0,[A.markerEnd,W]);if(A.hidden||x===null||V===null||D===null||f===null)return null;let t=($1)=>{let{addSelectedEdges:Z1,unselectNodesAndEdges:Y1,multiSelectionActive:K1}=b.getState();if(N)if(b.setState({nodesSelectionActive:!1}),A.selected&&K1)Y1({nodes:[],edges:[A]}),v.current?.blur();else Z1([_]);if(U)U($1,A)},a=G?($1)=>{G($1,{...A})}:void 0,d=Z?($1)=>{Z($1,{...A})}:void 0,c=F?($1)=>{F($1,{...A})}:void 0,e=H?($1)=>{H($1,{...A})}:void 0,Q1=Y?($1)=>{Y($1,{...A})}:void 0,G1=($1)=>{if(!w&&U6.includes($1.key)&&N){let{unselectNodesAndEdges:Z1,addSelectedEdges:Y1}=b.getState();if($1.key==="Escape")v.current?.blur(),Z1({edges:[A]});else Y1([_])}};return l.jsx("svg",{style:{zIndex:j},children:l.jsxs("g",{className:C1(["react-flow__edge",`react-flow__edge-${I}`,A.className,T,{selected:A.selected,animated:A.animated,inactive:!N&&!U,updating:E,selectable:N}]),onClick:t,onDoubleClick:a,onContextMenu:d,onMouseEnter:c,onMouseMove:e,onMouseLeave:Q1,onKeyDown:P?G1:void 0,tabIndex:P?0:void 0,role:A.ariaRole??(P?"group":"img"),"aria-roledescription":"edge","data-id":_,"data-testid":`rf__edge-${_}`,"aria-label":A.ariaLabel===null?void 0:A.ariaLabel||`Edge from ${A.source} to ${A.target}`,"aria-describedby":P?`${I9}-${W}`:void 0,ref:v,...A.domAttributes,children:[!h&&l.jsx(C,{id:_,source:A.source,target:A.target,type:A.type,selected:A.selected,animated:A.animated,selectable:N,deletable:A.deletable??!0,label:A.label,labelStyle:A.labelStyle,labelShowBg:A.labelShowBg,labelBgStyle:A.labelBgStyle,labelBgPadding:A.labelBgPadding,labelBgBorderRadius:A.labelBgBorderRadius,sourceX:x,sourceY:V,targetX:D,targetY:f,sourcePosition:y,targetPosition:p,data:A.data,style:A.style,sourceHandleId:A.sourceHandle,targetHandleId:A.targetHandle,markerStart:u,markerEnd:s,pathOptions:"pathOptions"in A?A.pathOptions:void 0,interactionWidth:A.interactionWidth}),k&&l.jsx(LG,{edge:A,isReconnectable:k,reconnectRadius:X,onReconnect:K,onReconnectStart:L,onReconnectEnd:z,sourceX:x,sourceY:V,targetX:D,targetY:f,sourcePosition:y,targetPosition:p,setUpdateHover:g,setReconnecting:S})]})})}var WG=r.memo(zG),AG=(_)=>({edgesFocusable:_.edgesFocusable,edgesReconnectable:_.edgesReconnectable,elementsSelectable:_.elementsSelectable,connectionMode:_.connectionMode,onError:_.onError});function s9({defaultMarkerColor:_,onlyRenderVisibleElements:Q,rfId:J,edgeTypes:q,noPanClassName:U,onReconnect:G,onEdgeContextMenu:Z,onEdgeMouseEnter:F,onEdgeMouseMove:H,onEdgeMouseLeave:Y,onEdgeClick:X,reconnectRadius:K,onEdgeDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,disableKeyboardA11y:O}){let{edgesFocusable:T,edgesReconnectable:B,elementsSelectable:w,onError:A}=M1(AG,P1),R=_G(Q);return l.jsxs("div",{className:"react-flow__edges",children:[l.jsx(UG,{defaultColor:_,rfId:J}),R.map((I)=>{return l.jsx(WG,{id:I,edgesFocusable:T,edgesReconnectable:B,elementsSelectable:w,noPanClassName:U,onReconnect:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:H,onMouseLeave:Y,onClick:X,reconnectRadius:K,onDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,rfId:J,onError:A,edgeTypes:q,disableKeyboardA11y:O},I)})]})}s9.displayName="EdgeRenderer";var BG=r.memo(s9),W9=(_)=>`translate(${_[0]}px,${_[1]}px) scale(${_[2]})`;function MG({children:_}){let Q=N1(),J=r.useRef(null),[q]=r.useState(()=>Q.getState().transform);return S9(()=>{let U=null,G=()=>{let Z=Q.getState().transform;if(U&&Z[0]===U[0]&&Z[1]===U[1]&&Z[2]===U[2])return;if(U=Z,J.current)J.current.style.transform=W9(Z)};return G(),Q.subscribe(G)},[Q]),l.jsx("div",{ref:J,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:W9(q)},children:_})}function TG(_){let Q=R5(),J=r.useRef(!1);r.useEffect(()=>{if(!J.current&&Q.viewportInitialized&&_)setTimeout(()=>_(Q),1),J.current=!0},[_,Q.viewportInitialized])}var RG=(_)=>_.panZoom?.syncViewport;function OG(_){let Q=M1(RG),J=N1();return r.useEffect(()=>{if(_)Q?.(_),J.setState({transform:[_.x,_.y,_.zoom]})},[_,Q]),null}function A9(_){return _.connection.inProgress?{..._.connection,to:u2(_.connection.to,_.transform)}:{..._.connection}}function fG(_){if(_)return(J)=>{let q=A9(J);return _(q)};return A9}function IG(_){let Q=fG(_);return M1(Q,P1)}var wG=(_)=>({nodesConnectable:_.nodesConnectable,isValid:_.connection.isValid,inProgress:_.connection.inProgress,width:_.width,height:_.height});function PG({containerStyle:_,style:Q,type:J,component:q}){let{nodesConnectable:U,width:G,height:Z,isValid:F,inProgress:H}=M1(wG,P1);if(!(G&&U&&H))return null;return l.jsx("svg",{style:_,width:G,height:Z,className:"react-flow__connectionline react-flow__container",children:l.jsx("g",{className:C1(["react-flow__connection",M6(F)]),children:l.jsx(t9,{style:Q,type:J,CustomComponent:q,isValid:F})})})}var t9=({style:_,type:Q=W0.Bezier,CustomComponent:J,isValid:q})=>{let{inProgress:U,from:G,fromNode:Z,fromHandle:F,fromPosition:H,to:Y,toNode:X,toHandle:K,toPosition:L,pointer:z}=IG();if(!U)return;if(J)return l.jsx(J,{connectionLineType:Q,connectionLineStyle:_,fromNode:Z,fromHandle:F,fromX:G.x,fromY:G.y,toX:Y.x,toY:Y.y,fromPosition:H,toPosition:L,connectionStatus:M6(q),toNode:X,toHandle:K,pointer:z});let W="",O={sourceX:G.x,sourceY:G.y,sourcePosition:H,targetX:Y.x,targetY:Y.y,targetPosition:L};switch(Q){case W0.Bezier:[W]=Z4(O);break;case W0.SimpleBezier:[W]=h9(O);break;case W0.Step:[W]=M5({...O,borderRadius:0});break;case W0.SmoothStep:[W]=M5(O);break;default:[W]=F4(O)}return l.jsx("path",{d:W,fill:"none",className:"react-flow__connection-path",style:_})};t9.displayName="ConnectionLine";var NG={};function B9(_=NG){let Q=r.useRef(_),J=N1();r.useEffect(()=>{{let q=new Set([...Object.keys(Q.current),...Object.keys(_)]);for(let U of q)if(Q.current[U]!==_[U]){J.getState().onError?.("002",i1.error002());break}Q.current=_}},[_])}function CG(){let _=N1(),Q=r.useRef(!1);r.useEffect(()=>{if(!Q.current){let J=document.querySelector(".react-flow__pane");if(J&&window.getComputedStyle(J).zIndex!=="1")_.getState().onError?.("013",i1.error013("react"));Q.current=!0}},[])}function o9({nodeTypes:_,edgeTypes:Q,onInit:J,onNodeClick:q,onEdgeClick:U,onNodeDoubleClick:G,onEdgeDoubleClick:Z,onNodeMouseEnter:F,onNodeMouseMove:H,onNodeMouseLeave:Y,onNodeContextMenu:X,onSelectionContextMenu:K,onSelectionStart:L,onSelectionEnd:z,connectionLineType:W,connectionLineStyle:O,connectionLineComponent:T,connectionLineContainerStyle:B,selectionKeyCode:w,selectionOnDrag:A,selectionMode:R,multiSelectionKeyCode:I,panActivationKeyCode:C,zoomActivationKeyCode:P,deleteKeyCode:k,onlyRenderVisibleElements:N,elementsSelectable:v,defaultViewport:E,translateExtent:g,minZoom:h,maxZoom:S,preventScrolling:b,defaultMarkerColor:j,zoomOnScroll:x,zoomOnPinch:V,panOnScroll:D,panOnScrollSpeed:f,panOnScrollMode:y,zoomOnDoubleClick:p,panOnDrag:u,autoPanOnSelection:s,onPaneClick:t,onPaneMouseEnter:a,onPaneMouseMove:d,onPaneMouseLeave:c,onPaneScroll:e,onPaneContextMenu:Q1,paneClickDistance:G1,nodeClickDistance:$1,onEdgeContextMenu:Z1,onEdgeMouseEnter:Y1,onEdgeMouseMove:K1,onEdgeMouseLeave:o,reconnectRadius:z1,onReconnect:q1,onReconnectStart:y1,onReconnectEnd:c1,noDragClassName:l1,noWheelClassName:k0,noPanClassName:F0,disableKeyboardA11y:M0,nodeExtent:a1,rfId:o1,viewport:n1,onViewportChange:K0,nodesDraggable:B2}){return B9(_),B9(Q),CG(),TG(J),OG(n1),l.jsx(lU,{onPaneClick:t,onPaneMouseEnter:a,onPaneMouseMove:d,onPaneMouseLeave:c,onPaneContextMenu:Q1,onPaneScroll:e,paneClickDistance:G1,deleteKeyCode:k,selectionKeyCode:w,selectionOnDrag:A,selectionMode:R,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:I,panActivationKeyCode:C,zoomActivationKeyCode:P,elementsSelectable:v,zoomOnScroll:x,zoomOnPinch:V,zoomOnDoubleClick:p,panOnScroll:D,panOnScrollSpeed:f,panOnScrollMode:y,panOnDrag:u,autoPanOnSelection:s,defaultViewport:E,translateExtent:g,minZoom:h,maxZoom:S,onSelectionContextMenu:K,preventScrolling:b,noDragClassName:l1,noWheelClassName:k0,noPanClassName:F0,disableKeyboardA11y:M0,onViewportChange:K0,isControlledViewport:!!n1,children:l.jsxs(MG,{children:[l.jsx(BG,{edgeTypes:Q,onEdgeClick:U,onEdgeDoubleClick:Z,onReconnect:q1,onReconnectStart:y1,onReconnectEnd:c1,onlyRenderVisibleElements:N,onEdgeContextMenu:Z1,onEdgeMouseEnter:Y1,onEdgeMouseMove:K1,onEdgeMouseLeave:o,reconnectRadius:z1,defaultMarkerColor:j,noPanClassName:F0,disableKeyboardA11y:M0,rfId:o1}),l.jsx(PG,{style:O,type:W,component:T,containerStyle:B}),l.jsx("div",{className:"react-flow__edgelabel-renderer"}),l.jsx(eU,{nodeTypes:_,onNodeClick:q,onNodeDoubleClick:G,onNodeMouseEnter:F,onNodeMouseMove:H,onNodeMouseLeave:Y,onNodeContextMenu:X,nodeClickDistance:$1,onlyRenderVisibleElements:N,noPanClassName:F0,noDragClassName:l1,disableKeyboardA11y:M0,nodeExtent:a1,rfId:o1,nodesDraggable:B2}),l.jsx("div",{className:"react-flow__viewport-portal"})]})})}o9.displayName="GraphView";var SG=r.memo(o9),kG=z6("React Flow","https://reactflow.dev/"),M9=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:H=0.5,maxZoom:Y=2,nodeOrigin:X,nodeExtent:K,zIndexMode:L="basic"}={})=>{let z=new Map,W=new Map,O=new Map,T=new Map,B=q??Q??[],w=J??_??[],A=X??[0,0],R=K??v2;C6(O,T,B);let{nodesInitialized:I}=H4(w,z,W,{nodeOrigin:A,nodeExtent:R,zIndexMode:L}),C=[0,0,1];if(Z&&U&&G){let P=Z2(z,{filter:(E)=>!!((E.width||E.initialWidth)&&(E.height||E.initialHeight))}),{x:k,y:N,zoom:v}=B5(P,U,G,H,Y,F?.padding??0.1);C=[k,N,v]}return{rfId:"1",width:U??0,height:G??0,transform:C,nodes:w,nodesInitialized:I,nodeLookup:z,parentLookup:W,edges:B,edgeLookup:T,connectionLookup:O,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:J!==void 0,hasDefaultEdges:q!==void 0,panZoom:null,minZoom:H,maxZoom:Y,translateExtent:v2,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:E0.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:A,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:Z??!1,fitViewOptions:F,fitViewResolver:null,connection:{...Z6},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:kG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:G6,zIndexMode:L,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},yG=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:H,maxZoom:Y,nodeOrigin:X,nodeExtent:K,zIndexMode:L})=>l7((z,W)=>{async function O(){let{nodeLookup:T,panZoom:B,fitViewOptions:w,fitViewResolver:A,width:R,height:I,minZoom:C,maxZoom:P}=W();if(!B)return;await Z7({nodes:T,width:R,height:I,panZoom:B,minZoom:C,maxZoom:P},w),A?.resolve(!0),z({fitViewResolver:null})}return{...M9({nodes:_,edges:Q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:H,maxZoom:Y,nodeOrigin:X,nodeExtent:K,defaultNodes:J,defaultEdges:q,zIndexMode:L}),setNodes:(T)=>{let{nodeLookup:B,parentLookup:w,nodeOrigin:A,nodeExtent:R,elevateNodesOnSelect:I,fitViewQueued:C,zIndexMode:P,nodesSelectionActive:k}=W(),{nodesInitialized:N,hasSelectedNodes:v}=H4(T,B,w,{nodeOrigin:A,nodeExtent:R,elevateNodesOnSelect:I,checkEquality:!0,zIndexMode:P}),E=k&&v;if(C&&N)O(),z({nodes:T,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:E});else z({nodes:T,nodesInitialized:N,nodesSelectionActive:E})},setEdges:(T)=>{let{connectionLookup:B,edgeLookup:w}=W();C6(B,w,T),z({edges:T})},setDefaultNodesAndEdges:(T,B)=>{if(T){let{setNodes:w}=W();w(T),z({hasDefaultNodes:!0})}if(B){let{setEdges:w}=W();w(B),z({hasDefaultEdges:!0})}},updateNodeInternals:(T)=>{let{triggerNodeChanges:B,nodeLookup:w,parentLookup:A,domNode:R,nodeOrigin:I,nodeExtent:C,debug:P,fitViewQueued:k,zIndexMode:N}=W(),{changes:v,updatedInternals:E}=I7(T,w,A,R,I,C,N);if(!E)return;if(O7(w,A,{nodeOrigin:I,nodeExtent:C,zIndexMode:N}),k)O(),z({fitViewQueued:!1,fitViewOptions:void 0});else z({});if(v?.length>0){if(P)console.log("React Flow: trigger node changes",v);B?.(v)}},updateNodePositions:(T,B=!1)=>{let w=[],A=[],{nodeLookup:R,triggerNodeChanges:I,connection:C,updateConnection:P,onNodesChangeMiddlewareMap:k}=W();for(let[N,v]of T){let E=R.get(N),g=!!(E?.expandParent&&E?.parentId&&v?.position),h={id:N,type:"position",position:g?{x:Math.max(0,v.position.x),y:Math.max(0,v.position.y)}:v.position,dragging:B};if(E&&C.inProgress&&C.fromNode.id===E.id){let S=x0(E,C.fromHandle,J1.Left,!0);P({...C,from:S})}if(g&&E.parentId)w.push({id:N,parentId:E.parentId,rect:{...v.internals.positionAbsolute,width:v.measured.width??0,height:v.measured.height??0}});A.push(h)}if(w.length>0){let{parentLookup:N,nodeOrigin:v}=W(),E=X4(w,R,N,v);A.push(...E)}for(let N of k.values())A=N(A);I(A)},triggerNodeChanges:(T)=>{let{onNodesChange:B,setNodes:w,nodes:A,hasDefaultNodes:R,debug:I}=W();if(T?.length){if(R){let C=N9(T,A);w(C)}if(I)console.log("React Flow: trigger node changes",T);B?.(T)}},triggerEdgeChanges:(T)=>{let{onEdgesChange:B,setEdges:w,edges:A,hasDefaultEdges:R,debug:I}=W();if(T?.length){if(R){let C=XU(T,A);w(C)}if(I)console.log("React Flow: trigger edge changes",T);B?.(T)}},addSelectedNodes:(T)=>{let{multiSelectionActive:B,edgeLookup:w,nodeLookup:A,triggerNodeChanges:R,triggerEdgeChanges:I}=W();if(B){let C=T.map((P)=>F2(P,!0));R(C);return}R(D2(A,new Set([...T]),!0)),I(D2(w))},addSelectedEdges:(T)=>{let{multiSelectionActive:B,edgeLookup:w,nodeLookup:A,triggerNodeChanges:R,triggerEdgeChanges:I}=W();if(B){let C=T.map((P)=>F2(P,!0));I(C);return}I(D2(w,new Set([...T]))),R(D2(A,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:B}={})=>{let{edges:w,nodes:A,nodeLookup:R,triggerNodeChanges:I,triggerEdgeChanges:C}=W(),P=T?T:A,k=B?B:w,N=[];for(let E of P){if(!E.selected)continue;let g=R.get(E.id);if(g)g.selected=!1;N.push(F2(E.id,!1))}let v=[];for(let E of k){if(!E.selected)continue;v.push(F2(E.id,!1))}I(N),C(v)},setMinZoom:(T)=>{let{panZoom:B,maxZoom:w}=W();B?.setScaleExtent([T,w]),z({minZoom:T})},setMaxZoom:(T)=>{let{panZoom:B,minZoom:w}=W();B?.setScaleExtent([w,T]),z({maxZoom:T})},setTranslateExtent:(T)=>{W().panZoom?.setTranslateExtent(T),z({translateExtent:T})},resetSelectedElements:()=>{let{edges:T,nodes:B,triggerNodeChanges:w,triggerEdgeChanges:A,elementsSelectable:R}=W();if(!R)return;let I=B.reduce((P,k)=>k.selected?[...P,F2(k.id,!1)]:P,[]),C=T.reduce((P,k)=>k.selected?[...P,F2(k.id,!1)]:P,[]);w(I),A(C)},setNodeExtent:(T)=>{let{nodes:B,nodeLookup:w,parentLookup:A,nodeOrigin:R,elevateNodesOnSelect:I,nodeExtent:C,zIndexMode:P}=W();if(T[0][0]===C[0][0]&&T[0][1]===C[0][1]&&T[1][0]===C[1][0]&&T[1][1]===C[1][1])return;H4(B,w,A,{nodeOrigin:R,nodeExtent:T,elevateNodesOnSelect:I,checkEquality:!1,zIndexMode:P}),z({nodeExtent:T})},panBy:(T)=>{let{transform:B,width:w,height:A,panZoom:R,translateExtent:I}=W();return w7({delta:T,panZoom:R,transform:B,translateExtent:I,width:w,height:A})},setCenter:async(T,B,w)=>{let{width:A,height:R,maxZoom:I,panZoom:C}=W();if(!C)return!1;let P=typeof w?.zoom<"u"?w.zoom:I;return await C.setViewport({x:A/2-T*P,y:R/2-B*P,zoom:P},{duration:w?.duration,ease:w?.ease,interpolate:w?.interpolate}),!0},cancelConnection:()=>{z({connection:{...Z6}})},updateConnection:(T)=>{z({connection:T})},reset:()=>z({...M9()})}},Object.is);function b6({initialNodes:_,initialEdges:Q,defaultNodes:J,defaultEdges:q,initialWidth:U,initialHeight:G,initialMinZoom:Z,initialMaxZoom:F,initialFitViewOptions:H,fitView:Y,nodeOrigin:X,nodeExtent:K,zIndexMode:L,children:z}){let[W]=r.useState(()=>yG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Y,minZoom:Z,maxZoom:F,fitViewOptions:H,nodeOrigin:X,nodeExtent:K,zIndexMode:L}));return l.jsx(rq,{value:W,children:l.jsx(AU,{children:l.jsx(vU,{children:z})})})}function vG({children:_,nodes:Q,edges:J,defaultNodes:q,defaultEdges:U,width:G,height:Z,fitView:F,fitViewOptions:H,minZoom:Y,maxZoom:X,nodeOrigin:K,nodeExtent:L,zIndexMode:z}){if(r.useContext(M4))return l.jsx(l.Fragment,{children:_});return l.jsx(b6,{initialNodes:Q,initialEdges:J,defaultNodes:q,defaultEdges:U,initialWidth:G,initialHeight:Z,fitView:F,initialFitViewOptions:H,initialMinZoom:Y,initialMaxZoom:X,nodeOrigin:K,nodeExtent:L,zIndexMode:z,children:_})}var jG={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function VG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,className:U,nodeTypes:G,edgeTypes:Z,onNodeClick:F,onEdgeClick:H,onInit:Y,onMove:X,onMoveStart:K,onMoveEnd:L,onConnect:z,onConnectStart:W,onConnectEnd:O,onClickConnectStart:T,onClickConnectEnd:B,onNodeMouseEnter:w,onNodeMouseMove:A,onNodeMouseLeave:R,onNodeContextMenu:I,onNodeDoubleClick:C,onNodeDragStart:P,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:v,onEdgesDelete:E,onDelete:g,onSelectionChange:h,onSelectionDragStart:S,onSelectionDrag:b,onSelectionDragStop:j,onSelectionContextMenu:x,onSelectionStart:V,onSelectionEnd:D,onBeforeDelete:f,connectionMode:y,connectionLineType:p=W0.Bezier,connectionLineStyle:u,connectionLineComponent:s,connectionLineContainerStyle:t,deleteKeyCode:a="Backspace",selectionKeyCode:d="Shift",selectionOnDrag:c=!1,selectionMode:e=$2.Full,panActivationKeyCode:Q1="Space",multiSelectionKeyCode:G1=b2()?"Meta":"Control",zoomActivationKeyCode:$1=b2()?"Meta":"Control",snapToGrid:Z1,snapGrid:Y1,onlyRenderVisibleElements:K1=!1,selectNodesOnDrag:o,nodesDraggable:z1,autoPanOnNodeFocus:q1,nodesConnectable:y1,nodesFocusable:c1,nodeOrigin:l1=w9,edgesFocusable:k0,edgesReconnectable:F0,elementsSelectable:M0=!0,defaultViewport:a1=qU,minZoom:o1=0.5,maxZoom:n1=2,translateExtent:K0=v2,preventScrolling:B2=!0,nodeExtent:y0,defaultMarkerColor:M2="#b1b1b7",zoomOnScroll:T2=!0,zoomOnPinch:g2=!0,panOnScroll:S5=!1,panOnScrollSpeed:r0=0.5,panOnScrollMode:M=I0.Free,zoomOnDoubleClick:m=!0,panOnDrag:n=!0,onPaneClick:_1,onPaneMouseEnter:U1,onPaneMouseMove:W1,onPaneMouseLeave:L1,onPaneScroll:f1,onPaneContextMenu:A1,paneClickDistance:H0=1,nodeClickDistance:v0=0,children:y4,onReconnect:v4,onReconnectStart:t_,onReconnectEnd:o_,onEdgeContextMenu:n_,onEdgeDoubleClick:e_,onEdgeMouseEnter:_Q,onEdgeMouseMove:QQ,onEdgeMouseLeave:JQ,reconnectRadius:$Q=10,onNodesChange:qQ,onEdgesChange:UQ,noDragClassName:GQ="nodrag",noWheelClassName:ZQ="nowheel",noPanClassName:o6="nopan",fitView:n6,fitViewOptions:e6,connectOnClick:FQ,attributionPosition:KQ,proOptions:HQ,defaultEdgeOptions:XQ,elevateNodesOnSelect:YQ=!0,elevateEdgesOnSelect:LQ=!1,disableKeyboardA11y:_8=!1,autoPanOnConnect:zQ,autoPanOnNodeDrag:WQ,autoPanOnSelection:AQ=!0,autoPanSpeed:BQ,connectionRadius:MQ,isValidConnection:TQ,onError:RQ,style:OQ,id:Q8,nodeDragThreshold:fQ,connectionDragThreshold:IQ,viewport:wQ,onViewportChange:PQ,width:NQ,height:CQ,colorMode:SQ="light",debug:kQ,onScroll:J8,ariaLabelConfig:yQ,zIndexMode:$8="basic",...vQ},jQ){let j4=Q8||"1",VQ=FU(SQ),uQ=r.useCallback((q8)=>{q8.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),J8?.(q8)},[J8]);return l.jsx("div",{"data-testid":"rf__wrapper",...vQ,onScroll:uQ,style:{...OQ,...jG},ref:jQ,className:C1(["react-flow",U,VQ]),id:Q8,role:"application",children:l.jsxs(vG,{nodes:_,edges:Q,width:NQ,height:CQ,fitView:n6,fitViewOptions:e6,minZoom:o1,maxZoom:n1,nodeOrigin:l1,nodeExtent:y0,zIndexMode:$8,children:[l.jsx(ZU,{nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,onConnect:z,onConnectStart:W,onConnectEnd:O,onClickConnectStart:T,onClickConnectEnd:B,nodesDraggable:z1,autoPanOnNodeFocus:q1,nodesConnectable:y1,nodesFocusable:c1,edgesFocusable:k0,edgesReconnectable:F0,elementsSelectable:M0,elevateNodesOnSelect:YQ,elevateEdgesOnSelect:LQ,minZoom:o1,maxZoom:n1,nodeExtent:y0,onNodesChange:qQ,onEdgesChange:UQ,snapToGrid:Z1,snapGrid:Y1,connectionMode:y,translateExtent:K0,connectOnClick:FQ,defaultEdgeOptions:XQ,fitView:n6,fitViewOptions:e6,onNodesDelete:v,onEdgesDelete:E,onDelete:g,onNodeDragStart:P,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:b,onSelectionDragStart:S,onSelectionDragStop:j,onMove:X,onMoveStart:K,onMoveEnd:L,noPanClassName:o6,nodeOrigin:l1,rfId:j4,autoPanOnConnect:zQ,autoPanOnNodeDrag:WQ,autoPanSpeed:BQ,onError:RQ,connectionRadius:MQ,isValidConnection:TQ,selectNodesOnDrag:o,nodeDragThreshold:fQ,connectionDragThreshold:IQ,onBeforeDelete:f,debug:kQ,ariaLabelConfig:yQ,zIndexMode:$8}),l.jsx(SG,{onInit:Y,onNodeClick:F,onEdgeClick:H,onNodeMouseEnter:w,onNodeMouseMove:A,onNodeMouseLeave:R,onNodeContextMenu:I,onNodeDoubleClick:C,nodeTypes:G,edgeTypes:Z,connectionLineType:p,connectionLineStyle:u,connectionLineComponent:s,connectionLineContainerStyle:t,selectionKeyCode:d,selectionOnDrag:c,selectionMode:e,deleteKeyCode:a,multiSelectionKeyCode:G1,panActivationKeyCode:Q1,zoomActivationKeyCode:$1,onlyRenderVisibleElements:K1,defaultViewport:a1,translateExtent:K0,minZoom:o1,maxZoom:n1,preventScrolling:B2,zoomOnScroll:T2,zoomOnPinch:g2,zoomOnDoubleClick:m,panOnScroll:S5,panOnScrollSpeed:r0,panOnScrollMode:M,panOnDrag:n,autoPanOnSelection:AQ,onPaneClick:_1,onPaneMouseEnter:U1,onPaneMouseMove:W1,onPaneMouseLeave:L1,onPaneScroll:f1,onPaneContextMenu:A1,paneClickDistance:H0,nodeClickDistance:v0,onSelectionContextMenu:x,onSelectionStart:V,onSelectionEnd:D,onReconnect:v4,onReconnectStart:t_,onReconnectEnd:o_,onEdgeContextMenu:n_,onEdgeDoubleClick:e_,onEdgeMouseEnter:_Q,onEdgeMouseMove:QQ,onEdgeMouseLeave:JQ,reconnectRadius:$Q,defaultMarkerColor:M2,noDragClassName:GQ,noWheelClassName:ZQ,noPanClassName:o6,rfId:j4,disableKeyboardA11y:_8,nodeExtent:y0,viewport:wQ,onViewportChange:PQ,nodesDraggable:z1}),l.jsx($U,{onSelectionChange:h}),y4,l.jsx(nq,{proOptions:HQ,position:KQ}),l.jsx(oq,{rfId:j4,disableKeyboardA11y:_8})]})})}var n9=C9(VG);function e9(_){let[Q,J]=r.useState(_),q=r.useCallback((U)=>J((G)=>N9(U,G)),[]);return[Q,J,q]}var IB=i1.error014();function uG({dimensions:_,lineWidth:Q,variant:J,className:q}){return l.jsx("path",{strokeWidth:Q,d:`M${_[0]/2} 0 V${_[1]} M0 ${_[1]/2} H${_[0]}`,className:C1(["react-flow__background-pattern",J,q])})}function bG({radius:_,className:Q}){return l.jsx("circle",{cx:_,cy:_,r:_,className:C1(["react-flow__background-pattern","dots",Q])})}var A0;(function(_){_.Lines="lines",_.Dots="dots",_.Cross="cross"})(A0||(A0={}));var DG={[A0.Dots]:1,[A0.Lines]:1,[A0.Cross]:6},hG=(_)=>({transform:_.transform,patternId:`pattern-${_.rfId}`});function __({id:_,variant:Q=A0.Dots,gap:J=20,size:q,lineWidth:U=1,offset:G=0,color:Z,bgColor:F,style:H,className:Y,patternClassName:X}){let K=r.useRef(null),{transform:L,patternId:z}=M1(hG,P1),W=q||DG[Q],O=Q===A0.Dots,T=Q===A0.Cross,B=Array.isArray(J)?J:[J,J],w=[B[0]*L[2]||1,B[1]*L[2]||1],A=W*L[2],R=Array.isArray(G)?G:[G,G],I=T?[A,A]:w,C=[R[0]*L[2]+I[0]/2,R[1]*L[2]+I[1]/2],P=`${z}${_?_:""}`;return l.jsxs("svg",{className:C1(["react-flow__background",Y]),style:{...H,...T4,"--xy-background-color-props":F,"--xy-background-pattern-color-props":Z},ref:K,"data-testid":"rf__background",children:[l.jsx("pattern",{id:P,x:L[0]%w[0],y:L[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:O?l.jsx(bG,{radius:A/2,className:X}):l.jsx(uG,{dimensions:I,lineWidth:U,variant:Q,className:X})}),l.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${P})`})]})}__.displayName="Background";var Q_=r.memo(__);function EG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:l.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function xG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:l.jsx("path",{d:"M0 0h32v4.2H0z"})})}function mG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:l.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function gG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function pG(){return l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:l.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function W4({children:_,className:Q,...J}){return l.jsx("button",{type:"button",className:C1(["react-flow__controls-button",Q]),...J,children:_})}var cG=(_)=>({isInteractive:_.nodesDraggable||_.nodesConnectable||_.elementsSelectable,minZoomReached:_.transform[2]<=_.minZoom,maxZoomReached:_.transform[2]>=_.maxZoom,ariaLabelConfig:_.ariaLabelConfig});function J_({style:_,showZoom:Q=!0,showFitView:J=!0,showInteractive:q=!0,fitViewOptions:U,onZoomIn:G,onZoomOut:Z,onFitView:F,onInteractiveChange:H,className:Y,children:X,position:K="bottom-left",orientation:L="vertical","aria-label":z}){let W=N1(),{isInteractive:O,minZoomReached:T,maxZoomReached:B,ariaLabelConfig:w}=M1(cG,P1),{zoomIn:A,zoomOut:R,fitView:I}=R5(),C=()=>{A(),G?.()},P=()=>{R(),Z?.()},k=()=>{I(U),F?.()},N=()=>{W.setState({nodesDraggable:!O,nodesConnectable:!O,elementsSelectable:!O}),H?.(!O)};return l.jsxs(K2,{className:C1(["react-flow__controls",L==="horizontal"?"horizontal":"vertical",Y]),position:K,style:_,"data-testid":"rf__controls","aria-label":z??w["controls.ariaLabel"],children:[Q&&l.jsxs(l.Fragment,{children:[l.jsx(W4,{onClick:C,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:B,children:l.jsx(EG,{})}),l.jsx(W4,{onClick:P,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:T,children:l.jsx(xG,{})})]}),J&&l.jsx(W4,{className:"react-flow__controls-fitview",onClick:k,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:l.jsx(mG,{})}),q&&l.jsx(W4,{className:"react-flow__controls-interactive",onClick:N,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:O?l.jsx(pG,{}):l.jsx(gG,{})}),X]})}J_.displayName="Controls";var $_=r.memo(J_);function lG({id:_,x:Q,y:J,width:q,height:U,style:G,color:Z,strokeColor:F,strokeWidth:H,className:Y,borderRadius:X,shapeRendering:K,selected:L,onClick:z}){let{background:W,backgroundColor:O}=G||{},T=Z||W||O;return l.jsx("rect",{className:C1(["react-flow__minimap-node",{selected:L},Y]),x:Q,y:J,rx:X,ry:X,width:q,height:U,style:{fill:T,stroke:F,strokeWidth:H},shapeRendering:K,onClick:z?(B)=>z(B,_):void 0})}var rG=r.memo(lG),iG=(_)=>_.nodes.map((Q)=>Q.id),v6=(_)=>_ instanceof Function?_:()=>_;function dG({nodeStrokeColor:_,nodeColor:Q,nodeClassName:J="",nodeBorderRadius:q=5,nodeStrokeWidth:U,nodeComponent:G=rG,onClick:Z}){let F=M1(iG,P1),H=v6(Q),Y=v6(_),X=v6(J),K=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return l.jsx(l.Fragment,{children:F.map((L)=>l.jsx(sG,{id:L,nodeColorFunc:H,nodeStrokeColorFunc:Y,nodeClassNameFunc:X,nodeBorderRadius:q,nodeStrokeWidth:U,NodeComponent:G,onClick:Z,shapeRendering:K},L))})}function aG({id:_,nodeColorFunc:Q,nodeStrokeColorFunc:J,nodeClassNameFunc:q,nodeBorderRadius:U,nodeStrokeWidth:G,shapeRendering:Z,NodeComponent:F,onClick:H}){let{node:Y,x:X,y:K,width:L,height:z}=M1((W)=>{let O=W.nodeLookup.get(_);if(!O)return{node:void 0,x:0,y:0,width:0,height:0};let T=O.internals.userNode,{x:B,y:w}=O.internals.positionAbsolute,{width:A,height:R}=Q0(T);return{node:T,x:B,y:w,width:A,height:R}},P1);if(!Y||Y.hidden||!W6(Y))return null;return l.jsx(F,{x:X,y:K,width:L,height:z,style:Y.style,selected:!!Y.selected,className:q(Y),color:Q(Y),borderRadius:U,strokeColor:J(Y),strokeWidth:G,shapeRendering:Z,onClick:H,id:Y.id})}var sG=r.memo(aG),tG=r.memo(dG),oG=200,nG=150,eG=(_)=>!_.hidden,_Z=(_)=>{let Q={x:-_.transform[0]/_.transform[2],y:-_.transform[1]/_.transform[2],width:_.width/_.transform[2],height:_.height/_.transform[2]},J=!1;for(let q of _.nodeLookup.values())if(!q.hidden){J=!0;break}return{viewBB:Q,boundingRect:J?Y6(Z2(_.nodeLookup,{filter:eG}),Q):Q,rfId:_.rfId,panZoom:_.panZoom,translateExtent:_.translateExtent,flowWidth:_.width,flowHeight:_.height,ariaLabelConfig:_.ariaLabelConfig}},T9=(_,Q)=>_.x===Q.x&&_.y===Q.y&&_.width===Q.width&&_.height===Q.height,QZ=(_,Q)=>T9(_.viewBB,Q.viewBB)&&T9(_.boundingRect,Q.boundingRect)&&_.rfId===Q.rfId&&_.panZoom===Q.panZoom&&_.translateExtent===Q.translateExtent&&_.flowWidth===Q.flowWidth&&_.flowHeight===Q.flowHeight&&_.ariaLabelConfig===Q.ariaLabelConfig,JZ="react-flow__minimap-desc";function q_({style:_,className:Q,nodeStrokeColor:J,nodeColor:q,nodeClassName:U="",nodeBorderRadius:G=5,nodeStrokeWidth:Z,nodeComponent:F,bgColor:H,maskColor:Y,maskStrokeColor:X,maskStrokeWidth:K,position:L="bottom-right",onClick:z,onNodeClick:W,pannable:O=!1,zoomable:T=!1,ariaLabel:B,inversePan:w,zoomStep:A=1,offsetScale:R=5}){let I=N1(),C=r.useRef(null),{boundingRect:P,panZoom:k,viewBB:N,rfId:v,translateExtent:E,flowWidth:g,flowHeight:h,ariaLabelConfig:S}=M1(_Z,QZ),b=_?.width??oG,j=_?.height??nG,x=P.width/b,V=P.height/j,D=Math.max(x,V),f=D*b,y=D*j,p=R*D,u=P.x-(f-P.width)/2-p,s=P.y-(y-P.height)/2-p,t=f+p*2,a=y+p*2,d=`${JZ}-${v}`,c=r.useRef(0),e=r.useRef();c.current=D,r.useEffect(()=>{let Y1=I.getState().panZoom;if(C.current&&Y1)return e.current=v7({domNode:C.current,panZoom:Y1,getTransform:()=>I.getState().transform,getViewScale:()=>c.current}),()=>{e.current?.destroy()}},[k]),r.useEffect(()=>{e.current?.update({translateExtent:E,width:g,height:h,inversePan:w,pannable:O,zoomStep:A,zoomable:T})},[O,T,w,A,E,g,h]);let Q1=z?(Y1)=>{let[K1,o]=e.current?.pointer(Y1)||[0,0];z(Y1,{x:K1,y:o})}:void 0,G1=r.useCallback((Y1,K1)=>{let o=I.getState().nodeLookup.get(K1).internals.userNode;W?.(Y1,o)},[W]),$1=W?G1:void 0,Z1=B??S["minimap.ariaLabel"];return l.jsx(K2,{position:L,style:{..._,"--xy-minimap-background-color-props":typeof H==="string"?H:void 0,"--xy-minimap-mask-background-color-props":typeof Y==="string"?Y:void 0,"--xy-minimap-mask-stroke-color-props":typeof X==="string"?X:void 0,"--xy-minimap-mask-stroke-width-props":typeof K==="number"?K*D:void 0,"--xy-minimap-node-background-color-props":typeof q==="string"?q:void 0,"--xy-minimap-node-stroke-color-props":typeof J==="string"?J:void 0,"--xy-minimap-node-stroke-width-props":typeof Z==="number"?Z:void 0},className:C1(["react-flow__minimap",Q]),"data-testid":"rf__minimap",children:l.jsxs("svg",{width:b,height:j,viewBox:`${u} ${s} ${t} ${a}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":d,ref:C,onClick:Q1,children:[Z1&&l.jsx("title",{id:d,children:Z1}),l.jsx(tG,{onClick:$1,nodeColor:q,nodeStrokeColor:J,nodeBorderRadius:G,nodeClassName:U,nodeStrokeWidth:Z,nodeComponent:F}),l.jsx("path",{className:"react-flow__minimap-mask",d:`M${u-p},${s-p}h${t+p*2}v${a+p*2}h${-t-p*2}z
34
+ M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}q_.displayName="MiniMap";var U_=r.memo(q_),$Z=(_)=>(Q)=>_?`${Math.max(1/Q.transform[2],1)}`:void 0,qZ={[m0.Line]:"right",[m0.Handle]:"bottom-right"};function UZ({nodeId:_,position:Q,variant:J=m0.Handle,className:q,style:U=void 0,children:G,color:Z,minWidth:F=10,minHeight:H=10,maxWidth:Y=Number.MAX_VALUE,maxHeight:X=Number.MAX_VALUE,keepAspectRatio:K=!1,resizeDirection:L,autoScale:z=!0,shouldResize:W,onResizeStart:O,onResize:T,onResizeEnd:B}){let w=u6(),A=typeof _==="string"?_:w,R=N1(),I=r.useRef(null),C=J===m0.Handle,P=M1(r.useCallback($Z(C&&z),[C,z]),P1),k=r.useRef(null),N=Q??qZ[J];r.useEffect(()=>{if(!I.current||!A)return;if(!k.current)k.current=D7({domNode:I.current,nodeId:A,getStoreItems:()=>{let{nodeLookup:E,transform:g,snapGrid:h,snapToGrid:S,nodeOrigin:b,domNode:j}=R.getState();return{nodeLookup:E,transform:g,snapGrid:h,snapToGrid:S,nodeOrigin:b,paneDomNode:j}},onChange:(E,g)=>{let{triggerNodeChanges:h,nodeLookup:S,parentLookup:b,nodeOrigin:j}=R.getState(),x=[],V={x:E.x,y:E.y},D=S.get(A);if(D&&D.expandParent&&D.parentId){let f=D.origin??j,y=E.width??D.measured.width??0,p=E.height??D.measured.height??0,u={id:D.id,parentId:D.parentId,rect:{width:y,height:p,...A6({x:E.x??D.position.x,y:E.y??D.position.y},{width:y,height:p},D.parentId,S,f)}},s=X4([u],S,b,j);x.push(...s),V.x=E.x?Math.max(f[0]*y,E.x):void 0,V.y=E.y?Math.max(f[1]*p,E.y):void 0}if(V.x!==void 0&&V.y!==void 0){let f={id:A,type:"position",position:{...V}};x.push(f)}if(E.width!==void 0&&E.height!==void 0){let y={id:A,type:"dimensions",resizing:!0,setAttributes:!L?!0:L==="horizontal"?"width":"height",dimensions:{width:E.width,height:E.height}};x.push(y)}for(let f of g){let y={...f,type:"position"};x.push(y)}h(x)},onEnd:({width:E,height:g})=>{let h={id:A,type:"dimensions",resizing:!1,dimensions:{width:E,height:g}};R.getState().triggerNodeChanges([h])}});return k.current.update({controlPosition:N,boundaries:{minWidth:F,minHeight:H,maxWidth:Y,maxHeight:X},keepAspectRatio:K,resizeDirection:L,onResizeStart:O,onResize:T,onResizeEnd:B,shouldResize:W}),()=>{k.current?.destroy()}},[N,F,H,Y,X,K,O,T,B,W]);let v=N.split("-");return l.jsx("div",{className:C1(["react-flow__resize-control","nodrag",...v,J,q]),ref:I,style:{...U,scale:P,...Z&&{[C?"backgroundColor":"borderColor"]:Z}},children:G})}var wB=r.memo(UZ);var GZ=(_)=>_.domNode?.querySelector(".react-flow__renderer");function ZZ({children:_}){let Q=M1(GZ);if(!Q)return null;return R9.createPortal(_,Q)}var FZ=(_,Q)=>_?.internals.positionAbsolute.x!==Q?.internals.positionAbsolute.x||_?.internals.positionAbsolute.y!==Q?.internals.positionAbsolute.y||_?.measured.width!==Q?.measured.width||_?.measured.height!==Q?.measured.height||_?.selected!==Q?.selected||_?.internals.z!==Q?.internals.z,KZ=(_,Q)=>{if(_.size!==Q.size)return!1;for(let[J,q]of _)if(FZ(q,Q.get(J)))return!1;return!0},HZ=(_)=>({x:_.transform[0],y:_.transform[1],zoom:_.transform[2],selectedNodesCount:_.nodes.filter((Q)=>Q.selected).length});function G_({nodeId:_,children:Q,className:J,style:q,isVisible:U,position:G=J1.Top,offset:Z=10,align:F="center",...H}){let Y=u6(),X=r.useCallback((I)=>{return(Array.isArray(_)?_:[_||Y||""]).reduce((k,N)=>{let v=I.nodeLookup.get(N);if(v)k.set(v.id,v);return k},new Map)},[_,Y]),K=M1(X,KZ),{x:L,y:z,zoom:W,selectedNodesCount:O}=M1(HZ,P1);if(!(typeof U==="boolean"?U:K.size===1&&K.values().next().value?.selected&&O===1)||!K.size)return null;let B=Z2(K),w=Array.from(K.values()),A=Math.max(...w.map((I)=>I.internals.z+1)),R={position:"absolute",transform:T7(B,{x:L,y:z,zoom:W},G,Z,F),zIndex:A,...q};return l.jsx(ZZ,{children:l.jsx("div",{style:R,className:C1(["react-flow__node-toolbar",J]),...H,"data-id":w.reduce((I,C)=>`${I}${C.id} `,"").trim(),children:Q})})}var D1=h1(X0(),1);var Z_={x:{title:"X",fill:"currentColor",d:"M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"},youtube:{title:"YouTube",fill:"#FF0000",d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"},tiktok:{title:"TikTok",fill:"currentColor",d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"},discord:{title:"Discord",fill:"#5865F2",d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},resend:{title:"Resend",fill:"currentColor",d:"M2.023 0v24h5.553v-8.434h2.998L15.326 24h6.65l-5.372-9.258a7.652 7.652 0 0 0 3.316-3.016c.709-1.21 1.062-2.57 1.062-4.08 0-1.462-.353-2.767-1.062-3.91-.709-1.165-1.692-2.079-2.95-2.742C15.737.331 14.355 0 12.823 0Zm5.553 4.87h4.219c.731 0 1.349.125 1.851.376.526.252.925.618 1.2 1.098.274.457.412.994.412 1.611S15.132 9.12 14.88 9.6c-.229.48-.572.856-1.03 1.13-.434.252-.948.38-1.542.38H7.576Z"},linkedin:{title:"LinkedIn",fill:"#0A66C2",d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"},reddit:{title:"Reddit",fill:"#FF4500",d:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},bluesky:{title:"Bluesky",fill:"#0285FF",d:"M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565.139 1.908 0 3.08 0 3.768c0 .69.378 5.65.624 6.479.815 2.736 3.713 3.66 6.383 3.364.136-.02.275-.039.415-.056-.138.022-.276.04-.415.056-3.912.58-7.387 2.005-2.83 7.078 5.013 5.19 6.87-1.113 7.823-4.308.953 3.195 2.05 9.271 7.733 4.308 4.267-4.308 1.172-6.498-2.74-7.078a8.741 8.741 0 0 1-.415-.056c.14.017.279.036.415.056 2.67.297 5.568-.628 6.383-3.364.246-.828.624-5.79.624-6.478 0-.69-.139-1.861-.902-2.206-.659-.298-1.664-.62-4.3 1.24C16.046 4.748 13.087 8.687 12 10.8Z"},instagram:{title:"Instagram",fill:"#FF0069",d:"M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077"},github:{title:"GitHub",fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},stripe:{title:"Stripe",fill:"#635BFF",d:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"},slack:{title:"Slack",fill:"#4A154B",d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"},openai:{title:"OpenAI",fill:"#412991",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"},anthropic:{title:"Anthropic",fill:"currentColor",d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"},twilio:{title:"Twilio",fill:"#F22F46",d:"M12 0C5.381-.008.008 5.352 0 11.971V12c0 6.64 5.359 12 12 12 6.64 0 12-5.36 12-12 0-6.641-5.36-12-12-12zm0 20.801c-4.846.015-8.786-3.904-8.801-8.75V12c-.014-4.846 3.904-8.786 8.75-8.801H12c4.847-.014 8.786 3.904 8.801 8.75V12c.015 4.847-3.904 8.786-8.75 8.801H12zm5.44-11.76c0 1.359-1.12 2.479-2.481 2.479-1.366-.007-2.472-1.113-2.479-2.479 0-1.361 1.12-2.481 2.479-2.481 1.361 0 2.481 1.12 2.481 2.481zm0 5.919c0 1.36-1.12 2.48-2.481 2.48-1.367-.008-2.473-1.114-2.479-2.48 0-1.359 1.12-2.479 2.479-2.479 1.361-.001 2.481 1.12 2.481 2.479zm-5.919 0c0 1.36-1.12 2.48-2.479 2.48-1.368-.007-2.475-1.113-2.481-2.48 0-1.359 1.12-2.479 2.481-2.479 1.358-.001 2.479 1.12 2.479 2.479zm0-5.919c0 1.359-1.12 2.479-2.479 2.479-1.367-.007-2.475-1.112-2.481-2.479 0-1.361 1.12-2.481 2.481-2.481 1.358 0 2.479 1.12 2.479 2.481z"},sendgrid:{title:"SendGrid",fill:"#51A9E3",d:"M.8 24h13.6c.88 0 1.6-.72 1.6-1.6v-4.8c0-.88-.72-1.6-1.6-1.6H9.6c-.88 0-1.6-.72-1.6-1.6V9.6C8 8.72 7.28 8 6.4 8H1.6C.72 8 0 8.72 0 9.6v13.6c0 .44.36.8.8.8zM23.2 0H9.6C8.72 0 8 .72 8 1.6v4.8C8 7.28 8.72 8 9.6 8h4.8c.88 0 1.6.72 1.6 1.6v4.8c0 .88.72 1.6 1.6 1.6h4.8c.88 0 1.6-.72 1.6-1.6V.8c0-.44-.36-.8-.8-.8Z"},mailgun:{title:"Mailgun",fill:"#F06B66",d:"M11.837 0c6.602 0 11.984 5.381 11.984 11.994-.017 2.99-3.264 4.84-5.844 3.331a3.805 3.805 0 0 1-.06-.035l-.055-.033-.022.055c-2.554 4.63-9.162 4.758-11.894.232-2.732-4.527.46-10.313 5.746-10.416a6.868 6.868 0 0 1 7.002 6.866 1.265 1.265 0 0 0 2.52 0c0-5.18-4.197-9.38-9.377-9.387C4.611 2.594.081 10.41 3.683 16.673c3.238 5.632 11.08 6.351 15.289 1.402l1.997 1.686A11.95 11.95 0 0 1 11.837 24C2.6 23.72-2.87 13.543 1.992 5.684A12.006 12.006 0 0 1 11.837 0Zm0 7.745c-3.276-.163-5.5 3.281-4.003 6.2a4.26 4.26 0 0 0 4.014 2.31c3.276-.171 5.137-3.824 3.35-6.575a4.26 4.26 0 0 0-3.36-1.935Zm0 2.53c1.324 0 2.152 1.433 1.49 2.58a1.72 1.72 0 0 1-1.49.86 1.72 1.72 0 1 1 0-3.44Z"},notion:{title:"Notion",fill:"currentColor",d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},linear:{title:"Linear",fill:"#5E6AD2",d:"M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z"},jira:{title:"Jira",fill:"#0052CC",d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"},hubspot:{title:"HubSpot",fill:"#FF7A59",d:"M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z"},paypal:{title:"PayPal",fill:"#003087",d:"M7.016 19.198h-4.2a.562.562 0 0 1-.555-.65L5.093.584A.692.692 0 0 1 5.776 0h7.222c3.417 0 5.904 2.488 5.846 5.5-.006.25-.027.5-.066.747A6.794 6.794 0 0 1 12.071 12H8.743a.69.69 0 0 0-.682.583l-.325 2.056-.013.083-.692 4.39-.015.087zM19.79 6.142c-.01.087-.01.175-.023.261a7.76 7.76 0 0 1-7.695 6.598H9.007l-.283 1.795-.013.083-.692 4.39-.134.843-.014.088H6.86l-.497 3.15a.562.562 0 0 0 .555.65h3.612c.34 0 .63-.249.683-.585l.952-6.031a.692.692 0 0 1 .683-.584h2.126a6.793 6.793 0 0 0 6.707-5.752c.306-1.95-.466-3.744-1.89-4.906z"},shopify:{title:"Shopify",fill:"#7AB55C",d:"M15.337 23.979l7.216-1.561s-2.604-17.613-2.625-17.73c-.018-.116-.114-.192-.211-.192s-1.929-.136-1.929-.136-1.275-1.274-1.439-1.411c-.045-.037-.075-.057-.121-.074l-.914 21.104h.023zM11.71 11.305s-.81-.424-1.774-.424c-1.447 0-1.504.906-1.504 1.141 0 1.232 3.24 1.715 3.24 4.629 0 2.295-1.44 3.76-3.406 3.76-2.354 0-3.54-1.465-3.54-1.465l.646-2.086s1.245 1.066 2.28 1.066c.675 0 .975-.545.975-.932 0-1.619-2.654-1.694-2.654-4.359-.034-2.237 1.571-4.416 4.827-4.416 1.257 0 1.875.361 1.875.361l-.945 2.715-.02.01zM11.17.83c.136 0 .271.038.405.135-.984.465-2.064 1.639-2.508 3.992-.656.213-1.293.405-1.889.578C7.697 3.75 8.951.84 11.17.84V.83zm1.235 2.949v.135c-.754.232-1.583.484-2.394.736.466-1.777 1.333-2.645 2.085-2.971.193.501.309 1.176.309 2.1zm.539-2.234c.694.074 1.141.867 1.429 1.755-.349.114-.735.231-1.158.366v-.252c0-.752-.096-1.371-.271-1.871v.002zm2.992 1.289c-.02 0-.06.021-.078.021s-.289.075-.714.21c-.423-1.233-1.176-2.37-2.508-2.37h-.115C12.135.209 11.669 0 11.265 0 8.159 0 6.675 3.877 6.21 5.846c-1.194.365-2.063.636-2.16.674-.675.213-.694.232-.772.87-.075.462-1.83 14.063-1.83 14.063L15.009 24l.927-21.166z"},sentry:{title:"Sentry",fill:"#362D59",d:"M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z"},vercel:{title:"Vercel",fill:"currentColor",d:"M24 22.525H0l12-21.05 12 21.05z"},supabase:{title:"Supabase",fill:"#3FCF8E",d:"M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z"},clerk:{title:"Clerk",fill:"#6C47FF",d:"m21.47 20.829-2.881-2.881a.572.572 0 0 0-.7-.084 6.854 6.854 0 0 1-7.081 0 .576.576 0 0 0-.7.084l-2.881 2.881a.576.576 0 0 0-.103.69.57.57 0 0 0 .166.186 12 12 0 0 0 14.113 0 .58.58 0 0 0 .239-.423.576.576 0 0 0-.172-.453Zm.002-17.668-2.88 2.88a.569.569 0 0 1-.701.084A6.857 6.857 0 0 0 8.724 8.08a6.862 6.862 0 0 0-1.222 3.692 6.86 6.86 0 0 0 .978 3.764.573.573 0 0 1-.083.699l-2.881 2.88a.567.567 0 0 1-.864-.063A11.993 11.993 0 0 1 6.771 2.7a11.99 11.99 0 0 1 14.637-.405.566.566 0 0 1 .232.418.57.57 0 0 1-.168.448Zm-7.118 12.261a3.427 3.427 0 1 0 0-6.854 3.427 3.427 0 0 0 0 6.854Z"},aws:{title:"Amazon Web Services",fill:"#232F3E",d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zM22.792 14.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z"},figma:{title:"Figma",fill:"#F24E1E",d:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},airtable:{title:"Airtable",fill:"#18BFFF",d:"M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z"},intercom:{title:"Intercom",fill:"#6AFDEF",d:"M21 0H3C1.343 0 0 1.343 0 3v18c0 1.658 1.343 3 3 3h18c1.658 0 3-1.342 3-3V3c0-1.657-1.342-3-3-3zm-5.801 4.399c0-.44.36-.8.802-.8.44 0 .8.36.8.8v10.688c0 .442-.36.801-.8.801-.443 0-.802-.359-.802-.801V4.399zM11.2 3.994c0-.44.357-.799.8-.799s.8.359.8.799v11.602c0 .44-.357.8-.8.8s-.8-.36-.8-.8V3.994zm-4 .405c0-.44.359-.8.799-.8.443 0 .802.36.802.8v10.688c0 .442-.36.801-.802.801-.44 0-.799-.359-.799-.801V4.399zM3.199 6c0-.442.36-.8.802-.8.44 0 .799.358.799.8v7.195c0 .441-.359.8-.799.8-.443 0-.802-.36-.802-.8V6zM20.52 18.202c-.123.105-3.086 2.593-8.52 2.593-5.433 0-8.397-2.486-8.521-2.593-.335-.288-.375-.792-.086-1.128.285-.334.79-.375 1.125-.09.047.041 2.693 2.211 7.481 2.211 4.848 0 7.456-2.186 7.479-2.207.334-.289.839-.25 1.128.086.289.336.25.84-.086 1.128zm.281-5.007c0 .441-.36.8-.801.8-.441 0-.801-.36-.801-.8V6c0-.442.361-.8.801-.8.441 0 .801.357.801.8v7.195z"},posthog:{title:"PostHog",fill:"currentColor",d:"M9.854 14.5 5 9.647.854 5.5A.5.5 0 0 0 0 5.854V8.44a.5.5 0 0 0 .146.353L5 13.647l.147.146L9.854 18.5l.146.147v-.049c.065.03.134.049.207.049h2.586a.5.5 0 0 0 .353-.854L9.854 14.5zm0-5-4-4a.487.487 0 0 0-.409-.144.515.515 0 0 0-.356.21.493.493 0 0 0-.089.288V8.44a.5.5 0 0 0 .147.353l9 9a.5.5 0 0 0 .853-.354v-2.585a.5.5 0 0 0-.146-.354l-5-5zm1-4a.5.5 0 0 0-.854.354V8.44a.5.5 0 0 0 .147.353l4 4a.5.5 0 0 0 .853-.354V9.854a.5.5 0 0 0-.146-.354l-4-4zm12.647 11.515a3.863 3.863 0 0 1-2.232-1.1l-4.708-4.707a.5.5 0 0 0-.854.354v6.585a.5.5 0 0 0 .5.5H23.5a.5.5 0 0 0 .5-.5v-.6c0-.276-.225-.497-.499-.532zm-5.394.032a.8.8 0 1 1 0-1.6.8.8 0 0 1 0 1.6zM.854 15.5a.5.5 0 0 0-.854.354v2.293a.5.5 0 0 0 .5.5h2.293c.222 0 .39-.135.462-.309a.493.493 0 0 0-.109-.545L.854 15.501zM5 14.647.854 10.5a.5.5 0 0 0-.854.353v2.586a.5.5 0 0 0 .146.353L4.854 18.5l.146.147h2.793a.5.5 0 0 0 .353-.854L5 14.647z"},datadog:{title:"Datadog",fill:"#632CA6",d:"M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"},algolia:{title:"Algolia",fill:"#003DFF",d:"M12 0C5.445 0 .103 5.285.01 11.817c-.097 6.634 5.285 12.131 11.92 12.17a11.91 11.91 0 0 0 5.775-1.443.281.281 0 0 0 .052-.457l-1.122-.994a.79.79 0 0 0-.833-.14 9.693 9.693 0 0 1-3.923.77c-5.36-.067-9.692-4.527-9.607-9.888.084-5.293 4.417-9.573 9.73-9.573h9.73v17.296l-5.522-4.907a.407.407 0 0 0-.596.063 4.52 4.52 0 0 1-3.934 1.793 4.538 4.538 0 0 1-4.192-4.168 4.53 4.53 0 0 1 4.512-4.872 4.532 4.532 0 0 1 4.509 4.126c.018.205.11.397.265.533l1.438 1.275a.28.28 0 0 0 .462-.158 6.82 6.82 0 0 0 .099-1.725c-.232-3.376-2.966-6.092-6.345-6.3-3.873-.24-7.11 2.79-7.214 6.588-.1 3.7 2.933 6.892 6.634 6.974a6.75 6.75 0 0 0 4.136-1.294l7.212 6.394a.48.48 0 0 0 .797-.36V.456A.456.456 0 0 0 23.54 0Z"},cloudflare:{title:"Cloudflare",fill:"#F38020",d:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727"},upstash:{title:"Upstash",fill:"#00E9A3",d:"M13.8027 0C11.193 0 8.583.9952 6.5918 2.9863c-3.9823 3.9823-3.9823 10.4396 0 14.4219 1.9911 1.9911 5.2198 1.9911 7.211 0 1.991-1.9911 1.991-5.2198 0-7.211L12 12c.9956.9956.9956 2.6098 0 3.6055-.9956.9955-2.6099.9955-3.6055 0-2.9866-2.9868-2.9866-7.8297 0-10.8164 2.9868-2.9868 7.8297-2.9868 10.8164 0l1.8028-1.8028C19.0225.9952 16.4125 0 13.8027 0zM12 12c-.9956-.9956-.9956-2.6098 0-3.6055.9956-.9955 2.6098-.9955 3.6055 0 2.9867 2.9868 2.9867 7.8297 0 10.8164-2.9867 2.9868-7.8297 2.9868-10.8164 0l-1.8028 1.8028c3.9823 3.9822 10.4396 3.9822 14.4219 0 3.9823-3.9824 3.9823-10.4396 0-14.4219-.9956-.9956-2.3006-1.4922-3.6055-1.4922-1.3048 0-2.6099.4966-3.6054 1.4922-1.9912 1.9912-1.9912 5.2198 0 7.211z"},mixpanel:{title:"Mixpanel",fill:"#7856FF",d:"M6.967 9.996h3.053c-.763-.477-1.048-1.145-1.431-2.384L7.443 3.366C6.919 1.458 6.49.551 4.39.551H.004v1.145h.621c1.286 0 1.431.477 1.814 1.908L3.44 7.326c.524 1.814 1.337 2.67 3.53 2.67h-.003Zm7.06 0h3.053c2.194 0 2.956-.86 3.484-2.67l1.001-3.722c.382-1.431.57-1.908 1.814-1.908H24V.551h-4.34c-2.146 0-2.576.86-3.053 2.815l-1.145 4.246c-.384 1.286-.673 1.907-1.435 2.384Zm-4.007 4.008h4.007V9.996H10.02v4.008ZM0 23.449h4.39c2.1 0 2.529-.907 3.053-2.815l1.146-4.246c.383-1.239.668-1.907 1.431-2.384H6.967c-2.194 0-3.007.86-3.531 2.67l-1.001 3.722c-.383 1.431-.524 1.907-1.814 1.907H0v1.146Zm19.65 0h4.343v-1.146h-.622c-1.239 0-1.431-.476-1.814-1.907l-1.001-3.722c-.524-1.814-1.286-2.67-3.483-2.67h-3.046c.762.477 1.041 1.098 1.424 2.384l1.145 4.246c.477 1.955.907 2.815 3.054 2.815Z"},gemini:{title:"Google Gemini",fill:"#8E75B2",d:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"}};var F1=h1(O5(),1),YZ="https://brand.volter.ai/logo/twin-world/svg?size=64&variant=mono";function f5({href:_,onClick:Q}){return F1.jsxDEV("h1",{children:F1.jsxDEV("a",{href:_,onClick:Q,children:[F1.jsxDEV("img",{src:YZ,alt:"",width:24,height:24,style:{verticalAlign:"middle"}},void 0,!1,void 0,this),F1.jsxDEV("span",{className:"brand-name",children:" Volter World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}async function P0(_){return(await _.json().catch(()=>({}))).error??`answered ${_.status}`}function K_(_,Q,J=0,q=""){let[U,G]=D1.useState({state:"loading"});return D1.useEffect(()=>{G({state:"loading"})},[q,Q]),D1.useEffect(()=>{if(!Q)return;let Z=!0;return(async()=>{try{let F=await _(Q),H=F.ok?{state:"ok",data:await F.json()}:{state:"error",status:F.status,error:await P0(F)};if(Z)G(H)}catch(F){if(Z)G({state:"error",status:0,error:String(F)})}})(),()=>{Z=!1}},[q,Q,J]),U}function g1({load:_,what:Q,retry:J,lines:q=3}){if(_.state==="loading")return F1.jsxDEV(LZ,{lines:q,label:`Loading ${Q}…`},void 0,!1,void 0,this);if(_.state==="error")return F1.jsxDEV("div",{role:"alert",className:"error-state",children:[F1.jsxDEV("span",{children:["Could not read ",Q,": ",_.error]},void 0,!0,void 0,this),J?F1.jsxDEV("button",{type:"button",onClick:J,children:"Try again"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);return null}function LZ({lines:_=3,label:Q="Loading…"}){return F1.jsxDEV("div",{className:"skeleton",role:"status","aria-label":Q,children:Array.from({length:_},(J,q)=>F1.jsxDEV("span",{style:{width:`${[92,76,84,64,88][q%5]}%`}},q,!1,void 0,this))},void 0,!1,void 0,this)}function O1({iso:_,time:Q}){if(!_)return F1.jsxDEV("span",{children:"—"},void 0,!1,void 0,this);let J=new Date(_);return F1.jsxDEV("time",{dateTime:_,title:_,children:Number.isNaN(J.getTime())?_:Q?J.toLocaleTimeString():J.toLocaleString()},void 0,!1,void 0,this)}var E6=(_)=>_?new Date(_).toLocaleString():"—";function x6(_){let Q=_?Date.parse(_):Number.NaN;if(Number.isNaN(Q))return"—";let J=Math.max(0,Math.round((Date.now()-Q)/1000));return J<60?"just now":J<3600?`${Math.round(J/60)}m ago`:J<86400?`${Math.round(J/3600)}h ago`:`${Math.round(J/86400)}d ago`}function k1(_,Q){let J=Q.replace(/[_-]+/g," "),q=J.endsWith("s")?J:/[^aeiou]y$/.test(J)?`${J.slice(0,-1)}ies`:/(ch|sh|x)$/.test(J)?`${J}es`:`${J}s`;return`${_} ${_===1?J:q}`}var X2=(_)=>_.length<=1?_.join(""):`${_.slice(0,-1).join(", ")} and ${_[_.length-1]}`,zZ={github:"GitHub",openai:"OpenAI",aws:"AWS",hubspot:"HubSpot",paypal:"PayPal",youtube:"YouTube",tiktok:"TikTok",linkedin:"LinkedIn",xai:"xAI",sendgrid:"SendGrid",elevenlabs:"ElevenLabs",assemblyai:"AssemblyAI",planetscale:"PlanetScale",googleoauth:"Google sign-in",npm:"npm","npm-registry":"npm registry",posthog:"PostHog",mongodb:"MongoDB",pagerduty:"PagerDuty",mailgun:"Mailgun",turbopuffer:"turbopuffer"},H1=(_)=>zZ[_]??_.charAt(0).toUpperCase()+_.slice(1);function b1({vendor:_}){let Q=Z_[_];return F1.jsxDEV("span",{className:Q?"mark logo":"mark","aria-hidden":"true",children:Q?F1.jsxDEV("svg",{viewBox:"0 0 24 24",children:F1.jsxDEV("path",{d:Q.d,fill:Q.fill},void 0,!1,void 0,this)},void 0,!1,void 0,this):H1(_).charAt(0)},void 0,!1,void 0,this)}var F_=(_)=>{_.currentTarget.closest("details")?.removeAttribute("open")},WZ="volter.theme",m6=()=>{try{let _=localStorage.getItem(WZ);return _==="light"||_==="dark"?_:"system"}catch{return"system"}};function H_(_=m6()){let Q=document.documentElement;if(_==="system")Q.removeAttribute("data-theme");else Q.setAttribute("data-theme",_)}function X_(){return D1.useEffect(()=>{let _=()=>[...document.querySelectorAll("details.menu[open], details.clock-more[open]")],Q=(q)=>{if(q.key!=="Escape"||document.querySelector("dialog[open]"))return;let U=_();if(!U.length)return;for(let G of U)G.removeAttribute("open");U[U.length-1].querySelector("summary")?.focus()},J=(q)=>{let U=q.target;for(let G of _())if(!U||!G.contains(U))G.removeAttribute("open")};return document.addEventListener("keydown",Q),document.addEventListener("click",J),()=>{document.removeEventListener("keydown",Q),document.removeEventListener("click",J)}},[]),null}function t1({open:_,onClose:Q,title:J,children:q,footer:U,wide:G}){let Z=D1.useRef(null),F=D1.useId();return D1.useEffect(()=>{let H=Z.current;if(!H)return;if(_&&!H.open){H.showModal();let Y=H.querySelector(".dialog-body :is(input:not([type=hidden]):not([disabled]), select, textarea)");if(Y?.focus(),Y instanceof HTMLInputElement&&Y.value&&/^(text|search|email|url)$/.test(Y.type))Y.select()}if(!_&&H.open)H.close()},[_]),F1.jsxDEV("dialog",{ref:Z,className:G==="window"?"dialog window":G?"dialog wide":"dialog","aria-labelledby":F,onClose:Q,onCancel:(H)=>{H.preventDefault(),Q()},onMouseDown:(H)=>{if(H.target===Z.current)Q()},children:_?F1.jsxDEV(F1.Fragment,{children:[F1.jsxDEV("div",{className:"dialog-head",children:[F1.jsxDEV("h2",{id:F,children:J},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Close",onClick:Q,children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F1.jsxDEV("div",{className:"dialog-body",children:q},void 0,!1,void 0,this),U?F1.jsxDEV("div",{className:"dialog-foot",children:U},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null},void 0,!1,void 0,this)}var D6="volter:confirm";function B0(_){return new Promise((Q)=>{window.dispatchEvent(new CustomEvent(D6,{detail:{ask:_,resolve:Q}}))})}function Y_(){let[_,Q]=D1.useState(null),[J,q]=D1.useState("");D1.useEffect(()=>{let F=(H)=>{q(""),Q(H.detail)};return window.addEventListener(D6,F),()=>window.removeEventListener(D6,F)},[]);let U=(F)=>{_?.resolve(F),Q(null)},G=_?.ask,Z=!G?.typed||J===G.typed;return F1.jsxDEV(t1,{open:Boolean(_),onClose:()=>U(!1),title:G?.title??"",footer:F1.jsxDEV(F1.Fragment,{children:[F1.jsxDEV("button",{type:"button",onClick:()=>U(!1),children:"Cancel"},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",className:G?.danger?"danger-button":"primary",disabled:!Z,onClick:()=>U(!0),children:G?.action},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:[G?.body?F1.jsxDEV("div",{className:"confirm-body",children:G.body},void 0,!1,void 0,this):null,G?.typed?F1.jsxDEV("div",{className:"typed-confirm",children:[F1.jsxDEV("p",{children:["Type ",F1.jsxDEV("code",{children:G.typed},void 0,!1,void 0,this)," to confirm."]},void 0,!0,void 0,this),F1.jsxDEV("input",{autoFocus:!0,"aria-label":`Type ${G.typed} to confirm`,value:J,onChange:(F)=>q(F.target.value),onKeyDown:(F)=>{if(F.key==="Enter"&&Z)U(!0)},autoComplete:"off",spellCheck:!1},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}var h6="volter:toast";function u1(_,Q="ok"){window.dispatchEvent(new CustomEvent(h6,{detail:{text:_,kind:Q}}))}function L_(){let[_,Q]=D1.useState([]);return D1.useEffect(()=>{let J=0,q=(U)=>{let{text:G,kind:Z}=U.detail,F=++J;if(Q((H)=>[...H.slice(-3),{id:F,text:G,kind:Z}]),Z!=="error")setTimeout(()=>Q((H)=>H.filter((Y)=>Y.id!==F)),4500)};return window.addEventListener(h6,q),()=>window.removeEventListener(h6,q)},[]),F1.jsxDEV("div",{className:"toasts",role:"region","aria-label":"Notifications",children:_.map((J)=>F1.jsxDEV("div",{className:`toast ${J.kind}`,role:J.kind==="error"?"alert":"status",children:[F1.jsxDEV("span",{children:J.text},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",className:"icon-button","aria-label":"Dismiss",onClick:()=>Q((q)=>q.filter((U)=>U.id!==J.id)),children:"✕"},void 0,!1,void 0,this)]},J.id,!0,void 0,this))},void 0,!1,void 0,this)}function g6({value:_,label:Q,secret:J}){let[q,U]=D1.useState(!1);return F1.jsxDEV("div",{className:"copy-field",children:[Q?F1.jsxDEV("span",{className:"copy-label",children:Q},void 0,!1,void 0,this):null,F1.jsxDEV("div",{className:"copy-row",children:[F1.jsxDEV("input",{readOnly:!0,value:_,"aria-label":Q??"Value",onFocus:(Z)=>Z.currentTarget.select(),spellCheck:!1},void 0,!1,void 0,this),F1.jsxDEV("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>{U(!0),setTimeout(()=>U(!1),1600),u1(J?"Copied. Keep it somewhere safe":"Copied")}).catch(()=>u1("Your browser would not copy it: select it and copy","error"))},children:q?"Copied":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function z_({label:_,items:Q}){return F1.jsxDEV("details",{className:"menu row-menu",children:[F1.jsxDEV("summary",{className:"icon-button",role:"button","aria-haspopup":"menu","aria-label":_,title:_,children:"⋯"},void 0,!1,void 0,this),F1.jsxDEV("div",{className:"popover menu-list",role:"menu",children:Q.filter((J)=>Boolean(J)).map((J)=>J.href?F1.jsxDEV("a",{role:"menuitem",href:J.href,className:J.danger?"danger-item":void 0,onClick:F_,children:J.label},J.label,!1,void 0,this):F1.jsxDEV("button",{type:"button",role:"menuitem",disabled:J.disabled,className:J.danger?"danger-item":void 0,onClick:(q)=>{F_(q),J.onSelect?.()},children:J.label},J.label,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function h2({title:_,children:Q,action:J}){return F1.jsxDEV("div",{className:"empty-state",children:[F1.jsxDEV("p",{className:"empty-title",children:_},void 0,!1,void 0,this),Q?F1.jsxDEV("div",{className:"empty-body",children:Q},void 0,!1,void 0,this):null,J?F1.jsxDEV("div",{className:"empty-action",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function W_(){return D1.useEffect(()=>{let _=(J)=>{let q=document.querySelector("main.app"),U=J.target;if(q?.hasAttribute("data-drawer")&&U&&!U.closest(".side")&&!U.closest(".drawer-button"))q.removeAttribute("data-drawer")},Q=(J)=>{if(J.key==="Escape")AZ()};return document.addEventListener("click",_),document.addEventListener("keydown",Q),()=>{document.removeEventListener("click",_),document.removeEventListener("keydown",Q)}},[]),F1.jsxDEV("button",{type:"button",className:"icon-button drawer-button","aria-label":"Menu",onClick:()=>{document.querySelector("main.app")?.toggleAttribute("data-drawer")},children:"☰"},void 0,!1,void 0,this)}var AZ=()=>{document.querySelector("main.app")?.removeAttribute("data-drawer")};function O4(_={}){let Q=(q,U)=>_.tools?`${U} (\`${q}\`)`:`\`${q}\``,J=["Set up Volter World for this app, so its calls to Stripe, Slack, GitHub, OpenAI and the other services it uses go to local twins instead of the real APIs. The app keeps its real SDKs and code.","",_.tools?"1. You have the Volter World tools (volter mcp). If the `volter` command is missing, install it: `npm install -g @volter/world`.":"1. Install the command and your agent tooling: `npm install -g @volter/world`, then `volter agents install --yes`.",`2. In the app's folder, ${Q("volter world init --install","world_init")}: it detects the vendors the app calls and installs their twins. Show me the vendors it detected and why, before keeping them.`,`3. ${_.tools?"Start it with world_up":"Start it: `volter world up`"}, then run the tests inside it: ${Q("volter world run -- <the test command>","world_run")}. Fix anything that fails because a call went to the real service.`,`4. Tell me what the app did at each vendor (${Q("volter world log","world_log")}), and give me the dashboard link (${_.tools?"world_view":"`volter world view --no-open`, started in the background: it keeps running"}).`];if(_.platform){let q=_.world??"<org>/<world>";J.push(`5. Share it with my team on ${_.platform}: ${Q(`volter login ${_.platform}`,"platform_login")} gives a link and a code for me to approve in my browser. Once I have, link it with ${Q(`volter remote add origin ${q} --create`,"remote_link with create: true")}${_.world?"":" (ask me for <org>/<world>)"}, then send what the app did: ${Q('volter world changeset -m "<what and why>"',"world_changeset")} and ${Q("volter world push","world_push")}.`)}return J.push("","The guide: https://world.volter.ai/docs/guides/use-with-a-coding-agent.md"),J.join(`
35
+ `)}var A_={"git-commit-horizontal":[["rect",{x:"9",y:"9",width:"6",height:"6"}],["path",{d:"M3 12h6M15 12h6"}]],"arrow-down-to-line":[["path",{d:"M12 17V3"}],["path",{d:"m6 11 6 6 6-6"}],["path",{d:"M19 21H5"}]],"arrow-up-from-line":[["path",{d:"m18 9-6-6-6 6"}],["path",{d:"M12 3v14"}],["path",{d:"M5 21h14"}]],"git-branch":[["rect",{x:"4",y:"3",width:"4",height:"4"}],["rect",{x:"4",y:"17",width:"4",height:"4"}],["rect",{x:"16",y:"5",width:"4",height:"4"}],["path",{d:"M6 7v10M18 9v2a4 4 0 0 1-4 4H6"}]],monitor:[["rect",{x:"3",y:"4",width:"18",height:"13"}],["path",{d:"M8 21h8M12 17v4"}]],vault:[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"6.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 7.9 2.7 2.7"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 10.6 2.7-2.7"}],["rect",{x:"6.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m7.9 16.1 2.7-2.7"}],["rect",{x:"15.3",y:"15.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["path",{d:"m13.4 13.4 2.7 2.7"}],["circle",{cx:"12",cy:"12",r:"2"}]],settings:[["circle",{cx:"12",cy:"12",r:"3"}],["circle",{cx:"12",cy:"12",r:"7"}],["path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9L7 7M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1"}]],history:[["path",{d:"M3 12a9 9 0 1 0 3-6.7"}],["path",{d:"M3 4v5h5"}],["path",{d:"M12 7v5l3 3"}]],activity:[["path",{d:"M2 12h4l3-8 6 16 3-8h4"}]],"file-diff":[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M9 10h6"}],["path",{d:"M12 13V7"}],["path",{d:"M9 17h6"}]],"square-plus":[["rect",{x:"4",y:"4",width:"16",height:"16"}],["path",{d:"M12 8v8M8 12h8"}]],"square-minus":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["path",{d:"M8 12h8"}]],"square-dot":[["rect",{width:"18",height:"18",x:"3",y:"3"}],["rect",{x:"10.8",y:"10.8",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],cloud:[["path",{d:"M7 19a5 5 0 0 1-.5-10A6 6 0 0 1 18 8a4.5 4.5 0 0 1 .5 11z"}]],"refresh-cw":[["path",{d:"M20 12a8 8 0 0 1-14.3 4.9M4 12a8 8 0 0 1 14.3-4.9"}],["path",{d:"M19 3v5h-5M5 21v-5h5"}]],clock:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M12 7v5l3 3"}]],"key-round":[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["rect",{x:"15.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],plug:[["path",{d:"M9 3v5M15 3v5M6 8h12v4a6 6 0 0 1-12 0zM12 18v3"}]],"list-checks":[["path",{d:"M11 6h9M11 12h9M11 18h9"}],["path",{d:"M3 6l1.5 1.5L7 5M3 12l1.5 1.5L7 11M3 18l1.5 1.5L7 17"}]],palette:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"}],["rect",{x:"12.3",y:"5.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"16.3",y:"9.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"5.3",y:"11.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}],["rect",{x:"7.3",y:"6.3",width:"2.4",height:"2.4",fill:"currentColor",stroke:"none"}]],check:[["path",{d:"M4 12l5 5L20 6"}]],plus:[["path",{d:"M12 4v16M4 12h16"}]],"chevron-down":[["path",{d:"M5 9l7 7 7-7"}]],"external-link":[["path",{d:"M14 4h6v6M20 4l-9 9"}],["path",{d:"M18 14v6H4V6h6"}]],"table-2":[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18"}]],"scroll-text":[["path",{d:"M15 12h-5"}],["path",{d:"M15 8h-5"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3"}]],"layout-grid":[["rect",{x:"4",y:"4",width:"7",height:"7"}],["rect",{x:"13",y:"4",width:"7",height:"7"}],["rect",{x:"4",y:"13",width:"7",height:"7"}],["rect",{x:"13",y:"13",width:"7",height:"7"}]],globe:[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"}]],"arrow-left":[["path",{d:"M20 12H5M11 6l-6 6 6 6"}]],link:[["path",{d:"M9 15l6-6"}],["path",{d:"M11 6l2-2a4.2 4.2 0 0 1 6 6l-2 2M13 18l-2 2a4.2 4.2 0 0 1-6-6l2-2"}]],user:[["circle",{cx:"12",cy:"8",r:"4"}],["path",{d:"M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1"}]],"log-out":[["path",{d:"M10 4H4v16h6M9 12h11M16 8l4 4-4 4"}]]};var $=h1(O5(),1),f4="volter.console.token",P5=document.getElementById("root"),X1=P5.dataset.base??"/-/console",T1=window.location.origin,W2=(P5.dataset.worlds??T1).replace(/\/+$/,""),P_=(P5.dataset.names??"").split(",").filter((_)=>_!==""),g0=P5.dataset.worldOrigin==="1",z2=window.fetch.bind(window),p0="(session)",N_="(pass)",I5=(_)=>{try{if(_&&!g0)sessionStorage.setItem(f4,_);else sessionStorage.removeItem(f4);localStorage.removeItem(f4)}catch{}},C_="volter.console.portal",S_=(_)=>{try{if(typeof _==="string"&&/^https?:$/.test(new URL(_).protocol))sessionStorage.setItem(C_,new URL(_).origin)}catch{}},BZ=()=>{return A2.get("token")??""},p1=()=>{try{let _=sessionStorage.getItem(C_)??"";return _&&/^https?:$/.test(new URL(_).protocol)?new URL(_).origin:""}catch{return""}},MZ=()=>{let _=BZ();if(g0){if(I5(""),A2.get("pass"))return N_;let Q=new URLSearchParams(window.location.search).has("signin");if(Q)try{window.history.replaceState(null,"",window.location.pathname+window.location.hash)}catch{}return _||(Q?"":p0)}if(_)return I5(_),_;try{return sessionStorage.getItem(f4)??""}catch{return""}};function v1(_){let Q=_.trim();if(/not ready/i.test(Q)&&/(never verified|not verified|no approvals)/i.test(Q)){let G=[],Z=[];if(/(never verified|not verified)/i.test(Q))G.push("it is not verified yet"),Z.push("verify");if(/no approvals/i.test(Q))G.push("no one has approved it"),Z.push("approve");return{text:`Not ready to deploy: ${X2(G)}.`,acts:Z}}let J=/no credential (?:is )?sealed for ([a-z0-9_-]+)/i.exec(Q);if(J)return{text:`No credential is sealed for ${H1(J[1])}: seal one in Settings › Vault.`,acts:["vault"]};if(/has no origin/i.test(Q))return{text:"This World has no remote: name one in Settings › Remote.",acts:["remote"]};let q=/the ([a-z0-9_-]+) twin has no root/i.exec(Q)??/:\s*([a-z0-9_, -]+?) (?:has|have) no root/i.exec(Q);if(q){let G=q[1].split(/,\s*/).filter(Boolean).map(H1);return{text:`${X2(G)} ${G.length===1?"is":"are"} not connected to ${G.length===1?"its":"their"} real service: Settings › Real services.`,acts:["settings"]}}if(/opening a seal is/i.test(Q))return{text:"A key cannot seal a credential: open the World as yourself.",acts:[]};if(/a key manages no keys/i.test(Q))return{text:"A key cannot manage keys: open the World as yourself.",acts:[]};if(/^PUT origin:/i.test(Q))return{text:"That is not a World's address: https://<host>/<org>/<world>",acts:[]};if(/^clock: \{/i.test(Q))return{text:"Pick a date and time.",acts:[]};if(/^advance: \{/i.test(Q))return{text:"Advance by a number and a unit: 90m, 12h, 3d.",acts:[]};if(/^branches: \{/i.test(Q))return{text:"That branch could not be made: pick now, or an instant before it.",acts:[]};if(/^approve: \{/i.test(Q))return{text:"Name who approves.",acts:[]};if(/a browser deploys only what it names/i.test(Q))return{text:"A deploy is confirmed by its name: use Deploy again.",acts:[]};if(/^no such door/i.test(Q))return{text:"This World does not answer that here.",acts:[]};return{text:Q.replace(/\s*[—–-]+\s*(?:run\s+)?`[^`]*`/g,"").replace(/\s*[—–-]+\s*(?:PUT|POST|GET|DELETE)\s+\/-\/\S+(?:\s*\{[^}]*\})?/g,"").replace(/\s*\(\s*`[^`]*`\s*\)/g,"").replace(/`(?:volter|printf|curl|npm|bun)[^`]*`/g,"").replace(/:\s*\{[^}]*\}/g,"").replace(/\(\s*\)/g,"").replace(/\s*;\s*(?=[;.]|$)/g,"").replace(/\s+([,.;:])/g,"$1").trim()||_,acts:[]}}var J0=async(_)=>v1(await P0(_)).text,TZ={vault:["vault","Open Vault"],remote:["remote","Open Remote"],settings:["settings/services","Open Real services"]};function k_({name:_,acts:Q}){let J=Q.map((q)=>TZ[q]).filter((q)=>Boolean(q));if(J.length===0)return null;return $.jsxDEV($.Fragment,{children:J.map(([q,U])=>$.jsxDEV(i.default.Fragment,{children:[" ",$.jsxDEV("a",{href:`${X1}/${_}/~/${q}`,onClick:(G)=>{G.preventDefault(),R1([..._.split("/"),"~",...q.split("/")])},children:U},void 0,!1,void 0,this)]},q,!0,void 0,this))},void 0,!1,void 0,this)}async function I1(_,Q,J={}){return z2(`${T1}${Q}`,{...J,headers:{...J.headers??{},..._===p0?{}:{"x-volter-token":_},...J.body&&!J.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function w1(_,Q,J=0){let q=K_((U)=>I1(_,U),Q,J,_);return q.state==="error"?{...q,error:v1(q.error).text}:q}var m2=(_)=>{let Q=new Date(_),J=(q)=>String(q).padStart(2,"0");return`${Q.getFullYear()}-${J(Q.getMonth()+1)}-${J(Q.getDate())}T${J(Q.getHours())}:${J(Q.getMinutes())}`},B_=(_)=>new Date(Math.ceil(Date.parse(_)/60000)*60000).toISOString(),y_=(_)=>_.operation==="observed"?`observed${_.provenance==="placeholder"?" (default data)":" (vendor)"}`:_.receipt?`${_.receipt.status??""} ${_.receipt.externalId??""} ${_.receipt.reason??""}`.trim():_.provenance==="placeholder"?"default data":"unpushed",RZ=(_)=>{let Q=/^[0-9a-f]{2}-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/.exec(_??"");return Q?{trace:Q[1],span:Q[2]}:null},r6="volter.console.snapshots",C0=()=>{try{return JSON.parse(sessionStorage.getItem(r6)??"{}")}catch{return{}}},v_=new Map,i6=(_)=>{if(g0){if(_.token||_.readToken)v_.set(_.name,{token:_.token,readToken:_.readToken});_={..._,token:"",readToken:""}}try{sessionStorage.setItem(r6,JSON.stringify({...C0(),[_.name]:_}))}catch{}},d6=(_)=>v_.get(_)?.readToken||C0()[_]?.readToken||"",I4=(_)=>{try{let Q=C0();delete Q[_],sessionStorage.setItem(r6,JSON.stringify(Q))}catch{}},A2=new URLSearchParams(window.location.hash.slice(1)),E2=A2.get("close")??"";function N5(_){if(typeof _!=="string")return null;let Q;try{Q=new URL(_)}catch{return null}return(Q.protocol==="http:"||Q.protocol==="https:")&&Q.origin===_.replace(/\/+$/,"")?Q:null}function a6(_){let Q=N5(_);if(!Q)return null;let J=new URL(T1);if(Q.protocol!==J.protocol||Q.port!==J.port)return null;if(Q.hostname===J.hostname)return Q.origin;let q=/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./;if(!q.test(Q.hostname))return null;let U=Q.hostname.replace(q,"");return U===J.hostname||q.test(J.hostname)&&U===J.hostname.replace(q,"")?Q.origin:null}function OZ(_){let Q;try{Q=JSON.parse(_)}catch{return null}let J=/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/i;if(typeof Q.name!=="string"||!J.test(Q.name)||typeof Q.parent!=="string"||!J.test(Q.parent)||typeof Q.at!=="string")return null;let q=Q.parentOrigin===void 0?void 0:a6(Q.parentOrigin);return{name:Q.name,parent:Q.parent,token:typeof Q.token==="string"?Q.token:"",readToken:typeof Q.readToken==="string"?Q.readToken:"",at:Q.at,expiresAt:typeof Q.expiresAt==="string"?Q.expiresAt:null,...q?{parentOrigin:q}:{}}}{let _=A2.get("snapshot");if(_){let Q=OZ(_);if(Q&&!C0()[Q.name])i6(Q)}}var j_="volter.console.home",V_=(_)=>{let Q=N5(_);if(!Q)return null;let J=new URL(T1).hostname,q=J.replace(/^[a-z0-9](?:[a-z0-9]|-(?!-))*--[a-z0-9](?:[a-z0-9]|-(?!-))*\./,"");return Q.hostname===J||Q.hostname===q?Q.origin:null};{let _=V_(A2.get("home"));if(_)try{sessionStorage.setItem(j_,_)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((_)=>A2.has(_)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var G0=()=>{try{return V_(sessionStorage.getItem(j_))??""}catch{return""}};function s6(_,Q,J,q){let U=new URLSearchParams({token:Q,home:G0()||T1}),G=C0()[J];if(G)U.set("snapshot",JSON.stringify(G));window.location.replace(`${_}${q??`${window.location.pathname}${window.location.search}`}#${U.toString()}`)}var C4=P5.dataset.route==="memory"?"":null;function pB(_){C4=_,window.dispatchEvent(new PopStateEvent("popstate"))}function Y2(){return(C4??window.location.pathname.slice(X1.length)).split("/").filter(Boolean).map((_)=>{try{return decodeURIComponent(_)}catch{return""}})}var M_=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,N0=(_,Q)=>_&&Q&&M_.test(_)&&M_.test(Q)?`${_}/${Q}`:"";function R1(_){let Q=`/${_.map(encodeURIComponent).join("/")}`;if(C4!==null)C4=Q;else window.history.pushState(null,"",`${X1}${Q}`);window.dispatchEvent(new PopStateEvent("popstate"))}function u_(_,Q){let J=a6(C0()[_]?.origin);if(J&&J!==T1){s6(J,d6(_),_,`${X1}/${Q.map(encodeURIComponent).join("/")}`);return}R1(Q)}async function T_(){let[_,Q]=Y2(),J=N0(_,Q),q=J?[J]:P_;if(q.length===0){let U=await z2(`${T1}/-/ping`).catch(()=>null);q=U?.ok?(await U.json().catch(()=>({}))).worlds??[]:[]}q=q.filter((U)=>{let[G,Z,...F]=U.split("/");return F.length===0&&N0(G,Z)===U});for(let U of q){let G=await z2(`${T1}/-/${U}/session`,{method:"POST"}).catch(()=>null);if(!G)continue;let Z=await G.json().catch(()=>({})),F=N5(Z.origin)?.origin;if(G.status===409&&F&&F!==T1)return window.location.replace(`${F}${X1}/${U}`),"moved";if(G.ok&&Z.local)return{token:typeof Z.token==="string"&&Z.token?Z.token:p0}}return null}function fZ(){let[_,Q]=i.useState(m6),J=(q)=>()=>{try{if(q==="system")localStorage.removeItem("volter.theme");else localStorage.setItem("volter.theme",q)}catch{}H_(q),Q(q)};return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"theme-choice",role:"radiogroup","aria-label":"Appearance",children:["system","light","dark"].map((q)=>$.jsxDEV("button",{type:"button",role:"radio","aria-checked":_===q,onClick:J(q),children:q==="system"?"System":q==="light"?"Light":"Dark"},q,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function IZ(){let[_,Q]=i.useState(MZ()),[J,q]=i.useState(!1),[U,G]=i.useState(!1),[Z,F]=i.useState(""),[H,Y]=i.useState(null),[X,K]=i.useState(null),[L,z]=i.useState(Y2());i.useEffect(()=>{let y=()=>z(Y2());return window.addEventListener("popstate",y),()=>window.removeEventListener("popstate",y)},[]),i.useEffect(()=>{let[y,p]=Y2(),u=N0(y,p),[s,t]=u?u.split("/"):[],a=C0()[E2];if(!E2||!_||!s||!t||!a?.made||a.parent!==`${s}/${t}`||N0(...E2.split("/"))!==E2)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}I1(_,`/-/${s}/${t}/branches/${E2}`,{method:"DELETE"}).catch(()=>null).then(()=>I4(E2))},[_]);let W=i.useCallback(async(y)=>{if(K(null),!y){let t=await T_();if(t==="moved")return;if(t){if(q(!0),t.token!==p0)I5(t.token);Q(t.token);return}Y(null),G(!0);return}if(g0&&y===p0){let t=await T_();if(t==="moved")return;if(t)q(!0)}if(g0&&y===N_){let[t,a]=Y2(),d=N0(t,a),[c,e]=d?d.split("/"):[],Q1=c&&e?await z2(`${T1}/-/${c}/${e}/session`,{method:"POST",headers:{"x-volter-pass":A2.get("pass")??""}}).catch(()=>null):null;if(!Q1){K(`${T1} did not answer: no session was opened`),Y(null);return}if(!Q1.ok){K(`${await J0(Q1)}. Open it again from the platform.`),Y(null);return}S_((await Q1.json().catch(()=>({}))).issuer),Q(p0);return}if(g0&&y!==p0){let[t,a]=Y2(),d=N0(t,a),[c,e]=d?d.split("/"):[],Q1=c&&e?await z2(`${T1}/-/${c}/${e}/session`,{method:"POST",headers:{"x-volter-token":y}}).catch(()=>null):null;if(!Q1){K(`${T1} did not answer: no session was opened`),Y(null);return}if(!Q1.ok){let G1=await J0(Q1);K(Q1.status===401||Q1.status===403?`That token does not open ${c}/${e}.`:Q1.status===409?`${c}/${e}'s session lives at another origin: ${G1}`:`The World could not open a session (${Q1.status}): ${G1}`),Y(null);return}Q(p0);return}let p=g0?new Response(null,{status:404}):await I1(y,"/-/worlds");if(p.ok){let{worlds:t}=await p.json();Y({kind:"admin",worlds:t});return}if(p.status===429){K("You are asking faster than the platform allows — wait a moment and reload."),Y(null);return}if(p.status>=500){let t=await p.json().catch(()=>({}));K(`The platform could not list your worlds${t.error?`: ${t.error}`:""}. Reload; if it stays, the status page says what is wrong.`),Y(null);return}let u=P_;if(u.length===0){let t=await z2(`${T1}/-/ping`);if(!t.ok){K(`${T1} does not answer as a host`),Y(null);return}if(u=(await t.json()).worlds??[],u.length===0){K(`${T1} does not list its Worlds: open a World at its own address, ${T1}${X1}/<org>/<world>`),Y(null);return}}let s=[];for(let t of u){let a=await I1(y,`/-/${t}/twins`);if(a.ok){let d=await a.json();s.push({name:t,base:`${W2}/${t}`,twins:(d.twins??[]).map((c)=>({vendor:c.twin,protocol:c.protocol??null,root:c.root??null}))})}}if(s.length===0){K("This link or key opens no World here: it was revoked, or it has ended."),Y(null);return}Y({kind:"world",worlds:s})},[]);i.useEffect(()=>{W(_)},[_,W]);let O=(y)=>H?.kind==="admin"?H.worlds.find((p)=>p.name===y)?.token??_:_,[T,B]=i.useState("");if(!_||!H&&!X)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(f5,{href:`${X1}/`},void 0,!1,void 0,this),_&&!H&&!X||!_&&!U?$.jsxDEV("p",{className:"mode",children:"Opening…"},void 0,!1,void 0,this):$.jsxDEV("form",{onSubmit:(y)=>{y.preventDefault(),I5(Z.trim()),Q(Z.trim())},className:"stack",children:[$.jsxDEV("h2",{children:"Open a World"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"A World's token opens that World. A host's admin token opens every World it serves."},void 0,!1,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Token"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"token",type:"password",value:Z,onChange:(y)=>F(y.target.value),autoFocus:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",children:"Open"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let w=()=>{if(J){window.location.reload();return}if(g0){let[y,p]=Y2(),u=N0(y,p),[s,t]=u?u.split("/"):[],a=()=>window.location.replace(p1()?`${p1()}/`:`${T1}${X1}/${s&&t?`${s}/${t}`:""}?signin`);if(setTimeout(a,2000),s&&t)z2(`${T1}/-/${s}/${t}/session/end`,{method:"POST"}).catch(()=>null).then(a);else a();return}if(H)for(let y of H.worlds)navigator.sendBeacon(`${y.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${y.name}/session/end`);I5(""),Q(""),F(""),Y(null),R1([])};if(X||!H)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(f5,{href:`${X1}/`},void 0,!1,void 0,this),$.jsxDEV("h2",{children:"Could not open it"},void 0,!1,void 0,this),$.jsxDEV("p",{role:"alert",children:X??"nothing answered"},void 0,!1,void 0,this),p1()?$.jsxDEV("a",{className:"button primary",href:`${p1()}/`,children:["Back to ",new URL(p1()).host]},void 0,!0,void 0,this):$.jsxDEV("button",{type:"button",className:"primary",onClick:w,children:J?"Try again":"Use another token"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);let[A,R,I,C,P,k,N]=L,v=I==="~",E=/^[A-Za-z0-9_-]+$/,g=/^[^\u0000-\u001f\u007f]{1,200}$/,h=v||!I||!E.test(I)?void 0:I,S=P&&E.test(P)?k!==void 0&&C!=="changes"&&C!=="screens"?N0(P,k)||void 0:P:void 0,b=C==="changes"&&P==="changesets"&&k&&E.test(k)?k:C==="screens"&&k&&N&&/^[A-Za-z0-9_.-]+$/.test(k)&&g.test(N)?`${k}:${N}`:void 0,j=N0(A,R),x=j?C0()[j]??null:null,V=(y)=>d6(y)||O(y),D=x?H.kind==="admin"?H.worlds.find((y)=>y.name===x.parent)?.token??null:H.worlds.some((y)=>y.name===x.parent)?_:null:null,f=async(y)=>{let p=a6(y.parentOrigin);if(p&&p!==T1){I4(y.name),window.location.assign(`${p}${X1}/${y.parent}#close=${encodeURIComponent(y.name)}`);return}if(y.made)await I1(O(y.parent),`/-/${y.parent}/branches/${y.name}`,{method:"DELETE"}).catch(()=>null),I4(y.name);R1(y.parent.split("/"))};return $.jsxDEV("main",{className:j?"app workspace":"app home",children:[j?null:$.jsxDEV("header",{children:[j?$.jsxDEV(W_,{},void 0,!1,void 0,this):null,$.jsxDEV(f5,{href:`${G0()&&G0()!==T1?G0():""}${X1}/`,onClick:(y)=>{if(G0()&&G0()!==T1)return;y.preventDefault(),R1([])}},void 0,!1,void 0,this),$.jsxDEV("nav",{"aria-label":"breadcrumb",className:"crumbs",children:[j?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("span",{children:j.split("/")[0]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${j}`,className:"crumb-world",onClick:(y)=>{y.preventDefault(),R1(j.split("/"))},children:j.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,h?$.jsxDEV("span",{children:[" / ",h]},void 0,!0,void 0,this):null,v&&C==="trace"?$.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),p1()?$.jsxDEV("a",{href:`${p1()}/${j?encodeURIComponent(j.split("/")[0]):""}`,title:`Back to the platform at ${new URL(p1()).host}`,className:"back-link",children:["← ",$.jsxDEV("span",{className:"back-text",children:j?`${j.split("/")[0]}'s Worlds`:new URL(p1()).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,j?null:$.jsxDEV("span",{className:"mode",children:J?"on this machine":T?`signed in as ${T}`:H.kind==="admin"?"host: admin":"opened with a link or key"},void 0,!1,void 0,this),j||J?null:$.jsxDEV("button",{onClick:w,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j?$.jsxDEV(NZ,{name:j,token:V(j),twin:h,tab:v?C??"overview":"overview",arg:v?S:void 0,...v&&b?{sub:b}:{},admin:x?null:H.kind==="admin"?_:null,snapshot:x,parentToken:D,who:{local:J,person:T||null,admin:H.kind==="admin"},onSignOut:w,onReturn:f,opens:(y)=>!!C0()[y]||H.kind==="admin"&&H.worlds.some((p)=>p.name===y),onRemoved:()=>{W(_),R1([])},onWho:B,worlds:H.worlds.map((y)=>y.name)},j,!1,void 0,this):$.jsxDEV(wZ,{mode:H,admin:H.kind==="admin"?_:null,reload:()=>W(_)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function wZ({mode:_,admin:Q,reload:J}){let[q,U]=i.useState(""),[G,Z]=i.useState(""),[F,H]=i.useState(""),[Y,X]=i.useState(null),K=async(P)=>{if(!await B0({title:`Rotate the tokens of ${P}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let k=await I1(Q,`/-/worlds/${P}/rotate`,{method:"POST"}),N=await k.json().catch(()=>({}));X(k.ok?`rotated ${P}: the new tokens are shown once — token ${N.token} · read token ${N.readToken}`:N.error?v1(N.error).text:`answered ${k.status}`),await J()},L=async(P)=>{let k=await I1(Q,`/-/worlds/${P}`,{method:"DELETE"}),N=await k.json().catch(()=>({}));X(k.ok?`removed ${P}`:N.error?v1(N.error).text:`answered ${k.status}`),await J()},[z,W]=i.useState(!1),[O,T]=i.useState(!1),[B,w]=i.useState(""),A=async(P)=>{P.preventDefault(),X(null),W(!0);try{let k=await I1(Q,"/-/worlds",{method:"POST",body:JSON.stringify({org:q,world:G,vendors:F.split(",").map((v)=>v.trim()).filter(Boolean)})}),N=await k.json();if(!k.ok){X(N.error?v1(N.error).text:`the host answered ${k.status}`);return}X(`provisioned ${N.name}`),Z(""),H(""),T(!1),await J()}finally{W(!1)}},R=B.trim().toLowerCase(),I=_.worlds.filter((P)=>!R||P.name.toLowerCase().includes(R)||P.twins.some((k)=>k.vendor.includes(R))),C=[...new Set(I.map((P)=>P.name.split("/")[0]))];return $.jsxDEV("section",{className:"home-window","aria-labelledby":"worlds",children:[$.jsxDEV("div",{className:"home-head",children:[$.jsxDEV("h2",{id:"worlds",children:"Worlds"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[k1(_.worlds.length,"World")," ",Q?"this host serves":"this key opens"]},void 0,!0,void 0,this),Q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{X(null),T(!0)},children:[$.jsxDEV(B1,{name:"plus",size:16},void 0,!1,void 0,this),"New World"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"home-find",children:$.jsxDEV("input",{type:"search",placeholder:"Filter by World or vendor","aria-label":"Filter Worlds",value:B,onChange:(P)=>w(P.target.value)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y&&!O?$.jsxDEV("p",{role:"status",className:"home-note",children:Y},void 0,!1,void 0,this):null,C.map((P)=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("p",{className:"menu-label home-org",children:P},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"home-list",children:I.filter((k)=>k.name.split("/")[0]===P).map((k)=>$.jsxDEV("li",{children:[$.jsxDEV("a",{href:`${X1}/${k.name}`,onClick:(N)=>{N.preventDefault(),R1(k.name.split("/"))},children:[$.jsxDEV(B1,{name:"globe",size:20},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:k.name.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("small",{children:$.jsxDEV("code",{children:k.base},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"home-vendors",children:k.twins.map((N)=>$.jsxDEV("span",{title:H1(N.vendor),children:$.jsxDEV(b1,{vendor:N.vendor},void 0,!1,void 0,this)},N.vendor,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q?$.jsxDEV("details",{className:"menu home-more",children:[$.jsxDEV("summary",{"aria-label":`More for ${k.name}`,children:"⋯"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"popover menu-list",children:[$.jsxDEV("button",{type:"button",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),K(k.name)},children:"Rotate tokens…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"danger-item",onClick:(N)=>{N.currentTarget.closest("details")?.removeAttribute("open"),B0({title:`Remove ${k.name}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:k.name}).then((v)=>{if(v)L(k.name)})},children:"Remove World…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},k.name,!0,void 0,this))},void 0,!1,void 0,this)]},P,!0,void 0,this)),I.length===0?$.jsxDEV("p",{className:"mode home-note",children:R?`No World matches ${B}.`:"No Worlds here yet."},void 0,!1,void 0,this):null,$.jsxDEV(t1,{open:O,onClose:()=>{if(!z)T(!1)},title:"New World",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>T(!1),disabled:z,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"provision",className:"primary",disabled:z,children:z?"Making… (ten seconds or so)":"Make World"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"provision",onSubmit:A,className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Org"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"org",value:q,onChange:(P)=>U(P.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"world",value:G,onChange:(P)=>Z(P.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Vendors"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"vendors",value:F,onChange:(P)=>H(P.target.value),placeholder:"stripe, slack",required:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"A twin of each, with its default data."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y?$.jsxDEV("p",{role:"status",children:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var PZ=["changes","events","trace","vendors","screens","canvas","branches","settings","remote","vault"],b_=(_,Q)=>{let J=Q?.screens?.find((q)=>q.path.replace(/\/+$/,"")==="")??Q?.screens?.find((q)=>!/[{<]/.test(q.path));return Q&&J?`${W2}/${_}/${Q.twin}${J.path.startsWith("/")?J.path:`/${J.path}`}`:null},R_={verify:"verified",use:"used",issue:"issued",revoke:"revoked",rotate:"rotated",seed:"seeded",upsert:"saved",set:"set",start:"started",finish:"finished",fail:"failed",schedule:"scheduled",deliver:"delivered",like:"liked",follow:"followed",reply:"replied",create:"created",update:"updated",delete:"deleted",record:"recorded",remove:"removed",add:"added",send:"sent",post:"posted",postmessage:"posted",cancel:"canceled",close:"closed",open:"opened",publish:"published",upload:"uploaded",invite:"invited",archive:"archived",merge:"merged",refund:"refunded",capture:"captured",confirm:"confirmed",pay:"paid"};function Z0(_){let Q=_.operation??_.op,J=(Q.includes(".")?Q.slice(Q.lastIndexOf(".")+1):Q).toLowerCase(),q=_.subject.type.replace(/[_-]+/g," ").trim(),U=`${q.charAt(0).toUpperCase()}${q.slice(1)}`,G=/(^|\.)twin\./.test(Q)||/^seed_/.test(J),Z=Q.replace(/[._]+/g," ").trim(),F=G?`${U} seeded`:R_[J]?`${U} ${R_[J]}`:`${Z.charAt(0).toUpperCase()}${Z.slice(1)}`,H=_.fields??{},Y=["title","name","email","text","subject","summary","description"].map((K)=>H[K]).find((K)=>typeof K==="string"&&K.trim()!=="")??null,X=Y===null?null:Y.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(K,L,z)=>`${L==="!"?"@":L}${z}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:F,label:X===null?null:X.length>80?`${X.slice(0,79)}…`:X}}var c0=(_)=>/token|password|secret|key|credential/i.test(_.subject.type)&&_.subject.id.length>6?`••••${_.subject.id.slice(-4)}`:_.subject.id;function NZ({name:_,token:Q,twin:J,tab:q,arg:U,sub:G,admin:Z,snapshot:F,parentToken:H,who:Y,onSignOut:X,onReturn:K,opens:L,onRemoved:z,onWho:W,worlds:O=[]}){let[T,B]=i.useState("pending"),[w,A]=i.useState(null),[R,I]=i.useState(0),[C,P]=i.useState(null);i.useEffect(()=>{let d=!0;return A(null),I1(Q,`/-/${_}/session`,{method:"POST"}).then(async(c)=>{let e=await c.json().catch(()=>({}));if(S_(e.issuer),e.who)W?.(e.who);P(typeof e.signsAs==="string"?e.signsAs:null);let Q1=N5(e.origin)?.origin;if(c.status===409&&Q1&&Q1!==T1){s6(Q1,Q,_);return}if(!d)return;if(B(!c.ok?"unknown":e.scope==="read"?"read":e.scope==="write"?"write":"unknown"),!c.ok)A(e.error?v1(e.error).text:`answered ${c.status}`)}).catch((c)=>{if(d)B("unknown"),A(`the World did not answer: ${c instanceof Error?c.message:String(c)}`)}),()=>{d=!1}},[_,Q,R]);let k=w?{state:"error",error:w}:T==="pending"?{state:"pending"}:{state:"ok",scope:T},N=T==="write",v=(d)=>{if(d.status!==403)return;d.clone().json().then((c)=>{if(/read token|opens only reads|write access|reads only/i.test(c?.error??""))B("read")},()=>null)},[E,g]=i.useState(0);i.useEffect(()=>{let d=setInterval(()=>{if(!document.hidden)g((c)=>c+1)},5000);return()=>clearInterval(d)},[]);let[h,S]=i.useState(0),b=w1(Q,`/-/${_}/clock`,E+h),j=w1(Q,`/-/${_}/twins`),x=w1(Q,`/-/${_}/branches`,h),V=w1(Q,`/-/${_}/map`,Math.floor(E/2)),D=!(x.state==="error"&&(x.status===404||x.status===405)),f=PZ.includes(q)?q:"overview",y=j.state==="ok"?j.data.twins.map((d)=>d.twin):[];if(J&&j.state==="ok"&&!y.includes(J))return $.jsxDEV("main",{className:"center",children:$.jsxDEV(h2,{title:`${_} has no ${J}`,action:$.jsxDEV("a",{href:`${X1}/${_}`,onClick:(d)=>{d.preventDefault(),R1(_.split("/"))},children:["Open ",_]},void 0,!0,void 0,this),children:$.jsxDEV("p",{children:["No vendor of this World is called ",J,". Its changesets are under Changes › History."]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);let p=f==="vendors"&&U?U:void 0,u=()=>{B("pending"),I((d)=>d+1)};if(f==="canvas"||f==="vendors"&&!p||q==="screens"&&!U)return $.jsxDEV(oZ,{name:_,token:Q,twins:j,session:k,retry:u,snapshot:F,back:()=>R1(_.split("/"))},void 0,!1,void 0,this);let t=q==="settings"?{kind:"settings",tab:((d)=>D_.find(([c])=>c===d)?.[0]??"account")(U)}:q==="remote"?{kind:"settings",tab:"remote"}:q==="vault"?{kind:"settings",tab:"vault"}:q==="branches"?{kind:"branches",...U?{open:U}:{}}:null,a=J?"vendor":q==="screens"&&U?"screen":f==="vendors"&&p?"vendor":q==="trace"?"trace":q==="events"?"events":q==="changes"&&U==="changesets"?"history":"changes";return $.jsxDEV(DZ,{name:_,token:Q,view:a,win:t,who:Y,snapshot:F,onReturn:K,onSignOut:X,worlds:O,session:k,retry:u,...a==="vendor"?{arg:J??p}:a==="events"||a==="trace"||a==="screen"?U?{arg:U}:{}:{},...G?{sub:G}:{},twins:j,map:V,branches:D?x:null,clock:b,canWrite:N&&!F,refused:v,signsAs:C,opens:L,tick:E,admin:Z,onRemoved:z,onClock:()=>S((d)=>d+1),scope:F?"read":T},void 0,!1,void 0,this)}function B1({name:_,size:Q=20}){return $.jsxDEV("svg",{className:"icon",viewBox:"0 0 24 24",width:Q,height:Q,fill:"none",stroke:"currentColor",strokeWidth:Q<=16?1.75:1.5,strokeLinecap:"square",strokeLinejoin:"miter","aria-hidden":"true",children:(A_[_]??[]).map(([J,q],U)=>i.default.createElement(J,{key:U,...q}))},void 0,!1,void 0,this)}function S4(_){let Q=(J)=>{let q=(J.operation??J.op).toLowerCase();return q.includes(".")?q.slice(q.lastIndexOf(".")+1):q};if(_.some((J)=>/^(delete|remove|archive|revoke)/.test(Q(J))||J.fields?.deleted===!0))return{icon:"square-minus",word:"removed",tone:"removed"};if(/^(create|add|insert|issue|send|post|upload|invite|record|seed)/.test(Q(_[0])))return{icon:"square-plus",word:"made",tone:"added"};return{icon:"square-dot",word:"changed",tone:"changed"}}var D_=[["account","Account","user"],["changesets","Changesets","git-commit-horizontal"],["remote","Remote","cloud"],["access","Access","key-round"],["services","Real services","plug"],["vault","Vault","vault"],["checks","Checks","list-checks"],["clock","Clock","clock"],["appearance","Appearance","palette"]],CZ=(_,Q)=>{let J=Q.split("/").pop()??Q,q=_.split("/").pop()??"";return J.startsWith(`${q}-`)?J.slice(q.length+1):J},L2=(_)=>_.replace(/^_+/,"").replace(/[_-]+/g," ");function h_({record:_,history:Q}){let J=_.writes[_.writes.length-1],q=Z0(J),U=S4(_.writes),G=new Set(_.writes.map((K)=>K.id)),Z=_.writes[0].occurredAt,F={};if(Q){for(let K of Q)if(!G.has(K.id)&&!K.landsId&&!K.aliasOf&&K.subject.type===J.subject.type&&K.subject.id===J.subject.id&&K.occurredAt<=Z)Object.assign(F,K.fields??{})}let H={...F};for(let K of _.writes)Object.assign(H,K.fields??{});let Y=U.tone==="added"&&Object.keys(F).length===0,X=[...new Set([...Object.keys(F),...Object.keys(H)])].filter((K)=>!a_(F[K],H[K]));return $.jsxDEV("div",{className:"ws-diff","aria-label":`${q.label??c0(J)}: its changes`,children:[$.jsxDEV("div",{className:"ws-diff-head",children:[$.jsxDEV("span",{className:`ws-kind ${U.tone}`,title:U.word,children:$.jsxDEV(B1,{name:U.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(b1,{vendor:_.twin},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:q.label??c0(J)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[H1(_.twin)," · ",J.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")," ",$.jsxDEV("code",{children:c0(J)},void 0,!1,void 0,this)," · ",U.word," here"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ol",{className:"ws-writes",children:_.writes.map((K)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:Z0(K).what},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(O1,{iso:K.occurredAt},void 0,!1,void 0,this)," · ",w5(K)]},void 0,!0,void 0,this)]},K.id,!0,void 0,this))},void 0,!1,void 0,this),Q===null?$.jsxDEV("p",{className:"mode pad",children:"Reading its history…"},void 0,!1,void 0,this):X.length===0?$.jsxDEV("p",{className:"mode pad",children:"No field holds a new value."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"ws-fields","aria-label":"Fields before and after",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Field"},void 0,!1,void 0,this),Y?null:$.jsxDEV("th",{children:"Before"},void 0,!1,void 0,this),$.jsxDEV("th",{children:U.tone==="removed"?"After":"Now"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:X.map((K)=>$.jsxDEV("tr",{children:[$.jsxDEV("th",{scope:"row",children:$.jsxDEV("code",{children:K},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y?null:$.jsxDEV("td",{className:K in F?"was":"none",children:K in F?$.jsxDEV(S0,{v:F[K]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:K in H?"now":"none",children:K in H?$.jsxDEV(S0,{v:H[K]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},K,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function E_({records:_,selected:Q,onPick:J,label:q}){let[U,G]=i.useState(()=>{try{return localStorage.getItem("volter.console.records")==="tree"}catch{return!1}}),Z=(Y)=>{G(Y);try{localStorage.setItem("volter.console.records",Y?"tree":"path")}catch{}},F=(Y,X)=>{let K=Y.writes[Y.writes.length-1],L=Z0(K),z=S4(Y.writes);return $.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:[Q===Y.key?"on":"",X?"nested":""].join(" ").trim()||void 0,"aria-pressed":Q===Y.key,onClick:()=>J(Y.key),children:[X?null:$.jsxDEV(b1,{vendor:Y.twin},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:L.label??c0(K)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[L2(K.subject.type)," · ",L.what.split(" ").slice(-1)[0],Y.writes.length>1?` · ${k1(Y.writes.length,"write")}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:`ws-kind ${z.tone}`,title:z.word,"aria-label":z.word,children:$.jsxDEV(B1,{name:z.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},Y.key,!1,void 0,this)},H=[...new Set(_.map((Y)=>Y.twin))];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-view-switch",role:"group","aria-label":"List the records by",children:[$.jsxDEV("button",{type:"button","aria-pressed":!U,className:U?void 0:"on",onClick:()=>Z(!1),children:"Path"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button","aria-pressed":U,className:U?"on":void 0,onClick:()=>Z(!0),children:"Tree"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"ws-list","aria-label":q,children:U?H.map((Y)=>{let X=_.filter((K)=>K.twin===Y);return $.jsxDEV("li",{className:"ws-group",children:[$.jsxDEV("p",{className:"ws-group-head",children:[$.jsxDEV(b1,{vendor:Y},void 0,!1,void 0,this),$.jsxDEV("b",{children:H1(Y)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:X.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:X.map((K)=>F(K,!0))},void 0,!1,void 0,this)]},Y,!0,void 0,this)}):_.map((Y)=>F(Y,!1))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function SZ({name:_,token:Q,branches:J,opens:q,refused:U,onChanged:G}){let[Z,F]=i.useState(""),[H,Y]=i.useState(!1),X=J?.state==="ok"&&J.data.checkedOut||_.split("/")[1],K=J?.state==="ok"&&J.data.named?.length?J.data.named:[{name:X,running:!0}],L=J?.state==="ok"?J.data.branches:[],z=Z.trim().toLowerCase(),W=(T)=>!z||T.toLowerCase().includes(z),O=(T)=>{T.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"The branch served here",children:[$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("b",{children:X},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(B1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover ws-branch-menu",children:[$.jsxDEV("div",{className:"ws-branch-find",children:[$.jsxDEV("input",{type:"search",placeholder:"Filter","aria-label":"Filter branches",value:Z,onChange:(T)=>F(T.target.value)},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:(T)=>{O(T),Y(!0)},disabled:!J,children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"This World"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-branch-list",children:K.filter((T)=>W(T.name)).map((T)=>$.jsxDEV("li",{className:T.name===X?"current":void 0,children:[$.jsxDEV("span",{className:"tick",children:T.name===X?$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:T.name},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:T.name===X?"served here":T.running?"running":"stopped"},void 0,!1,void 0,this)]},T.name,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Branches of it"},void 0,!1,void 0,this),L.length===0?$.jsxDEV("p",{className:"mode ws-branch-none",children:"None yet. New branch makes one, from now or as the World was."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"ws-branch-list",children:L.filter((T)=>W(T.name)).map((T)=>{let B=$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"tick",children:$.jsxDEV(B1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:CZ(_,T.name)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:T.at?.instant?$.jsxDEV($.Fragment,{children:["as of ",$.jsxDEV(O1,{iso:T.at.instant,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w=T.expiresAt?`Goes away ${new Date(T.expiresAt).toLocaleString()}`:"Kept";return $.jsxDEV("li",{children:q(T.name)?$.jsxDEV("a",{href:`${X1}/${T.name}`,title:w,onClick:(A)=>{A.preventDefault(),O(A),u_(T.name,T.name.split("/"))},children:B},void 0,!1,void 0,this):$.jsxDEV("span",{title:`${w}. Its tokens went to whoever made it; it opens from their page.`,children:B},void 0,!1,void 0,this)},T.name,!1,void 0,this)})},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-branch-foot",children:$.jsxDEV("a",{href:`${X1}/${_}/~/branches`,onClick:(T)=>{T.preventDefault(),O(T),R1([..._.split("/"),"~","branches"])},children:"Manage branches…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g_,{name:_,token:Q,open:H,onClose:()=>Y(!1),onMade:G,refused:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function x_({name:_,view:Q,changes:J,changesets:q}){let U=(G)=>(Z)=>{Z.preventDefault(),R1([..._.split("/"),"~",...G])};return $.jsxDEV("nav",{className:"tabs ws-pane-tabs","aria-label":"Changes and history",children:[$.jsxDEV("a",{href:`${X1}/${_}/~/changes`,className:Q==="changes"?"on":void 0,"aria-current":Q==="changes"?"page":void 0,onClick:U(["changes"]),children:["Changes",J?$.jsxDEV("span",{className:"count",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/changes/changesets`,className:Q==="history"?"on":void 0,"aria-current":Q==="history"?"page":void 0,onClick:U(["changes","changesets"]),children:["History",q?$.jsxDEV("span",{className:"count",children:q},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function kZ({name:_,token:Q,sets:J,sub:q,signsAs:U,canWrite:G,rooted:Z,refused:F,onChanged:H,changes:Y,withScreens:X,required:K}){let[L,z]=i.useState(null),[W,O]=i.useState(!1),T=J.state==="ok"?[...J.data.changesets].sort((k,N)=>N.createdAt.localeCompare(k.createdAt)):[],B=T.find((k)=>k.name===q)??T[0],w=i.useMemo(()=>{let k=new Map;for(let N of B?i_(B):[]){let v=`${N.twin}:${N.entry.subject.type}:${N.entry.subject.id}`,E=k.get(v)??{key:v,twin:N.twin,writes:[]};E.writes.push(N.entry),k.set(v,E)}return[...k.values()]},[B]),A=w.find((k)=>k.key===L)??w[0],R=w1(Q,A?`/-/${_}/log/${A.twin}`:null),I={added:0,removed:0,changed:0};for(let k of w)I[S4(k.writes).tone]=(I[S4(k.writes).tone]??0)+1;let C=B?k4(B):null,P=B?d_(B,K):null;return $.jsxDEV("div",{className:"ws-two",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(x_,{name:_,view:"history",changes:Y,changesets:T.length},void 0,!1,void 0,this),$.jsxDEV(g1,{load:J,what:"the changesets",lines:4},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-list ws-commits","aria-label":"Changesets",children:T.map((k)=>{let N=B?.name===k.name,v=k4(k).label==="Not sent";return $.jsxDEV("li",{children:$.jsxDEV("a",{href:`${X1}/${_}/~/changes/changesets/${k.name}`,className:N?"on":void 0,"aria-current":N?"true":void 0,onClick:(E)=>{E.preventDefault(),z(null),R1([..._.split("/"),"~","changes","changesets",k.name])},children:[$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:l6(k)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[k.owner??(k.cutBy?w4(k.cutBy):"unrecorded")," • ",$.jsxDEV(O1,{iso:k.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),v?$.jsxDEV("span",{className:"ws-unpushed",title:"Not pushed to the remote yet",children:$.jsxDEV(B1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},k.name,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-pane-right",children:[J.state==="ok"&&!B?$.jsxDEV(h2,{title:"No changesets yet",children:$.jsxDEV("p",{children:"Cut one from Changes: the cut box is at its foot."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,B&&C&&P?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-commit-head",children:[$.jsxDEV("div",{className:"ws-commit-title",children:[$.jsxDEV("h3",{children:l6(B)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-commit-stat",children:[$.jsxDEV(B1,{name:"file-diff",size:16},void 0,!1,void 0,this)," ",k1(w.length,"changed record"),I.added?$.jsxDEV("span",{className:"plus",children:[" +",I.added]},void 0,!0,void 0,this):null,I.removed?$.jsxDEV("span",{className:"minus",children:[" −",I.removed]},void 0,!0,void 0,this):null,I.changed?$.jsxDEV("span",{className:"dot",children:[" •",I.changed]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode ws-commit-meta",children:[$.jsxDEV("code",{children:B.name},void 0,!1,void 0,this)," · ",$.jsxDEV(O1,{iso:B.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"ws-commit-who",children:[["Owner",B.owner??(B.cutBy&&/^(token|token:read)$|^key:(?!.* for:)/.test(B.cutBy)?"no person: a service’s":"unrecorded")],["Cut by",B.cutBy?B.pushedBy&&B.applied===null&&B.cutBy==="machine"?"the machine it was cut on":w4(B.cutBy):"unrecorded"],...B.pushedBy?[["Pushed by",w4(B.pushedBy)]]:[]].map(([k,N])=>$.jsxDEV("span",{children:[$.jsxDEV("span",{className:"mode",children:k},void 0,!1,void 0,this)," ",N]},k,!0,void 0,this))},void 0,!1,void 0,this),B.pushedBy?$.jsxDEV("p",{className:"mode ws-commit-meta",children:B.applied===null?"Owner and cut by are as the World it was cut in recorded them; pushed by is this World's own record.":"Owner and cut by are this World’s record; pushed by is as the remote recorded it."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>O(!0),title:"Where it went, the checks, the approvals; Verify, Approve and Deploy",children:[$.jsxDEV("span",{className:`badge cs-${C.tone}`,children:C.label},void 0,!1,void 0,this),$.jsxDEV("span",{className:`badge cs-${P.tone}`,children:P.label},void 0,!1,void 0,this),"Review…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-two inner",children:[$.jsxDEV("div",{className:"ws-files",children:$.jsxDEV(E_,{records:w,...A?{selected:A.key}:{},onPick:z,label:"Records it changed"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:A?$.jsxDEV(h_,{record:A,history:R.state==="ok"?R.data.entries:R.state==="error"?[]:null},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"It changes nothing."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:W,onClose:()=>O(!1),title:`Review: ${l6(B)}`,wide:!0,children:[$.jsxDEV(w_,{name:_,token:Q,signsAs:U,c:B,canWrite:G,rooted:Z,refused:F,onChanged:H,part:"head",required:K},`h:${B.name}`,!1,void 0,this),$.jsxDEV(w_,{name:_,token:Q,signsAs:U,c:B,canWrite:G,rooted:Z,refused:F,onChanged:H,part:"review",required:K},`r:${B.name}`,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function yZ({name:_,token:Q,vendors:J,vendor:q,tick:U}){let[G,Z]=i.useState(O_*4),[F,H]=i.useState(""),[Y,X]=i.useState(null),K=w1(Q,`/-/${_}/timeline?limit=${G}${q?`&twin=${encodeURIComponent(q)}`:""}`,Math.floor(U/2)),L=K.state==="ok"?aZ(K.data.entries):[],z=[...new Set(L.map((I)=>Z0(I.entry).what))].sort(),W=L.filter((I)=>!F||Z0(I.entry).what===F),O=W.find((I)=>x2(I)===Y)??W[0],T=(I)=>(C)=>{C.preventDefault(),X(null),R1([..._.split("/"),"~","events",...I?[I]:[]])},B=O?.entry.input&&typeof O.entry.input==="object"?O.entry.input.body:void 0,w=O?RZ(O.entry.traceparent):null,A=O?f_(O):null,R=O?lZ(O.entry):[];return $.jsxDEV("div",{className:"ws-events",children:[$.jsxDEV("div",{className:"ws-filterbar",children:[$.jsxDEV("nav",{className:"ws-seg","aria-label":"Vendor",children:[$.jsxDEV("a",{href:`${X1}/${_}/~/events`,className:!q?"on":void 0,"aria-current":!q?"page":void 0,onClick:T(),children:"All"},void 0,!1,void 0,this),J.map((I)=>$.jsxDEV("a",{href:`${X1}/${_}/~/events/${I}`,className:q===I?"on":void 0,"aria-current":q===I?"page":void 0,onClick:T(I),children:[$.jsxDEV(b1,{vendor:I},void 0,!1,void 0,this),H1(I)]},I,!0,void 0,this))]},void 0,!0,void 0,this),$.jsxDEV("select",{"aria-label":"Operation",value:F,onChange:(I)=>{H(I.target.value),X(null)},children:[$.jsxDEV("option",{value:"",children:"Every operation"},void 0,!1,void 0,this),z.map((I)=>$.jsxDEV("option",{value:I,children:I},I,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[$.jsxDEV(g1,{load:K,what:"the events",lines:6},void 0,!1,void 0,this),$.jsxDEV("table",{className:"ws-grid","aria-label":"Events",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Time"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"What"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Record"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"By"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Receipt"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:W.map((I)=>{let C=Z0(I.entry),P=f_(I),k=O&&x2(I)===x2(O);return $.jsxDEV("tr",{className:k?"on":void 0,"aria-selected":k,onClick:()=>X(x2(I)),children:[$.jsxDEV("td",{className:"mono",children:$.jsxDEV(O1,{iso:I.entry.occurredAt,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:I.twin},void 0,!1,void 0,this),H1(I.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("b",{children:C.what},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"ws-cell-clip",children:C.label?`“${C.label}”`:$.jsxDEV("code",{children:c0(I.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:w5(I.entry,I.caller)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P?$.jsxDEV("span",{className:P.bad?"badge cs-bad":P.status==="deployed"?"badge cs-done":"badge",children:P.status},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:y_(I.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},x2(I),!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-detail",children:O?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-event-line",children:[$.jsxDEV("span",{className:"badge",children:c_(O.entry)},void 0,!1,void 0,this),A?$.jsxDEV("span",{className:A.bad?"badge cs-bad":"badge cs-good",children:A.status},void 0,!1,void 0,this):null,$.jsxDEV("code",{children:[O.entry.subject.type,":",c0(O.entry)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(O1,{iso:O.entry.occurredAt},void 0,!1,void 0,this)," · ",w5(O.entry,O.caller)]},void 0,!0,void 0,this),w?$.jsxDEV("a",{href:`${X1}/${_}/~/trace/${w.trace}`,onClick:(I)=>{I.preventDefault(),R1([..._.split("/"),"~","trace",w.trace])},children:"Its trace →"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-event-panes",children:[$.jsxDEV("div",{role:"region","aria-label":"The request",children:[$.jsxDEV("h4",{children:"Request"},void 0,!1,void 0,this),B!==void 0?$.jsxDEV(iZ,{body:B},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"No request body: the World or the vendor wrote it."},void 0,!1,void 0,this),R.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Usage"},void 0,!1,void 0,this),$.jsxDEV("dl",{className:"fields",children:R.map(([I,C])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:I},void 0,!1,void 0,this),$.jsxDEV("dd",{children:C},void 0,!1,void 0,this)]},I,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{role:"region","aria-label":"What it wrote",children:[$.jsxDEV("h4",{children:"Written"},void 0,!1,void 0,this),$.jsxDEV(r_,{fields:O.entry.fields},void 0,!1,void 0,this),$.jsxDEV("h4",{children:O.copies.length?"Receipts":"Receipt"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:O.copies.length?O.copies.map((I)=>I.entry.receipt?.status??"landed copy").join(" · "):dZ(O.entry)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode pad",children:"Nothing written here yet."},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:[$.jsxDEV("span",{children:[O?`${W.indexOf(O)+1} of ${W.length}`:W.length," events",q?` at ${H1(q)}`:""]},void 0,!0,void 0,this),K.state==="ok"&&K.data.next?$.jsxDEV("button",{type:"button",onClick:()=>Z((I)=>I+O_*4),children:"Load older"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function vZ({name:_,token:Q,id:J}){let q=/^[0-9a-f]{32}$/.test(J),U=w1(Q,q?`/-/${_}/timeline?trace=${J}&limit=500`:null),G=U.state==="ok"?[...U.data.entries].sort((K,L)=>-p_(K,L)):[],[Z,F]=i.useState(null),H=G[0]?Date.parse(G[0].entry.occurredAt):0,Y=G.length?Math.max(1,Date.parse(G[G.length-1].entry.occurredAt)-H):1,X=[...new Set(G.map((K)=>K.twin))];return $.jsxDEV("div",{className:"ws-sheet ws-trace",children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${X1}/${_}/~/events`,onClick:(K)=>{K.preventDefault(),R1([..._.split("/"),"~","events"])},children:[$.jsxDEV(B1,{name:"arrow-left",size:16},void 0,!1,void 0,this)," Events"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("h2",{children:[G[0]?`${Z0(G[0].entry).what} …`:"Trace"," ",$.jsxDEV("code",{className:"mode",children:J.slice(0,12)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!q?$.jsxDEV("p",{role:"alert",children:[J?`${J} is not a trace id`:"No trace named",": a W3C trace id is 32 hex characters."]},void 0,!0,void 0,this):$.jsxDEV(g1,{load:U,what:"the trace"},void 0,!1,void 0,this),G.length?$.jsxDEV("p",{className:"ws-trace-meta",children:["Started ",$.jsxDEV("b",{children:$.jsxDEV(O1,{iso:G[0].entry.occurredAt},void 0,!1,void 0,this)},void 0,!1,void 0,this)," · Took ",$.jsxDEV("b",{children:[Y," ms"]},void 0,!0,void 0,this)," · Vendors ",$.jsxDEV("b",{children:X.map(H1).join(", ")},void 0,!1,void 0,this)," · Writes ",$.jsxDEV("b",{children:G.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,U.state==="ok"&&G.length===0?$.jsxDEV(h2,{title:"Nothing in this World carries this trace",children:$.jsxDEV("p",{children:["An app instrumented with OpenTelemetry sends a ",$.jsxDEV("code",{children:"traceparent"},void 0,!1,void 0,this)," with each call, and every write that call makes keeps it, so one click reads across every vendor."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,G.length?$.jsxDEV("div",{className:"ws-spans",role:"table","aria-label":"The trace's writes",children:[$.jsxDEV("div",{className:"ws-span head",role:"row",children:[$.jsxDEV("span",{role:"columnheader",children:"Vendor and what"},void 0,!1,void 0,this),$.jsxDEV("span",{role:"columnheader",className:"ws-ticks",children:[$.jsxDEV("span",{children:"0 ms"},void 0,!1,void 0,this),$.jsxDEV("span",{children:[Math.round(Y/2)," ms"]},void 0,!0,void 0,this),$.jsxDEV("span",{children:[Y," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),G.map((K)=>{let L=Date.parse(K.entry.occurredAt)-H,z=x2(K),W=Z0(K.entry);return $.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("div",{className:Z===z?"ws-span on":"ws-span",role:"row",onClick:()=>F(Z===z?null:z),children:[$.jsxDEV("span",{role:"cell",className:"ws-span-name",children:[$.jsxDEV(b1,{vendor:K.twin},void 0,!1,void 0,this),$.jsxDEV("b",{children:H1(K.twin)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[W.what,W.label?` “${W.label}”`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{role:"cell",className:"ws-span-track",children:[$.jsxDEV("span",{className:"ws-span-dot",style:{left:`${L/Y*100}%`}},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-span-at mode",style:{left:`${L/Y*100}%`},children:["+",L," ms"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z===z?$.jsxDEV("div",{className:"ws-span-detail",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:c_(K.entry)},void 0,!1,void 0,this)," on ",$.jsxDEV("code",{children:[K.entry.subject.type,":",c0(K.entry)]},void 0,!0,void 0,this)," · ",w5(K.entry,K.caller)," · ",y_(K.entry)]},void 0,!0,void 0,this),$.jsxDEV(r_,{fields:K.entry.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},z,!0,void 0,this)})]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function jZ({name:_,token:Q,vendor:J,withScreens:q,tick:U}){let G=w1(Q,`/-/${_}/checkpoint/${J}`,Math.floor(U/6)),Z=G.state==="ok"?G.data.tree.filter((R)=>R.deleted!==!0):[],F=[...new Set(Z.map((R)=>R.type))].map((R)=>({type:R,count:Z.filter((I)=>I.type===R).length})).sort((R,I)=>Number(R.type.startsWith("_"))-Number(I.type.startsWith("_"))||L2(R.type).localeCompare(L2(I.type))),[H,Y]=i.useState(null),[X,K]=i.useState(null),L=F.some((R)=>R.type===H)?H:F[0]?.type,z=Z.filter((R)=>R.type===L),W=z.find((R)=>R.id===X)??z[0],O=["name","email","title","text","description","subject","amount","percent_off","unit_amount","currency","status","channel","customer","product"],T=new Set(["id","type","object","livemode","created","updated","updatedAt","deleted"]),B=(R)=>!T.has(R)&&z.some((I)=>I[R]!==void 0&&I[R]!==null&&typeof I[R]!=="object"),w=[...new Set(z.flatMap((R)=>Object.keys(R)))],A=[...O.filter(B),...w.filter((R)=>!O.includes(R)&&B(R))].slice(0,4);return $.jsxDEV("div",{className:"ws-table-app",children:[$.jsxDEV("nav",{className:"ws-tables","aria-label":`${H1(J)}'s records`,children:[$.jsxDEV("div",{className:"ws-list-head",children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:J},void 0,!1,void 0,this),H1(J)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(g1,{load:G,what:"what it stores",lines:4},void 0,!1,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Stores"},void 0,!1,void 0,this),F.map((R)=>$.jsxDEV("a",{href:`#${R.type}`,className:L===R.type?"on":void 0,"aria-current":L===R.type?"true":void 0,onClick:(I)=>{I.preventDefault(),Y(R.type),K(null)},children:[$.jsxDEV(B1,{name:"table-2",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:L2(R.type)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"count",children:R.count},void 0,!1,void 0,this)]},R.type,!0,void 0,this)),$.jsxDEV("p",{className:"menu-label",children:"Also"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/events/${J}`,onClick:(R)=>{R.preventDefault(),R1([..._.split("/"),"~","events",J])},children:[$.jsxDEV(B1,{name:"activity",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its events"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q?$.jsxDEV("a",{href:`${X1}/${_}/~/screens/${J}`,onClick:(R)=>{R.preventDefault(),R1([..._.split("/"),"~","screens",J])},children:[$.jsxDEV(B1,{name:"monitor",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Its screens"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[G.state==="ok"&&F.length===0?$.jsxDEV(h2,{title:`${H1(J)} stores nothing yet`,children:$.jsxDEV("p",{children:"What your app makes there shows here, by type."},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,z.length?$.jsxDEV("table",{className:"ws-grid","aria-label":`${L2(L??"")} records`,children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"id"},void 0,!1,void 0,this),A.map((R)=>$.jsxDEV("th",{children:R},R,!1,void 0,this)),$.jsxDEV("th",{children:"updated"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:z.map((R)=>$.jsxDEV("tr",{className:W?.id===R.id?"on":void 0,"aria-selected":W?.id===R.id,onClick:()=>K(R.id),children:[$.jsxDEV("td",{children:$.jsxDEV("code",{children:R.id},void 0,!1,void 0,this)},void 0,!1,void 0,this),A.map((I)=>$.jsxDEV("td",{className:"ws-cell-clip",children:R[I]===void 0||R[I]===null?$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this):String(R[I])},I,!1,void 0,this)),$.jsxDEV("td",{className:"mode",children:typeof R.updatedAt==="string"?$.jsxDEV(O1,{iso:R.updatedAt},void 0,!1,void 0,this):"—"},void 0,!1,void 0,this)]},R.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("aside",{className:"ws-record","aria-label":"The selected record",children:W?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:L2(W.type)},void 0,!1,void 0,this),$.jsxDEV("code",{children:W.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("dl",{className:"ws-record-fields",children:Object.entries(W).filter(([R])=>R!=="type"&&R!=="id").map(([R,I])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:R},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(S0,{v:I},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},R,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-foot mode",children:W?`${z.indexOf(W)+1} of ${k1(z.length,L2(L??"record"))}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function VZ({name:_,vendor:Q,url:J,mapError:q,holding:U,session:G,retry:Z}){return $.jsxDEV("div",{className:"ws-screen",children:[$.jsxDEV("div",{className:"ws-screen-bar",children:[$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:Q},void 0,!1,void 0,this),$.jsxDEV("b",{children:H1(Q)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:U},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/vendors/${Q}`,onClick:(F)=>{F.preventDefault(),R1([..._.split("/"),"~","vendors",Q])},children:[$.jsxDEV(B1,{name:"table-2",size:16},void 0,!1,void 0,this),"Its records"]},void 0,!0,void 0,this),J?$.jsxDEV("a",{href:J,target:"_blank",rel:"noopener noreferrer",children:[$.jsxDEV(B1,{name:"external-link",size:16},void 0,!1,void 0,this),"New tab"]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),G.state==="ok"&&G.scope==="read"?$.jsxDEV("p",{className:"mode ws-screens-note",children:"You are looking read only: the screens browse, and refuse changes."},void 0,!1,void 0,this):null,q?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not say where its screens are: ",q]},void 0,!0,void 0,this):G.state==="pending"||J===void 0?$.jsxDEV("p",{className:"mode ws-screens-note",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,G.state==="error"?$.jsxDEV("p",{role:"alert",className:"ws-screens-note",children:["The World did not open its screens: ",G.error," ",$.jsxDEV("button",{type:"button",onClick:Z,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,G.state==="ok"&&J===null?$.jsxDEV("p",{className:"mode ws-screens-note",children:[H1(Q),"'s pack lists no screens."]},void 0,!0,void 0,this):null,G.state==="ok"&&J?$.jsxDEV("iframe",{title:`${H1(Q)}, as this World shows it`,src:J},Q,!1,void 0,this):null]},void 0,!0,void 0,this)}function uZ({name:_,token:Q,who:J,scope:q}){let[U,G]=i.useState(0),Z=w1(Q,`/-/${_}/twins`),F=w1(Q,`/-/${_}/rules`,U),H=F.state==="ok"?F.data.changesets:null,[Y,X]=i.useState(null),[K,L]=i.useState(null),[z,W]=i.useState(!1),[O,T]=i.useState([]),B=Y??H?.approvals??1,w=K??H?.summary??"required",A=H!==null&&(B!==(H.approvals??1)||w!==(H.summary??"required")),R=(v,E)=>{if(T((g)=>[{ok:v,text:E,at:new Date().toISOString(),n:++C5},...g].slice(0,3)),!v)u1(E,"error")},I=async(v)=>{v.preventDefault(),W(!0);try{let E=await I1(Q,`/-/${_}/rules`,{method:"PUT",body:JSON.stringify({changesets:{approvals:B,summary:w}})});if(!E.ok){R(!1,`Save: ${await J0(E)}`);return}R(!0,`Saved: ${B===0?"no approval":k1(B,"approval")} before a deploy; a summary ${w==="required"?"required":"generated when none is given"}.`),X(null),L(null),G((g)=>g+1)}finally{W(!1)}},C={gated:"a person deploys an approved changeset",auto:"a push deploys at once",hold:"nothing deploys"},P=J.person?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:J.person},void 0,!1,void 0,this),J.local?", signed in on this machine":""]},void 0,!0,void 0,this):J.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this machine"},void 0,!1,void 0,this),": no one is signed in here, so no person owns them until they are pushed by one"]},void 0,!0,void 0,this):J.admin?$.jsxDEV($.Fragment,{children:$.jsxDEV("b",{children:"the host's admin"},void 0,!1,void 0,this)},void 0,!1,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("b",{children:"this token"},void 0,!1,void 0,this),", a service"]},void 0,!0,void 0,this),k=Z.state==="ok"?Z.data.twins.filter((v)=>v.root?.url):[],N=q!=="write"?"This session reads the World; it changes no rules":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Changesets"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"This World's rules, kept with it and shared by everyone who works in it. A person or the World's token changes them; a key never does, so an agent cannot relax the review its own changes go through."},void 0,!1,void 0,this),$.jsxDEV(g1,{load:F,what:"the rules",lines:2},void 0,!1,void 0,this),$.jsxDEV("form",{className:"ws-rules",onSubmit:(v)=>void I(v),"aria-label":"Changeset rules",children:[$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Recorded as"},void 0,!1,void 0,this),$.jsxDEV("p",{children:["What you cut here is recorded as ",P,". An agent's or an app's key cuts as itself, for the person it was made for; a World's token cuts as a service."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"A cut's summary"},void 0,!1,void 0,this),$.jsxDEV("fieldset",{className:"choice",disabled:Boolean(N)||H===null,children:[$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:w==="required",onChange:()=>L("required")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Required: whoever cuts says what it does and why"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:w==="generated",onChange:()=>L("generated")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Generated from its changes when none is given"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Either way a cut takes every change not yet in a changeset: there is no staging."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Ready to deploy"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-rule-list",children:$.jsxDEV("li",{children:[$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this),"Verified: replayed in a throwaway World, the World's checks passing"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("label",{className:"ws-rule-row",children:[$.jsxDEV("span",{children:"Approved by"},void 0,!1,void 0,this),$.jsxDEV("select",{value:B,onChange:(v)=>X(Number(v.target.value)),disabled:Boolean(N)||H===null,"aria-label":"Approvals required",children:[0,1,2,3,4,5].map((v)=>$.jsxDEV("option",{value:v,children:v===0?"no one: verified is enough":v===1?"1 person":`${v} different people`},v,!1,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"for its contents as they stand"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-rule",children:[$.jsxDEV("h4",{children:"Deploys to"},void 0,!1,void 0,this),Z.state==="ok"&&k.length===0?$.jsxDEV("p",{className:"mode",children:"No vendor here is connected to its real service, so nothing deploys from this World."},void 0,!1,void 0,this):null,k.length?$.jsxDEV("ul",{className:"ws-rule-list",children:k.map((v)=>$.jsxDEV("li",{children:[$.jsxDEV(b1,{vendor:v.twin},void 0,!1,void 0,this),H1(v.twin),": ",C[v.root.deploy??"gated"]??"gated"]},v.twin,!0,void 0,this))},void 0,!1,void 0,this):null,$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("a",{href:`${X1}/${_}/~/settings/services`,onClick:(v)=>{v.preventDefault(),R1([..._.split("/"),"~","settings","services"])},children:"Real services"},void 0,!1,void 0,this)," sets each vendor's deploy policy."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(l0,{log:O,name:_},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(N)||z||!A,title:N??void 0,children:z?"Saving…":"Save"},void 0,!1,void 0,this),A?$.jsxDEV("button",{type:"button",onClick:()=>{X(null),L(null)},children:"Cancel"},void 0,!1,void 0,this):null,N?$.jsxDEV("span",{className:"mode",children:[N,"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function bZ({who:_,scope:Q,snapshot:J,portal:q,onSignOut:U}){let G=Q==="write"?"Reads and changes this World":Q==="read"?"Reads this World; changes nothing":"…",[Z,F]=J?["A snapshot",`of ${J.parent}, read only`]:_.local&&_.person?[_.person,"Signed in on this machine: this World is served here, and acts as you"]:_.local?["This machine","Served here, with no one signed in: what you do is recorded as this machine"]:_.person?[_.person,q?`Signed in through ${new URL(q).host}`:"Signed in"]:_.admin?["The host's admin","Opened with the host admin token: every World it serves"]:["A link or key","Opened with a token for this World"];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Account"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-account",children:[$.jsxDEV("span",{className:"ws-account-face","aria-hidden":"true",children:$.jsxDEV(B1,{name:_.person?"user":_.local?"monitor":J?"clock":"key-round",size:20},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:Z},void 0,!1,void 0,this),$.jsxDEV("small",{children:F},void 0,!1,void 0,this),$.jsxDEV("small",{children:G},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_.local||J?null:$.jsxDEV("p",{children:$.jsxDEV("button",{type:"button",onClick:U,children:[$.jsxDEV(B1,{name:"log-out",size:16},void 0,!1,void 0,this),_.person?"Sign out":_.admin?"Sign out of the host":"Use another token"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q&&_.person?$.jsxDEV("p",{className:"mode",children:["Your profile, orgs and keys are on ",$.jsxDEV("a",{href:`${q}/`,children:new URL(q).host},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function DZ({name:_,token:Q,view:J,sub:q,arg:U,win:G,who:Z,snapshot:F,onReturn:H,onSignOut:Y,worlds:X,session:K,retry:L,twins:z,map:W,branches:O,clock:T,canWrite:B,refused:w,signsAs:A,opens:R,tick:I,admin:C,onRemoved:P,onClock:k,scope:N}){let v=s_(_,Q,I,w),[E,g]=i.useState(0),h=E*1e5+Math.floor(I/2),S=w1(Q,`/-/${_}/diff`,h),b=w1(Q,`/-/${_}/changesets`,h),j=w1(Q,`/-/${_}/rules`,h),[x,V]=i.useState(null),D=(o)=>(z1)=>{z1?.preventDefault(),R1([..._.split("/"),"~",...o])},f=z.state==="ok"?z.data.twins.map((o)=>o.twin):[],y=new Map((W.state==="ok"?W.data.twins:[]).flatMap((o)=>{let z1=b_(_,o);return z1?[[o.twin,z1]]:[]})),p=[...y.keys()],u=W.state==="ok"?W.data.twins.filter((o)=>o.root).map((o)=>o.twin):[],s=(o)=>W.state==="ok"?(W.data.twins.find((z1)=>z1.twin===o)?.resources??[]).reduce((z1,q1)=>z1+q1.count,0):0,t=O?.state==="ok"&&O.data.checkedOut||_.split("/")[1],a=i.useMemo(()=>{if(S.state!=="ok")return[];let o=new Map;for(let z1 of S.data.changes){let q1=`${z1.twin}:${z1.entry.subject.type}:${z1.entry.subject.id}`,y1=o.get(q1)??{key:q1,twin:z1.twin,writes:[]};y1.writes.push(z1.entry),o.set(q1,y1)}return[...o.values()]},[S]),d=a.find((o)=>o.key===x)??a[0],c=w1(Q,J==="changes"&&d?`/-/${_}/log/${d.twin}`:null,h),e=S.state==="ok"?S.data.changes.length:0,Q1=v.waiting.length,G1=v.there,$1=v.origin.state==="ok"?v.origin.data.origin:null,Z1=!B?"This session reads the World; it changes nothing":!G1?"No remote: name one in Settings › Remote":null,Y1=(o,z1,q1,y1,c1,l1)=>$.jsxDEV("a",{href:`${X1}/${_}/~/${y1}`,className:o?"on":void 0,"aria-current":o?"page":void 0,onClick:c1,children:[z1,$.jsxDEV("span",{children:q1},void 0,!1,void 0,this),l1?$.jsxDEV("span",{className:"count",children:l1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),K1=(o)=>{o.currentTarget.closest("details")?.removeAttribute("open")};return $.jsxDEV("div",{className:"ws",children:[$.jsxDEV("div",{className:"ws-bar",role:"toolbar","aria-label":`${_} toolbar`,children:[$.jsxDEV("div",{className:"ws-left",children:[$.jsxDEV(f5,{href:`${X1}/${_}`,onClick:(o)=>{o.preventDefault(),D(["changes"])()}},void 0,!1,void 0,this),$.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"This World",children:[$.jsxDEV(B1,{name:"globe",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-pick-label",children:[$.jsxDEV("small",{children:"World"},void 0,!1,void 0,this),$.jsxDEV("b",{children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(B1,{name:"chevron-down",size:16},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"popover menu-list ws-world-menu",children:[Z.local?null:$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"menu-label",children:"Worlds"},void 0,!1,void 0,this),X.map((o)=>$.jsxDEV("a",{href:`${X1}/${o}`,className:o===_?"on":void 0,onClick:(z1)=>{z1.preventDefault(),K1(z1),R1(o.split("/"))},children:[o===_?$.jsxDEV(B1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(B1,{name:"globe",size:16},void 0,!1,void 0,this),o]},o,!0,void 0,this)),$.jsxDEV("a",{href:`${G0()&&G0()!==T1?G0():""}${X1}/`,onClick:(o)=>{if(G0()&&G0()!==T1)return;o.preventDefault(),K1(o),R1([])},children:[$.jsxDEV(B1,{name:"layout-grid",size:16},void 0,!1,void 0,this),"All Worlds",p1()?` on ${new URL(p1()).host}`:""]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"menu-label",children:"Connect an app"},void 0,!1,void 0,this),p1()?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Point your app's SDKs here with a key made on the platform; its calls to these vendors land in this World:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:[W2,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(p6,{text:O4({platform:p1(),world:_})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):!Z.local?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Point your app's SDKs here with a key from Settings › Access; its calls to these vendors land in this World:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:[W2,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(p6,{text:O4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"ws-menu-text",children:"Run it in this World; its calls to these vendors land here:"},void 0,!1,void 0,this),$.jsxDEV("pre",{children:"volter world run -- npm start"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-menu-text mode",children:["Or point an SDK at ",$.jsxDEV("code",{children:[W2,"/",_,"/<vendor>"]},void 0,!0,void 0,this)," with the token in ",$.jsxDEV("code",{children:".volter/token"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this),$.jsxDEV(p6,{text:O4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/settings`,onClick:(o)=>{K1(o),D(["settings"])(o)},children:[$.jsxDEV(B1,{name:"settings",size:16},void 0,!1,void 0,this),"Settings…"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(SZ,{name:_,token:Q,branches:O,opens:R,refused:w,onChanged:k},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-where",title:"Where this is",children:[$.jsxDEV("span",{children:_},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("span",{children:t},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$1?$.jsxDEV("a",{href:`${X1}/${_}/~/remote`,onClick:D(["remote"]),children:["origin ",$1.namespace,Q1?$.jsxDEV("b",{children:[" ↑",Q1]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("a",{href:`${X1}/${_}/~/remote`,onClick:D(["remote"]),children:"no remote"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/~/settings/clock`,onClick:D(["settings","clock"]),children:T.state==="ok"?$.jsxDEV($.Fragment,{children:[T.data.frozen?"stopped at ":"",$.jsxDEV(O1,{iso:T.data.at,time:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):"…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-right",children:[$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void v.pull(),disabled:Boolean(Z1)||v.busy!==null,title:Z1??`Fetch what ${G1} has and move this branch onto it`,children:[$.jsxDEV(B1,{name:"arrow-down-to-line",size:16},void 0,!1,void 0,this),v.busy==="Pull"?"Pulling…":"Pull"]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void v.push(),disabled:Boolean(Z1)||v.busy!==null||Q1===0,title:Z1??(Q1?`Push ${k1(Q1,"changeset")} to ${G1}`:`Every changeset is at ${G1}`),children:[$.jsxDEV(B1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this),v.busy==="Push"?"Pushing…":"Push",Q1?$.jsxDEV("span",{className:"ws-btn-count",children:Q1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn icon-only","aria-label":"Settings",title:"Settings",onClick:()=>D(["settings"])(),children:$.jsxDEV(B1,{name:"settings",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F?$.jsxDEV("div",{className:"ws-banner",role:"region","aria-label":"Snapshot",children:[$.jsxDEV(B1,{name:"clock",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:["You are looking at ",$.jsxDEV("b",{children:F.parent},void 0,!1,void 0,this)," as it was at ",$.jsxDEV(O1,{iso:F.at},void 0,!1,void 0,this),": a read-only snapshot",F.expiresAt?$.jsxDEV($.Fragment,{children:[", gone ",$.jsxDEV(O1,{iso:F.expiresAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,"."]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void H(F),children:"Return to live"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,v.log.length?$.jsxDEV("div",{className:"ws-said",children:$.jsxDEV(l0,{log:v.log.slice(0,1),name:_},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV("div",{className:"ws-body",children:[$.jsxDEV("nav",{className:"ws-side","aria-label":`${_} places`,children:[p.length?$.jsxDEV("a",{href:`${X1}/${_}/~/screens`,className:J==="screen"?"ws-screens-entry on":"ws-screens-entry",onClick:D(["screens"]),title:`${k1(p.length,"screen")}: ${X2(p.map(H1))}`,children:[$.jsxDEV(B1,{name:"layout-grid",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Screens"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-screens-marks",children:[p.slice(0,3).map((o)=>$.jsxDEV(b1,{vendor:o},o,!1,void 0,this)),p.length>3?$.jsxDEV("span",{className:"more",children:["+",p.length-3]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"count",children:p.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{className:"side-group",children:"Workspace"},void 0,!1,void 0,this),Y1(J==="changes"||J==="history",$.jsxDEV(B1,{name:"file-diff",size:16},void 0,!1,void 0,this),"Changes","changes",D(["changes"]),a.length?String(a.length):void 0),Y1(J==="events"&&!U||J==="trace",$.jsxDEV(B1,{name:"activity",size:16},void 0,!1,void 0,this),"Events","events",D(["events"])),$.jsxDEV("p",{className:"side-group",children:"Records"},void 0,!1,void 0,this),f.map((o)=>$.jsxDEV(i.default.Fragment,{children:Y1(J==="vendor"&&U===o,$.jsxDEV(b1,{vendor:o},void 0,!1,void 0,this),H1(o),`vendors/${o}`,D(["vendors",o]),s(o)?String(s(o)):void 0)},o,!1,void 0,this)),$.jsxDEV("p",{className:"side-group",children:"Remote"},void 0,!1,void 0,this),Y1(!1,$.jsxDEV(B1,{name:"cloud",size:16},void 0,!1,void 0,this),G1?"origin":"Name a remote…","remote",D(["remote"]),Q1?`↑${Q1}`:void 0)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-main",role:"main",children:[J==="changes"?$.jsxDEV("div",{className:"ws-status",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(x_,{name:_,view:"changes",changes:a.length,changesets:b.state==="ok"?b.data.changesets.length:0},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:"Not in a changeset"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:S.state==="ok"?`${k1(a.length,"record")} · ${k1(e,"write")}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:S,what:"the changes",lines:4},void 0,!1,void 0,this),$.jsxDEV(E_,{records:a,...d?{selected:d.key}:{},onPick:V,label:"Changed records"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:[S.state==="ok"&&!d?$.jsxDEV(h2,{title:"No changes on this branch",action:Q1>0&&G1?$.jsxDEV("button",{type:"button",className:"primary",disabled:Boolean(Z1)||v.busy!==null,onClick:()=>void v.push(),children:["Push ",k1(Q1,"changeset")," to origin"]},void 0,!0,void 0,this):void 0,children:$.jsxDEV("p",{children:["What your app writes to this World lands here, record by record, to cut into a changeset. Everything since ",S.data.base.at?$.jsxDEV(O1,{iso:S.data.base.at},void 0,!1,void 0,this):$.jsxDEV("code",{children:S.data.base.id},void 0,!1,void 0,this)," is in one already."]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,d?$.jsxDEV(h_,{record:d,history:c.state==="ok"?c.data.entries:c.state==="error"?[]:null},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(QF,{pinned:!0,generated:j.state==="ok"&&j.data.changesets.summary==="generated",author:{face:$.jsxDEV(B1,{name:Z.person?"user":Z.local?"monitor":"key-round",size:18},void 0,!1,void 0,this),who:Z.person??(Z.local?"This machine":Z.admin?"The host's admin":"A token"),account:`${X1}/${_}/~/settings/account`,branch:t},name:_,token:Q,changes:e,canWrite:B,refused:w,onCut:()=>{g((o)=>o+1),V(null)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,J==="history"?$.jsxDEV(kZ,{name:_,token:Q,sets:b,changes:a.length,withScreens:p,required:j.state==="ok"?j.data.changesets.approvals??1:1,...q?{sub:q}:{},signsAs:A,canWrite:B,rooted:u,refused:w,onChanged:()=>g((o)=>o+1)},void 0,!1,void 0,this):null,J==="events"?$.jsxDEV(yZ,{name:_,token:Q,vendors:f,...U&&f.includes(U)?{vendor:U}:{},tick:I},U??"",!1,void 0,this):null,J==="trace"?$.jsxDEV(vZ,{name:_,token:Q,id:U??""},void 0,!1,void 0,this):null,J==="vendor"&&U?$.jsxDEV(jZ,{name:_,token:Q,vendor:U,withScreens:p.includes(U),tick:I},U,!1,void 0,this):null,J==="screen"&&U?$.jsxDEV(VZ,{name:_,vendor:U,url:W.state==="ok"?y.get(U)??null:void 0,...W.state==="error"?{mapError:W.error}:{},holding:EZ(W.state==="ok"?W.data.twins.find((o)=>o.twin===U)?.resources??[]:[]),session:K,retry:L},U,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:G?.kind==="settings",onClose:()=>D(["changes"])(),title:"Settings",wide:"window",children:G?.kind==="settings"?$.jsxDEV("div",{className:"ws-settings",children:[$.jsxDEV("nav",{"aria-label":"Settings",children:D_.map(([o,z1,q1])=>$.jsxDEV("a",{href:`${X1}/${_}/~/settings/${o}`,className:G.tab===o?"on":void 0,"aria-current":G.tab===o?"page":void 0,onClick:D(["settings",o]),children:[$.jsxDEV(B1,{name:q1,size:16},void 0,!1,void 0,this),z1]},o,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-settings-pane",children:[N==="read"?$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"badge read-only",children:"Read only"},void 0,!1,void 0,this)," This session reads the World; it changes nothing."]},void 0,!0,void 0,this):null,G.tab==="account"?$.jsxDEV(bZ,{who:Z,scope:N,snapshot:F,portal:p1(),onSignOut:Y},void 0,!1,void 0,this):null,G.tab==="changesets"?$.jsxDEV(uZ,{name:_,token:Q,who:Z,scope:N},void 0,!1,void 0,this):null,G.tab==="remote"?$.jsxDEV($F,{name:_,token:Q,canWrite:B,tick:I,refused:w},void 0,!1,void 0,this):null,G.tab==="access"||G.tab==="services"||G.tab==="checks"||G.tab==="clock"?$.jsxDEV(UF,{name:_,token:Q,admin:C,canWrite:B,refused:w,onRemoved:P,only:G.tab},void 0,!1,void 0,this):null,G.tab==="vault"?$.jsxDEV(qF,{name:_,token:Q,canWrite:B,refused:w},void 0,!1,void 0,this):null,G.tab==="appearance"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Appearance"},void 0,!1,void 0,this),$.jsxDEV(fZ,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null},void 0,!1,void 0,this),$.jsxDEV(t1,{open:G?.kind==="branches",onClose:()=>D(["changes"])(),title:"Branches",wide:!0,children:G?.kind==="branches"?$.jsxDEV(gZ,{name:_,token:Q,canWrite:B,branches:O,opens:R,...G.open?{open:G.open}:{},onChanged:k,refused:w},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function p6({text:_}){return $.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>u1("Copied the prompt: paste it into your coding agent"),()=>u1("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}var t6=(_)=>`${_.url.replace(/\/+$/,"")}/${_.namespace}`,hZ=(_)=>_.filter((Q)=>Q.applied===null||Q.applied.outcome==="refused"),EZ=(_,Q=4)=>{let J=[..._].filter((q)=>q.count>0).sort((q,U)=>U.count-q.count);return J.length?J.slice(0,Q).map((q)=>k1(q.count,q.type.replace(/^_+/,""))).join(" · ")+(J.length>Q?` · +${J.length-Q} more`:""):"nothing yet"},m_=$.jsxDEV("svg",{className:"branch-glyph",viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:$.jsxDEV("path",{fill:"currentColor",d:"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm0 2.122a2.25 2.25 0 1 0-1.5 0v5.256a2.25 2.25 0 1 0 1.5 0V9.5h4.25A2.25 2.25 0 0 0 11.5 7.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75H5V5.372ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm6.5-9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this);function xZ({name:_,token:Q,clock:J,canWrite:q,onChanged:U,refused:G,open:Z}){let[F,H]=i.useState(!1),[Y,X]=i.useState(""),[K,L]=i.useState(""),[z,W]=i.useState(null),[O,T]=i.useState(!1),B=J.state==="ok"?J.data:null,w=async(C,P,k)=>{T(!0),W(null);try{let N=await I1(Q,`/-/${_}/${P}`,{method:P==="clock"?"PUT":"POST",body:JSON.stringify(k)});if(!N.ok){G(N),W({ok:!1,text:await J0(N)});return}let v=await N.json();W({ok:!0,text:`${C} — the World is at ${new Date(v.at).toLocaleString()}`}),H(!1),U()}catch(N){W({ok:!1,text:`the World did not answer: ${N instanceof Error?N.message:String(N)}`})}finally{T(!1)}},A=(C)=>{C.preventDefault();let P=new Date(Y);if(Number.isNaN(P.getTime())){W({ok:!1,text:"Pick a date and time."});return}if(B&&P.getTime()<Date.parse(B.at)){W({ok:!1,text:`The World's clock only moves forward: pick a time after ${new Date(B.at).toLocaleString()}.`});return}w("Clock set","clock",{at:P.toISOString()})},R=(C,P)=>{w(`Advanced ${P}`,"clock/advance",{by:C})},I=[["1h","1 hour"],["1d","1 day"],["7d","1 week"],["30d","30 days"]];return $.jsxDEV("div",{className:`clock${B?.frozen?" frozen":""}`,role:"region","aria-label":"World clock",children:[$.jsxDEV("p",{className:"clock-now",children:J.state==="loading"?$.jsxDEV("span",{className:"mode",children:"clock…"},void 0,!1,void 0,this):J.state==="error"?$.jsxDEV("span",{className:"mode",children:["Clock: ",J.error]},void 0,!0,void 0,this):B.frozen?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge",children:"Simulation"},void 0,!1,void 0,this)," World time ",$.jsxDEV("strong",{children:$.jsxDEV(O1,{iso:B.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV($.Fragment,{children:["World time ",$.jsxDEV("strong",{children:$.jsxDEV(O1,{iso:B.at},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"· real time"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q&&B?$.jsxDEV("details",{className:Z?"clock-more inline":"clock-more",open:Z||void 0,children:[$.jsxDEV("summary",{children:"Simulate time…"},void 0,!1,void 0,this),$.jsxDEV("div",{className:Z?void 0:"popover",children:[$.jsxDEV("p",{className:"mode",children:"Move this World's clock forward to see what happens later: renewals, expiries, scheduled sends. Like a test clock, it only moves forward; to look back, the branch picker’s Manage branches… views an earlier moment."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"clock-controls",children:[$.jsxDEV("button",{type:"button","aria-expanded":F,onClick:()=>{H(!F),X(m2(B_(B.at))),W(null)},children:"Set time…"},void 0,!1,void 0,this),$.jsxDEV("div",{role:"group","aria-label":"Advance the clock",className:"advance",children:[$.jsxDEV("span",{className:"mode",children:"Advance"},void 0,!1,void 0,this),I.map(([C,P])=>$.jsxDEV("button",{type:"button","aria-label":`Advance ${P}`,disabled:O||!B.frozen,title:B.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>R(C,P),children:P},C,!1,void 0,this)),$.jsxDEV("form",{className:"inline",onSubmit:(C)=>{if(C.preventDefault(),!/^\d+[smhd]$/.test(K.trim())){W({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}R(K.trim(),`by ${K.trim()}`)},children:[$.jsxDEV("label",{className:"sr",children:["Advance by ",$.jsxDEV("input",{name:"advanceBy",value:K,onChange:(C)=>L(C.target.value),placeholder:"90m, 12h, 3d",size:9,disabled:!B.frozen},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:O||!B.frozen,children:"Advance"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!B.frozen?$.jsxDEV("p",{className:"mode",children:"The World runs on real time. Set a time to start simulating; then advance it."},void 0,!1,void 0,this):null,F?$.jsxDEV("form",{className:"inline","aria-label":"Set the World time",onSubmit:A,noValidate:!0,children:[$.jsxDEV("label",{children:["World time ",$.jsxDEV("input",{name:"worldTime",type:"datetime-local",value:Y,min:m2(B_(B.at)),onChange:(C)=>X(C.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:Intl.DateTimeFormat().resolvedOptions().timeZone},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",disabled:O,children:"Set time"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>H(!1),children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,z?$.jsxDEV("p",{role:z.ok?"status":"alert",children:z.text},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function mZ({name:_,token:Q,clock:J,refused:q}){let[U,G]=i.useState(!1),[Z,F]=i.useState(""),[H,Y]=i.useState(null),[X,K]=i.useState(!1),L=J.state==="ok"?J.data.at:new Date().toISOString(),z=i.useRef(null);return i.useEffect(()=>{if(!U)return;let O=(B)=>{if(B.key==="Escape"&&!document.querySelector("dialog[open]"))G(!1),z.current?.querySelector("button")?.focus()},T=(B)=>{if(!z.current?.contains(B.target))G(!1)};return document.addEventListener("keydown",O),document.addEventListener("click",T),()=>{document.removeEventListener("keydown",O),document.removeEventListener("click",T)}},[U]),$.jsxDEV("div",{className:"as-of",ref:z,children:[$.jsxDEV("button",{type:"button","aria-expanded":U,title:"Open a read-only copy of this World as it was at a moment you pick",onClick:()=>{G(!U),F(m2(L)),Y(null)},children:"View an earlier moment…"},void 0,!1,void 0,this),U?$.jsxDEV("form",{className:"inline","aria-label":"View the World as of a past moment",onSubmit:async(O)=>{O.preventDefault(),Y(null);let T=new Date(Z);if(Number.isNaN(T.getTime())){Y("Pick a date and time.");return}if(T.getTime()>Date.parse(L)){Y(`That is after the World's present (${new Date(L).toLocaleString()}); a snapshot looks back.`);return}K(!0);try{let B=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({at:{instant:T.toISOString()},ttl:3600})});if(!B.ok){q(B),Y(await J0(B));return}let w=await B.json();i6({name:w.name,parent:_,token:w.token,readToken:w.readToken,at:T.toISOString(),expiresAt:w.expiresAt??null,parentOrigin:T1,made:!0});let A=N5(w.origin)?.origin;if(A&&A!==T1){s6(A,w.readToken,w.name,`${X1}/${w.name}`);return}R1(w.name.split("/"))}catch(B){Y(`the World did not answer: ${B instanceof Error?B.message:String(B)}`)}finally{K(!1)}},noValidate:!0,children:[$.jsxDEV("label",{children:["As of ",$.jsxDEV("input",{name:"asOf",type:"datetime-local",value:Z,max:m2(L),onChange:(O)=>F(O.target.value),required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:X,children:X?"Opening…":"Open snapshot"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Opens a read-only copy of this World as it was then; the copy goes away within the hour."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,H?$.jsxDEV("p",{role:"alert",children:H},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function g_({name:_,token:Q,open:J,onClose:q,onMade:U,refused:G}){let Z=(P)=>P.split("/").pop()??P,[F,H]=i.useState(!1),[Y,X]=i.useState(null),[K,L]=i.useState(""),[z,W]=i.useState("now"),[O,T]=i.useState(""),[B,w]=i.useState("24"),[A,R]=i.useState(!0);i.useEffect(()=>{if(J)X(null),T(m2(new Date().toISOString()))},[J]);let I=async(P)=>{P.preventDefault(),X(null);let k=z==="at"?new Date(O):null;if(k&&Number.isNaN(k.getTime())){X("Pick a date and time, or make it as of now.");return}if(k&&k.getTime()>Date.now()){X("A branch is made as of now or a moment before it.");return}H(!0);let N=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({ttl:Math.round(Number(B)*3600),...k?{at:{instant:k.toISOString()}}:A?{live:!0}:{},...K.trim()?{label:K.trim()}:{}})}).catch(()=>null);if(H(!1),!N){X(`${T1} did not answer`);return}if(!N.ok){G(N),X(await J0(N));return}let v=await N.json();i6({name:v.name,parent:_,token:v.token??"",readToken:v.readToken,at:(k??new Date).toISOString(),expiresAt:v.expiresAt??null,parentOrigin:T1,...v.origin?{origin:v.origin}:{}}),q(),L(""),u1(`Made ${Z(v.name)}`),U()};return $.jsxDEV(t1,{open:J,onClose:()=>{if(!F)q()},title:`New branch of ${Z(_)}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>q(),disabled:F,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"new-branch",className:"primary",disabled:F,children:F?"Making…":"Make branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"new-branch",onSubmit:(P)=>void I(P),className:"stack",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Label ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"branchLabel",value:K,onChange:(P)=>L(P.target.value.toLowerCase()),placeholder:"checkout-flow",pattern:"[a-z0-9][a-z0-9\\-]{0,23}",maxLength:24},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("fieldset",{className:"choice",children:[$.jsxDEV("legend",{children:"From"},void 0,!1,void 0,this),$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="now",onChange:()=>W("now")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Now: the World as it is"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="now"?$.jsxDEV("label",{className:"check sub",children:[$.jsxDEV("input",{type:"checkbox",name:"branchLive",checked:A,onChange:(P)=>R(P.target.checked)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"Live: its clock keeps this World's time, as a pull request's preview does (else it stops now)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"branchWhen",checked:z==="at",onChange:()=>W("at")},void 0,!1,void 0,this)," ",$.jsxDEV("span",{children:"An instant before now: the World as it was then, its clock stopped there"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z==="at"?$.jsxDEV("input",{type:"datetime-local","aria-label":"As of",value:O,max:m2(new Date().toISOString()),onChange:(P)=>T(P.target.value)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Goes away after"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"branchLife",value:B,onChange:(P)=>w(P.target.value),children:[$.jsxDEV("option",{value:"1",children:"1 hour"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"24",children:"1 day"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"72",children:"3 days"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"168",children:"7 days"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y?$.jsxDEV("p",{role:"alert",children:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function gZ({name:_,token:Q,canWrite:J,branches:q,opens:U,open:G,onChanged:Z,refused:F,snapshotOf:H}){let Y=w1(Q,`/-/${_}/clock`),X=(w)=>w.split("/").pop()??w,[K,L]=i.useState(!1),z=(w)=>(A)=>{A.preventDefault(),R1([..._.split("/"),"~","branches",...w?w.split("/"):[]])};if(!q)return $.jsxDEV("p",{className:"mode",children:"This host makes no branches of a World."},void 0,!1,void 0,this);let W=q.state==="ok"?q.data.branches:[],O=q.state==="ok"&&(q.data.named?.length??0)>0?q.data.named:[{name:X(_),running:!0}],T=q.state==="ok"?q.data.checkedOut??X(_):X(_),B=async(w)=>{if(!await B0({title:`Remove the branch ${X(w)}?`,body:"Whoever holds its tokens loses it, and its history goes with it.",action:"Remove branch",danger:!0}))return;let A=await I1(Q,`/-/${_}/branches/${w}`,{method:"DELETE"}).catch((R)=>R);if(A instanceof Error){u1(`Remove ${X(w)}: the World did not answer (${A.message})`,"error");return}if(!A.ok){F(A),u1(`Remove ${X(w)}: ${await J0(A)}`,"error");return}I4(w),u1(`Removed ${X(w)}`),Z(),R1([..._.split("/"),"~","branches"])};if(G){let w=G.includes("/")?W.find((R)=>R.name===G):void 0,A=G.includes("/")?void 0:O.find((R)=>R.name===G);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${X1}/${_}/~/branches`,onClick:z(),children:"← Branches"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(g1,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"&&!w&&!A?$.jsxDEV("p",{className:"mode",children:["This World has no branch named ",G,"."]},void 0,!0,void 0,this):null,w?$.jsxDEV(pZ,{name:_,b:w,canWrite:J,opens:U(w.name),remove:()=>void B(w.name)},void 0,!1,void 0,this):null,A&&!w?$.jsxDEV(cZ,{name:_,token:Q,b:A,served:A.name===T,canWrite:J,canServe:q.state==="ok"&&Boolean(q.data.canServe)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}return $.jsxDEV("div",{"aria-labelledby":"branches",children:[$.jsxDEV("div",{className:"branches-head",children:[$.jsxDEV("p",{className:"lede",children:["Branch this World to look at it as it was, or to change it without touching ",$.jsxDEV("b",{children:T},void 0,!1,void 0,this),". Each branch's name opens its page."]},void 0,!0,void 0,this),J?$.jsxDEV("div",{className:"head-actions",children:[H?null:$.jsxDEV(mZ,{name:_,token:Q,clock:Y,refused:F},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>L(!0),children:"New branch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Branches",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{id:"branches",children:"Branch"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Goes away"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:[O.map((w)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:[$.jsxDEV("a",{href:`${X1}/${_}/~/branches/${w.name}`,onClick:z(w.name),children:$.jsxDEV("b",{children:w.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),w.name===T?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):w.running?null:$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge",children:"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"live"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"—"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:"kept"},void 0,!1,void 0,this)]},`own:${w.name}`,!0,void 0,this)),W.map((w)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("a",{href:`${X1}/${_}/~/branches/${w.name}`,onClick:z(w.name),children:$.jsxDEV("b",{children:X(w.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:X(w.from??_)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w.at?.instant?$.jsxDEV(O1,{iso:w.at.instant},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"live"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV(O1,{iso:w.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w.expiresAt?$.jsxDEV(O1,{iso:w.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},w.name,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV(g_,{name:_,token:Q,open:K,onClose:()=>L(!1),onMade:Z,refused:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function pZ({name:_,b:Q,canWrite:J,opens:q,remove:U}){let G=(H)=>H.split("/").pop()??H,Z=d6(Q.name),F=w1(Z,Z?`/-/${Q.name}/diff`:null);return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[m_," ",G(Q.name)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>u_(Q.name,Q.name.split("/")),children:"Open"},void 0,!1,void 0,this):null,J?$.jsxDEV("button",{type:"button",className:"danger-button",onClick:U,children:"Remove…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:Q.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Parent"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:G(Q.from??_)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"As of"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.at?.instant?$.jsxDEV(O1,{iso:Q.at.instant},void 0,!1,void 0,this):"live: it keeps its parent's time"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(O1,{iso:Q.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Goes away"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:Q.expiresAt?$.jsxDEV(O1,{iso:Q.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),!q?$.jsxDEV("p",{className:"mode",children:"Its tokens were handed to whoever made it: it opens, and shows its own changes, in their tab."},void 0,!1,void 0,this):null,F.state==="ok"?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Its changes"},void 0,!1,void 0,this),F.data.changes.length===0?$.jsxDEV("p",{className:"mode",children:"Nothing written on it since it branched."},void 0,!1,void 0,this):$.jsxDEV(_F,{changes:F.data.changes,idPrefix:`branch-${G(Q.name)}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function cZ({name:_,token:Q,b:J,served:q,canWrite:U,canServe:G}){let[Z,F]=i.useState(!1),[H,Y]=i.useState(null),X=async()=>{F(!0),Y(null);let K=await I1(Q,`/-/${_}/branches/${encodeURIComponent(J.name)}/serve`,{method:"POST"}).catch(()=>null);if(K?.ok){location.reload();return}F(!1),Y(K?await J0(K):`${T1} did not answer`)};return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[m_," ",J.name," ",q?$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:U&&G&&!q?$.jsxDEV("button",{type:"button",className:"primary",disabled:Z,onClick:()=>void X(),children:Z?"Switching…":"Serve here"},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"block",children:$.jsxDEV("dl",{className:"fields pad",children:[$.jsxDEV("dt",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV("code",{children:J.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"Kind"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:"one of this World's own branches"},void 0,!1,void 0,this),$.jsxDEV("dt",{children:"State"},void 0,!1,void 0,this),$.jsxDEV("dd",{children:J.running?"running":"stopped"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("p",{className:"mode",children:["This is the branch these pages show: its changes are on ",$.jsxDEV("a",{href:`${X1}/${_}/~/changes`,onClick:(K)=>{K.preventDefault(),R1([..._.split("/"),"~","changes"])},children:"Changes"},void 0,!1,void 0,this),"."]},void 0,!0,void 0,this):G?$.jsxDEV("p",{className:"mode",children:["“Serve here” stops this one's twins and serves ",J.name," in its place."]},void 0,!0,void 0,this):$.jsxDEV("p",{className:"mode",children:"This host serves one of the World's own branches at a time, and does not switch them from this page."},void 0,!1,void 0,this),H?$.jsxDEV("p",{role:"alert",children:H},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var O_=50,x2=(_)=>`${_.twin}:${_.position}`,p_=(_,Q)=>Date.parse(Q.entry.occurredAt)-Date.parse(_.entry.occurredAt)||_.twin.localeCompare(Q.twin)||Q.position-_.position,w4=(_)=>{if(!_)return"someone";if(_.startsWith("key:")){let[Q,J]=_.slice(4).split(" for:");return J?`${Q}, for ${J}`:Q||"a key"}if(_.startsWith("person:"))return _.slice(7);return _==="machine"?"this machine":_==="person"?"a session with no name":_==="token:read"?"the read-only token":_==="token"?"the World's token":_},w5=(_,Q)=>{let J=typeof Q==="string"?Q:typeof _.caller==="string"?_.caller:"";if(J.startsWith("key:")&&J.length>4)return`by ${w4(J)}`;if(J.startsWith("person:")&&J.length>7)return`by ${J.slice(7)}`;if(J==="machine")return"by this machine";if(J==="person")return"by a session with no name";if(J==="key")return"by a key";if(J==="token:read")return"by the read-only token";if(J==="token")return"by the World's token";return _.actor?.kind==="system"?"by the vendor":_.actor?.id?`by ${_.actor.id}`:"by an app"},c_=(_)=>_.operation??_.op;function lZ(_){let Q=_.fields??{},J=Q.usage!==null&&typeof Q.usage==="object"?Q.usage:Q,q=(...Y)=>Y.map((X)=>J[X]??Q[X]).find((X)=>typeof X==="number"),U=[],G=q("prompt_tokens","input_tokens"),Z=q("completion_tokens","output_tokens"),F=q("total_tokens");if(G!==void 0)U.push(["tokens in",G.toLocaleString()]);if(Z!==void 0)U.push(["tokens out",Z.toLocaleString()]);if(F!==void 0)U.push(["tokens in all",F.toLocaleString()]);let H=q("cost_usd","cost");if(H!==void 0)U.push(["cost",`$${H<0.01?H.toPrecision(2):H.toFixed(2)}`]);return U}function l_({text:_,at:Q=280}){if(_.length<=Q)return $.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this);return $.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:[$.jsxDEV("span",{className:"text",children:[_.slice(0,Q),"…"]},void 0,!0,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:["show all ",_.length.toLocaleString()," characters"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"text",children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function S0({v:_}){if(typeof _==="string")return $.jsxDEV(l_,{text:_},void 0,!1,void 0,this);if(_===null||typeof _!=="object")return $.jsxDEV("code",{children:String(_)},void 0,!1,void 0,this);let Q=JSON.stringify(_,null,2);return Q.length<=160?$.jsxDEV("code",{children:JSON.stringify(_)},void 0,!1,void 0,this):$.jsxDEV("details",{className:"folded",children:[$.jsxDEV("summary",{children:$.jsxDEV("code",{children:[JSON.stringify(_).slice(0,120),"…"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("pre",{children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var rZ=(_)=>typeof _==="string"?_:Array.isArray(_)?_.map((Q)=>Q&&typeof Q==="object"&&typeof Q.text==="string"?Q.text:"").filter(Boolean).join(`
36
+ `):JSON.stringify(_??"");function iZ({body:_}){if(_===null||typeof _!=="object"||Array.isArray(_))return $.jsxDEV(S0,{v:_},void 0,!1,void 0,this);let Q=_,J=Array.isArray(Q.messages)?Q.messages:null,q=Object.entries(Q).filter(([U])=>!(J&&U==="messages"));return $.jsxDEV($.Fragment,{children:[q.length?$.jsxDEV("dl",{className:"fields",children:q.map(([U,G])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:U},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(S0,{v:G},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},U,!0,void 0,this))},void 0,!1,void 0,this):null,J?$.jsxDEV("ol",{className:"messages",children:J.map((U,G)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:"role",children:typeof U.role==="string"?U.role:"message"},void 0,!1,void 0,this),$.jsxDEV(l_,{text:rZ(U.content)},void 0,!1,void 0,this)]},G,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function r_({fields:_}){let Q=Object.entries(_??{});if(Q.length===0)return $.jsxDEV("p",{className:"mode",children:"No fields."},void 0,!1,void 0,this);return $.jsxDEV("dl",{className:"fields",children:Q.map(([J,q])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:J},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(S0,{v:q},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},J,!0,void 0,this))},void 0,!1,void 0,this)}var dZ=(_)=>_.receipt?`${_.receipt.status??""}${_.receipt.externalId?` · ${_.receipt.externalId}`:""}${_.receipt.reason?` · ${_.receipt.reason}`:""}`:_.operation==="observed"?"observed from the vendor":_.provenance==="placeholder"?"default data":"none: it has not left this World";function aZ(_){let Q=new Map,J=[],q=[],U=new Map;for(let G of _){if(G.entry.landsId||G.entry.aliasOf){q.push(G);continue}let Z={...G,copies:[]};if(J.push(Z),!Q.has(`${G.twin}:${G.entry.id}`))Q.set(`${G.twin}:${G.entry.id}`,Z);if(!U.has(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`))U.set(`${G.twin}:${G.entry.subject.type}:${G.entry.subject.id}`,Z)}for(let G of q){let Z=G.entry.landsId?Q.get(`${G.twin}:${G.entry.landsId}`):G.entry.aliasOf?U.get(`${G.twin}:${G.entry.subject.type}:${G.entry.aliasOf}`):void 0;if(Z)Z.copies.push(G);else J.push({...G,copies:[]})}return J.sort(p_)}var c6={deployed:5,confirmed:4,landed:3,replayed:2,skipped:1};function f_(_){let Q=[_.entry.receipt,..._.copies.map((U)=>U.entry.receipt)].filter((U)=>Boolean(U?.status));if(Q.length===0)return null;let J=Q.find((U)=>U.status==="failed"||U.status==="refused"),q=[...Q].sort((U,G)=>(c6[G.status]??0)-(c6[U.status]??0))[0];return J&&!(c6[q.status]>=5)?{status:J.status,bad:!0}:{status:q.status,bad:!1}}var P4=1280,N4=820,I_=160;function sZ({data:_}){let{world:Q,vendor:J,url:q,active:U,open:G,changed:Z}=_;return $.jsxDEV($.Fragment,{children:[$.jsxDEV(G_,{isVisible:!0,position:J1.Top,align:"start",className:"frame-label",children:[$.jsxDEV(b1,{vendor:J},void 0,!1,void 0,this),$.jsxDEV("span",{children:H1(J)},void 0,!1,void 0,this),Z?$.jsxDEV("a",{className:"frame-changed nodrag",href:`${X1}/${Q}/~/changes`,onClick:(F)=>{F.preventDefault(),R1([...Q.split("/"),"~","changes"])},title:`${k1(Z,"record")} changed here, not in a changeset: see them in Changes`,children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),Z]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:U?"frame on":"frame",style:{width:P4,height:N4},children:[$.jsxDEV("div",{className:"frame-bar",title:"Drag to move",children:[$.jsxDEV(b1,{vendor:J},void 0,!1,void 0,this),$.jsxDEV("strong",{children:H1(J)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"frame-url",children:q.replace(/^https?:\/\//,"")},void 0,!1,void 0,this),$.jsxDEV("a",{className:"nodrag",href:`${X1}/${Q}/~/screens/${J}`,onClick:(F)=>{F.preventDefault(),G(J)},children:"Open"},void 0,!1,void 0,this),$.jsxDEV("a",{className:"nodrag",href:q,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${H1(J)} in a new tab`,children:"↗"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:U?"frame-body nodrag nopan nowheel":"frame-body",children:$.jsxDEV("iframe",{title:`${J} screens`,src:q,loading:"lazy",style:{pointerEvents:U?"auto":"none"}},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var tZ={screen:sZ};function oZ(_){return $.jsxDEV(b6,{children:$.jsxDEV(nZ,{..._},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function nZ({name:_,token:Q,twins:J,session:q,retry:U,snapshot:G,back:Z}){let F=w1(Q,`/-/${_}/diff`),H=i.useMemo(()=>{let g={};if(F.state==="ok")for(let h of F.data.changes)(g[h.twin]??=new Set).add(`${h.entry.subject.type}:${h.entry.subject.id}`);return Object.fromEntries(Object.entries(g).map(([h,S])=>[h,S.size]))},[F]),Y=(g)=>H[g]??0,X=new Map((J.state==="ok"?J.data.twins:[]).flatMap((g)=>{let h=b_(_,g);return h?[[g.twin,h]]:[]})),K=[...X.keys()],L=`volter.canvas.${_}`,[z,W]=i.useState(null),[O,T]=i.useState(!0),B=R5(),w=i.useCallback((g)=>R1([..._.split("/"),"~","screens",g]),[_]),A=Math.max(1,Math.ceil(Math.sqrt(K.length))),R=i.useCallback(()=>{let g={};try{g=JSON.parse(localStorage.getItem(L)??"{}")}catch{}return K.map((h,S)=>({id:h,type:"screen",dragHandle:".frame-bar",position:g[h]??{x:S%A*(P4+I_),y:Math.floor(S/A)*(N4+I_)},data:{world:_,vendor:h,url:X.get(h),active:!1,open:w,changed:H[h]??0}}))},[K.join(","),_,A,w,H]),[I,C,P]=e9([]);i.useEffect(()=>{C(R())},[R,C]),i.useEffect(()=>{C((g)=>g.map((h)=>h.data.active===(h.id===z)?h:{...h,data:{...h.data,active:h.id===z}}))},[z,C]),i.useEffect(()=>{let g=(h)=>{if(h.key==="Escape")W(null)};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[]);let k=()=>{try{localStorage.setItem(L,JSON.stringify(Object.fromEntries(I.map((g)=>[g.id,g.position]))))}catch{}},N=(g)=>{W(g);let h=B.getNode(g);if(!h)return;let S=Math.min((window.innerWidth-300)/P4,(window.innerHeight-120)/N4,1);B.setCenter(h.position.x+P4/2-130/S,h.position.y+N4/2,{zoom:S,duration:400})},v=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,E=q.state==="ok"&&J.state==="ok";return $.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"Every vendor's screens",children:$.jsxDEV(n9,{nodes:E?I:[],onNodesChange:P,nodeTypes:tZ,onNodeDragStop:k,onNodeClick:(g,h)=>W(h.id),onPaneClick:()=>W(null),fitView:!0,fitViewOptions:{padding:{top:"64px",left:"272px",right:"32px",bottom:"32px"}},minZoom:0.05,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!1,zoomOnDoubleClick:!1,colorMode:v?"dark":"light",proOptions:{hideAttribution:!0},children:[$.jsxDEV(Q_,{variant:A0.Dots,gap:28,size:1.4},void 0,!1,void 0,this),$.jsxDEV(K2,{position:"top-left",className:"float layers",children:[$.jsxDEV("div",{className:"float-head",children:[$.jsxDEV("button",{type:"button",className:"back",onClick:Z,"aria-label":`Back to ${_}`,children:"←"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"float-title",children:[$.jsxDEV("strong",{children:_.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[_.split("/")[0],G?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ghost","aria-expanded":O,"aria-label":O?"Hide the screens list":"Show the screens list",onClick:()=>T(!O),children:O?"▾":"▸"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O?$.jsxDEV("ul",{className:"layer-list","aria-label":"Screens",children:K.map((g)=>$.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:z===g?"on":void 0,onClick:()=>N(g),children:[$.jsxDEV(b1,{vendor:g},void 0,!1,void 0,this),$.jsxDEV("span",{children:H1(g)},void 0,!1,void 0,this),Y(g)?$.jsxDEV("span",{className:"layer-changed",title:`${k1(Y(g),"record")} changed, not in a changeset`,children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),Y(g)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},g,!1,void 0,this))},void 0,!1,void 0,this):null,$.jsxDEV(g1,{load:J,what:"the vendors"},void 0,!1,void 0,this),q.state==="pending"?$.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,q.state==="error"?$.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",q.error," ",$.jsxDEV("button",{type:"button",onClick:U,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(K2,{position:"top-center",className:"float hint mode",children:z?`Using ${H1(z)} · Esc to leave`:"Drag to pan · scroll to zoom · click a screen to use it"},void 0,!1,void 0,this),$.jsxDEV($_,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),$.jsxDEV(U_,{pannable:!0,zoomable:!0,nodeBorderRadius:8,position:"bottom-right"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var i_=(_)=>_.actions.map((Q)=>({twin:Q.service,entry:{...Q.action,service:Q.service,op:Q.action.op??Q.action.operation??""}})),eZ=(_)=>{let Q=_.action.input??{};return!(typeof Q.operationId==="string"||Q.graphql!==void 0&&Q.graphql!==null)};function k4(_){let Q=_.actions.filter(eZ).length,J=_.actions.length-Q,q=_.applied?.receipts??[],U=_.deployed??[],G=new Set([...U.filter((H)=>H.status==="deployed"),...q.filter((H)=>H.status==="confirmed")].map((H)=>H.actionId)).size,Z=new Set([...U.filter((H)=>H.status==="refused"||H.status==="failed"),...q.filter((H)=>H.status==="failed")].map((H)=>H.actionId)).size,F={performed:G,failed:Z,total:J,own:Q};if(J>0&&G>=J)return{label:"Deployed",tone:"done",...F};if(G>0)return{label:`Partly deployed: ${G} of ${J}`,tone:"warn",...F};if(Z>0)return{label:`${Z} refused or failed`,tone:"bad",...F};if(q.some((H)=>H.status==="replayed")&&q.every((H)=>H.status==="replayed"||H.status==="skipped"))return{label:"Pushed",tone:"good",...F};return{label:"Not sent",tone:"plain",...F}}var l6=(_)=>_.message??_.narration?.split(`
37
+ `)[0]?.replace(/ setting .*$/,"")??_.name;function d_(_,Q=1){let J=_.currentHash??_.contentHash,q=_.readiness?.approvers??new Set(_.approvals.filter((G)=>G.contentHash===J).map((G)=>G.principal)).size,U=_.verification&&_.verification.contentHash===J?_.verification:null;if(U&&!U.passed)return{label:"Checks failed",tone:"bad"};if(q>0&&q<Q)return{label:`Approved by ${q} of ${Q}`,tone:"plain"};if(q>0)return{label:`Approved by ${q}`,tone:"good"};if(U)return{label:"Verified",tone:"good"};return{label:"Not verified",tone:"plain"}}function w_({name:_,token:Q,signsAs:J,c:q,canWrite:U,rooted:G,refused:Z,onChanged:F,part:H,required:Y}){let X=H==="head",K=H==="review",[L,z]=i.useState(null),[W,O]=i.useState(!1),[T,B]=i.useState(""),[w,A]=i.useState(""),[R,I]=i.useState(null),C=w1(Q,`/-/${_}/origin`),P=k4(q),k=d_(q,Y),N=i_(q),v=[...new Set(N.map((u)=>u.twin))],E=v.some((u)=>G.includes(u)),g=(u)=>u===(q.currentHash??q.contentHash),h=q.applied?.receipts??[],S=(q.deployed??[]).filter((u)=>u.status!=="landed"),b=h.filter((u)=>u.status==="confirmed").length,j=S.filter((u)=>u.status==="deployed"),x=async(u,s,t,a)=>{z(u),I(null);try{let d=await I1(Q,s,{method:"POST",...t===void 0?{}:{body:JSON.stringify(t)}});if(!d.ok)return Z(d),I({what:u,...v1(await P0(d))}),!1;if(a)u1(a);return F(),!0}catch(d){return I({what:u,text:`the World did not answer (${d instanceof Error?d.message:String(d)})`,acts:[]}),!1}finally{z(null)}},V=()=>{x("Verify",`/-/${_}/changesets/${q.name}/verify`,void 0,"Verified: the checks ran over it")},D=async(u)=>{if(u.preventDefault(),await x("Approve",`/-/${_}/changesets/${q.name}/approve`,{...T.trim()?{note:T.trim()}:{},...J===null&&w.trim()?{as:w.trim()}:{}},"Approved"))O(!1),B("")},f=async()=>{let u=v.filter((s)=>G.includes(s));if(!await B0({title:`Deploy ${q.name} to the real vendors?`,body:$.jsxDEV($.Fragment,{children:["It performs its ",q.actions.length," change",q.actions.length===1?"":"s"," against the real account",u.length===1?"":"s"," behind ",X2(u.map(H1)),". This cannot be taken back here."]},void 0,!0,void 0,this),action:"Deploy",danger:!0,typed:q.name}))return;z("Deploy"),I(null);try{let s=await I1(Q,`/-/${_}/deploy/${q.name}`,{method:"POST",body:JSON.stringify({confirm:q.name})});if(!s.ok){Z(s),I({what:"Deploy",...v1(await P0(s))});return}let t=await I1(Q,`/-/${_}/changesets/${q.name}`),a=t.ok?await t.json():null;if(!a){u1("Deploy: sent; reading its receipts failed","info"),F();return}let d=k4(a);u1(`Deploy: ${d.performed} of ${d.total} change${d.total===1?"":"s"} performed at the vendor${d.failed?`; ${d.failed} refused or failed`:""}`,d.failed?"error":d.performed?"ok":"info"),F()}catch(s){I({what:"Deploy",text:`the World did not answer (${s instanceof Error?s.message:String(s)})`,acts:[]})}finally{z(null)}},y=!U?"This session reads the World; it changes nothing":P.label==="Deployed"?"Already deployed: every change was performed at the vendor":null,p=C.state==="ok"&&C.data.origin?t6(C.data.origin):null;return $.jsxDEV("div",{className:"changeset","aria-labelledby":"changeset-title",children:[X?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"changeset-title",children:[q.message??q.name," ",$.jsxDEV("span",{className:`badge cs-${P.tone}`,children:P.label},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:`badge cs-${k.tone}`,children:k.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:q.name},void 0,!1,void 0,this)," · made ",$.jsxDEV(O1,{iso:q.createdAt},void 0,!1,void 0,this)," · ",q.actions.length," change",q.actions.length===1?"":"s"," at ",X2(v.map(H1))||"no vendor"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[$.jsxDEV("button",{type:"button",onClick:V,disabled:Boolean(y)||L!==null,title:y??"Replay it in a throwaway World and run the World's checks",children:L==="Verify"?"Verifying…":"Verify"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>O(!0),disabled:Boolean(y)||L!==null,title:y??"Sign its current contents as yourself",children:"Approve…"},void 0,!1,void 0,this),E?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>void f(),disabled:Boolean(y)||L!==null,title:y??"Perform it against the real accounts behind this World",children:L==="Deploy"?"Deploying…":"Deploy…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),y&&P.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:[y,"."]},void 0,!0,void 0,this):null,R?$.jsxDEV("div",{role:"alert",className:"refusal",children:[$.jsxDEV("span",{children:[$.jsxDEV("b",{children:R.what},void 0,!1,void 0,this),": ",R.text]},void 0,!0,void 0,this),R.acts.includes("verify")&&U?$.jsxDEV("button",{type:"button",onClick:V,disabled:L!==null,children:"Verify"},void 0,!1,void 0,this):null,R.acts.includes("approve")&&U?$.jsxDEV("button",{type:"button",onClick:()=>O(!0),disabled:L!==null,children:"Approve…"},void 0,!1,void 0,this):null,$.jsxDEV(k_,{name:_,acts:R.acts},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):null,K?$.jsxDEV($.Fragment,{children:[q.narration?$.jsxDEV("p",{className:"narration",children:q.narration},void 0,!1,void 0,this):null,$.jsxDEV("h4",{children:"Where it went"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"block where",children:[P.performed>0?$.jsxDEV("p",{className:"pad",children:[P.performed>=P.total?"Deployed":"Partly deployed",": ",P.performed," of ",P.total," change",P.total===1?"":"s",P.own?` (and ${P.own} of the World's own, which stay in it)`:""," performed at ",X2([...new Set([...j.map((u)=>u.service),...h.filter((u)=>u.status==="confirmed").map((u)=>u.service)].map(H1))]),j.length?` (${j.length} from here`:" (",j.length&&b?", ":"",b?`${b} by the remote`:"",")."]},void 0,!0,void 0,this):P.label==="Pushed"?$.jsxDEV("p",{className:"pad",children:["Pushed to the remote",p?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:p},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,q.applied?$.jsxDEV($.Fragment,{children:[" · ",$.jsxDEV(O1,{iso:q.applied.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,": every change was replayed there. No vendor has performed any of it."]},void 0,!0,void 0,this):P.failed===0?$.jsxDEV("p",{className:"pad",children:["Not sent: it is only in this World.",q.applied?.outcome==="refused"?" A push was refused (below); Push sends it again.":$.jsxDEV($.Fragment,{children:[" Push sends it to the remote World",E?"; Deploy, to the real vendors behind it":"","."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,P.failed>0?$.jsxDEV("p",{className:"pad failed",role:"alert",children:[P.failed," change",P.failed===1?" was":"s were"," refused or failed at the vendor",[...S.filter((u)=>u.reason&&(u.status==="refused"||u.status==="failed")).map((u)=>u.reason),...h.filter((u)=>u.status==="failed"&&u.error).map((u)=>u.error)].slice(0,3).map((u)=>`: ${v1(u).text}`).join(""),"."]},void 0,!0,void 0,this):null,q.applied?.refusal?.length?$.jsxDEV("ul",{className:"checks pad",children:q.applied.refusal.map((u,s)=>$.jsxDEV("li",{className:"mode",children:v1(u).text},s,!1,void 0,this))},void 0,!1,void 0,this):null,S.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the vendor"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:S.map((u)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:u.status==="refused"||u.status==="failed"?"badge cs-bad":u.status==="deployed"?"badge cs-done":"badge",children:u.status},void 0,!1,void 0,this)," ",H1(u.service)," ",u.status==="deployed"?u.url?$.jsxDEV("a",{href:u.url,target:"_blank",rel:"noopener noreferrer",children:u.externalId??u.url},void 0,!1,void 0,this):u.externalId?$.jsxDEV("code",{children:u.externalId},void 0,!1,void 0,this):null:null,u.reason?$.jsxDEV("span",{className:"mode",children:[" · ",v1(u.reason).text]},void 0,!0,void 0,this):null," ",$.jsxDEV("span",{className:"mode",children:["· ",$.jsxDEV(O1,{iso:u.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},`v:${u.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,h.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"pad where-sub mode",children:"At the remote"},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"receipts pad",children:h.map((u)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:u.status==="failed"?"badge cs-bad":u.status==="confirmed"?"badge cs-done":"badge",children:u.status},void 0,!1,void 0,this)," ",H1(u.service)," ",$.jsxDEV("span",{className:"mode",children:u.status==="replayed"?"replayed at the remote World":u.status==="confirmed"?"performed at the vendor by the remote":""},void 0,!1,void 0,this),u.status==="confirmed"&&u.externalId?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:u.externalId},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,u.error?$.jsxDEV("span",{className:"mode",children:[" · ",v1(u.error).text]},void 0,!0,void 0,this):null]},`r:${u.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),!E&&P.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:["No vendor it changes is connected to its real service here, so it does not deploy from this World. ",$.jsxDEV("a",{href:`${X1}/${_}/~/settings/services`,onClick:(u)=>{u.preventDefault(),R1([..._.split("/"),"~","settings","services"])},children:"Connect a vendor in Settings › Real services"},void 0,!1,void 0,this)," to deploy."]},void 0,!0,void 0,this):null,$.jsxDEV("h4",{children:"Checks"},void 0,!1,void 0,this),!q.verification?$.jsxDEV("p",{className:"mode",children:"Not verified yet. Verify replays it in a throwaway World and runs this World's checks over the result."},void 0,!1,void 0,this):$.jsxDEV("div",{className:g(q.verification.contentHash)?"":"stale",children:[$.jsxDEV("p",{children:[q.verification.passed?"✓ Passed":"✗ Failed"," · ",$.jsxDEV(O1,{iso:q.verification.at},void 0,!1,void 0,this),g(q.verification.contentHash)?null:$.jsxDEV("span",{className:"mode",children:" · on an earlier version of it: verify again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.verification.results.length?$.jsxDEV("ul",{className:"checks",children:q.verification.results.map((u)=>$.jsxDEV("li",{children:[u.passed?"✓":"✗"," ",$.jsxDEV("code",{children:u.id},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:H1(u.service)},void 0,!1,void 0,this)]},u.id,!0,void 0,this))},void 0,!1,void 0,this):null,q.verification.refusals?.length?$.jsxDEV("ul",{className:"checks",children:q.verification.refusals.map((u,s)=>$.jsxDEV("li",{children:["✗ ",$.jsxDEV("code",{children:u.check},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[H1(u.service),": ",u.reason]},void 0,!0,void 0,this)]},s,!0,void 0,this))},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("h4",{children:"Approvals"},void 0,!1,void 0,this),q.approvals.length===0?$.jsxDEV("p",{className:"mode",children:"No one has approved it."},void 0,!1,void 0,this):$.jsxDEV("ul",{className:"approvals",children:q.approvals.map((u,s)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:u.principal},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(O1,{iso:u.at},void 0,!1,void 0,this),g(u.contentHash)?"":" · signed an earlier version"]},void 0,!0,void 0,this),u.note?$.jsxDEV("div",{className:"mode",children:["“",u.note,"”"]},void 0,!0,void 0,this):null]},s,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(t1,{open:W,onClose:()=>{if(!L)O(!1)},title:`Approve ${q.name}`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>O(!1),disabled:L!==null,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"approve-changeset",className:"primary",disabled:L!==null,children:L==="Approve"?"Approving…":"Approve"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"approve-changeset",onSubmit:(u)=>void D(u),className:"stack",children:[$.jsxDEV("p",{className:"mode",children:["You sign its contents as they stand now",J?$.jsxDEV($.Fragment,{children:[", recorded as ",$.jsxDEV("b",{children:J},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,". A later change to it shows your approval as for an earlier version."]},void 0,!0,void 0,this),J===null?$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Approving as"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"approveAs",value:w,onChange:(u)=>A(u.target.value),maxLength:80,required:!0,placeholder:"your name or email",autoComplete:"off"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"This World was opened with its token, which names no person: the approval records the name you give."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Note ",$.jsxDEV("span",{className:"mode",children:"(optional)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("textarea",{name:"approveNote",value:T,onChange:(u)=>B(u.target.value),rows:3,maxLength:500},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var a_=(_,Q)=>JSON.stringify(_)===JSON.stringify(Q);function _F({changes:_,idPrefix:Q}){let J=[...new Set(_.map((q)=>q.twin))];return $.jsxDEV($.Fragment,{children:J.map((q)=>{let U=_.filter((Z)=>Z.twin===q).map((Z)=>Z.entry),G=[...new Set(U.map((Z)=>`${Z.subject.type}:${Z.subject.id}`))];return $.jsxDEV("div",{className:"compare",role:"group","aria-labelledby":`${Q}-${q}`,children:[$.jsxDEV("h3",{id:`${Q}-${q}`,className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:q},void 0,!1,void 0,this),H1(q)," ",$.jsxDEV("span",{className:"mode",children:["· ",k1(G.length,"record"),", ",k1(U.length,"write")]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:G.map((Z)=>{let F=U.filter((K)=>`${K.subject.type}:${K.subject.id}`===Z),H=F[F.length-1],Y=Z0(H),X={};return $.jsxDEV("li",{className:"record",children:[$.jsxDEV("p",{className:"record-head",children:[$.jsxDEV("span",{className:"kind",children:H.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")},void 0,!1,void 0,this)," ",Y.label?$.jsxDEV("span",{className:"label",children:["“",Y.label,"”"]},void 0,!0,void 0,this):null," ",$.jsxDEV("code",{children:c0(H)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.map((K)=>{let L=K.fields??{},z=Object.entries(L).filter(([O,T])=>!(O in X)||!a_(X[O],T)),W=X;return X={...X,...L},$.jsxDEV("div",{className:"write",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"op",children:Z0(K).what},void 0,!1,void 0,this)," · ",$.jsxDEV(O1,{iso:K.occurredAt},void 0,!1,void 0,this)," · ",w5(K)]},void 0,!0,void 0,this),z.length===0?$.jsxDEV("p",{className:"mode",children:"It set no field to a new value."},void 0,!1,void 0,this):$.jsxDEV("dl",{className:"fields field-diff","aria-label":`Fields ${Z0(K).what} set`,children:z.map(([O,T])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:O},void 0,!1,void 0,this),$.jsxDEV("dd",{children:O in W?$.jsxDEV("span",{className:"changed",children:[$.jsxDEV("del",{children:$.jsxDEV(S0,{v:W[O]},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"arrow","aria-label":"becomes",children:"→"},void 0,!1,void 0,this),$.jsxDEV("ins",{children:$.jsxDEV(S0,{v:T},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV(S0,{v:T},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},O,!0,void 0,this))},void 0,!1,void 0,this)]},K.id,!0,void 0,this)})]},Z,!0,void 0,this)})},void 0,!1,void 0,this)]},q,!0,void 0,this)})},void 0,!1,void 0,this)}function QF({name:_,token:Q,changes:J,canWrite:q,refused:U,onCut:G,pinned:Z,generated:F,inputRef:H,author:Y}){let[X,K]=i.useState(""),[L,z]=i.useState(!1),[W,O]=i.useState([]),T=(w,A,R)=>{O((I)=>[{ok:w,text:A,at:new Date().toISOString(),n:++C5,...R?.length?{acts:R}:{}},...I].slice(0,4))},B=async(w)=>{w.preventDefault(),z(!0);try{let A=await I1(Q,`/-/${_}/changesets`,{method:"POST",body:JSON.stringify(X.trim()?{message:X.trim()}:{})});if(!A.ok){U(A);let I=v1(await P0(A));T(!1,`Cut a changeset: ${I.text}`,I.acts);return}let R=await A.json();T(!0,`Cut ${R.name??"a changeset"}: ${k1(R.actions?.length??0,"change")}, ready to review in History and push.`),K(""),G()}catch(A){T(!1,`Cut a changeset: the World did not answer (${A instanceof Error?A.message:String(A)})`)}finally{z(!1)}};if(Z){let w=!q?"This session reads the World; it changes nothing":J===0?"Nothing to cut: no change is outside a changeset":null;return $.jsxDEV("div",{className:"ws-cut",children:[$.jsxDEV(l0,{log:W,name:_},void 0,!1,void 0,this),$.jsxDEV("form",{onSubmit:(A)=>void B(A),"aria-label":"Cut a changeset",children:[Y?$.jsxDEV("a",{className:"ws-author",href:Y.account,title:`${Y.who}: your account`,onClick:(A)=>{A.preventDefault(),R1(Y.account.slice(X1.length+1).split("/"))},children:Y.face},void 0,!1,void 0,this):null,$.jsxDEV("input",{ref:H,name:"changesetMessage","aria-label":"Summary",value:X,onChange:(A)=>K(A.target.value),placeholder:J===0?"Nothing to cut":F?"Summary (optional)":"Summary (required)",required:!F,maxLength:200,disabled:Boolean(w),title:w??void 0},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(w)||L,title:w??void 0,children:L?"Cutting…":J===0?"Cut a changeset":$.jsxDEV($.Fragment,{children:["Cut ",k1(J,"change"),Y?$.jsxDEV($.Fragment,{children:[" on ",$.jsxDEV("b",{children:Y.branch},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}if(!q||J===0)return $.jsxDEV(l0,{log:W,name:_},void 0,!1,void 0,this);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("form",{className:"block cut pad",onSubmit:(w)=>void B(w),"aria-label":"Cut a changeset",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:["Cut ",J===1?"this change":`these ${J} changes`," into a changeset: what it does and why"]},void 0,!0,void 0,this),$.jsxDEV("input",{name:"changesetMessage",value:X,onChange:(w)=>K(w.target.value),placeholder:"Welcome email for new sign-ups",required:!0,maxLength:200,disabled:J===0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:L||J===0,children:L?"Cutting…":"Cut a changeset"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(l0,{log:W,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function JF({name:_,token:Q}){let[J,q]=i.useState(0),U=w1(Q,`/-/${_}/keys`,J),[G,Z]=i.useState(!1),[F,H]=i.useState(""),[Y,X]=i.useState("write"),[K,L]=i.useState(!1),[z,W]=i.useState(null),[O,T]=i.useState(null),[B,w]=i.useState(null),A=async()=>{let C=`Read-only link · ${new Date().toLocaleDateString(void 0,{month:"short",day:"numeric"})}`,P=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:C,scope:"read"})}).catch(()=>null),k=P?await P.json().catch(()=>({})):{error:`${T1} did not answer`};if(!P?.ok||!k.key){u1(k.error?v1(k.error).text:"refused","error");return}w(`${window.location.origin}${X1}/${_}#${new URLSearchParams({token:k.key}).toString()}`),q((N)=>N+1)},R=async(C)=>{C.preventDefault(),L(!0),W(null);let P=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:F.trim(),scope:Y})}).catch(()=>null);L(!1);let k=P?await P.json().catch(()=>({})):{error:`${T1} did not answer`};if(!P?.ok||!k.key){W(k.error?v1(k.error).text:"refused");return}Z(!1),T({key:k.key,name:F.trim()}),H(""),q((N)=>N+1)},I=async(C)=>{if(!await B0({title:`Revoke ${C.name}?`,body:"Whatever holds it loses this World at once.",action:"Revoke key",danger:!0}))return;let P=await I1(Q,`/-/${_}/keys/${C.id}`,{method:"DELETE"});if(P.ok)u1(`Revoked ${C.name}`);else u1(await J0(P),"error");q((k)=>k+1)};return $.jsxDEV("section",{"aria-labelledby":"keys-head",className:"keys",children:[$.jsxDEV("div",{className:"keys-head",children:[$.jsxDEV("div",{children:[$.jsxDEV("h3",{id:"keys-head",children:"Keys"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"What an app, a script or a CI job holds to reach this World: each named for what holds it and revoked alone. People open the World as themselves; keys are for software."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),p1()?$.jsxDEV("a",{className:"button primary",href:`${p1()}/${encodeURIComponent(_.split("/")[0]??"")}`,children:"Make a key on the platform"},void 0,!1,void 0,this):$.jsxDEV("div",{className:"head-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>void A(),children:"Share a read-only link"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{W(null),Z(!0)},children:"Make a key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:U,what:"the keys",retry:()=>q((C)=>C+1)},void 0,!1,void 0,this),U.state==="ok"?U.data.keys.length===0?$.jsxDEV("p",{className:"mode",children:"No keys yet. The World's own token opens it too."},void 0,!1,void 0,this):$.jsxDEV("table",{className:"dense","aria-label":"Keys",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Name"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"For"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Access"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Made"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last used"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:U.data.keys.map((C)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:C.name},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.person??$.jsxDEV("span",{className:"mode",title:"It acts as itself: a service",children:"no one: a service"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:C.scope==="write"?"Read and write":"Read only"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:$.jsxDEV("span",{title:E6(C.createdAt),children:x6(C.createdAt)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:C.lastUsedAt?x6(C.lastUsedAt):"never"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:$.jsxDEV(z_,{label:`More for ${C.name}`,items:[{label:"Revoke…",danger:!0,onSelect:()=>void I(C)}]},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},C.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(t1,{open:G,onClose:()=>{if(!K)Z(!1)},title:"Make a key",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>Z(!1),disabled:K,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"make-key",disabled:K||!F.trim(),children:K?"Making…":"Make key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"make-key",onSubmit:R,"aria-label":"Make a key",children:[$.jsxDEV("label",{children:["Name ",$.jsxDEV("input",{autoFocus:!0,name:"keyName",value:F,onChange:(C)=>H(C.target.value),placeholder:"ci, staging app…",maxLength:80,required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:["Access ",$.jsxDEV("select",{value:Y,onChange:(C)=>X(C.target.value==="read"?"read":"write"),children:[$.jsxDEV("option",{value:"write",children:"Read and write"},void 0,!1,void 0,this),$.jsxDEV("option",{value:"read",children:"Read only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z?$.jsxDEV("p",{role:"alert",children:z},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(t1,{open:Boolean(O),onClose:()=>T(null),title:`${O?.name??"The key"} is ready`,footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>T(null),children:"Done"},void 0,!1,void 0,this),children:[$.jsxDEV("p",{className:"mode",children:"Copy it now: it is shown this once. Put it where the app reads its secrets."},void 0,!1,void 0,this),O?$.jsxDEV(g6,{label:"Key",value:O.key,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:Boolean(B),onClose:()=>w(null),title:"A read-only link",footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>w(null),children:"Done"},void 0,!1,void 0,this),children:[$.jsxDEV("p",{className:"mode",children:"Whoever opens it sees this World's pages and changes nothing. Copy it now: it is shown this once. It is listed under Keys, where revoking it closes the link at once."},void 0,!1,void 0,this),B?$.jsxDEV(g6,{label:"Link",value:B,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var C5=0;function l0({log:_,name:Q}){if(_.length===0)return null;return $.jsxDEV("ul",{className:"narration-log",role:"status","aria-live":"polite",children:_.map((J)=>$.jsxDEV("li",{className:J.ok?"ok":"bad",children:[$.jsxDEV("span",{className:"mode",children:$.jsxDEV(O1,{iso:J.at,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",J.text,J.acts?$.jsxDEV(k_,{name:Q,acts:J.acts},void 0,!1,void 0,this):null]},J.n,!0,void 0,this))},void 0,!1,void 0,this)}function s_(_,Q,J,q){let[U,G]=i.useState(0),Z=U*1e5+Math.floor(J/2),F=w1(Q,`/-/${_}/origin`,Z),H=w1(Q,`/-/${_}/diff`,Z),Y=w1(Q,`/-/${_}/changesets`,Z),[X,K]=i.useState([]),[L,z]=i.useState(null),W=(I,C,P)=>{if(K((k)=>[{ok:I,text:C,at:new Date().toISOString(),n:++C5,...P?.length?{acts:P}:{}},...k].slice(0,8)),!I)u1(C,"error")},O=async(I,C,P)=>{z(I);try{let k=await I1(Q,`/-/${_}/${C}`,P);if(!k.ok){q(k);let N=v1(await P0(k));return W(!1,`${I}: ${N.text}`,N.acts),null}return await k.json()}catch(k){return W(!1,`${I}: the World did not answer (${k instanceof Error?k.message:String(k)})`),null}finally{z(null),G((k)=>k+1)}},T=F.state==="ok"&&F.data.origin?t6(F.data.origin):null,B=H.state==="ok"?H.data.changes.length:null,w=Y.state==="ok"&&T?hZ(Y.data.changesets.filter((I)=>!I.pushedBy)).sort((I,C)=>I.createdAt.localeCompare(C.createdAt)):[];return{origin:F,diff:H,sets:Y,there:T,changes:B,waiting:w,log:X,busy:L,say:W,send:O,push:async()=>{let I=await O("Push","origin/push",{method:"POST"});if(!I)return;if(I.pushed.length===0){W(!0,"Nothing to push: every changeset is already at the remote.");return}for(let C of I.pushed){let P=C.receipts??[],k=P.filter((h)=>h.status==="replayed").length,N=P.filter((h)=>h.status==="confirmed").length,v=P.filter((h)=>h.status==="failed").length,E=C.outcome==="applied"&&v===0;if(C.outcome==="refused"){W(!1,`Push of ${C.changeset} was refused${C.refusal?.length?`: ${C.refusal.map((h)=>v1(h).text).join("; ")}`:""}.`);continue}let g=[`${k} of ${k1(P.length,"change")} replayed there`,...N?[`${N} performed at the vendor by the remote`]:[],...v?[`${v} failed`]:[]];W(E,`${C.outcome==="partial"?"Partly pushed":"Pushed"} ${C.changeset} to ${T??"the remote"}: ${g.join("; ")}${C.refusal?.length?` (${C.refusal.map((h)=>v1(h).text).join("; ")})`:""}.`)}},pull:async()=>{let I=await O("Pull","origin/pull",{method:"POST"});if(!I)return;let C=Object.entries(I.appended).filter(([,k])=>k>0),P=I.rebased.flatMap((k)=>k.conflicts.map((N)=>`${H1(k.twin)} ${N.subject.type}:${N.subject.id} ${N.field}`));W(P.length===0,`Pulled from ${T??"the remote"}: ${C.length?C.map(([k,N])=>`${k1(N,"entry")} at ${H1(k)}`).join(", "):"nothing new"}${P.length?`; conflicts at ${P.join(", ")}`:""}.`)}}}function $F({name:_,token:Q,canWrite:J,tick:q,refused:U}){let{origin:G,there:Z,changes:F,log:H,busy:Y,say:X,send:K,push:L,pull:z}=s_(_,Q,q,U),[W,O]=i.useState(""),[T,B]=i.useState(""),[w,A]=i.useState(!1),R=async(C)=>{C.preventDefault();let P=await K("Name the remote","origin",{method:"PUT",body:JSON.stringify({url:W.trim(),token:T.trim()})});if(P){let k=Object.values(P.appended??{}).reduce((N,v)=>N+v,0);X(!0,`The remote is ${t6(P.origin)}: its history came in (${k1(k,"entry")}).`),B(""),A(!1)}},I=!J?"This session reads the World; it changes nothing":null;return $.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"block remote",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{children:"Origin"},void 0,!1,void 0,this),J?$.jsxDEV("button",{type:"button",onClick:()=>{O(Z??""),A(!w)},"aria-expanded":w,children:Z?"Change the remote…":"Name a remote…"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"pad",children:[G.state==="ok"?Z?$.jsxDEV("p",{children:[$.jsxDEV("code",{className:"big",children:Z},void 0,!1,void 0,this),G.data.origin?.fetchedAt?$.jsxDEV("span",{className:"mode",children:[" · last fetched ",$.jsxDEV(O1,{iso:G.data.origin.fetchedAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("p",{children:"No remote — this World keeps its default data. Name one to push its changesets to a shared World and pull what others pushed there."},void 0,!1,void 0,this):$.jsxDEV(g1,{load:G,what:"the remote",lines:1},void 0,!1,void 0,this),w?$.jsxDEV("form",{className:"stack origin-form",onSubmit:(C)=>void R(C),"aria-label":"Name the remote",children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The World's address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originUrl",value:W,onChange:(C)=>O(C.target.value),placeholder:"https://worlds.example.com/acme/team",required:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"A key or token that opens it"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"originToken",type:"password",value:T,onChange:(C)=>B(C.target.value),required:!0,autoComplete:"off"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"mode",children:"Naming it brings its history in. Your pushes are recorded there as whoever this key was made for, or as the key itself."},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Y!==null,children:Y==="Name the remote"?"Bringing its history in…":"Save the remote"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>A(!1),children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(l0,{log:H,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function qF({name:_,token:Q,canWrite:J,refused:q}){let[U,G]=i.useState(0),Z=w1(Q,`/-/${_}/twins`,U),F=w1(Q,`/-/${_}/links`,U),H=w1(Q,`/-/${_}/requests?hours=24`,U),[Y,X]=i.useState({}),[K,L]=i.useState(null),[z,W]=i.useState(""),[O,T]=i.useState(!1),[B,w]=i.useState([]),A=(N,v,E)=>{if(w((g)=>[{ok:N,text:v,at:new Date().toISOString(),n:++C5,...E?.length?{acts:E}:{}},...g].slice(0,6)),!N)u1(v,"error")},R=F.state==="ok"?Object.keys(F.data.links).sort():[];i.useEffect(()=>{let N=!0;return Promise.all(R.map(async(v)=>{let E=await I1(Q,`/-/${_}/twins/${v}/credential`).catch(()=>null),g=E?.ok?await E.json():null;return[v,g?.credential??null]})).then((v)=>{if(N)X(Object.fromEntries(v))}),()=>{N=!1}},[_,Q,R.join(","),U]);let I=async(N)=>{if(N.preventDefault(),!K||!z)return;T(!0);let v=await I1(Q,`/-/${_}/twins/${K.vendor}/credential`,{method:"PUT",body:z,headers:{"content-type":"text/plain"}}).catch(()=>null);if(T(!1),!v){A(!1,`Seal ${K.vendor}: ${T1} did not answer`);return}if(!v.ok){q(v);let g=v1(await P0(v));A(!1,`Seal ${H1(K.vendor)}: ${g.text}`,g.acts);return}let E=await v.json().catch(()=>({}));A(!0,`Sealed a credential for ${H1(K.vendor)}${E.fingerprint?` (${E.fingerprint})`:""}: it opens for ${E.boundTo??K.to} only, and is never shown again.`),W(""),L(null),G((g)=>g+1)},C=async(N)=>{if(!await B0({title:`Remove the link ${N}?`,body:`Requests to ${W2}/${_}/${N}/… stop being forwarded to ${F.state==="ok"?F.data.links[N]?.origin:"its origin"}.`,action:"Remove link",danger:!0}))return;let v=await I1(Q,`/-/${_}/links/${N}`,{method:"DELETE"}).catch(()=>null);if(!v?.ok){if(v)q(v);A(!1,`Remove ${N}: ${v?await J0(v):"the World did not answer"}`);return}A(!0,`Removed the link ${N}.`),G((E)=>E+1)},P=(N)=>N?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge rooted",children:"sealed"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[N.fingerprint?$.jsxDEV("code",{children:N.fingerprint},void 0,!1,void 0,this):null," · ",$.jsxDEV(O1,{iso:N.placedAt},void 0,!1,void 0,this),N.sealedBy?` · by ${N.sealedBy==="vault"?"the vault":"the host's key"}`:""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("span",{className:"mode",children:"none"},void 0,!1,void 0,this),k=Z.state==="ok"?Z.data.twins:[];return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"lede",children:"A real vendor's credential lives in one place, sealed: beside this World, bound to where it goes. It is never readable back; this page says only that one is sealed, when, by what, and for where."},void 0,!1,void 0,this),$.jsxDEV(l0,{log:B,name:_},void 0,!1,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"creds-head",children:[$.jsxDEV("div",{className:"block-head",children:$.jsxDEV("h3",{id:"creds-head",children:"Vendors"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(g1,{load:Z,what:"the vendors"},void 0,!1,void 0,this),Z.state==="ok"?$.jsxDEV("table",{className:"dense","aria-label":"Credentials by vendor",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Bound to"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:k.map((N)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:N.twin},void 0,!1,void 0,this),H1(N.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P(N.credential)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.credential?.boundTo?$.jsxDEV("code",{children:N.credential.boundTo},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N.root?.url?$.jsxDEV("code",{children:N.root.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"none: a stand-in"},void 0,!1,void 0,this)},void 0,!1,void 0,this),J?$.jsxDEV("td",{className:"num",children:$.jsxDEV("button",{type:"button",disabled:!N.root?.url,title:N.root?.url?`Seal ${H1(N.twin)}'s real credential for ${N.root.url}`:"Connect it to its real service first (Settings › Real services): a credential is sealed for where it goes",onClick:()=>{W(""),L({vendor:N.twin,to:N.root.url})},children:N.credential?"Replace…":"Seal a credential…"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},N.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Z.state==="ok"&&k.every((N)=>!N.root?.url)?$.jsxDEV("p",{className:"mode pad",children:"No vendor here has a real service behind it, so none holds a credential. Connect one in Settings › Real services; its credential is sealed here."},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("section",{className:"block","aria-labelledby":"links-head",children:[$.jsxDEV("div",{className:"block-head",children:[$.jsxDEV("h3",{id:"links-head",children:"Links"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"a vendor with no twin, forwarded with its sealed credential"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:F,what:"the links"},void 0,!1,void 0,this),H.state==="ok"&&(H.data.journalFailures??0)>0?$.jsxDEV("p",{className:"mode pad",role:"alert",children:[H.data.journalFailures," request ",H.data.journalFailures===1?"line was":"lines were"," not kept by this World's server since it started (its links, and the twins it runs in its own process): those requests are missing from what this page counts."]},void 0,!0,void 0,this):null,F.state==="ok"&&R.length===0?$.jsxDEV("p",{className:"mode pad",children:["No links. A link forwards requests for a vendor with no twin here, at ",$.jsxDEV("code",{children:[W2,"/",_,"/<link>/…"]},void 0,!0,void 0,this),", to that vendor's real API with the credential sealed for it."]},void 0,!0,void 0,this):null,R.length?$.jsxDEV("table",{className:"dense","aria-label":"Links",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Link"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Origin"},void 0,!1,void 0,this),$.jsxDEV("th",{className:"num",children:"Requests, 24h"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Credential"},void 0,!1,void 0,this),J?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:R.map((N)=>{let v=F.state==="ok"?F.data.links[N].origin:"",E=H.state==="ok"?H.data.twins.find((g)=>g.twin===N):void 0;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("b",{children:N},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("code",{children:v},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:E?$.jsxDEV("span",{title:Object.entries(E.byStatus).map(([g,h])=>`${g}: ${h}`).join(" · "),children:E.requests},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:[P(Y[N]??null),Y[N]?.boundTo?$.jsxDEV("div",{className:"mode",children:["bound to ",$.jsxDEV("code",{children:Y[N].boundTo},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),J?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{W(""),L({vendor:N,to:v})},children:Y[N]?"Replace…":"Seal a credential…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void C(N),children:"Remove…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},N,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(t1,{open:Boolean(K),onClose:()=>{if(!O)L(null)},title:`Seal ${K?H1(K.vendor):""}'s credential`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>L(null),disabled:O,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"seal-credential",className:"primary",disabled:O||!z,children:O?"Sealing…":"Seal it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"seal-credential",className:"stack",onSubmit:(N)=>void I(N),children:[$.jsxDEV("p",{className:"mode",children:["It is sealed for ",$.jsxDEV("code",{children:K?.to},void 0,!1,void 0,this)," and opens there only. It is never shown again, here or anywhere."]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real key"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"credential",type:"password",value:z,onChange:(N)=>W(N.target.value),autoComplete:"off",required:!0,autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function UF({name:_,token:Q,admin:J,canWrite:q,refused:U,onRemoved:G,only:Z}){let F=(V)=>!Z||Z===V,[H,Y]=i.useState(0),X=w1(Q,`/-/${_}/twins`,H),K=w1(Q,`/-/${_}/checks`,H),[L,z]=i.useState(0),W=w1(Q,`/-/${_}/clock`,L),[O,T]=i.useState([]),[B,w]=i.useState(null),[A,R]=i.useState(null),[I,C]=i.useState(""),[P,k]=i.useState("gated"),[N,v]=i.useState(!1),E=(V,D,f)=>{if(T((y)=>[{ok:V,text:D,at:new Date().toISOString(),n:++C5,...f?.length?{acts:f}:{}},...y].slice(0,6)),!V)u1(D,"error")},g=async(V,D,f)=>{let y=await I1(Q,D,f).catch(()=>null);if(!y)return E(!1,`${V}: the World did not answer`),!1;if(!y.ok){U(y);let p=v1(await P0(y));return E(!1,`${V}: ${p.text}`,p.acts),!1}return E(!0,`${V}: done.`),Y((p)=>p+1),!0},h=async(V)=>{if(V.preventDefault(),!A)return;v(!0);let D=A.root??{},f=await g(I.trim()?`Connect ${H1(A.twin)} to ${I.trim()}`:`Disconnect ${H1(A.twin)}`,`/-/${_}/twins/${A.twin}/root`,{method:"PUT",body:JSON.stringify(I.trim()?{...D,url:I.trim(),deploy:P}:null)});if(v(!1),f)R(null)},S=async()=>{if(!await B0({title:`Rotate the tokens of ${_}?`,body:"Every app, script and person holding the current tokens loses access at once. The new ones are shown once.",action:"Rotate tokens",danger:!0}))return;let V=await I1(J,`/-/worlds/${_}/rotate`,{method:"POST"});if(V.ok)w(await V.json()),E(!0,"Rotated: the new tokens are shown once, below.");else E(!1,`Rotate: ${await J0(V)}`)},b=async()=>{if(!await B0({title:`Remove ${_}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:_}))return;let V=await I1(J,`/-/worlds/${_}`,{method:"DELETE"}).catch((D)=>D);if(V instanceof Error){E(!1,`Remove: the host did not answer (${V.message})`);return}if(V.ok)G();else E(!1,`Remove: ${await J0(V)}`)},j=X.state==="ok"?X.data.twins:[],x={gated:"gated: a person deploys an approved changeset",auto:"auto: a push deploys at once",hold:"hold: nothing deploys"};return $.jsxDEV($.Fragment,{children:[$.jsxDEV(l0,{log:O,name:_},void 0,!1,void 0,this),F("access")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Access"},void 0,!1,void 0,this),q?$.jsxDEV(JF,{name:_,token:Q},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode",children:"This session reads the World: its keys are managed by whoever holds its token."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("services")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Real services"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:[j.some((V)=>V.root?.url)?null:"Every vendor here is a stand-in. ","Connect a vendor to its real service to read the real state into this World; its real credential is sealed in the Vault, and an approved changeset deploys there by its policy."]},void 0,!0,void 0,this),$.jsxDEV(g1,{load:X,what:"the vendors"},void 0,!1,void 0,this),X.state==="ok"?$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Real services",children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"Vendor"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Real service"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("th",{children:"Last read from it"},void 0,!1,void 0,this),q?$.jsxDEV("th",{className:"num",children:$.jsxDEV("span",{className:"sr",children:"Actions"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("tbody",{children:j.map((V)=>{let D=V.root;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(b1,{vendor:V.twin},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${X1}/${_}/${V.twin}`,title:`Its log and stored state · ${V.position??0} entries`,onClick:(f)=>{f.preventDefault(),R1([..._.split("/"),V.twin])},children:H1(V.twin)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:D?.url?$.jsxDEV("code",{children:D.url},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"not connected"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:D?.url?x[D.deploy??""]??D.deploy??"—":"—"},void 0,!1,void 0,this),$.jsxDEV("td",{children:V.refresh?.failed?$.jsxDEV("span",{role:"alert",children:["failed ×",V.refresh.failed.count??1,": ",V.refresh.failed.reason??""]},void 0,!0,void 0,this):D?.url?E6(V.refresh?.observedAt??V.refresh?.at):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this),q?$.jsxDEV("td",{className:"num row-actions",children:[$.jsxDEV("button",{type:"button",onClick:()=>{C(D?.url??""),k(D?.deploy==="auto"||D?.deploy==="hold"?D.deploy:"gated"),R(V)},children:D?.url?"Change…":"Connect…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",disabled:!D?.url,title:D?.url?"Read the real service's current state into this World":"Connect it first",onClick:()=>void B0({title:`Read ${H1(V.twin)} now?`,body:`The real ${H1(V.twin)}'s current state is read into this World. Nothing is written to ${H1(V.twin)}.`,action:"Read from it"}).then((f)=>{if(f)g(`Read from ${H1(V.twin)}`,`/-/${_}/twins/${V.twin}/refresh`,{method:"POST"})}),children:"Read from it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},V.twin,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,F("clock")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Clock"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"The instant every vendor here stamps from. Set it and move it forward to see what happens later: renewals, expiries, scheduled sends."},void 0,!1,void 0,this),$.jsxDEV(xZ,{name:_,token:Q,clock:W,canWrite:q,onChanged:()=>z((V)=>V+1),refused:U,open:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,F("checks")?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h3",{className:"settings-head",children:"Checks"},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:"JavaScript the World runs over every change before it is performed (a changeset's Verify runs them too)."},void 0,!1,void 0,this),$.jsxDEV(g1,{load:K,what:"the checks"},void 0,!1,void 0,this),K.state==="ok"?K.data.checks.length===0?$.jsxDEV("p",{className:"mode",children:"No checks: every change is performed as it comes."},void 0,!1,void 0,this):$.jsxDEV("div",{className:"block",children:$.jsxDEV("table",{className:"dense","aria-label":"Checks",children:$.jsxDEV("tbody",{children:K.data.checks.map((V)=>$.jsxDEV("tr",{children:$.jsxDEV("td",{children:$.jsxDEV("code",{children:V},void 0,!1,void 0,this)},void 0,!1,void 0,this)},V,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},void 0,!0,void 0,this):null,J&&!Z?$.jsxDEV("div",{className:"danger",role:"region","aria-label":"Danger zone",children:[$.jsxDEV("h3",{children:"Danger zone"},void 0,!1,void 0,this),B?$.jsxDEV("p",{role:"status",children:["token ",$.jsxDEV("code",{children:B.token},void 0,!1,void 0,this)," · read token ",$.jsxDEV("code",{children:B.readToken},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void S(),children:"Rotate tokens"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"New tokens for this World; every app, script and browser using the old ones is signed out."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void b(),children:"Remove world"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:"Deletes this World and everything in it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(t1,{open:Boolean(A),onClose:()=>{if(!N)R(null)},title:`Connect ${A?H1(A.twin):""} to its real service`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>R(null),disabled:N,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"connect-root",className:"primary",disabled:N,children:N?"Saving…":I.trim()?"Connect":"Disconnect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"connect-root",className:"stack",onSubmit:(V)=>void h(V),children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real service's API address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"rootUrl",value:I,onChange:(V)=>C(V.target.value),placeholder:"https://api.openai.com",autoFocus:!0},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Empty disconnects it."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"Deploy policy"},void 0,!1,void 0,this),$.jsxDEV("select",{name:"rootDeploy",value:P,onChange:(V)=>k(V.target.value==="auto"?"auto":V.target.value==="hold"?"hold":"gated"),children:["gated","auto","hold"].map((V)=>$.jsxDEV("option",{value:V,children:x[V]},V,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function cB(){return $.jsxDEV($.Fragment,{children:[$.jsxDEV(IZ,{},void 0,!1,void 0,this),$.jsxDEV(L_,{},void 0,!1,void 0,this),$.jsxDEV(Y_,{},void 0,!1,void 0,this),$.jsxDEV(X_,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{pB as openAt,P5 as ROOT,cB as ConsolePage};