@volter/world-console 3.0.5 → 3.0.6

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,37 +1,37 @@
1
- var xQ=Object.create;var{getPrototypeOf:mQ,defineProperty:K8,getOwnPropertyNames:gQ}=Object;var pQ=Object.prototype.hasOwnProperty;function cQ(_){return this[_]}var lQ,rQ,g1=(_,Q,J)=>{var q=_!=null&&typeof _==="object";if(q){var U=Q?lQ??=new WeakMap:rQ??=new WeakMap,G=U.get(_);if(G)return G}J=_!=null?xQ(mQ(_)):{};let Z=Q||!_||!_.__esModule?K8(J,"default",{value:_,enumerable:!0}):J;for(let F of gQ(_))if(!pQ.call(Z,F))K8(Z,F,{get:cQ.bind(_,F),enumerable:!0});if(q)U.set(_,Z);return Z};var a0=(_,Q)=>()=>(Q||_((Q={exports:{}}).exports,Q),Q.exports);var L0=a0((iQ,u5)=>{(function(){function _(M,x){Object.defineProperty(q.prototype,M,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",x[0],x[1])}})}function Q(M){if(M===null||typeof M!=="object")return null;return M=G1&&M[G1]||M["@@iterator"],typeof M==="function"?M:null}function J(M,x){M=(M=M.constructor)&&(M.displayName||M.name)||"ReactClass";var Q1=M+"."+x;F1[Q1]||(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.",x,M),F1[Q1]=!0)}function q(M,x,Q1){this.props=M,this.context=x,this.refs=_1,this.updater=Q1||c}function U(){}function G(M,x,Q1){this.props=M,this.context=x,this.refs=_1,this.updater=Q1||c}function Z(){}function F(M){return""+M}function X(M){try{F(M);var x=!1}catch(H1){x=!0}if(x){x=console;var Q1=x.error,U1=typeof Symbol==="function"&&Symbol.toStringTag&&M[Symbol.toStringTag]||M.constructor.name||"Object";return Q1.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",U1),F(M)}}function Y(M){if(M==null)return null;if(typeof M==="function")return M.$$typeof===K1?null:M.displayName||M.name||null;if(typeof M==="string")return M;switch(M){case h:return"Fragment";case v:return"Profiler";case I:return"StrictMode";case e:return"Suspense";case t:return"SuspenseList";case J1: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 m:return(M._context.displayName||"Context")+".Consumer";case n:var x=M.render;return M=M.displayName,M||(M=x.displayName||x.name||"",M=M!==""?"ForwardRef("+M+")":"ForwardRef"),M;case a:return x=M.displayName||null,x!==null?x:Y(M.type)||"Memo";case g:x=M._payload,M=M._init;try{return Y(M(x))}catch(Q1){}}return null}function K(M){if(M===h)return"<>";if(typeof M==="object"&&M!==null&&M.$$typeof===g)return"<...>";try{var x=Y(M);return x?"<"+x+">":"<...>"}catch(Q1){return"<...>"}}function H(){var M=$1.A;return M===null?null:M.getOwner()}function L(){return Error("react-stack-top-frame")}function z(M){if(M1.call(M,"key")){var x=Object.getOwnPropertyDescriptor(M,"key").get;if(x&&x.isReactWarning)return!1}return M.key!==void 0}function W(M,x){function Q1(){x1||(x1=!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)",x))}Q1.isReactWarning=!0,Object.defineProperty(M,"key",{get:Q1,configurable:!0})}function O(){var M=Y(this.type);return k1[M]||(k1[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 R(M,x,Q1,U1,H1,W1){var z1=Q1.ref;return M={$$typeof:E,type:M,key:x,props:Q1,_owner:U1},(z1!==void 0?z1: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:H1}),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,x){return x=R(M.type,x,M.props,M._owner,M._debugStack,M._debugTask),M._store&&(x._store.validated=M._store.validated),x}function P(M){A(M)?M._store&&(M._store.validated=1):typeof M==="object"&&M!==null&&M.$$typeof===g&&(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===E}function T(M){var x={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(Q1){return x[Q1]})}function f(M,x){return typeof M==="object"&&M!==null&&M.key!=null?(X(M.key),T(""+M.key)):x.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(x){M.status==="pending"&&(M.status="fulfilled",M.value=x)},function(x){M.status==="pending"&&(M.status="rejected",M.reason=x)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function w(M,x,Q1,U1,H1){var W1=typeof M;if(W1==="undefined"||W1==="boolean")M=null;var z1=!1;if(M===null)z1=!0;else switch(W1){case"bigint":case"string":case"number":z1=!0;break;case"object":switch(M.$$typeof){case E:case V:z1=!0;break;case g:return z1=M._init,w(z1(M._payload),x,Q1,U1,H1)}}if(z1){z1=M,H1=H1(z1);var P1=U1===""?"."+f(z1,0):U1;return o(H1)?(Q1="",P1!=null&&(Q1=P1.replace(_0,"$&/")+"/"),w(H1,x,Q1,"",function(Y0){return Y0})):H1!=null&&(A(H1)&&(H1.key!=null&&(z1&&z1.key===H1.key||X(H1.key)),Q1=B(H1,Q1+(H1.key==null||z1&&z1.key===H1.key?"":(""+H1.key).replace(_0,"$&/")+"/")+P1),U1!==""&&z1!=null&&A(z1)&&z1.key==null&&z1._store&&!z1._store.validated&&(Q1._store.validated=2),H1=Q1),x.push(H1)),1}if(z1=0,P1=U1===""?".":U1+":",o(M))for(var A1=0;A1<M.length;A1++)U1=M[A1],W1=P1+f(U1,A1),z1+=w(U1,x,Q1,W1,H1);else if(A1=Q(M),typeof A1==="function")for(A1===M.entries&&(e1||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),e1=!0),M=A1.call(M),A1=0;!(U1=M.next()).done;)U1=U1.value,W1=P1+f(U1,A1++),z1+=w(U1,x,Q1,W1,H1);else if(W1==="object"){if(typeof M.then==="function")return w(C(M),x,Q1,U1,H1);throw x=String(M),Error("Objects are not valid as a React child (found: "+(x==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":x)+"). If you meant to render a collection of children, use an array instead.")}return z1}function S(M,x,Q1){if(M==null)return M;var U1=[],H1=0;return w(M,U1,"","",function(W1){return x.call(Q1,W1,H1++)}),U1}function N(M){if(M._status===-1){var x=M._ioInfo;x!=null&&(x.start=x.end=performance.now()),x=M._result;var Q1=x();if(Q1.then(function(H1){if(M._status===0||M._status===-1){M._status=1,M._result=H1;var W1=M._ioInfo;W1!=null&&(W1.end=performance.now()),Q1.status===void 0&&(Q1.status="fulfilled",Q1.value=H1)}},function(H1){if(M._status===0||M._status===-1){M._status=2,M._result=H1;var W1=M._ioInfo;W1!=null&&(W1.end=performance.now()),Q1.status===void 0&&(Q1.status="rejected",Q1.reason=H1)}}),x=M._ioInfo,x!=null){x.value=Q1;var U1=Q1.displayName;typeof U1==="string"&&(x.name=U1)}M._status===-1&&(M._status=0,M._result=Q1)}if(M._status===1)return x=M._result,x===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
1
+ var lQ=Object.create;var{getPrototypeOf:rQ,defineProperty:L8,getOwnPropertyNames:iQ}=Object;var dQ=Object.prototype.hasOwnProperty;function aQ(_){return this[_]}var sQ,tQ,r1=(_,Q,J)=>{var q=_!=null&&typeof _==="object";if(q){var U=Q?sQ??=new WeakMap:tQ??=new WeakMap,G=U.get(_);if(G)return G}J=_!=null?lQ(rQ(_)):{};let Z=Q||!_||!_.__esModule?L8(J,"default",{value:_,enumerable:!0}):J;for(let F of iQ(_))if(!dQ.call(Z,F))L8(Z,F,{get:aQ.bind(_,F),enumerable:!0});if(q)U.set(_,Z);return Z};var U2=(_,Q)=>()=>(Q||_((Q={exports:{}}).exports,Q),Q.exports);var O0=U2((oQ,m5)=>{(function(){function _(z,y){Object.defineProperty(q.prototype,z,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",y[0],y[1])}})}function Q(z){if(z===null||typeof z!=="object")return null;return z=U1&&z[U1]||z["@@iterator"],typeof z==="function"?z:null}function J(z,y){z=(z=z.constructor)&&(z.displayName||z.name)||"ReactClass";var l=z+"."+y;X1[l]||(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.",y,z),X1[l]=!0)}function q(z,y,l){this.props=z,this.context=y,this.refs=B1,this.updater=l||G1}function U(){}function G(z,y,l){this.props=z,this.context=y,this.refs=B1,this.updater=l||G1}function Z(){}function F(z){return""+z}function X(z){try{F(z);var y=!1}catch(n){y=!0}if(y){y=console;var l=y.error,_1=typeof Symbol==="function"&&Symbol.toStringTag&&z[Symbol.toStringTag]||z.constructor.name||"Object";return l.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",_1),F(z)}}function Y(z){if(z==null)return null;if(typeof z==="function")return z.$$typeof===T1?null:z.displayName||z.name||null;if(typeof z==="string")return z;switch(z){case D:return"Fragment";case k:return"Profiler";case I:return"StrictMode";case t:return"Suspense";case o:return"SuspenseList";case J1:return"Activity"}if(typeof z==="object")switch(typeof z.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),z.$$typeof){case u:return"Portal";case b:return z.displayName||"Context";case p:return(z._context.displayName||"Context")+".Consumer";case e:var y=z.render;return z=z.displayName,z||(z=y.displayName||y.name||"",z=z!==""?"ForwardRef("+z+")":"ForwardRef"),z;case s:return y=z.displayName||null,y!==null?y:Y(z.type)||"Memo";case g:y=z._payload,z=z._init;try{return Y(z(y))}catch(l){}}return null}function K(z){if(z===D)return"<>";if(typeof z==="object"&&z!==null&&z.$$typeof===g)return"<...>";try{var y=Y(z);return y?"<"+y+">":"<...>"}catch(l){return"<...>"}}function H(){var z=K1.A;return z===null?null:z.getOwner()}function L(){return Error("react-stack-top-frame")}function W(z){if(y1.call(z,"key")){var y=Object.getOwnPropertyDescriptor(z,"key").get;if(y&&y.isReactWarning)return!1}return z.key!==void 0}function B(z,y){function l(){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)",y))}l.isReactWarning=!0,Object.defineProperty(z,"key",{get:l,configurable:!0})}function O(){var z=Y(this.type);return Z0[z]||(Z0[z]=!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.")),z=this.props.ref,z!==void 0?z:null}function T(z,y,l,_1,n,$1){var q1=l.ref;return z={$$typeof:E,type:z,key:y,props:l,_owner:_1},(q1!==void 0?q1:null)!==null?Object.defineProperty(z,"ref",{enumerable:!1,get:O}):Object.defineProperty(z,"ref",{enumerable:!1,value:null}),z._store={},Object.defineProperty(z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(z,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(z,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:n}),Object.defineProperty(z,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:$1}),Object.freeze&&(Object.freeze(z.props),Object.freeze(z)),z}function M(z,y){return y=T(z.type,y,z.props,z._owner,z._debugStack,z._debugTask),z._store&&(y._store.validated=z._store.validated),y}function P(z){A(z)?z._store&&(z._store.validated=1):typeof z==="object"&&z!==null&&z.$$typeof===g&&(z._payload.status==="fulfilled"?A(z._payload.value)&&z._payload.value._store&&(z._payload.value._store.validated=1):z._store&&(z._store.validated=1))}function A(z){return typeof z==="object"&&z!==null&&z.$$typeof===E}function R(z){var y={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(l){return y[l]})}function f(z,y){return typeof z==="object"&&z!==null&&z.key!=null?(X(z.key),R(""+z.key)):y.toString(36)}function C(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status==="string"?z.then(Z,Z):(z.status="pending",z.then(function(y){z.status==="pending"&&(z.status="fulfilled",z.value=y)},function(y){z.status==="pending"&&(z.status="rejected",z.reason=y)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function N(z,y,l,_1,n){var $1=typeof z;if($1==="undefined"||$1==="boolean")z=null;var q1=!1;if(z===null)q1=!0;else switch($1){case"bigint":case"string":case"number":q1=!0;break;case"object":switch(z.$$typeof){case E:case u:q1=!0;break;case g:return q1=z._init,N(q1(z._payload),y,l,_1,n)}}if(q1){q1=z,n=n(q1);var H1=_1===""?"."+f(q1,0):_1;return Q1(n)?(l="",H1!=null&&(l=H1.replace(n1,"$&/")+"/"),N(n,y,l,"",function(M1){return M1})):n!=null&&(A(n)&&(n.key!=null&&(q1&&q1.key===n.key||X(n.key)),l=M(n,l+(n.key==null||q1&&q1.key===n.key?"":(""+n.key).replace(n1,"$&/")+"/")+H1),_1!==""&&q1!=null&&A(q1)&&q1.key==null&&q1._store&&!q1._store.validated&&(l._store.validated=2),n=l),y.push(n)),1}if(q1=0,H1=_1===""?".":_1+":",Q1(z))for(var L1=0;L1<z.length;L1++)_1=z[L1],$1=H1+f(_1,L1),q1+=N(_1,y,l,$1,n);else if(L1=Q(z),typeof L1==="function")for(L1===z.entries&&(Q0||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Q0=!0),z=L1.call(z),L1=0;!(_1=z.next()).done;)_1=_1.value,$1=H1+f(_1,L1++),q1+=N(_1,y,l,$1,n);else if($1==="object"){if(typeof z.then==="function")return N(C(z),y,l,_1,n);throw y=String(z),Error("Objects are not valid as a React child (found: "+(y==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":y)+"). If you meant to render a collection of children, use an array instead.")}return q1}function S(z,y,l){if(z==null)return z;var _1=[],n=0;return N(z,_1,"","",function($1){return y.call(l,$1,n++)}),_1}function w(z){if(z._status===-1){var y=z._ioInfo;y!=null&&(y.start=y.end=performance.now()),y=z._result;var l=y();if(l.then(function(n){if(z._status===0||z._status===-1){z._status=1,z._result=n;var $1=z._ioInfo;$1!=null&&($1.end=performance.now()),l.status===void 0&&(l.status="fulfilled",l.value=n)}},function(n){if(z._status===0||z._status===-1){z._status=2,z._result=n;var $1=z._ioInfo;$1!=null&&($1.end=performance.now()),l.status===void 0&&(l.status="rejected",l.reason=n)}}),y=z._ioInfo,y!=null){y.value=l;var _1=l.displayName;typeof _1==="string"&&(y.name=_1)}z._status===-1&&(z._status=0,z._result=l)}if(z._status===1)return y=z._result,y===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'))
5
5
 
6
- Did you accidentally put curly braces around the import?`,x),"default"in x||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
6
+ Did you accidentally put curly braces around the import?`,y),"default"in y||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
7
7
 
8
8
  Your code should look like:
9
- const MyComponent = lazy(() => import('./MyComponent'))`,x),x.default;throw M._result}function y(){var M=$1.H;return M===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:
9
+ const MyComponent = lazy(() => import('./MyComponent'))`,y),y.default;throw z._result}function j(){var z=K1.H;return z===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:
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 D(){$1.asyncTransitions--}function l(M){if(y0===null)try{var x=("require"+Math.random()).slice(0,7);y0=(u5&&u5[x]).call(u5,"timers").setImmediate}catch(Q1){y0=function(U1){T2===!1&&(T2=!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 H1=new MessageChannel;H1.port1.onmessage=U1,H1.port2.postMessage(void 0)}}return y0(M)}function p(M){return 1<M.length&&typeof AggregateError==="function"?AggregateError(M):M[0]}function k(M,x){x!==R2-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. "),R2=x}function b(M,x,Q1){var U1=$1.actQueue;if(U1!==null)if(U1.length!==0)try{j(U1),l(function(){return b(M,x,Q1)});return}catch(H1){$1.thrownErrors.push(H1)}else $1.actQueue=null;0<$1.thrownErrors.length?(U1=p($1.thrownErrors),$1.thrownErrors.length=0,Q1(U1)):x(M)}function j(M){if(!r2){r2=!0;var x=0;try{for(;x<M.length;x++){var Q1=M[x];do{$1.didUsePromise=!1;var U1=Q1(!1);if(U1!==null){if($1.didUsePromise){M[x]=Q1,M.splice(0,x);return}Q1=U1}else break}while(1)}M.length=0}catch(H1){M.splice(0,x+1),$1.thrownErrors.push(H1)}finally{r2=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var E=Symbol.for("react.transitional.element"),V=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),u=Symbol.for("react.context"),n=Symbol.for("react.forward_ref"),e=Symbol.for("react.suspense"),t=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),J1=Symbol.for("react.activity"),G1=Symbol.iterator,F1={},c={isMounted:function(){return!1},enqueueForceUpdate:function(M){J(M,"forceUpdate")},enqueueReplaceState:function(M){J(M,"replaceState")},enqueueSetState:function(M){J(M,"setState")}},s=Object.assign,_1={};Object.freeze(_1),q.prototype.isReactComponent={},q.prototype.setState=function(M,x){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,x,"setState")},q.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};var q1={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(d0 in q1)q1.hasOwnProperty(d0)&&_(d0,q1[d0]);U.prototype=q.prototype,q1=G.prototype=new U,q1.constructor=G,s(q1,q.prototype),q1.isPureReactComponent=!0;var o=Array.isArray,K1=Symbol.for("react.client.reference"),$1={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},M1=Object.prototype.hasOwnProperty,R1=console.createTask?console.createTask:function(){return null};q1={react_stack_bottom_frame:function(M){return M()}};var x1,U0,k1={},R0=q1.react_stack_bottom_frame.bind(q1,L)(),t1=R1(K(L)),e1=!1,_0=/\/+/g,X0=typeof reportError==="function"?reportError:function(M){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var x=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(x))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",M);return}console.error(M)},T2=!1,y0=null,R2=0,O2=!1,r2=!1,V5=typeof queueMicrotask==="function"?function(M){queueMicrotask(function(){return queueMicrotask(M)})}:l;q1=Object.freeze({__proto__:null,c:function(M){return y().useMemoCache(M)}});var d0={map:S,forEach:function(M,x,Q1){S(M,function(){x.apply(this,arguments)},Q1)},count:function(M){var x=0;return S(M,function(){x++}),x},toArray:function(M){return S(M,function(x){return x})||[]},only:function(M){if(!A(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};iQ.Activity=J1,iQ.Children=d0,iQ.Component=q,iQ.Fragment=h,iQ.Profiler=v,iQ.PureComponent=G,iQ.StrictMode=I,iQ.Suspense=e,iQ.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$1,iQ.__COMPILER_RUNTIME=q1,iQ.act=function(M){var x=$1.actQueue,Q1=R2;R2++;var U1=$1.actQueue=x!==null?x:[],H1=!1;try{var W1=M()}catch(A1){$1.thrownErrors.push(A1)}if(0<$1.thrownErrors.length)throw k(x,Q1),M=p($1.thrownErrors),$1.thrownErrors.length=0,M;if(W1!==null&&typeof W1==="object"&&typeof W1.then==="function"){var z1=W1;return V5(function(){H1||O2||(O2=!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,Y0){H1=!0,z1.then(function(j0){if(k(x,Q1),Q1===0){try{j(U1),l(function(){return b(j0,A1,Y0)})}catch(b4){$1.thrownErrors.push(b4)}if(0<$1.thrownErrors.length){var u4=p($1.thrownErrors);$1.thrownErrors.length=0,Y0(u4)}}else A1(j0)},function(j0){k(x,Q1),0<$1.thrownErrors.length?(j0=p($1.thrownErrors),$1.thrownErrors.length=0,Y0(j0)):Y0(j0)})}}}var P1=W1;if(k(x,Q1),Q1===0&&(j(U1),U1.length!==0&&V5(function(){H1||O2||(O2=!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(() => ...)"))}),$1.actQueue=null),0<$1.thrownErrors.length)throw M=p($1.thrownErrors),$1.thrownErrors.length=0,M;return{then:function(A1,Y0){H1=!0,Q1===0?($1.actQueue=U1,l(function(){return b(P1,A1,Y0)})):A1(P1)}}},iQ.cache=function(M){return function(){return M.apply(null,arguments)}},iQ.cacheSignal=function(){return null},iQ.captureOwnerStack=function(){var M=$1.getCurrentStack;return M===null?null:M()},iQ.cloneElement=function(M,x,Q1){if(M===null||M===void 0)throw Error("The argument must be a React element, but you passed "+M+".");var U1=s({},M.props),H1=M.key,W1=M._owner;if(x!=null){var z1;_:{if(M1.call(x,"ref")&&(z1=Object.getOwnPropertyDescriptor(x,"ref").get)&&z1.isReactWarning){z1=!1;break _}z1=x.ref!==void 0}z1&&(W1=H()),z(x)&&(X(x.key),H1=""+x.key);for(P1 in x)!M1.call(x,P1)||P1==="key"||P1==="__self"||P1==="__source"||P1==="ref"&&x.ref===void 0||(U1[P1]=x[P1])}var P1=arguments.length-2;if(P1===1)U1.children=Q1;else if(1<P1){z1=Array(P1);for(var A1=0;A1<P1;A1++)z1[A1]=arguments[A1+2];U1.children=z1}U1=R(M.type,H1,U1,W1,M._debugStack,M._debugTask);for(H1=2;H1<arguments.length;H1++)P(arguments[H1]);return U1},iQ.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:m,_context:M},M._currentRenderer=null,M._currentRenderer2=null,M},iQ.createElement=function(M,x,Q1){for(var U1=2;U1<arguments.length;U1++)P(arguments[U1]);U1={};var H1=null;if(x!=null)for(A1 in U0||!("__self"in x)||"key"in x||(U0=!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(x)&&(X(x.key),H1=""+x.key),x)M1.call(x,A1)&&A1!=="key"&&A1!=="__self"&&A1!=="__source"&&(U1[A1]=x[A1]);var W1=arguments.length-2;if(W1===1)U1.children=Q1;else if(1<W1){for(var z1=Array(W1),P1=0;P1<W1;P1++)z1[P1]=arguments[P1+2];Object.freeze&&Object.freeze(z1),U1.children=z1}if(M&&M.defaultProps)for(A1 in W1=M.defaultProps,W1)U1[A1]===void 0&&(U1[A1]=W1[A1]);H1&&W(U1,typeof M==="function"?M.displayName||M.name||"Unknown":M);var A1=1e4>$1.recentlyCreatedOwnerStacks++;return R(M,H1,U1,H(),A1?Error("react-stack-top-frame"):R0,A1?R1(K(M)):t1)},iQ.createRef=function(){var M={current:null};return Object.seal(M),M},iQ.forwardRef=function(M){M!=null&&M.$$typeof===a?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 x={$$typeof:n,render:M},Q1;return Object.defineProperty(x,"displayName",{enumerable:!1,configurable:!0,get:function(){return Q1},set:function(U1){Q1=U1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:U1}),M.displayName=U1)}}),x},iQ.isValidElement=A,iQ.lazy=function(M){M={_status:-1,_result:M};var x={$$typeof:g,_payload:M,_init:N},Q1={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=Q1,x._debugInfo=[{awaited:Q1}],x},iQ.memo=function(M,x){M==null&&console.error("memo: The first argument must be a component. Instead received: %s",M===null?"null":typeof M),x={$$typeof:a,type:M,compare:x===void 0?null:x};var Q1;return Object.defineProperty(x,"displayName",{enumerable:!1,configurable:!0,get:function(){return Q1},set:function(U1){Q1=U1,M.name||M.displayName||(Object.defineProperty(M,"name",{value:U1}),M.displayName=U1)}}),x},iQ.startTransition=function(M){var x=$1.T,Q1={};Q1._updatedFibers=new Set,$1.T=Q1;try{var U1=M(),H1=$1.S;H1!==null&&H1(Q1,U1),typeof U1==="object"&&U1!==null&&typeof U1.then==="function"&&($1.asyncTransitions++,U1.then(D,D),U1.then(Z,X0))}catch(W1){X0(W1)}finally{x===null&&Q1._updatedFibers&&(M=Q1._updatedFibers.size,Q1._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.")),x!==null&&Q1.types!==null&&(x.types!==null&&x.types!==Q1.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."),x.types=Q1.types),$1.T=x}},iQ.unstable_useCacheRefresh=function(){return y().useCacheRefresh()},iQ.use=function(M){return y().use(M)},iQ.useActionState=function(M,x,Q1){return y().useActionState(M,x,Q1)},iQ.useCallback=function(M,x){return y().useCallback(M,x)},iQ.useContext=function(M){var x=y();return M.$$typeof===m&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),x.useContext(M)},iQ.useDebugValue=function(M,x){return y().useDebugValue(M,x)},iQ.useDeferredValue=function(M,x){return y().useDeferredValue(M,x)},iQ.useEffect=function(M,x){return M==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),y().useEffect(M,x)},iQ.useEffectEvent=function(M){return y().useEffectEvent(M)},iQ.useId=function(){return y().useId()},iQ.useImperativeHandle=function(M,x,Q1){return y().useImperativeHandle(M,x,Q1)},iQ.useInsertionEffect=function(M,x){return M==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),y().useInsertionEffect(M,x)},iQ.useLayoutEffect=function(M,x){return M==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),y().useLayoutEffect(M,x)},iQ.useMemo=function(M,x){return y().useMemo(M,x)},iQ.useOptimistic=function(M,x){return y().useOptimistic(M,x)},iQ.useReducer=function(M,x,Q1){return y().useReducer(M,x,Q1)},iQ.useRef=function(M){return y().useRef(M)},iQ.useState=function(M){return y().useState(M)},iQ.useSyncExternalStore=function(M,x,Q1){return y().useSyncExternalStore(M,x,Q1)},iQ.useTransition=function(){return y().useTransition()},iQ.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var X8=a0((dQ)=>{var s0=g1(L0());(function(){function _(I){if(I==null)return null;if(typeof I==="function")return I.$$typeof===y?null:I.displayName||I.name||null;if(typeof I==="string")return I;switch(I){case O:return"Fragment";case B:return"Profiler";case R:return"StrictMode";case f:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof I==="object")switch(typeof I.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),I.$$typeof){case W:return"Portal";case A:return I.displayName||"Context";case P:return(I._context.displayName||"Context")+".Consumer";case T:var v=I.render;return I=I.displayName,I||(I=v.displayName||v.name||"",I=I!==""?"ForwardRef("+I+")":"ForwardRef"),I;case w:return v=I.displayName||null,v!==null?v:_(I.type)||"Memo";case S:v=I._payload,I=I._init;try{return _(I(v))}catch(m){}}return null}function Q(I){return""+I}function J(I){try{Q(I);var v=!1}catch(n){v=!0}if(v){v=console;var m=v.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object";return m.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(I)}}function q(I){if(I===O)return"<>";if(typeof I==="object"&&I!==null&&I.$$typeof===S)return"<...>";try{var v=_(I);return v?"<"+v+">":"<...>"}catch(m){return"<...>"}}function U(){var I=D.A;return I===null?null:I.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(I){if(l.call(I,"key")){var v=Object.getOwnPropertyDescriptor(I,"key").get;if(v&&v.isReactWarning)return!1}return I.key!==void 0}function F(I,v){function m(){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)",v))}m.isReactWarning=!0,Object.defineProperty(I,"key",{get:m,configurable:!0})}function X(){var I=_(this.type);return j[I]||(j[I]=!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.")),I=this.props.ref,I!==void 0?I:null}function Y(I,v,m,u,n,e){var t=m.ref;return I={$$typeof:z,type:I,key:v,props:m,_owner:u},(t!==void 0?t:null)!==null?Object.defineProperty(I,"ref",{enumerable:!1,get:X}):Object.defineProperty(I,"ref",{enumerable:!1,value:null}),I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(I,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(I,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:n}),Object.defineProperty(I,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:e}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I}function K(I,v,m,u,n,e){var t=v.children;if(t!==void 0)if(u)if(p(t)){for(u=0;u<t.length;u++)H(t[u]);Object.freeze&&Object.freeze(t)}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 H(t);if(l.call(v,"key")){t=_(I);var a=Object.keys(v).filter(function(J1){return J1!=="key"});u=0<a.length?"{key: someKey, "+a.join(": ..., ")+": ...}":"{key: someKey}",h[t+u]||(a=0<a.length?"{"+a.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.`),z}function x(){K1.asyncTransitions--}function r(z){if(H0===null)try{var y=("require"+Math.random()).slice(0,7);H0=(m5&&m5[y]).call(m5,"timers").setImmediate}catch(l){H0=function(_1){r0===!1&&(r0=!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 n=new MessageChannel;n.port1.onmessage=_1,n.port2.postMessage(void 0)}}return H0(z)}function m(z){return 1<z.length&&typeof AggregateError==="function"?AggregateError(z):z[0]}function v(z,y){y!==k0-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. "),k0=y}function h(z,y,l){var _1=K1.actQueue;if(_1!==null)if(_1.length!==0)try{V(_1),r(function(){return h(z,y,l)});return}catch(n){K1.thrownErrors.push(n)}else K1.actQueue=null;0<K1.thrownErrors.length?(_1=m(K1.thrownErrors),K1.thrownErrors.length=0,l(_1)):y(z)}function V(z){if(!q2){q2=!0;var y=0;try{for(;y<z.length;y++){var l=z[y];do{K1.didUsePromise=!1;var _1=l(!1);if(_1!==null){if(K1.didUsePromise){z[y]=l,z.splice(0,y);return}l=_1}else break}while(1)}z.length=0}catch(n){z.splice(0,y+1),K1.thrownErrors.push(n)}finally{q2=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var E=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),b=Symbol.for("react.context"),e=Symbol.for("react.forward_ref"),t=Symbol.for("react.suspense"),o=Symbol.for("react.suspense_list"),s=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),J1=Symbol.for("react.activity"),U1=Symbol.iterator,X1={},G1={isMounted:function(){return!1},enqueueForceUpdate:function(z){J(z,"forceUpdate")},enqueueReplaceState:function(z){J(z,"replaceState")},enqueueSetState:function(z){J(z,"setState")}},F1=Object.assign,B1={};Object.freeze(B1),q.prototype.isReactComponent={},q.prototype.setState=function(z,y){if(typeof z!=="object"&&typeof z!=="function"&&z!=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,z,y,"setState")},q.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};var Y1={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(c in Y1)Y1.hasOwnProperty(c)&&_(c,Y1[c]);U.prototype=q.prototype,Y1=G.prototype=new U,Y1.constructor=G,F1(Y1,q.prototype),Y1.isPureReactComponent=!0;var Q1=Array.isArray,T1=Symbol.for("react.client.reference"),K1={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,p1=console.createTask?console.createTask:function(){return null};Y1={react_stack_bottom_frame:function(z){return z()}};var l1,z0,Z0={},F0=Y1.react_stack_bottom_frame.bind(Y1,L)(),o1=p1(K(L)),Q0=!1,n1=/\/+/g,J0=typeof reportError==="function"?reportError:function(z){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z==="object"&&z!==null&&typeof z.message==="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(y))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",z);return}console.error(z)},r0=!1,H0=null,k0=0,y0=!1,q2=!1,k2=typeof queueMicrotask==="function"?function(z){queueMicrotask(function(){return queueMicrotask(z)})}:r;Y1=Object.freeze({__proto__:null,c:function(z){return j().useMemoCache(z)}});var c={map:S,forEach:function(z,y,l){S(z,function(){y.apply(this,arguments)},l)},count:function(z){var y=0;return S(z,function(){y++}),y},toArray:function(z){return S(z,function(y){return y})||[]},only:function(z){if(!A(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};oQ.Activity=J1,oQ.Children=c,oQ.Component=q,oQ.Fragment=D,oQ.Profiler=k,oQ.PureComponent=G,oQ.StrictMode=I,oQ.Suspense=t,oQ.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K1,oQ.__COMPILER_RUNTIME=Y1,oQ.act=function(z){var y=K1.actQueue,l=k0;k0++;var _1=K1.actQueue=y!==null?y:[],n=!1;try{var $1=z()}catch(L1){K1.thrownErrors.push(L1)}if(0<K1.thrownErrors.length)throw v(y,l),z=m(K1.thrownErrors),K1.thrownErrors.length=0,z;if($1!==null&&typeof $1==="object"&&typeof $1.then==="function"){var q1=$1;return k2(function(){n||y0||(y0=!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(L1,M1){n=!0,q1.then(function(E1){if(v(y,l),l===0){try{V(_1),r(function(){return h(E1,L1,M1)})}catch(_5){K1.thrownErrors.push(_5)}if(0<K1.thrownErrors.length){var u1=m(K1.thrownErrors);K1.thrownErrors.length=0,M1(u1)}}else L1(E1)},function(E1){v(y,l),0<K1.thrownErrors.length?(E1=m(K1.thrownErrors),K1.thrownErrors.length=0,M1(E1)):M1(E1)})}}}var H1=$1;if(v(y,l),l===0&&(V(_1),_1.length!==0&&k2(function(){n||y0||(y0=!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(() => ...)"))}),K1.actQueue=null),0<K1.thrownErrors.length)throw z=m(K1.thrownErrors),K1.thrownErrors.length=0,z;return{then:function(L1,M1){n=!0,l===0?(K1.actQueue=_1,r(function(){return h(H1,L1,M1)})):L1(H1)}}},oQ.cache=function(z){return function(){return z.apply(null,arguments)}},oQ.cacheSignal=function(){return null},oQ.captureOwnerStack=function(){var z=K1.getCurrentStack;return z===null?null:z()},oQ.cloneElement=function(z,y,l){if(z===null||z===void 0)throw Error("The argument must be a React element, but you passed "+z+".");var _1=F1({},z.props),n=z.key,$1=z._owner;if(y!=null){var q1;_:{if(y1.call(y,"ref")&&(q1=Object.getOwnPropertyDescriptor(y,"ref").get)&&q1.isReactWarning){q1=!1;break _}q1=y.ref!==void 0}q1&&($1=H()),W(y)&&(X(y.key),n=""+y.key);for(H1 in y)!y1.call(y,H1)||H1==="key"||H1==="__self"||H1==="__source"||H1==="ref"&&y.ref===void 0||(_1[H1]=y[H1])}var H1=arguments.length-2;if(H1===1)_1.children=l;else if(1<H1){q1=Array(H1);for(var L1=0;L1<H1;L1++)q1[L1]=arguments[L1+2];_1.children=q1}_1=T(z.type,n,_1,$1,z._debugStack,z._debugTask);for(n=2;n<arguments.length;n++)P(arguments[n]);return _1},oQ.createContext=function(z){return z={$$typeof:b,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:p,_context:z},z._currentRenderer=null,z._currentRenderer2=null,z},oQ.createElement=function(z,y,l){for(var _1=2;_1<arguments.length;_1++)P(arguments[_1]);_1={};var n=null;if(y!=null)for(L1 in z0||!("__self"in y)||"key"in y||(z0=!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")),W(y)&&(X(y.key),n=""+y.key),y)y1.call(y,L1)&&L1!=="key"&&L1!=="__self"&&L1!=="__source"&&(_1[L1]=y[L1]);var $1=arguments.length-2;if($1===1)_1.children=l;else if(1<$1){for(var q1=Array($1),H1=0;H1<$1;H1++)q1[H1]=arguments[H1+2];Object.freeze&&Object.freeze(q1),_1.children=q1}if(z&&z.defaultProps)for(L1 in $1=z.defaultProps,$1)_1[L1]===void 0&&(_1[L1]=$1[L1]);n&&B(_1,typeof z==="function"?z.displayName||z.name||"Unknown":z);var L1=1e4>K1.recentlyCreatedOwnerStacks++;return T(z,n,_1,H(),L1?Error("react-stack-top-frame"):F0,L1?p1(K(z)):o1)},oQ.createRef=function(){var z={current:null};return Object.seal(z),z},oQ.forwardRef=function(z){z!=null&&z.$$typeof===s?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof z!=="function"?console.error("forwardRef requires a render function but was given %s.",z===null?"null":typeof z):z.length!==0&&z.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",z.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),z!=null&&z.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var y={$$typeof:e,render:z},l;return Object.defineProperty(y,"displayName",{enumerable:!1,configurable:!0,get:function(){return l},set:function(_1){l=_1,z.name||z.displayName||(Object.defineProperty(z,"name",{value:_1}),z.displayName=_1)}}),y},oQ.isValidElement=A,oQ.lazy=function(z){z={_status:-1,_result:z};var y={$$typeof:g,_payload:z,_init:w},l={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return z._ioInfo=l,y._debugInfo=[{awaited:l}],y},oQ.memo=function(z,y){z==null&&console.error("memo: The first argument must be a component. Instead received: %s",z===null?"null":typeof z),y={$$typeof:s,type:z,compare:y===void 0?null:y};var l;return Object.defineProperty(y,"displayName",{enumerable:!1,configurable:!0,get:function(){return l},set:function(_1){l=_1,z.name||z.displayName||(Object.defineProperty(z,"name",{value:_1}),z.displayName=_1)}}),y},oQ.startTransition=function(z){var y=K1.T,l={};l._updatedFibers=new Set,K1.T=l;try{var _1=z(),n=K1.S;n!==null&&n(l,_1),typeof _1==="object"&&_1!==null&&typeof _1.then==="function"&&(K1.asyncTransitions++,_1.then(x,x),_1.then(Z,J0))}catch($1){J0($1)}finally{y===null&&l._updatedFibers&&(z=l._updatedFibers.size,l._updatedFibers.clear(),10<z&&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.")),y!==null&&l.types!==null&&(y.types!==null&&y.types!==l.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."),y.types=l.types),K1.T=y}},oQ.unstable_useCacheRefresh=function(){return j().useCacheRefresh()},oQ.use=function(z){return j().use(z)},oQ.useActionState=function(z,y,l){return j().useActionState(z,y,l)},oQ.useCallback=function(z,y){return j().useCallback(z,y)},oQ.useContext=function(z){var y=j();return z.$$typeof===p&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),y.useContext(z)},oQ.useDebugValue=function(z,y){return j().useDebugValue(z,y)},oQ.useDeferredValue=function(z,y){return j().useDeferredValue(z,y)},oQ.useEffect=function(z,y){return z==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),j().useEffect(z,y)},oQ.useEffectEvent=function(z){return j().useEffectEvent(z)},oQ.useId=function(){return j().useId()},oQ.useImperativeHandle=function(z,y,l){return j().useImperativeHandle(z,y,l)},oQ.useInsertionEffect=function(z,y){return z==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),j().useInsertionEffect(z,y)},oQ.useLayoutEffect=function(z,y){return z==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),j().useLayoutEffect(z,y)},oQ.useMemo=function(z,y){return j().useMemo(z,y)},oQ.useOptimistic=function(z,y){return j().useOptimistic(z,y)},oQ.useReducer=function(z,y,l){return j().useReducer(z,y,l)},oQ.useRef=function(z){return j().useRef(z)},oQ.useState=function(z){return j().useState(z)},oQ.useSyncExternalStore=function(z,y,l){return j().useSyncExternalStore(z,y,l)},oQ.useTransition=function(){return j().useTransition()},oQ.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var z8=U2((nQ)=>{var G2=r1(O0());(function(){function _(I){if(I==null)return null;if(typeof I==="function")return I.$$typeof===j?null:I.displayName||I.name||null;if(typeof I==="string")return I;switch(I){case O:return"Fragment";case M:return"Profiler";case T:return"StrictMode";case f:return"Suspense";case C:return"SuspenseList";case w:return"Activity"}if(typeof I==="object")switch(typeof I.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),I.$$typeof){case B:return"Portal";case A:return I.displayName||"Context";case P:return(I._context.displayName||"Context")+".Consumer";case R:var k=I.render;return I=I.displayName,I||(I=k.displayName||k.name||"",I=I!==""?"ForwardRef("+I+")":"ForwardRef"),I;case N:return k=I.displayName||null,k!==null?k:_(I.type)||"Memo";case S:k=I._payload,I=I._init;try{return _(I(k))}catch(p){}}return null}function Q(I){return""+I}function J(I){try{Q(I);var k=!1}catch(e){k=!0}if(k){k=console;var p=k.error,b=typeof Symbol==="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object";return p.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),Q(I)}}function q(I){if(I===O)return"<>";if(typeof I==="object"&&I!==null&&I.$$typeof===S)return"<...>";try{var k=_(I);return k?"<"+k+">":"<...>"}catch(p){return"<...>"}}function U(){var I=x.A;return I===null?null:I.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(I){if(r.call(I,"key")){var k=Object.getOwnPropertyDescriptor(I,"key").get;if(k&&k.isReactWarning)return!1}return I.key!==void 0}function F(I,k){function p(){h||(h=!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)",k))}p.isReactWarning=!0,Object.defineProperty(I,"key",{get:p,configurable:!0})}function X(){var I=_(this.type);return V[I]||(V[I]=!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.")),I=this.props.ref,I!==void 0?I:null}function Y(I,k,p,b,e,t){var o=p.ref;return I={$$typeof:W,type:I,key:k,props:p,_owner:b},(o!==void 0?o:null)!==null?Object.defineProperty(I,"ref",{enumerable:!1,get:X}):Object.defineProperty(I,"ref",{enumerable:!1,value:null}),I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(I,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(I,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:e}),Object.defineProperty(I,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I}function K(I,k,p,b,e,t){var o=k.children;if(o!==void 0)if(b)if(m(o)){for(b=0;b<o.length;b++)H(o[b]);Object.freeze&&Object.freeze(o)}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 H(o);if(r.call(k,"key")){o=_(I);var s=Object.keys(k).filter(function(J1){return J1!=="key"});b=0<s.length?"{key: someKey, "+s.join(": ..., ")+": ...}":"{key: someKey}",D[o+b]||(s=0<s.length?"{"+s.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,t,a,t),h[t+u]=!0)}if(t=null,m!==void 0&&(J(m),t=""+m),Z(v)&&(J(v.key),t=""+v.key),"key"in v){m={};for(var g in v)g!=="key"&&(m[g]=v[g])}else m=v;return t&&F(m,typeof I==="function"?I.displayName||I.name||"Unknown":I),Y(I,t,m,U(),n,e)}function H(I){L(I)?I._store&&(I._store.validated=1):typeof I==="object"&&I!==null&&I.$$typeof===S&&(I._payload.status==="fulfilled"?L(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function L(I){return typeof I==="object"&&I!==null&&I.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),A=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),y=Symbol.for("react.client.reference"),D=s0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,l=Object.prototype.hasOwnProperty,p=Array.isArray,k=console.createTask?console.createTask:function(){return null};s0={react_stack_bottom_frame:function(I){return I()}};var b,j={},E=s0.react_stack_bottom_frame.bind(s0,G)(),V=k(q(G)),h={};dQ.Fragment=O,dQ.jsx=function(I,v,m){var u=1e4>D.recentlyCreatedOwnerStacks++;return K(I,v,m,!1,u?Error("react-stack-top-frame"):E,u?k(q(I)):V)},dQ.jsxs=function(I,v,m){var u=1e4>D.recentlyCreatedOwnerStacks++;return K(I,v,m,!0,u?Error("react-stack-top-frame"):E,u?k(q(I)):V)}})()});var p7=a0((pq)=>{var o1=g1(L0());(function(){function _(L,z){return L===z&&(L!==0||1/L===1/z)||L!==L&&z!==z}function Q(L,z){Y||o1.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(!K){var O=z();U(W,O)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),K=!0)}O=G({inst:{value:W,getSnapshot:z}});var R=O[0].inst,B=O[1];return F(function(){R.value=W,R.getSnapshot=z,J(R)&&B({inst:R})},[L,W,z]),Z(function(){return J(R)&&B({inst:R}),L(function(){J(R)&&B({inst:R})})},[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=o1.useState,Z=o1.useEffect,F=o1.useLayoutEffect,X=o1.useDebugValue,Y=!1,K=!1,H=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?q:Q;pq.useSyncExternalStore=o1.useSyncExternalStore!==void 0?o1.useSyncExternalStore:H,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var c7=a0((cq)=>{var N0=g1(L0());(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=p7(),J=typeof Object.is==="function"?Object.is:_,q=Q.useSyncExternalStore,U=N0.useRef,G=N0.useEffect,Z=N0.useMemo,F=N0.useDebugValue;cq.useSyncExternalStoreWithSelector=function(X,Y,K,H,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 R(f){if(!B){if(B=!0,P=f,f=H(f),L!==void 0&&W.hasValue){var C=W.value;if(L(C,f))return A=C}return A=f}if(C=A,J(P,f))return C;var w=H(f);if(L!==void 0&&L(C,w))return P=f,C;return P=f,A=w}var B=!1,P,A,T=K===void 0?null:K;return[function(){return R(Y())},T===null?void 0:function(){return R(T())}]},[Y,K,H,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 t7=a0((dq)=>{var V6=g1(L0());(function(){function _(){}function Q(K){return""+K}function J(K,H,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:K,containerInfo:H,implementation:L}}function q(K,H){if(K==="font")return"";if(typeof H==="string")return H==="use-credentials"?H:""}function U(K){return K===null?"`null`":K===void 0?"`undefined`":K===""?"an empty string":'something with type "'+typeof K+'"'}function G(K){return K===null?"`null`":K===void 0?"`undefined`":K===""?"an empty string":typeof K==="string"?JSON.stringify(K):typeof K==="number"?"`"+K+"`":'something with type "'+typeof K+'"'}function Z(){var K=Y.H;return K===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} />`,b,o,s,o),D[o+b]=!0)}if(o=null,p!==void 0&&(J(p),o=""+p),Z(k)&&(J(k.key),o=""+k.key),"key"in k){p={};for(var g in k)g!=="key"&&(p[g]=k[g])}else p=k;return o&&F(p,typeof I==="function"?I.displayName||I.name||"Unknown":I),Y(I,o,p,U(),e,t)}function H(I){L(I)?I._store&&(I._store.validated=1):typeof I==="object"&&I!==null&&I.$$typeof===S&&(I._payload.status==="fulfilled"?L(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function L(I){return typeof I==="object"&&I!==null&&I.$$typeof===W}var W=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),j=Symbol.for("react.client.reference"),x=G2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,r=Object.prototype.hasOwnProperty,m=Array.isArray,v=console.createTask?console.createTask:function(){return null};G2={react_stack_bottom_frame:function(I){return I()}};var h,V={},E=G2.react_stack_bottom_frame.bind(G2,G)(),u=v(q(G)),D={};nQ.Fragment=O,nQ.jsx=function(I,k,p){var b=1e4>x.recentlyCreatedOwnerStacks++;return K(I,k,p,!1,b?Error("react-stack-top-frame"):E,b?v(q(I)):u)},nQ.jsxs=function(I,k,p){var b=1e4>x.recentlyCreatedOwnerStacks++;return K(I,k,p,!0,b?Error("react-stack-top-frame"):E,b?v(q(I)):u)}})()});var d7=U2((dq)=>{var q0=r1(O0());(function(){function _(L,W){return L===W&&(L!==0||1/L===1/W)||L!==L&&W!==W}function Q(L,W){Y||q0.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 B=W();if(!K){var O=W();U(B,O)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),K=!0)}O=G({inst:{value:B,getSnapshot:W}});var T=O[0].inst,M=O[1];return F(function(){T.value=B,T.getSnapshot=W,J(T)&&M({inst:T})},[L,B,W]),Z(function(){return J(T)&&M({inst:T}),L(function(){J(T)&&M({inst:T})})},[L]),X(B),B}function J(L){var W=L.getSnapshot;L=L.value;try{var B=W();return!U(L,B)}catch(O){return!0}}function q(L,W){return W()}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=q0.useState,Z=q0.useEffect,F=q0.useLayoutEffect,X=q0.useDebugValue,Y=!1,K=!1,H=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?q:Q;dq.useSyncExternalStore=q0.useSyncExternalStore!==void 0?q0.useSyncExternalStore:H,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var a7=U2((aq)=>{var x0=r1(O0());(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=d7(),J=typeof Object.is==="function"?Object.is:_,q=Q.useSyncExternalStore,U=x0.useRef,G=x0.useEffect,Z=x0.useMemo,F=x0.useDebugValue;aq.useSyncExternalStoreWithSelector=function(X,Y,K,H,L){var W=U(null);if(W.current===null){var B={hasValue:!1,value:null};W.current=B}else B=W.current;W=Z(function(){function T(f){if(!M){if(M=!0,P=f,f=H(f),L!==void 0&&B.hasValue){var C=B.value;if(L(C,f))return A=C}return A=f}if(C=A,J(P,f))return C;var N=H(f);if(L!==void 0&&L(C,N))return P=f,C;return P=f,A=N}var M=!1,P,A,R=K===void 0?null:K;return[function(){return T(Y())},R===null?void 0:function(){return T(R())}]},[Y,K,H,L]);var O=q(X,W[0],W[1]);return G(function(){B.hasValue=!0,B.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 Q9=U2((nq)=>{var D6=r1(O0());(function(){function _(){}function Q(K){return""+K}function J(K,H,L){var W=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{Q(W);var B=!1}catch(O){B=!0}return B&&(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&&W[Symbol.toStringTag]||W.constructor.name||"Object"),Q(W)),{$$typeof:X,key:W==null?null:""+W,children:K,containerInfo:H,implementation:L}}function q(K,H){if(K==="font")return"";if(typeof H==="string")return H==="use-credentials"?H:""}function U(K){return K===null?"`null`":K===void 0?"`undefined`":K===""?"an empty string":'something with type "'+typeof K+'"'}function G(K){return K===null?"`null`":K===void 0?"`undefined`":K===""?"an empty string":typeof K==="string"?JSON.stringify(K):typeof K==="number"?"`"+K+"`":'something with type "'+typeof K+'"'}function Z(){var K=Y.H;return K===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.`),K}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=V6.__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"),dq.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,dq.createPortal=function(K,H){var L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!H||H.nodeType!==1&&H.nodeType!==9&&H.nodeType!==11)throw Error("Target container is not a DOM element.");return J(K,H,null,L)},dq.flushSync=function(K){var H=Y.T,L=F.p;try{if(Y.T=null,F.p=2,K)return K()}finally{Y.T=H,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.")}},dq.preconnect=function(K,H){typeof K==="string"&&K?H!=null&&typeof H!=="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(H)):H!=null&&typeof H.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(H.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K)),typeof K==="string"&&(H?(H=H.crossOrigin,H=typeof H==="string"?H==="use-credentials"?H:"":void 0):H=null,F.d.C(K,H))},dq.prefetchDNS=function(K){if(typeof K!=="string"||!K)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K));else if(1<arguments.length){var H=arguments[1];typeof H==="object"&&H.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(H)):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(H))}typeof K==="string"&&F.d.D(K)},dq.preinit=function(K,H){if(typeof K==="string"&&K?H==null||typeof H!=="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(H)):H.as!=="style"&&H.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(H.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K)),typeof K==="string"&&H&&typeof H.as==="string"){var L=H.as,z=q(L,H.crossOrigin),W=typeof H.integrity==="string"?H.integrity:void 0,O=typeof H.fetchPriority==="string"?H.fetchPriority:void 0;L==="style"?F.d.S(K,typeof H.precedence==="string"?H.precedence:void 0,{crossOrigin:z,integrity:W,fetchPriority:O}):L==="script"&&F.d.X(K,{crossOrigin:z,integrity:W,fetchPriority:O,nonce:typeof H.nonce==="string"?H.nonce:void 0})}},dq.preinitModule=function(K,H){var L="";if(typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H!==void 0&&typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":H&&("as"in H)&&H.as!=="script"&&(L+=" The `as` option encountered was "+G(H.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=H&&typeof H.as==="string"?H.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,K)}if(typeof K==="string")if(typeof H==="object"&&H!==null){if(H.as==null||H.as==="script")L=q(H.as,H.crossOrigin),F.d.M(K,{crossOrigin:L,integrity:typeof H.integrity==="string"?H.integrity:void 0,nonce:typeof H.nonce==="string"?H.nonce:void 0})}else H==null&&F.d.M(K)},dq.preload=function(K,H){var L="";if(typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H==null||typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":typeof H.as==="string"&&H.as||(L+=" The `as` option encountered was "+U(H.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 K==="string"&&typeof H==="object"&&H!==null&&typeof H.as==="string"){L=H.as;var z=q(L,H.crossOrigin);F.d.L(K,L,{crossOrigin:z,integrity:typeof H.integrity==="string"?H.integrity:void 0,nonce:typeof H.nonce==="string"?H.nonce:void 0,type:typeof H.type==="string"?H.type:void 0,fetchPriority:typeof H.fetchPriority==="string"?H.fetchPriority:void 0,referrerPolicy:typeof H.referrerPolicy==="string"?H.referrerPolicy:void 0,imageSrcSet:typeof H.imageSrcSet==="string"?H.imageSrcSet:void 0,imageSizes:typeof H.imageSizes==="string"?H.imageSizes:void 0,media:typeof H.media==="string"?H.media:void 0})}},dq.preloadModule=function(K,H){var L="";typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H!==void 0&&typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":H&&("as"in H)&&typeof H.as!=="string"&&(L+=" The `as` option encountered was "+U(H.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 K==="string"&&(H?(L=q(H.as,H.crossOrigin),F.d.m(K,{as:typeof H.as==="string"&&H.as!=="script"?H.as:void 0,crossOrigin:L,integrity:typeof H.integrity==="string"?H.integrity:void 0})):F.d.m(K))},dq.requestFormReset=function(K){F.d.r(K)},dq.unstable_batchedUpdates=function(K,H){return K(H)},dq.useFormState=function(K,H,L){return Z().useFormState(K,H,L)},dq.useFormStatus=function(){return Z().useHostTransitionStatus()},dq.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var n7=a0((BB,o7)=>{var aq=g1(t7());o7.exports=aq});var P5=a0((WZ)=>{var Y2=g1(L0());(function(){function _(I){if(I==null)return null;if(typeof I==="function")return I.$$typeof===y?null:I.displayName||I.name||null;if(typeof I==="string")return I;switch(I){case O:return"Fragment";case B:return"Profiler";case R:return"StrictMode";case f:return"Suspense";case C:return"SuspenseList";case N:return"Activity"}if(typeof I==="object")switch(typeof I.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),I.$$typeof){case W:return"Portal";case A:return I.displayName||"Context";case P:return(I._context.displayName||"Context")+".Consumer";case T:var v=I.render;return I=I.displayName,I||(I=v.displayName||v.name||"",I=I!==""?"ForwardRef("+I+")":"ForwardRef"),I;case w:return v=I.displayName||null,v!==null?v:_(I.type)||"Memo";case S:v=I._payload,I=I._init;try{return _(I(v))}catch(m){}}return null}function Q(I){return""+I}function J(I){try{Q(I);var v=!1}catch(n){v=!0}if(v){v=console;var m=v.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object";return m.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),Q(I)}}function q(I){if(I===O)return"<>";if(typeof I==="object"&&I!==null&&I.$$typeof===S)return"<...>";try{var v=_(I);return v?"<"+v+">":"<...>"}catch(m){return"<...>"}}function U(){var I=D.A;return I===null?null:I.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(I){if(l.call(I,"key")){var v=Object.getOwnPropertyDescriptor(I,"key").get;if(v&&v.isReactWarning)return!1}return I.key!==void 0}function F(I,v){function m(){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)",v))}m.isReactWarning=!0,Object.defineProperty(I,"key",{get:m,configurable:!0})}function X(){var I=_(this.type);return j[I]||(j[I]=!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.")),I=this.props.ref,I!==void 0?I:null}function Y(I,v,m,u,n,e){var t=m.ref;return I={$$typeof:z,type:I,key:v,props:m,_owner:u},(t!==void 0?t:null)!==null?Object.defineProperty(I,"ref",{enumerable:!1,get:X}):Object.defineProperty(I,"ref",{enumerable:!1,value:null}),I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(I,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(I,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:n}),Object.defineProperty(I,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:e}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I}function K(I,v,m,u,n,e){var t=v.children;if(t!==void 0)if(u)if(p(t)){for(u=0;u<t.length;u++)H(t[u]);Object.freeze&&Object.freeze(t)}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 H(t);if(l.call(v,"key")){t=_(I);var a=Object.keys(v).filter(function(J1){return J1!=="key"});u=0<a.length?"{key: someKey, "+a.join(": ..., ")+": ...}":"{key: someKey}",h[t+u]||(a=0<a.length?"{"+a.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.`),K}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=D6.__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"),nq.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,nq.createPortal=function(K,H){var L=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!H||H.nodeType!==1&&H.nodeType!==9&&H.nodeType!==11)throw Error("Target container is not a DOM element.");return J(K,H,null,L)},nq.flushSync=function(K){var H=Y.T,L=F.p;try{if(Y.T=null,F.p=2,K)return K()}finally{Y.T=H,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.")}},nq.preconnect=function(K,H){typeof K==="string"&&K?H!=null&&typeof H!=="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(H)):H!=null&&typeof H.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(H.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K)),typeof K==="string"&&(H?(H=H.crossOrigin,H=typeof H==="string"?H==="use-credentials"?H:"":void 0):H=null,F.d.C(K,H))},nq.prefetchDNS=function(K){if(typeof K!=="string"||!K)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K));else if(1<arguments.length){var H=arguments[1];typeof H==="object"&&H.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(H)):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(H))}typeof K==="string"&&F.d.D(K)},nq.preinit=function(K,H){if(typeof K==="string"&&K?H==null||typeof H!=="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(H)):H.as!=="style"&&H.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(H.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",U(K)),typeof K==="string"&&H&&typeof H.as==="string"){var L=H.as,W=q(L,H.crossOrigin),B=typeof H.integrity==="string"?H.integrity:void 0,O=typeof H.fetchPriority==="string"?H.fetchPriority:void 0;L==="style"?F.d.S(K,typeof H.precedence==="string"?H.precedence:void 0,{crossOrigin:W,integrity:B,fetchPriority:O}):L==="script"&&F.d.X(K,{crossOrigin:W,integrity:B,fetchPriority:O,nonce:typeof H.nonce==="string"?H.nonce:void 0})}},nq.preinitModule=function(K,H){var L="";if(typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H!==void 0&&typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":H&&("as"in H)&&H.as!=="script"&&(L+=" The `as` option encountered was "+G(H.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=H&&typeof H.as==="string"?H.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,K)}if(typeof K==="string")if(typeof H==="object"&&H!==null){if(H.as==null||H.as==="script")L=q(H.as,H.crossOrigin),F.d.M(K,{crossOrigin:L,integrity:typeof H.integrity==="string"?H.integrity:void 0,nonce:typeof H.nonce==="string"?H.nonce:void 0})}else H==null&&F.d.M(K)},nq.preload=function(K,H){var L="";if(typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H==null||typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":typeof H.as==="string"&&H.as||(L+=" The `as` option encountered was "+U(H.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 K==="string"&&typeof H==="object"&&H!==null&&typeof H.as==="string"){L=H.as;var W=q(L,H.crossOrigin);F.d.L(K,L,{crossOrigin:W,integrity:typeof H.integrity==="string"?H.integrity:void 0,nonce:typeof H.nonce==="string"?H.nonce:void 0,type:typeof H.type==="string"?H.type:void 0,fetchPriority:typeof H.fetchPriority==="string"?H.fetchPriority:void 0,referrerPolicy:typeof H.referrerPolicy==="string"?H.referrerPolicy:void 0,imageSrcSet:typeof H.imageSrcSet==="string"?H.imageSrcSet:void 0,imageSizes:typeof H.imageSizes==="string"?H.imageSizes:void 0,media:typeof H.media==="string"?H.media:void 0})}},nq.preloadModule=function(K,H){var L="";typeof K==="string"&&K||(L+=" The `href` argument encountered was "+U(K)+"."),H!==void 0&&typeof H!=="object"?L+=" The `options` argument encountered was "+U(H)+".":H&&("as"in H)&&typeof H.as!=="string"&&(L+=" The `as` option encountered was "+U(H.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 K==="string"&&(H?(L=q(H.as,H.crossOrigin),F.d.m(K,{as:typeof H.as==="string"&&H.as!=="script"?H.as:void 0,crossOrigin:L,integrity:typeof H.integrity==="string"?H.integrity:void 0})):F.d.m(K))},nq.requestFormReset=function(K){F.d.r(K)},nq.unstable_batchedUpdates=function(K,H){return K(H)},nq.useFormState=function(K,H,L){return Z().useFormState(K,H,L)},nq.useFormStatus=function(){return Z().useHostTransitionStatus()},nq.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var $9=U2((fA,J9)=>{var eq=r1(Q9());J9.exports=eq});var u5=U2((RZ)=>{var I2=r1(O0());(function(){function _(I){if(I==null)return null;if(typeof I==="function")return I.$$typeof===j?null:I.displayName||I.name||null;if(typeof I==="string")return I;switch(I){case O:return"Fragment";case M:return"Profiler";case T:return"StrictMode";case f:return"Suspense";case C:return"SuspenseList";case w:return"Activity"}if(typeof I==="object")switch(typeof I.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),I.$$typeof){case B:return"Portal";case A:return I.displayName||"Context";case P:return(I._context.displayName||"Context")+".Consumer";case R:var k=I.render;return I=I.displayName,I||(I=k.displayName||k.name||"",I=I!==""?"ForwardRef("+I+")":"ForwardRef"),I;case N:return k=I.displayName||null,k!==null?k:_(I.type)||"Memo";case S:k=I._payload,I=I._init;try{return _(I(k))}catch(p){}}return null}function Q(I){return""+I}function J(I){try{Q(I);var k=!1}catch(e){k=!0}if(k){k=console;var p=k.error,b=typeof Symbol==="function"&&Symbol.toStringTag&&I[Symbol.toStringTag]||I.constructor.name||"Object";return p.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),Q(I)}}function q(I){if(I===O)return"<>";if(typeof I==="object"&&I!==null&&I.$$typeof===S)return"<...>";try{var k=_(I);return k?"<"+k+">":"<...>"}catch(p){return"<...>"}}function U(){var I=x.A;return I===null?null:I.getOwner()}function G(){return Error("react-stack-top-frame")}function Z(I){if(r.call(I,"key")){var k=Object.getOwnPropertyDescriptor(I,"key").get;if(k&&k.isReactWarning)return!1}return I.key!==void 0}function F(I,k){function p(){h||(h=!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)",k))}p.isReactWarning=!0,Object.defineProperty(I,"key",{get:p,configurable:!0})}function X(){var I=_(this.type);return V[I]||(V[I]=!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.")),I=this.props.ref,I!==void 0?I:null}function Y(I,k,p,b,e,t){var o=p.ref;return I={$$typeof:W,type:I,key:k,props:p,_owner:b},(o!==void 0?o:null)!==null?Object.defineProperty(I,"ref",{enumerable:!1,get:X}):Object.defineProperty(I,"ref",{enumerable:!1,value:null}),I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(I,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(I,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:e}),Object.defineProperty(I,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I}function K(I,k,p,b,e,t){var o=k.children;if(o!==void 0)if(b)if(m(o)){for(b=0;b<o.length;b++)H(o[b]);Object.freeze&&Object.freeze(o)}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 H(o);if(r.call(k,"key")){o=_(I);var s=Object.keys(k).filter(function(J1){return J1!=="key"});b=0<s.length?"{key: someKey, "+s.join(": ..., ")+": ...}":"{key: someKey}",D[o+b]||(s=0<s.length?"{"+s.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,t,a,t),h[t+u]=!0)}if(t=null,m!==void 0&&(J(m),t=""+m),Z(v)&&(J(v.key),t=""+v.key),"key"in v){m={};for(var g in v)g!=="key"&&(m[g]=v[g])}else m=v;return t&&F(m,typeof I==="function"?I.displayName||I.name||"Unknown":I),Y(I,t,m,U(),n,e)}function H(I){L(I)?I._store&&(I._store.validated=1):typeof I==="object"&&I!==null&&I.$$typeof===S&&(I._payload.status==="fulfilled"?L(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function L(I){return typeof I==="object"&&I!==null&&I.$$typeof===z}var z=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),A=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),y=Symbol.for("react.client.reference"),D=Y2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,l=Object.prototype.hasOwnProperty,p=Array.isArray,k=console.createTask?console.createTask:function(){return null};Y2={react_stack_bottom_frame:function(I){return I()}};var b,j={},E=Y2.react_stack_bottom_frame.bind(Y2,G)(),V=k(q(G)),h={};WZ.Fragment=O,WZ.jsxDEV=function(I,v,m,u){var n=1e4>D.recentlyCreatedOwnerStacks++;return K(I,v,m,u,n?Error("react-stack-top-frame"):E,n?k(q(I)):V)}})()});var r=g1(L0(),1);var i=g1(X8(),1),d=g1(L0(),1);function v1(_){if(typeof _==="string"||typeof _==="number")return""+_;let Q="";if(Array.isArray(_)){for(let J=0,q;J<_.length;J++)if((q=v1(_[J]))!=="")Q+=(Q&&" ")+q}else for(let J in _)if(_[J])Q+=(Q&&" ")+J;return Q}var aQ={value:()=>{}};function L8(){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 b5(J)}function b5(_){this._=_}function sQ(_,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}})}b5.prototype=L8.prototype={constructor:b5,on:function(_,Q){var J=this._,q=sQ(_+"",J),U,G=-1,Z=q.length;if(arguments.length<2){while(++G<Z)if((U=(_=q[G]).type)&&(U=tQ(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]=Y8(J[U],_.name,Q);else if(Q==null)for(U in J)J[U]=Y8(J[U],_.name,null);return this},copy:function(){var _={},Q=this._;for(var J in Q)_[J]=Q[J].slice();return new b5(_)},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 tQ(_,Q){for(var J=0,q=_.length,U;J<q;++J)if((U=_[J]).name===Q)return U.value}function Y8(_,Q,J){for(var q=0,U=_.length;q<U;++q)if(_[q].name===Q){_[q]=aQ,_=_.slice(0,q).concat(_.slice(q+1));break}if(J!=null)_.push({name:Q,value:J});return _}var t0=L8;function I2(_){return function(){return this.matches(_)}}function D5(_){return function(Q){return Q.matches(_)}}var h5="http://www.w3.org/1999/xhtml",h4={svg:"http://www.w3.org/2000/svg",xhtml:h5,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function z0(_){var Q=_+="",J=Q.indexOf(":");if(J>=0&&(Q=_.slice(0,J))!=="xmlns")_=_.slice(J+1);return h4.hasOwnProperty(Q)?{space:h4[Q],local:_}:_}function E4(_){let Q;while(Q=_.sourceEvent)_=Q;return _}function c1(_,Q){if(_=E4(_),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 oQ(){}function V0(_){return _==null?oQ:function(){return this.querySelector(_)}}function x4(_){if(typeof _!=="function")_=V0(_);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,K=0;K<Z;++K)if((X=G[K])&&(Y=_.call(X,X.__data__,K,G))){if("__data__"in X)Y.__data__=X.__data__;F[K]=Y}return new y1(q,this._parents)}function m4(_){return _==null?[]:Array.isArray(_)?_:Array.from(_)}function nQ(){return[]}function f2(_){return _==null?nQ:function(){return this.querySelectorAll(_)}}function eQ(_){return function(){return m4(_.apply(this,arguments))}}function g4(_){if(typeof _==="function")_=eQ(_);else _=f2(_);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 y1(q,U)}var _J=Array.prototype.find;function QJ(_){return function(){return _J.call(this.children,_)}}function JJ(){return this.firstElementChild}function p4(_){return this.select(_==null?JJ:QJ(typeof _==="function"?_:D5(_)))}var $J=Array.prototype.filter;function qJ(){return Array.from(this.children)}function UJ(_){return function(){return $J.call(this.children,_)}}function c4(_){return this.selectAll(_==null?qJ:UJ(typeof _==="function"?_:D5(_)))}function l4(_){if(typeof _!=="function")_=I2(_);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 y1(q,this._parents)}function i2(_){return Array(_.length)}function r4(){return new y1(this._enter||this._groups.map(i2),this._parents)}function d2(_,Q){this.ownerDocument=_.ownerDocument,this.namespaceURI=_.namespaceURI,this._next=null,this._parent=_,this.__data__=Q}d2.prototype={constructor:d2,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 i4(_){return function(){return _}}function GJ(_,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 d2(_,G[Z]);for(;Z<X;++Z)if(F=Q[Z])U[Z]=F}function ZJ(_,Q,J,q,U,G,Z){var F,X,Y=new Map,K=Q.length,H=G.length,L=Array(K),z;for(F=0;F<K;++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<H;++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 d2(_,G[F]);for(F=0;F<K;++F)if((X=Q[F])&&Y.get(L[F])===X)U[F]=X}function FJ(_){return _.__data__}function d4(_,Q){if(!arguments.length)return Array.from(this,FJ);var J=Q?ZJ:GJ,q=this._parents,U=this._groups;if(typeof _!=="function")_=i4(_);for(var G=U.length,Z=Array(G),F=Array(G),X=Array(G),Y=0;Y<G;++Y){var K=q[Y],H=U[Y],L=H.length,z=HJ(_.call(K,K&&K.__data__,Y,q)),W=z.length,O=F[Y]=Array(W),R=Z[Y]=Array(W),B=X[Y]=Array(L);J(K,H,O,R,B,z,Q);for(var P=0,A=0,T,f;P<W;++P)if(T=O[P]){if(P>=A)A=P+1;while(!(f=R[A])&&++A<W);T._next=f||null}}return Z=new y1(Z,q),Z._enter=F,Z._exit=X,Z}function HJ(_){return typeof _==="object"&&"length"in _?_:Array.from(_)}function a4(){return new y1(this._exit||this._groups.map(i2),this._parents)}function s4(_,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 t4(_){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],K=q[X],H=Y.length,L=F[X]=Array(H),z,W=0;W<H;++W)if(z=Y[W]||K[W])L[W]=z;for(;X<U;++X)F[X]=J[X];return new y1(F,this._parents)}function o4(){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 n4(_){if(!_)_=KJ;function Q(H,L){return H&&L?_(H.__data__,L.__data__):!H-!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,K=0;K<F;++K)if(Y=Z[K])X[K]=Y;X.sort(Q)}return new y1(U,this._parents).order()}function KJ(_,Q){return _<Q?-1:_>Q?1:_>=Q?0:NaN}function e4(){var _=arguments[0];return arguments[0]=this,_.apply(null,arguments),this}function _3(){return Array.from(this)}function Q3(){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 J3(){let _=0;for(let Q of this)++_;return _}function $3(){return!this.node()}function q3(_){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 XJ(_){return function(){this.removeAttribute(_)}}function YJ(_){return function(){this.removeAttributeNS(_.space,_.local)}}function LJ(_,Q){return function(){this.setAttribute(_,Q)}}function zJ(_,Q){return function(){this.setAttributeNS(_.space,_.local,Q)}}function WJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttribute(_);else this.setAttribute(_,J)}}function AJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttributeNS(_.space,_.local);else this.setAttributeNS(_.space,_.local,J)}}function U3(_,Q){var J=z0(_);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?YJ:XJ:typeof Q==="function"?J.local?AJ:WJ:J.local?zJ:LJ)(J,Q))}function a2(_){return _.ownerDocument&&_.ownerDocument.defaultView||_.document&&_||_.defaultView}function BJ(_){return function(){this.style.removeProperty(_)}}function MJ(_,Q,J){return function(){this.style.setProperty(_,Q,J)}}function TJ(_,Q,J){return function(){var q=Q.apply(this,arguments);if(q==null)this.style.removeProperty(_);else this.style.setProperty(_,q,J)}}function G3(_,Q,J){return arguments.length>1?this.each((Q==null?BJ:typeof Q==="function"?TJ:MJ)(_,Q,J==null?"":J)):u0(this.node(),_)}function u0(_,Q){return _.style.getPropertyValue(Q)||a2(_).getComputedStyle(_,null).getPropertyValue(Q)}function RJ(_){return function(){delete this[_]}}function OJ(_,Q){return function(){this[_]=Q}}function IJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)delete this[_];else this[_]=J}}function Z3(_,Q){return arguments.length>1?this.each((Q==null?RJ:typeof Q==="function"?IJ:OJ)(_,Q)):this.node()[_]}function z8(_){return _.trim().split(/^|\s+/)}function F3(_){return _.classList||new W8(_)}function W8(_){this._node=_,this._names=z8(_.getAttribute("class")||"")}W8.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 A8(_,Q){var J=F3(_),q=-1,U=Q.length;while(++q<U)J.add(Q[q])}function B8(_,Q){var J=F3(_),q=-1,U=Q.length;while(++q<U)J.remove(Q[q])}function fJ(_){return function(){A8(this,_)}}function wJ(_){return function(){B8(this,_)}}function PJ(_,Q){return function(){(Q.apply(this,arguments)?A8:B8)(this,_)}}function H3(_,Q){var J=z8(_+"");if(arguments.length<2){var q=F3(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"?PJ:Q?fJ:wJ)(J,Q))}function NJ(){this.textContent=""}function CJ(_){return function(){this.textContent=_}}function SJ(_){return function(){var Q=_.apply(this,arguments);this.textContent=Q==null?"":Q}}function K3(_){return arguments.length?this.each(_==null?NJ:(typeof _==="function"?SJ:CJ)(_)):this.node().textContent}function kJ(){this.innerHTML=""}function vJ(_){return function(){this.innerHTML=_}}function yJ(_){return function(){var Q=_.apply(this,arguments);this.innerHTML=Q==null?"":Q}}function X3(_){return arguments.length?this.each(_==null?kJ:(typeof _==="function"?yJ:vJ)(_)):this.node().innerHTML}function jJ(){if(this.nextSibling)this.parentNode.appendChild(this)}function Y3(){return this.each(jJ)}function VJ(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function L3(){return this.each(VJ)}function uJ(_){return function(){var Q=this.ownerDocument,J=this.namespaceURI;return J===h5&&Q.documentElement.namespaceURI===h5?Q.createElement(_):Q.createElementNS(J,_)}}function bJ(_){return function(){return this.ownerDocument.createElementNS(_.space,_.local)}}function s2(_){var Q=z0(_);return(Q.local?bJ:uJ)(Q)}function z3(_){var Q=typeof _==="function"?_:s2(_);return this.select(function(){return this.appendChild(Q.apply(this,arguments))})}function DJ(){return null}function W3(_,Q){var J=typeof _==="function"?_:s2(_),q=Q==null?DJ:typeof Q==="function"?Q:V0(Q);return this.select(function(){return this.insertBefore(J.apply(this,arguments),q.apply(this,arguments)||null)})}function hJ(){var _=this.parentNode;if(_)_.removeChild(this)}function A3(){return this.each(hJ)}function EJ(){var _=this.cloneNode(!1),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function xJ(){var _=this.cloneNode(!0),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function B3(_){return this.select(_?xJ:EJ)}function M3(_){return arguments.length?this.property("__data__",_):this.node().__data__}function mJ(_){return function(Q){_.call(this,Q,this.__data__)}}function gJ(_){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 pJ(_){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 cJ(_,Q,J){return function(){var q=this.__on,U,G=mJ(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 T3(_,Q,J){var q=gJ(_+""),U,G=q.length,Z;if(arguments.length<2){var F=this.node().__on;if(F){for(var X=0,Y=F.length,K;X<Y;++X)for(U=0,K=F[X];U<G;++U)if((Z=q[U]).type===K.type&&Z.name===K.name)return K.value}return}F=Q?cJ:pJ;for(U=0;U<G;++U)this.each(F(q[U],Q,J));return this}function M8(_,Q,J){var q=a2(_),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 lJ(_,Q){return function(){return M8(this,_,Q)}}function rJ(_,Q){return function(){return M8(this,_,Q.apply(this,arguments))}}function R3(_,Q){return this.each((typeof Q==="function"?rJ:lJ)(_,Q))}function*O3(){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 I3=[null];function y1(_,Q){this._groups=_,this._parents=Q}function T8(){return new y1([[document.documentElement]],I3)}function iJ(){return this}y1.prototype=T8.prototype={constructor:y1,select:x4,selectAll:g4,selectChild:p4,selectChildren:c4,filter:l4,data:d4,enter:r4,exit:a4,join:s4,merge:t4,selection:iJ,order:o4,sort:n4,call:e4,nodes:_3,node:Q3,size:J3,empty:$3,each:q3,attr:U3,style:G3,property:Z3,classed:H3,text:K3,html:X3,raise:Y3,lower:L3,append:z3,insert:W3,remove:A3,clone:B3,datum:M3,on:T3,dispatch:R3,[Symbol.iterator]:O3};var O0=T8;function D1(_){return typeof _==="string"?new y1([[document.querySelector(_)]],[document.documentElement]):new y1([[_]],I3)}var R8={passive:!1},o0={capture:!0,passive:!1};function E5(_){_.stopImmediatePropagation()}function I0(_){_.preventDefault(),_.stopImmediatePropagation()}function w2(_){var Q=_.document.documentElement,J=D1(_).on("dragstart.drag",I0,o0);if("onselectstart"in Q)J.on("selectstart.drag",I0,o0);else Q.__noselect=Q.style.MozUserSelect,Q.style.MozUserSelect="none"}function t2(_,Q){var J=_.document.documentElement,q=D1(_).on("dragstart.drag",null);if(Q)q.on("click.drag",I0,o0),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 o2=(_)=>()=>_;function n2(_,{sourceEvent:Q,subject:J,target:q,identifier:U,active:G,x:Z,y:F,dx:X,dy:Y,dispatch:K}){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:K}})}n2.prototype.on=function(){var _=this._.on.apply(this._,arguments);return _===this._?this:_};function dJ(_){return!_.ctrlKey&&!_.button}function aJ(){return this.parentNode}function sJ(_,Q){return Q==null?{x:_.x,y:_.y}:Q}function tJ(){return navigator.maxTouchPoints||"ontouchstart"in this}function e2(){var _=dJ,Q=aJ,J=sJ,q=tJ,U={},G=t0("start","drag","end"),Z=0,F,X,Y,K,H=0;function L(T){T.on("mousedown.drag",z).filter(q).on("touchstart.drag",R).on("touchmove.drag",B,R8).on("touchend.drag touchcancel.drag",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function z(T,f){if(K||!_.call(this,T,f))return;var C=A(this,Q.call(this,T,f),T,f,"mouse");if(!C)return;D1(T.view).on("mousemove.drag",W,o0).on("mouseup.drag",O,o0),w2(T.view),E5(T),Y=!1,F=T.clientX,X=T.clientY,C("start",T)}function W(T){if(I0(T),!Y){var f=T.clientX-F,C=T.clientY-X;Y=f*f+C*C>H}U.mouse("drag",T)}function O(T){D1(T.view).on("mousemove.drag mouseup.drag",null),t2(T.view,Y),I0(T),U.mouse("end",T)}function R(T,f){if(!_.call(this,T,f))return;var C=T.changedTouches,w=Q.call(this,T,f),S=C.length,N,y;for(N=0;N<S;++N)if(y=A(this,w,T,f,C[N].identifier,C[N]))E5(T),y("start",T,C[N])}function B(T){var f=T.changedTouches,C=f.length,w,S;for(w=0;w<C;++w)if(S=U[f[w].identifier])I0(T),S("drag",T,f[w])}function P(T){var f=T.changedTouches,C=f.length,w,S;if(K)clearTimeout(K);K=setTimeout(function(){K=null},500);for(w=0;w<C;++w)if(S=U[f[w].identifier])E5(T),S("end",T,f[w])}function A(T,f,C,w,S,N){var y=G.copy(),D=c1(N||C,f),l,p,k;if((k=J.call(T,new n2("beforestart",{sourceEvent:C,target:L,identifier:S,active:Z,x:D[0],y:D[1],dx:0,dy:0,dispatch:y}),w))==null)return;return l=k.x-D[0]||0,p=k.y-D[1]||0,function b(j,E,V){var h=D,I;switch(j){case"start":U[S]=b,I=Z++;break;case"end":delete U[S],--Z;case"drag":D=c1(V||E,f),I=Z;break}y.call(j,T,new n2(j,{sourceEvent:E,subject:k,target:L,identifier:S,active:I,x:D[0]+l,y:D[1]+p,dx:D[0]-h[0],dy:D[1]-h[1],dispatch:y}),w)}}return L.filter=function(T){return arguments.length?(_=typeof T==="function"?T:o2(!!T),L):_},L.container=function(T){return arguments.length?(Q=typeof T==="function"?T:o2(T),L):Q},L.subject=function(T){return arguments.length?(J=typeof T==="function"?T:o2(T),L):J},L.touchable=function(T){return arguments.length?(q=typeof T==="function"?T:o2(!!T),L):q},L.on=function(){var T=G.on.apply(G,arguments);return T===G?L:T},L.clickDistance=function(T){return arguments.length?(H=(T=+T)*T,L):Math.sqrt(H)},L}function _5(_,Q,J){_.prototype=Q.prototype=J,J.constructor=_}function f3(_,Q){var J=Object.create(_.prototype);for(var q in Q)J[q]=Q[q];return J}function $5(){}var Q5=0.7,g5=1/Q5,P2="\\s*([+-]?\\d+)\\s*",J5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",W0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oJ=/^#([0-9a-f]{3,8})$/,nJ=new RegExp(`^rgb\\(${P2},${P2},${P2}\\)$`),eJ=new RegExp(`^rgb\\(${W0},${W0},${W0}\\)$`),_$=new RegExp(`^rgba\\(${P2},${P2},${P2},${J5}\\)$`),Q$=new RegExp(`^rgba\\(${W0},${W0},${W0},${J5}\\)$`),J$=new RegExp(`^hsl\\(${J5},${W0},${W0}\\)$`),$$=new RegExp(`^hsla\\(${J5},${W0},${W0},${J5}\\)$`),O8={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};_5($5,Z0,{copy(_){return Object.assign(new this.constructor,this,_)},displayable(){return this.rgb().displayable()},hex:I8,formatHex:I8,formatHex8:q$,formatHsl:U$,formatRgb:f8,toString:f8});function I8(){return this.rgb().formatHex()}function q$(){return this.rgb().formatHex8()}function U$(){return k8(this).formatHsl()}function f8(){return this.rgb().formatRgb()}function Z0(_){var Q,J;return _=(_+"").trim().toLowerCase(),(Q=oJ.exec(_))?(J=Q[1].length,Q=parseInt(Q[1],16),J===6?w8(Q):J===3?new s1(Q>>8&15|Q>>4&240,Q>>4&15|Q&240,(Q&15)<<4|Q&15,1):J===8?x5(Q>>24&255,Q>>16&255,Q>>8&255,(Q&255)/255):J===4?x5(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=nJ.exec(_))?new s1(Q[1],Q[2],Q[3],1):(Q=eJ.exec(_))?new s1(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,1):(Q=_$.exec(_))?x5(Q[1],Q[2],Q[3],Q[4]):(Q=Q$.exec(_))?x5(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,Q[4]):(Q=J$.exec(_))?C8(Q[1],Q[2]/100,Q[3]/100,1):(Q=$$.exec(_))?C8(Q[1],Q[2]/100,Q[3]/100,Q[4]):O8.hasOwnProperty(_)?w8(O8[_]):_==="transparent"?new s1(NaN,NaN,NaN,0):null}function w8(_){return new s1(_>>16&255,_>>8&255,_&255,1)}function x5(_,Q,J,q){if(q<=0)_=Q=J=NaN;return new s1(_,Q,J,q)}function G$(_){if(!(_ instanceof $5))_=Z0(_);if(!_)return new s1;return _=_.rgb(),new s1(_.r,_.g,_.b,_.opacity)}function N2(_,Q,J,q){return arguments.length===1?G$(_):new s1(_,Q,J,q==null?1:q)}function s1(_,Q,J,q){this.r=+_,this.g=+Q,this.b=+J,this.opacity=+q}_5(s1,N2,f3($5,{brighter(_){return _=_==null?g5:Math.pow(g5,_),new s1(this.r*_,this.g*_,this.b*_,this.opacity)},darker(_){return _=_==null?Q5:Math.pow(Q5,_),new s1(this.r*_,this.g*_,this.b*_,this.opacity)},rgb(){return this},clamp(){return new s1(e0(this.r),e0(this.g),e0(this.b),p5(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:P8,formatHex:P8,formatHex8:Z$,formatRgb:N8,toString:N8}));function P8(){return`#${n0(this.r)}${n0(this.g)}${n0(this.b)}`}function Z$(){return`#${n0(this.r)}${n0(this.g)}${n0(this.b)}${n0((isNaN(this.opacity)?1:this.opacity)*255)}`}function N8(){let _=p5(this.opacity);return`${_===1?"rgb(":"rgba("}${e0(this.r)}, ${e0(this.g)}, ${e0(this.b)}${_===1?")":`, ${_})`}`}function p5(_){return isNaN(_)?1:Math.max(0,Math.min(1,_))}function e0(_){return Math.max(0,Math.min(255,Math.round(_)||0))}function n0(_){return _=e0(_),(_<16?"0":"")+_.toString(16)}function C8(_,Q,J,q){if(q<=0)_=Q=J=NaN;else if(J<=0||J>=1)_=Q=NaN;else if(Q<=0)_=NaN;return new G0(_,Q,J,q)}function k8(_){if(_ instanceof G0)return new G0(_.h,_.s,_.l,_.opacity);if(!(_ instanceof $5))_=Z0(_);if(!_)return new G0;if(_ instanceof G0)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 G0(Z,F,X,_.opacity)}function v8(_,Q,J,q){return arguments.length===1?k8(_):new G0(_,Q,J,q==null?1:q)}function G0(_,Q,J,q){this.h=+_,this.s=+Q,this.l=+J,this.opacity=+q}_5(G0,v8,f3($5,{brighter(_){return _=_==null?g5:Math.pow(g5,_),new G0(this.h,this.s,this.l*_,this.opacity)},darker(_){return _=_==null?Q5:Math.pow(Q5,_),new G0(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 s1(w3(_>=240?_-240:_+120,U,q),w3(_,U,q),w3(_<120?_+240:_-120,U,q),this.opacity)},clamp(){return new G0(S8(this.h),m5(this.s),m5(this.l),p5(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 _=p5(this.opacity);return`${_===1?"hsl(":"hsla("}${S8(this.h)}, ${m5(this.s)*100}%, ${m5(this.l)*100}%${_===1?")":`, ${_})`}`}}));function S8(_){return _=(_||0)%360,_<0?_+360:_}function m5(_){return Math.max(0,Math.min(1,_||0))}function w3(_,Q,J){return(_<60?Q+(J-Q)*_/60:_<180?J:_<240?Q+(J-Q)*(240-_)/60:Q)*255}function P3(_,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 N3(_){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 P3((J-q/Q)*Q,Z,U,G,F)}}function C3(_){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 P3((J-q/Q)*Q,U,G,Z,F)}}var q5=(_)=>()=>_;function F$(_,Q){return function(J){return _+J*Q}}function H$(_,Q,J){return _=Math.pow(_,J),Q=Math.pow(Q,J)-_,J=1/J,function(q){return Math.pow(_+q*Q,J)}}function y8(_){return(_=+_)===1?c5:function(Q,J){return J-Q?H$(Q,J,_):q5(isNaN(Q)?J:Q)}}function c5(_,Q){var J=Q-_;return J?F$(_,J):q5(isNaN(_)?Q:_)}var _2=function _(Q){var J=y8(Q);function q(U,G){var Z=J((U=N2(U)).r,(G=N2(G)).r),F=J(U.g,G.g),X=J(U.b,G.b),Y=c5(U.opacity,G.opacity);return function(K){return U.r=Z(K),U.g=F(K),U.b=X(K),U.opacity=Y(K),U+""}}return q.gamma=_,q}(1);function j8(_){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=N2(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 K$=j8(N3),X$=j8(C3);function S3(_,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 V8(_){return ArrayBuffer.isView(_)&&!(_ instanceof DataView)}function u8(_,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]=A0(_[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 k3(_,Q){var J=new Date;return _=+_,Q=+Q,function(q){return J.setTime(_*(1-q)+Q*q),J}}function l1(_,Q){return _=+_,Q=+Q,function(J){return _*(1-J)+Q*J}}function v3(_,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]=A0(_[U],Q[U]);else q[U]=Q[U];return function(G){for(U in J)q[U]=J[U](G);return q}}var j3=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,y3=new RegExp(j3.source,"g");function Y$(_){return function(){return _}}function L$(_){return function(Q){return _(Q)+""}}function C2(_,Q){var J=j3.lastIndex=y3.lastIndex=0,q,U,G,Z=-1,F=[],X=[];_=_+"",Q=Q+"";while((q=j3.exec(_))&&(U=y3.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:l1(q,U)});J=y3.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]?L$(X[0].x):Y$(Q):(Q=X.length,function(Y){for(var K=0,H;K<Q;++K)F[(H=X[K]).i]=H.x(Y);return F.join("")})}function A0(_,Q){var J=typeof Q,q;return Q==null||J==="boolean"?q5(Q):(J==="number"?l1:J==="string"?(q=Z0(Q))?(Q=q,_2):C2:Q instanceof Z0?_2:Q instanceof Date?k3:V8(Q)?S3:Array.isArray(Q)?u8:typeof Q.valueOf!=="function"&&typeof Q.toString!=="function"||isNaN(Q)?v3:l1)(_,Q)}var b8=180/Math.PI,l5={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function r5(_,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,_)*b8,skewX:Math.atan(X)*b8,scaleX:Z,scaleY:F}}var i5;function D8(_){let Q=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(_+"");return Q.isIdentity?l5:r5(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)}function h8(_){if(_==null)return l5;if(!i5)i5=document.createElementNS("http://www.w3.org/2000/svg","g");if(i5.setAttribute("transform",_),!(_=i5.transform.baseVal.consolidate()))return l5;return _=_.matrix,r5(_.a,_.b,_.c,_.d,_.e,_.f)}function E8(_,Q,J,q){function U(Y){return Y.length?Y.pop()+" ":""}function G(Y,K,H,L,z,W){if(Y!==H||K!==L){var O=z.push("translate(",null,Q,null,J);W.push({i:O-4,x:l1(Y,H)},{i:O-2,x:l1(K,L)})}else if(H||L)z.push("translate("+H+Q+L+J)}function Z(Y,K,H,L){if(Y!==K){if(Y-K>180)K+=360;else if(K-Y>180)Y+=360;L.push({i:H.push(U(H)+"rotate(",null,q)-2,x:l1(Y,K)})}else if(K)H.push(U(H)+"rotate("+K+q)}function F(Y,K,H,L){if(Y!==K)L.push({i:H.push(U(H)+"skewX(",null,q)-2,x:l1(Y,K)});else if(K)H.push(U(H)+"skewX("+K+q)}function X(Y,K,H,L,z,W){if(Y!==H||K!==L){var O=z.push(U(z)+"scale(",null,",",null,")");W.push({i:O-4,x:l1(Y,H)},{i:O-2,x:l1(K,L)})}else if(H!==1||L!==1)z.push(U(z)+"scale("+H+","+L+")")}return function(Y,K){var H=[],L=[];return Y=_(Y),K=_(K),G(Y.translateX,Y.translateY,K.translateX,K.translateY,H,L),Z(Y.rotate,K.rotate,H,L),F(Y.skewX,K.skewX,H,L),X(Y.scaleX,Y.scaleY,K.scaleX,K.scaleY,H,L),Y=K=null,function(z){var W=-1,O=L.length,R;while(++W<O)H[(R=L[W]).i]=R.x(z);return H.join("")}}}var V3=E8(D8,"px, ","px)","deg)"),u3=E8(h8,", ",")",")");var z$=0.000000000001;function x8(_){return((_=Math.exp(_))+1/_)/2}function W$(_){return((_=Math.exp(_))-1/_)/2}function A$(_){return((_=Math.exp(2*_))-1)/(_+1)}var Q2=function _(Q,J,q){function U(G,Z){var F=G[0],X=G[1],Y=G[2],K=Z[0],H=Z[1],L=Z[2],z=K-F,W=H-X,O=z*z+W*W,R,B;if(O<z$)B=Math.log(L/Y)/Q,R=function(w){return[F+w*z,X+w*W,Y*Math.exp(Q*w*B)]};else{var P=Math.sqrt(O),A=(L*L-Y*Y+q*O)/(2*Y*J*P),T=(L*L-Y*Y-q*O)/(2*L*J*P),f=Math.log(Math.sqrt(A*A+1)-A),C=Math.log(Math.sqrt(T*T+1)-T);B=(C-f)/Q,R=function(w){var S=w*B,N=x8(f),y=Y/(J*P)*(N*A$(Q*S+f)-W$(f));return[F+y*z,X+y*W,Y*N/x8(Q*S+f)]}}return R.duration=B*1000*Q/Math.SQRT2,R}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 S2=0,G5=0,U5=0,g8=1000,d5,Z5,a5=0,J2=0,s5=0,F5=typeof performance==="object"&&performance.now?performance:Date,p8=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(_){setTimeout(_,17)};function K5(){return J2||(p8(B$),J2=F5.now()+s5)}function B$(){J2=0}function H5(){this._call=this._time=this._next=null}H5.prototype=t5.prototype={constructor:H5,restart:function(_,Q,J){if(typeof _!=="function")throw TypeError("callback is not a function");if(J=(J==null?K5():+J)+(Q==null?0:+Q),!this._next&&Z5!==this){if(Z5)Z5._next=this;else d5=this;Z5=this}this._call=_,this._time=J,b3()},stop:function(){if(this._call)this._call=null,this._time=1/0,b3()}};function t5(_,Q,J){var q=new H5;return q.restart(_,Q,J),q}function c8(){K5(),++S2;var _=d5,Q;while(_){if((Q=J2-_._time)>=0)_._call.call(void 0,Q);_=_._next}--S2}function m8(){J2=(a5=F5.now())+s5,S2=G5=0;try{c8()}finally{S2=0,T$(),J2=0}}function M$(){var _=F5.now(),Q=_-a5;if(Q>g8)s5-=Q,a5=_}function T$(){var _,Q=d5,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:d5=J;Z5=_,b3(q)}function b3(_){if(S2)return;if(G5)G5=clearTimeout(G5);var Q=_-J2;if(Q>24){if(_<1/0)G5=setTimeout(m8,_-F5.now()-s5);if(U5)U5=clearInterval(U5)}else{if(!U5)a5=F5.now(),U5=setInterval(M$,g8);S2=1,p8(m8)}}function X5(_,Q,J){var q=new H5;return Q=Q==null?0:+Q,q.restart((U)=>{q.stop(),_(U+Q)},Q,J),q}var R$=t0("start","end","cancel","interrupt"),O$=[],i8=0,l8=1,n5=2,o5=3,r8=4,e5=5,Y5=6;function f0(_,Q,J,q,U,G){var Z=_.__transition;if(!Z)_.__transition={};else if(J in Z)return;I$(_,J,{name:Q,index:q,group:U,on:R$,tween:O$,time:G.time,delay:G.delay,duration:G.duration,ease:G.ease,timer:null,state:i8})}function L5(_,Q){var J=h1(_,Q);if(J.state>i8)throw Error("too late; already scheduled");return J}function p1(_,Q){var J=h1(_,Q);if(J.state>o5)throw Error("too late; already running");return J}function h1(_,Q){var J=_.__transition;if(!J||!(J=J[Q]))throw Error("transition not found");return J}function I$(_,Q,J){var q=_.__transition,U;q[Q]=J,J.timer=t5(G,0,J.time);function G(Y){if(J.state=l8,J.timer.restart(Z,J.delay,J.time),J.delay<=Y)Z(Y-J.delay)}function Z(Y){var K,H,L,z;if(J.state!==l8)return X();for(K in q){if(z=q[K],z.name!==J.name)continue;if(z.state===o5)return X5(Z);if(z.state===r8)z.state=Y5,z.timer.stop(),z.on.call("interrupt",_,_.__data__,z.index,z.group),delete q[K];else if(+K<Q)z.state=Y5,z.timer.stop(),z.on.call("cancel",_,_.__data__,z.index,z.group),delete q[K]}if(X5(function(){if(J.state===o5)J.state=r8,J.timer.restart(F,J.delay,J.time),F(Y)}),J.state=n5,J.on.call("start",_,_.__data__,J.index,J.group),J.state!==n5)return;J.state=o5,U=Array(L=J.tween.length);for(K=0,H=-1;K<L;++K)if(z=J.tween[K].value.call(_,_.__data__,J.index,J.group))U[++H]=z;U.length=H+1}function F(Y){var K=Y<J.duration?J.ease.call(null,Y/J.duration):(J.timer.restart(X),J.state=e5,1),H=-1,L=U.length;while(++H<L)U[H].call(_,K);if(J.state===e5)J.on.call("end",_,_.__data__,J.index,J.group),X()}function X(){J.state=Y5,J.timer.stop(),delete q[Q];for(var Y in q)return;delete _.__transition}}function b0(_,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>n5&&q.state<e5,q.state=Y5,q.timer.stop(),q.on.call(U?"interrupt":"cancel",_,_.__data__,q.index,q.group),delete J[Z]}if(G)delete _.__transition}function D3(_){return this.each(function(){b0(this,_)})}function f$(_,Q){var J,q;return function(){var U=p1(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 w$(_,Q,J){var q,U;if(typeof J!=="function")throw Error();return function(){var G=p1(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 h3(_,Q){var J=this._id;if(_+="",arguments.length<2){var q=h1(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?f$:w$)(J,_,Q))}function k2(_,Q,J){var q=_._id;return _.each(function(){var U=p1(this,q);(U.value||(U.value={}))[Q]=J.apply(this,arguments)}),function(U){return h1(U,q).value[Q]}}function z5(_,Q){var J;return(typeof Q==="number"?l1:Q instanceof Z0?_2:(J=Z0(Q))?(Q=J,_2):C2)(_,Q)}function P$(_){return function(){this.removeAttribute(_)}}function N$(_){return function(){this.removeAttributeNS(_.space,_.local)}}function C$(_,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 S$(_,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 k$(_,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 v$(_,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 E3(_,Q){var J=z0(_),q=J==="transform"?u3:z5;return this.attrTween(_,typeof Q==="function"?(J.local?v$:k$)(J,q,k2(this,"attr."+_,Q)):Q==null?(J.local?N$:P$)(J):(J.local?S$:C$)(J,q,Q))}function y$(_,Q){return function(J){this.setAttribute(_,Q.call(this,J))}}function j$(_,Q){return function(J){this.setAttributeNS(_.space,_.local,Q.call(this,J))}}function V$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&j$(_,G);return J}return U._value=Q,U}function u$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&y$(_,G);return J}return U._value=Q,U}function x3(_,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=z0(_);return this.tween(J,(q.local?V$:u$)(q,Q))}function b$(_,Q){return function(){L5(this,_).delay=+Q.apply(this,arguments)}}function D$(_,Q){return Q=+Q,function(){L5(this,_).delay=Q}}function m3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?b$:D$)(Q,_)):h1(this.node(),Q).delay}function h$(_,Q){return function(){p1(this,_).duration=+Q.apply(this,arguments)}}function E$(_,Q){return Q=+Q,function(){p1(this,_).duration=Q}}function g3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?h$:E$)(Q,_)):h1(this.node(),Q).duration}function x$(_,Q){if(typeof Q!=="function")throw Error();return function(){p1(this,_).ease=Q}}function p3(_){var Q=this._id;return arguments.length?this.each(x$(Q,_)):h1(this.node(),Q).ease}function m$(_,Q){return function(){var J=Q.apply(this,arguments);if(typeof J!=="function")throw Error();p1(this,_).ease=J}}function c3(_){if(typeof _!=="function")throw Error();return this.each(m$(this._id,_))}function l3(_){if(typeof _!=="function")_=I2(_);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 d1(q,this._parents,this._name,this._id)}function r3(_){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],K=X.length,H=Z[F]=Array(K),L,z=0;z<K;++z)if(L=X[z]||Y[z])H[z]=L;for(;F<q;++F)Z[F]=Q[F];return new d1(Z,this._parents,this._name,this._id)}function g$(_){return(_+"").trim().split(/^|\s+/).every(function(Q){var J=Q.indexOf(".");if(J>=0)Q=Q.slice(0,J);return!Q||Q==="start"})}function p$(_,Q,J){var q,U,G=g$(Q)?L5:p1;return function(){var Z=G(this,_),F=Z.on;if(F!==q)(U=(q=F).copy()).on(Q,J);Z.on=U}}function i3(_,Q){var J=this._id;return arguments.length<2?h1(this.node(),J).on.on(_):this.each(p$(J,_,Q))}function c$(_){return function(){var Q=this.parentNode;for(var J in this.__transition)if(+J!==_)return;if(Q)Q.removeChild(this)}}function d3(){return this.on("end.remove",c$(this._id))}function a3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=V0(_);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),K,H,L=0;L<X;++L)if((K=F[L])&&(H=_.call(K,K.__data__,L,F))){if("__data__"in K)H.__data__=K.__data__;Y[L]=H,f0(Y[L],Q,J,L,Y,h1(K,J))}return new d1(G,this._parents,Q,J)}function s3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=f2(_);for(var q=this._groups,U=q.length,G=[],Z=[],F=0;F<U;++F)for(var X=q[F],Y=X.length,K,H=0;H<Y;++H)if(K=X[H]){for(var L=_.call(K,K.__data__,H,X),z,W=h1(K,J),O=0,R=L.length;O<R;++O)if(z=L[O])f0(z,Q,J,O,L,W);G.push(L),Z.push(K)}return new d1(G,Z,Q,J)}var l$=O0.prototype.constructor;function t3(){return new l$(this._groups,this._parents)}function r$(_,Q){var J,q,U;return function(){var G=u0(this,_),Z=(this.style.removeProperty(_),u0(this,_));return G===Z?null:G===J&&Z===q?U:U=Q(J=G,q=Z)}}function d8(_){return function(){this.style.removeProperty(_)}}function i$(_,Q,J){var q,U=J+"",G;return function(){var Z=u0(this,_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function d$(_,Q,J){var q,U,G;return function(){var Z=u0(this,_),F=J(this),X=F+"";if(F==null)X=F=(this.style.removeProperty(_),u0(this,_));return Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function a$(_,Q){var J,q,U,G="style."+Q,Z="end."+G,F;return function(){var X=p1(this,_),Y=X.on,K=X.value[G]==null?F||(F=d8(Q)):void 0;if(Y!==J||U!==K)(q=(J=Y).copy()).on(Z,U=K);X.on=q}}function o3(_,Q,J){var q=(_+="")==="transform"?V3:z5;return Q==null?this.styleTween(_,r$(_,q)).on("end.style."+_,d8(_)):typeof Q==="function"?this.styleTween(_,d$(_,q,k2(this,"style."+_,Q))).each(a$(this._id,_)):this.styleTween(_,i$(_,q,Q),J).on("end.style."+_,null)}function s$(_,Q,J){return function(q){this.style.setProperty(_,Q.call(this,q),J)}}function t$(_,Q,J){var q,U;function G(){var Z=Q.apply(this,arguments);if(Z!==U)q=(U=Z)&&s$(_,Z,J);return q}return G._value=Q,G}function n3(_,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,t$(_,Q,J==null?"":J))}function o$(_){return function(){this.textContent=_}}function n$(_){return function(){var Q=_(this);this.textContent=Q==null?"":Q}}function e3(_){return this.tween("text",typeof _==="function"?n$(k2(this,"text",_)):o$(_==null?"":_+""))}function e$(_){return function(Q){this.textContent=_.call(this,Q)}}function _q(_){var Q,J;function q(){var U=_.apply(this,arguments);if(U!==J)Q=(J=U)&&e$(U);return Q}return q._value=_,q}function _6(_){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,_q(_))}function Q6(){var _=this._name,Q=this._id,J=_4();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 K=h1(X,Q);f0(X,_,J,Y,Z,{time:K.time+K.delay+K.duration,delay:0,duration:K.duration,ease:K.ease})}return new d1(q,this._parents,_,J)}function J6(){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=p1(this,q),K=Y.on;if(K!==_)Q=(_=K).copy(),Q._.cancel.push(F),Q._.interrupt.push(F),Q._.end.push(X);Y.on=Q}),U===0)G()})}var Qq=0;function d1(_,Q,J,q){this._groups=_,this._parents=Q,this._name=J,this._id=q}function a8(_){return O0().transition(_)}function _4(){return++Qq}var w0=O0.prototype;d1.prototype=a8.prototype={constructor:d1,select:a3,selectAll:s3,selectChild:w0.selectChild,selectChildren:w0.selectChildren,filter:l3,merge:r3,selection:t3,transition:Q6,call:w0.call,nodes:w0.nodes,node:w0.node,size:w0.size,empty:w0.empty,each:w0.each,on:i3,attr:E3,attrTween:x3,style:o3,styleTween:n3,text:e3,textTween:_6,remove:d3,tween:h3,delay:m3,duration:g3,ease:p3,easeVarying:c3,end:J6,[Symbol.iterator]:w0[Symbol.iterator]};function Q4(_){return((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2}var Jq={time:null,delay:0,duration:250,ease:Q4};function $q(_,Q){var J;while(!(J=_.__transition)||!(J=J[Q]))if(!(_=_.parentNode))throw Error(`transition ${Q} not found`);return J}function $6(_){var Q,J;if(_ instanceof d1)Q=_._id,_=_._name;else Q=_4(),(J=Jq).time=K5(),_=_==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])f0(X,_,Q,Y,Z,J||$q(X,Q));return new d1(q,this._parents,_,Q)}O0.prototype.interrupt=D3;O0.prototype.transition=$6;var W5=(_)=>()=>_;function q6(_,{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 F0(_,Q,J){this.k=_,this.x=Q,this.y=J}F0.prototype={constructor:F0,scale:function(_){return _===1?this:new F0(this.k*_,this.x,this.y)},translate:function(_,Q){return _===0&Q===0?this:new F0(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 $2=new F0(1,0,0);A5.prototype=F0.prototype;function A5(_){while(!_.__zoom)if(!(_=_.parentNode))return $2;return _.__zoom}function J4(_){_.stopImmediatePropagation()}function q2(_){_.preventDefault(),_.stopImmediatePropagation()}function qq(_){return(!_.ctrlKey||_.type==="wheel")&&!_.button}function Uq(){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 s8(){return this.__zoom||$2}function Gq(_){return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*(_.ctrlKey?10:1)}function Zq(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fq(_,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 B5(){var _=qq,Q=Uq,J=Fq,q=Gq,U=Zq,G=[0,1/0],Z=[[-1/0,-1/0],[1/0,1/0]],F=250,X=Q2,Y=t0("start","zoom","end"),K,H,L,z=500,W=150,O=0,R=10;function B(k){k.property("__zoom",s8).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",y).filter(U).on("touchstart.zoom",D).on("touchmove.zoom",l).on("touchend.zoom touchcancel.zoom",p).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}B.transform=function(k,b,j,E){var V=k.selection?k.selection():k;if(V.property("__zoom",s8),k!==V)f(k,b,j,E);else V.interrupt().each(function(){C(this,arguments).event(E).start().zoom(null,typeof b==="function"?b.apply(this,arguments):b).end()})},B.scaleBy=function(k,b,j,E){B.scaleTo(k,function(){var V=this.__zoom.k,h=typeof b==="function"?b.apply(this,arguments):b;return V*h},j,E)},B.scaleTo=function(k,b,j,E){B.transform(k,function(){var V=Q.apply(this,arguments),h=this.__zoom,I=j==null?T(V):typeof j==="function"?j.apply(this,arguments):j,v=h.invert(I),m=typeof b==="function"?b.apply(this,arguments):b;return J(A(P(h,m),I,v),V,Z)},j,E)},B.translateBy=function(k,b,j,E){B.transform(k,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,E)},B.translateTo=function(k,b,j,E,V){B.transform(k,function(){var h=Q.apply(this,arguments),I=this.__zoom,v=E==null?T(h):typeof E==="function"?E.apply(this,arguments):E;return J($2.translate(v[0],v[1]).scale(I.k).translate(typeof b==="function"?-b.apply(this,arguments):-b,typeof j==="function"?-j.apply(this,arguments):-j),h,Z)},E,V)};function P(k,b){return b=Math.max(G[0],Math.min(G[1],b)),b===k.k?k:new F0(b,k.x,k.y)}function A(k,b,j){var E=b[0]-j[0]*k.k,V=b[1]-j[1]*k.k;return E===k.x&&V===k.y?k:new F0(k.k,E,V)}function T(k){return[(+k[0][0]+ +k[1][0])/2,(+k[0][1]+ +k[1][1])/2]}function f(k,b,j,E){k.on("start.zoom",function(){C(this,arguments).event(E).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(E).end()}).tween("zoom",function(){var V=this,h=arguments,I=C(V,h).event(E),v=Q.apply(V,h),m=j==null?T(v):typeof j==="function"?j.apply(V,h):j,u=Math.max(v[1][0]-v[0][0],v[1][1]-v[0][1]),n=V.__zoom,e=typeof b==="function"?b.apply(V,h):b,t=X(n.invert(m).concat(u/n.k),e.invert(m).concat(u/e.k));return function(a){if(a===1)a=e;else{var g=t(a),J1=u/g[2];a=new F0(J1,m[0]-g[0]*J1,m[1]-g[1]*J1)}I.zoom(null,a)}})}function C(k,b,j){return!j&&k.__zooming||new w(k,b)}function w(k,b){this.that=k,this.args=b,this.active=0,this.sourceEvent=null,this.extent=Q.apply(k,b),this.taps=0}w.prototype={event:function(k){if(k)this.sourceEvent=k;return this},start:function(){if(++this.active===1)this.that.__zooming=this,this.emit("start");return this},zoom:function(k,b){if(this.mouse&&k!=="mouse")this.mouse[1]=b.invert(this.mouse[0]);if(this.touch0&&k!=="touch")this.touch0[1]=b.invert(this.touch0[0]);if(this.touch1&&k!=="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(k){var b=D1(this.that).datum();Y.call(k,this.that,new q6(k,{sourceEvent:this.sourceEvent,target:B,type:k,transform:this.that.__zoom,dispatch:Y}),b)}};function S(k,...b){if(!_.apply(this,arguments))return;var j=C(this,b).event(k),E=this.__zoom,V=Math.max(G[0],Math.min(G[1],E.k*Math.pow(2,q.apply(this,arguments)))),h=c1(k);if(j.wheel){if(j.mouse[0][0]!==h[0]||j.mouse[0][1]!==h[1])j.mouse[1]=E.invert(j.mouse[0]=h);clearTimeout(j.wheel)}else if(E.k===V)return;else j.mouse=[h,E.invert(h)],b0(this),j.start();q2(k),j.wheel=setTimeout(I,W),j.zoom("mouse",J(A(P(E,V),j.mouse[0],j.mouse[1]),j.extent,Z));function I(){j.wheel=null,j.end()}}function N(k,...b){if(L||!_.apply(this,arguments))return;var j=k.currentTarget,E=C(this,b,!0).event(k),V=D1(k.view).on("mousemove.zoom",m,!0).on("mouseup.zoom",u,!0),h=c1(k,j),I=k.clientX,v=k.clientY;w2(k.view),J4(k),E.mouse=[h,this.__zoom.invert(h)],b0(this),E.start();function m(n){if(q2(n),!E.moved){var e=n.clientX-I,t=n.clientY-v;E.moved=e*e+t*t>O}E.event(n).zoom("mouse",J(A(E.that.__zoom,E.mouse[0]=c1(n,j),E.mouse[1]),E.extent,Z))}function u(n){V.on("mousemove.zoom mouseup.zoom",null),t2(n.view,E.moved),q2(n),E.event(n).end()}}function y(k,...b){if(!_.apply(this,arguments))return;var j=this.__zoom,E=c1(k.changedTouches?k.changedTouches[0]:k,this),V=j.invert(E),h=j.k*(k.shiftKey?0.5:2),I=J(A(P(j,h),E,V),Q.apply(this,b),Z);if(q2(k),F>0)D1(this).transition().duration(F).call(f,I,E,k);else D1(this).call(B.transform,I,E,k)}function D(k,...b){if(!_.apply(this,arguments))return;var j=k.touches,E=j.length,V=C(this,b,k.changedTouches.length===E).event(k),h,I,v,m;J4(k);for(I=0;I<E;++I)if(v=j[I],m=c1(v,this),m=[m,this.__zoom.invert(m),v.identifier],!V.touch0)V.touch0=m,h=!0,V.taps=1+!!K;else if(!V.touch1&&V.touch0[2]!==m[2])V.touch1=m,V.taps=0;if(K)K=clearTimeout(K);if(h){if(V.taps<2)H=m[0],K=setTimeout(function(){K=null},z);b0(this),V.start()}}function l(k,...b){if(!this.__zooming)return;var j=C(this,b).event(k),E=k.changedTouches,V=E.length,h,I,v,m;q2(k);for(h=0;h<V;++h)if(I=E[h],v=c1(I,this),j.touch0&&j.touch0[2]===I.identifier)j.touch0[0]=v;else if(j.touch1&&j.touch1[2]===I.identifier)j.touch1[0]=v;if(I=j.that.__zoom,j.touch1){var u=j.touch0[0],n=j.touch0[1],e=j.touch1[0],t=j.touch1[1],a=(a=e[0]-u[0])*a+(a=e[1]-u[1])*a,g=(g=t[0]-n[0])*g+(g=t[1]-n[1])*g;I=P(I,Math.sqrt(a/g)),v=[(u[0]+e[0])/2,(u[1]+e[1])/2],m=[(n[0]+t[0])/2,(n[1]+t[1])/2]}else if(j.touch0)v=j.touch0[0],m=j.touch0[1];else return;j.zoom("touch",J(A(I,v,m),j.extent,Z))}function p(k,...b){if(!this.__zooming)return;var j=C(this,b).event(k),E=k.changedTouches,V=E.length,h,I;if(J4(k),L)clearTimeout(L);L=setTimeout(function(){L=null},z);for(h=0;h<V;++h)if(I=E[h],j.touch0&&j.touch0[2]===I.identifier)delete j.touch0;else if(j.touch1&&j.touch1[2]===I.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(I=c1(I,this),Math.hypot(H[0]-I[0],H[1]-I[1])<R){var v=D1(this).on("dblclick.zoom");if(v)v.apply(this,arguments)}}}return B.wheelDelta=function(k){return arguments.length?(q=typeof k==="function"?k:W5(+k),B):q},B.filter=function(k){return arguments.length?(_=typeof k==="function"?k:W5(!!k),B):_},B.touchable=function(k){return arguments.length?(U=typeof k==="function"?k:W5(!!k),B):U},B.extent=function(k){return arguments.length?(Q=typeof k==="function"?k:W5([[+k[0][0],+k[0][1]],[+k[1][0],+k[1][1]]]),B):Q},B.scaleExtent=function(k){return arguments.length?(G[0]=+k[0],G[1]=+k[1],B):[G[0],G[1]]},B.translateExtent=function(k){return arguments.length?(Z[0][0]=+k[0][0],Z[1][0]=+k[1][0],Z[0][1]=+k[0][1],Z[1][1]=+k[1][1],B):[[Z[0][0],Z[0][1]],[Z[1][0],Z[1][1]]]},B.constrain=function(k){return arguments.length?(J=k,B):J},B.duration=function(k){return arguments.length?(F=+k,B):F},B.interpolate=function(k){return arguments.length?(X=k,B):X},B.on=function(){var k=Y.on.apply(Y,arguments);return k===Y?B:k},B.clickDistance=function(k){return arguments.length?(O=(k=+k)*k,B):Math.sqrt(O)},B.tapDistance=function(k){return arguments.length?(R=+k,B):R},B}var a1={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]],H6=["Enter"," ","Escape"],K6={"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"},x0;(function(_){_.Strict="strict",_.Loose="loose"})(x0||(x0={}));var P0;(function(_){_.Free="free",_.Vertical="vertical",_.Horizontal="horizontal"})(P0||(P0={}));var U2;(function(_){_.Partial="partial",_.Full="full"})(U2||(U2={}));var X6={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},B0;(function(_){_.Bezier="default",_.Straight="straight",_.Step="step",_.SmoothStep="smoothstep",_.SimpleBezier="simplebezier"})(B0||(B0={}));var y2;(function(_){_.Arrow="arrow",_.ArrowClosed="arrowclosed"})(y2||(y2={}));var Z1;(function(_){_.Left="left",_.Top="top",_.Right="right",_.Bottom="bottom"})(Z1||(Z1={}));var t8={[Z1.Left]:Z1.Right,[Z1.Right]:Z1.Left,[Z1.Top]:Z1.Bottom,[Z1.Bottom]:Z1.Top},Y6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("source"in _)&&("target"in _),K7=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("position"in _)&&!("source"in _)&&!("target"in _),L6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("internals"in _)&&!("source"in _)&&!("target"in _);var T5=(_,Q=[0,0])=>{let{width:J,height:q}=$0(_),U=_.origin??Q,G=J*U[0],Z=q*U[1];return{x:_.position.x-G,y:_.position.y-Z}},z6=(_,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):!L6(G)?Q.nodeLookup.get(G.id):G;if(!F)return U;return J=!0,F4(U,U4(F,Q.nodeOrigin))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return J?H4(q):{x:0,y:0,width:0,height:0}},H2=(_,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=F4(J,U4(U)),q=!0}),q?H4(J):{x:0,y:0,width:0,height:0}},G4=(_,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,K=Q.height/U,H=[];for(let L of _.values()){let{measured:z,selectable:W=!0,hidden:O=!1}=L;if(Z&&!W||O)continue;let R=z.width??L.width??L.initialWidth??0,B=z.height??L.height??L.initialHeight??0,{x:P,y:A}=L.internals.positionAbsolute,T=W7(F,X,Y,K,P,A,R,B),f=R*B,C=G&&T>0;if(!L.internals.handleBounds||C||T>=f||L.dragging)H.push(L)}return H},X7=(_,Q)=>{let J=new Set;return _.forEach((q)=>{J.add(q.id)}),Q.filter((q)=>J.has(q.source)||J.has(q.target))};function Hq(_,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}=$0(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 Y7({nodes:_,width:Q,height:J,panZoom:q,minZoom:U,maxZoom:G},Z){if(_.size===0)return!0;let F=Hq(_,Z),X=H2(F),Y=O5(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 W6({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},K=Z.origin??q,H=Z.extent||U;if(Z.extent==="parent"&&!Z.expandParent)if(!F)G?.("005",a1.error005());else{let{width:z,height:W}=$0(F);if(z&&W)H=[[X,Y],[X+z,Y+W]]}else if(F&&F2(Z.extent))H=[[Z.extent[0][0]+X,Z.extent[0][1]+Y],[Z.extent[1][0]+X,Z.extent[1][1]+Y]];let L=F2(H)?G2(Q,H,Z.measured):Q;if(Z.measured.width===void 0||Z.measured.height===void 0)G?.("015",a1.error015());return{position:{x:L.x-X+(Z.measured.width??0)*K[0],y:L.y-Y+(Z.measured.height??0)*K[1]},positionAbsolute:L}}async function L7({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),K=X7(Z,X);for(let L of X)if(F.has(L.id)&&!K.find((W)=>W.id===L.id))K.push(L);if(!U)return{edges:K,nodes:Z};let H=await U({nodes:Z,edges:K});if(typeof H==="boolean")return H?{edges:K,nodes:Z}:{edges:[],nodes:[]};return H}var j2=(_,Q=0,J=1)=>Math.min(Math.max(_,Q),J),G2=(_={x:0,y:0},Q,J)=>({x:j2(_.x,Q[0][0],Q[1][0]-(J?.width??0)),y:j2(_.y,Q[0][1],Q[1][1]-(J?.height??0))});function z7(_,Q,J){let{width:q,height:U}=$0(J),{x:G,y:Z}=J.internals.positionAbsolute;return G2(_,[[G,Z],[G+q,Z+U]],Q)}var o8=(_,Q,J)=>{if(_<Q)return j2(Math.abs(_-Q),1,Q)/Q;else if(_>J)return-j2(Math.abs(_-J),1,Q)/Q;return 0},Z4=(_,Q,J=15,q=40)=>{let U=o8(_.x,q,Q.width-q)*J,G=o8(_.y,q,Q.height-q)*J;return[U,G]},F4=(_,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)}),F6=({x:_,y:Q,width:J,height:q})=>({x:_,y:Q,x2:_+J,y2:Q+q}),H4=({x:_,y:Q,x2:J,y2:q})=>({x:_,y:Q,width:J-_,height:q-Q}),u2=(_,Q=[0,0])=>{let{x:J,y:q}=L6(_)?_.internals.positionAbsolute:T5(_,Q);return{x:J,y:q,width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}},U4=(_,Q=[0,0])=>{let{x:J,y:q}=L6(_)?_.internals.positionAbsolute:T5(_,Q);return{x:J,y:q,x2:J+(_.measured?.width??_.width??_.initialWidth??0),y2:q+(_.measured?.height??_.height??_.initialHeight??0)}},A6=(_,Q)=>H4(F4(F6(_),F6(Q))),W7=(_,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)},R5=(_,Q)=>W7(_.x,_.y,_.width,_.height,Q.x,Q.y,Q.width,Q.height),B6=(_)=>Q0(_.width)&&Q0(_.height)&&Q0(_.x)&&Q0(_.y),Q0=(_)=>!isNaN(_)&&isFinite(_),M6=(_,Q)=>(J,q)=>{console.warn(`[${_}]: ${q} Help: ${Q}error#${J}`)},b2=(_,Q=[1,1])=>{return{x:Q[0]*Math.round(_.x/Q[0]),y:Q[1]*Math.round(_.y/Q[1])}},D2=({x:_,y:Q},[J,q,U],G=!1,Z=[1,1])=>{let F={x:(_-J)/U,y:(Q-q)/U};return G?b2(F,Z):F},Z2=({x:_,y:Q},[J,q,U])=>{return{x:_*U+J,y:Q*U+q}};function v2(_,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 Kq(_,Q,J){if(typeof _==="string"||typeof _==="number"){let q=v2(_,J),U=v2(_,Q);return{top:q,right:U,bottom:q,left:U,x:U*2,y:q*2}}if(typeof _==="object"){let q=v2(_.top??_.y??0,J),U=v2(_.bottom??_.y??0,J),G=v2(_.left??_.x??0,Q),Z=v2(_.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 Xq(_,Q,J,q,U,G){let{x:Z,y:F}=Z2(_,[Q,J,q]),{x:X,y:Y}=Z2({x:_.x+_.width,y:_.y+_.height},[Q,J,q]),K=U-X,H=G-Y;return{left:Math.floor(Z),top:Math.floor(F),right:Math.floor(K),bottom:Math.floor(H)}}var O5=(_,Q,J,q,U,G)=>{let Z=Kq(G,Q,J),F=(Q-Z.x)/_.width,X=(J-Z.y)/_.height,Y=Math.min(F,X),K=j2(Y,q,U),H=_.x+_.width/2,L=_.y+_.height/2,z=Q/2-H*K,W=J/2-L*K,O=Xq(_,z,W,K,Q,J),R={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-R.left+R.right,y:W-R.top+R.bottom,zoom:K}},h2=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function F2(_){return _!==void 0&&_!==null&&_!=="parent"}function $0(_){return{width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}}function T6(_){return(_.measured?.width??_.width??_.initialWidth)!==void 0&&(_.measured?.height??_.height??_.initialHeight)!==void 0}function R6(_,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 O6(_,Q){if(_.size!==Q.size)return!1;for(let J of _)if(!Q.has(J))return!1;return!0}function A7(){let _,Q;return{promise:new Promise((q,U)=>{_=q,Q=U}),resolve:_,reject:Q}}function B7(_){return{...K6,..._||{}}}function Yq(_){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 n8=!1;function M7(_){if(n8)return;n8=!0;let Q=`${_.charAt(0).toUpperCase()+_.slice(1)} Flow`;setTimeout(()=>{if(!Yq(_))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 I6(_){return _===null?null:_?"valid":"invalid"}function M5(_,{snapGrid:Q=[0,0],snapToGrid:J=!1,transform:q,containerBounds:U}){let{x:G,y:Z}=J0(_),F=D2({x:G-(U?.left??0),y:Z-(U?.top??0)},q),{x:X,y:Y}=J?b2(F,Q):F;return{xSnapped:X,ySnapped:Y,...F}}var K4=(_)=>({width:_.offsetWidth,height:_.offsetHeight}),f6=(_)=>_?.getRootNode?.()||window?.document,Lq=["INPUT","SELECT","TEXTAREA"];function w6(_){let Q=_.composedPath?.()?.[0]||_.target;if(Q?.nodeType!==1)return!1;return Lq.includes(Q.nodeName)||Q.hasAttribute("contenteditable")||!!Q.closest(".nokey")}var P6=(_)=>("clientX"in _),J0=(_,Q)=>{let J=P6(_),q=J?_.clientX:_.touches?.[0].clientX,U=J?_.clientY:_.touches?.[0].clientY;return{x:q-(Q?.left??0),y:U-(Q?.top??0)}},e8=(_,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,...K4(Z)}})};function X4({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,K=Math.abs(X-_),H=Math.abs(Y-Q);return[X,Y,K,H]}function $4(_,Q){if(_>=0)return 0.5*_;return Q*25*Math.sqrt(-_)}function _7({pos:_,x1:Q,y1:J,x2:q,y2:U,c:G}){switch(_){case Z1.Left:return[Q-$4(Q-q,G),J];case Z1.Right:return[Q+$4(q-Q,G),J];case Z1.Top:return[Q,J-$4(J-U,G)];case Z1.Bottom:return[Q,J+$4(U-J,G)]}}function Y4({sourceX:_,sourceY:Q,sourcePosition:J=Z1.Bottom,targetX:q,targetY:U,targetPosition:G=Z1.Top,curvature:Z=0.25}){let[F,X]=_7({pos:J,x1:_,y1:Q,x2:q,y2:U,c:Z}),[Y,K]=_7({pos:G,x1:q,y1:U,x2:_,y2:Q,c:Z}),[H,L,z,W]=X4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:F,sourceControlY:X,targetControlX:Y,targetControlY:K});return[`M${_},${Q} C${F},${X} ${Y},${K} ${q},${U}`,H,L,z,W]}function N6({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 T7({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 R7({sourceNode:_,targetNode:Q,width:J,height:q,transform:U}){let G=F4(U4(_),U4(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 R5(Z,H4(G))>0}var zq=({source:_,sourceHandle:Q,target:J,targetHandle:q})=>`xy-edge__${_}${Q||""}-${J}${q||""}`,Wq=(_,Q)=>{return Q.some((J)=>J.source===_.source&&J.target===_.target&&(J.sourceHandle===_.sourceHandle||!J.sourceHandle&&!_.sourceHandle)&&(J.targetHandle===_.targetHandle||!J.targetHandle&&!_.targetHandle))},O7=(_,Q,J={})=>{if(!_.source||!_.target)return J.onError?.("006",a1.error006()),Q;let q=J.getEdgeId||zq,U;if(Y6(_))U={..._};else U={..._,id:q(_)};if(Wq(U,Q))return Q;if(U.sourceHandle===null)delete U.sourceHandle;if(U.targetHandle===null)delete U.targetHandle;return Q.concat(U)};function L4({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let[U,G,Z,F]=N6({sourceX:_,sourceY:Q,targetX:J,targetY:q});return[`M ${_},${Q}L ${J},${q}`,U,G,Z,F]}var Q7={[Z1.Left]:{x:-1,y:0},[Z1.Right]:{x:1,y:0},[Z1.Top]:{x:0,y:-1},[Z1.Bottom]:{x:0,y:1}},Aq=({source:_,sourcePosition:Q=Z1.Bottom,target:J})=>{if(Q===Z1.Left||Q===Z1.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}},J7=(_,Q)=>Math.sqrt(Math.pow(Q.x-_.x,2)+Math.pow(Q.y-_.y,2));function Bq({source:_,sourcePosition:Q=Z1.Bottom,target:J,targetPosition:q=Z1.Top,center:U,offset:G,stepPosition:Z}){let F=Q7[Q],X=Q7[q],Y={x:_.x+F.x*G,y:_.y+F.y*G},K={x:J.x+X.x*G,y:J.y+X.y*G},H=Aq({source:Y,sourcePosition:Q,target:K}),L=H.x!==0?"x":"y",z=H[L],W=[],O,R,B={x:0,y:0},P={x:0,y:0},[,,A,T]=N6({sourceX:_.x,sourceY:_.y,targetX:J.x,targetY:J.y});if(F[L]*X[L]===-1){if(L==="x")O=U.x??Y.x+(K.x-Y.x)*Z,R=U.y??(Y.y+K.y)/2;else O=U.x??(Y.x+K.x)/2,R=U.y??Y.y+(K.y-Y.y)*Z;let S=[{x:O,y:Y.y},{x:O,y:K.y}],N=[{x:Y.x,y:R},{x:K.x,y:R}];if(F[L]===z)W=L==="x"?S:N;else W=L==="x"?N:S}else{let S=[{x:Y.x,y:K.y}],N=[{x:K.x,y:Y.y}];if(L==="x")W=F.x===z?N:S;else W=F.y===z?S:N;if(Q===q){let k=Math.abs(_[L]-J[L]);if(k<=G){let b=Math.min(G-1,G-k);if(F[L]===z)B[L]=(Y[L]>_[L]?-1:1)*b;else P[L]=(K[L]>J[L]?-1:1)*b}}if(Q!==q){let k=L==="x"?"y":"x",b=F[L]===X[k],j=Y[k]>K[k],E=Y[k]<K[k];if(F[L]===1&&(!b&&j||b&&E)||F[L]!==1&&(!b&&E||b&&j))W=L==="x"?S:N}let y={x:Y.x+B.x,y:Y.y+B.y},D={x:K.x+P.x,y:K.y+P.y},l=Math.max(Math.abs(y.x-W[0].x),Math.abs(D.x-W[0].x)),p=Math.max(Math.abs(y.y-W[0].y),Math.abs(D.y-W[0].y));if(l>=p)O=(y.x+D.x)/2,R=W[0].y;else O=W[0].x,R=(y.y+D.y)/2}let f={x:Y.x+B.x,y:Y.y+B.y},C={x:K.x+P.x,y:K.y+P.y};return[[_,...f.x!==W[0].x||f.y!==W[0].y?[f]:[],...W,...C.x!==W[W.length-1].x||C.y!==W[W.length-1].y?[C]:[],J],O,R,A,T]}function Mq(_,Q,J,q){let U=Math.min(J7(_,Q)/2,J7(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,K=_.y<J.y?1:-1;return`L ${G+U*Y},${Z}Q ${G},${Z} ${G},${Z+U*K}`}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 I5({sourceX:_,sourceY:Q,sourcePosition:J=Z1.Bottom,targetX:q,targetY:U,targetPosition:G=Z1.Top,borderRadius:Z=5,centerX:F,centerY:X,offset:Y=20,stepPosition:K=0.5}){let[H,L,z,W,O]=Bq({source:{x:_,y:Q},sourcePosition:J,target:{x:q,y:U},targetPosition:G,center:{x:F,y:X},offset:Y,stepPosition:K}),R=`M${H[0].x} ${H[0].y}`;for(let B=1;B<H.length-1;B++)R+=Mq(H[B-1],H[B],H[B+1],Z);return R+=`L${H[H.length-1].x} ${H[H.length-1].y}`,[R,L,z,W,O]}function $7(_){return _&&!!(_.internals.handleBounds||_.handles?.length)&&!!(_.measured.width||_.width||_.initialWidth)}function I7(_){let{sourceNode:Q,targetNode:J}=_;if(!$7(Q)||!$7(J))return null;let q=Q.internals.handleBounds||q7(Q.handles),U=J.internals.handleBounds||q7(J.handles),G=U7(q?.source??[],_.sourceHandle),Z=U7(_.connectionMode===x0.Strict?U?.target??[]:(U?.target??[]).concat(U?.source??[]),_.targetHandle);if(!G||!Z)return _.onError?.("008",a1.error008(!G?"source":"target",{id:_.id,sourceHandle:_.sourceHandle,targetHandle:_.targetHandle})),null;let F=G?.position||Z1.Bottom,X=Z?.position||Z1.Top,Y=m0(Q,G,F),K=m0(J,Z,X);return{sourceX:Y.x,sourceY:Y.y,targetX:K.x,targetY:K.y,sourcePosition:F,targetPosition:X}}function q7(_){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 m0(_,Q,J=Z1.Left,q=!1){let U=(Q?.x??0)+_.internals.positionAbsolute.x,G=(Q?.y??0)+_.internals.positionAbsolute.y,{width:Z,height:F}=Q??$0(_);if(q)return{x:U+Z/2,y:G+F/2};switch(Q?.position??J){case Z1.Top:return{x:U+Z/2,y:G};case Z1.Right:return{x:U+Z,y:G+F/2};case Z1.Bottom:return{x:U+Z/2,y:G+F};case Z1.Left:return{x:U,y:G+F/2}}}function U7(_,Q){if(!_)return null;return(!Q?_[0]:_.find((J)=>J.id===Q))||null}function z4(_,Q){if(!_)return"";if(typeof _==="string")return _;return`${Q?`${Q}__`:""}${Object.keys(_).sort().map((q)=>`${q}=${_[q]}`).join("&")}`}function f7(_,{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=z4(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 w7(_,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 Z1.Right:Z=[(_.x+_.width)*Q.zoom+Q.x+q,(_.y+_.height*G)*Q.zoom+Q.y],F=[0,-100*G];break;case Z1.Bottom:Z[1]=(_.y+_.height)*Q.zoom+Q.y+q,F[1]=0;break;case Z1.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 P7=1000,Tq=10,C6={nodeOrigin:[0,0],nodeExtent:V2,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Rq={...C6,checkEquality:!0};function S6(_,Q){let J={..._};for(let q in Q)if(Q[q]!==void 0)J[q]=Q[q];return J}function N7(_,Q,J){let q=S6(C6,J);for(let U of _.values())if(U.parentId)v6(U,_,Q,q);else{let G=T5(U,q.nodeOrigin),Z=F2(U.extent)?U.extent:q.nodeExtent,F=G2(G,Z,$0(U));U.internals.positionAbsolute=F}}function Oq(_,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 k6(_){return _==="manual"}function W4(_,Q,J,q={}){let U=S6(Rq,q),G={i:0},Z=new Map(Q),F=U?.elevateNodesOnSelect&&!k6(U.zIndexMode)?P7:0,X=_.length>0,Y=!1;Q.clear(),J.clear();for(let K of _){let H=Z.get(K.id);if(U.checkEquality&&K===H?.internals.userNode)Q.set(K.id,H);else{let L=T5(K,U.nodeOrigin),z=F2(K.extent)?K.extent:U.nodeExtent,W=G2(L,z,$0(K));H={...U.defaults,...K,measured:{width:K.measured?.width,height:K.measured?.height},internals:{positionAbsolute:W,handleBounds:Oq(K,H),z:C7(K,F,U.zIndexMode),userNode:K}},Q.set(K.id,H)}if((H.measured===void 0||H.measured.width===void 0||H.measured.height===void 0)&&!H.hidden)X=!1;if(K.parentId)v6(H,Q,J,q,G);Y||=K.selected??!1}return{nodesInitialized:X,hasSelectedNodes:Y}}function Iq(_,Q){if(!_.parentId)return;let J=Q.get(_.parentId);if(J)J.set(_.id,_);else Q.set(_.parentId,new Map([[_.id,_]]))}function v6(_,Q,J,q,U){let{elevateNodesOnSelect:G,nodeOrigin:Z,nodeExtent:F,zIndexMode:X}=S6(C6,q),Y=_.parentId,K=Q.get(Y);if(!K){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(Iq(_,J),U&&!K.parentId&&K.internals.rootParentIndex===void 0&&X==="auto")K.internals.rootParentIndex=++U.i,K.internals.z=K.internals.z+U.i*Tq;if(U&&K.internals.rootParentIndex!==void 0)U.i=K.internals.rootParentIndex;let H=G&&!k6(X)?P7:0,{x:L,y:z,z:W}=fq(_,K,Z,F,H,X),{positionAbsolute:O}=_.internals,R=L!==O.x||z!==O.y;if(R||W!==_.internals.z)Q.set(_.id,{..._,internals:{..._.internals,positionAbsolute:R?{x:L,y:z}:O,z:W}})}function C7(_,Q,J){let q=Q0(_.zIndex)?_.zIndex:0;if(k6(J))return q;return q+(_.selected?Q:0)}function fq(_,Q,J,q,U,G){let{x:Z,y:F}=Q.internals.positionAbsolute,X=$0(_),Y=T5(_,J),K=F2(_.extent)?G2(Y,_.extent,X):Y,H=G2({x:Z+K.x,y:F+K.y},q,X);if(_.extent==="parent")H=z7(H,X,Q);let L=C7(_,U,G),z=Q.internals.z??0;return{x:H.x,y:H.y,z:z>=L?z+1:L}}function A4(_,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??u2(F),Y=A6(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,K=$0(F),H=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(K.width,Math.round(Z.width)),O=Math.max(K.height,Math.round(Z.height)),R=(W-K.width)*H[0],B=(O-K.height)*H[1];if(L>0||z>0||R||B)U.push({id:X,type:"position",position:{x:F.position.x-L+R,y:F.position.y-z+B}}),J.get(X)?.forEach((P)=>{if(!_.some((A)=>A.id===P.id))U.push({id:P.id,type:"position",position:{x:P.position.x+L,y:P.position.y+z}})});if(K.width<Z.width||K.height<Z.height||L||z)U.push({id:X,type:"dimensions",setAttributes:!0,dimensions:{width:W+(L?H[0]*L-R:0),height:O+(z?H[1]*z-B:0)}})});return U}function S7(_,Q,J,q,U,G,Z){let F=q?.querySelector(".xyflow__viewport"),X=!1;if(!F)return{changes:[],updatedInternals:X};let Y=[],K=window.getComputedStyle(F),{m22:H}=new window.DOMMatrixReadOnly(K.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=K4(z.nodeElement),R=W.measured.width!==O.width||W.measured.height!==O.height;if(!!(O.width&&O.height&&(R||!W.internals.handleBounds||z.force))){let P=z.nodeElement.getBoundingClientRect(),A=F2(W.extent)?W.extent:G,{positionAbsolute:T}=W.internals;if(W.parentId&&W.extent==="parent"){let C=Q.get(W.parentId);if(C)T=z7(T,O,C)}else if(A)T=G2(T,A,O);let f={...W,measured:O,internals:{...W.internals,positionAbsolute:T,handleBounds:{source:e8("source",z.nodeElement,P,H,W.id),target:e8("target",z.nodeElement,P,H,W.id)}}};if(Q.set(W.id,f),W.parentId)v6(f,Q,J,{nodeOrigin:U,zIndexMode:Z});if(X=!0,R){if(Y.push({id:W.id,type:"dimensions",dimensions:O}),W.expandParent&&W.parentId)L.push({id:W.id,parentId:W.parentId,rect:u2(f,U)})}}}if(L.length>0){let z=A4(L,Q,J,U);Y.push(...z)}return{changes:Y,updatedInternals:X}}async function k7({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 G7(_,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 y6(_,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}`,K=`${G}-${F}--${U}-${Z}`;G7("source",X,K,_,U,Z),G7("target",X,Y,_,G,F),Q.set(q.id,q)}}function v7(_,Q){if(!_.parentId)return!1;let J=Q.get(_.parentId);if(!J)return!1;if(J.selected)return!0;return v7(J,Q)}function Z7(_,Q,J){let q=_;do{if(q?.matches?.(Q))return!0;if(q===J)return!1;q=q?.parentElement}while(q);return!1}function wq(_,Q,J,q){let U=new Map;for(let[G,Z]of _)if((Z.selected||Z.id===q)&&(!Z.parentId||!v7(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 U6({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 Pq({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=b2(G,Q);return{x:Z.x-G.x,y:Z.y-G.y}}function y7({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},K=null,H=!1,L=null,z=!1,W=!1,O=null;function R({noDragClassName:P,handleSelector:A,domNode:T,isSelectable:f,nodeId:C,nodeClickDistance:w=0}){L=D1(T);function S({x:l,y:p}){let{nodeLookup:k,nodeExtent:b,snapGrid:j,snapToGrid:E,nodeOrigin:V,onNodeDrag:h,onSelectionDrag:I,onError:v,updateNodePositions:m}=Q();G={x:l,y:p};let u=!1,n=F.size>1,e=n&&b?F6(H2(F)):null,t=n&&E?Pq({dragItems:F,snapGrid:j,x:l,y:p}):null;for(let[a,g]of F){if(!k.has(a))continue;let J1={x:l-g.distance.x,y:p-g.distance.y};if(E)J1=t?{x:Math.round(J1.x+t.x),y:Math.round(J1.y+t.y)}:b2(J1,j);let G1=null;if(n&&b&&!g.extent&&e){let{positionAbsolute:s}=g.internals,_1=s.x-e.x+b[0][0],q1=s.x+g.measured.width-e.x2+b[1][0],o=s.y-e.y+b[0][1],K1=s.y+g.measured.height-e.y2+b[1][1];G1=[[_1,o],[q1,K1]]}let{position:F1,positionAbsolute:c}=W6({nodeId:a,nextPosition:J1,nodeLookup:k,nodeExtent:G1?G1:b,nodeOrigin:V,onError:v});u=u||g.position.x!==F1.x||g.position.y!==F1.y,g.position=F1,g.internals.positionAbsolute=c}if(W=W||u,!u)return;if(m(F,!0),O&&(q||h||!C&&I)){let[a,g]=U6({nodeId:C,dragItems:F,nodeLookup:k});if(q?.(O,F,a,g),h?.(O,a,g),!C)I?.(O,g)}}async function N(){if(!K)return;let{transform:l,panBy:p,autoPanSpeed:k,autoPanOnNodeDrag:b}=Q();if(!b){X=!1,cancelAnimationFrame(Z);return}let[j,E]=Z4(Y,K,k);if(j!==0||E!==0){if(G.x=(G.x??0)-j/l[2],G.y=(G.y??0)-E/l[2],await p({x:j,y:E}))S(G)}Z=requestAnimationFrame(N)}function y(l){let{nodeLookup:p,multiSelectionActive:k,nodesDraggable:b,transform:j,snapGrid:E,snapToGrid:V,selectNodesOnDrag:h,onNodeDragStart:I,onSelectionDragStart:v,unselectNodesAndEdges:m}=Q();if(H=!0,(!h||!f)&&!k&&C){if(!p.get(C)?.selected)m()}if(f&&h&&C)_?.(C);let u=M5(l.sourceEvent,{transform:j,snapGrid:E,snapToGrid:V,containerBounds:K});if(G=u,F=wq(p,b,u,C),F.size>0&&(J||I||!C&&v)){let[n,e]=U6({nodeId:C,dragItems:F,nodeLookup:p});if(J?.(l.sourceEvent,F,n,e),I?.(l.sourceEvent,n,e),!C)v?.(l.sourceEvent,e)}}let D=e2().clickDistance(w).on("start",(l)=>{let{domNode:p,nodeDragThreshold:k,transform:b,snapGrid:j,snapToGrid:E}=Q();if(K=p?.getBoundingClientRect()||null,z=!1,W=!1,O=l.sourceEvent,k===0)y(l);G=M5(l.sourceEvent,{transform:b,snapGrid:j,snapToGrid:E,containerBounds:K}),Y=J0(l.sourceEvent,K)}).on("drag",(l)=>{let{autoPanOnNodeDrag:p,transform:k,snapGrid:b,snapToGrid:j,nodeDragThreshold:E,nodeLookup:V}=Q(),h=M5(l.sourceEvent,{transform:k,snapGrid:b,snapToGrid:j,containerBounds:K});if(O=l.sourceEvent,l.sourceEvent.type==="touchmove"&&l.sourceEvent.touches.length>1||C&&!V.has(C))z=!0;if(z)return;if(!X&&p&&H)X=!0,N();if(!H){let I=J0(l.sourceEvent,K),v=I.x-Y.x,m=I.y-Y.y;if(Math.sqrt(v*v+m*m)>E)y(l)}if((G.x!==h.xSnapped||G.y!==h.ySnapped)&&F&&H)Y=J0(l.sourceEvent,K),S(h)}).on("end",(l)=>{if(!H||z){if(z&&F.size>0)Q().updateNodePositions(F,!1);return}if(X=!1,H=!1,cancelAnimationFrame(Z),F.size>0){let{nodeLookup:p,updateNodePositions:k,onNodeDragStop:b,onSelectionDragStop:j}=Q();if(W)k(F,!1),W=!1;if(U||b||!C&&j){let[E,V]=U6({nodeId:C,dragItems:F,nodeLookup:p,dragging:!1});if(U?.(l.sourceEvent,F,E,V),b?.(l.sourceEvent,E,V),!C)j?.(l.sourceEvent,V)}}}).filter((l)=>{let p=l.target;return!l.button&&(!P||!Z7(p,`.${P}`,T))&&(!A||Z7(p,A,T))});L.call(D)}function B(){L?.on(".drag",null)}return{update:R,destroy:B}}function Nq(_,Q,J){let q=[],U={x:_.x-J,y:_.y-J,width:J*2,height:J*2};for(let G of Q.values())if(R5(U,u2(G))>0)q.push(G);return q}var Cq=250;function Sq(_,Q,J,q){let U=[],G=1/0,Z=Nq(_,J,Q+Cq);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:K,y:H}=m0(F,Y,Y.position,!0),L=Math.sqrt(Math.pow(K-_.x,2)+Math.pow(H-_.y,2));if(L>Q)continue;if(L<G)U=[{...Y,x:K,y:H}],G=L;else if(L===G)U.push({...Y,x:K,y:H})}}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 j7(_,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,...m0(Z,X,X.position,!0)}:X}function V7(_,Q){if(_)return _;else if(Q?.classList.contains("target"))return"target";else if(Q?.classList.contains("source"))return"source";return null}function kq(_,Q){let J=null;if(Q)J=!0;else if(_&&!Q)J=!1;return J}var u7=()=>!0;function vq(_,{connectionMode:Q,connectionRadius:J,handleId:q,nodeId:U,edgeUpdaterType:G,isTarget:Z,domNode:F,nodeLookup:X,lib:Y,autoPanOnConnect:K,flowId:H,panBy:L,cancelConnection:z,onConnectStart:W,onConnect:O,onConnectEnd:R,isValidConnection:B=u7,onReconnectEnd:P,updateConnection:A,getTransform:T,getFromHandle:f,autoPanSpeed:C,dragThreshold:w=1,handleDomNode:S}){let N=f6(_.target),y=0,D,{x:l,y:p}=J0(_),k=V7(G,S),b=F?.getBoundingClientRect(),j=!1;if(!b||!k)return;let E=j7(U,k,q,X,Q);if(!E)return;let V=J0(_,b),h=!1,I=null,v=!1,m=null;function u(){if(!K||!b)return;let[F1,c]=Z4(V,b,C);L({x:F1,y:c}),y=requestAnimationFrame(u)}let n={...E,nodeId:U,type:k,position:E.position},e=X.get(U),a={inProgress:!0,isValid:null,from:m0(e,n,Z1.Left,!0),fromHandle:n,fromPosition:n.position,fromNode:e,to:V,toHandle:null,toPosition:t8[n.position],toNode:null,pointer:V};function g(){j=!0,A(a),W?.(_,{nodeId:U,handleId:q,handleType:k})}if(w===0)g();function J1(F1){if(!j){let{x:K1,y:$1}=J0(F1),M1=K1-l,R1=$1-p;if(!(M1*M1+R1*R1>w*w))return;g()}if(!f()||!n){G1(F1);return}let c=T();if(V=J0(F1,b),D=Sq(D2(V,c,!1,[1,1]),J,X,n),!h)u(),h=!0;let s=b7(F1,{handle:D,connectionMode:Q,fromNodeId:U,fromHandleId:q,fromType:Z?"target":"source",isValidConnection:B,doc:N,lib:Y,flowId:H,nodeLookup:X});m=s.handleDomNode,I=s.connection,v=kq(!!D,s.isValid);let _1=X.get(U),q1=_1?m0(_1,n,Z1.Left,!0):a.from,o={...a,from:q1,isValid:v,to:s.toHandle&&v?Z2({x:s.toHandle.x,y:s.toHandle.y},c):V,toHandle:s.toHandle,toPosition:v&&s.toHandle?s.toHandle.position:t8[n.position],toNode:s.toHandle?X.get(s.toHandle.nodeId):null,pointer:V};A(o),a=o}function G1(F1){if("touches"in F1&&F1.touches.length>0)return;if(j){if((D||m)&&I&&v)O?.(I);let{inProgress:c,...s}=a,_1={...s,toPosition:a.toHandle?a.toPosition:null};if(R?.(F1,_1),G)P?.(F1,_1)}z(),cancelAnimationFrame(y),h=!1,v=!1,I=null,m=null,N.removeEventListener("mousemove",J1),N.removeEventListener("mouseup",G1),N.removeEventListener("touchmove",J1),N.removeEventListener("touchend",G1)}N.addEventListener("mousemove",J1),N.addEventListener("mouseup",G1),N.addEventListener("touchmove",J1),N.addEventListener("touchend",G1)}function b7(_,{handle:Q,connectionMode:J,fromNodeId:q,fromHandleId:U,fromType:G,doc:Z,lib:F,flowId:X,isValidConnection:Y=u7,nodeLookup:K}){let H=G==="target",L=Q?Z.querySelector(`.${F}-flow__handle[data-id="${X}-${Q?.nodeId}-${Q?.id}-${Q?.type}"]`):null,{x:z,y:W}=J0(_),O=Z.elementFromPoint(z,W),R=O?.classList.contains(`${F}-flow__handle`)?O:L,B={handleDomNode:R,isValid:!1,connection:null,toHandle:null};if(R){let P=V7(void 0,R),A=R.getAttribute("data-nodeid"),T=R.getAttribute("data-handleid"),f=R.classList.contains("connectable"),C=R.classList.contains("connectableend");if(!A||!P)return B;let w={source:H?A:q,sourceHandle:H?T:U,target:H?q:A,targetHandle:H?U:T};B.connection=w;let N=f&&C&&(J===x0.Strict?H&&P==="source"||!H&&P==="target":A!==q||T!==U);B.isValid=N&&Y(w),B.toHandle=j7(A,P,T,K,J,!0)}return B}var B4={onPointerDown:vq,isValid:b7};function D7({domNode:_,panZoom:Q,getTransform:J,getViewScale:q}){let U=D1(_);function G({translateExtent:F,width:X,height:Y,zoomStep:K=1,pannable:H=!0,zoomable:L=!0,inversePan:z=!1}){let W=(A)=>{if(A.sourceEvent.type!=="wheel"||!Q)return;let T=J(),f=A.sourceEvent.ctrlKey&&h2()?10:1,C=-A.sourceEvent.deltaY*(A.sourceEvent.deltaMode===1?0.05:A.sourceEvent.deltaMode?1:0.002)*K,w=T[2]*Math.pow(2,C*f);Q.scaleTo(w)},O=[0,0],R=(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 T=J();if(A.sourceEvent.type!=="mousemove"&&A.sourceEvent.type!=="touchmove"||!Q)return;let f=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY],C=[f[0]-O[0],f[1]-O[1]];O=f;let w=q()*Math.max(T[2],Math.log(T[2]))*(z?-1:1),S={x:T[0]-C[0]*w,y:T[1]-C[1]*w},N=[[0,0],[X,Y]];Q.setViewportConstrained({x:S.x,y:S.y,zoom:T[2]},N,F)},P=B5().on("start",R).on("zoom",H?B:null).on("zoom.wheel",L?W:null);U.call(P,{})}function Z(){U.on("zoom",null)}return{update:G,destroy:Z,pointer:c1}}var M4=(_)=>({x:_.x,y:_.y,zoom:_.k}),G6=({x:_,y:Q,zoom:J})=>$2.translate(_,Q).scale(J),E0=(_,Q)=>_.target.closest(`.${Q}`),h7=(_,Q)=>Q===2&&Array.isArray(_)&&_.includes(2),yq=(_)=>((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2,Z6=(_,Q=0,J=yq,q=()=>{})=>{let U=typeof Q==="number"&&Q>0;if(!U)q();return U?_.transition().duration(Q).ease(J).on("end",q):_},E7=(_)=>{let Q=_.ctrlKey&&h2()?10:1;return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*Q};function jq({zoomPanValues:_,noWheelClassName:Q,d3Selection:J,d3Zoom:q,panOnScrollMode:U,panOnScrollSpeed:G,zoomOnPinch:Z,onPanZoomStart:F,onPanZoom:X,onPanZoomEnd:Y}){return(K)=>{if(E0(K,Q)){if(K.ctrlKey)K.preventDefault();return!1}K.preventDefault(),K.stopImmediatePropagation();let H=J.property("__zoom").k||1;if(K.ctrlKey&&Z){let R=c1(K),B=E7(K),P=H*Math.pow(2,B);q.scaleTo(J,P,R,K);return}let L=K.deltaMode===1?20:1,z=U===P0.Vertical?0:K.deltaX*L,W=U===P0.Horizontal?0:K.deltaY*L;if(!h2()&&K.shiftKey&&U!==P0.Vertical)z=K.deltaY*L,W=0;q.translateBy(J,-(z/H)*G,-(W/H)*G,{internal:!0});let O=M4(J.property("__zoom"));if(clearTimeout(_.panScrollTimeout),!_.isPanScrolling)_.isPanScrolling=!0,F?.(K,O);else X?.(K,O);_.panScrollTimeout=setTimeout(()=>{Y?.(K,O),_.isPanScrolling=!1},150)}}function Vq({noWheelClassName:_,preventScrolling:Q,d3ZoomHandler:J}){return function(q,U){let G=q.type==="wheel",Z=!Q&&G&&!q.ctrlKey,F=E0(q,_);if(q.ctrlKey&&G&&F)q.preventDefault();if(Z||F)return null;q.preventDefault(),J.call(this,q,U)}}function uq({zoomPanValues:_,onDraggingChange:Q,onPanZoomStart:J}){return(q)=>{if(q.sourceEvent?.internal)return;let U=M4(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 bq({zoomPanValues:_,panOnDrag:Q,onPaneContextMenu:J,onTransformChange:q,onPanZoom:U}){return(G)=>{if(_.usedRightMouseButton=!!(J&&h7(Q,_.mouseButton??0)),!G.sourceEvent?.sync)q([G.transform.x,G.transform.y,G.transform.k]);if(U&&!G.sourceEvent?.internal)U?.(G.sourceEvent,M4(G.transform))}}function Dq({zoomPanValues:_,panOnDrag:Q,panOnScroll:J,onDraggingChange:q,onPanZoomEnd:U,onPaneContextMenu:G}){return(Z)=>{if(Z.sourceEvent?.internal)return;if(_.isZoomingOrPanning=!1,G&&h7(Q,_.mouseButton??0)&&!_.usedRightMouseButton&&Z.sourceEvent)G(Z.sourceEvent);if(_.usedRightMouseButton=!1,q(!1),U){let F=M4(Z.transform);_.prevViewport=F,clearTimeout(_.timerId),_.timerId=setTimeout(()=>{U?.(Z.sourceEvent,F)},J?150:0)}}}function hq({panActivationKeyPressed:_,zoomActivationKeyPressed:Q,zoomOnScroll:J,zoomOnPinch:q,panOnDrag:U,panOnScroll:G,zoomOnDoubleClick:Z,userSelectionActive:F,noWheelClassName:X,noPanClassName:Y,lib:K,connectionInProgress:H}){return(L)=>{let z=Q||J,W=q&&L.ctrlKey,O=L.type==="wheel";if(L.button===1&&L.type==="mousedown"&&(E0(L,`${K}-flow__node`)||E0(L,`${K}-flow__edge`)||E0(L,`${K}-flow__selection`)||E0(L,`${K}-flow__nodesselection`)))return!0;if(!U&&!z&&!G&&!Z&&!q)return!1;if(F)return!1;if(H&&!O)return!1;if(E0(L,X)&&O)return!1;if(E0(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 R=Array.isArray(U)&&U.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||O||_)&&R}}function x7({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},K=_.getBoundingClientRect(),H=[[0,0],[K.width,K.height]];(typeof ResizeObserver<"u"?new ResizeObserver((p)=>{let k=p[0];if(k)H=[[0,0],[k.contentRect.width,k.contentRect.height]]}):null)?.observe(_);let z=B5().extent(()=>H).scaleExtent([Q,J]).translateExtent(q),W=D1(_).call(z);T({x:U.x,y:U.y,zoom:j2(U.zoom,Q,J)},[[0,0],[K.width,K.height]],q);let O=W.on("wheel.zoom"),R=W.on("dblclick.zoom");z.wheelDelta(E7);async function B(p,k){if(W)return new Promise((b)=>{z?.interpolate(k?.interpolate==="linear"?A0:Q2).transform(Z6(W,k?.duration,k?.ease,()=>b(!0)),p)});return!1}function P({noWheelClassName:p,noPanClassName:k,onPaneContextMenu:b,userSelectionActive:j,panOnScroll:E,panOnDrag:V,panOnScrollMode:h,panOnScrollSpeed:I,preventScrolling:v,zoomOnPinch:m,zoomOnScroll:u,zoomOnDoubleClick:n,panActivationKeyPressed:e=!1,zoomActivationKeyPressed:t,lib:a,onTransformChange:g,connectionInProgress:J1,paneClickDistance:G1,selectionOnDrag:F1}){if(j&&!Y.isZoomingOrPanning)A();let c=E&&!t&&!j;z.clickDistance(F1?1/0:!Q0(G1)||G1<0?0:G1);let s=c?jq({zoomPanValues:Y,noWheelClassName:p,d3Selection:W,d3Zoom:z,panOnScrollMode:h,panOnScrollSpeed:I,zoomOnPinch:m,onPanZoomStart:Z,onPanZoom:G,onPanZoomEnd:F}):Vq({noWheelClassName:p,preventScrolling:v,d3ZoomHandler:O});W.on("wheel.zoom",s,{passive:!1});let _1=uq({zoomPanValues:Y,onDraggingChange:X,onPanZoomStart:Z});z.on("start",_1);let q1=bq({zoomPanValues:Y,panOnDrag:V,onPaneContextMenu:!!b,onPanZoom:G,onTransformChange:g});z.on("zoom",q1);let o=Dq({zoomPanValues:Y,panOnDrag:V,panOnScroll:E,onPaneContextMenu:b,onPanZoomEnd:F,onDraggingChange:X});z.on("end",o);let K1=hq({panActivationKeyPressed:e,zoomActivationKeyPressed:t,panOnDrag:V,zoomOnScroll:u,panOnScroll:E,zoomOnDoubleClick:n,zoomOnPinch:m,userSelectionActive:j,noPanClassName:k,noWheelClassName:p,lib:a,connectionInProgress:J1});if(z.filter(K1),n)W.on("dblclick.zoom",R);else W.on("dblclick.zoom",null)}function A(){z.on("zoom",null)}async function T(p,k,b){let j=G6(p),E=z?.constrain()(j,k,b);if(E)await B(E);return E}async function f(p,k){let b=G6(p);return await B(b,k),b}function C(p){if(W){let k=G6(p),b=W.property("__zoom");if(b.k!==p.zoom||b.x!==p.x||b.y!==p.y)z?.transform(W,k,null,{sync:!0})}}function w(){let p=W?A5(W.node()):{x:0,y:0,k:1};return{x:p.x,y:p.y,zoom:p.k}}async function S(p,k){if(W)return new Promise((b)=>{z?.interpolate(k?.interpolate==="linear"?A0:Q2).scaleTo(Z6(W,k?.duration,k?.ease,()=>b(!0)),p)});return!1}async function N(p,k){if(W)return new Promise((b)=>{z?.interpolate(k?.interpolate==="linear"?A0:Q2).scaleBy(Z6(W,k?.duration,k?.ease,()=>b(!0)),p)});return!1}function y(p){z?.scaleExtent(p)}function D(p){z?.translateExtent(p)}function l(p){let k=!Q0(p)||p<0?0:p;z?.clickDistance(k)}return{update:P,destroy:A,setViewport:f,setViewportConstrained:T,getViewport:w,scaleTo:S,scaleBy:N,setScaleExtent:y,setTranslateExtent:D,syncViewport:C,setClickDistance:l}}var g0;(function(_){_.Line="line",_.Handle="handle"})(g0||(g0={}));function Eq({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 F7(_){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 D0(_,Q){return Math.max(0,Q-_)}function h0(_,Q){return Math.max(0,_-Q)}function q4(_,Q,J){return Math.max(0,Q-_,_-J)}function H7(_,Q){return _?!Q:Q}function xq(_,Q,J,q,U,G,Z,F){let{affectsX:X,affectsY:Y}=Q,{isHorizontal:K,isVertical:H}=Q,L=K&&H,{xSnapped:z,ySnapped:W}=J,{minWidth:O,maxWidth:R,minHeight:B,maxHeight:P}=q,{x:A,y:T,width:f,height:C,aspectRatio:w}=_,S=Math.floor(K?z-_.pointerX:0),N=Math.floor(H?W-_.pointerY:0),y=f+(X?-S:S),D=C+(Y?-N:N),l=-G[0]*f,p=-G[1]*C,k=q4(y,O,R),b=q4(D,B,P);if(Z){let V=0,h=0;if(X&&S<0)V=D0(A+S+l,Z[0][0]);else if(!X&&S>0)V=h0(A+y+l,Z[1][0]);if(Y&&N<0)h=D0(T+N+p,Z[0][1]);else if(!Y&&N>0)h=h0(T+D+p,Z[1][1]);k=Math.max(k,V),b=Math.max(b,h)}if(F){let V=0,h=0;if(X&&S>0)V=h0(A+S,F[0][0]);else if(!X&&S<0)V=D0(A+y,F[1][0]);if(Y&&N>0)h=h0(T+N,F[0][1]);else if(!Y&&N<0)h=D0(T+D,F[1][1]);k=Math.max(k,V),b=Math.max(b,h)}if(U){if(K){let V=q4(y/w,B,P)*w;if(k=Math.max(k,V),Z){let h=0;if(!X&&!Y||X&&!Y&&L)h=h0(T+p+y/w,Z[1][1])*w;else h=D0(T+p+(X?S:-S)/w,Z[0][1])*w;k=Math.max(k,h)}if(F){let h=0;if(!X&&!Y||X&&!Y&&L)h=D0(T+y/w,F[1][1])*w;else h=h0(T+(X?S:-S)/w,F[0][1])*w;k=Math.max(k,h)}}if(H){let V=q4(D*w,O,R)/w;if(b=Math.max(b,V),Z){let h=0;if(!X&&!Y||Y&&!X&&L)h=h0(A+D*w+l,Z[1][0])/w;else h=D0(A+(Y?N:-N)*w+l,Z[0][0])/w;b=Math.max(b,h)}if(F){let h=0;if(!X&&!Y||Y&&!X&&L)h=D0(A+D*w,F[1][0])/w;else h=h0(A+(Y?N:-N)*w,F[0][0])/w;b=Math.max(b,h)}}}if(N=N+(N<0?b:-b),S=S+(S<0?k:-k),U)if(L)if(y>D*w)N=(H7(X,Y)?-S:S)/w;else S=(H7(X,Y)?-N:N)*w;else if(K)N=S/w,Y=X;else S=N*w,X=Y;let j=X?A+S:A,E=Y?T+N:T;return{width:f+(X?-S:S),height:C+(Y?-N:N),x:G[0]*S*(!X?1:-1)+j,y:G[1]*N*(!Y?1:-1)+E}}var m7={width:0,height:0,x:0,y:0},mq={...m7,pointerX:0,pointerY:0,aspectRatio:1};function gq(_,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 g7({domNode:_,nodeId:Q,getStoreItems:J,onChange:q,onEnd:U}){let G=D1(_),Z={controlDirection:F7("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:K,keepAspectRatio:H,resizeDirection:L,onResizeStart:z,onResize:W,onResizeEnd:O,shouldResize:R}){let B={...m7},P={...mq};Z={boundaries:K,resizeDirection:L,keepAspectRatio:H,controlDirection:F7(Y)};let A=void 0,T=null,f=[],C=void 0,w=void 0,S=void 0,N=e2().on("start",(y)=>{let{nodeLookup:D,transform:l,snapGrid:p,snapToGrid:k,nodeOrigin:b,paneDomNode:j}=J();if(A=D.get(Q),!A)return;T=j?.getBoundingClientRect()??null;let{xSnapped:E,ySnapped:V}=M5(y.sourceEvent,{transform:l,snapGrid:p,snapToGrid:k,containerBounds:T});if(B={width:A.measured.width??0,height:A.measured.height??0,x:A.position.x??0,y:A.position.y??0},P={...B,pointerX:E,pointerY:V,aspectRatio:B.width/B.height},C=void 0,w=F2(A.extent)?A.extent:void 0,A.parentId&&(A.extent==="parent"||A.expandParent))C=D.get(A.parentId);if(C&&A.extent==="parent")w=[[0,0],[C.measured.width,C.measured.height]];f=[],S=void 0;for(let[h,I]of D)if(I.parentId===Q){if(f.push({id:h,position:{...I.position},extent:I.extent}),I.extent==="parent"||I.expandParent){let v=gq(I,A,I.origin??b);if(S)S=[[Math.min(v[0][0],S[0][0]),Math.min(v[0][1],S[0][1])],[Math.max(v[1][0],S[1][0]),Math.max(v[1][1],S[1][1])]];else S=v}}z?.(y,{...B})}).on("drag",(y)=>{let{transform:D,snapGrid:l,snapToGrid:p,nodeOrigin:k}=J(),b=M5(y.sourceEvent,{transform:D,snapGrid:l,snapToGrid:p,containerBounds:T}),j=[];if(!A)return;let{x:E,y:V,width:h,height:I}=B,v={},m=A.origin??k,{width:u,height:n,x:e,y:t}=xq(P,Z.controlDirection,b,Z.boundaries,Z.keepAspectRatio,m,w,S),a=u!==h,g=n!==I,J1=e!==E&&a,G1=t!==V&&g;if(!J1&&!G1&&!a&&!g)return;let F1={prevValues:{...B},startX:P.x,startY:P.y,childNodes:f.map((q1)=>({...q1,position:{...q1.position}}))};if(J1||G1||m[0]===1||m[1]===1){if(v.x=J1?e:B.x,v.y=G1?t:B.y,B.x=v.x,B.y=v.y,f.length>0){let q1=e-E,o=t-V;for(let K1 of f)K1.position={x:K1.position.x-q1+m[0]*(u-h),y:K1.position.y-o+m[1]*(n-I)},j.push(K1)}}if(a||g)v.width=a&&(!Z.resizeDirection||Z.resizeDirection==="horizontal")?u:B.width,v.height=g&&(!Z.resizeDirection||Z.resizeDirection==="vertical")?n:B.height,B.width=v.width,B.height=v.height;if(C&&A.expandParent){let q1=m[0]*(v.width??0);if(v.x&&v.x<q1)B.x=q1,P.x=P.x-(v.x-q1);let o=m[1]*(v.height??0);if(v.y&&v.y<o)B.y=o,P.y=P.y-(v.y-o)}let c=Eq({width:B.width,prevWidth:h,height:B.height,prevHeight:I,affectsX:Z.controlDirection.affectsX,affectsY:Z.controlDirection.affectsY}),s={...B,direction:c};if(R?.(y,s)===!1){B=F1.prevValues,P.x=F1.startX,P.y=F1.startY,f.forEach((q1,o)=>{q1.position=F1.childNodes[o].position});return}W?.(y,s),q(v,j)}).on("end",(y)=>{O?.(y,{...B}),U?.({...B})});G.call(N)}function X(){G.on(".drag",null)}return{update:F,destroy:X}}var d7=g1(L0(),1),a7=g1(c7(),1);var l7=(_)=>{let Q,J=new Set,q=(K,H)=>{let L=typeof K==="function"?K(Q):K;if(!Object.is(L,Q)){let z=Q;Q=(H!=null?H: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:(K)=>{return J.add(K),()=>J.delete(K)},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},r7=(_)=>_?l7(_):l7;var{useDebugValue:lq}=d7.default,{useSyncExternalStoreWithSelector:rq}=a7.default,iq=(_)=>_;function j6(_,Q=iq,J){let q=rq(_.subscribe,_.getState,_.getServerState||_.getInitialState,Q,J);return lq(q),q}var i7=(_,Q)=>{let J=r7(_),q=(U,G=Q)=>j6(J,U,G);return Object.assign(q,J),q},s7=(_,Q)=>_?i7(_,Q):i7;function C1(_,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 P9=g1(n7(),1),f4=d.createContext(null),sq=f4.Provider,N9=a1.error001("react");function T1(_,Q){let J=d.useContext(f4);if(J===null)throw Error(N9);return j6(J,_,Q)}function S1(){let _=d.useContext(f4);if(_===null)throw Error(N9);return d.useMemo(()=>({getState:_.getState,setState:_.setState,subscribe:_.subscribe}),[_])}var e7={display:"none"},tq={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},C9="react-flow__node-desc",S9="react-flow__edge-desc",oq="react-flow__aria-live",nq=(_)=>_.ariaLiveMessage,eq=(_)=>_.ariaLabelConfig;function _U({rfId:_}){let Q=T1(nq);return i.jsx("div",{id:`${oq}-${_}`,"aria-live":"assertive","aria-atomic":"true",style:tq,children:Q})}function QU({rfId:_,disableKeyboardA11y:Q}){let J=T1(eq);return i.jsxs(i.Fragment,{children:[i.jsx("div",{id:`${C9}-${_}`,style:e7,children:Q?J["node.a11yDescription.default"]:J["node.a11yDescription.keyboardDisabled"]}),i.jsx("div",{id:`${S9}-${_}`,style:e7,children:J["edge.a11yDescription.default"]}),!Q&&i.jsx(_U,{rfId:_})]})}var X2=d.forwardRef(({position:_="top-left",children:Q,className:J,style:q,...U},G)=>{let Z=`${_}`.split("-");return i.jsx("div",{className:v1(["react-flow__panel",J,...Z]),style:q,ref:G,...U,children:Q})});X2.displayName="Panel";var _9="https://reactflow.dev/attribution";function JU({proOptions:_,position:Q="bottom-right"}){if(d.useEffect(()=>{M7("react")},[]),_?.hideAttribution)return null;return i.jsx(X2,{position:Q,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${_9}`,children:i.jsx("a",{href:_9,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var $U=(_)=>{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}},T4=(_)=>_.id;function qU(_,Q){return C1(_.selectedNodes.map(T4),Q.selectedNodes.map(T4))&&C1(_.selectedEdges.map(T4),Q.selectedEdges.map(T4))}function UU({onSelectionChange:_}){let Q=S1(),{selectedNodes:J,selectedEdges:q}=T1($U,qU);return d.useEffect(()=>{let U={nodes:J,edges:q};_?.(U),Q.getState().onSelectionChangeHandlers.forEach((G)=>G(U))},[J,q,_]),null}var GU=(_)=>!!_.onSelectionChangeHandlers;function ZU({onSelectionChange:_}){let Q=T1(GU);if(_||Q)return i.jsx(UU,{onSelectionChange:_});return null}var k9=[0,0],FU={x:0,y:0,zoom:1},HU=["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"],Q9=[...HU,"rfId"],KU=(_)=>({setNodes:_.setNodes,setEdges:_.setEdges,setMinZoom:_.setMinZoom,setMaxZoom:_.setMaxZoom,setTranslateExtent:_.setTranslateExtent,setNodeExtent:_.setNodeExtent,reset:_.reset,setDefaultNodesAndEdges:_.setDefaultNodesAndEdges}),J9={translateExtent:V2,nodeOrigin:k9,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function XU(_){let{setNodes:Q,setEdges:J,setMinZoom:q,setMaxZoom:U,setTranslateExtent:G,setNodeExtent:Z,reset:F,setDefaultNodesAndEdges:X}=T1(KU,C1),Y=S1();d.useEffect(()=>{return X(_.defaultNodes,_.defaultEdges),()=>{K.current=J9,F()}},[]);let K=d.useRef(J9);return d.useEffect(()=>{for(let H of Q9){let L=_[H],z=K.current[H];if(L===z)continue;if(typeof _[H]>"u")continue;if(H==="nodes")Q(L);else if(H==="edges")J(L);else if(H==="minZoom")q(L);else if(H==="maxZoom")U(L);else if(H==="translateExtent")G(L);else if(H==="nodeExtent")Z(L);else if(H==="ariaLabelConfig")Y.setState({ariaLabelConfig:B7(L)});else if(H==="fitView")Y.setState({fitViewQueued:L});else if(H==="fitViewOptions")Y.setState({fitViewOptions:L});else Y.setState({[H]:L})}K.current=_},Q9.map((H)=>_[H])),null}function $9(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function YU(_){let[Q,J]=d.useState(_==="system"?null:_);return d.useEffect(()=>{if(_!=="system"){J(_);return}let q=$9(),U=()=>J(q?.matches?"dark":"light");return U(),q?.addEventListener("change",U),()=>{q?.removeEventListener("change",U)}},[_]),Q!==null?Q:$9()?.matches?"dark":"light"}var q9=typeof document<"u"?document:null;function f5(_=null,Q={target:q9,actInsideInputWithModifier:!0}){let[J,q]=d.useState(!1),U=d.useRef(!1),G=d.useRef(new Set([])),[Z,F]=d.useMemo(()=>{if(_!==null){let Y=(Array.isArray(_)?_:[_]).filter((H)=>typeof H==="string").map((H)=>H.replace(/\+/g,`
27
+ <%s key={someKey} {...props} />`,b,o,s,o),D[o+b]=!0)}if(o=null,p!==void 0&&(J(p),o=""+p),Z(k)&&(J(k.key),o=""+k.key),"key"in k){p={};for(var g in k)g!=="key"&&(p[g]=k[g])}else p=k;return o&&F(p,typeof I==="function"?I.displayName||I.name||"Unknown":I),Y(I,o,p,U(),e,t)}function H(I){L(I)?I._store&&(I._store.validated=1):typeof I==="object"&&I!==null&&I.$$typeof===S&&(I._payload.status==="fulfilled"?L(I._payload.value)&&I._payload.value._store&&(I._payload.value._store.validated=1):I._store&&(I._store.validated=1))}function L(I){return typeof I==="object"&&I!==null&&I.$$typeof===W}var W=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),j=Symbol.for("react.client.reference"),x=I2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,r=Object.prototype.hasOwnProperty,m=Array.isArray,v=console.createTask?console.createTask:function(){return null};I2={react_stack_bottom_frame:function(I){return I()}};var h,V={},E=I2.react_stack_bottom_frame.bind(I2,G)(),u=v(q(G)),D={};RZ.Fragment=O,RZ.jsxDEV=function(I,k,p,b){var e=1e4>x.recentlyCreatedOwnerStacks++;return K(I,k,p,b,e?Error("react-stack-top-frame"):E,e?v(q(I)):u)}})()});var i=r1(O0(),1);var d=r1(z8(),1),a=r1(O0(),1);function j1(_){if(typeof _==="string"||typeof _==="number")return""+_;let Q="";if(Array.isArray(_)){for(let J=0,q;J<_.length;J++)if((q=j1(_[J]))!=="")Q+=(Q&&" ")+q}else for(let J in _)if(_[J])Q+=(Q&&" ")+J;return Q}var eQ={value:()=>{}};function B8(){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 g5(J)}function g5(_){this._=_}function _J(_,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}})}g5.prototype=B8.prototype={constructor:g5,on:function(_,Q){var J=this._,q=_J(_+"",J),U,G=-1,Z=q.length;if(arguments.length<2){while(++G<Z)if((U=(_=q[G]).type)&&(U=QJ(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]=W8(J[U],_.name,Q);else if(Q==null)for(U in J)J[U]=W8(J[U],_.name,null);return this},copy:function(){var _={},Q=this._;for(var J in Q)_[J]=Q[J].slice();return new g5(_)},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 QJ(_,Q){for(var J=0,q=_.length,U;J<q;++J)if((U=_[J]).name===Q)return U.value}function W8(_,Q,J){for(var q=0,U=_.length;q<U;++q)if(_[q].name===Q){_[q]=eQ,_=_.slice(0,q).concat(_.slice(q+1));break}if(J!=null)_.push({name:Q,value:J});return _}var Z2=B8;function y2(_){return function(){return this.matches(_)}}function p5(_){return function(Q){return Q.matches(_)}}var c5="http://www.w3.org/1999/xhtml",g4={svg:"http://www.w3.org/2000/svg",xhtml:c5,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function I0(_){var Q=_+="",J=Q.indexOf(":");if(J>=0&&(Q=_.slice(0,J))!=="xmlns")_=_.slice(J+1);return g4.hasOwnProperty(Q)?{space:g4[Q],local:_}:_}function p4(_){let Q;while(Q=_.sourceEvent)_=Q;return _}function d1(_,Q){if(_=p4(_),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 JJ(){}function i0(_){return _==null?JJ:function(){return this.querySelector(_)}}function c4(_){if(typeof _!=="function")_=i0(_);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,K=0;K<Z;++K)if((X=G[K])&&(Y=_.call(X,X.__data__,K,G))){if("__data__"in X)Y.__data__=X.__data__;F[K]=Y}return new b1(q,this._parents)}function l4(_){return _==null?[]:Array.isArray(_)?_:Array.from(_)}function $J(){return[]}function j2(_){return _==null?$J:function(){return this.querySelectorAll(_)}}function qJ(_){return function(){return l4(_.apply(this,arguments))}}function r4(_){if(typeof _==="function")_=qJ(_);else _=j2(_);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 b1(q,U)}var UJ=Array.prototype.find;function GJ(_){return function(){return UJ.call(this.children,_)}}function ZJ(){return this.firstElementChild}function i4(_){return this.select(_==null?ZJ:GJ(typeof _==="function"?_:p5(_)))}var FJ=Array.prototype.filter;function HJ(){return Array.from(this.children)}function KJ(_){return function(){return FJ.call(this.children,_)}}function d4(_){return this.selectAll(_==null?HJ:KJ(typeof _==="function"?_:p5(_)))}function a4(_){if(typeof _!=="function")_=y2(_);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 b1(q,this._parents)}function Q5(_){return Array(_.length)}function s4(){return new b1(this._enter||this._groups.map(Q5),this._parents)}function J5(_,Q){this.ownerDocument=_.ownerDocument,this.namespaceURI=_.namespaceURI,this._next=null,this._parent=_,this.__data__=Q}J5.prototype={constructor:J5,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 t4(_){return function(){return _}}function XJ(_,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 J5(_,G[Z]);for(;Z<X;++Z)if(F=Q[Z])U[Z]=F}function YJ(_,Q,J,q,U,G,Z){var F,X,Y=new Map,K=Q.length,H=G.length,L=Array(K),W;for(F=0;F<K;++F)if(X=Q[F])if(L[F]=W=Z.call(X,X.__data__,F,Q)+"",Y.has(W))U[F]=X;else Y.set(W,X);for(F=0;F<H;++F)if(W=Z.call(_,G[F],F,G)+"",X=Y.get(W))q[F]=X,X.__data__=G[F],Y.delete(W);else J[F]=new J5(_,G[F]);for(F=0;F<K;++F)if((X=Q[F])&&Y.get(L[F])===X)U[F]=X}function LJ(_){return _.__data__}function o4(_,Q){if(!arguments.length)return Array.from(this,LJ);var J=Q?YJ:XJ,q=this._parents,U=this._groups;if(typeof _!=="function")_=t4(_);for(var G=U.length,Z=Array(G),F=Array(G),X=Array(G),Y=0;Y<G;++Y){var K=q[Y],H=U[Y],L=H.length,W=zJ(_.call(K,K&&K.__data__,Y,q)),B=W.length,O=F[Y]=Array(B),T=Z[Y]=Array(B),M=X[Y]=Array(L);J(K,H,O,T,M,W,Q);for(var P=0,A=0,R,f;P<B;++P)if(R=O[P]){if(P>=A)A=P+1;while(!(f=T[A])&&++A<B);R._next=f||null}}return Z=new b1(Z,q),Z._enter=F,Z._exit=X,Z}function zJ(_){return typeof _==="object"&&"length"in _?_:Array.from(_)}function n4(){return new b1(this._exit||this._groups.map(Q5),this._parents)}function e4(_,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 _3(_){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],K=q[X],H=Y.length,L=F[X]=Array(H),W,B=0;B<H;++B)if(W=Y[B]||K[B])L[B]=W;for(;X<U;++X)F[X]=J[X];return new b1(F,this._parents)}function Q3(){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 J3(_){if(!_)_=WJ;function Q(H,L){return H&&L?_(H.__data__,L.__data__):!H-!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,K=0;K<F;++K)if(Y=Z[K])X[K]=Y;X.sort(Q)}return new b1(U,this._parents).order()}function WJ(_,Q){return _<Q?-1:_>Q?1:_>=Q?0:NaN}function $3(){var _=arguments[0];return arguments[0]=this,_.apply(null,arguments),this}function q3(){return Array.from(this)}function U3(){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 G3(){let _=0;for(let Q of this)++_;return _}function Z3(){return!this.node()}function F3(_){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 BJ(_){return function(){this.removeAttribute(_)}}function AJ(_){return function(){this.removeAttributeNS(_.space,_.local)}}function MJ(_,Q){return function(){this.setAttribute(_,Q)}}function TJ(_,Q){return function(){this.setAttributeNS(_.space,_.local,Q)}}function RJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttribute(_);else this.setAttribute(_,J)}}function OJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)this.removeAttributeNS(_.space,_.local);else this.setAttributeNS(_.space,_.local,J)}}function H3(_,Q){var J=I0(_);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?AJ:BJ:typeof Q==="function"?J.local?OJ:RJ:J.local?TJ:MJ)(J,Q))}function $5(_){return _.ownerDocument&&_.ownerDocument.defaultView||_.document&&_||_.defaultView}function IJ(_){return function(){this.style.removeProperty(_)}}function fJ(_,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 K3(_,Q,J){return arguments.length>1?this.each((Q==null?IJ:typeof Q==="function"?wJ:fJ)(_,Q,J==null?"":J)):d0(this.node(),_)}function d0(_,Q){return _.style.getPropertyValue(Q)||$5(_).getComputedStyle(_,null).getPropertyValue(Q)}function PJ(_){return function(){delete this[_]}}function NJ(_,Q){return function(){this[_]=Q}}function CJ(_,Q){return function(){var J=Q.apply(this,arguments);if(J==null)delete this[_];else this[_]=J}}function X3(_,Q){return arguments.length>1?this.each((Q==null?PJ:typeof Q==="function"?CJ:NJ)(_,Q)):this.node()[_]}function A8(_){return _.trim().split(/^|\s+/)}function Y3(_){return _.classList||new M8(_)}function M8(_){this._node=_,this._names=A8(_.getAttribute("class")||"")}M8.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 T8(_,Q){var J=Y3(_),q=-1,U=Q.length;while(++q<U)J.add(Q[q])}function R8(_,Q){var J=Y3(_),q=-1,U=Q.length;while(++q<U)J.remove(Q[q])}function SJ(_){return function(){T8(this,_)}}function vJ(_){return function(){R8(this,_)}}function kJ(_,Q){return function(){(Q.apply(this,arguments)?T8:R8)(this,_)}}function L3(_,Q){var J=A8(_+"");if(arguments.length<2){var q=Y3(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"?kJ:Q?SJ:vJ)(J,Q))}function yJ(){this.textContent=""}function jJ(_){return function(){this.textContent=_}}function VJ(_){return function(){var Q=_.apply(this,arguments);this.textContent=Q==null?"":Q}}function z3(_){return arguments.length?this.each(_==null?yJ:(typeof _==="function"?VJ:jJ)(_)):this.node().textContent}function uJ(){this.innerHTML=""}function bJ(_){return function(){this.innerHTML=_}}function hJ(_){return function(){var Q=_.apply(this,arguments);this.innerHTML=Q==null?"":Q}}function W3(_){return arguments.length?this.each(_==null?uJ:(typeof _==="function"?hJ:bJ)(_)):this.node().innerHTML}function DJ(){if(this.nextSibling)this.parentNode.appendChild(this)}function B3(){return this.each(DJ)}function EJ(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function A3(){return this.each(EJ)}function xJ(_){return function(){var Q=this.ownerDocument,J=this.namespaceURI;return J===c5&&Q.documentElement.namespaceURI===c5?Q.createElement(_):Q.createElementNS(J,_)}}function mJ(_){return function(){return this.ownerDocument.createElementNS(_.space,_.local)}}function q5(_){var Q=I0(_);return(Q.local?mJ:xJ)(Q)}function M3(_){var Q=typeof _==="function"?_:q5(_);return this.select(function(){return this.appendChild(Q.apply(this,arguments))})}function gJ(){return null}function T3(_,Q){var J=typeof _==="function"?_:q5(_),q=Q==null?gJ:typeof Q==="function"?Q:i0(Q);return this.select(function(){return this.insertBefore(J.apply(this,arguments),q.apply(this,arguments)||null)})}function pJ(){var _=this.parentNode;if(_)_.removeChild(this)}function R3(){return this.each(pJ)}function cJ(){var _=this.cloneNode(!1),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function lJ(){var _=this.cloneNode(!0),Q=this.parentNode;return Q?Q.insertBefore(_,this.nextSibling):_}function O3(_){return this.select(_?lJ:cJ)}function I3(_){return arguments.length?this.property("__data__",_):this.node().__data__}function rJ(_){return function(Q){_.call(this,Q,this.__data__)}}function iJ(_){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 dJ(_){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 aJ(_,Q,J){return function(){var q=this.__on,U,G=rJ(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 f3(_,Q,J){var q=iJ(_+""),U,G=q.length,Z;if(arguments.length<2){var F=this.node().__on;if(F){for(var X=0,Y=F.length,K;X<Y;++X)for(U=0,K=F[X];U<G;++U)if((Z=q[U]).type===K.type&&Z.name===K.name)return K.value}return}F=Q?aJ:dJ;for(U=0;U<G;++U)this.each(F(q[U],Q,J));return this}function O8(_,Q,J){var q=$5(_),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 sJ(_,Q){return function(){return O8(this,_,Q)}}function tJ(_,Q){return function(){return O8(this,_,Q.apply(this,arguments))}}function w3(_,Q){return this.each((typeof Q==="function"?tJ:sJ)(_,Q))}function*P3(){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 N3=[null];function b1(_,Q){this._groups=_,this._parents=Q}function I8(){return new b1([[document.documentElement]],N3)}function oJ(){return this}b1.prototype=I8.prototype={constructor:b1,select:c4,selectAll:r4,selectChild:i4,selectChildren:d4,filter:a4,data:o4,enter:s4,exit:n4,join:e4,merge:_3,selection:oJ,order:Q3,sort:J3,call:$3,nodes:q3,node:U3,size:G3,empty:Z3,each:F3,attr:H3,style:K3,property:X3,classed:L3,text:z3,html:W3,raise:B3,lower:A3,append:M3,insert:T3,remove:R3,clone:O3,datum:I3,on:f3,dispatch:w3,[Symbol.iterator]:P3};var V0=I8;function m1(_){return typeof _==="string"?new b1([[document.querySelector(_)]],[document.documentElement]):new b1([[_]],N3)}var f8={passive:!1},F2={capture:!0,passive:!1};function l5(_){_.stopImmediatePropagation()}function u0(_){_.preventDefault(),_.stopImmediatePropagation()}function V2(_){var Q=_.document.documentElement,J=m1(_).on("dragstart.drag",u0,F2);if("onselectstart"in Q)J.on("selectstart.drag",u0,F2);else Q.__noselect=Q.style.MozUserSelect,Q.style.MozUserSelect="none"}function U5(_,Q){var J=_.document.documentElement,q=m1(_).on("dragstart.drag",null);if(Q)q.on("click.drag",u0,F2),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 G5=(_)=>()=>_;function Z5(_,{sourceEvent:Q,subject:J,target:q,identifier:U,active:G,x:Z,y:F,dx:X,dy:Y,dispatch:K}){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:K}})}Z5.prototype.on=function(){var _=this._.on.apply(this._,arguments);return _===this._?this:_};function nJ(_){return!_.ctrlKey&&!_.button}function eJ(){return this.parentNode}function _$(_,Q){return Q==null?{x:_.x,y:_.y}:Q}function Q$(){return navigator.maxTouchPoints||"ontouchstart"in this}function F5(){var _=nJ,Q=eJ,J=_$,q=Q$,U={},G=Z2("start","drag","end"),Z=0,F,X,Y,K,H=0;function L(R){R.on("mousedown.drag",W).filter(q).on("touchstart.drag",T).on("touchmove.drag",M,f8).on("touchend.drag touchcancel.drag",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function W(R,f){if(K||!_.call(this,R,f))return;var C=A(this,Q.call(this,R,f),R,f,"mouse");if(!C)return;m1(R.view).on("mousemove.drag",B,F2).on("mouseup.drag",O,F2),V2(R.view),l5(R),Y=!1,F=R.clientX,X=R.clientY,C("start",R)}function B(R){if(u0(R),!Y){var f=R.clientX-F,C=R.clientY-X;Y=f*f+C*C>H}U.mouse("drag",R)}function O(R){m1(R.view).on("mousemove.drag mouseup.drag",null),U5(R.view,Y),u0(R),U.mouse("end",R)}function T(R,f){if(!_.call(this,R,f))return;var C=R.changedTouches,N=Q.call(this,R,f),S=C.length,w,j;for(w=0;w<S;++w)if(j=A(this,N,R,f,C[w].identifier,C[w]))l5(R),j("start",R,C[w])}function M(R){var f=R.changedTouches,C=f.length,N,S;for(N=0;N<C;++N)if(S=U[f[N].identifier])u0(R),S("drag",R,f[N])}function P(R){var f=R.changedTouches,C=f.length,N,S;if(K)clearTimeout(K);K=setTimeout(function(){K=null},500);for(N=0;N<C;++N)if(S=U[f[N].identifier])l5(R),S("end",R,f[N])}function A(R,f,C,N,S,w){var j=G.copy(),x=d1(w||C,f),r,m,v;if((v=J.call(R,new Z5("beforestart",{sourceEvent:C,target:L,identifier:S,active:Z,x:x[0],y:x[1],dx:0,dy:0,dispatch:j}),N))==null)return;return r=v.x-x[0]||0,m=v.y-x[1]||0,function h(V,E,u){var D=x,I;switch(V){case"start":U[S]=h,I=Z++;break;case"end":delete U[S],--Z;case"drag":x=d1(u||E,f),I=Z;break}j.call(V,R,new Z5(V,{sourceEvent:E,subject:v,target:L,identifier:S,active:I,x:x[0]+r,y:x[1]+m,dx:x[0]-D[0],dy:x[1]-D[1],dispatch:j}),N)}}return L.filter=function(R){return arguments.length?(_=typeof R==="function"?R:G5(!!R),L):_},L.container=function(R){return arguments.length?(Q=typeof R==="function"?R:G5(R),L):Q},L.subject=function(R){return arguments.length?(J=typeof R==="function"?R:G5(R),L):J},L.touchable=function(R){return arguments.length?(q=typeof R==="function"?R:G5(!!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?(H=(R=+R)*R,L):Math.sqrt(H)},L}function H5(_,Q,J){_.prototype=Q.prototype=J,J.constructor=_}function C3(_,Q){var J=Object.create(_.prototype);for(var q in Q)J[q]=Q[q];return J}function Y5(){}var K5=0.7,d5=1/K5,u2="\\s*([+-]?\\d+)\\s*",X5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",f0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",J$=/^#([0-9a-f]{3,8})$/,$$=new RegExp(`^rgb\\(${u2},${u2},${u2}\\)$`),q$=new RegExp(`^rgb\\(${f0},${f0},${f0}\\)$`),U$=new RegExp(`^rgba\\(${u2},${u2},${u2},${X5}\\)$`),G$=new RegExp(`^rgba\\(${f0},${f0},${f0},${X5}\\)$`),Z$=new RegExp(`^hsl\\(${X5},${f0},${f0}\\)$`),F$=new RegExp(`^hsla\\(${X5},${f0},${f0},${X5}\\)$`),w8={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};H5(Y5,B0,{copy(_){return Object.assign(new this.constructor,this,_)},displayable(){return this.rgb().displayable()},hex:P8,formatHex:P8,formatHex8:H$,formatHsl:K$,formatRgb:N8,toString:N8});function P8(){return this.rgb().formatHex()}function H$(){return this.rgb().formatHex8()}function K$(){return j8(this).formatHsl()}function N8(){return this.rgb().formatRgb()}function B0(_){var Q,J;return _=(_+"").trim().toLowerCase(),(Q=J$.exec(_))?(J=Q[1].length,Q=parseInt(Q[1],16),J===6?C8(Q):J===3?new $0(Q>>8&15|Q>>4&240,Q>>4&15|Q&240,(Q&15)<<4|Q&15,1):J===8?r5(Q>>24&255,Q>>16&255,Q>>8&255,(Q&255)/255):J===4?r5(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=$$.exec(_))?new $0(Q[1],Q[2],Q[3],1):(Q=q$.exec(_))?new $0(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,1):(Q=U$.exec(_))?r5(Q[1],Q[2],Q[3],Q[4]):(Q=G$.exec(_))?r5(Q[1]*255/100,Q[2]*255/100,Q[3]*255/100,Q[4]):(Q=Z$.exec(_))?k8(Q[1],Q[2]/100,Q[3]/100,1):(Q=F$.exec(_))?k8(Q[1],Q[2]/100,Q[3]/100,Q[4]):w8.hasOwnProperty(_)?C8(w8[_]):_==="transparent"?new $0(NaN,NaN,NaN,0):null}function C8(_){return new $0(_>>16&255,_>>8&255,_&255,1)}function r5(_,Q,J,q){if(q<=0)_=Q=J=NaN;return new $0(_,Q,J,q)}function X$(_){if(!(_ instanceof Y5))_=B0(_);if(!_)return new $0;return _=_.rgb(),new $0(_.r,_.g,_.b,_.opacity)}function b2(_,Q,J,q){return arguments.length===1?X$(_):new $0(_,Q,J,q==null?1:q)}function $0(_,Q,J,q){this.r=+_,this.g=+Q,this.b=+J,this.opacity=+q}H5($0,b2,C3(Y5,{brighter(_){return _=_==null?d5:Math.pow(d5,_),new $0(this.r*_,this.g*_,this.b*_,this.opacity)},darker(_){return _=_==null?K5:Math.pow(K5,_),new $0(this.r*_,this.g*_,this.b*_,this.opacity)},rgb(){return this},clamp(){return new $0(K2(this.r),K2(this.g),K2(this.b),a5(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:S8,formatHex:S8,formatHex8:Y$,formatRgb:v8,toString:v8}));function S8(){return`#${H2(this.r)}${H2(this.g)}${H2(this.b)}`}function Y$(){return`#${H2(this.r)}${H2(this.g)}${H2(this.b)}${H2((isNaN(this.opacity)?1:this.opacity)*255)}`}function v8(){let _=a5(this.opacity);return`${_===1?"rgb(":"rgba("}${K2(this.r)}, ${K2(this.g)}, ${K2(this.b)}${_===1?")":`, ${_})`}`}function a5(_){return isNaN(_)?1:Math.max(0,Math.min(1,_))}function K2(_){return Math.max(0,Math.min(255,Math.round(_)||0))}function H2(_){return _=K2(_),(_<16?"0":"")+_.toString(16)}function k8(_,Q,J,q){if(q<=0)_=Q=J=NaN;else if(J<=0||J>=1)_=Q=NaN;else if(Q<=0)_=NaN;return new W0(_,Q,J,q)}function j8(_){if(_ instanceof W0)return new W0(_.h,_.s,_.l,_.opacity);if(!(_ instanceof Y5))_=B0(_);if(!_)return new W0;if(_ instanceof W0)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 W0(Z,F,X,_.opacity)}function V8(_,Q,J,q){return arguments.length===1?j8(_):new W0(_,Q,J,q==null?1:q)}function W0(_,Q,J,q){this.h=+_,this.s=+Q,this.l=+J,this.opacity=+q}H5(W0,V8,C3(Y5,{brighter(_){return _=_==null?d5:Math.pow(d5,_),new W0(this.h,this.s,this.l*_,this.opacity)},darker(_){return _=_==null?K5:Math.pow(K5,_),new W0(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 $0(S3(_>=240?_-240:_+120,U,q),S3(_,U,q),S3(_<120?_+240:_-120,U,q),this.opacity)},clamp(){return new W0(y8(this.h),i5(this.s),i5(this.l),a5(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 _=a5(this.opacity);return`${_===1?"hsl(":"hsla("}${y8(this.h)}, ${i5(this.s)*100}%, ${i5(this.l)*100}%${_===1?")":`, ${_})`}`}}));function y8(_){return _=(_||0)%360,_<0?_+360:_}function i5(_){return Math.max(0,Math.min(1,_||0))}function S3(_,Q,J){return(_<60?Q+(J-Q)*_/60:_<180?J:_<240?Q+(J-Q)*(240-_)/60:Q)*255}function v3(_,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 k3(_){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 v3((J-q/Q)*Q,Z,U,G,F)}}function y3(_){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 v3((J-q/Q)*Q,U,G,Z,F)}}var L5=(_)=>()=>_;function L$(_,Q){return function(J){return _+J*Q}}function z$(_,Q,J){return _=Math.pow(_,J),Q=Math.pow(Q,J)-_,J=1/J,function(q){return Math.pow(_+q*Q,J)}}function u8(_){return(_=+_)===1?s5:function(Q,J){return J-Q?z$(Q,J,_):L5(isNaN(Q)?J:Q)}}function s5(_,Q){var J=Q-_;return J?L$(_,J):L5(isNaN(_)?Q:_)}var X2=function _(Q){var J=u8(Q);function q(U,G){var Z=J((U=b2(U)).r,(G=b2(G)).r),F=J(U.g,G.g),X=J(U.b,G.b),Y=s5(U.opacity,G.opacity);return function(K){return U.r=Z(K),U.g=F(K),U.b=X(K),U.opacity=Y(K),U+""}}return q.gamma=_,q}(1);function b8(_){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=b2(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 W$=b8(k3),B$=b8(y3);function j3(_,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 h8(_){return ArrayBuffer.isView(_)&&!(_ instanceof DataView)}function D8(_,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]=w0(_[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 V3(_,Q){var J=new Date;return _=+_,Q=+Q,function(q){return J.setTime(_*(1-q)+Q*q),J}}function a1(_,Q){return _=+_,Q=+Q,function(J){return _*(1-J)+Q*J}}function u3(_,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]=w0(_[U],Q[U]);else q[U]=Q[U];return function(G){for(U in J)q[U]=J[U](G);return q}}var h3=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,b3=new RegExp(h3.source,"g");function A$(_){return function(){return _}}function M$(_){return function(Q){return _(Q)+""}}function h2(_,Q){var J=h3.lastIndex=b3.lastIndex=0,q,U,G,Z=-1,F=[],X=[];_=_+"",Q=Q+"";while((q=h3.exec(_))&&(U=b3.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:a1(q,U)});J=b3.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]?M$(X[0].x):A$(Q):(Q=X.length,function(Y){for(var K=0,H;K<Q;++K)F[(H=X[K]).i]=H.x(Y);return F.join("")})}function w0(_,Q){var J=typeof Q,q;return Q==null||J==="boolean"?L5(Q):(J==="number"?a1:J==="string"?(q=B0(Q))?(Q=q,X2):h2:Q instanceof B0?X2:Q instanceof Date?V3:h8(Q)?j3:Array.isArray(Q)?D8:typeof Q.valueOf!=="function"&&typeof Q.toString!=="function"||isNaN(Q)?u3:a1)(_,Q)}var E8=180/Math.PI,t5={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function o5(_,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,_)*E8,skewX:Math.atan(X)*E8,scaleX:Z,scaleY:F}}var n5;function x8(_){let Q=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(_+"");return Q.isIdentity?t5:o5(Q.a,Q.b,Q.c,Q.d,Q.e,Q.f)}function m8(_){if(_==null)return t5;if(!n5)n5=document.createElementNS("http://www.w3.org/2000/svg","g");if(n5.setAttribute("transform",_),!(_=n5.transform.baseVal.consolidate()))return t5;return _=_.matrix,o5(_.a,_.b,_.c,_.d,_.e,_.f)}function g8(_,Q,J,q){function U(Y){return Y.length?Y.pop()+" ":""}function G(Y,K,H,L,W,B){if(Y!==H||K!==L){var O=W.push("translate(",null,Q,null,J);B.push({i:O-4,x:a1(Y,H)},{i:O-2,x:a1(K,L)})}else if(H||L)W.push("translate("+H+Q+L+J)}function Z(Y,K,H,L){if(Y!==K){if(Y-K>180)K+=360;else if(K-Y>180)Y+=360;L.push({i:H.push(U(H)+"rotate(",null,q)-2,x:a1(Y,K)})}else if(K)H.push(U(H)+"rotate("+K+q)}function F(Y,K,H,L){if(Y!==K)L.push({i:H.push(U(H)+"skewX(",null,q)-2,x:a1(Y,K)});else if(K)H.push(U(H)+"skewX("+K+q)}function X(Y,K,H,L,W,B){if(Y!==H||K!==L){var O=W.push(U(W)+"scale(",null,",",null,")");B.push({i:O-4,x:a1(Y,H)},{i:O-2,x:a1(K,L)})}else if(H!==1||L!==1)W.push(U(W)+"scale("+H+","+L+")")}return function(Y,K){var H=[],L=[];return Y=_(Y),K=_(K),G(Y.translateX,Y.translateY,K.translateX,K.translateY,H,L),Z(Y.rotate,K.rotate,H,L),F(Y.skewX,K.skewX,H,L),X(Y.scaleX,Y.scaleY,K.scaleX,K.scaleY,H,L),Y=K=null,function(W){var B=-1,O=L.length,T;while(++B<O)H[(T=L[B]).i]=T.x(W);return H.join("")}}}var D3=g8(x8,"px, ","px)","deg)"),E3=g8(m8,", ",")",")");var T$=0.000000000001;function p8(_){return((_=Math.exp(_))+1/_)/2}function R$(_){return((_=Math.exp(_))-1/_)/2}function O$(_){return((_=Math.exp(2*_))-1)/(_+1)}var Y2=function _(Q,J,q){function U(G,Z){var F=G[0],X=G[1],Y=G[2],K=Z[0],H=Z[1],L=Z[2],W=K-F,B=H-X,O=W*W+B*B,T,M;if(O<T$)M=Math.log(L/Y)/Q,T=function(N){return[F+N*W,X+N*B,Y*Math.exp(Q*N*M)]};else{var P=Math.sqrt(O),A=(L*L-Y*Y+q*O)/(2*Y*J*P),R=(L*L-Y*Y-q*O)/(2*L*J*P),f=Math.log(Math.sqrt(A*A+1)-A),C=Math.log(Math.sqrt(R*R+1)-R);M=(C-f)/Q,T=function(N){var S=N*M,w=p8(f),j=Y/(J*P)*(w*O$(Q*S+f)-R$(f));return[F+j*W,X+j*B,Y*w/p8(Q*S+f)]}}return T.duration=M*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 D2=0,W5=0,z5=0,l8=1000,e5,B5,_4=0,L2=0,Q4=0,A5=typeof performance==="object"&&performance.now?performance:Date,r8=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(_){setTimeout(_,17)};function T5(){return L2||(r8(I$),L2=A5.now()+Q4)}function I$(){L2=0}function M5(){this._call=this._time=this._next=null}M5.prototype=J4.prototype={constructor:M5,restart:function(_,Q,J){if(typeof _!=="function")throw TypeError("callback is not a function");if(J=(J==null?T5():+J)+(Q==null?0:+Q),!this._next&&B5!==this){if(B5)B5._next=this;else e5=this;B5=this}this._call=_,this._time=J,x3()},stop:function(){if(this._call)this._call=null,this._time=1/0,x3()}};function J4(_,Q,J){var q=new M5;return q.restart(_,Q,J),q}function i8(){T5(),++D2;var _=e5,Q;while(_){if((Q=L2-_._time)>=0)_._call.call(void 0,Q);_=_._next}--D2}function c8(){L2=(_4=A5.now())+Q4,D2=W5=0;try{i8()}finally{D2=0,w$(),L2=0}}function f$(){var _=A5.now(),Q=_-_4;if(Q>l8)Q4-=Q,_4=_}function w$(){var _,Q=e5,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:e5=J;B5=_,x3(q)}function x3(_){if(D2)return;if(W5)W5=clearTimeout(W5);var Q=_-L2;if(Q>24){if(_<1/0)W5=setTimeout(c8,_-A5.now()-Q4);if(z5)z5=clearInterval(z5)}else{if(!z5)_4=A5.now(),z5=setInterval(f$,l8);D2=1,r8(c8)}}function R5(_,Q,J){var q=new M5;return Q=Q==null?0:+Q,q.restart((U)=>{q.stop(),_(U+Q)},Q,J),q}var P$=Z2("start","end","cancel","interrupt"),N$=[],s8=0,d8=1,q4=2,$4=3,a8=4,U4=5,O5=6;function b0(_,Q,J,q,U,G){var Z=_.__transition;if(!Z)_.__transition={};else if(J in Z)return;C$(_,J,{name:Q,index:q,group:U,on:P$,tween:N$,time:G.time,delay:G.delay,duration:G.duration,ease:G.ease,timer:null,state:s8})}function I5(_,Q){var J=g1(_,Q);if(J.state>s8)throw Error("too late; already scheduled");return J}function i1(_,Q){var J=g1(_,Q);if(J.state>$4)throw Error("too late; already running");return J}function g1(_,Q){var J=_.__transition;if(!J||!(J=J[Q]))throw Error("transition not found");return J}function C$(_,Q,J){var q=_.__transition,U;q[Q]=J,J.timer=J4(G,0,J.time);function G(Y){if(J.state=d8,J.timer.restart(Z,J.delay,J.time),J.delay<=Y)Z(Y-J.delay)}function Z(Y){var K,H,L,W;if(J.state!==d8)return X();for(K in q){if(W=q[K],W.name!==J.name)continue;if(W.state===$4)return R5(Z);if(W.state===a8)W.state=O5,W.timer.stop(),W.on.call("interrupt",_,_.__data__,W.index,W.group),delete q[K];else if(+K<Q)W.state=O5,W.timer.stop(),W.on.call("cancel",_,_.__data__,W.index,W.group),delete q[K]}if(R5(function(){if(J.state===$4)J.state=a8,J.timer.restart(F,J.delay,J.time),F(Y)}),J.state=q4,J.on.call("start",_,_.__data__,J.index,J.group),J.state!==q4)return;J.state=$4,U=Array(L=J.tween.length);for(K=0,H=-1;K<L;++K)if(W=J.tween[K].value.call(_,_.__data__,J.index,J.group))U[++H]=W;U.length=H+1}function F(Y){var K=Y<J.duration?J.ease.call(null,Y/J.duration):(J.timer.restart(X),J.state=U4,1),H=-1,L=U.length;while(++H<L)U[H].call(_,K);if(J.state===U4)J.on.call("end",_,_.__data__,J.index,J.group),X()}function X(){J.state=O5,J.timer.stop(),delete q[Q];for(var Y in q)return;delete _.__transition}}function a0(_,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>q4&&q.state<U4,q.state=O5,q.timer.stop(),q.on.call(U?"interrupt":"cancel",_,_.__data__,q.index,q.group),delete J[Z]}if(G)delete _.__transition}function m3(_){return this.each(function(){a0(this,_)})}function S$(_,Q){var J,q;return function(){var U=i1(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 v$(_,Q,J){var q,U;if(typeof J!=="function")throw Error();return function(){var G=i1(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 g3(_,Q){var J=this._id;if(_+="",arguments.length<2){var q=g1(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?S$:v$)(J,_,Q))}function E2(_,Q,J){var q=_._id;return _.each(function(){var U=i1(this,q);(U.value||(U.value={}))[Q]=J.apply(this,arguments)}),function(U){return g1(U,q).value[Q]}}function f5(_,Q){var J;return(typeof Q==="number"?a1:Q instanceof B0?X2:(J=B0(Q))?(Q=J,X2):h2)(_,Q)}function k$(_){return function(){this.removeAttribute(_)}}function y$(_){return function(){this.removeAttributeNS(_.space,_.local)}}function j$(_,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 V$(_,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 u$(_,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 b$(_,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 p3(_,Q){var J=I0(_),q=J==="transform"?E3:f5;return this.attrTween(_,typeof Q==="function"?(J.local?b$:u$)(J,q,E2(this,"attr."+_,Q)):Q==null?(J.local?y$:k$)(J):(J.local?V$:j$)(J,q,Q))}function h$(_,Q){return function(J){this.setAttribute(_,Q.call(this,J))}}function D$(_,Q){return function(J){this.setAttributeNS(_.space,_.local,Q.call(this,J))}}function E$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&D$(_,G);return J}return U._value=Q,U}function x$(_,Q){var J,q;function U(){var G=Q.apply(this,arguments);if(G!==q)J=(q=G)&&h$(_,G);return J}return U._value=Q,U}function c3(_,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=I0(_);return this.tween(J,(q.local?E$:x$)(q,Q))}function m$(_,Q){return function(){I5(this,_).delay=+Q.apply(this,arguments)}}function g$(_,Q){return Q=+Q,function(){I5(this,_).delay=Q}}function l3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?m$:g$)(Q,_)):g1(this.node(),Q).delay}function p$(_,Q){return function(){i1(this,_).duration=+Q.apply(this,arguments)}}function c$(_,Q){return Q=+Q,function(){i1(this,_).duration=Q}}function r3(_){var Q=this._id;return arguments.length?this.each((typeof _==="function"?p$:c$)(Q,_)):g1(this.node(),Q).duration}function l$(_,Q){if(typeof Q!=="function")throw Error();return function(){i1(this,_).ease=Q}}function i3(_){var Q=this._id;return arguments.length?this.each(l$(Q,_)):g1(this.node(),Q).ease}function r$(_,Q){return function(){var J=Q.apply(this,arguments);if(typeof J!=="function")throw Error();i1(this,_).ease=J}}function d3(_){if(typeof _!=="function")throw Error();return this.each(r$(this._id,_))}function a3(_){if(typeof _!=="function")_=y2(_);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 e1(q,this._parents,this._name,this._id)}function s3(_){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],K=X.length,H=Z[F]=Array(K),L,W=0;W<K;++W)if(L=X[W]||Y[W])H[W]=L;for(;F<q;++F)Z[F]=Q[F];return new e1(Z,this._parents,this._name,this._id)}function i$(_){return(_+"").trim().split(/^|\s+/).every(function(Q){var J=Q.indexOf(".");if(J>=0)Q=Q.slice(0,J);return!Q||Q==="start"})}function d$(_,Q,J){var q,U,G=i$(Q)?I5:i1;return function(){var Z=G(this,_),F=Z.on;if(F!==q)(U=(q=F).copy()).on(Q,J);Z.on=U}}function t3(_,Q){var J=this._id;return arguments.length<2?g1(this.node(),J).on.on(_):this.each(d$(J,_,Q))}function a$(_){return function(){var Q=this.parentNode;for(var J in this.__transition)if(+J!==_)return;if(Q)Q.removeChild(this)}}function o3(){return this.on("end.remove",a$(this._id))}function n3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=i0(_);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),K,H,L=0;L<X;++L)if((K=F[L])&&(H=_.call(K,K.__data__,L,F))){if("__data__"in K)H.__data__=K.__data__;Y[L]=H,b0(Y[L],Q,J,L,Y,g1(K,J))}return new e1(G,this._parents,Q,J)}function e3(_){var Q=this._name,J=this._id;if(typeof _!=="function")_=j2(_);for(var q=this._groups,U=q.length,G=[],Z=[],F=0;F<U;++F)for(var X=q[F],Y=X.length,K,H=0;H<Y;++H)if(K=X[H]){for(var L=_.call(K,K.__data__,H,X),W,B=g1(K,J),O=0,T=L.length;O<T;++O)if(W=L[O])b0(W,Q,J,O,L,B);G.push(L),Z.push(K)}return new e1(G,Z,Q,J)}var s$=V0.prototype.constructor;function _6(){return new s$(this._groups,this._parents)}function t$(_,Q){var J,q,U;return function(){var G=d0(this,_),Z=(this.style.removeProperty(_),d0(this,_));return G===Z?null:G===J&&Z===q?U:U=Q(J=G,q=Z)}}function t8(_){return function(){this.style.removeProperty(_)}}function o$(_,Q,J){var q,U=J+"",G;return function(){var Z=d0(this,_);return Z===U?null:Z===q?G:G=Q(q=Z,J)}}function n$(_,Q,J){var q,U,G;return function(){var Z=d0(this,_),F=J(this),X=F+"";if(F==null)X=F=(this.style.removeProperty(_),d0(this,_));return Z===X?null:Z===q&&X===U?G:(U=X,G=Q(q=Z,F))}}function e$(_,Q){var J,q,U,G="style."+Q,Z="end."+G,F;return function(){var X=i1(this,_),Y=X.on,K=X.value[G]==null?F||(F=t8(Q)):void 0;if(Y!==J||U!==K)(q=(J=Y).copy()).on(Z,U=K);X.on=q}}function Q6(_,Q,J){var q=(_+="")==="transform"?D3:f5;return Q==null?this.styleTween(_,t$(_,q)).on("end.style."+_,t8(_)):typeof Q==="function"?this.styleTween(_,n$(_,q,E2(this,"style."+_,Q))).each(e$(this._id,_)):this.styleTween(_,o$(_,q,Q),J).on("end.style."+_,null)}function _q(_,Q,J){return function(q){this.style.setProperty(_,Q.call(this,q),J)}}function Qq(_,Q,J){var q,U;function G(){var Z=Q.apply(this,arguments);if(Z!==U)q=(U=Z)&&_q(_,Z,J);return q}return G._value=Q,G}function J6(_,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,Qq(_,Q,J==null?"":J))}function Jq(_){return function(){this.textContent=_}}function $q(_){return function(){var Q=_(this);this.textContent=Q==null?"":Q}}function $6(_){return this.tween("text",typeof _==="function"?$q(E2(this,"text",_)):Jq(_==null?"":_+""))}function qq(_){return function(Q){this.textContent=_.call(this,Q)}}function Uq(_){var Q,J;function q(){var U=_.apply(this,arguments);if(U!==J)Q=(J=U)&&qq(U);return Q}return q._value=_,q}function q6(_){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,Uq(_))}function U6(){var _=this._name,Q=this._id,J=G4();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 K=g1(X,Q);b0(X,_,J,Y,Z,{time:K.time+K.delay+K.duration,delay:0,duration:K.duration,ease:K.ease})}return new e1(q,this._parents,_,J)}function G6(){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=i1(this,q),K=Y.on;if(K!==_)Q=(_=K).copy(),Q._.cancel.push(F),Q._.interrupt.push(F),Q._.end.push(X);Y.on=Q}),U===0)G()})}var Gq=0;function e1(_,Q,J,q){this._groups=_,this._parents=Q,this._name=J,this._id=q}function o8(_){return V0().transition(_)}function G4(){return++Gq}var h0=V0.prototype;e1.prototype=o8.prototype={constructor:e1,select:n3,selectAll:e3,selectChild:h0.selectChild,selectChildren:h0.selectChildren,filter:a3,merge:s3,selection:_6,transition:U6,call:h0.call,nodes:h0.nodes,node:h0.node,size:h0.size,empty:h0.empty,each:h0.each,on:t3,attr:p3,attrTween:c3,style:Q6,styleTween:J6,text:$6,textTween:q6,remove:o3,tween:g3,delay:l3,duration:r3,ease:i3,easeVarying:d3,end:G6,[Symbol.iterator]:h0[Symbol.iterator]};function Z4(_){return((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2}var Zq={time:null,delay:0,duration:250,ease:Z4};function Fq(_,Q){var J;while(!(J=_.__transition)||!(J=J[Q]))if(!(_=_.parentNode))throw Error(`transition ${Q} not found`);return J}function Z6(_){var Q,J;if(_ instanceof e1)Q=_._id,_=_._name;else Q=G4(),(J=Zq).time=T5(),_=_==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])b0(X,_,Q,Y,Z,J||Fq(X,Q));return new e1(q,this._parents,_,Q)}V0.prototype.interrupt=m3;V0.prototype.transition=Z6;var w5=(_)=>()=>_;function F6(_,{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 A0(_,Q,J){this.k=_,this.x=Q,this.y=J}A0.prototype={constructor:A0,scale:function(_){return _===1?this:new A0(this.k*_,this.x,this.y)},translate:function(_,Q){return _===0&Q===0?this:new A0(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 z2=new A0(1,0,0);P5.prototype=A0.prototype;function P5(_){while(!_.__zoom)if(!(_=_.parentNode))return z2;return _.__zoom}function F4(_){_.stopImmediatePropagation()}function W2(_){_.preventDefault(),_.stopImmediatePropagation()}function Hq(_){return(!_.ctrlKey||_.type==="wheel")&&!_.button}function Kq(){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 n8(){return this.__zoom||z2}function Xq(_){return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*(_.ctrlKey?10:1)}function Yq(){return navigator.maxTouchPoints||"ontouchstart"in this}function Lq(_,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 N5(){var _=Hq,Q=Kq,J=Lq,q=Xq,U=Yq,G=[0,1/0],Z=[[-1/0,-1/0],[1/0,1/0]],F=250,X=Y2,Y=Z2("start","zoom","end"),K,H,L,W=500,B=150,O=0,T=10;function M(v){v.property("__zoom",n8).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",w).on("dblclick.zoom",j).filter(U).on("touchstart.zoom",x).on("touchmove.zoom",r).on("touchend.zoom touchcancel.zoom",m).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}M.transform=function(v,h,V,E){var u=v.selection?v.selection():v;if(u.property("__zoom",n8),v!==u)f(v,h,V,E);else u.interrupt().each(function(){C(this,arguments).event(E).start().zoom(null,typeof h==="function"?h.apply(this,arguments):h).end()})},M.scaleBy=function(v,h,V,E){M.scaleTo(v,function(){var u=this.__zoom.k,D=typeof h==="function"?h.apply(this,arguments):h;return u*D},V,E)},M.scaleTo=function(v,h,V,E){M.transform(v,function(){var u=Q.apply(this,arguments),D=this.__zoom,I=V==null?R(u):typeof V==="function"?V.apply(this,arguments):V,k=D.invert(I),p=typeof h==="function"?h.apply(this,arguments):h;return J(A(P(D,p),I,k),u,Z)},V,E)},M.translateBy=function(v,h,V,E){M.transform(v,function(){return J(this.__zoom.translate(typeof h==="function"?h.apply(this,arguments):h,typeof V==="function"?V.apply(this,arguments):V),Q.apply(this,arguments),Z)},null,E)},M.translateTo=function(v,h,V,E,u){M.transform(v,function(){var D=Q.apply(this,arguments),I=this.__zoom,k=E==null?R(D):typeof E==="function"?E.apply(this,arguments):E;return J(z2.translate(k[0],k[1]).scale(I.k).translate(typeof h==="function"?-h.apply(this,arguments):-h,typeof V==="function"?-V.apply(this,arguments):-V),D,Z)},E,u)};function P(v,h){return h=Math.max(G[0],Math.min(G[1],h)),h===v.k?v:new A0(h,v.x,v.y)}function A(v,h,V){var E=h[0]-V[0]*v.k,u=h[1]-V[1]*v.k;return E===v.x&&u===v.y?v:new A0(v.k,E,u)}function R(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function f(v,h,V,E){v.on("start.zoom",function(){C(this,arguments).event(E).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(E).end()}).tween("zoom",function(){var u=this,D=arguments,I=C(u,D).event(E),k=Q.apply(u,D),p=V==null?R(k):typeof V==="function"?V.apply(u,D):V,b=Math.max(k[1][0]-k[0][0],k[1][1]-k[0][1]),e=u.__zoom,t=typeof h==="function"?h.apply(u,D):h,o=X(e.invert(p).concat(b/e.k),t.invert(p).concat(b/t.k));return function(s){if(s===1)s=t;else{var g=o(s),J1=b/g[2];s=new A0(J1,p[0]-g[0]*J1,p[1]-g[1]*J1)}I.zoom(null,s)}})}function C(v,h,V){return!V&&v.__zooming||new N(v,h)}function N(v,h){this.that=v,this.args=h,this.active=0,this.sourceEvent=null,this.extent=Q.apply(v,h),this.taps=0}N.prototype={event:function(v){if(v)this.sourceEvent=v;return this},start:function(){if(++this.active===1)this.that.__zooming=this,this.emit("start");return this},zoom:function(v,h){if(this.mouse&&v!=="mouse")this.mouse[1]=h.invert(this.mouse[0]);if(this.touch0&&v!=="touch")this.touch0[1]=h.invert(this.touch0[0]);if(this.touch1&&v!=="touch")this.touch1[1]=h.invert(this.touch1[0]);return this.that.__zoom=h,this.emit("zoom"),this},end:function(){if(--this.active===0)delete this.that.__zooming,this.emit("end");return this},emit:function(v){var h=m1(this.that).datum();Y.call(v,this.that,new F6(v,{sourceEvent:this.sourceEvent,target:M,type:v,transform:this.that.__zoom,dispatch:Y}),h)}};function S(v,...h){if(!_.apply(this,arguments))return;var V=C(this,h).event(v),E=this.__zoom,u=Math.max(G[0],Math.min(G[1],E.k*Math.pow(2,q.apply(this,arguments)))),D=d1(v);if(V.wheel){if(V.mouse[0][0]!==D[0]||V.mouse[0][1]!==D[1])V.mouse[1]=E.invert(V.mouse[0]=D);clearTimeout(V.wheel)}else if(E.k===u)return;else V.mouse=[D,E.invert(D)],a0(this),V.start();W2(v),V.wheel=setTimeout(I,B),V.zoom("mouse",J(A(P(E,u),V.mouse[0],V.mouse[1]),V.extent,Z));function I(){V.wheel=null,V.end()}}function w(v,...h){if(L||!_.apply(this,arguments))return;var V=v.currentTarget,E=C(this,h,!0).event(v),u=m1(v.view).on("mousemove.zoom",p,!0).on("mouseup.zoom",b,!0),D=d1(v,V),I=v.clientX,k=v.clientY;V2(v.view),F4(v),E.mouse=[D,this.__zoom.invert(D)],a0(this),E.start();function p(e){if(W2(e),!E.moved){var t=e.clientX-I,o=e.clientY-k;E.moved=t*t+o*o>O}E.event(e).zoom("mouse",J(A(E.that.__zoom,E.mouse[0]=d1(e,V),E.mouse[1]),E.extent,Z))}function b(e){u.on("mousemove.zoom mouseup.zoom",null),U5(e.view,E.moved),W2(e),E.event(e).end()}}function j(v,...h){if(!_.apply(this,arguments))return;var V=this.__zoom,E=d1(v.changedTouches?v.changedTouches[0]:v,this),u=V.invert(E),D=V.k*(v.shiftKey?0.5:2),I=J(A(P(V,D),E,u),Q.apply(this,h),Z);if(W2(v),F>0)m1(this).transition().duration(F).call(f,I,E,v);else m1(this).call(M.transform,I,E,v)}function x(v,...h){if(!_.apply(this,arguments))return;var V=v.touches,E=V.length,u=C(this,h,v.changedTouches.length===E).event(v),D,I,k,p;F4(v);for(I=0;I<E;++I)if(k=V[I],p=d1(k,this),p=[p,this.__zoom.invert(p),k.identifier],!u.touch0)u.touch0=p,D=!0,u.taps=1+!!K;else if(!u.touch1&&u.touch0[2]!==p[2])u.touch1=p,u.taps=0;if(K)K=clearTimeout(K);if(D){if(u.taps<2)H=p[0],K=setTimeout(function(){K=null},W);a0(this),u.start()}}function r(v,...h){if(!this.__zooming)return;var V=C(this,h).event(v),E=v.changedTouches,u=E.length,D,I,k,p;W2(v);for(D=0;D<u;++D)if(I=E[D],k=d1(I,this),V.touch0&&V.touch0[2]===I.identifier)V.touch0[0]=k;else if(V.touch1&&V.touch1[2]===I.identifier)V.touch1[0]=k;if(I=V.that.__zoom,V.touch1){var b=V.touch0[0],e=V.touch0[1],t=V.touch1[0],o=V.touch1[1],s=(s=t[0]-b[0])*s+(s=t[1]-b[1])*s,g=(g=o[0]-e[0])*g+(g=o[1]-e[1])*g;I=P(I,Math.sqrt(s/g)),k=[(b[0]+t[0])/2,(b[1]+t[1])/2],p=[(e[0]+o[0])/2,(e[1]+o[1])/2]}else if(V.touch0)k=V.touch0[0],p=V.touch0[1];else return;V.zoom("touch",J(A(I,k,p),V.extent,Z))}function m(v,...h){if(!this.__zooming)return;var V=C(this,h).event(v),E=v.changedTouches,u=E.length,D,I;if(F4(v),L)clearTimeout(L);L=setTimeout(function(){L=null},W);for(D=0;D<u;++D)if(I=E[D],V.touch0&&V.touch0[2]===I.identifier)delete V.touch0;else if(V.touch1&&V.touch1[2]===I.identifier)delete V.touch1;if(V.touch1&&!V.touch0)V.touch0=V.touch1,delete V.touch1;if(V.touch0)V.touch0[1]=this.__zoom.invert(V.touch0[0]);else if(V.end(),V.taps===2){if(I=d1(I,this),Math.hypot(H[0]-I[0],H[1]-I[1])<T){var k=m1(this).on("dblclick.zoom");if(k)k.apply(this,arguments)}}}return M.wheelDelta=function(v){return arguments.length?(q=typeof v==="function"?v:w5(+v),M):q},M.filter=function(v){return arguments.length?(_=typeof v==="function"?v:w5(!!v),M):_},M.touchable=function(v){return arguments.length?(U=typeof v==="function"?v:w5(!!v),M):U},M.extent=function(v){return arguments.length?(Q=typeof v==="function"?v:w5([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),M):Q},M.scaleExtent=function(v){return arguments.length?(G[0]=+v[0],G[1]=+v[1],M):[G[0],G[1]]},M.translateExtent=function(v){return arguments.length?(Z[0][0]=+v[0][0],Z[1][0]=+v[1][0],Z[0][1]=+v[0][1],Z[1][1]=+v[1][1],M):[[Z[0][0],Z[0][1]],[Z[1][0],Z[1][1]]]},M.constrain=function(v){return arguments.length?(J=v,M):J},M.duration=function(v){return arguments.length?(F=+v,M):F},M.interpolate=function(v){return arguments.length?(X=v,M):X},M.on=function(){var v=Y.on.apply(Y,arguments);return v===Y?M:v},M.clickDistance=function(v){return arguments.length?(O=(v=+v)*v,M):Math.sqrt(O)},M.tapDistance=function(v){return arguments.length?(T=+v,M):T},M}var _0={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.`},p2=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],L6=["Enter"," ","Escape"],z6={"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"},n0;(function(_){_.Strict="strict",_.Loose="loose"})(n0||(n0={}));var D0;(function(_){_.Free="free",_.Vertical="vertical",_.Horizontal="horizontal"})(D0||(D0={}));var B2;(function(_){_.Partial="partial",_.Full="full"})(B2||(B2={}));var W6={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},P0;(function(_){_.Bezier="default",_.Straight="straight",_.Step="step",_.SmoothStep="smoothstep",_.SimpleBezier="simplebezier"})(P0||(P0={}));var m2;(function(_){_.Arrow="arrow",_.ArrowClosed="arrowclosed"})(m2||(m2={}));var Z1;(function(_){_.Left="left",_.Top="top",_.Right="right",_.Bottom="bottom"})(Z1||(Z1={}));var e8={[Z1.Left]:Z1.Right,[Z1.Right]:Z1.Left,[Z1.Top]:Z1.Bottom,[Z1.Bottom]:Z1.Top},B6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("source"in _)&&("target"in _),L7=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("position"in _)&&!("source"in _)&&!("target"in _),A6=(_)=>!!_&&typeof _==="object"&&("id"in _)&&("internals"in _)&&!("source"in _)&&!("target"in _);var S5=(_,Q=[0,0])=>{let{width:J,height:q}=Y0(_),U=_.origin??Q,G=J*U[0],Z=q*U[1];return{x:_.position.x-G,y:_.position.y-Z}},M6=(_,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):!A6(G)?Q.nodeLookup.get(G.id):G;if(!F)return U;return J=!0,z4(U,X4(F,Q.nodeOrigin))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return J?W4(q):{x:0,y:0,width:0,height:0}},R2=(_,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=z4(J,X4(U)),q=!0}),q?W4(J):{x:0,y:0,width:0,height:0}},Y4=(_,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,K=Q.height/U,H=[];for(let L of _.values()){let{measured:W,selectable:B=!0,hidden:O=!1}=L;if(Z&&!B||O)continue;let T=W.width??L.width??L.initialWidth??0,M=W.height??L.height??L.initialHeight??0,{x:P,y:A}=L.internals.positionAbsolute,R=M7(F,X,Y,K,P,A,T,M),f=T*M,C=G&&R>0;if(!L.internals.handleBounds||C||R>=f||L.dragging)H.push(L)}return H},z7=(_,Q)=>{let J=new Set;return _.forEach((q)=>{J.add(q.id)}),Q.filter((q)=>J.has(q.source)||J.has(q.target))};function zq(_,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}=Y0(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 W7({nodes:_,width:Q,height:J,panZoom:q,minZoom:U,maxZoom:G},Z){if(_.size===0)return!0;let F=zq(_,Z),X=R2(F),Y=k5(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 T6({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},K=Z.origin??q,H=Z.extent||U;if(Z.extent==="parent"&&!Z.expandParent)if(!F)G?.("005",_0.error005());else{let{width:W,height:B}=Y0(F);if(W&&B)H=[[X,Y],[X+W,Y+B]]}else if(F&&T2(Z.extent))H=[[Z.extent[0][0]+X,Z.extent[0][1]+Y],[Z.extent[1][0]+X,Z.extent[1][1]+Y]];let L=T2(H)?A2(Q,H,Z.measured):Q;if(Z.measured.width===void 0||Z.measured.height===void 0)G?.("015",_0.error015());return{position:{x:L.x-X+(Z.measured.width??0)*K[0],y:L.y-Y+(Z.measured.height??0)*K[1]},positionAbsolute:L}}async function B7({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 W=G.has(L.id),B=!W&&L.parentId&&Z.find((O)=>O.id===L.parentId);if(W||B)Z.push(L)}let F=new Set(Q.map((L)=>L.id)),X=q.filter((L)=>L.deletable!==!1),K=z7(Z,X);for(let L of X)if(F.has(L.id)&&!K.find((B)=>B.id===L.id))K.push(L);if(!U)return{edges:K,nodes:Z};let H=await U({nodes:Z,edges:K});if(typeof H==="boolean")return H?{edges:K,nodes:Z}:{edges:[],nodes:[]};return H}var g2=(_,Q=0,J=1)=>Math.min(Math.max(_,Q),J),A2=(_={x:0,y:0},Q,J)=>({x:g2(_.x,Q[0][0],Q[1][0]-(J?.width??0)),y:g2(_.y,Q[0][1],Q[1][1]-(J?.height??0))});function A7(_,Q,J){let{width:q,height:U}=Y0(J),{x:G,y:Z}=J.internals.positionAbsolute;return A2(_,[[G,Z],[G+q,Z+U]],Q)}var _7=(_,Q,J)=>{if(_<Q)return g2(Math.abs(_-Q),1,Q)/Q;else if(_>J)return-g2(Math.abs(_-J),1,Q)/Q;return 0},L4=(_,Q,J=15,q=40)=>{let U=_7(_.x,q,Q.width-q)*J,G=_7(_.y,q,Q.height-q)*J;return[U,G]},z4=(_,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)}),Y6=({x:_,y:Q,width:J,height:q})=>({x:_,y:Q,x2:_+J,y2:Q+q}),W4=({x:_,y:Q,x2:J,y2:q})=>({x:_,y:Q,width:J-_,height:q-Q}),c2=(_,Q=[0,0])=>{let{x:J,y:q}=A6(_)?_.internals.positionAbsolute:S5(_,Q);return{x:J,y:q,width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}},X4=(_,Q=[0,0])=>{let{x:J,y:q}=A6(_)?_.internals.positionAbsolute:S5(_,Q);return{x:J,y:q,x2:J+(_.measured?.width??_.width??_.initialWidth??0),y2:q+(_.measured?.height??_.height??_.initialHeight??0)}},R6=(_,Q)=>W4(z4(Y6(_),Y6(Q))),M7=(_,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)},v5=(_,Q)=>M7(_.x,_.y,_.width,_.height,Q.x,Q.y,Q.width,Q.height),O6=(_)=>K0(_.width)&&K0(_.height)&&K0(_.x)&&K0(_.y),K0=(_)=>!isNaN(_)&&isFinite(_),I6=(_,Q)=>(J,q)=>{console.warn(`[${_}]: ${q} Help: ${Q}error#${J}`)},l2=(_,Q=[1,1])=>{return{x:Q[0]*Math.round(_.x/Q[0]),y:Q[1]*Math.round(_.y/Q[1])}},r2=({x:_,y:Q},[J,q,U],G=!1,Z=[1,1])=>{let F={x:(_-J)/U,y:(Q-q)/U};return G?l2(F,Z):F},M2=({x:_,y:Q},[J,q,U])=>{return{x:_*U+J,y:Q*U+q}};function x2(_,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 Wq(_,Q,J){if(typeof _==="string"||typeof _==="number"){let q=x2(_,J),U=x2(_,Q);return{top:q,right:U,bottom:q,left:U,x:U*2,y:q*2}}if(typeof _==="object"){let q=x2(_.top??_.y??0,J),U=x2(_.bottom??_.y??0,J),G=x2(_.left??_.x??0,Q),Z=x2(_.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 Bq(_,Q,J,q,U,G){let{x:Z,y:F}=M2(_,[Q,J,q]),{x:X,y:Y}=M2({x:_.x+_.width,y:_.y+_.height},[Q,J,q]),K=U-X,H=G-Y;return{left:Math.floor(Z),top:Math.floor(F),right:Math.floor(K),bottom:Math.floor(H)}}var k5=(_,Q,J,q,U,G)=>{let Z=Wq(G,Q,J),F=(Q-Z.x)/_.width,X=(J-Z.y)/_.height,Y=Math.min(F,X),K=g2(Y,q,U),H=_.x+_.width/2,L=_.y+_.height/2,W=Q/2-H*K,B=J/2-L*K,O=Bq(_,W,B,K,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:W-T.left+T.right,y:B-T.top+T.bottom,zoom:K}},i2=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function T2(_){return _!==void 0&&_!==null&&_!=="parent"}function Y0(_){return{width:_.measured?.width??_.width??_.initialWidth??0,height:_.measured?.height??_.height??_.initialHeight??0}}function f6(_){return(_.measured?.width??_.width??_.initialWidth)!==void 0&&(_.measured?.height??_.height??_.initialHeight)!==void 0}function w6(_,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 P6(_,Q){if(_.size!==Q.size)return!1;for(let J of _)if(!Q.has(J))return!1;return!0}function T7(){let _,Q;return{promise:new Promise((q,U)=>{_=q,Q=U}),resolve:_,reject:Q}}function R7(_){return{...z6,..._||{}}}function Aq(_){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 Q7=!1;function O7(_){if(Q7)return;Q7=!0;let Q=`${_.charAt(0).toUpperCase()+_.slice(1)} Flow`;setTimeout(()=>{if(!Aq(_))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 N6(_){return _===null?null:_?"valid":"invalid"}function C5(_,{snapGrid:Q=[0,0],snapToGrid:J=!1,transform:q,containerBounds:U}){let{x:G,y:Z}=X0(_),F=r2({x:G-(U?.left??0),y:Z-(U?.top??0)},q),{x:X,y:Y}=J?l2(F,Q):F;return{xSnapped:X,ySnapped:Y,...F}}var B4=(_)=>({width:_.offsetWidth,height:_.offsetHeight}),C6=(_)=>_?.getRootNode?.()||window?.document,Mq=["INPUT","SELECT","TEXTAREA"];function S6(_){let Q=_.composedPath?.()?.[0]||_.target;if(Q?.nodeType!==1)return!1;return Mq.includes(Q.nodeName)||Q.hasAttribute("contenteditable")||!!Q.closest(".nokey")}var v6=(_)=>("clientX"in _),X0=(_,Q)=>{let J=v6(_),q=J?_.clientX:_.touches?.[0].clientX,U=J?_.clientY:_.touches?.[0].clientY;return{x:q-(Q?.left??0),y:U-(Q?.top??0)}},J7=(_,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,...B4(Z)}})};function A4({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,K=Math.abs(X-_),H=Math.abs(Y-Q);return[X,Y,K,H]}function H4(_,Q){if(_>=0)return 0.5*_;return Q*25*Math.sqrt(-_)}function $7({pos:_,x1:Q,y1:J,x2:q,y2:U,c:G}){switch(_){case Z1.Left:return[Q-H4(Q-q,G),J];case Z1.Right:return[Q+H4(q-Q,G),J];case Z1.Top:return[Q,J-H4(J-U,G)];case Z1.Bottom:return[Q,J+H4(U-J,G)]}}function M4({sourceX:_,sourceY:Q,sourcePosition:J=Z1.Bottom,targetX:q,targetY:U,targetPosition:G=Z1.Top,curvature:Z=0.25}){let[F,X]=$7({pos:J,x1:_,y1:Q,x2:q,y2:U,c:Z}),[Y,K]=$7({pos:G,x1:q,y1:U,x2:_,y2:Q,c:Z}),[H,L,W,B]=A4({sourceX:_,sourceY:Q,targetX:q,targetY:U,sourceControlX:F,sourceControlY:X,targetControlX:Y,targetControlY:K});return[`M${_},${Q} C${F},${X} ${Y},${K} ${q},${U}`,H,L,W,B]}function k6({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 I7({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 f7({sourceNode:_,targetNode:Q,width:J,height:q,transform:U}){let G=z4(X4(_),X4(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 v5(Z,W4(G))>0}var Tq=({source:_,sourceHandle:Q,target:J,targetHandle:q})=>`xy-edge__${_}${Q||""}-${J}${q||""}`,Rq=(_,Q)=>{return Q.some((J)=>J.source===_.source&&J.target===_.target&&(J.sourceHandle===_.sourceHandle||!J.sourceHandle&&!_.sourceHandle)&&(J.targetHandle===_.targetHandle||!J.targetHandle&&!_.targetHandle))},w7=(_,Q,J={})=>{if(!_.source||!_.target)return J.onError?.("006",_0.error006()),Q;let q=J.getEdgeId||Tq,U;if(B6(_))U={..._};else U={..._,id:q(_)};if(Rq(U,Q))return Q;if(U.sourceHandle===null)delete U.sourceHandle;if(U.targetHandle===null)delete U.targetHandle;return Q.concat(U)};function T4({sourceX:_,sourceY:Q,targetX:J,targetY:q}){let[U,G,Z,F]=k6({sourceX:_,sourceY:Q,targetX:J,targetY:q});return[`M ${_},${Q}L ${J},${q}`,U,G,Z,F]}var q7={[Z1.Left]:{x:-1,y:0},[Z1.Right]:{x:1,y:0},[Z1.Top]:{x:0,y:-1},[Z1.Bottom]:{x:0,y:1}},Oq=({source:_,sourcePosition:Q=Z1.Bottom,target:J})=>{if(Q===Z1.Left||Q===Z1.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}},U7=(_,Q)=>Math.sqrt(Math.pow(Q.x-_.x,2)+Math.pow(Q.y-_.y,2));function Iq({source:_,sourcePosition:Q=Z1.Bottom,target:J,targetPosition:q=Z1.Top,center:U,offset:G,stepPosition:Z}){let F=q7[Q],X=q7[q],Y={x:_.x+F.x*G,y:_.y+F.y*G},K={x:J.x+X.x*G,y:J.y+X.y*G},H=Oq({source:Y,sourcePosition:Q,target:K}),L=H.x!==0?"x":"y",W=H[L],B=[],O,T,M={x:0,y:0},P={x:0,y:0},[,,A,R]=k6({sourceX:_.x,sourceY:_.y,targetX:J.x,targetY:J.y});if(F[L]*X[L]===-1){if(L==="x")O=U.x??Y.x+(K.x-Y.x)*Z,T=U.y??(Y.y+K.y)/2;else O=U.x??(Y.x+K.x)/2,T=U.y??Y.y+(K.y-Y.y)*Z;let S=[{x:O,y:Y.y},{x:O,y:K.y}],w=[{x:Y.x,y:T},{x:K.x,y:T}];if(F[L]===W)B=L==="x"?S:w;else B=L==="x"?w:S}else{let S=[{x:Y.x,y:K.y}],w=[{x:K.x,y:Y.y}];if(L==="x")B=F.x===W?w:S;else B=F.y===W?S:w;if(Q===q){let v=Math.abs(_[L]-J[L]);if(v<=G){let h=Math.min(G-1,G-v);if(F[L]===W)M[L]=(Y[L]>_[L]?-1:1)*h;else P[L]=(K[L]>J[L]?-1:1)*h}}if(Q!==q){let v=L==="x"?"y":"x",h=F[L]===X[v],V=Y[v]>K[v],E=Y[v]<K[v];if(F[L]===1&&(!h&&V||h&&E)||F[L]!==1&&(!h&&E||h&&V))B=L==="x"?S:w}let j={x:Y.x+M.x,y:Y.y+M.y},x={x:K.x+P.x,y:K.y+P.y},r=Math.max(Math.abs(j.x-B[0].x),Math.abs(x.x-B[0].x)),m=Math.max(Math.abs(j.y-B[0].y),Math.abs(x.y-B[0].y));if(r>=m)O=(j.x+x.x)/2,T=B[0].y;else O=B[0].x,T=(j.y+x.y)/2}let f={x:Y.x+M.x,y:Y.y+M.y},C={x:K.x+P.x,y:K.y+P.y};return[[_,...f.x!==B[0].x||f.y!==B[0].y?[f]:[],...B,...C.x!==B[B.length-1].x||C.y!==B[B.length-1].y?[C]:[],J],O,T,A,R]}function fq(_,Q,J,q){let U=Math.min(U7(_,Q)/2,U7(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,K=_.y<J.y?1:-1;return`L ${G+U*Y},${Z}Q ${G},${Z} ${G},${Z+U*K}`}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 y5({sourceX:_,sourceY:Q,sourcePosition:J=Z1.Bottom,targetX:q,targetY:U,targetPosition:G=Z1.Top,borderRadius:Z=5,centerX:F,centerY:X,offset:Y=20,stepPosition:K=0.5}){let[H,L,W,B,O]=Iq({source:{x:_,y:Q},sourcePosition:J,target:{x:q,y:U},targetPosition:G,center:{x:F,y:X},offset:Y,stepPosition:K}),T=`M${H[0].x} ${H[0].y}`;for(let M=1;M<H.length-1;M++)T+=fq(H[M-1],H[M],H[M+1],Z);return T+=`L${H[H.length-1].x} ${H[H.length-1].y}`,[T,L,W,B,O]}function G7(_){return _&&!!(_.internals.handleBounds||_.handles?.length)&&!!(_.measured.width||_.width||_.initialWidth)}function P7(_){let{sourceNode:Q,targetNode:J}=_;if(!G7(Q)||!G7(J))return null;let q=Q.internals.handleBounds||Z7(Q.handles),U=J.internals.handleBounds||Z7(J.handles),G=F7(q?.source??[],_.sourceHandle),Z=F7(_.connectionMode===n0.Strict?U?.target??[]:(U?.target??[]).concat(U?.source??[]),_.targetHandle);if(!G||!Z)return _.onError?.("008",_0.error008(!G?"source":"target",{id:_.id,sourceHandle:_.sourceHandle,targetHandle:_.targetHandle})),null;let F=G?.position||Z1.Bottom,X=Z?.position||Z1.Top,Y=e0(Q,G,F),K=e0(J,Z,X);return{sourceX:Y.x,sourceY:Y.y,targetX:K.x,targetY:K.y,sourcePosition:F,targetPosition:X}}function Z7(_){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 e0(_,Q,J=Z1.Left,q=!1){let U=(Q?.x??0)+_.internals.positionAbsolute.x,G=(Q?.y??0)+_.internals.positionAbsolute.y,{width:Z,height:F}=Q??Y0(_);if(q)return{x:U+Z/2,y:G+F/2};switch(Q?.position??J){case Z1.Top:return{x:U+Z/2,y:G};case Z1.Right:return{x:U+Z,y:G+F/2};case Z1.Bottom:return{x:U+Z/2,y:G+F};case Z1.Left:return{x:U,y:G+F/2}}}function F7(_,Q){if(!_)return null;return(!Q?_[0]:_.find((J)=>J.id===Q))||null}function R4(_,Q){if(!_)return"";if(typeof _==="string")return _;return`${Q?`${Q}__`:""}${Object.keys(_).sort().map((q)=>`${q}=${_[q]}`).join("&")}`}function N7(_,{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=R4(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 C7(_,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 Z1.Right:Z=[(_.x+_.width)*Q.zoom+Q.x+q,(_.y+_.height*G)*Q.zoom+Q.y],F=[0,-100*G];break;case Z1.Bottom:Z[1]=(_.y+_.height)*Q.zoom+Q.y+q,F[1]=0;break;case Z1.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 S7=1000,wq=10,y6={nodeOrigin:[0,0],nodeExtent:p2,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Pq={...y6,checkEquality:!0};function j6(_,Q){let J={..._};for(let q in Q)if(Q[q]!==void 0)J[q]=Q[q];return J}function v7(_,Q,J){let q=j6(y6,J);for(let U of _.values())if(U.parentId)u6(U,_,Q,q);else{let G=S5(U,q.nodeOrigin),Z=T2(U.extent)?U.extent:q.nodeExtent,F=A2(G,Z,Y0(U));U.internals.positionAbsolute=F}}function Nq(_,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 V6(_){return _==="manual"}function O4(_,Q,J,q={}){let U=j6(Pq,q),G={i:0},Z=new Map(Q),F=U?.elevateNodesOnSelect&&!V6(U.zIndexMode)?S7:0,X=_.length>0,Y=!1;Q.clear(),J.clear();for(let K of _){let H=Z.get(K.id);if(U.checkEquality&&K===H?.internals.userNode)Q.set(K.id,H);else{let L=S5(K,U.nodeOrigin),W=T2(K.extent)?K.extent:U.nodeExtent,B=A2(L,W,Y0(K));H={...U.defaults,...K,measured:{width:K.measured?.width,height:K.measured?.height},internals:{positionAbsolute:B,handleBounds:Nq(K,H),z:k7(K,F,U.zIndexMode),userNode:K}},Q.set(K.id,H)}if((H.measured===void 0||H.measured.width===void 0||H.measured.height===void 0)&&!H.hidden)X=!1;if(K.parentId)u6(H,Q,J,q,G);Y||=K.selected??!1}return{nodesInitialized:X,hasSelectedNodes:Y}}function Cq(_,Q){if(!_.parentId)return;let J=Q.get(_.parentId);if(J)J.set(_.id,_);else Q.set(_.parentId,new Map([[_.id,_]]))}function u6(_,Q,J,q,U){let{elevateNodesOnSelect:G,nodeOrigin:Z,nodeExtent:F,zIndexMode:X}=j6(y6,q),Y=_.parentId,K=Q.get(Y);if(!K){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(Cq(_,J),U&&!K.parentId&&K.internals.rootParentIndex===void 0&&X==="auto")K.internals.rootParentIndex=++U.i,K.internals.z=K.internals.z+U.i*wq;if(U&&K.internals.rootParentIndex!==void 0)U.i=K.internals.rootParentIndex;let H=G&&!V6(X)?S7:0,{x:L,y:W,z:B}=Sq(_,K,Z,F,H,X),{positionAbsolute:O}=_.internals,T=L!==O.x||W!==O.y;if(T||B!==_.internals.z)Q.set(_.id,{..._,internals:{..._.internals,positionAbsolute:T?{x:L,y:W}:O,z:B}})}function k7(_,Q,J){let q=K0(_.zIndex)?_.zIndex:0;if(V6(J))return q;return q+(_.selected?Q:0)}function Sq(_,Q,J,q,U,G){let{x:Z,y:F}=Q.internals.positionAbsolute,X=Y0(_),Y=S5(_,J),K=T2(_.extent)?A2(Y,_.extent,X):Y,H=A2({x:Z+K.x,y:F+K.y},q,X);if(_.extent==="parent")H=A7(H,X,Q);let L=k7(_,U,G),W=Q.internals.z??0;return{x:H.x,y:H.y,z:W>=L?W+1:L}}function I4(_,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??c2(F),Y=R6(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,K=Y0(F),H=F.origin??q,L=Z.x<Y.x?Math.round(Math.abs(Y.x-Z.x)):0,W=Z.y<Y.y?Math.round(Math.abs(Y.y-Z.y)):0,B=Math.max(K.width,Math.round(Z.width)),O=Math.max(K.height,Math.round(Z.height)),T=(B-K.width)*H[0],M=(O-K.height)*H[1];if(L>0||W>0||T||M)U.push({id:X,type:"position",position:{x:F.position.x-L+T,y:F.position.y-W+M}}),J.get(X)?.forEach((P)=>{if(!_.some((A)=>A.id===P.id))U.push({id:P.id,type:"position",position:{x:P.position.x+L,y:P.position.y+W}})});if(K.width<Z.width||K.height<Z.height||L||W)U.push({id:X,type:"dimensions",setAttributes:!0,dimensions:{width:B+(L?H[0]*L-T:0),height:O+(W?H[1]*W-M:0)}})});return U}function y7(_,Q,J,q,U,G,Z){let F=q?.querySelector(".xyflow__viewport"),X=!1;if(!F)return{changes:[],updatedInternals:X};let Y=[],K=window.getComputedStyle(F),{m22:H}=new window.DOMMatrixReadOnly(K.transform),L=[];for(let W of _.values()){let B=Q.get(W.id);if(!B)continue;if(B.hidden){Q.set(B.id,{...B,internals:{...B.internals,handleBounds:void 0}}),X=!0;continue}let O=B4(W.nodeElement),T=B.measured.width!==O.width||B.measured.height!==O.height;if(!!(O.width&&O.height&&(T||!B.internals.handleBounds||W.force))){let P=W.nodeElement.getBoundingClientRect(),A=T2(B.extent)?B.extent:G,{positionAbsolute:R}=B.internals;if(B.parentId&&B.extent==="parent"){let C=Q.get(B.parentId);if(C)R=A7(R,O,C)}else if(A)R=A2(R,A,O);let f={...B,measured:O,internals:{...B.internals,positionAbsolute:R,handleBounds:{source:J7("source",W.nodeElement,P,H,B.id),target:J7("target",W.nodeElement,P,H,B.id)}}};if(Q.set(B.id,f),B.parentId)u6(f,Q,J,{nodeOrigin:U,zIndexMode:Z});if(X=!0,T){if(Y.push({id:B.id,type:"dimensions",dimensions:O}),B.expandParent&&B.parentId)L.push({id:B.id,parentId:B.parentId,rect:c2(f,U)})}}}if(L.length>0){let W=I4(L,Q,J,U);Y.push(...W)}return{changes:Y,updatedInternals:X}}async function j7({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 H7(_,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 b6(_,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}`,K=`${G}-${F}--${U}-${Z}`;H7("source",X,K,_,U,Z),H7("target",X,Y,_,G,F),Q.set(q.id,q)}}function V7(_,Q){if(!_.parentId)return!1;let J=Q.get(_.parentId);if(!J)return!1;if(J.selected)return!0;return V7(J,Q)}function K7(_,Q,J){let q=_;do{if(q?.matches?.(Q))return!0;if(q===J)return!1;q=q?.parentElement}while(q);return!1}function vq(_,Q,J,q){let U=new Map;for(let[G,Z]of _)if((Z.selected||Z.id===q)&&(!Z.parentId||!V7(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 H6({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 kq({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=l2(G,Q);return{x:Z.x-G.x,y:Z.y-G.y}}function u7({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},K=null,H=!1,L=null,W=!1,B=!1,O=null;function T({noDragClassName:P,handleSelector:A,domNode:R,isSelectable:f,nodeId:C,nodeClickDistance:N=0}){L=m1(R);function S({x:r,y:m}){let{nodeLookup:v,nodeExtent:h,snapGrid:V,snapToGrid:E,nodeOrigin:u,onNodeDrag:D,onSelectionDrag:I,onError:k,updateNodePositions:p}=Q();G={x:r,y:m};let b=!1,e=F.size>1,t=e&&h?Y6(R2(F)):null,o=e&&E?kq({dragItems:F,snapGrid:V,x:r,y:m}):null;for(let[s,g]of F){if(!v.has(s))continue;let J1={x:r-g.distance.x,y:m-g.distance.y};if(E)J1=o?{x:Math.round(J1.x+o.x),y:Math.round(J1.y+o.y)}:l2(J1,V);let U1=null;if(e&&h&&!g.extent&&t){let{positionAbsolute:F1}=g.internals,B1=F1.x-t.x+h[0][0],Y1=F1.x+g.measured.width-t.x2+h[1][0],Q1=F1.y-t.y+h[0][1],T1=F1.y+g.measured.height-t.y2+h[1][1];U1=[[B1,Q1],[Y1,T1]]}let{position:X1,positionAbsolute:G1}=T6({nodeId:s,nextPosition:J1,nodeLookup:v,nodeExtent:U1?U1:h,nodeOrigin:u,onError:k});b=b||g.position.x!==X1.x||g.position.y!==X1.y,g.position=X1,g.internals.positionAbsolute=G1}if(B=B||b,!b)return;if(p(F,!0),O&&(q||D||!C&&I)){let[s,g]=H6({nodeId:C,dragItems:F,nodeLookup:v});if(q?.(O,F,s,g),D?.(O,s,g),!C)I?.(O,g)}}async function w(){if(!K)return;let{transform:r,panBy:m,autoPanSpeed:v,autoPanOnNodeDrag:h}=Q();if(!h){X=!1,cancelAnimationFrame(Z);return}let[V,E]=L4(Y,K,v);if(V!==0||E!==0){if(G.x=(G.x??0)-V/r[2],G.y=(G.y??0)-E/r[2],await m({x:V,y:E}))S(G)}Z=requestAnimationFrame(w)}function j(r){let{nodeLookup:m,multiSelectionActive:v,nodesDraggable:h,transform:V,snapGrid:E,snapToGrid:u,selectNodesOnDrag:D,onNodeDragStart:I,onSelectionDragStart:k,unselectNodesAndEdges:p}=Q();if(H=!0,(!D||!f)&&!v&&C){if(!m.get(C)?.selected)p()}if(f&&D&&C)_?.(C);let b=C5(r.sourceEvent,{transform:V,snapGrid:E,snapToGrid:u,containerBounds:K});if(G=b,F=vq(m,h,b,C),F.size>0&&(J||I||!C&&k)){let[e,t]=H6({nodeId:C,dragItems:F,nodeLookup:m});if(J?.(r.sourceEvent,F,e,t),I?.(r.sourceEvent,e,t),!C)k?.(r.sourceEvent,t)}}let x=F5().clickDistance(N).on("start",(r)=>{let{domNode:m,nodeDragThreshold:v,transform:h,snapGrid:V,snapToGrid:E}=Q();if(K=m?.getBoundingClientRect()||null,W=!1,B=!1,O=r.sourceEvent,v===0)j(r);G=C5(r.sourceEvent,{transform:h,snapGrid:V,snapToGrid:E,containerBounds:K}),Y=X0(r.sourceEvent,K)}).on("drag",(r)=>{let{autoPanOnNodeDrag:m,transform:v,snapGrid:h,snapToGrid:V,nodeDragThreshold:E,nodeLookup:u}=Q(),D=C5(r.sourceEvent,{transform:v,snapGrid:h,snapToGrid:V,containerBounds:K});if(O=r.sourceEvent,r.sourceEvent.type==="touchmove"&&r.sourceEvent.touches.length>1||C&&!u.has(C))W=!0;if(W)return;if(!X&&m&&H)X=!0,w();if(!H){let I=X0(r.sourceEvent,K),k=I.x-Y.x,p=I.y-Y.y;if(Math.sqrt(k*k+p*p)>E)j(r)}if((G.x!==D.xSnapped||G.y!==D.ySnapped)&&F&&H)Y=X0(r.sourceEvent,K),S(D)}).on("end",(r)=>{if(!H||W){if(W&&F.size>0)Q().updateNodePositions(F,!1);return}if(X=!1,H=!1,cancelAnimationFrame(Z),F.size>0){let{nodeLookup:m,updateNodePositions:v,onNodeDragStop:h,onSelectionDragStop:V}=Q();if(B)v(F,!1),B=!1;if(U||h||!C&&V){let[E,u]=H6({nodeId:C,dragItems:F,nodeLookup:m,dragging:!1});if(U?.(r.sourceEvent,F,E,u),h?.(r.sourceEvent,E,u),!C)V?.(r.sourceEvent,u)}}}).filter((r)=>{let m=r.target;return!r.button&&(!P||!K7(m,`.${P}`,R))&&(!A||K7(m,A,R))});L.call(x)}function M(){L?.on(".drag",null)}return{update:T,destroy:M}}function yq(_,Q,J){let q=[],U={x:_.x-J,y:_.y-J,width:J*2,height:J*2};for(let G of Q.values())if(v5(U,c2(G))>0)q.push(G);return q}var jq=250;function Vq(_,Q,J,q){let U=[],G=1/0,Z=yq(_,J,Q+jq);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:K,y:H}=e0(F,Y,Y.position,!0),L=Math.sqrt(Math.pow(K-_.x,2)+Math.pow(H-_.y,2));if(L>Q)continue;if(L<G)U=[{...Y,x:K,y:H}],G=L;else if(L===G)U.push({...Y,x:K,y:H})}}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 b7(_,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,...e0(Z,X,X.position,!0)}:X}function h7(_,Q){if(_)return _;else if(Q?.classList.contains("target"))return"target";else if(Q?.classList.contains("source"))return"source";return null}function uq(_,Q){let J=null;if(Q)J=!0;else if(_&&!Q)J=!1;return J}var D7=()=>!0;function bq(_,{connectionMode:Q,connectionRadius:J,handleId:q,nodeId:U,edgeUpdaterType:G,isTarget:Z,domNode:F,nodeLookup:X,lib:Y,autoPanOnConnect:K,flowId:H,panBy:L,cancelConnection:W,onConnectStart:B,onConnect:O,onConnectEnd:T,isValidConnection:M=D7,onReconnectEnd:P,updateConnection:A,getTransform:R,getFromHandle:f,autoPanSpeed:C,dragThreshold:N=1,handleDomNode:S}){let w=C6(_.target),j=0,x,{x:r,y:m}=X0(_),v=h7(G,S),h=F?.getBoundingClientRect(),V=!1;if(!h||!v)return;let E=b7(U,v,q,X,Q);if(!E)return;let u=X0(_,h),D=!1,I=null,k=!1,p=null;function b(){if(!K||!h)return;let[X1,G1]=L4(u,h,C);L({x:X1,y:G1}),j=requestAnimationFrame(b)}let e={...E,nodeId:U,type:v,position:E.position},t=X.get(U),s={inProgress:!0,isValid:null,from:e0(t,e,Z1.Left,!0),fromHandle:e,fromPosition:e.position,fromNode:t,to:u,toHandle:null,toPosition:e8[e.position],toNode:null,pointer:u};function g(){V=!0,A(s),B?.(_,{nodeId:U,handleId:q,handleType:v})}if(N===0)g();function J1(X1){if(!V){let{x:T1,y:K1}=X0(X1),y1=T1-r,p1=K1-m;if(!(y1*y1+p1*p1>N*N))return;g()}if(!f()||!e){U1(X1);return}let G1=R();if(u=X0(X1,h),x=Vq(r2(u,G1,!1,[1,1]),J,X,e),!D)b(),D=!0;let F1=E7(X1,{handle:x,connectionMode:Q,fromNodeId:U,fromHandleId:q,fromType:Z?"target":"source",isValidConnection:M,doc:w,lib:Y,flowId:H,nodeLookup:X});p=F1.handleDomNode,I=F1.connection,k=uq(!!x,F1.isValid);let B1=X.get(U),Y1=B1?e0(B1,e,Z1.Left,!0):s.from,Q1={...s,from:Y1,isValid:k,to:F1.toHandle&&k?M2({x:F1.toHandle.x,y:F1.toHandle.y},G1):u,toHandle:F1.toHandle,toPosition:k&&F1.toHandle?F1.toHandle.position:e8[e.position],toNode:F1.toHandle?X.get(F1.toHandle.nodeId):null,pointer:u};A(Q1),s=Q1}function U1(X1){if("touches"in X1&&X1.touches.length>0)return;if(V){if((x||p)&&I&&k)O?.(I);let{inProgress:G1,...F1}=s,B1={...F1,toPosition:s.toHandle?s.toPosition:null};if(T?.(X1,B1),G)P?.(X1,B1)}W(),cancelAnimationFrame(j),D=!1,k=!1,I=null,p=null,w.removeEventListener("mousemove",J1),w.removeEventListener("mouseup",U1),w.removeEventListener("touchmove",J1),w.removeEventListener("touchend",U1)}w.addEventListener("mousemove",J1),w.addEventListener("mouseup",U1),w.addEventListener("touchmove",J1),w.addEventListener("touchend",U1)}function E7(_,{handle:Q,connectionMode:J,fromNodeId:q,fromHandleId:U,fromType:G,doc:Z,lib:F,flowId:X,isValidConnection:Y=D7,nodeLookup:K}){let H=G==="target",L=Q?Z.querySelector(`.${F}-flow__handle[data-id="${X}-${Q?.nodeId}-${Q?.id}-${Q?.type}"]`):null,{x:W,y:B}=X0(_),O=Z.elementFromPoint(W,B),T=O?.classList.contains(`${F}-flow__handle`)?O:L,M={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){let P=h7(void 0,T),A=T.getAttribute("data-nodeid"),R=T.getAttribute("data-handleid"),f=T.classList.contains("connectable"),C=T.classList.contains("connectableend");if(!A||!P)return M;let N={source:H?A:q,sourceHandle:H?R:U,target:H?q:A,targetHandle:H?U:R};M.connection=N;let w=f&&C&&(J===n0.Strict?H&&P==="source"||!H&&P==="target":A!==q||R!==U);M.isValid=w&&Y(N),M.toHandle=b7(A,P,R,K,J,!0)}return M}var f4={onPointerDown:bq,isValid:E7};function x7({domNode:_,panZoom:Q,getTransform:J,getViewScale:q}){let U=m1(_);function G({translateExtent:F,width:X,height:Y,zoomStep:K=1,pannable:H=!0,zoomable:L=!0,inversePan:W=!1}){let B=(A)=>{if(A.sourceEvent.type!=="wheel"||!Q)return;let R=J(),f=A.sourceEvent.ctrlKey&&i2()?10:1,C=-A.sourceEvent.deltaY*(A.sourceEvent.deltaMode===1?0.05:A.sourceEvent.deltaMode?1:0.002)*K,N=R[2]*Math.pow(2,C*f);Q.scaleTo(N)},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]},M=(A)=>{let R=J();if(A.sourceEvent.type!=="mousemove"&&A.sourceEvent.type!=="touchmove"||!Q)return;let f=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY],C=[f[0]-O[0],f[1]-O[1]];O=f;let N=q()*Math.max(R[2],Math.log(R[2]))*(W?-1:1),S={x:R[0]-C[0]*N,y:R[1]-C[1]*N},w=[[0,0],[X,Y]];Q.setViewportConstrained({x:S.x,y:S.y,zoom:R[2]},w,F)},P=N5().on("start",T).on("zoom",H?M:null).on("zoom.wheel",L?B:null);U.call(P,{})}function Z(){U.on("zoom",null)}return{update:G,destroy:Z,pointer:d1}}var w4=(_)=>({x:_.x,y:_.y,zoom:_.k}),K6=({x:_,y:Q,zoom:J})=>z2.translate(_,Q).scale(J),o0=(_,Q)=>_.target.closest(`.${Q}`),m7=(_,Q)=>Q===2&&Array.isArray(_)&&_.includes(2),hq=(_)=>((_*=2)<=1?_*_*_:(_-=2)*_*_+2)/2,X6=(_,Q=0,J=hq,q=()=>{})=>{let U=typeof Q==="number"&&Q>0;if(!U)q();return U?_.transition().duration(Q).ease(J).on("end",q):_},g7=(_)=>{let Q=_.ctrlKey&&i2()?10:1;return-_.deltaY*(_.deltaMode===1?0.05:_.deltaMode?1:0.002)*Q};function Dq({zoomPanValues:_,noWheelClassName:Q,d3Selection:J,d3Zoom:q,panOnScrollMode:U,panOnScrollSpeed:G,zoomOnPinch:Z,onPanZoomStart:F,onPanZoom:X,onPanZoomEnd:Y}){return(K)=>{if(o0(K,Q)){if(K.ctrlKey)K.preventDefault();return!1}K.preventDefault(),K.stopImmediatePropagation();let H=J.property("__zoom").k||1;if(K.ctrlKey&&Z){let T=d1(K),M=g7(K),P=H*Math.pow(2,M);q.scaleTo(J,P,T,K);return}let L=K.deltaMode===1?20:1,W=U===D0.Vertical?0:K.deltaX*L,B=U===D0.Horizontal?0:K.deltaY*L;if(!i2()&&K.shiftKey&&U!==D0.Vertical)W=K.deltaY*L,B=0;q.translateBy(J,-(W/H)*G,-(B/H)*G,{internal:!0});let O=w4(J.property("__zoom"));if(clearTimeout(_.panScrollTimeout),!_.isPanScrolling)_.isPanScrolling=!0,F?.(K,O);else X?.(K,O);_.panScrollTimeout=setTimeout(()=>{Y?.(K,O),_.isPanScrolling=!1},150)}}function Eq({noWheelClassName:_,preventScrolling:Q,d3ZoomHandler:J}){return function(q,U){let G=q.type==="wheel",Z=!Q&&G&&!q.ctrlKey,F=o0(q,_);if(q.ctrlKey&&G&&F)q.preventDefault();if(Z||F)return null;q.preventDefault(),J.call(this,q,U)}}function xq({zoomPanValues:_,onDraggingChange:Q,onPanZoomStart:J}){return(q)=>{if(q.sourceEvent?.internal)return;let U=w4(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 mq({zoomPanValues:_,panOnDrag:Q,onPaneContextMenu:J,onTransformChange:q,onPanZoom:U}){return(G)=>{if(_.usedRightMouseButton=!!(J&&m7(Q,_.mouseButton??0)),!G.sourceEvent?.sync)q([G.transform.x,G.transform.y,G.transform.k]);if(U&&!G.sourceEvent?.internal)U?.(G.sourceEvent,w4(G.transform))}}function gq({zoomPanValues:_,panOnDrag:Q,panOnScroll:J,onDraggingChange:q,onPanZoomEnd:U,onPaneContextMenu:G}){return(Z)=>{if(Z.sourceEvent?.internal)return;if(_.isZoomingOrPanning=!1,G&&m7(Q,_.mouseButton??0)&&!_.usedRightMouseButton&&Z.sourceEvent)G(Z.sourceEvent);if(_.usedRightMouseButton=!1,q(!1),U){let F=w4(Z.transform);_.prevViewport=F,clearTimeout(_.timerId),_.timerId=setTimeout(()=>{U?.(Z.sourceEvent,F)},J?150:0)}}}function pq({panActivationKeyPressed:_,zoomActivationKeyPressed:Q,zoomOnScroll:J,zoomOnPinch:q,panOnDrag:U,panOnScroll:G,zoomOnDoubleClick:Z,userSelectionActive:F,noWheelClassName:X,noPanClassName:Y,lib:K,connectionInProgress:H}){return(L)=>{let W=Q||J,B=q&&L.ctrlKey,O=L.type==="wheel";if(L.button===1&&L.type==="mousedown"&&(o0(L,`${K}-flow__node`)||o0(L,`${K}-flow__edge`)||o0(L,`${K}-flow__selection`)||o0(L,`${K}-flow__nodesselection`)))return!0;if(!U&&!W&&!G&&!Z&&!q)return!1;if(F)return!1;if(H&&!O)return!1;if(o0(L,X)&&O)return!1;if(o0(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(!W&&!G&&!B&&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 p7({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},K=_.getBoundingClientRect(),H=[[0,0],[K.width,K.height]];(typeof ResizeObserver<"u"?new ResizeObserver((m)=>{let v=m[0];if(v)H=[[0,0],[v.contentRect.width,v.contentRect.height]]}):null)?.observe(_);let W=N5().extent(()=>H).scaleExtent([Q,J]).translateExtent(q),B=m1(_).call(W);R({x:U.x,y:U.y,zoom:g2(U.zoom,Q,J)},[[0,0],[K.width,K.height]],q);let O=B.on("wheel.zoom"),T=B.on("dblclick.zoom");W.wheelDelta(g7);async function M(m,v){if(B)return new Promise((h)=>{W?.interpolate(v?.interpolate==="linear"?w0:Y2).transform(X6(B,v?.duration,v?.ease,()=>h(!0)),m)});return!1}function P({noWheelClassName:m,noPanClassName:v,onPaneContextMenu:h,userSelectionActive:V,panOnScroll:E,panOnDrag:u,panOnScrollMode:D,panOnScrollSpeed:I,preventScrolling:k,zoomOnPinch:p,zoomOnScroll:b,zoomOnDoubleClick:e,panActivationKeyPressed:t=!1,zoomActivationKeyPressed:o,lib:s,onTransformChange:g,connectionInProgress:J1,paneClickDistance:U1,selectionOnDrag:X1}){if(V&&!Y.isZoomingOrPanning)A();let G1=E&&!o&&!V;W.clickDistance(X1?1/0:!K0(U1)||U1<0?0:U1);let F1=G1?Dq({zoomPanValues:Y,noWheelClassName:m,d3Selection:B,d3Zoom:W,panOnScrollMode:D,panOnScrollSpeed:I,zoomOnPinch:p,onPanZoomStart:Z,onPanZoom:G,onPanZoomEnd:F}):Eq({noWheelClassName:m,preventScrolling:k,d3ZoomHandler:O});B.on("wheel.zoom",F1,{passive:!1});let B1=xq({zoomPanValues:Y,onDraggingChange:X,onPanZoomStart:Z});W.on("start",B1);let Y1=mq({zoomPanValues:Y,panOnDrag:u,onPaneContextMenu:!!h,onPanZoom:G,onTransformChange:g});W.on("zoom",Y1);let Q1=gq({zoomPanValues:Y,panOnDrag:u,panOnScroll:E,onPaneContextMenu:h,onPanZoomEnd:F,onDraggingChange:X});W.on("end",Q1);let T1=pq({panActivationKeyPressed:t,zoomActivationKeyPressed:o,panOnDrag:u,zoomOnScroll:b,panOnScroll:E,zoomOnDoubleClick:e,zoomOnPinch:p,userSelectionActive:V,noPanClassName:v,noWheelClassName:m,lib:s,connectionInProgress:J1});if(W.filter(T1),e)B.on("dblclick.zoom",T);else B.on("dblclick.zoom",null)}function A(){W.on("zoom",null)}async function R(m,v,h){let V=K6(m),E=W?.constrain()(V,v,h);if(E)await M(E);return E}async function f(m,v){let h=K6(m);return await M(h,v),h}function C(m){if(B){let v=K6(m),h=B.property("__zoom");if(h.k!==m.zoom||h.x!==m.x||h.y!==m.y)W?.transform(B,v,null,{sync:!0})}}function N(){let m=B?P5(B.node()):{x:0,y:0,k:1};return{x:m.x,y:m.y,zoom:m.k}}async function S(m,v){if(B)return new Promise((h)=>{W?.interpolate(v?.interpolate==="linear"?w0:Y2).scaleTo(X6(B,v?.duration,v?.ease,()=>h(!0)),m)});return!1}async function w(m,v){if(B)return new Promise((h)=>{W?.interpolate(v?.interpolate==="linear"?w0:Y2).scaleBy(X6(B,v?.duration,v?.ease,()=>h(!0)),m)});return!1}function j(m){W?.scaleExtent(m)}function x(m){W?.translateExtent(m)}function r(m){let v=!K0(m)||m<0?0:m;W?.clickDistance(v)}return{update:P,destroy:A,setViewport:f,setViewportConstrained:R,getViewport:N,scaleTo:S,scaleBy:w,setScaleExtent:j,setTranslateExtent:x,syncViewport:C,setClickDistance:r}}var E0;(function(_){_.Line="line",_.Handle="handle"})(E0||(E0={}));var c7=["top-left","top-right","bottom-left","bottom-right"],l7=["top","right","bottom","left"];function cq({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 X7(_){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 s0(_,Q){return Math.max(0,Q-_)}function t0(_,Q){return Math.max(0,_-Q)}function K4(_,Q,J){return Math.max(0,Q-_,_-J)}function Y7(_,Q){return _?!Q:Q}function lq(_,Q,J,q,U,G,Z,F){let{affectsX:X,affectsY:Y}=Q,{isHorizontal:K,isVertical:H}=Q,L=K&&H,{xSnapped:W,ySnapped:B}=J,{minWidth:O,maxWidth:T,minHeight:M,maxHeight:P}=q,{x:A,y:R,width:f,height:C,aspectRatio:N}=_,S=Math.floor(K?W-_.pointerX:0),w=Math.floor(H?B-_.pointerY:0),j=f+(X?-S:S),x=C+(Y?-w:w),r=-G[0]*f,m=-G[1]*C,v=K4(j,O,T),h=K4(x,M,P);if(Z){let u=0,D=0;if(X&&S<0)u=s0(A+S+r,Z[0][0]);else if(!X&&S>0)u=t0(A+j+r,Z[1][0]);if(Y&&w<0)D=s0(R+w+m,Z[0][1]);else if(!Y&&w>0)D=t0(R+x+m,Z[1][1]);v=Math.max(v,u),h=Math.max(h,D)}if(F){let u=0,D=0;if(X&&S>0)u=t0(A+S,F[0][0]);else if(!X&&S<0)u=s0(A+j,F[1][0]);if(Y&&w>0)D=t0(R+w,F[0][1]);else if(!Y&&w<0)D=s0(R+x,F[1][1]);v=Math.max(v,u),h=Math.max(h,D)}if(U){if(K){let u=K4(j/N,M,P)*N;if(v=Math.max(v,u),Z){let D=0;if(!X&&!Y||X&&!Y&&L)D=t0(R+m+j/N,Z[1][1])*N;else D=s0(R+m+(X?S:-S)/N,Z[0][1])*N;v=Math.max(v,D)}if(F){let D=0;if(!X&&!Y||X&&!Y&&L)D=s0(R+j/N,F[1][1])*N;else D=t0(R+(X?S:-S)/N,F[0][1])*N;v=Math.max(v,D)}}if(H){let u=K4(x*N,O,T)/N;if(h=Math.max(h,u),Z){let D=0;if(!X&&!Y||Y&&!X&&L)D=t0(A+x*N+r,Z[1][0])/N;else D=s0(A+(Y?w:-w)*N+r,Z[0][0])/N;h=Math.max(h,D)}if(F){let D=0;if(!X&&!Y||Y&&!X&&L)D=s0(A+x*N,F[1][0])/N;else D=t0(A+(Y?w:-w)*N,F[0][0])/N;h=Math.max(h,D)}}}if(w=w+(w<0?h:-h),S=S+(S<0?v:-v),U)if(L)if(j>x*N)w=(Y7(X,Y)?-S:S)/N;else S=(Y7(X,Y)?-w:w)*N;else if(K)w=S/N,Y=X;else S=w*N,X=Y;let V=X?A+S:A,E=Y?R+w:R;return{width:f+(X?-S:S),height:C+(Y?-w:w),x:G[0]*S*(!X?1:-1)+V,y:G[1]*w*(!Y?1:-1)+E}}var r7={width:0,height:0,x:0,y:0},rq={...r7,pointerX:0,pointerY:0,aspectRatio:1};function iq(_,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 i7({domNode:_,nodeId:Q,getStoreItems:J,onChange:q,onEnd:U}){let G=m1(_),Z={controlDirection:X7("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:K,keepAspectRatio:H,resizeDirection:L,onResizeStart:W,onResize:B,onResizeEnd:O,shouldResize:T}){let M={...r7},P={...rq};Z={boundaries:K,resizeDirection:L,keepAspectRatio:H,controlDirection:X7(Y)};let A=void 0,R=null,f=[],C=void 0,N=void 0,S=void 0,w=F5().on("start",(j)=>{let{nodeLookup:x,transform:r,snapGrid:m,snapToGrid:v,nodeOrigin:h,paneDomNode:V}=J();if(A=x.get(Q),!A)return;R=V?.getBoundingClientRect()??null;let{xSnapped:E,ySnapped:u}=C5(j.sourceEvent,{transform:r,snapGrid:m,snapToGrid:v,containerBounds:R});if(M={width:A.measured.width??0,height:A.measured.height??0,x:A.position.x??0,y:A.position.y??0},P={...M,pointerX:E,pointerY:u,aspectRatio:M.width/M.height},C=void 0,N=T2(A.extent)?A.extent:void 0,A.parentId&&(A.extent==="parent"||A.expandParent))C=x.get(A.parentId);if(C&&A.extent==="parent")N=[[0,0],[C.measured.width,C.measured.height]];f=[],S=void 0;for(let[D,I]of x)if(I.parentId===Q){if(f.push({id:D,position:{...I.position},extent:I.extent}),I.extent==="parent"||I.expandParent){let k=iq(I,A,I.origin??h);if(S)S=[[Math.min(k[0][0],S[0][0]),Math.min(k[0][1],S[0][1])],[Math.max(k[1][0],S[1][0]),Math.max(k[1][1],S[1][1])]];else S=k}}W?.(j,{...M})}).on("drag",(j)=>{let{transform:x,snapGrid:r,snapToGrid:m,nodeOrigin:v}=J(),h=C5(j.sourceEvent,{transform:x,snapGrid:r,snapToGrid:m,containerBounds:R}),V=[];if(!A)return;let{x:E,y:u,width:D,height:I}=M,k={},p=A.origin??v,{width:b,height:e,x:t,y:o}=lq(P,Z.controlDirection,h,Z.boundaries,Z.keepAspectRatio,p,N,S),s=b!==D,g=e!==I,J1=t!==E&&s,U1=o!==u&&g;if(!J1&&!U1&&!s&&!g)return;let X1={prevValues:{...M},startX:P.x,startY:P.y,childNodes:f.map((Y1)=>({...Y1,position:{...Y1.position}}))};if(J1||U1||p[0]===1||p[1]===1){if(k.x=J1?t:M.x,k.y=U1?o:M.y,M.x=k.x,M.y=k.y,f.length>0){let Y1=t-E,Q1=o-u;for(let T1 of f)T1.position={x:T1.position.x-Y1+p[0]*(b-D),y:T1.position.y-Q1+p[1]*(e-I)},V.push(T1)}}if(s||g)k.width=s&&(!Z.resizeDirection||Z.resizeDirection==="horizontal")?b:M.width,k.height=g&&(!Z.resizeDirection||Z.resizeDirection==="vertical")?e:M.height,M.width=k.width,M.height=k.height;if(C&&A.expandParent){let Y1=p[0]*(k.width??0);if(k.x&&k.x<Y1)M.x=Y1,P.x=P.x-(k.x-Y1);let Q1=p[1]*(k.height??0);if(k.y&&k.y<Q1)M.y=Q1,P.y=P.y-(k.y-Q1)}let G1=cq({width:M.width,prevWidth:D,height:M.height,prevHeight:I,affectsX:Z.controlDirection.affectsX,affectsY:Z.controlDirection.affectsY}),F1={...M,direction:G1};if(T?.(j,F1)===!1){M=X1.prevValues,P.x=X1.startX,P.y=X1.startY,f.forEach((Y1,Q1)=>{Y1.position=X1.childNodes[Q1].position});return}B?.(j,F1),q(k,V)}).on("end",(j)=>{O?.(j,{...M}),U?.({...M})});G.call(w)}function X(){G.on(".drag",null)}return{update:F,destroy:X}}var n7=r1(O0(),1),e7=r1(a7(),1);var s7=(_)=>{let Q,J=new Set,q=(K,H)=>{let L=typeof K==="function"?K(Q):K;if(!Object.is(L,Q)){let W=Q;Q=(H!=null?H:typeof L!=="object"||L===null)?L:Object.assign({},Q,L),J.forEach((B)=>B(Q,W))}},U=()=>Q,X={setState:q,getState:U,getInitialState:()=>Y,subscribe:(K)=>{return J.add(K),()=>J.delete(K)},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},t7=(_)=>_?s7(_):s7;var{useDebugValue:sq}=n7.default,{useSyncExternalStoreWithSelector:tq}=e7.default,oq=(_)=>_;function h6(_,Q=oq,J){let q=tq(_.subscribe,_.getState,_.getServerState||_.getInitialState,Q,J);return sq(q),q}var o7=(_,Q)=>{let J=t7(_),q=(U,G=Q)=>h6(J,U,G);return Object.assign(q,J),q},_9=(_,Q)=>_?o7(_,Q):o7;function S1(_,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 y9=r1($9(),1),v4=a.createContext(null),_U=v4.Provider,j9=_0.error001("react");function O1(_,Q){let J=a.useContext(v4);if(J===null)throw Error(j9);return h6(J,_,Q)}function v1(){let _=a.useContext(v4);if(_===null)throw Error(j9);return a.useMemo(()=>({getState:_.getState,setState:_.setState,subscribe:_.subscribe}),[_])}var q9={display:"none"},QU={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},V9="react-flow__node-desc",u9="react-flow__edge-desc",JU="react-flow__aria-live",$U=(_)=>_.ariaLiveMessage,qU=(_)=>_.ariaLabelConfig;function UU({rfId:_}){let Q=O1($U);return d.jsx("div",{id:`${JU}-${_}`,"aria-live":"assertive","aria-atomic":"true",style:QU,children:Q})}function GU({rfId:_,disableKeyboardA11y:Q}){let J=O1(qU);return d.jsxs(d.Fragment,{children:[d.jsx("div",{id:`${V9}-${_}`,style:q9,children:Q?J["node.a11yDescription.default"]:J["node.a11yDescription.keyboardDisabled"]}),d.jsx("div",{id:`${u9}-${_}`,style:q9,children:J["edge.a11yDescription.default"]}),!Q&&d.jsx(UU,{rfId:_})]})}var C0=a.forwardRef(({position:_="top-left",children:Q,className:J,style:q,...U},G)=>{let Z=`${_}`.split("-");return d.jsx("div",{className:j1(["react-flow__panel",J,...Z]),style:q,ref:G,...U,children:Q})});C0.displayName="Panel";var U9="https://reactflow.dev/attribution";function ZU({proOptions:_,position:Q="bottom-right"}){if(a.useEffect(()=>{O7("react")},[]),_?.hideAttribution)return null;return d.jsx(C0,{position:Q,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${U9}`,children:d.jsx("a",{href:U9,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}var FU=(_)=>{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}},P4=(_)=>_.id;function HU(_,Q){return S1(_.selectedNodes.map(P4),Q.selectedNodes.map(P4))&&S1(_.selectedEdges.map(P4),Q.selectedEdges.map(P4))}function KU({onSelectionChange:_}){let Q=v1(),{selectedNodes:J,selectedEdges:q}=O1(FU,HU);return a.useEffect(()=>{let U={nodes:J,edges:q};_?.(U),Q.getState().onSelectionChangeHandlers.forEach((G)=>G(U))},[J,q,_]),null}var XU=(_)=>!!_.onSelectionChangeHandlers;function YU({onSelectionChange:_}){let Q=O1(XU);if(_||Q)return d.jsx(KU,{onSelectionChange:_});return null}var b9=[0,0],LU={x:0,y:0,zoom:1},zU=["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"],G9=[...zU,"rfId"],WU=(_)=>({setNodes:_.setNodes,setEdges:_.setEdges,setMinZoom:_.setMinZoom,setMaxZoom:_.setMaxZoom,setTranslateExtent:_.setTranslateExtent,setNodeExtent:_.setNodeExtent,reset:_.reset,setDefaultNodesAndEdges:_.setDefaultNodesAndEdges}),Z9={translateExtent:p2,nodeOrigin:b9,minZoom:0.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function BU(_){let{setNodes:Q,setEdges:J,setMinZoom:q,setMaxZoom:U,setTranslateExtent:G,setNodeExtent:Z,reset:F,setDefaultNodesAndEdges:X}=O1(WU,S1),Y=v1();a.useEffect(()=>{return X(_.defaultNodes,_.defaultEdges),()=>{K.current=Z9,F()}},[]);let K=a.useRef(Z9);return a.useEffect(()=>{for(let H of G9){let L=_[H],W=K.current[H];if(L===W)continue;if(typeof _[H]>"u")continue;if(H==="nodes")Q(L);else if(H==="edges")J(L);else if(H==="minZoom")q(L);else if(H==="maxZoom")U(L);else if(H==="translateExtent")G(L);else if(H==="nodeExtent")Z(L);else if(H==="ariaLabelConfig")Y.setState({ariaLabelConfig:R7(L)});else if(H==="fitView")Y.setState({fitViewQueued:L});else if(H==="fitViewOptions")Y.setState({fitViewOptions:L});else Y.setState({[H]:L})}K.current=_},G9.map((H)=>_[H])),null}function F9(){if(typeof window>"u"||!window.matchMedia)return null;return window.matchMedia("(prefers-color-scheme: dark)")}function AU(_){let[Q,J]=a.useState(_==="system"?null:_);return a.useEffect(()=>{if(_!=="system"){J(_);return}let q=F9(),U=()=>J(q?.matches?"dark":"light");return U(),q?.addEventListener("change",U),()=>{q?.removeEventListener("change",U)}},[_]),Q!==null?Q:F9()?.matches?"dark":"light"}var H9=typeof document<"u"?document:null;function j5(_=null,Q={target:H9,actInsideInputWithModifier:!0}){let[J,q]=a.useState(!1),U=a.useRef(!1),G=a.useRef(new Set([])),[Z,F]=a.useMemo(()=>{if(_!==null){let Y=(Array.isArray(_)?_:[_]).filter((H)=>typeof H==="string").map((H)=>H.replace(/\+/g,`
29
29
  `).replace(`
30
30
 
31
31
  `,`
32
32
  +`).split(`
33
- `)),K=Y.reduce((H,L)=>H.concat(...L),[]);return[Y,K]}return[[],[]]},[_]);return d.useEffect(()=>{let X=Q?.target??q9,Y=Q?.actInsideInputWithModifier??!0;if(_!==null){let K=(z)=>{if(U.current=z.ctrlKey||z.metaKey||z.shiftKey||z.altKey,(!U.current||U.current&&!Y)&&w6(z))return!1;let O=G9(z.code,F);if(G.current.add(z[O]),U9(Z,G.current,!1)){let R=z.composedPath?.()?.[0]||z.target,B=R?.nodeName==="BUTTON"||R?.nodeName==="A";if(Q.preventDefault!==!1&&(U.current||!B))z.preventDefault();q(!0)}},H=(z)=>{let W=G9(z.code,F);if(U9(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",K),X?.addEventListener("keyup",H),window.addEventListener("blur",L),window.addEventListener("contextmenu",L),()=>{X?.removeEventListener("keydown",K),X?.removeEventListener("keyup",H),window.removeEventListener("blur",L),window.removeEventListener("contextmenu",L)}}},[_,q]),J}function U9(_,Q,J){return _.filter((q)=>J||q.length===Q.size).some((q)=>q.every((U)=>Q.has(U)))}function G9(_,Q){return Q.includes(_)?"code":"key"}var LU=()=>{let _=S1();return d.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=O5(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},K=J.snapGrid??U,H=J.snapToGrid??G;return D2(Y,q,H,K)},flowToScreenPosition:(Q)=>{let{transform:J,domNode:q}=_.getState();if(!q)return Q;let{x:U,y:G}=q.getBoundingClientRect(),Z=Z2(Q,J);return{x:Z.x+U,y:Z.y+G}}}},[])};function v9(_,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)zU(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 zU(_,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 y9(_,Q){return v9(_,Q)}function WU(_,Q){return v9(_,Q)}function K2(_,Q){return{id:_,type:"select",selected:Q}}function E2(_,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(K2(G.id,Z))}}return q}function Z9({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 F9(_){return{id:_.id,type:"remove"}}var AU=M6("React Flow","https://reactflow.dev/");function BU(_,Q,J={}){return O7(_,Q,{...J,onError:J.onError??AU})}var H9=(_)=>K7(_),MU=(_)=>Y6(_);function j9(_){return d.forwardRef(_)}var V9=typeof window<"u"?d.useLayoutEffect:d.useEffect;function K9(_){let[Q,J]=d.useState(BigInt(0)),[q]=d.useState(()=>TU(()=>J((U)=>U+BigInt(1))));return V9(()=>{let U=q.get();if(U.length)_(U),q.reset()},[Q]),q}function TU(_){let Q=[];return{get:()=>Q,reset:()=>{Q=[]},push:(J)=>{Q.push(J),_()}}}var u9=d.createContext(null);function RU({children:_}){let Q=S1(),J=d.useCallback((F)=>{let{nodes:X=[],setNodes:Y,hasDefaultNodes:K,onNodesChange:H,nodeLookup:L,fitViewQueued:z,onNodesChangeMiddlewareMap:W}=Q.getState(),O=X;for(let B of F)O=typeof B==="function"?B(O):B;let R=Z9({items:O,lookup:L});for(let B of W.values())R=B(R);if(K)Y(O);if(R.length>0)H?.(R);else if(z)window.requestAnimationFrame(()=>{let{fitViewQueued:B,nodes:P,setNodes:A}=Q.getState();if(B)A(P)})},[]),q=K9(J),U=d.useCallback((F)=>{let{edges:X=[],setEdges:Y,hasDefaultEdges:K,onEdgesChange:H,edgeLookup:L}=Q.getState(),z=X;for(let W of F)z=typeof W==="function"?W(z):W;if(K)Y(z);else if(H)H(Z9({items:z,lookup:L}))},[]),G=K9(U),Z=d.useMemo(()=>({nodeQueue:q,edgeQueue:G}),[]);return i.jsx(u9.Provider,{value:Z,children:_})}function OU(){let _=d.useContext(u9);if(!_)throw Error("useBatchContext must be used within a BatchProvider");return _}var IU=(_)=>!!_.panZoom;function w5(){let _=LU(),Q=S1(),J=OU(),q=T1(IU),U=d.useMemo(()=>{let G=(H)=>Q.getState().nodeLookup.get(H),Z=(H)=>{J.nodeQueue.push(H)},F=(H)=>{J.edgeQueue.push(H)},X=(H)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState(),W=H9(H)?H:L.get(H.id),O=W.parentId?R6(W.position,W.measured,W.parentId,L,z):W.position,R={...W,position:O,width:W.measured?.width??W.width,height:W.measured?.height??W.height};return u2(R)},Y=(H,L,z={replace:!1})=>{Z((W)=>W.map((O)=>{if(O.id===H){let R=typeof L==="function"?L(O):L;return z.replace&&H9(R)?R:{...O,...R}}return O}))},K=(H,L,z={replace:!1})=>{F((W)=>W.map((O)=>{if(O.id===H){let R=typeof L==="function"?L(O):L;return z.replace&&MU(R)?R:{...O,...R}}return O}))};return{getNodes:()=>Q.getState().nodes.map((H)=>({...H})),getNode:(H)=>G(H)?.internals.userNode,getInternalNode:G,getEdges:()=>{let{edges:H=[]}=Q.getState();return H.map((L)=>({...L}))},getEdge:(H)=>Q.getState().edgeLookup.get(H),setNodes:Z,setEdges:F,addNodes:(H)=>{let L=Array.isArray(H)?H:[H];J.nodeQueue.push((z)=>[...z,...L])},addEdges:(H)=>{let L=Array.isArray(H)?H:[H];J.edgeQueue.push((z)=>[...z,...L])},toObject:()=>{let{nodes:H=[],edges:L=[],transform:z}=Q.getState(),[W,O,R]=z;return{nodes:H.map((B)=>({...B})),edges:L.map((B)=>({...B})),viewport:{x:W,y:O,zoom:R}}},deleteElements:async({nodes:H=[],edges:L=[]})=>{let{nodes:z,edges:W,onNodesDelete:O,onEdgesDelete:R,triggerNodeChanges:B,triggerEdgeChanges:P,onDelete:A,onBeforeDelete:T}=Q.getState(),{nodes:f,edges:C}=await L7({nodesToRemove:H,edgesToRemove:L,nodes:z,edges:W,onBeforeDelete:T}),w=C.length>0,S=f.length>0;if(w){let N=C.map(F9);R?.(C),P(N)}if(S){let N=f.map(F9);O?.(f),B(N)}if(S||w)A?.({nodes:f,edges:C});return{deletedNodes:f,deletedEdges:C}},getIntersectingNodes:(H,L=!0,z)=>{let W=B6(H),O=W?H:X(H),R=z!==void 0;if(!O)return[];return(z||Q.getState().nodes).filter((B)=>{let P=Q.getState().nodeLookup.get(B.id);if(P&&!W&&(B.id===H.id||!P.internals.positionAbsolute))return!1;let A=u2(R?B:P),T=R5(A,O);return L&&T>0||T>=A.width*A.height||T>=O.width*O.height})},isNodeIntersecting:(H,L,z=!0)=>{let O=B6(H)?H:X(H);if(!O)return!1;let R=R5(O,L);return z&&R>0||R>=L.width*L.height||R>=O.width*O.height},updateNode:Y,updateNodeData:(H,L,z={replace:!1})=>{Y(H,(W)=>{let O=typeof L==="function"?L(W):L;return z.replace?{...W,data:O}:{...W,data:{...W.data,...O}}},z)},updateEdge:K,updateEdgeData:(H,L,z={replace:!1})=>{K(H,(W)=>{let O=typeof L==="function"?L(W):L;return z.replace?{...W,data:O}:{...W,data:{...W.data,...O}}},z)},getNodesBounds:(H)=>{let{nodeLookup:L,nodeOrigin:z}=Q.getState();return z6(H,{nodeLookup:L,nodeOrigin:z})},getHandleConnections:({type:H,id:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}-${H}${L?`-${L}`:""}`)?.values()??[]),getNodeConnections:({type:H,handleId:L,nodeId:z})=>Array.from(Q.getState().connectionLookup.get(`${z}${H?L?`-${H}-${L}`:`-${H}`:""}`)?.values()??[]),fitView:async(H)=>{let L=Q.getState().fitViewResolver??A7();return Q.setState({fitViewQueued:!0,fitViewOptions:H,fitViewResolver:L}),J.nodeQueue.push((z)=>[...z]),L.promise}}},[]);return d.useMemo(()=>{return{...U,..._,viewportInitialized:q}},[q])}var X9=(_)=>_.selected,fU=typeof window<"u"?window:void 0;function wU({deleteKeyCode:_,multiSelectionKeyCode:Q}){let J=S1(),{deleteElements:q}=w5(),U=f5(_,{actInsideInputWithModifier:!1}),G=f5(Q,{target:fU});d.useEffect(()=>{if(U){let{edges:Z,nodes:F}=J.getState();q({nodes:F.filter(X9),edges:Z.filter(X9)}),J.setState({nodesSelectionActive:!1})}},[U]),d.useEffect(()=>{J.setState({multiSelectionActive:G})},[G])}function PU(_){let Q=S1();d.useEffect(()=>{let J=()=>{if(!_.current||!(_.current.checkVisibility?.()??!0))return!1;let q=K4(_.current);if(q.height===0||q.width===0)Q.getState().onError?.("004",a1.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 w4={position:"absolute",width:"100%",height:"100%",top:0,left:0},NU=(_)=>({userSelectionActive:_.userSelectionActive,lib:_.lib,connectionInProgress:_.connection.inProgress});function CU({onPaneContextMenu:_,zoomOnScroll:Q=!0,zoomOnPinch:J=!0,panOnScroll:q=!1,panActivationKeyPressed:U,panOnScrollSpeed:G=0.5,panOnScrollMode:Z=P0.Free,zoomOnDoubleClick:F=!0,panOnDrag:X=!0,defaultViewport:Y,translateExtent:K,minZoom:H,maxZoom:L,zoomActivationKeyCode:z,preventScrolling:W=!0,children:O,noWheelClassName:R,noPanClassName:B,onViewportChange:P,isControlledViewport:A,paneClickDistance:T,selectionOnDrag:f}){let C=S1(),w=d.useRef(null),{userSelectionActive:S,lib:N,connectionInProgress:y}=T1(NU,C1),D=f5(z),l=d.useRef();PU(w);let p=d.useCallback((k)=>{if(P?.({x:k[0],y:k[1],zoom:k[2]}),!A)C.setState({transform:k})},[P,A]);return d.useEffect(()=>{if(w.current){l.current=x7({domNode:w.current,minZoom:H,maxZoom:L,translateExtent:K,viewport:Y,onDraggingChange:(E)=>C.setState((V)=>V.paneDragging===E?V:{paneDragging:E}),onPanZoomStart:(E,V)=>{let{onViewportChangeStart:h,onMoveStart:I}=C.getState();I?.(E,V),h?.(V)},onPanZoom:(E,V)=>{let{onViewportChange:h,onMove:I}=C.getState();I?.(E,V),h?.(V)},onPanZoomEnd:(E,V)=>{let{onViewportChangeEnd:h,onMoveEnd:I}=C.getState();I?.(E,V),h?.(V)}});let{x:k,y:b,zoom:j}=l.current.getViewport();return C.setState({panZoom:l.current,transform:[k,b,j],domNode:w.current.closest(".react-flow")}),()=>{l.current?.destroy()}}},[]),d.useEffect(()=>{l.current?.update({onPaneContextMenu:_,zoomOnScroll:Q,zoomOnPinch:J,panOnScroll:q,panActivationKeyPressed:U,panOnScrollSpeed:G,panOnScrollMode:Z,zoomOnDoubleClick:F,panOnDrag:X,zoomActivationKeyPressed:D,preventScrolling:W,noPanClassName:B,userSelectionActive:S,noWheelClassName:R,lib:N,onTransformChange:p,connectionInProgress:y,selectionOnDrag:f,paneClickDistance:T})},[_,Q,J,q,U,G,Z,F,X,D,W,B,S,R,N,p,y,f,T]),i.jsx("div",{className:"react-flow__renderer",ref:w,style:w4,children:O})}var SU=(_)=>({userSelectionActive:_.userSelectionActive,userSelectionRect:_.userSelectionRect});function kU(){let{userSelectionActive:_,userSelectionRect:Q}=T1(SU,C1);if(!(_&&Q))return null;return i.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 u6=(_,Q)=>{return(J)=>{if(J.target!==Q.current)return;_?.(J)}},vU=(_)=>({userSelectionActive:_.userSelectionActive,elementsSelectable:_.elementsSelectable,dragging:_.paneDragging,panBy:_.panBy,autoPanSpeed:_.autoPanSpeed});function yU({isSelecting:_,selectionKeyPressed:Q,selectionMode:J=U2.Full,panOnDrag:q,autoPanOnSelection:U,paneClickDistance:G,selectionOnDrag:Z,onSelectionStart:F,onSelectionEnd:X,onPaneClick:Y,onPaneContextMenu:K,onPaneScroll:H,onPaneMouseEnter:L,onPaneMouseMove:z,onPaneMouseLeave:W,children:O}){let R=d.useRef(0),B=S1(),{userSelectionActive:P,elementsSelectable:A,dragging:T,panBy:f,autoPanSpeed:C}=T1(vU,C1),w=A&&(_||P),S=d.useRef(null),N=d.useRef(),y=d.useRef(new Set),D=d.useRef(new Set),l=d.useRef(!1),p=d.useRef(!1),k=d.useRef({x:0,y:0}),b=d.useRef(!1),j=(g)=>{if(p.current||l.current||B.getState().connection.inProgress){p.current=!1,l.current=!1;return}Y?.(g),B.getState().resetSelectedElements(),B.setState({nodesSelectionActive:!1})},E=(g)=>{if(Array.isArray(q)&&q?.includes(2)){g.preventDefault();return}K?.(g)},V=H?(g)=>H(g):void 0,h=(g)=>{if(p.current)g.stopPropagation(),p.current=!1},I=(g)=>{if(g.pointerType==="touch"&&q!==!1&&!Q)return;let{domNode:J1,transform:G1}=B.getState();if(N.current=J1?.getBoundingClientRect(),!N.current)return;let F1=g.target===S.current;if(!F1&&!!g.target.closest(".nokey")||!_||!(Z&&F1||Q)||g.button!==0||!g.isPrimary)return;g.target?.setPointerCapture?.(g.pointerId),p.current=!1;let{x:_1,y:q1}=J0(g.nativeEvent,N.current),o=D2({x:_1,y:q1},G1);if(B.setState({userSelectionRect:{width:0,height:0,startX:o.x,startY:o.y,x:_1,y:q1}}),!F1)g.stopPropagation(),g.preventDefault()};function v(g,J1){let{userSelectionRect:G1}=B.getState();if(!G1)return;let{transform:F1,nodeLookup:c,edgeLookup:s,connectionLookup:_1,triggerNodeChanges:q1,triggerEdgeChanges:o,defaultEdgeOptions:K1}=B.getState(),$1={x:G1.startX,y:G1.startY},{x:M1,y:R1}=Z2($1,F1),x1={startX:$1.x,startY:$1.y,x:g<M1?g:M1,y:J1<R1?J1:R1,width:Math.abs(g-M1),height:Math.abs(J1-R1)},U0=y.current,k1=D.current;y.current=new Set(G4(c,x1,F1,J===U2.Partial,!0).map((t1)=>t1.id)),D.current=new Set;let R0=K1?.selectable??!0;for(let t1 of y.current){let e1=_1.get(t1);if(!e1)continue;for(let{edgeId:_0}of e1.values()){let X0=s.get(_0);if(X0&&(X0.selectable??R0))D.current.add(_0)}}if(!O6(U0,y.current)){let t1=E2(c,y.current,!0);q1(t1)}if(!O6(k1,D.current)){let t1=E2(s,D.current);o(t1)}B.setState({userSelectionRect:x1,userSelectionActive:!0,nodesSelectionActive:!1})}function m(){if(!U||!N.current)return;let[g,J1]=Z4(k.current,N.current,C);f({x:g,y:J1}).then((G1)=>{if(!p.current||!G1){R.current=requestAnimationFrame(m);return}let{x:F1,y:c}=k.current;v(F1,c),R.current=requestAnimationFrame(m)})}let u=()=>{cancelAnimationFrame(R.current),R.current=0,b.current=!1};d.useEffect(()=>{return()=>u()},[]);let n=(g)=>{let{userSelectionRect:J1,transform:G1,resetSelectedElements:F1}=B.getState();if(!N.current||!J1)return;let{x:c,y:s}=J0(g.nativeEvent,N.current);k.current={x:c,y:s};let _1=Z2({x:J1.startX,y:J1.startY},G1);if(!p.current){let q1=Q?0:G;if(Math.hypot(c-_1.x,s-_1.y)<=q1)return;F1(),F?.(g)}if(p.current=!0,!b.current)m(),b.current=!0;v(c,s)},e=(g)=>{if(!w){if(g.target===S.current&&B.getState().connection.inProgress)l.current=!0;return}if(g.button!==0)return;if(g.target?.releasePointerCapture?.(g.pointerId),!P&&g.target===S.current&&B.getState().userSelectionRect)j?.(g);if(B.setState({userSelectionActive:!1,userSelectionRect:null}),p.current)X?.(g),B.setState({nodesSelectionActive:y.current.size>0});u()},t=(g)=>{g.target?.releasePointerCapture?.(g.pointerId),u()},a=q===!0||Array.isArray(q)&&q.includes(0);return i.jsxs("div",{className:v1(["react-flow__pane",{draggable:a,dragging:T,selection:_}]),onClick:w?void 0:u6(j,S),onContextMenu:u6(E,S),onWheel:u6(V,S),onPointerEnter:w?void 0:L,onPointerMove:w?n:z,onPointerUp:e,onPointerCancel:w?t:void 0,onPointerDownCapture:w?I:void 0,onClickCapture:w?h:void 0,onPointerLeave:W,ref:S,style:w4,children:[O,i.jsx(kU,{})]})}function D6({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",a1.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 b9({nodeRef:_,disabled:Q=!1,noDragClassName:J,handleSelector:q,nodeId:U,isSelectable:G,nodeClickDistance:Z}){let F=S1(),[X,Y]=d.useState(!1),K=d.useRef();return d.useEffect(()=>{if(Q)return;return K.current=y7({getStoreItems:()=>F.getState(),onNodeMouseDown:(H)=>{D6({id:H,store:F,nodeRef:_})},onDragStart:()=>{Y(!0)},onDragStop:()=>{Y(!1)}}),()=>{K.current?.destroy(),K.current=void 0}},[Q,F,_]),d.useEffect(()=>{if(Q||!_.current||!K.current)return;K.current.update({noDragClassName:J,handleSelector:q,domNode:_.current,isSelectable:G,nodeId:U,nodeClickDistance:Z})},[J,q,Q,G,_,U,Z]),X}var jU=(_)=>(Q)=>Q.selected&&(Q.draggable||_&&typeof Q.draggable>"u");function D9(){let _=S1();return d.useCallback((J)=>{let{nodeExtent:q,snapToGrid:U,snapGrid:G,nodesDraggable:Z,onError:F,updateNodePositions:X,nodeLookup:Y,nodeOrigin:K}=_.getState(),H=new Map,L=jU(Z),z=U?G[0]:5,W=U?G[1]:5,O=J.direction.x*z*J.factor,R=J.direction.y*W*J.factor;for(let[,B]of Y){if(!L(B))continue;let P={x:B.internals.positionAbsolute.x+O,y:B.internals.positionAbsolute.y+R};if(U)P=b2(P,G);let{position:A,positionAbsolute:T}=W6({nodeId:B.id,nextPosition:P,nodeLookup:Y,nodeExtent:q,nodeOrigin:K,onError:F});B.position=A,B.internals.positionAbsolute=T,H.set(B.id,B)}X(H)},[])}var h6=d.createContext(null),VU=h6.Provider;h6.Consumer;var E6=()=>{return d.useContext(h6)},uU=(_)=>({connectOnClick:_.connectOnClick,noPanClassName:_.noPanClassName,rfId:_.rfId}),h9=d.createContext(null);function bU({children:_}){let Q=T1(uU,C1);return i.jsx(h9.Provider,{value:Q,children:_})}function DU(){let _=d.useContext(h9);if(!_)throw Error("useHandleConfig must be used within a HandleConfigProvider");return _}var hU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},EU=(_,Q,J)=>(q)=>{let{connectionClickStartHandle:U,connectionMode:G,connection:Z}=q,{fromHandle:F,toHandle:X,isValid:Y}=Z;if(!F&&!U)return hU;let K=X?.nodeId===_&&X?.id===Q&&X?.type===J;return{connectingFrom:F?.nodeId===_&&F?.id===Q&&F?.type===J,connectingTo:K,clickConnecting:U?.nodeId===_&&U?.id===Q&&U?.type===J,isPossibleEndHandle:G===x0.Strict?F?.type!==J:_!==F?.nodeId||Q!==F?.id,connectionInProcess:!!F,clickConnectionInProcess:!!U,valid:K&&Y}};function xU({type:_="source",position:Q=Z1.Top,isValidConnection:J,isConnectable:q=!0,isConnectableStart:U=!0,isConnectableEnd:G=!0,id:Z,onConnect:F,children:X,className:Y,onMouseDown:K,onTouchStart:H,...L},z){let W=Z||null,O=_==="target",R=S1(),B=E6(),{connectOnClick:P,noPanClassName:A,rfId:T}=DU(),{connectingFrom:f,connectingTo:C,clickConnecting:w,isPossibleEndHandle:S,connectionInProcess:N,clickConnectionInProcess:y,valid:D}=T1(EU(B,W,_),C1);if(!B)R.getState().onError?.("010",a1.error010());let l=(b)=>{let{defaultEdgeOptions:j,onConnect:E,hasDefaultEdges:V}=R.getState(),h={...j,...b};if(V){let{edges:I,setEdges:v,onError:m}=R.getState();v(BU(h,I,{onError:m}))}E?.(h),F?.(h)},p=(b)=>{if(!B)return;let j=P6(b.nativeEvent);if(U&&(j&&b.button===0||!j)){let E=R.getState();B4.onPointerDown(b.nativeEvent,{handleDomNode:b.currentTarget,autoPanOnConnect:E.autoPanOnConnect,connectionMode:E.connectionMode,connectionRadius:E.connectionRadius,domNode:E.domNode,nodeLookup:E.nodeLookup,lib:E.lib,isTarget:O,handleId:W,nodeId:B,flowId:E.rfId,panBy:E.panBy,cancelConnection:E.cancelConnection,onConnectStart:E.onConnectStart,onConnectEnd:(...V)=>R.getState().onConnectEnd?.(...V),updateConnection:E.updateConnection,onConnect:l,isValidConnection:J||((...V)=>R.getState().isValidConnection?.(...V)??!0),getTransform:()=>R.getState().transform,getFromHandle:()=>R.getState().connection.fromHandle,autoPanSpeed:E.autoPanSpeed,dragThreshold:E.connectionDragThreshold})}if(j)K?.(b);else H?.(b)},k=(b)=>{let{onClickConnectStart:j,onClickConnectEnd:E,connectionClickStartHandle:V,connectionMode:h,isValidConnection:I,lib:v,rfId:m,nodeLookup:u,connection:n}=R.getState();if(!B||!V&&!U)return;if(!V){j?.(b.nativeEvent,{nodeId:B,handleId:W,handleType:_}),R.setState({connectionClickStartHandle:{nodeId:B,type:_,id:W}});return}let e=f6(b.target),t=J||I,{connection:a,isValid:g}=B4.isValid(b.nativeEvent,{handle:{nodeId:B,id:W,type:_},connectionMode:h,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:t,flowId:m,doc:e,lib:v,nodeLookup:u});if(g&&a)l(a);let J1=structuredClone(n);delete J1.inProgress,J1.toPosition=J1.toHandle?J1.toHandle.position:null,E?.(b,J1),R.setState({connectionClickStartHandle:null})};return i.jsx("div",{"data-handleid":W,"data-nodeid":B,"data-handlepos":Q,"data-id":`${T}-${B}-${W}-${_}`,className:v1(["react-flow__handle",`react-flow__handle-${Q}`,"nodrag",A,Y,{source:!O,target:O,connectable:q,connectablestart:U,connectableend:G,clickconnecting:w,connectingfrom:f,connectingto:C,valid:D,connectionindicator:q&&(!N||S)&&(N||y?G:U)}]),onMouseDown:p,onTouchStart:p,onClick:P?k:void 0,ref:z,...L,children:X})}var O4=d.memo(j9(xU));function mU({data:_,isConnectable:Q,sourcePosition:J=Z1.Bottom}){return i.jsxs(i.Fragment,{children:[_?.label,i.jsx(O4,{type:"source",position:J,isConnectable:Q})]})}function gU({data:_,isConnectable:Q,targetPosition:J=Z1.Top,sourcePosition:q=Z1.Bottom}){return i.jsxs(i.Fragment,{children:[i.jsx(O4,{type:"target",position:J,isConnectable:Q}),_?.label,i.jsx(O4,{type:"source",position:q,isConnectable:Q})]})}function pU(){return null}function cU({data:_,isConnectable:Q,targetPosition:J=Z1.Top}){return i.jsxs(i.Fragment,{children:[i.jsx(O4,{type:"target",position:J,isConnectable:Q}),_?.label]})}var I4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Y9={input:mU,default:gU,output:cU,group:pU};function lU(_){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 rU=(_)=>{let{width:Q,height:J,x:q,y:U}=H2(_.nodeLookup,{filter:(G)=>!!G.selected});return{width:Q0(Q)?Q:null,height:Q0(J)?J:null,userSelectionActive:_.userSelectionActive,transformString:`translate(${_.transform[0]}px,${_.transform[1]}px) scale(${_.transform[2]}) translate(${q}px,${U}px)`}};function iU({onSelectionContextMenu:_,noPanClassName:Q,disableKeyboardA11y:J}){let q=S1(),{width:U,height:G,transformString:Z,userSelectionActive:F}=T1(rU,C1),X=D9(),Y=d.useRef(null);d.useEffect(()=>{if(!J)Y.current?.focus({preventScroll:!0})},[J]);let K=!F&&U!==null&&G!==null;if(b9({nodeRef:Y,disabled:!K}),!K)return null;let H=_?(z)=>{let W=q.getState().nodes.filter((O)=>O.selected);_(z,W)}:void 0,L=(z)=>{if(Object.prototype.hasOwnProperty.call(I4,z.key))z.preventDefault(),X({direction:I4[z.key],factor:z.shiftKey?4:1})};return i.jsx("div",{className:v1(["react-flow__nodesselection","react-flow__container",Q]),style:{transform:Z},children:i.jsx("div",{ref:Y,className:"react-flow__nodesselection-rect",onContextMenu:H,tabIndex:J?void 0:-1,onKeyDown:J?void 0:L,style:{width:U,height:G}})})}var L9=typeof window<"u"?window:void 0,dU=(_)=>{return{nodesSelectionActive:_.nodesSelectionActive,userSelectionActive:_.userSelectionActive}};function E9({children:_,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,paneClickDistance:F,deleteKeyCode:X,selectionKeyCode:Y,selectionOnDrag:K,selectionMode:H,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:W,panActivationKeyCode:O,zoomActivationKeyCode:R,elementsSelectable:B,zoomOnScroll:P,zoomOnPinch:A,panOnScroll:T,panOnScrollSpeed:f,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:S,autoPanOnSelection:N,defaultViewport:y,translateExtent:D,minZoom:l,maxZoom:p,preventScrolling:k,onSelectionContextMenu:b,noWheelClassName:j,noPanClassName:E,disableKeyboardA11y:V,onViewportChange:h,isControlledViewport:I}){let{nodesSelectionActive:v,userSelectionActive:m}=T1(dU,C1),u=f5(Y,{target:L9}),n=f5(O,{target:L9}),e=n||S,t=n||T,a=K&&e!==!0,g=u||m||a;return wU({deleteKeyCode:X,multiSelectionKeyCode:W}),i.jsx(CU,{onPaneContextMenu:G,elementsSelectable:B,zoomOnScroll:P,zoomOnPinch:A,panOnScroll:t,panActivationKeyPressed:n,panOnScrollSpeed:f,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:!u&&e,defaultViewport:y,translateExtent:D,minZoom:l,maxZoom:p,zoomActivationKeyCode:R,preventScrolling:k,noWheelClassName:j,noPanClassName:E,onViewportChange:h,isControlledViewport:I,paneClickDistance:F,selectionOnDrag:a,children:i.jsxs(yU,{onSelectionStart:L,onSelectionEnd:z,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,panOnDrag:e,autoPanOnSelection:N,isSelecting:!!g,selectionMode:H,selectionKeyPressed:u,paneClickDistance:F,selectionOnDrag:a,children:[_,v&&i.jsx(iU,{onSelectionContextMenu:b,noPanClassName:E,disableKeyboardA11y:V})]})})}E9.displayName="FlowRenderer";var aU=d.memo(E9),sU=(_)=>(Q)=>{return _?G4(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 tU(_){return T1(d.useCallback(sU(_),[_]),C1)}var oU=(_)=>_.updateNodeInternals;function nU(){let _=T1(oU),[Q]=d.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 d.useEffect(()=>{return()=>{Q?.disconnect()}},[Q]),Q}function eU({node:_,nodeType:Q,hasDimensions:J,resizeObserver:q}){let U=S1(),G=d.useRef(null),Z=d.useRef(null),F=d.useRef(_.sourcePosition),X=d.useRef(_.targetPosition),Y=d.useRef(Q),K=J&&!!_.internals.handleBounds;return d.useEffect(()=>{if(G.current&&!_.hidden&&(!K||Z.current!==G.current)){if(Z.current)q?.unobserve(Z.current);q?.observe(G.current),Z.current=G.current}},[K,_.hidden]),d.useEffect(()=>{return()=>{if(Z.current)q?.unobserve(Z.current),Z.current=null}},[]),d.useEffect(()=>{if(G.current){let H=Y.current!==Q,L=F.current!==_.sourcePosition,z=X.current!==_.targetPosition;if(H||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 _G({id:_,onClick:Q,onMouseEnter:J,onMouseMove:q,onMouseLeave:U,onContextMenu:G,onDoubleClick:Z,nodesDraggable:F,elementsSelectable:X,nodesConnectable:Y,nodesFocusable:K,resizeObserver:H,noDragClassName:L,noPanClassName:z,disableKeyboardA11y:W,rfId:O,nodeTypes:R,nodeClickDistance:B,onError:P}){let{node:A,internals:T,isParent:f}=T1((g)=>{let J1=g.nodeLookup.get(_),G1=g.parentLookup.has(_);return{node:J1,internals:J1.internals,isParent:G1}},C1),C=A.type||"default",w=R?.[C]||Y9[C];if(w===void 0)P?.("003",a1.error003(C)),C="default",w=R?.default||Y9.default;let S=!!(A.draggable||F&&typeof A.draggable>"u"),N=!!(A.selectable||X&&typeof A.selectable>"u"),y=!!(A.connectable||Y&&typeof A.connectable>"u"),D=!!(A.focusable||K&&typeof A.focusable>"u"),l=S1(),p=T6(A),k=eU({node:A,nodeType:C,hasDimensions:p,resizeObserver:H}),b=b9({nodeRef:k,disabled:A.hidden||!S,noDragClassName:L,handleSelector:A.dragHandle,nodeId:_,isSelectable:N,nodeClickDistance:B}),j=D9();if(A.hidden)return null;let E=$0(A),V=lU(A),h=N||S||Q||J||q||U,I=J?(g)=>J(g,{...T.userNode}):void 0,v=q?(g)=>q(g,{...T.userNode}):void 0,m=U?(g)=>U(g,{...T.userNode}):void 0,u=G?(g)=>G(g,{...T.userNode}):void 0,n=Z?(g)=>Z(g,{...T.userNode}):void 0,e=(g)=>{let{selectNodesOnDrag:J1,nodeDragThreshold:G1}=l.getState();if(N&&(!J1||!S||G1>0))D6({id:_,store:l,nodeRef:k});if(Q)Q(g,{...T.userNode})},t=(g)=>{if(w6(g.nativeEvent)||W)return;if(H6.includes(g.key)&&N){let J1=g.key==="Escape";D6({id:_,store:l,unselect:J1,nodeRef:k})}else if(S&&A.selected&&Object.prototype.hasOwnProperty.call(I4,g.key)){g.preventDefault();let{ariaLabelConfig:J1}=l.getState();l.setState({ariaLiveMessage:J1["node.a11yDescription.ariaLiveMessage"]({direction:g.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),j({direction:I4[g.key],factor:g.shiftKey?4:1})}},a=()=>{if(W||!k.current?.matches(":focus-visible"))return;let{transform:g,width:J1,height:G1,autoPanOnNodeFocus:F1,setCenter:c}=l.getState();if(!F1)return;if(!(G4(new Map([[_,A]]),{x:0,y:0,width:J1,height:G1},g,!0).length>0))c(A.position.x+E.width/2,A.position.y+E.height/2,{zoom:g[2]})};return i.jsx("div",{className:v1(["react-flow__node",`react-flow__node-${C}`,{[z]:S},A.className,{selected:A.selected,selectable:N,parent:f,draggable:S,dragging:b}]),ref:k,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:h?"all":"none",visibility:p?"visible":"hidden",...A.style,...V},"data-id":_,"data-testid":`rf__node-${_}`,onMouseEnter:I,onMouseMove:v,onMouseLeave:m,onContextMenu:u,onClick:e,onDoubleClick:n,onKeyDown:D?t:void 0,tabIndex:D?0:void 0,onFocus:D?a:void 0,role:A.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":W?void 0:`${C9}-${O}`,"aria-label":A.ariaLabel,...A.domAttributes,children:i.jsx(VU,{value:_,children:i.jsx(w,{id:_,data:A.data,type:C,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:A.selected??!1,selectable:N,draggable:S,deletable:A.deletable??!0,isConnectable:y,sourcePosition:A.sourcePosition,targetPosition:A.targetPosition,dragging:b,dragHandle:A.dragHandle,zIndex:T.z,parentId:A.parentId,...E})})})}var QG=d.memo(_G),JG=(_)=>({nodesConnectable:_.nodesConnectable,nodesFocusable:_.nodesFocusable,elementsSelectable:_.elementsSelectable,onError:_.onError});function x9(_){let{nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,onError:U}=T1(JG,C1),G=tU(_.onlyRenderVisibleElements),Z=nU();return i.jsx("div",{className:"react-flow__nodes",style:w4,children:G.map((F)=>{return i.jsx(QG,{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)})})}x9.displayName="NodeRenderer";var $G=d.memo(x9);function qG(_){return T1(d.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&&R7({sourceNode:G,targetNode:Z,width:J.width,height:J.height,transform:J.transform}))q.push(U.id)}return q},[_]),C1)}var UG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_}};return i.jsx("polyline",{className:"arrow",style:J,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},GG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_,fill:_}};return i.jsx("polyline",{className:"arrowclosed",style:J,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},z9={[y2.Arrow]:UG,[y2.ArrowClosed]:GG};function ZG(_){let Q=S1();return d.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(z9,_))return Q.getState().onError?.("009",a1.error009(_)),null;return z9[_]},[_])}var FG=({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=ZG(Q);if(!X)return null;return i.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:i.jsx(X,{color:J,strokeWidth:Z})})},m9=({defaultColor:_,rfId:Q})=>{let J=T1((G)=>G.edges),q=T1((G)=>G.defaultEdgeOptions),U=d.useMemo(()=>{return f7(J,{id:Q,defaultColor:_,defaultMarkerStart:q?.markerStart,defaultMarkerEnd:q?.markerEnd})},[J,q,Q,_]);if(!U.length)return null;return i.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:i.jsx("defs",{children:U.map((G)=>i.jsx(FG,{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))})})};m9.displayName="MarkerDefinitions";var HG=d.memo(m9);function g9({x:_,y:Q,label:J,labelStyle:q,labelShowBg:U=!0,labelBgStyle:G,labelBgPadding:Z=[2,4],labelBgBorderRadius:F=2,children:X,className:Y,...K}){let[H,L]=d.useState({x:1,y:0,width:0,height:0}),z=v1(["react-flow__edge-textwrapper",Y]),W=d.useRef(null);if(d.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 i.jsxs("g",{transform:`translate(${_-H.width/2} ${Q-H.height/2})`,className:z,visibility:H.width?"visible":"hidden",...K,children:[U&&i.jsx("rect",{width:H.width+2*Z[0],x:-Z[0],y:-Z[1],height:H.height+2*Z[1],className:"react-flow__edge-textbg",style:G,rx:F,ry:F}),i.jsx("text",{className:"react-flow__edge-text",y:H.height/2,dy:"0.3em",ref:W,style:q,children:J}),X]})}g9.displayName="EdgeText";var KG=d.memo(g9);function P4({path:_,labelX:Q,labelY:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X,interactionWidth:Y=20,...K}){return i.jsxs(i.Fragment,{children:[i.jsx("path",{...K,d:_,fill:"none",className:v1(["react-flow__edge-path",K.className])}),Y?i.jsx("path",{d:_,fill:"none",strokeOpacity:0,strokeWidth:Y,className:"react-flow__edge-interaction"}):null,q&&Q0(Q)&&Q0(J)?i.jsx(KG,{x:Q,y:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X}):null]})}function W9({pos:_,x1:Q,y1:J,x2:q,y2:U}){if(_===Z1.Left||_===Z1.Right)return[0.5*(Q+q),J];return[Q,0.5*(J+U)]}function p9({sourceX:_,sourceY:Q,sourcePosition:J=Z1.Bottom,targetX:q,targetY:U,targetPosition:G=Z1.Top}){let[Z,F]=W9({pos:J,x1:_,y1:Q,x2:q,y2:U}),[X,Y]=W9({pos:G,x1:q,y1:U,x2:_,y2:Q}),[K,H,L,z]=X4({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}`,K,H,L,z]}function c9(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z,targetPosition:F,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:R,interactionWidth:B})=>{let[P,A,T]=p9({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F}),f=_.isInternal?void 0:Q;return i.jsx(P4,{id:f,path:P,labelX:A,labelY:T,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:R,interactionWidth:B})})}var XG=c9({isInternal:!1}),l9=c9({isInternal:!0});XG.displayName="SimpleBezierEdge";l9.displayName="SimpleBezierEdgeInternal";function r9(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,sourcePosition:z=Z1.Bottom,targetPosition:W=Z1.Top,markerEnd:O,markerStart:R,pathOptions:B,interactionWidth:P})=>{let[A,T,f]=I5({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 i.jsx(P4,{id:C,path:A,labelX:T,labelY:f,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:O,markerStart:R,interactionWidth:P})})}var i9=r9({isInternal:!1}),d9=r9({isInternal:!0});i9.displayName="SmoothStepEdge";d9.displayName="SmoothStepEdgeInternal";function a9(_){return d.memo(({id:Q,...J})=>{let q=_.isInternal?void 0:Q;return i.jsx(i9,{...J,id:q,pathOptions:d.useMemo(()=>({borderRadius:0,offset:J.pathOptions?.offset}),[J.pathOptions?.offset])})})}var YG=a9({isInternal:!1}),s9=a9({isInternal:!0});YG.displayName="StepEdge";s9.displayName="StepEdgeInternal";function t9(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:z,markerStart:W,interactionWidth:O})=>{let[R,B,P]=L4({sourceX:J,sourceY:q,targetX:U,targetY:G}),A=_.isInternal?void 0:Q;return i.jsx(P4,{id:A,path:R,labelX:B,labelY:P,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:z,markerStart:W,interactionWidth:O})})}var LG=t9({isInternal:!1}),o9=t9({isInternal:!0});LG.displayName="StraightEdge";o9.displayName="StraightEdgeInternal";function n9(_){return d.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z=Z1.Bottom,targetPosition:F=Z1.Top,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:R,pathOptions:B,interactionWidth:P})=>{let[A,T,f]=Y4({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F,curvature:B?.curvature}),C=_.isInternal?void 0:Q;return i.jsx(P4,{id:C,path:A,labelX:T,labelY:f,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:z,style:W,markerEnd:O,markerStart:R,interactionWidth:P})})}var zG=n9({isInternal:!1}),e9=n9({isInternal:!0});zG.displayName="BezierEdge";e9.displayName="BezierEdgeInternal";var A9={default:e9,straight:o9,step:s9,smoothstep:d9,simplebezier:l9},B9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},WG=(_,Q,J)=>{if(J===Z1.Left)return _-Q;if(J===Z1.Right)return _+Q;return _},AG=(_,Q,J)=>{if(J===Z1.Top)return _-Q;if(J===Z1.Bottom)return _+Q;return _},M9="react-flow__edgeupdater";function T9({position:_,centerX:Q,centerY:J,radius:q=10,onMouseDown:U,onMouseEnter:G,onMouseOut:Z,type:F}){return i.jsx("circle",{onMouseDown:U,onMouseEnter:G,onMouseOut:Z,className:v1([M9,`${M9}-${F}`]),cx:WG(Q,q,_),cy:AG(J,q,_),r:q,stroke:"transparent",fill:"transparent"})}function BG({isReconnectable:_,reconnectRadius:Q,edge:J,sourceX:q,sourceY:U,targetX:G,targetY:Z,sourcePosition:F,targetPosition:X,onReconnect:Y,onReconnectStart:K,onReconnectEnd:H,setReconnecting:L,setUpdateHover:z}){let W=S1(),O=(T,f)=>{if(T.button!==0)return;let{autoPanOnConnect:C,domNode:w,connectionMode:S,connectionRadius:N,lib:y,onConnectStart:D,cancelConnection:l,nodeLookup:p,rfId:k,panBy:b,updateConnection:j}=W.getState(),E=f.type==="target",V=(v,m)=>{L(!1),H?.(v,J,f.type,m)},h=(v)=>Y?.(J,v),I=(v,m)=>{L(!0),K?.(T,J,f.type),D?.(v,m)};B4.onPointerDown(T.nativeEvent,{autoPanOnConnect:C,connectionMode:S,connectionRadius:N,domNode:w,handleId:f.id,nodeId:f.nodeId,nodeLookup:p,isTarget:E,edgeUpdaterType:f.type,lib:y,flowId:k,cancelConnection:l,panBy:b,isValidConnection:(...v)=>W.getState().isValidConnection?.(...v)??!0,onConnect:h,onConnectStart:I,onConnectEnd:(...v)=>W.getState().onConnectEnd?.(...v),onReconnectEnd:V,updateConnection:j,getTransform:()=>W.getState().transform,getFromHandle:()=>W.getState().connection.fromHandle,dragThreshold:W.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},R=(T)=>O(T,{nodeId:J.target,id:J.targetHandle??null,type:"target"}),B=(T)=>O(T,{nodeId:J.source,id:J.sourceHandle??null,type:"source"}),P=()=>z(!0),A=()=>z(!1);return i.jsxs(i.Fragment,{children:[(_===!0||_==="source")&&i.jsx(T9,{position:F,centerX:q,centerY:U,radius:Q,onMouseDown:R,onMouseEnter:P,onMouseOut:A,type:"source"}),(_===!0||_==="target")&&i.jsx(T9,{position:X,centerX:G,centerY:Z,radius:Q,onMouseDown:B,onMouseEnter:P,onMouseOut:A,type:"target"})]})}function MG({id:_,edgesFocusable:Q,edgesReconnectable:J,elementsSelectable:q,onClick:U,onDoubleClick:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,reconnectRadius:K,onReconnect:H,onReconnectStart:L,onReconnectEnd:z,rfId:W,edgeTypes:O,noPanClassName:R,onError:B,disableKeyboardA11y:P}){let A=T1((c)=>c.edgeLookup.get(_)),T=T1((c)=>c.defaultEdgeOptions);A=T?{...T,...A}:A;let f=A.type||"default",C=O?.[f]||A9[f];if(C===void 0)B?.("011",a1.error011(f)),f="default",C=O?.default||A9.default;let w=!!(A.focusable||Q&&typeof A.focusable>"u"),S=typeof H<"u"&&(A.reconnectable||J&&typeof A.reconnectable>"u"),N=!!(A.selectable||q&&typeof A.selectable>"u"),y=d.useRef(null),[D,l]=d.useState(!1),[p,k]=d.useState(!1),b=S1(),{zIndex:j=A.zIndex,sourceX:E,sourceY:V,targetX:h,targetY:I,sourcePosition:v,targetPosition:m}=T1(d.useCallback((c)=>{let s=c.nodeLookup.get(A.source),_1=c.nodeLookup.get(A.target);if(!s||!_1)return B9;let q1=I7({id:_,sourceNode:s,targetNode:_1,sourceHandle:A.sourceHandle||null,targetHandle:A.targetHandle||null,connectionMode:c.connectionMode,onError:B}),o=T7({selected:A.selected,zIndex:A.zIndex,sourceNode:s,targetNode:_1,elevateOnSelect:c.elevateEdgesOnSelect,zIndexMode:c.zIndexMode});return{...q1||B9,zIndex:o}},[A.source,A.target,A.sourceHandle,A.targetHandle,A.selected,A.zIndex,B]),C1),u=d.useMemo(()=>A.markerStart?`url('#${z4(A.markerStart,W)}')`:void 0,[A.markerStart,W]),n=d.useMemo(()=>A.markerEnd?`url('#${z4(A.markerEnd,W)}')`:void 0,[A.markerEnd,W]);if(A.hidden||E===null||V===null||h===null||I===null)return null;let e=(c)=>{let{addSelectedEdges:s,unselectNodesAndEdges:_1,multiSelectionActive:q1}=b.getState();if(N)if(b.setState({nodesSelectionActive:!1}),A.selected&&q1)_1({nodes:[],edges:[A]}),y.current?.blur();else s([_]);if(U)U(c,A)},t=G?(c)=>{G(c,{...A})}:void 0,a=Z?(c)=>{Z(c,{...A})}:void 0,g=F?(c)=>{F(c,{...A})}:void 0,J1=X?(c)=>{X(c,{...A})}:void 0,G1=Y?(c)=>{Y(c,{...A})}:void 0,F1=(c)=>{if(!P&&H6.includes(c.key)&&N){let{unselectNodesAndEdges:s,addSelectedEdges:_1}=b.getState();if(c.key==="Escape")y.current?.blur(),s({edges:[A]});else _1([_])}};return i.jsx("svg",{style:{zIndex:j},children:i.jsxs("g",{className:v1(["react-flow__edge",`react-flow__edge-${f}`,A.className,R,{selected:A.selected,animated:A.animated,inactive:!N&&!U,updating:D,selectable:N}]),onClick:e,onDoubleClick:t,onContextMenu:a,onMouseEnter:g,onMouseMove:J1,onMouseLeave:G1,onKeyDown:w?F1:void 0,tabIndex:w?0:void 0,role:A.ariaRole??(w?"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":w?`${S9}-${W}`:void 0,ref:y,...A.domAttributes,children:[!p&&i.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:E,sourceY:V,targetX:h,targetY:I,sourcePosition:v,targetPosition:m,data:A.data,style:A.style,sourceHandleId:A.sourceHandle,targetHandleId:A.targetHandle,markerStart:u,markerEnd:n,pathOptions:"pathOptions"in A?A.pathOptions:void 0,interactionWidth:A.interactionWidth}),S&&i.jsx(BG,{edge:A,isReconnectable:S,reconnectRadius:K,onReconnect:H,onReconnectStart:L,onReconnectEnd:z,sourceX:E,sourceY:V,targetX:h,targetY:I,sourcePosition:v,targetPosition:m,setUpdateHover:l,setReconnecting:k})]})})}var TG=d.memo(MG),RG=(_)=>({edgesFocusable:_.edgesFocusable,edgesReconnectable:_.edgesReconnectable,elementsSelectable:_.elementsSelectable,connectionMode:_.connectionMode,onError:_.onError});function __({defaultMarkerColor:_,onlyRenderVisibleElements:Q,rfId:J,edgeTypes:q,noPanClassName:U,onReconnect:G,onEdgeContextMenu:Z,onEdgeMouseEnter:F,onEdgeMouseMove:X,onEdgeMouseLeave:Y,onEdgeClick:K,reconnectRadius:H,onEdgeDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,disableKeyboardA11y:O}){let{edgesFocusable:R,edgesReconnectable:B,elementsSelectable:P,onError:A}=T1(RG,C1),T=qG(Q);return i.jsxs("div",{className:"react-flow__edges",children:[i.jsx(HG,{defaultColor:_,rfId:J}),T.map((f)=>{return i.jsx(TG,{id:f,edgesFocusable:R,edgesReconnectable:B,elementsSelectable:P,noPanClassName:U,onReconnect:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,onClick:K,reconnectRadius:H,onDoubleClick:L,onReconnectStart:z,onReconnectEnd:W,rfId:J,onError:A,edgeTypes:q,disableKeyboardA11y:O},f)})]})}__.displayName="EdgeRenderer";var OG=d.memo(__),R9=(_)=>`translate(${_[0]}px,${_[1]}px) scale(${_[2]})`;function IG({children:_}){let Q=S1(),J=d.useRef(null),[q]=d.useState(()=>Q.getState().transform);return V9(()=>{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=R9(Z)};return G(),Q.subscribe(G)},[Q]),i.jsx("div",{ref:J,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:R9(q)},children:_})}function fG(_){let Q=w5(),J=d.useRef(!1);d.useEffect(()=>{if(!J.current&&Q.viewportInitialized&&_)setTimeout(()=>_(Q),1),J.current=!0},[_,Q.viewportInitialized])}var wG=(_)=>_.panZoom?.syncViewport;function PG(_){let Q=T1(wG),J=S1();return d.useEffect(()=>{if(_)Q?.(_),J.setState({transform:[_.x,_.y,_.zoom]})},[_,Q]),null}function O9(_){return _.connection.inProgress?{..._.connection,to:D2(_.connection.to,_.transform)}:{..._.connection}}function NG(_){if(_)return(J)=>{let q=O9(J);return _(q)};return O9}function CG(_){let Q=NG(_);return T1(Q,C1)}var SG=(_)=>({nodesConnectable:_.nodesConnectable,isValid:_.connection.isValid,inProgress:_.connection.inProgress,width:_.width,height:_.height});function kG({containerStyle:_,style:Q,type:J,component:q}){let{nodesConnectable:U,width:G,height:Z,isValid:F,inProgress:X}=T1(SG,C1);if(!(G&&U&&X))return null;return i.jsx("svg",{style:_,width:G,height:Z,className:"react-flow__connectionline react-flow__container",children:i.jsx("g",{className:v1(["react-flow__connection",I6(F)]),children:i.jsx(Q_,{style:Q,type:J,CustomComponent:q,isValid:F})})})}var Q_=({style:_,type:Q=B0.Bezier,CustomComponent:J,isValid:q})=>{let{inProgress:U,from:G,fromNode:Z,fromHandle:F,fromPosition:X,to:Y,toNode:K,toHandle:H,toPosition:L,pointer:z}=CG();if(!U)return;if(J)return i.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:I6(q),toNode:K,toHandle:H,pointer:z});let W="",O={sourceX:G.x,sourceY:G.y,sourcePosition:X,targetX:Y.x,targetY:Y.y,targetPosition:L};switch(Q){case B0.Bezier:[W]=Y4(O);break;case B0.SimpleBezier:[W]=p9(O);break;case B0.Step:[W]=I5({...O,borderRadius:0});break;case B0.SmoothStep:[W]=I5(O);break;default:[W]=L4(O)}return i.jsx("path",{d:W,fill:"none",className:"react-flow__connection-path",style:_})};Q_.displayName="ConnectionLine";var vG={};function I9(_=vG){let Q=d.useRef(_),J=S1();d.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",a1.error002());break}Q.current=_}},[_])}function yG(){let _=S1(),Q=d.useRef(!1);d.useEffect(()=>{if(!Q.current){let J=document.querySelector(".react-flow__pane");if(J&&window.getComputedStyle(J).zIndex!=="1")_.getState().onError?.("013",a1.error013("react"));Q.current=!0}},[])}function J_({nodeTypes:_,edgeTypes:Q,onInit:J,onNodeClick:q,onEdgeClick:U,onNodeDoubleClick:G,onEdgeDoubleClick:Z,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:K,onSelectionContextMenu:H,onSelectionStart:L,onSelectionEnd:z,connectionLineType:W,connectionLineStyle:O,connectionLineComponent:R,connectionLineContainerStyle:B,selectionKeyCode:P,selectionOnDrag:A,selectionMode:T,multiSelectionKeyCode:f,panActivationKeyCode:C,zoomActivationKeyCode:w,deleteKeyCode:S,onlyRenderVisibleElements:N,elementsSelectable:y,defaultViewport:D,translateExtent:l,minZoom:p,maxZoom:k,preventScrolling:b,defaultMarkerColor:j,zoomOnScroll:E,zoomOnPinch:V,panOnScroll:h,panOnScrollSpeed:I,panOnScrollMode:v,zoomOnDoubleClick:m,panOnDrag:u,autoPanOnSelection:n,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:a,onPaneMouseLeave:g,onPaneScroll:J1,onPaneContextMenu:G1,paneClickDistance:F1,nodeClickDistance:c,onEdgeContextMenu:s,onEdgeMouseEnter:_1,onEdgeMouseMove:q1,onEdgeMouseLeave:o,reconnectRadius:K1,onReconnect:$1,onReconnectStart:M1,onReconnectEnd:R1,noDragClassName:x1,noWheelClassName:U0,noPanClassName:k1,disableKeyboardA11y:R0,nodeExtent:t1,rfId:e1,viewport:_0,onViewportChange:X0,nodesDraggable:T2}){return I9(_),I9(Q),yG(),fG(J),PG(_0),i.jsx(aU,{onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:a,onPaneMouseLeave:g,onPaneContextMenu:G1,onPaneScroll:J1,paneClickDistance:F1,deleteKeyCode:S,selectionKeyCode:P,selectionOnDrag:A,selectionMode:T,onSelectionStart:L,onSelectionEnd:z,multiSelectionKeyCode:f,panActivationKeyCode:C,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:E,zoomOnPinch:V,zoomOnDoubleClick:m,panOnScroll:h,panOnScrollSpeed:I,panOnScrollMode:v,panOnDrag:u,autoPanOnSelection:n,defaultViewport:D,translateExtent:l,minZoom:p,maxZoom:k,onSelectionContextMenu:H,preventScrolling:b,noDragClassName:x1,noWheelClassName:U0,noPanClassName:k1,disableKeyboardA11y:R0,onViewportChange:X0,isControlledViewport:!!_0,children:i.jsxs(IG,{children:[i.jsx(OG,{edgeTypes:Q,onEdgeClick:U,onEdgeDoubleClick:Z,onReconnect:$1,onReconnectStart:M1,onReconnectEnd:R1,onlyRenderVisibleElements:N,onEdgeContextMenu:s,onEdgeMouseEnter:_1,onEdgeMouseMove:q1,onEdgeMouseLeave:o,reconnectRadius:K1,defaultMarkerColor:j,noPanClassName:k1,disableKeyboardA11y:R0,rfId:e1}),i.jsx(kG,{style:O,type:W,component:R,containerStyle:B}),i.jsx("div",{className:"react-flow__edgelabel-renderer"}),i.jsx($G,{nodeTypes:_,onNodeClick:q,onNodeDoubleClick:G,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:K,nodeClickDistance:c,onlyRenderVisibleElements:N,noPanClassName:k1,noDragClassName:x1,disableKeyboardA11y:R0,nodeExtent:t1,rfId:e1,nodesDraggable:T2}),i.jsx("div",{className:"react-flow__viewport-portal"})]})})}J_.displayName="GraphView";var jG=d.memo(J_),VG=M6("React Flow","https://reactflow.dev/"),f9=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X=0.5,maxZoom:Y=2,nodeOrigin:K,nodeExtent:H,zIndexMode:L="basic"}={})=>{let z=new Map,W=new Map,O=new Map,R=new Map,B=q??Q??[],P=J??_??[],A=K??[0,0],T=H??V2;y6(O,R,B);let{nodesInitialized:f}=W4(P,z,W,{nodeOrigin:A,nodeExtent:T,zIndexMode:L}),C=[0,0,1];if(Z&&U&&G){let w=H2(z,{filter:(D)=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:S,y:N,zoom:y}=O5(w,U,G,X,Y,F?.padding??0.1);C=[S,N,y]}return{rfId:"1",width:U??0,height:G??0,transform:C,nodes:P,nodesInitialized:f,nodeLookup:z,parentLookup:W,edges:B,edgeLookup:R,connectionLookup:O,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:J!==void 0,hasDefaultEdges:q!==void 0,panZoom:null,minZoom:X,maxZoom:Y,translateExtent:V2,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:x0.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:{...X6},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:VG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:K6,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}},uG=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:K,nodeExtent:H,zIndexMode:L})=>s7((z,W)=>{async function O(){let{nodeLookup:R,panZoom:B,fitViewOptions:P,fitViewResolver:A,width:T,height:f,minZoom:C,maxZoom:w}=W();if(!B)return;await Y7({nodes:R,width:T,height:f,panZoom:B,minZoom:C,maxZoom:w},P),A?.resolve(!0),z({fitViewResolver:null})}return{...f9({nodes:_,edges:Q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:K,nodeExtent:H,defaultNodes:J,defaultEdges:q,zIndexMode:L}),setNodes:(R)=>{let{nodeLookup:B,parentLookup:P,nodeOrigin:A,nodeExtent:T,elevateNodesOnSelect:f,fitViewQueued:C,zIndexMode:w,nodesSelectionActive:S}=W(),{nodesInitialized:N,hasSelectedNodes:y}=W4(R,B,P,{nodeOrigin:A,nodeExtent:T,elevateNodesOnSelect:f,checkEquality:!0,zIndexMode:w}),D=S&&y;if(C&&N)O(),z({nodes:R,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D});else z({nodes:R,nodesInitialized:N,nodesSelectionActive:D})},setEdges:(R)=>{let{connectionLookup:B,edgeLookup:P}=W();y6(B,P,R),z({edges:R})},setDefaultNodesAndEdges:(R,B)=>{if(R){let{setNodes:P}=W();P(R),z({hasDefaultNodes:!0})}if(B){let{setEdges:P}=W();P(B),z({hasDefaultEdges:!0})}},updateNodeInternals:(R)=>{let{triggerNodeChanges:B,nodeLookup:P,parentLookup:A,domNode:T,nodeOrigin:f,nodeExtent:C,debug:w,fitViewQueued:S,zIndexMode:N}=W(),{changes:y,updatedInternals:D}=S7(R,P,A,T,f,C,N);if(!D)return;if(N7(P,A,{nodeOrigin:f,nodeExtent:C,zIndexMode:N}),S)O(),z({fitViewQueued:!1,fitViewOptions:void 0});else z({});if(y?.length>0){if(w)console.log("React Flow: trigger node changes",y);B?.(y)}},updateNodePositions:(R,B=!1)=>{let P=[],A=[],{nodeLookup:T,triggerNodeChanges:f,connection:C,updateConnection:w,onNodesChangeMiddlewareMap:S}=W();for(let[N,y]of R){let D=T.get(N),l=!!(D?.expandParent&&D?.parentId&&y?.position),p={id:N,type:"position",position:l?{x:Math.max(0,y.position.x),y:Math.max(0,y.position.y)}:y.position,dragging:B};if(D&&C.inProgress&&C.fromNode.id===D.id){let k=m0(D,C.fromHandle,Z1.Left,!0);w({...C,from:k})}if(l&&D.parentId)P.push({id:N,parentId:D.parentId,rect:{...y.internals.positionAbsolute,width:y.measured.width??0,height:y.measured.height??0}});A.push(p)}if(P.length>0){let{parentLookup:N,nodeOrigin:y}=W(),D=A4(P,T,N,y);A.push(...D)}for(let N of S.values())A=N(A);f(A)},triggerNodeChanges:(R)=>{let{onNodesChange:B,setNodes:P,nodes:A,hasDefaultNodes:T,debug:f}=W();if(R?.length){if(T){let C=y9(R,A);P(C)}if(f)console.log("React Flow: trigger node changes",R);B?.(R)}},triggerEdgeChanges:(R)=>{let{onEdgesChange:B,setEdges:P,edges:A,hasDefaultEdges:T,debug:f}=W();if(R?.length){if(T){let C=WU(R,A);P(C)}if(f)console.log("React Flow: trigger edge changes",R);B?.(R)}},addSelectedNodes:(R)=>{let{multiSelectionActive:B,edgeLookup:P,nodeLookup:A,triggerNodeChanges:T,triggerEdgeChanges:f}=W();if(B){let C=R.map((w)=>K2(w,!0));T(C);return}T(E2(A,new Set([...R]),!0)),f(E2(P))},addSelectedEdges:(R)=>{let{multiSelectionActive:B,edgeLookup:P,nodeLookup:A,triggerNodeChanges:T,triggerEdgeChanges:f}=W();if(B){let C=R.map((w)=>K2(w,!0));f(C);return}f(E2(P,new Set([...R]))),T(E2(A,new Set,!0))},unselectNodesAndEdges:({nodes:R,edges:B}={})=>{let{edges:P,nodes:A,nodeLookup:T,triggerNodeChanges:f,triggerEdgeChanges:C}=W(),w=R?R:A,S=B?B:P,N=[];for(let D of w){if(!D.selected)continue;let l=T.get(D.id);if(l)l.selected=!1;N.push(K2(D.id,!1))}let y=[];for(let D of S){if(!D.selected)continue;y.push(K2(D.id,!1))}f(N),C(y)},setMinZoom:(R)=>{let{panZoom:B,maxZoom:P}=W();B?.setScaleExtent([R,P]),z({minZoom:R})},setMaxZoom:(R)=>{let{panZoom:B,minZoom:P}=W();B?.setScaleExtent([P,R]),z({maxZoom:R})},setTranslateExtent:(R)=>{W().panZoom?.setTranslateExtent(R),z({translateExtent:R})},resetSelectedElements:()=>{let{edges:R,nodes:B,triggerNodeChanges:P,triggerEdgeChanges:A,elementsSelectable:T}=W();if(!T)return;let f=B.reduce((w,S)=>S.selected?[...w,K2(S.id,!1)]:w,[]),C=R.reduce((w,S)=>S.selected?[...w,K2(S.id,!1)]:w,[]);P(f),A(C)},setNodeExtent:(R)=>{let{nodes:B,nodeLookup:P,parentLookup:A,nodeOrigin:T,elevateNodesOnSelect:f,nodeExtent:C,zIndexMode:w}=W();if(R[0][0]===C[0][0]&&R[0][1]===C[0][1]&&R[1][0]===C[1][0]&&R[1][1]===C[1][1])return;W4(B,P,A,{nodeOrigin:T,nodeExtent:R,elevateNodesOnSelect:f,checkEquality:!1,zIndexMode:w}),z({nodeExtent:R})},panBy:(R)=>{let{transform:B,width:P,height:A,panZoom:T,translateExtent:f}=W();return k7({delta:R,panZoom:T,transform:B,translateExtent:f,width:P,height:A})},setCenter:async(R,B,P)=>{let{width:A,height:T,maxZoom:f,panZoom:C}=W();if(!C)return!1;let w=typeof P?.zoom<"u"?P.zoom:f;return await C.setViewport({x:A/2-R*w,y:T/2-B*w,zoom:w},{duration:P?.duration,ease:P?.ease,interpolate:P?.interpolate}),!0},cancelConnection:()=>{z({connection:{...X6}})},updateConnection:(R)=>{z({connection:R})},reset:()=>z({...f9()})}},Object.is);function x6({initialNodes:_,initialEdges:Q,defaultNodes:J,defaultEdges:q,initialWidth:U,initialHeight:G,initialMinZoom:Z,initialMaxZoom:F,initialFitViewOptions:X,fitView:Y,nodeOrigin:K,nodeExtent:H,zIndexMode:L,children:z}){let[W]=d.useState(()=>uG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Y,minZoom:Z,maxZoom:F,fitViewOptions:X,nodeOrigin:K,nodeExtent:H,zIndexMode:L}));return i.jsx(sq,{value:W,children:i.jsx(RU,{children:i.jsx(bU,{children:z})})})}function bG({children:_,nodes:Q,edges:J,defaultNodes:q,defaultEdges:U,width:G,height:Z,fitView:F,fitViewOptions:X,minZoom:Y,maxZoom:K,nodeOrigin:H,nodeExtent:L,zIndexMode:z}){if(d.useContext(f4))return i.jsx(i.Fragment,{children:_});return i.jsx(x6,{initialNodes:Q,initialEdges:J,defaultNodes:q,defaultEdges:U,initialWidth:G,initialHeight:Z,fitView:F,initialFitViewOptions:X,initialMinZoom:Y,initialMaxZoom:K,nodeOrigin:H,nodeExtent:L,zIndexMode:z,children:_})}var DG={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function hG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,className:U,nodeTypes:G,edgeTypes:Z,onNodeClick:F,onEdgeClick:X,onInit:Y,onMove:K,onMoveStart:H,onMoveEnd:L,onConnect:z,onConnectStart:W,onConnectEnd:O,onClickConnectStart:R,onClickConnectEnd:B,onNodeMouseEnter:P,onNodeMouseMove:A,onNodeMouseLeave:T,onNodeContextMenu:f,onNodeDoubleClick:C,onNodeDragStart:w,onNodeDrag:S,onNodeDragStop:N,onNodesDelete:y,onEdgesDelete:D,onDelete:l,onSelectionChange:p,onSelectionDragStart:k,onSelectionDrag:b,onSelectionDragStop:j,onSelectionContextMenu:E,onSelectionStart:V,onSelectionEnd:h,onBeforeDelete:I,connectionMode:v,connectionLineType:m=B0.Bezier,connectionLineStyle:u,connectionLineComponent:n,connectionLineContainerStyle:e,deleteKeyCode:t="Backspace",selectionKeyCode:a="Shift",selectionOnDrag:g=!1,selectionMode:J1=U2.Full,panActivationKeyCode:G1="Space",multiSelectionKeyCode:F1=h2()?"Meta":"Control",zoomActivationKeyCode:c=h2()?"Meta":"Control",snapToGrid:s,snapGrid:_1,onlyRenderVisibleElements:q1=!1,selectNodesOnDrag:o,nodesDraggable:K1,autoPanOnNodeFocus:$1,nodesConnectable:M1,nodesFocusable:R1,nodeOrigin:x1=k9,edgesFocusable:U0,edgesReconnectable:k1,elementsSelectable:R0=!0,defaultViewport:t1=FU,minZoom:e1=0.5,maxZoom:_0=2,translateExtent:X0=V2,preventScrolling:T2=!0,nodeExtent:y0,defaultMarkerColor:R2="#b1b1b7",zoomOnScroll:O2=!0,zoomOnPinch:r2=!0,panOnScroll:V5=!1,panOnScrollSpeed:d0=0.5,panOnScrollMode:M=P0.Free,zoomOnDoubleClick:x=!0,panOnDrag:Q1=!0,onPaneClick:U1,onPaneMouseEnter:H1,onPaneMouseMove:W1,onPaneMouseLeave:z1,onPaneScroll:P1,onPaneContextMenu:A1,paneClickDistance:Y0=1,nodeClickDistance:j0=0,children:u4,onReconnect:b4,onReconnectStart:_Q,onReconnectEnd:QQ,onEdgeContextMenu:JQ,onEdgeDoubleClick:$Q,onEdgeMouseEnter:qQ,onEdgeMouseMove:UQ,onEdgeMouseLeave:GQ,reconnectRadius:ZQ=10,onNodesChange:FQ,onEdgesChange:HQ,noDragClassName:KQ="nodrag",noWheelClassName:XQ="nowheel",noPanClassName:J8="nopan",fitView:$8,fitViewOptions:q8,connectOnClick:YQ,attributionPosition:LQ,proOptions:zQ,defaultEdgeOptions:WQ,elevateNodesOnSelect:AQ=!0,elevateEdgesOnSelect:BQ=!1,disableKeyboardA11y:U8=!1,autoPanOnConnect:MQ,autoPanOnNodeDrag:TQ,autoPanOnSelection:RQ=!0,autoPanSpeed:OQ,connectionRadius:IQ,isValidConnection:fQ,onError:wQ,style:PQ,id:G8,nodeDragThreshold:NQ,connectionDragThreshold:CQ,viewport:SQ,onViewportChange:kQ,width:vQ,height:yQ,colorMode:jQ="light",debug:VQ,onScroll:Z8,ariaLabelConfig:uQ,zIndexMode:F8="basic",...bQ},DQ){let D4=G8||"1",hQ=YU(jQ),EQ=d.useCallback((H8)=>{H8.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Z8?.(H8)},[Z8]);return i.jsx("div",{"data-testid":"rf__wrapper",...bQ,onScroll:EQ,style:{...PQ,...DG},ref:DQ,className:v1(["react-flow",U,hQ]),id:G8,role:"application",children:i.jsxs(bG,{nodes:_,edges:Q,width:vQ,height:yQ,fitView:$8,fitViewOptions:q8,minZoom:e1,maxZoom:_0,nodeOrigin:x1,nodeExtent:y0,zIndexMode:F8,children:[i.jsx(XU,{nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,onConnect:z,onConnectStart:W,onConnectEnd:O,onClickConnectStart:R,onClickConnectEnd:B,nodesDraggable:K1,autoPanOnNodeFocus:$1,nodesConnectable:M1,nodesFocusable:R1,edgesFocusable:U0,edgesReconnectable:k1,elementsSelectable:R0,elevateNodesOnSelect:AQ,elevateEdgesOnSelect:BQ,minZoom:e1,maxZoom:_0,nodeExtent:y0,onNodesChange:FQ,onEdgesChange:HQ,snapToGrid:s,snapGrid:_1,connectionMode:v,translateExtent:X0,connectOnClick:YQ,defaultEdgeOptions:WQ,fitView:$8,fitViewOptions:q8,onNodesDelete:y,onEdgesDelete:D,onDelete:l,onNodeDragStart:w,onNodeDrag:S,onNodeDragStop:N,onSelectionDrag:b,onSelectionDragStart:k,onSelectionDragStop:j,onMove:K,onMoveStart:H,onMoveEnd:L,noPanClassName:J8,nodeOrigin:x1,rfId:D4,autoPanOnConnect:MQ,autoPanOnNodeDrag:TQ,autoPanSpeed:OQ,onError:wQ,connectionRadius:IQ,isValidConnection:fQ,selectNodesOnDrag:o,nodeDragThreshold:NQ,connectionDragThreshold:CQ,onBeforeDelete:I,debug:VQ,ariaLabelConfig:uQ,zIndexMode:F8}),i.jsx(jG,{onInit:Y,onNodeClick:F,onEdgeClick:X,onNodeMouseEnter:P,onNodeMouseMove:A,onNodeMouseLeave:T,onNodeContextMenu:f,onNodeDoubleClick:C,nodeTypes:G,edgeTypes:Z,connectionLineType:m,connectionLineStyle:u,connectionLineComponent:n,connectionLineContainerStyle:e,selectionKeyCode:a,selectionOnDrag:g,selectionMode:J1,deleteKeyCode:t,multiSelectionKeyCode:F1,panActivationKeyCode:G1,zoomActivationKeyCode:c,onlyRenderVisibleElements:q1,defaultViewport:t1,translateExtent:X0,minZoom:e1,maxZoom:_0,preventScrolling:T2,zoomOnScroll:O2,zoomOnPinch:r2,zoomOnDoubleClick:x,panOnScroll:V5,panOnScrollSpeed:d0,panOnScrollMode:M,panOnDrag:Q1,autoPanOnSelection:RQ,onPaneClick:U1,onPaneMouseEnter:H1,onPaneMouseMove:W1,onPaneMouseLeave:z1,onPaneScroll:P1,onPaneContextMenu:A1,paneClickDistance:Y0,nodeClickDistance:j0,onSelectionContextMenu:E,onSelectionStart:V,onSelectionEnd:h,onReconnect:b4,onReconnectStart:_Q,onReconnectEnd:QQ,onEdgeContextMenu:JQ,onEdgeDoubleClick:$Q,onEdgeMouseEnter:qQ,onEdgeMouseMove:UQ,onEdgeMouseLeave:GQ,reconnectRadius:ZQ,defaultMarkerColor:R2,noDragClassName:KQ,noWheelClassName:XQ,noPanClassName:J8,rfId:D4,disableKeyboardA11y:U8,nodeExtent:y0,viewport:SQ,onViewportChange:kQ,nodesDraggable:K1}),i.jsx(ZU,{onSelectionChange:p}),u4,i.jsx(JU,{proOptions:zQ,position:LQ}),i.jsx(QU,{rfId:D4,disableKeyboardA11y:U8})]})})}var $_=j9(hG);function q_(_){let[Q,J]=d.useState(_),q=d.useCallback((U)=>J((G)=>y9(U,G)),[]);return[Q,J,q]}var yB=a1.error014();function EG({dimensions:_,lineWidth:Q,variant:J,className:q}){return i.jsx("path",{strokeWidth:Q,d:`M${_[0]/2} 0 V${_[1]} M0 ${_[1]/2} H${_[0]}`,className:v1(["react-flow__background-pattern",J,q])})}function xG({radius:_,className:Q}){return i.jsx("circle",{cx:_,cy:_,r:_,className:v1(["react-flow__background-pattern","dots",Q])})}var M0;(function(_){_.Lines="lines",_.Dots="dots",_.Cross="cross"})(M0||(M0={}));var mG={[M0.Dots]:1,[M0.Lines]:1,[M0.Cross]:6},gG=(_)=>({transform:_.transform,patternId:`pattern-${_.rfId}`});function U_({id:_,variant:Q=M0.Dots,gap:J=20,size:q,lineWidth:U=1,offset:G=0,color:Z,bgColor:F,style:X,className:Y,patternClassName:K}){let H=d.useRef(null),{transform:L,patternId:z}=T1(gG,C1),W=q||mG[Q],O=Q===M0.Dots,R=Q===M0.Cross,B=Array.isArray(J)?J:[J,J],P=[B[0]*L[2]||1,B[1]*L[2]||1],A=W*L[2],T=Array.isArray(G)?G:[G,G],f=R?[A,A]:P,C=[T[0]*L[2]+f[0]/2,T[1]*L[2]+f[1]/2],w=`${z}${_?_:""}`;return i.jsxs("svg",{className:v1(["react-flow__background",Y]),style:{...X,...w4,"--xy-background-color-props":F,"--xy-background-pattern-color-props":Z},ref:H,"data-testid":"rf__background",children:[i.jsx("pattern",{id:w,x:L[0]%P[0],y:L[1]%P[1],width:P[0],height:P[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:O?i.jsx(xG,{radius:A/2,className:K}):i.jsx(EG,{dimensions:f,lineWidth:U,variant:Q,className:K})}),i.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${w})`})]})}U_.displayName="Background";var G_=d.memo(U_);function pG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:i.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function cG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:i.jsx("path",{d:"M0 0h32v4.2H0z"})})}function lG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:i.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 rG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.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 iG(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.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 R4({children:_,className:Q,...J}){return i.jsx("button",{type:"button",className:v1(["react-flow__controls-button",Q]),...J,children:_})}var dG=(_)=>({isInteractive:_.nodesDraggable||_.nodesConnectable||_.elementsSelectable,minZoomReached:_.transform[2]<=_.minZoom,maxZoomReached:_.transform[2]>=_.maxZoom,ariaLabelConfig:_.ariaLabelConfig});function Z_({style:_,showZoom:Q=!0,showFitView:J=!0,showInteractive:q=!0,fitViewOptions:U,onZoomIn:G,onZoomOut:Z,onFitView:F,onInteractiveChange:X,className:Y,children:K,position:H="bottom-left",orientation:L="vertical","aria-label":z}){let W=S1(),{isInteractive:O,minZoomReached:R,maxZoomReached:B,ariaLabelConfig:P}=T1(dG,C1),{zoomIn:A,zoomOut:T,fitView:f}=w5(),C=()=>{A(),G?.()},w=()=>{T(),Z?.()},S=()=>{f(U),F?.()},N=()=>{W.setState({nodesDraggable:!O,nodesConnectable:!O,elementsSelectable:!O}),X?.(!O)};return i.jsxs(X2,{className:v1(["react-flow__controls",L==="horizontal"?"horizontal":"vertical",Y]),position:H,style:_,"data-testid":"rf__controls","aria-label":z??P["controls.ariaLabel"],children:[Q&&i.jsxs(i.Fragment,{children:[i.jsx(R4,{onClick:C,className:"react-flow__controls-zoomin",title:P["controls.zoomIn.ariaLabel"],"aria-label":P["controls.zoomIn.ariaLabel"],disabled:B,children:i.jsx(pG,{})}),i.jsx(R4,{onClick:w,className:"react-flow__controls-zoomout",title:P["controls.zoomOut.ariaLabel"],"aria-label":P["controls.zoomOut.ariaLabel"],disabled:R,children:i.jsx(cG,{})})]}),J&&i.jsx(R4,{className:"react-flow__controls-fitview",onClick:S,title:P["controls.fitView.ariaLabel"],"aria-label":P["controls.fitView.ariaLabel"],children:i.jsx(lG,{})}),q&&i.jsx(R4,{className:"react-flow__controls-interactive",onClick:N,title:P["controls.interactive.ariaLabel"],"aria-label":P["controls.interactive.ariaLabel"],children:O?i.jsx(iG,{}):i.jsx(rG,{})}),K]})}Z_.displayName="Controls";var F_=d.memo(Z_);function aG({id:_,x:Q,y:J,width:q,height:U,style:G,color:Z,strokeColor:F,strokeWidth:X,className:Y,borderRadius:K,shapeRendering:H,selected:L,onClick:z}){let{background:W,backgroundColor:O}=G||{},R=Z||W||O;return i.jsx("rect",{className:v1(["react-flow__minimap-node",{selected:L},Y]),x:Q,y:J,rx:K,ry:K,width:q,height:U,style:{fill:R,stroke:F,strokeWidth:X},shapeRendering:H,onClick:z?(B)=>z(B,_):void 0})}var sG=d.memo(aG),tG=(_)=>_.nodes.map((Q)=>Q.id),b6=(_)=>_ instanceof Function?_:()=>_;function oG({nodeStrokeColor:_,nodeColor:Q,nodeClassName:J="",nodeBorderRadius:q=5,nodeStrokeWidth:U,nodeComponent:G=sG,onClick:Z}){let F=T1(tG,C1),X=b6(Q),Y=b6(_),K=b6(J),H=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return i.jsx(i.Fragment,{children:F.map((L)=>i.jsx(eG,{id:L,nodeColorFunc:X,nodeStrokeColorFunc:Y,nodeClassNameFunc:K,nodeBorderRadius:q,nodeStrokeWidth:U,NodeComponent:G,onClick:Z,shapeRendering:H},L))})}function nG({id:_,nodeColorFunc:Q,nodeStrokeColorFunc:J,nodeClassNameFunc:q,nodeBorderRadius:U,nodeStrokeWidth:G,shapeRendering:Z,NodeComponent:F,onClick:X}){let{node:Y,x:K,y:H,width:L,height:z}=T1((W)=>{let O=W.nodeLookup.get(_);if(!O)return{node:void 0,x:0,y:0,width:0,height:0};let R=O.internals.userNode,{x:B,y:P}=O.internals.positionAbsolute,{width:A,height:T}=$0(R);return{node:R,x:B,y:P,width:A,height:T}},C1);if(!Y||Y.hidden||!T6(Y))return null;return i.jsx(F,{x:K,y:H,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 eG=d.memo(nG),_Z=d.memo(oG),QZ=200,JZ=150,$Z=(_)=>!_.hidden,qZ=(_)=>{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?A6(H2(_.nodeLookup,{filter:$Z}),Q):Q,rfId:_.rfId,panZoom:_.panZoom,translateExtent:_.translateExtent,flowWidth:_.width,flowHeight:_.height,ariaLabelConfig:_.ariaLabelConfig}},w9=(_,Q)=>_.x===Q.x&&_.y===Q.y&&_.width===Q.width&&_.height===Q.height,UZ=(_,Q)=>w9(_.viewBB,Q.viewBB)&&w9(_.boundingRect,Q.boundingRect)&&_.rfId===Q.rfId&&_.panZoom===Q.panZoom&&_.translateExtent===Q.translateExtent&&_.flowWidth===Q.flowWidth&&_.flowHeight===Q.flowHeight&&_.ariaLabelConfig===Q.ariaLabelConfig,GZ="react-flow__minimap-desc";function H_({style:_,className:Q,nodeStrokeColor:J,nodeColor:q,nodeClassName:U="",nodeBorderRadius:G=5,nodeStrokeWidth:Z,nodeComponent:F,bgColor:X,maskColor:Y,maskStrokeColor:K,maskStrokeWidth:H,position:L="bottom-right",onClick:z,onNodeClick:W,pannable:O=!1,zoomable:R=!1,ariaLabel:B,inversePan:P,zoomStep:A=1,offsetScale:T=5}){let f=S1(),C=d.useRef(null),{boundingRect:w,panZoom:S,viewBB:N,rfId:y,translateExtent:D,flowWidth:l,flowHeight:p,ariaLabelConfig:k}=T1(qZ,UZ),b=_?.width??QZ,j=_?.height??JZ,E=w.width/b,V=w.height/j,h=Math.max(E,V),I=h*b,v=h*j,m=T*h,u=w.x-(I-w.width)/2-m,n=w.y-(v-w.height)/2-m,e=I+m*2,t=v+m*2,a=`${GZ}-${y}`,g=d.useRef(0),J1=d.useRef();g.current=h,d.useEffect(()=>{let _1=f.getState().panZoom;if(C.current&&_1)return J1.current=D7({domNode:C.current,panZoom:_1,getTransform:()=>f.getState().transform,getViewScale:()=>g.current}),()=>{J1.current?.destroy()}},[S]),d.useEffect(()=>{J1.current?.update({translateExtent:D,width:l,height:p,inversePan:P,pannable:O,zoomStep:A,zoomable:R})},[O,R,P,A,D,l,p]);let G1=z?(_1)=>{let[q1,o]=J1.current?.pointer(_1)||[0,0];z(_1,{x:q1,y:o})}:void 0,F1=d.useCallback((_1,q1)=>{let o=f.getState().nodeLookup.get(q1).internals.userNode;W?.(_1,o)},[W]),c=W?F1:void 0,s=B??k["minimap.ariaLabel"];return i.jsx(X2,{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 K==="string"?K:void 0,"--xy-minimap-mask-stroke-width-props":typeof H==="number"?H*h: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:v1(["react-flow__minimap",Q]),"data-testid":"rf__minimap",children:i.jsxs("svg",{width:b,height:j,viewBox:`${u} ${n} ${e} ${t}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":a,ref:C,onClick:G1,children:[s&&i.jsx("title",{id:a,children:s}),i.jsx(_Z,{onClick:c,nodeColor:q,nodeStrokeColor:J,nodeBorderRadius:G,nodeClassName:U,nodeStrokeWidth:Z,nodeComponent:F}),i.jsx("path",{className:"react-flow__minimap-mask",d:`M${u-m},${n-m}h${e+m*2}v${t+m*2}h${-e-m*2}z
34
- M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}H_.displayName="MiniMap";var K_=d.memo(H_),ZZ=(_)=>(Q)=>_?`${Math.max(1/Q.transform[2],1)}`:void 0,FZ={[g0.Line]:"right",[g0.Handle]:"bottom-right"};function HZ({nodeId:_,position:Q,variant:J=g0.Handle,className:q,style:U=void 0,children:G,color:Z,minWidth:F=10,minHeight:X=10,maxWidth:Y=Number.MAX_VALUE,maxHeight:K=Number.MAX_VALUE,keepAspectRatio:H=!1,resizeDirection:L,autoScale:z=!0,shouldResize:W,onResizeStart:O,onResize:R,onResizeEnd:B}){let P=E6(),A=typeof _==="string"?_:P,T=S1(),f=d.useRef(null),C=J===g0.Handle,w=T1(d.useCallback(ZZ(C&&z),[C,z]),C1),S=d.useRef(null),N=Q??FZ[J];d.useEffect(()=>{if(!f.current||!A)return;if(!S.current)S.current=g7({domNode:f.current,nodeId:A,getStoreItems:()=>{let{nodeLookup:D,transform:l,snapGrid:p,snapToGrid:k,nodeOrigin:b,domNode:j}=T.getState();return{nodeLookup:D,transform:l,snapGrid:p,snapToGrid:k,nodeOrigin:b,paneDomNode:j}},onChange:(D,l)=>{let{triggerNodeChanges:p,nodeLookup:k,parentLookup:b,nodeOrigin:j}=T.getState(),E=[],V={x:D.x,y:D.y},h=k.get(A);if(h&&h.expandParent&&h.parentId){let I=h.origin??j,v=D.width??h.measured.width??0,m=D.height??h.measured.height??0,u={id:h.id,parentId:h.parentId,rect:{width:v,height:m,...R6({x:D.x??h.position.x,y:D.y??h.position.y},{width:v,height:m},h.parentId,k,I)}},n=A4([u],k,b,j);E.push(...n),V.x=D.x?Math.max(I[0]*v,D.x):void 0,V.y=D.y?Math.max(I[1]*m,D.y):void 0}if(V.x!==void 0&&V.y!==void 0){let I={id:A,type:"position",position:{...V}};E.push(I)}if(D.width!==void 0&&D.height!==void 0){let v={id:A,type:"dimensions",resizing:!0,setAttributes:!L?!0:L==="horizontal"?"width":"height",dimensions:{width:D.width,height:D.height}};E.push(v)}for(let I of l){let v={...I,type:"position"};E.push(v)}p(E)},onEnd:({width:D,height:l})=>{let p={id:A,type:"dimensions",resizing:!1,dimensions:{width:D,height:l}};T.getState().triggerNodeChanges([p])}});return S.current.update({controlPosition:N,boundaries:{minWidth:F,minHeight:X,maxWidth:Y,maxHeight:K},keepAspectRatio:H,resizeDirection:L,onResizeStart:O,onResize:R,onResizeEnd:B,shouldResize:W}),()=>{S.current?.destroy()}},[N,F,X,Y,K,H,O,R,B,W]);let y=N.split("-");return i.jsx("div",{className:v1(["react-flow__resize-control","nodrag",...y,J,q]),ref:f,style:{...U,scale:w,...Z&&{[C?"backgroundColor":"borderColor"]:Z}},children:G})}var jB=d.memo(HZ);var KZ=(_)=>_.domNode?.querySelector(".react-flow__renderer");function XZ({children:_}){let Q=T1(KZ);if(!Q)return null;return P9.createPortal(_,Q)}var YZ=(_,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,LZ=(_,Q)=>{if(_.size!==Q.size)return!1;for(let[J,q]of _)if(YZ(q,Q.get(J)))return!1;return!0},zZ=(_)=>({x:_.transform[0],y:_.transform[1],zoom:_.transform[2],selectedNodesCount:_.nodes.filter((Q)=>Q.selected).length});function X_({nodeId:_,children:Q,className:J,style:q,isVisible:U,position:G=Z1.Top,offset:Z=10,align:F="center",...X}){let Y=E6(),K=d.useCallback((f)=>{return(Array.isArray(_)?_:[_||Y||""]).reduce((S,N)=>{let y=f.nodeLookup.get(N);if(y)S.set(y.id,y);return S},new Map)},[_,Y]),H=T1(K,LZ),{x:L,y:z,zoom:W,selectedNodesCount:O}=T1(zZ,C1);if(!(typeof U==="boolean"?U:H.size===1&&H.values().next().value?.selected&&O===1)||!H.size)return null;let B=H2(H),P=Array.from(H.values()),A=Math.max(...P.map((f)=>f.internals.z+1)),T={position:"absolute",transform:w7(B,{x:L,y:z,zoom:W},G,Z,F),zIndex:A,...q};return i.jsx(XZ,{children:i.jsx("div",{style:T,className:v1(["react-flow__node-toolbar",J]),...X,"data-id":P.reduce((f,C)=>`${f}${C.id} `,"").trim(),children:Q})})}var m1=g1(L0(),1);var Y_={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 X1=g1(P5(),1),AZ="https://brand.volter.ai/logo/twin-world/svg?size=64&variant=mono";function N5({href:_,onClick:Q}){return X1.jsxDEV("h1",{children:X1.jsxDEV("a",{href:_,onClick:Q,children:[X1.jsxDEV("img",{src:AZ,alt:"",width:24,height:24,style:{verticalAlign:"middle"}},void 0,!1,void 0,this),X1.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 C0(_){return(await _.json().catch(()=>({}))).error??`answered ${_.status}`}function z_(_,Q,J=0,q=""){let[U,G]=m1.useState({state:"loading"});return m1.useEffect(()=>{G({state:"loading"})},[q,Q]),m1.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 C0(F)};if(Z)G(X)}catch(F){if(Z)G({state:"error",status:0,error:String(F)})}})(),()=>{Z=!1}},[q,Q,J]),U}function r1({load:_,what:Q,retry:J,lines:q=3}){if(_.state==="loading")return X1.jsxDEV(BZ,{lines:q,label:`Loading ${Q}…`},void 0,!1,void 0,this);if(_.state==="error")return X1.jsxDEV("div",{role:"alert",className:"error-state",children:[X1.jsxDEV("span",{children:["Could not read ",Q,": ",_.error]},void 0,!0,void 0,this),J?X1.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 BZ({lines:_=3,label:Q="Loading…"}){return X1.jsxDEV("div",{className:"skeleton",role:"status","aria-label":Q,children:Array.from({length:_},(J,q)=>X1.jsxDEV("span",{style:{width:`${[92,76,84,64,88][q%5]}%`}},q,!1,void 0,this))},void 0,!1,void 0,this)}function w1({iso:_,time:Q}){if(!_)return X1.jsxDEV("span",{children:"—"},void 0,!1,void 0,this);let J=new Date(_);return X1.jsxDEV("time",{dateTime:_,title:_,children:Number.isNaN(J.getTime())?_:Q?J.toLocaleTimeString():J.toLocaleString()},void 0,!1,void 0,this)}var p6=(_)=>_?new Date(_).toLocaleString():"—";function c6(_){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 V1(_,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 L2=(_)=>_.length<=1?_.join(""):`${_.slice(0,-1).join(", ")} and ${_[_.length-1]}`,MZ={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"},Y1=(_)=>MZ[_]??_.charAt(0).toUpperCase()+_.slice(1);function u1({vendor:_}){let Q=Y_[_];return X1.jsxDEV("span",{className:Q?"mark logo":"mark","aria-hidden":"true",children:Q?X1.jsxDEV("svg",{viewBox:"0 0 24 24",children:X1.jsxDEV("path",{d:Q.d,fill:Q.fill},void 0,!1,void 0,this)},void 0,!1,void 0,this):Y1(_).charAt(0)},void 0,!1,void 0,this)}var L_=(_)=>{_.currentTarget.closest("details")?.removeAttribute("open")},TZ="volter.theme",l6=()=>{try{let _=localStorage.getItem(TZ);return _==="light"||_==="dark"?_:"system"}catch{return"system"}};function W_(_=l6()){let Q=document.documentElement;if(_==="system")Q.removeAttribute("data-theme");else Q.setAttribute("data-theme",_)}function A_(){return m1.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 n1({open:_,onClose:Q,title:J,children:q,footer:U,wide:G}){let Z=m1.useRef(null),F=m1.useId();return m1.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()},[_]),X1.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:_?X1.jsxDEV(X1.Fragment,{children:[X1.jsxDEV("div",{className:"dialog-head",children:[X1.jsxDEV("h2",{id:F,children:J},void 0,!1,void 0,this),X1.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),X1.jsxDEV("div",{className:"dialog-body",children:q},void 0,!1,void 0,this),U?X1.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 m6="volter:confirm";function T0(_){return new Promise((Q)=>{window.dispatchEvent(new CustomEvent(m6,{detail:{ask:_,resolve:Q}}))})}function B_(){let[_,Q]=m1.useState(null),[J,q]=m1.useState("");m1.useEffect(()=>{let F=(X)=>{q(""),Q(X.detail)};return window.addEventListener(m6,F),()=>window.removeEventListener(m6,F)},[]);let U=(F)=>{_?.resolve(F),Q(null)},G=_?.ask,Z=!G?.typed||J===G.typed;return X1.jsxDEV(n1,{open:Boolean(_),onClose:()=>U(!1),title:G?.title??"",footer:X1.jsxDEV(X1.Fragment,{children:[X1.jsxDEV("button",{type:"button",onClick:()=>U(!1),children:"Cancel"},void 0,!1,void 0,this),X1.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?X1.jsxDEV("div",{className:"confirm-body",children:G.body},void 0,!1,void 0,this):null,G?.typed?X1.jsxDEV("div",{className:"typed-confirm",children:[X1.jsxDEV("p",{children:["Type ",X1.jsxDEV("code",{children:G.typed},void 0,!1,void 0,this)," to confirm."]},void 0,!0,void 0,this),X1.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 g6="volter:toast";function j1(_,Q="ok"){window.dispatchEvent(new CustomEvent(g6,{detail:{text:_,kind:Q}}))}function M_(){let[_,Q]=m1.useState([]);return m1.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(g6,q),()=>window.removeEventListener(g6,q)},[]),X1.jsxDEV("div",{className:"toasts",role:"region","aria-label":"Notifications",children:_.map((J)=>X1.jsxDEV("div",{className:`toast ${J.kind}`,role:J.kind==="error"?"alert":"status",children:[X1.jsxDEV("span",{children:J.text},void 0,!1,void 0,this),X1.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 r6({value:_,label:Q,secret:J}){let[q,U]=m1.useState(!1);return X1.jsxDEV("div",{className:"copy-field",children:[Q?X1.jsxDEV("span",{className:"copy-label",children:Q},void 0,!1,void 0,this):null,X1.jsxDEV("div",{className:"copy-row",children:[X1.jsxDEV("input",{readOnly:!0,value:_,"aria-label":Q??"Value",onFocus:(Z)=>Z.currentTarget.select(),spellCheck:!1},void 0,!1,void 0,this),X1.jsxDEV("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>{U(!0),setTimeout(()=>U(!1),1600),j1(J?"Copied. Keep it somewhere safe":"Copied")}).catch(()=>j1("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 T_({label:_,items:Q}){return X1.jsxDEV("details",{className:"menu row-menu",children:[X1.jsxDEV("summary",{className:"icon-button",role:"button","aria-haspopup":"menu","aria-label":_,title:_,children:"⋯"},void 0,!1,void 0,this),X1.jsxDEV("div",{className:"popover menu-list",role:"menu",children:Q.filter((J)=>Boolean(J)).map((J)=>J.href?X1.jsxDEV("a",{role:"menuitem",href:J.href,className:J.danger?"danger-item":void 0,onClick:L_,children:J.label},J.label,!1,void 0,this):X1.jsxDEV("button",{type:"button",role:"menuitem",disabled:J.disabled,className:J.danger?"danger-item":void 0,onClick:(q)=>{L_(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 x2({title:_,children:Q,action:J}){return X1.jsxDEV("div",{className:"empty-state",children:[X1.jsxDEV("p",{className:"empty-title",children:_},void 0,!1,void 0,this),Q?X1.jsxDEV("div",{className:"empty-body",children:Q},void 0,!1,void 0,this):null,J?X1.jsxDEV("div",{className:"empty-action",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function R_(){return m1.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")RZ()};return document.addEventListener("click",_),document.addEventListener("keydown",Q),()=>{document.removeEventListener("click",_),document.removeEventListener("keydown",Q)}},[]),X1.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 RZ=()=>{document.querySelector("main.app")?.removeAttribute("data-drawer")};function N4(_={}){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 O_={"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 $=g1(P5(),1),S4="volter.console.token",v5=document.getElementById("root"),L1=v5.dataset.base??"/-/console",O1=window.location.origin,l0=(v5.dataset.worlds??O1).replace(/\/+$/,""),v_=(v5.dataset.names??"").split(",").filter((_)=>_!==""),p0=v5.dataset.worldOrigin==="1",B2=window.fetch.bind(window),c0="(session)",y_="(pass)",S5=(_)=>{try{if(_&&!p0)sessionStorage.setItem(S4,_);else sessionStorage.removeItem(S4);localStorage.removeItem(S4)}catch{}},j_="volter.console.portal",V_=(_)=>{try{if(typeof _==="string"&&/^https?:$/.test(new URL(_).protocol))sessionStorage.setItem(j_,new URL(_).origin)}catch{}},OZ=()=>{return M2.get("token")??""},i1=()=>{try{let _=sessionStorage.getItem(j_)??"";return _&&/^https?:$/.test(new URL(_).protocol)?new URL(_).origin:""}catch{return""}},IZ=()=>{let _=OZ();if(p0){if(S5(""),M2.get("pass"))return y_;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?"":c0)}if(_)return S5(_),_;try{return sessionStorage.getItem(S4)??""}catch{return""}};function b1(_){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: ${L2(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 ${Y1(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(Y1);return{text:`${L2(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 q0=async(_)=>b1(await C0(_)).text,fZ={vault:["vault","Open Vault"],remote:["remote","Open Remote"],settings:["settings/services","Open Real services"]};function u_({name:_,acts:Q}){let J=Q.map((q)=>fZ[q]).filter((q)=>Boolean(q));if(J.length===0)return null;return $.jsxDEV($.Fragment,{children:J.map(([q,U])=>$.jsxDEV(r.default.Fragment,{children:[" ",$.jsxDEV("a",{href:`${L1}/${_}/~/${q}`,onClick:(G)=>{G.preventDefault(),f1([..._.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 B2(`${O1}${Q}`,{...J,headers:{...J.headers??{},..._===c0?{}:{"x-volter-token":_},...J.body&&!J.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function N1(_,Q,J=0){let q=z_((U)=>I1(_,U),Q,J,_);return q.state==="error"?{...q,error:b1(q.error).text}:q}var l2=(_)=>{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())}`},I_=(_)=>new Date(Math.ceil(Date.parse(_)/60000)*60000).toISOString(),b_=(_)=>_.operation==="observed"?`observed${_.provenance==="placeholder"?" (default data)":" (vendor)"}`:_.receipt?`${_.receipt.status??""} ${_.receipt.externalId??""} ${_.receipt.reason??""}`.trim():_.provenance==="placeholder"?"default data":"unpushed",wZ=(_)=>{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},s6="volter.console.snapshots",k0=()=>{try{return JSON.parse(sessionStorage.getItem(s6)??"{}")}catch{return{}}},D_=new Map,t6=(_)=>{if(p0){if(_.token||_.readToken)D_.set(_.name,{token:_.token,readToken:_.readToken});_={..._,token:"",readToken:""}}try{sessionStorage.setItem(s6,JSON.stringify({...k0(),[_.name]:_}))}catch{}},o6=(_)=>D_.get(_)?.readToken||k0()[_]?.readToken||"",k4=(_)=>{try{let Q=k0();delete Q[_],sessionStorage.setItem(s6,JSON.stringify(Q))}catch{}},M2=new URLSearchParams(window.location.hash.slice(1)),m2=M2.get("close")??"";function y5(_){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 n6(_){let Q=y5(_);if(!Q)return null;let J=new URL(O1);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 PZ(_){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:n6(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 _=M2.get("snapshot");if(_){let Q=PZ(_);if(Q&&!k0()[Q.name])t6(Q)}}var h_="volter.console.home",E_=(_)=>{let Q=y5(_);if(!Q)return null;let J=new URL(O1).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 _=E_(M2.get("home"));if(_)try{sessionStorage.setItem(h_,_)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((_)=>M2.has(_)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var H0=()=>{try{return E_(sessionStorage.getItem(h_))??""}catch{return""}};function e6(_,Q,J,q){let U=new URLSearchParams({token:Q,home:H0()||O1}),G=k0()[J];if(G)U.set("snapshot",JSON.stringify(G));window.location.replace(`${_}${q??`${window.location.pathname}${window.location.search}`}#${U.toString()}`)}var y4=v5.dataset.route==="memory"?"":null;function tB(_){y4=_,window.dispatchEvent(new PopStateEvent("popstate"))}function W2(){return(y4??window.location.pathname.slice(L1.length)).split("/").filter(Boolean).map((_)=>{try{return decodeURIComponent(_)}catch{return""}})}var f_=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,S0=(_,Q)=>_&&Q&&f_.test(_)&&f_.test(Q)?`${_}/${Q}`:"";function f1(_){let Q=`/${_.map(encodeURIComponent).join("/")}`;if(y4!==null)y4=Q;else window.history.pushState(null,"",`${L1}${Q}`);window.dispatchEvent(new PopStateEvent("popstate"))}function x_(_,Q){let J=n6(k0()[_]?.origin);if(J&&J!==O1){e6(J,o6(_),_,`${L1}/${Q.map(encodeURIComponent).join("/")}`);return}f1(Q)}async function w_(){let[_,Q]=W2(),J=S0(_,Q),q=J?[J]:v_;if(q.length===0){let U=await B2(`${O1}/-/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&&S0(G,Z)===U});for(let U of q){let G=await B2(`${O1}/-/${U}/session`,{method:"POST"}).catch(()=>null);if(!G)continue;let Z=await G.json().catch(()=>({})),F=y5(Z.origin)?.origin;if(G.status===409&&F&&F!==O1)return window.location.replace(`${F}${L1}/${U}`),"moved";if(G.ok&&Z.local)return{token:typeof Z.token==="string"&&Z.token?Z.token:c0}}return null}function NZ(){let[_,Q]=r.useState(l6),J=(q)=>()=>{try{if(q==="system")localStorage.removeItem("volter.theme");else localStorage.setItem("volter.theme",q)}catch{}W_(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 CZ(){let[_,Q]=r.useState(IZ()),[J,q]=r.useState(!1),[U,G]=r.useState(!1),[Z,F]=r.useState(""),[X,Y]=r.useState(null),[K,H]=r.useState(null),[L,z]=r.useState(W2());r.useEffect(()=>{let v=()=>z(W2());return window.addEventListener("popstate",v),()=>window.removeEventListener("popstate",v)},[]),r.useEffect(()=>{let[v,m]=W2(),u=S0(v,m),[n,e]=u?u.split("/"):[],t=k0()[m2];if(!m2||!_||!n||!e||!t?.made||t.parent!==`${n}/${e}`||S0(...m2.split("/"))!==m2)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}I1(_,`/-/${n}/${e}/branches/${m2}`,{method:"DELETE"}).catch(()=>null).then(()=>k4(m2))},[_]);let W=r.useCallback(async(v)=>{if(H(null),!v){let e=await w_();if(e==="moved")return;if(e){if(q(!0),e.token!==c0)S5(e.token);Q(e.token);return}Y(null),G(!0);return}if(p0&&v===c0){let e=await w_();if(e==="moved")return;if(e)q(!0)}if(p0&&v===y_){let[e,t]=W2(),a=S0(e,t),[g,J1]=a?a.split("/"):[],G1=g&&J1?await B2(`${O1}/-/${g}/${J1}/session`,{method:"POST",headers:{"x-volter-pass":M2.get("pass")??""}}).catch(()=>null):null;if(!G1){H(`${O1} did not answer: no session was opened`),Y(null);return}if(!G1.ok){H(`${await q0(G1)}. Open it again from the platform.`),Y(null);return}V_((await G1.json().catch(()=>({}))).issuer),Q(c0);return}if(p0&&v!==c0){let[e,t]=W2(),a=S0(e,t),[g,J1]=a?a.split("/"):[],G1=g&&J1?await B2(`${O1}/-/${g}/${J1}/session`,{method:"POST",headers:{"x-volter-token":v}}).catch(()=>null):null;if(!G1){H(`${O1} did not answer: no session was opened`),Y(null);return}if(!G1.ok){let F1=await q0(G1);H(G1.status===401||G1.status===403?`That token does not open ${g}/${J1}.`:G1.status===409?`${g}/${J1}'s session lives at another origin: ${F1}`:`The World could not open a session (${G1.status}): ${F1}`),Y(null);return}Q(c0);return}let m=p0?new Response(null,{status:404}):await I1(v,"/-/worlds");if(m.ok){let{worlds:e}=await m.json();Y({kind:"admin",worlds:e});return}if(m.status===429){H("You are asking faster than the platform allows — wait a moment and reload."),Y(null);return}if(m.status>=500){let e=await m.json().catch(()=>({}));H(`The platform could not list your worlds${e.error?`: ${e.error}`:""}. Reload; if it stays, the status page says what is wrong.`),Y(null);return}let u=v_;if(u.length===0){let e=await B2(`${O1}/-/ping`);if(!e.ok){H(`${O1} does not answer as a host`),Y(null);return}if(u=(await e.json()).worlds??[],u.length===0){H(`${O1} does not list its Worlds: open a World at its own address, ${O1}${L1}/<org>/<world>`),Y(null);return}}let n=[];for(let e of u){let t=await I1(v,`/-/${e}/twins`);if(t.ok){let a=await t.json();n.push({name:e,base:`${l0}/${e}`,twins:(a.twins??[]).map((g)=>({vendor:g.twin,protocol:g.protocol??null,root:g.root??null}))})}}if(n.length===0){H("This link or key opens no World here: it was revoked, or it has ended."),Y(null);return}Y({kind:"world",worlds:n})},[]);r.useEffect(()=>{W(_)},[_,W]);let O=(v)=>X?.kind==="admin"?X.worlds.find((m)=>m.name===v)?.token??_:_,[R,B]=r.useState("");if(!_||!X&&!K)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(N5,{href:`${L1}/`},void 0,!1,void 0,this),_&&!X&&!K||!_&&!U?$.jsxDEV("p",{className:"mode",children:"Opening…"},void 0,!1,void 0,this):$.jsxDEV("form",{onSubmit:(v)=>{v.preventDefault(),S5(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:(v)=>F(v.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 P=()=>{if(J){window.location.reload();return}if(p0){let[v,m]=W2(),u=S0(v,m),[n,e]=u?u.split("/"):[],t=()=>window.location.replace(i1()?`${i1()}/`:`${O1}${L1}/${n&&e?`${n}/${e}`:""}?signin`);if(setTimeout(t,2000),n&&e)B2(`${O1}/-/${n}/${e}/session/end`,{method:"POST"}).catch(()=>null).then(t);else t();return}if(X)for(let v of X.worlds)navigator.sendBeacon(`${v.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${v.name}/session/end`);S5(""),Q(""),F(""),Y(null),f1([])};if(K||!X)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(N5,{href:`${L1}/`},void 0,!1,void 0,this),$.jsxDEV("h2",{children:"Could not open it"},void 0,!1,void 0,this),$.jsxDEV("p",{role:"alert",children:K??"nothing answered"},void 0,!1,void 0,this),i1()?$.jsxDEV("a",{className:"button primary",href:`${i1()}/`,children:["Back to ",new URL(i1()).host]},void 0,!0,void 0,this):$.jsxDEV("button",{type:"button",className:"primary",onClick:P,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,T,f,C,w,S,N]=L,y=f==="~",D=/^[A-Za-z0-9_-]+$/,l=/^[^\u0000-\u001f\u007f]{1,200}$/,p=y||!f||!D.test(f)?void 0:f,k=w&&D.test(w)?S!==void 0&&C!=="changes"&&C!=="screens"?S0(w,S)||void 0:w:void 0,b=C==="changes"&&w==="changesets"&&S&&D.test(S)?S:C==="screens"&&S&&N&&/^[A-Za-z0-9_.-]+$/.test(S)&&l.test(N)?`${S}:${N}`:void 0,j=S0(A,T),E=j?k0()[j]??null:null,V=(v)=>o6(v)||O(v),h=E?X.kind==="admin"?X.worlds.find((v)=>v.name===E.parent)?.token??null:X.worlds.some((v)=>v.name===E.parent)?_:null:null,I=async(v)=>{let m=n6(v.parentOrigin);if(m&&m!==O1){k4(v.name),window.location.assign(`${m}${L1}/${v.parent}#close=${encodeURIComponent(v.name)}`);return}if(v.made)await I1(O(v.parent),`/-/${v.parent}/branches/${v.name}`,{method:"DELETE"}).catch(()=>null),k4(v.name);f1(v.parent.split("/"))};return $.jsxDEV("main",{className:j?"app workspace":"app home",children:[j?null:$.jsxDEV("header",{children:[j?$.jsxDEV(R_,{},void 0,!1,void 0,this):null,$.jsxDEV(N5,{href:`${H0()&&H0()!==O1?H0():""}${L1}/`,onClick:(v)=>{if(H0()&&H0()!==O1)return;v.preventDefault(),f1([])}},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:`${L1}/${j}`,className:"crumb-world",onClick:(v)=>{v.preventDefault(),f1(j.split("/"))},children:j.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,p?$.jsxDEV("span",{children:[" / ",p]},void 0,!0,void 0,this):null,y&&C==="trace"?$.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),i1()?$.jsxDEV("a",{href:`${i1()}/${j?encodeURIComponent(j.split("/")[0]):""}`,title:`Back to the platform at ${new URL(i1()).host}`,className:"back-link",children:["← ",$.jsxDEV("span",{className:"back-text",children:j?`${j.split("/")[0]}'s Worlds`:new URL(i1()).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":R?`signed in as ${R}`:X.kind==="admin"?"host: admin":"opened with a link or key"},void 0,!1,void 0,this),j||J?null:$.jsxDEV("button",{onClick:P,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),j?$.jsxDEV(yZ,{name:j,token:V(j),twin:p,tab:y?C??"overview":"overview",arg:y?k:void 0,...y&&b?{sub:b}:{},admin:E?null:X.kind==="admin"?_:null,snapshot:E,parentToken:h,who:{local:J,person:R||null,admin:X.kind==="admin"},onSignOut:P,onReturn:I,opens:(v)=>!!k0()[v]||X.kind==="admin"&&X.worlds.some((m)=>m.name===v),onRemoved:()=>{W(_),f1([])},onWho:B,worlds:X.worlds.map((v)=>v.name)},j,!1,void 0,this):$.jsxDEV(SZ,{mode:X,admin:X.kind==="admin"?_:null,reload:()=>W(_)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function SZ({mode:_,admin:Q,reload:J}){let[q,U]=r.useState(""),[G,Z]=r.useState(""),[F,X]=r.useState(""),[Y,K]=r.useState(null),H=async(w)=>{if(!await T0({title:`Rotate the tokens of ${w}?`,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 S=await I1(Q,`/-/worlds/${w}/rotate`,{method:"POST"}),N=await S.json().catch(()=>({}));K(S.ok?`rotated ${w}: the new tokens are shown once — token ${N.token} · read token ${N.readToken}`:N.error?b1(N.error).text:`answered ${S.status}`),await J()},L=async(w)=>{let S=await I1(Q,`/-/worlds/${w}`,{method:"DELETE"}),N=await S.json().catch(()=>({}));K(S.ok?`removed ${w}`:N.error?b1(N.error).text:`answered ${S.status}`),await J()},[z,W]=r.useState(!1),[O,R]=r.useState(!1),[B,P]=r.useState(""),A=async(w)=>{w.preventDefault(),K(null),W(!0);try{let S=await I1(Q,"/-/worlds",{method:"POST",body:JSON.stringify({org:q,world:G,vendors:F.split(",").map((y)=>y.trim()).filter(Boolean)})}),N=await S.json();if(!S.ok){K(N.error?b1(N.error).text:`the host answered ${S.status}`);return}K(`provisioned ${N.name}`),Z(""),X(""),R(!1),await J()}finally{W(!1)}},T=B.trim().toLowerCase(),f=_.worlds.filter((w)=>!T||w.name.toLowerCase().includes(T)||w.twins.some((S)=>S.vendor.includes(T))),C=[...new Set(f.map((w)=>w.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:[V1(_.worlds.length,"World")," ",Q?"this host serves":"this key opens"]},void 0,!0,void 0,this),Q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>{K(null),R(!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:(w)=>P(w.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((w)=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("p",{className:"menu-label home-org",children:w},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"home-list",children:f.filter((S)=>S.name.split("/")[0]===w).map((S)=>$.jsxDEV("li",{children:[$.jsxDEV("a",{href:`${L1}/${S.name}`,onClick:(N)=>{N.preventDefault(),f1(S.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:S.name.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("small",{children:$.jsxDEV("code",{children:S.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:S.twins.map((N)=>$.jsxDEV("span",{title:Y1(N.vendor),children:$.jsxDEV(u1,{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 ${S.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"),H(S.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"),T0({title:`Remove ${S.name}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:S.name}).then((y)=>{if(y)L(S.name)})},children:"Remove World…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},S.name,!0,void 0,this))},void 0,!1,void 0,this)]},w,!0,void 0,this)),f.length===0?$.jsxDEV("p",{className:"mode home-note",children:T?`No World matches ${B}.`:"No Worlds here yet."},void 0,!1,void 0,this):null,$.jsxDEV(n1,{open:O,onClose:()=>{if(!z)R(!1)},title:"New World",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>R(!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:(w)=>U(w.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:(w)=>Z(w.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:(w)=>X(w.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 kZ=["changes","events","trace","vendors","screens","canvas","branches","settings","remote","vault"],vZ=(_,Q)=>{let J=Q?.screens?.find((q)=>q.path.replace(/\/+$/,"")==="")??Q?.screens?.find((q)=>!/[{<]/.test(q.path));return Q&&J?`${l0}/${_}/${Q.twin}${J.path.startsWith("/")?J.path:`/${J.path}`}`:null},P_={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 K0(_){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`:P_[J]?`${U} ${P_[J]}`:`${Z.charAt(0).toUpperCase()}${Z.slice(1)}`,X=_.fields??{},Y=["title","name","email","text","subject","summary","description"].map((H)=>X[H]).find((H)=>typeof H==="string"&&H.trim()!=="")??null,K=Y===null?null:Y.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(H,L,z)=>`${L==="!"?"@":L}${z}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:F,label:K===null?null:K.length>80?`${K.slice(0,79)}…`:K}}var r0=(_)=>/token|password|secret|key|credential/i.test(_.subject.type)&&_.subject.id.length>6?`••••${_.subject.id.slice(-4)}`:_.subject.id;function yZ({name:_,token:Q,twin:J,tab:q,arg:U,sub:G,admin:Z,snapshot:F,parentToken:X,who:Y,onSignOut:K,onReturn:H,opens:L,onRemoved:z,onWho:W,worlds:O=[]}){let[R,B]=r.useState("pending"),[P,A]=r.useState(null),[T,f]=r.useState(0),[C,w]=r.useState(null);r.useEffect(()=>{let a=!0;return A(null),I1(Q,`/-/${_}/session`,{method:"POST"}).then(async(g)=>{let J1=await g.json().catch(()=>({}));if(V_(J1.issuer),J1.who)W?.(J1.who);w(typeof J1.signsAs==="string"?J1.signsAs:null);let G1=y5(J1.origin)?.origin;if(g.status===409&&G1&&G1!==O1){e6(G1,Q,_);return}if(!a)return;if(B(!g.ok?"unknown":J1.scope==="read"?"read":J1.scope==="write"?"write":"unknown"),!g.ok)A(J1.error?b1(J1.error).text:`answered ${g.status}`)}).catch((g)=>{if(a)B("unknown"),A(`the World did not answer: ${g instanceof Error?g.message:String(g)}`)}),()=>{a=!1}},[_,Q,T]);let S=P?{state:"error",error:P}:R==="pending"?{state:"pending"}:{state:"ok",scope:R},N=R==="write",y=(a)=>{if(a.status!==403)return;a.clone().json().then((g)=>{if(/read token|opens only reads|write access|reads only/i.test(g?.error??""))B("read")},()=>null)},[D,l]=r.useState(0);r.useEffect(()=>{let a=setInterval(()=>{if(!document.hidden)l((g)=>g+1)},5000);return()=>clearInterval(a)},[]);let[p,k]=r.useState(0),b=N1(Q,`/-/${_}/clock`,D+p),j=N1(Q,`/-/${_}/twins`),E=N1(Q,`/-/${_}/branches`,p),V=N1(Q,`/-/${_}/map`,Math.floor(D/2)),h=!(E.state==="error"&&(E.status===404||E.status===405)),I=kZ.includes(q)?q:"overview",v=j.state==="ok"?j.data.twins.map((a)=>a.twin):[];if(J&&j.state==="ok"&&!v.includes(J))return $.jsxDEV("main",{className:"center",children:$.jsxDEV(x2,{title:`${_} has no ${J}`,action:$.jsxDEV("a",{href:`${L1}/${_}`,onClick:(a)=>{a.preventDefault(),f1(_.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 m=I==="vendors"&&U?U:void 0,u=()=>{B("pending"),f((a)=>a+1)};if(I==="canvas"||I==="vendors"&&!m||q==="screens"&&!U)return $.jsxDEV(UF,{name:_,token:Q,twins:j,session:S,retry:u,snapshot:F,back:()=>f1(_.split("/")),canWrite:N&&!F},void 0,!1,void 0,this);let e=q==="settings"?{kind:"settings",tab:((a)=>m_.find(([g])=>g===a)?.[0]??"account")(U)}:q==="remote"?{kind:"settings",tab:"remote"}:q==="vault"?{kind:"settings",tab:"vault"}:q==="branches"?{kind:"branches",...U?{open:U}:{}}:null,t=J?"vendor":q==="screens"&&U?"screen":I==="vendors"&&m?"vendor":q==="trace"?"trace":q==="events"?"events":q==="changes"&&U==="changesets"?"history":"changes";return $.jsxDEV(gZ,{name:_,token:Q,view:t,win:e,who:Y,snapshot:F,onReturn:H,onSignOut:K,worlds:O,session:S,retry:u,...t==="vendor"?{arg:J??m}:t==="events"||t==="trace"||t==="screen"?U?{arg:U}:{}:{},...G?{sub:G}:{},twins:j,map:V,branches:h?E:null,clock:b,canWrite:N&&!F,refused:y,signsAs:C,opens:L,tick:D,admin:Z,onRemoved:z,onClock:()=>k((a)=>a+1),scope:F?"read":R},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:(O_[_]??[]).map(([J,q],U)=>r.default.createElement(J,{key:U,...q}))},void 0,!1,void 0,this)}function j4(_){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 m_=[["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"]],jZ=(_,Q)=>{let J=Q.split("/").pop()??Q,q=_.split("/").pop()??"";return J.startsWith(`${q}-`)?J.slice(q.length+1):J},A2=(_)=>_.replace(/^_+/,"").replace(/[_-]+/g," ");function g_({record:_,history:Q}){let J=_.writes[_.writes.length-1],q=K0(J),U=j4(_.writes),G=new Set(_.writes.map((H)=>H.id)),Z=_.writes[0].occurredAt,F={};if(Q){for(let H of Q)if(!G.has(H.id)&&!H.landsId&&!H.aliasOf&&H.subject.type===J.subject.type&&H.subject.id===J.subject.id&&H.occurredAt<=Z)Object.assign(F,H.fields??{})}let X={...F};for(let H of _.writes)Object.assign(X,H.fields??{});let Y=U.tone==="added"&&Object.keys(F).length===0,K=[...new Set([...Object.keys(F),...Object.keys(X)])].filter((H)=>!n_(F[H],X[H]));return $.jsxDEV("div",{className:"ws-diff","aria-label":`${q.label??r0(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(u1,{vendor:_.twin},void 0,!1,void 0,this),$.jsxDEV("div",{className:"cell-label",children:[$.jsxDEV("b",{children:q.label??r0(J)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[Y1(_.twin)," · ",J.subject.type.replace(/^_+/,"").replace(/[_-]+/g," ")," ",$.jsxDEV("code",{children:r0(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((H)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:K0(H).what},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(w1,{iso:H.occurredAt},void 0,!1,void 0,this)," · ",k5(H)]},void 0,!0,void 0,this)]},H.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):K.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:K.map((H)=>$.jsxDEV("tr",{children:[$.jsxDEV("th",{scope:"row",children:$.jsxDEV("code",{children:H},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y?null:$.jsxDEV("td",{className:H in F?"was":"none",children:H in F?$.jsxDEV(v0,{v:F[H]},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:H in X?"now":"none",children:H in X?$.jsxDEV(v0,{v:X[H]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},H,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function p_({records:_,selected:Q,onPick:J,label:q}){let[U,G]=r.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,K)=>{let H=Y.writes[Y.writes.length-1],L=K0(H),z=j4(Y.writes);return $.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:[Q===Y.key?"on":"",K?"nested":""].join(" ").trim()||void 0,"aria-pressed":Q===Y.key,onClick:()=>J(Y.key),children:[K?null:$.jsxDEV(u1,{vendor:Y.twin},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:L.label??r0(H)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[A2(H.subject.type)," · ",L.what.split(" ").slice(-1)[0],Y.writes.length>1?` · ${V1(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 K=_.filter((H)=>H.twin===Y);return $.jsxDEV("li",{className:"ws-group",children:[$.jsxDEV("p",{className:"ws-group-head",children:[$.jsxDEV(u1,{vendor:Y},void 0,!1,void 0,this),$.jsxDEV("b",{children:Y1(Y)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:K.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:K.map((H)=>F(H,!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 VZ({name:_,token:Q,branches:J,opens:q,refused:U,onChanged:G}){let[Z,F]=r.useState(""),[X,Y]=r.useState(!1),K=J?.state==="ok"&&J.data.checkedOut||_.split("/")[1],H=J?.state==="ok"&&J.data.named?.length?J.data.named:[{name:K,running:!0}],L=J?.state==="ok"?J.data.branches:[],z=Z.trim().toLowerCase(),W=(R)=>!z||R.toLowerCase().includes(z),O=(R)=>{R.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:K},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:(R)=>F(R.target.value)},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:(R)=>{O(R),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:H.filter((R)=>W(R.name)).map((R)=>$.jsxDEV("li",{className:R.name===K?"current":void 0,children:[$.jsxDEV("span",{className:"tick",children:R.name===K?$.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:R.name},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:R.name===K?"served here":R.running?"running":"stopped"},void 0,!1,void 0,this)]},R.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((R)=>W(R.name)).map((R)=>{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:jZ(_,R.name)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:R.at?.instant?$.jsxDEV($.Fragment,{children:["as of ",$.jsxDEV(w1,{iso:R.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),P=R.expiresAt?`Goes away ${new Date(R.expiresAt).toLocaleString()}`:"Kept";return $.jsxDEV("li",{children:q(R.name)?$.jsxDEV("a",{href:`${L1}/${R.name}`,title:P,onClick:(A)=>{A.preventDefault(),O(A),x_(R.name,R.name.split("/"))},children:B},void 0,!1,void 0,this):$.jsxDEV("span",{title:`${P}. Its tokens went to whoever made it; it opens from their page.`,children:B},void 0,!1,void 0,this)},R.name,!1,void 0,this)})},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-branch-foot",children:$.jsxDEV("a",{href:`${L1}/${_}/~/branches`,onClick:(R)=>{R.preventDefault(),O(R),f1([..._.split("/"),"~","branches"])},children:"Manage branches…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(r_,{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 c_({name:_,view:Q,changes:J,changesets:q}){let U=(G)=>(Z)=>{Z.preventDefault(),f1([..._.split("/"),"~",...G])};return $.jsxDEV("nav",{className:"tabs ws-pane-tabs","aria-label":"Changes and history",children:[$.jsxDEV("a",{href:`${L1}/${_}/~/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:`${L1}/${_}/~/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 uZ({name:_,token:Q,sets:J,sub:q,signsAs:U,canWrite:G,rooted:Z,refused:F,onChanged:X,changes:Y,withScreens:K,required:H}){let[L,z]=r.useState(null),[W,O]=r.useState(!1),R=J.state==="ok"?[...J.data.changesets].sort((S,N)=>N.createdAt.localeCompare(S.createdAt)):[],B=R.find((S)=>S.name===q)??R[0],P=r.useMemo(()=>{let S=new Map;for(let N of B?t_(B):[]){let y=`${N.twin}:${N.entry.subject.type}:${N.entry.subject.id}`,D=S.get(y)??{key:y,twin:N.twin,writes:[]};D.writes.push(N.entry),S.set(y,D)}return[...S.values()]},[B]),A=P.find((S)=>S.key===L)??P[0],T=N1(Q,A?`/-/${_}/log/${A.twin}`:null),f={added:0,removed:0,changed:0};for(let S of P)f[j4(S.writes).tone]=(f[j4(S.writes).tone]??0)+1;let C=B?V4(B):null,w=B?o_(B,H):null;return $.jsxDEV("div",{className:"ws-two",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(c_,{name:_,view:"history",changes:Y,changesets:R.length},void 0,!1,void 0,this),$.jsxDEV(r1,{load:J,what:"the changesets",lines:4},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"ws-list ws-commits","aria-label":"Changesets",children:R.map((S)=>{let N=B?.name===S.name,y=V4(S).label==="Not sent";return $.jsxDEV("li",{children:$.jsxDEV("a",{href:`${L1}/${_}/~/changes/changesets/${S.name}`,className:N?"on":void 0,"aria-current":N?"true":void 0,onClick:(D)=>{D.preventDefault(),z(null),f1([..._.split("/"),"~","changes","changesets",S.name])},children:[$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:a6(S)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[S.owner??(S.cutBy?v4(S.cutBy):"unrecorded")," • ",$.jsxDEV(w1,{iso:S.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),y?$.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)},S.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(x2,{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&&w?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-commit-head",children:[$.jsxDEV("div",{className:"ws-commit-title",children:[$.jsxDEV("h3",{children:a6(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)," ",V1(P.length,"changed record"),f.added?$.jsxDEV("span",{className:"plus",children:[" +",f.added]},void 0,!0,void 0,this):null,f.removed?$.jsxDEV("span",{className:"minus",children:[" −",f.removed]},void 0,!0,void 0,this):null,f.changed?$.jsxDEV("span",{className:"dot",children:[" •",f.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(w1,{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":v4(B.cutBy):"unrecorded"],...B.pushedBy?[["Pushed by",v4(B.pushedBy)]]:[]].map(([S,N])=>$.jsxDEV("span",{children:[$.jsxDEV("span",{className:"mode",children:S},void 0,!1,void 0,this)," ",N]},S,!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-${w.tone}`,children:w.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(p_,{records:P,...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(g_,{record:A,history:T.state==="ok"?T.data.entries:T.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(n1,{open:W,onClose:()=>O(!1),title:`Review: ${a6(B)}`,wide:!0,children:[$.jsxDEV(k_,{name:_,token:Q,signsAs:U,c:B,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"head",required:H},`h:${B.name}`,!1,void 0,this),$.jsxDEV(k_,{name:_,token:Q,signsAs:U,c:B,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"review",required:H},`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 bZ({name:_,token:Q,vendors:J,vendor:q,tick:U}){let[G,Z]=r.useState(N_*4),[F,X]=r.useState(""),[Y,K]=r.useState(null),H=N1(Q,`/-/${_}/timeline?limit=${G}${q?`&twin=${encodeURIComponent(q)}`:""}`,Math.floor(U/2)),L=H.state==="ok"?eZ(H.data.entries):[],z=[...new Set(L.map((f)=>K0(f.entry).what))].sort(),W=L.filter((f)=>!F||K0(f.entry).what===F),O=W.find((f)=>g2(f)===Y)??W[0],R=(f)=>(C)=>{C.preventDefault(),K(null),f1([..._.split("/"),"~","events",...f?[f]:[]])},B=O?.entry.input&&typeof O.entry.input==="object"?O.entry.input.body:void 0,P=O?wZ(O.entry.traceparent):null,A=O?C_(O):null,T=O?sZ(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:`${L1}/${_}/~/events`,className:!q?"on":void 0,"aria-current":!q?"page":void 0,onClick:R(),children:"All"},void 0,!1,void 0,this),J.map((f)=>$.jsxDEV("a",{href:`${L1}/${_}/~/events/${f}`,className:q===f?"on":void 0,"aria-current":q===f?"page":void 0,onClick:R(f),children:[$.jsxDEV(u1,{vendor:f},void 0,!1,void 0,this),Y1(f)]},f,!0,void 0,this))]},void 0,!0,void 0,this),$.jsxDEV("select",{"aria-label":"Operation",value:F,onChange:(f)=>{X(f.target.value),K(null)},children:[$.jsxDEV("option",{value:"",children:"Every operation"},void 0,!1,void 0,this),z.map((f)=>$.jsxDEV("option",{value:f,children:f},f,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[$.jsxDEV(r1,{load:H,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((f)=>{let C=K0(f.entry),w=C_(f),S=O&&g2(f)===g2(O);return $.jsxDEV("tr",{className:S?"on":void 0,"aria-selected":S,onClick:()=>K(g2(f)),children:[$.jsxDEV("td",{className:"mono",children:$.jsxDEV(w1,{iso:f.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(u1,{vendor:f.twin},void 0,!1,void 0,this),Y1(f.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:r0(f.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:k5(f.entry,f.caller)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w?$.jsxDEV("span",{className:w.bad?"badge cs-bad":w.status==="deployed"?"badge cs-done":"badge",children:w.status},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:b_(f.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},g2(f),!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:d_(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,":",r0(O.entry)]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(w1,{iso:O.entry.occurredAt},void 0,!1,void 0,this)," · ",k5(O.entry,O.caller)]},void 0,!0,void 0,this),P?$.jsxDEV("a",{href:`${L1}/${_}/~/trace/${P.trace}`,onClick:(f)=>{f.preventDefault(),f1([..._.split("/"),"~","trace",P.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(oZ,{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),T.length?$.jsxDEV($.Fragment,{children:[$.jsxDEV("h4",{children:"Usage"},void 0,!1,void 0,this),$.jsxDEV("dl",{className:"fields",children:T.map(([f,C])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:f},void 0,!1,void 0,this),$.jsxDEV("dd",{children:C},void 0,!1,void 0,this)]},f,!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(s_,{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((f)=>f.entry.receipt?.status??"landed copy").join(" · "):nZ(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 ${Y1(q)}`:""]},void 0,!0,void 0,this),H.state==="ok"&&H.data.next?$.jsxDEV("button",{type:"button",onClick:()=>Z((f)=>f+N_*4),children:"Load older"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function DZ({name:_,token:Q,id:J}){let q=/^[0-9a-f]{32}$/.test(J),U=N1(Q,q?`/-/${_}/timeline?trace=${J}&limit=500`:null),G=U.state==="ok"?[...U.data.entries].sort((H,L)=>-i_(H,L)):[],[Z,F]=r.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,K=[...new Set(G.map((H)=>H.twin))];return $.jsxDEV("div",{className:"ws-sheet ws-trace",children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${L1}/${_}/~/events`,onClick:(H)=>{H.preventDefault(),f1([..._.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]?`${K0(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(r1,{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(w1,{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:K.map(Y1).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(x2,{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((H)=>{let L=Date.parse(H.entry.occurredAt)-X,z=g2(H),W=K0(H.entry);return $.jsxDEV(r.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(u1,{vendor:H.twin},void 0,!1,void 0,this),$.jsxDEV("b",{children:Y1(H.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:d_(H.entry)},void 0,!1,void 0,this)," on ",$.jsxDEV("code",{children:[H.entry.subject.type,":",r0(H.entry)]},void 0,!0,void 0,this)," · ",k5(H.entry,H.caller)," · ",b_(H.entry)]},void 0,!0,void 0,this),$.jsxDEV(s_,{fields:H.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 hZ({name:_,token:Q,vendor:J,withScreens:q,tick:U}){let G=N1(Q,`/-/${_}/checkpoint/${J}`,Math.floor(U/6)),Z=G.state==="ok"?G.data.tree.filter((T)=>T.deleted!==!0):[],F=[...new Set(Z.map((T)=>T.type))].map((T)=>({type:T,count:Z.filter((f)=>f.type===T).length})).sort((T,f)=>Number(T.type.startsWith("_"))-Number(f.type.startsWith("_"))||A2(T.type).localeCompare(A2(f.type))),[X,Y]=r.useState(null),[K,H]=r.useState(null),L=F.some((T)=>T.type===X)?X:F[0]?.type,z=Z.filter((T)=>T.type===L),W=z.find((T)=>T.id===K)??z[0],O=["name","email","title","text","description","subject","amount","percent_off","unit_amount","currency","status","channel","customer","product"],R=new Set(["id","type","object","livemode","created","updated","updatedAt","deleted"]),B=(T)=>!R.has(T)&&z.some((f)=>f[T]!==void 0&&f[T]!==null&&typeof f[T]!=="object"),P=[...new Set(z.flatMap((T)=>Object.keys(T)))],A=[...O.filter(B),...P.filter((T)=>!O.includes(T)&&B(T))].slice(0,4);return $.jsxDEV("div",{className:"ws-table-app",children:[$.jsxDEV("nav",{className:"ws-tables","aria-label":`${Y1(J)}'s records`,children:[$.jsxDEV("div",{className:"ws-list-head",children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(u1,{vendor:J},void 0,!1,void 0,this),Y1(J)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(r1,{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((T)=>$.jsxDEV("a",{href:`#${T.type}`,className:L===T.type?"on":void 0,"aria-current":L===T.type?"true":void 0,onClick:(f)=>{f.preventDefault(),Y(T.type),H(null)},children:[$.jsxDEV(B1,{name:"table-2",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:A2(T.type)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"count",children:T.count},void 0,!1,void 0,this)]},T.type,!0,void 0,this)),$.jsxDEV("p",{className:"menu-label",children:"Also"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${L1}/${_}/~/events/${J}`,onClick:(T)=>{T.preventDefault(),f1([..._.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:`${L1}/${_}/~/screens/${J}`,onClick:(T)=>{T.preventDefault(),f1([..._.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(x2,{title:`${Y1(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":`${A2(L??"")} records`,children:[$.jsxDEV("thead",{children:$.jsxDEV("tr",{children:[$.jsxDEV("th",{children:"id"},void 0,!1,void 0,this),A.map((T)=>$.jsxDEV("th",{children:T},T,!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((T)=>$.jsxDEV("tr",{className:W?.id===T.id?"on":void 0,"aria-selected":W?.id===T.id,onClick:()=>H(T.id),children:[$.jsxDEV("td",{children:$.jsxDEV("code",{children:T.id},void 0,!1,void 0,this)},void 0,!1,void 0,this),A.map((f)=>$.jsxDEV("td",{className:"ws-cell-clip",children:T[f]===void 0||T[f]===null?$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this):String(T[f])},f,!1,void 0,this)),$.jsxDEV("td",{className:"mode",children:typeof T.updatedAt==="string"?$.jsxDEV(w1,{iso:T.updatedAt},void 0,!1,void 0,this):"—"},void 0,!1,void 0,this)]},T.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:A2(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(([T])=>T!=="type"&&T!=="id").map(([T,f])=>$.jsxDEV(r.default.Fragment,{children:[$.jsxDEV("dt",{children:T},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(v0,{v:f},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},T,!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 ${V1(z.length,A2(L??"record"))}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function EZ({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(u1,{vendor:Q},void 0,!1,void 0,this),$.jsxDEV("b",{children:Y1(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:`${L1}/${_}/~/vendors/${Q}`,onClick:(F)=>{F.preventDefault(),f1([..._.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:[Y1(Q),"'s pack lists no screens."]},void 0,!0,void 0,this):null,G.state==="ok"&&J?$.jsxDEV("iframe",{title:`${Y1(Q)}, as this World shows it`,src:J},Q,!1,void 0,this):null]},void 0,!0,void 0,this)}function xZ({name:_,token:Q,who:J,scope:q}){let[U,G]=r.useState(0),Z=N1(Q,`/-/${_}/twins`),F=N1(Q,`/-/${_}/rules`,U),X=F.state==="ok"?F.data.changesets:null,[Y,K]=r.useState(null),[H,L]=r.useState(null),[z,W]=r.useState(!1),[O,R]=r.useState([]),B=Y??X?.approvals??1,P=H??X?.summary??"required",A=X!==null&&(B!==(X.approvals??1)||P!==(X.summary??"required")),T=(y,D)=>{if(R((l)=>[{ok:y,text:D,at:new Date().toISOString(),n:++j5},...l].slice(0,3)),!y)j1(D,"error")},f=async(y)=>{y.preventDefault(),W(!0);try{let D=await I1(Q,`/-/${_}/rules`,{method:"PUT",body:JSON.stringify({changesets:{approvals:B,summary:P}})});if(!D.ok){T(!1,`Save: ${await q0(D)}`);return}T(!0,`Saved: ${B===0?"no approval":V1(B,"approval")} before a deploy; a summary ${P==="required"?"required":"generated when none is given"}.`),K(null),L(null),G((l)=>l+1)}finally{W(!1)}},C={gated:"a person deploys an approved changeset",auto:"a push deploys at once",hold:"nothing deploys"},w=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),S=Z.state==="ok"?Z.data.twins.filter((y)=>y.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(r1,{load:F,what:"the rules",lines:2},void 0,!1,void 0,this),$.jsxDEV("form",{className:"ws-rules",onSubmit:(y)=>void f(y),"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 ",w,". 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:P==="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:P==="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:(y)=>K(Number(y.target.value)),disabled:Boolean(N)||X===null,"aria-label":"Approvals required",children:[0,1,2,3,4,5].map((y)=>$.jsxDEV("option",{value:y,children:y===0?"no one: verified is enough":y===1?"1 person":`${y} different people`},y,!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"&&S.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,S.length?$.jsxDEV("ul",{className:"ws-rule-list",children:S.map((y)=>$.jsxDEV("li",{children:[$.jsxDEV(u1,{vendor:y.twin},void 0,!1,void 0,this),Y1(y.twin),": ",C[y.root.deploy??"gated"]??"gated"]},y.twin,!0,void 0,this))},void 0,!1,void 0,this):null,$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("a",{href:`${L1}/${_}/~/settings/services`,onClick:(y)=>{y.preventDefault(),f1([..._.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(i0,{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:()=>{K(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 mZ({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 gZ({name:_,token:Q,view:J,sub:q,arg:U,win:G,who:Z,snapshot:F,onReturn:X,onSignOut:Y,worlds:K,session:H,retry:L,twins:z,map:W,branches:O,clock:R,canWrite:B,refused:P,signsAs:A,opens:T,tick:f,admin:C,onRemoved:w,onClock:S,scope:N}){let y=e_(_,Q,f,P),[D,l]=r.useState(0),p=D*1e5+Math.floor(f/2),k=N1(Q,`/-/${_}/diff`,p),b=N1(Q,`/-/${_}/changesets`,p),j=N1(Q,`/-/${_}/rules`,p),[E,V]=r.useState(null),h=(o)=>(K1)=>{K1?.preventDefault(),f1([..._.split("/"),"~",...o])},I=z.state==="ok"?z.data.twins.map((o)=>o.twin):[],v=new Map((W.state==="ok"?W.data.twins:[]).flatMap((o)=>{let K1=vZ(_,o);return K1?[[o.twin,K1]]:[]})),m=[...v.keys()],u=W.state==="ok"?W.data.twins.filter((o)=>o.root).map((o)=>o.twin):[],n=(o)=>W.state==="ok"?(W.data.twins.find((K1)=>K1.twin===o)?.resources??[]).reduce((K1,$1)=>K1+$1.count,0):0,e=O?.state==="ok"&&O.data.checkedOut||_.split("/")[1],t=r.useMemo(()=>{if(k.state!=="ok")return[];let o=new Map;for(let K1 of k.data.changes){let $1=`${K1.twin}:${K1.entry.subject.type}:${K1.entry.subject.id}`,M1=o.get($1)??{key:$1,twin:K1.twin,writes:[]};M1.writes.push(K1.entry),o.set($1,M1)}return[...o.values()]},[k]),a=t.find((o)=>o.key===E)??t[0],g=N1(Q,J==="changes"&&a?`/-/${_}/log/${a.twin}`:null,p),J1=k.state==="ok"?k.data.changes.length:0,G1=y.waiting.length,F1=y.there,c=y.origin.state==="ok"?y.origin.data.origin:null,s=!B?"This session reads the World; it changes nothing":!F1?"No remote: name one in Settings › Remote":null,_1=(o,K1,$1,M1,R1,x1)=>$.jsxDEV("a",{href:`${L1}/${_}/~/${M1}`,className:o?"on":void 0,"aria-current":o?"page":void 0,onClick:R1,children:[K1,$.jsxDEV("span",{children:$1},void 0,!1,void 0,this),x1?$.jsxDEV("span",{className:"count",children:x1},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),q1=(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(N5,{href:`${L1}/${_}`,onClick:(o)=>{o.preventDefault(),h(["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),K.map((o)=>$.jsxDEV("a",{href:`${L1}/${o}`,className:o===_?"on":void 0,onClick:(K1)=>{K1.preventDefault(),q1(K1),f1(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:`${H0()&&H0()!==O1?H0():""}${L1}/`,onClick:(o)=>{if(H0()&&H0()!==O1)return;o.preventDefault(),q1(o),f1([])},children:[$.jsxDEV(B1,{name:"layout-grid",size:16},void 0,!1,void 0,this),"All Worlds",i1()?` on ${new URL(i1()).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),i1()?$.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:[l0,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(i6,{text:N4({platform:i1(),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:[l0,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(i6,{text:N4()},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:[l0,"/",_,"/<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(i6,{text:N4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${L1}/${_}/~/settings`,onClick:(o)=>{q1(o),h(["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(VZ,{name:_,token:Q,branches:O,opens:T,refused:P,onChanged:S},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:e},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),c?$.jsxDEV("a",{href:`${L1}/${_}/~/remote`,onClick:h(["remote"]),children:["origin ",c.namespace,G1?$.jsxDEV("b",{children:[" ↑",G1]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("a",{href:`${L1}/${_}/~/remote`,onClick:h(["remote"]),children:"no remote"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"sep",children:":"},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${L1}/${_}/~/settings/clock`,onClick:h(["settings","clock"]),children:R.state==="ok"?$.jsxDEV($.Fragment,{children:[R.data.frozen?"stopped at ":"",$.jsxDEV(w1,{iso:R.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 y.pull(),disabled:Boolean(s)||y.busy!==null,title:s??`Fetch what ${F1} has and move this branch onto it`,children:[$.jsxDEV(B1,{name:"arrow-down-to-line",size:16},void 0,!1,void 0,this),y.busy==="Pull"?"Pulling…":"Pull"]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void y.push(),disabled:Boolean(s)||y.busy!==null||G1===0,title:s??(G1?`Push ${V1(G1,"changeset")} to ${F1}`:`Every changeset is at ${F1}`),children:[$.jsxDEV(B1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this),y.busy==="Push"?"Pushing…":"Push",G1?$.jsxDEV("span",{className:"ws-btn-count",children:G1},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:()=>h(["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(w1,{iso:F.at},void 0,!1,void 0,this),": a read-only snapshot",F.expiresAt?$.jsxDEV($.Fragment,{children:[", gone ",$.jsxDEV(w1,{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,y.log.length?$.jsxDEV("div",{className:"ws-said",children:$.jsxDEV(i0,{log:y.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:[I.length?$.jsxDEV("a",{href:`${L1}/${_}/~/screens`,className:J==="screen"?"ws-screens-entry on":"ws-screens-entry",onClick:h(["screens"]),title:`The board: ${L2(I.map(Y1))}`,children:[$.jsxDEV(B1,{name:"layout-grid",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Board"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-screens-marks",children:[I.slice(0,3).map((o)=>$.jsxDEV(u1,{vendor:o},o,!1,void 0,this)),I.length>3?$.jsxDEV("span",{className:"more",children:["+",I.length-3]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{className:"side-group",children:"Workspace"},void 0,!1,void 0,this),_1(J==="changes"||J==="history",$.jsxDEV(B1,{name:"file-diff",size:16},void 0,!1,void 0,this),"Changes","changes",h(["changes"]),t.length?String(t.length):void 0),_1(J==="events"&&!U||J==="trace",$.jsxDEV(B1,{name:"activity",size:16},void 0,!1,void 0,this),"Events","events",h(["events"])),$.jsxDEV("p",{className:"side-group",children:"Records"},void 0,!1,void 0,this),I.map((o)=>$.jsxDEV(r.default.Fragment,{children:_1(J==="vendor"&&U===o,$.jsxDEV(u1,{vendor:o},void 0,!1,void 0,this),Y1(o),`vendors/${o}`,h(["vendors",o]),n(o)?String(n(o)):void 0)},o,!1,void 0,this)),$.jsxDEV("p",{className:"side-group",children:"Remote"},void 0,!1,void 0,this),_1(!1,$.jsxDEV(B1,{name:"cloud",size:16},void 0,!1,void 0,this),F1?"origin":"Name a remote…","remote",h(["remote"]),G1?`↑${G1}`: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(c_,{name:_,view:"changes",changes:t.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:k.state==="ok"?`${V1(t.length,"record")} · ${V1(J1,"write")}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(r1,{load:k,what:"the changes",lines:4},void 0,!1,void 0,this),$.jsxDEV(p_,{records:t,...a?{selected:a.key}:{},onPick:V,label:"Changed records"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:[k.state==="ok"&&!a?$.jsxDEV(x2,{title:"No changes on this branch",action:G1>0&&F1?$.jsxDEV("button",{type:"button",className:"primary",disabled:Boolean(s)||y.busy!==null,onClick:()=>void y.push(),children:["Push ",V1(G1,"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 ",k.data.base.at?$.jsxDEV(w1,{iso:k.data.base.at},void 0,!1,void 0,this):$.jsxDEV("code",{children:k.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,a?$.jsxDEV(g_,{record:a,history:g.state==="ok"?g.data.entries:g.state==="error"?[]:null},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(HF,{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:`${L1}/${_}/~/settings/account`,branch:e},name:_,token:Q,changes:J1,canWrite:B,refused:P,onCut:()=>{l((o)=>o+1),V(null)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,J==="history"?$.jsxDEV(uZ,{name:_,token:Q,sets:b,changes:t.length,withScreens:m,required:j.state==="ok"?j.data.changesets.approvals??1:1,...q?{sub:q}:{},signsAs:A,canWrite:B,rooted:u,refused:P,onChanged:()=>l((o)=>o+1)},void 0,!1,void 0,this):null,J==="events"?$.jsxDEV(bZ,{name:_,token:Q,vendors:I,...U&&I.includes(U)?{vendor:U}:{},tick:f},U??"",!1,void 0,this):null,J==="trace"?$.jsxDEV(DZ,{name:_,token:Q,id:U??""},void 0,!1,void 0,this):null,J==="vendor"&&U?$.jsxDEV(hZ,{name:_,token:Q,vendor:U,withScreens:m.includes(U),tick:f},U,!1,void 0,this):null,J==="screen"&&U?$.jsxDEV(EZ,{name:_,vendor:U,url:W.state==="ok"?v.get(U)??null:void 0,...W.state==="error"?{mapError:W.error}:{},holding:cZ(W.state==="ok"?W.data.twins.find((o)=>o.twin===U)?.resources??[]:[]),session:H,retry:L},U,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(n1,{open:G?.kind==="settings",onClose:()=>h(["changes"])(),title:"Settings",wide:"window",children:G?.kind==="settings"?$.jsxDEV("div",{className:"ws-settings",children:[$.jsxDEV("nav",{"aria-label":"Settings",children:m_.map(([o,K1,$1])=>$.jsxDEV("a",{href:`${L1}/${_}/~/settings/${o}`,className:G.tab===o?"on":void 0,"aria-current":G.tab===o?"page":void 0,onClick:h(["settings",o]),children:[$.jsxDEV(B1,{name:$1,size:16},void 0,!1,void 0,this),K1]},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(mZ,{who:Z,scope:N,snapshot:F,portal:i1(),onSignOut:Y},void 0,!1,void 0,this):null,G.tab==="changesets"?$.jsxDEV(xZ,{name:_,token:Q,who:Z,scope:N},void 0,!1,void 0,this):null,G.tab==="remote"?$.jsxDEV(XF,{name:_,token:Q,canWrite:B,tick:f,refused:P},void 0,!1,void 0,this):null,G.tab==="access"||G.tab==="services"||G.tab==="checks"||G.tab==="clock"?$.jsxDEV(LF,{name:_,token:Q,admin:C,canWrite:B,refused:P,onRemoved:w,only:G.tab},void 0,!1,void 0,this):null,G.tab==="vault"?$.jsxDEV(YF,{name:_,token:Q,canWrite:B,refused:P},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(NZ,{},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(n1,{open:G?.kind==="branches",onClose:()=>h(["changes"])(),title:"Branches",wide:!0,children:G?.kind==="branches"?$.jsxDEV(iZ,{name:_,token:Q,canWrite:B,branches:O,opens:T,...G.open?{open:G.open}:{},onChanged:S,refused:P},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function i6({text:_}){return $.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>j1("Copied the prompt: paste it into your coding agent"),()=>j1("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}var _8=(_)=>`${_.url.replace(/\/+$/,"")}/${_.namespace}`,pZ=(_)=>_.filter((Q)=>Q.applied===null||Q.applied.outcome==="refused"),cZ=(_,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)=>V1(q.count,q.type.replace(/^_+/,""))).join(" · ")+(J.length>Q?` · +${J.length-Q} more`:""):"nothing yet"},l_=$.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 lZ({name:_,token:Q,clock:J,canWrite:q,onChanged:U,refused:G,open:Z}){let[F,X]=r.useState(!1),[Y,K]=r.useState(""),[H,L]=r.useState(""),[z,W]=r.useState(null),[O,R]=r.useState(!1),B=J.state==="ok"?J.data:null,P=async(C,w,S)=>{R(!0),W(null);try{let N=await I1(Q,`/-/${_}/${w}`,{method:w==="clock"?"PUT":"POST",body:JSON.stringify(S)});if(!N.ok){G(N),W({ok:!1,text:await q0(N)});return}let y=await N.json();W({ok:!0,text:`${C} — the World is at ${new Date(y.at).toLocaleString()}`}),X(!1),U()}catch(N){W({ok:!1,text:`the World did not answer: ${N instanceof Error?N.message:String(N)}`})}finally{R(!1)}},A=(C)=>{C.preventDefault();let w=new Date(Y);if(Number.isNaN(w.getTime())){W({ok:!1,text:"Pick a date and time."});return}if(B&&w.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}P("Clock set","clock",{at:w.toISOString()})},T=(C,w)=>{P(`Advanced ${w}`,"clock/advance",{by:C})},f=[["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(w1,{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(w1,{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),K(l2(I_(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),f.map(([C,w])=>$.jsxDEV("button",{type:"button","aria-label":`Advance ${w}`,disabled:O||!B.frozen,title:B.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>T(C,w),children:w},C,!1,void 0,this)),$.jsxDEV("form",{className:"inline",onSubmit:(C)=>{if(C.preventDefault(),!/^\d+[smhd]$/.test(H.trim())){W({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}T(H.trim(),`by ${H.trim()}`)},children:[$.jsxDEV("label",{className:"sr",children:["Advance by ",$.jsxDEV("input",{name:"advanceBy",value:H,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:l2(I_(B.at)),onChange:(C)=>K(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 rZ({name:_,token:Q,clock:J,refused:q}){let[U,G]=r.useState(!1),[Z,F]=r.useState(""),[X,Y]=r.useState(null),[K,H]=r.useState(!1),L=J.state==="ok"?J.data.at:new Date().toISOString(),z=r.useRef(null);return r.useEffect(()=>{if(!U)return;let O=(B)=>{if(B.key==="Escape"&&!document.querySelector("dialog[open]"))G(!1),z.current?.querySelector("button")?.focus()},R=(B)=>{if(!z.current?.contains(B.target))G(!1)};return document.addEventListener("keydown",O),document.addEventListener("click",R),()=>{document.removeEventListener("keydown",O),document.removeEventListener("click",R)}},[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(l2(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 R=new Date(Z);if(Number.isNaN(R.getTime())){Y("Pick a date and time.");return}if(R.getTime()>Date.parse(L)){Y(`That is after the World's present (${new Date(L).toLocaleString()}); a snapshot looks back.`);return}H(!0);try{let B=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({at:{instant:R.toISOString()},ttl:3600})});if(!B.ok){q(B),Y(await q0(B));return}let P=await B.json();t6({name:P.name,parent:_,token:P.token,readToken:P.readToken,at:R.toISOString(),expiresAt:P.expiresAt??null,parentOrigin:O1,made:!0});let A=y5(P.origin)?.origin;if(A&&A!==O1){e6(A,P.readToken,P.name,`${L1}/${P.name}`);return}f1(P.name.split("/"))}catch(B){Y(`the World did not answer: ${B instanceof Error?B.message:String(B)}`)}finally{H(!1)}},noValidate:!0,children:[$.jsxDEV("label",{children:["As of ",$.jsxDEV("input",{name:"asOf",type:"datetime-local",value:Z,max:l2(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:K,children:K?"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 r_({name:_,token:Q,open:J,onClose:q,onMade:U,refused:G}){let Z=(w)=>w.split("/").pop()??w,[F,X]=r.useState(!1),[Y,K]=r.useState(null),[H,L]=r.useState(""),[z,W]=r.useState("now"),[O,R]=r.useState(""),[B,P]=r.useState("24"),[A,T]=r.useState(!0);r.useEffect(()=>{if(J)K(null),R(l2(new Date().toISOString()))},[J]);let f=async(w)=>{w.preventDefault(),K(null);let S=z==="at"?new Date(O):null;if(S&&Number.isNaN(S.getTime())){K("Pick a date and time, or make it as of now.");return}if(S&&S.getTime()>Date.now()){K("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),...S?{at:{instant:S.toISOString()}}:A?{live:!0}:{},...H.trim()?{label:H.trim()}:{}})}).catch(()=>null);if(X(!1),!N){K(`${O1} did not answer`);return}if(!N.ok){G(N),K(await q0(N));return}let y=await N.json();t6({name:y.name,parent:_,token:y.token??"",readToken:y.readToken,at:(S??new Date).toISOString(),expiresAt:y.expiresAt??null,parentOrigin:O1,...y.origin?{origin:y.origin}:{}}),q(),L(""),j1(`Made ${Z(y.name)}`),U()};return $.jsxDEV(n1,{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:(w)=>void f(w),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:H,onChange:(w)=>L(w.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:(w)=>T(w.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:l2(new Date().toISOString()),onChange:(w)=>R(w.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:(w)=>P(w.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 iZ({name:_,token:Q,canWrite:J,branches:q,opens:U,open:G,onChanged:Z,refused:F,snapshotOf:X}){let Y=N1(Q,`/-/${_}/clock`),K=(P)=>P.split("/").pop()??P,[H,L]=r.useState(!1),z=(P)=>(A)=>{A.preventDefault(),f1([..._.split("/"),"~","branches",...P?P.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:K(_),running:!0}],R=q.state==="ok"?q.data.checkedOut??K(_):K(_),B=async(P)=>{if(!await T0({title:`Remove the branch ${K(P)}?`,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/${P}`,{method:"DELETE"}).catch((T)=>T);if(A instanceof Error){j1(`Remove ${K(P)}: the World did not answer (${A.message})`,"error");return}if(!A.ok){F(A),j1(`Remove ${K(P)}: ${await q0(A)}`,"error");return}k4(P),j1(`Removed ${K(P)}`),Z(),f1([..._.split("/"),"~","branches"])};if(G){let P=G.includes("/")?W.find((T)=>T.name===G):void 0,A=G.includes("/")?void 0:O.find((T)=>T.name===G);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${L1}/${_}/~/branches`,onClick:z(),children:"← Branches"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(r1,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"&&!P&&!A?$.jsxDEV("p",{className:"mode",children:["This World has no branch named ",G,"."]},void 0,!0,void 0,this):null,P?$.jsxDEV(dZ,{name:_,b:P,canWrite:J,opens:U(P.name),remove:()=>void B(P.name)},void 0,!1,void 0,this):null,A&&!P?$.jsxDEV(aZ,{name:_,token:Q,b:A,served:A.name===R,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:R},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(rZ,{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(r1,{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((P)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:[$.jsxDEV("a",{href:`${L1}/${_}/~/branches/${P.name}`,onClick:z(P.name),children:$.jsxDEV("b",{children:P.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),P.name===R?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("span",{className:"badge live",children:"served here"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):P.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:${P.name}`,!0,void 0,this)),W.map((P)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("a",{href:`${L1}/${_}/~/branches/${P.name}`,onClick:z(P.name),children:$.jsxDEV("b",{children:K(P.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:K(P.from??_)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P.at?.instant?$.jsxDEV(w1,{iso:P.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(w1,{iso:P.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P.expiresAt?$.jsxDEV(w1,{iso:P.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},P.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(r_,{name:_,token:Q,open:H,onClose:()=>L(!1),onMade:Z,refused:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function dZ({name:_,b:Q,canWrite:J,opens:q,remove:U}){let G=(X)=>X.split("/").pop()??X,Z=o6(Q.name),F=N1(Z,Z?`/-/${Q.name}/diff`:null);return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[l_," ",G(Q.name)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>x_(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(w1,{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(w1,{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(w1,{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(FF,{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 aZ({name:_,token:Q,b:J,served:q,canWrite:U,canServe:G}){let[Z,F]=r.useState(!1),[X,Y]=r.useState(null),K=async()=>{F(!0),Y(null);let H=await I1(Q,`/-/${_}/branches/${encodeURIComponent(J.name)}/serve`,{method:"POST"}).catch(()=>null);if(H?.ok){location.reload();return}F(!1),Y(H?await q0(H):`${O1} did not answer`)};return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[l_," ",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 K(),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:`${L1}/${_}/~/changes`,onClick:(H)=>{H.preventDefault(),f1([..._.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 N_=50,g2=(_)=>`${_.twin}:${_.position}`,i_=(_,Q)=>Date.parse(Q.entry.occurredAt)-Date.parse(_.entry.occurredAt)||_.twin.localeCompare(Q.twin)||Q.position-_.position,v4=(_)=>{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":_},k5=(_,Q)=>{let J=typeof Q==="string"?Q:typeof _.caller==="string"?_.caller:"";if(J.startsWith("key:")&&J.length>4)return`by ${v4(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"},d_=(_)=>_.operation??_.op;function sZ(_){let Q=_.fields??{},J=Q.usage!==null&&typeof Q.usage==="object"?Q.usage:Q,q=(...Y)=>Y.map((K)=>J[K]??Q[K]).find((K)=>typeof K==="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 a_({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 v0({v:_}){if(typeof _==="string")return $.jsxDEV(a_,{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 tZ=(_)=>typeof _==="string"?_:Array.isArray(_)?_.map((Q)=>Q&&typeof Q==="object"&&typeof Q.text==="string"?Q.text:"").filter(Boolean).join(`
36
- `):JSON.stringify(_??"");function oZ({body:_}){if(_===null||typeof _!=="object"||Array.isArray(_))return $.jsxDEV(v0,{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(r.default.Fragment,{children:[$.jsxDEV("dt",{children:U},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(v0,{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(a_,{text:tZ(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 s_({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(r.default.Fragment,{children:[$.jsxDEV("dt",{children:J},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(v0,{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 nZ=(_)=>_.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 eZ(_){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(i_)}var d6={deployed:5,confirmed:4,landed:3,replayed:2,skipped:1};function C_(_){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)=>(d6[G.status]??0)-(d6[U.status]??0))[0];return J&&!(d6[q.status]>=5)?{status:J.status,bad:!0}:{status:q.status,bad:!1}}var p2=1280,c2=820,C4=160,C5=72,S_=72,E1=(_)=>`${_.vendor}:${_.id}`,z2=(_)=>`${_.vendor}:section:${_.section.id}`,Q8=(_)=>[_.section.id,..._.section.aka??[]].map((Q)=>`${_.vendor}:section:${Q}`),_F=(_,Q)=>Q.at&&("site"in Q.at)?Q.at.site:Q.at?`${l0}/${_}/${Q.vendor}${Q.at.screen}`:null,QF=(_,Q)=>_.include?Q.filter((J)=>_.include.includes(E1(J))||Q8(J).some((q)=>_.include.includes(q))):Q.filter((J)=>!(_.hidden??[]).includes(E1(J)));function JF({data:_}){let{world:Q,frame:J,url:q,active:U,boards:G,addTo:Z,remove:F}=_,X=E1(J),Y=G.filter((K)=>K.include&&!K.include.includes(X)&&!Q8(J).some((H)=>K.include.includes(H)));return $.jsxDEV($.Fragment,{children:[$.jsxDEV(X_,{isVisible:!0,position:Z1.Top,align:"start",className:"frame-label",children:[$.jsxDEV(u1,{vendor:J.vendor},void 0,!1,void 0,this),$.jsxDEV("span",{children:[Y1(J.vendor)," · ",J.kind]},void 0,!0,void 0,this),J.changes?$.jsxDEV("a",{className:"frame-changed nodrag",href:`${L1}/${Q}/~/changes`,onClick:(K)=>{K.preventDefault(),f1([...Q.split("/"),"~","changes"])},title:`${V1(J.changes,"change")} here, not in a changeset: see them in Changes`,children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),J.changes]},void 0,!0,void 0,this):null,Y.length?$.jsxDEV("select",{className:"nodrag frame-add",value:"","aria-label":`Add ${J.title} to a board`,onChange:(K)=>{if(K.target.value)Z(K.target.value,X)},children:[$.jsxDEV("option",{value:"",children:"Add to board…"},void 0,!1,void 0,this),Y.map((K)=>$.jsxDEV("option",{value:K.id,children:K.name},K.id,!1,void 0,this))]},void 0,!0,void 0,this):null,F?$.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>F.act(X),title:F.label,"aria-label":F.label,children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:U?"frame on":"frame",style:{width:p2,height:c2},children:[$.jsxDEV("div",{className:"frame-bar",title:"Drag to move",children:[$.jsxDEV(u1,{vendor:J.vendor},void 0,!1,void 0,this),$.jsxDEV("strong",{children:J.title},void 0,!1,void 0,this),$.jsxDEV("span",{className:"frame-url",children:J.url.replace(/^https?:\/\//,"")},void 0,!1,void 0,this),q?$.jsxDEV("a",{className:"nodrag",href:q,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${J.title} in a new tab`,children:"↗"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:U?"frame-body nodrag nopan nowheel":"frame-body",children:q?$.jsxDEV("iframe",{title:J.title,src:q,loading:"lazy",style:{pointerEvents:U?"auto":"none"}},void 0,!1,void 0,this):$.jsxDEV("div",{className:"frame-none",children:[$.jsxDEV("p",{children:$.jsxDEV("strong",{children:J.unseen==="sites-not-routed"?`This World shows ${J.title} only at its own local address.`:`${Y1(J.vendor)}'s twin draws no page for this ${J.kind} yet.`},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:J.url},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function $F({data:_}){return $.jsxDEV("div",{className:"section-box",style:{width:_.width,height:_.height},children:$.jsxDEV("span",{className:"section-label",children:[$.jsxDEV(u1,{vendor:_.vendor},void 0,!1,void 0,this),_.label]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var qF={screen:JF,section:$F};function UF(_){return $.jsxDEV(x6,{children:$.jsxDEV(GF,{..._},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function GF({name:_,token:Q,session:J,retry:q,snapshot:U,back:G,canWrite:Z}){let F=r.useRef(null),X=r.useRef(0),Y=r.useRef(Promise.resolve()),K=r.useRef(0),[,H]=r.useState(0),[L,z]=r.useState({state:"loading"}),[W,O]=r.useState(null),R=r.useRef(0),B=r.useRef(0),P=r.useCallback(async()=>{let c=K.current,s=++R.current,_1=await I1(Q,`/-/${_}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),q1=_1?.ok?await _1.json().catch(()=>null):null;if(s<B.current)return;if(B.current=s,!q1?.frames||!q1.boards||!q1.version){let o=_1?`the World answered ${_1.status}`:"the World did not answer";z((K1)=>K1.state==="ok"?K1:{state:"error",status:_1?.status??0,error:o}),O(o);return}if(O(null),c===K.current&&X.current===0)F.current={boards:q1.boards,version:q1.version};z({state:"ok",data:q1})},[Q,_]);r.useEffect(()=>{P();let c=setInterval(()=>{if(!document.hidden)P()},1e4);return()=>clearInterval(c)},[P]);let A=L.state==="ok"?L.data.frames:[],T=F.current?.boards??[{id:"everything",name:"Everything"}],[f,C]=r.useState("everything"),w=T.find((c)=>c.id===f)??T[0],S=Z&&!U,N=r.useCallback((c)=>{if(!F.current)return j1("The board is being read again: make that change once it shows","error"),Promise.resolve();F.current={...F.current,boards:c(F.current.boards)},X.current+=1,K.current+=1,H((_1)=>_1+1);let s=Y.current.then(async()=>{let _1=F.current;if(!_1)return;try{let q1=await I1(Q,`/-/${_}/board`,{method:"PUT",body:JSON.stringify({boards:_1.boards,version:_1.version}),signal:AbortSignal.timeout(15000)}),o=await q1.json().catch(()=>null);if(q1.ok&&o?.boards&&o.version)F.current={boards:X.current>1&&F.current?F.current.boards:o.boards,version:o.version};else if(q1.status===409&&o?.boards&&o.version)F.current={boards:o.boards,version:o.version},j1("Someone else changed the board first: it is shown as they left it","error");else throw Error(o?.error??`the World answered ${q1.status}`)}catch(q1){j1(`The board was not kept: ${q1 instanceof Error?q1.message:String(q1)}`,"error"),F.current=null;let o=await I1(Q,`/-/${_}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),K1=o?.ok?await o.json().catch(()=>null):null;if(K1?.boards&&K1.version)F.current={boards:K1.boards,version:K1.version}}}).finally(()=>{if(X.current-=1,K.current+=1,H((_1)=>_1+1),X.current===0&&!F.current)P()});return Y.current=s,s},[Q,_,P]),y=(c,s)=>{N((_1)=>_1.map((q1)=>q1.id===c?s(q1):q1))},D=QF(w,A),l=A.filter((c)=>c.changes&&!D.includes(c)).reduce((c,s)=>c+s.changes,0),[p,k]=r.useState(null),b=w5(),j=r.useCallback(()=>{let c=new Map;for(let $1 of D){let M1=w.placed?.[E1($1)];if(M1)c.set(E1($1),M1)}let s=Math.max(-C4,...[...c.values()].map(($1)=>$1.y+c2)),_1=[...new Set(D.map(z2))];for(let $1 of _1){let M1=D.filter((k1)=>z2(k1)===$1),R1=M1.filter((k1)=>c.has(E1(k1))).map((k1)=>c.get(E1(k1))),x1=R1.length?Math.max(...R1.map((k1)=>k1.x))+p2+C4:0,U0=R1.length?Math.min(...R1.map((k1)=>k1.y)):s+C4+C5*2+S_;for(let k1 of M1)if(!c.has(E1(k1)))c.set(E1(k1),{x:x1,y:U0}),x1+=p2+C4;s=Math.max(s,U0+c2)}let q1=T.filter(($1)=>$1.include),o=($1,M1)=>y($1,(R1)=>({...R1,include:[...R1.include??[],M1]})),K1={label:w.include?"Take it off this board":"Hide it",act:($1)=>y(w.id,(M1)=>M1.include?{...M1,include:M1.include.filter((R1)=>R1!==$1)}:{...M1,hidden:[...M1.hidden??[],$1]})};return D.map(($1)=>({id:E1($1),type:"screen",dragHandle:".frame-bar",draggable:S,position:c.get(E1($1)),data:{world:_,frame:$1,url:_F(_,$1),active:!1,boards:S?q1:[],addTo:o,remove:!S||w.include&&!w.include.includes(E1($1))?null:K1}}))},[JSON.stringify(D),JSON.stringify(w),JSON.stringify(T.map((c)=>[c.id,c.name,c.include])),_,S]),[E,V,h]=q_([]),I=r.useRef("");r.useEffect(()=>{let c=j();if(V(c.map((s)=>({...s,data:{...s.data,active:s.id===p}}))),c.length&&I.current!==w.id)I.current=w.id,requestAnimationFrame(()=>{b.fitView({padding:0.08,duration:0})})},[j,V]),r.useEffect(()=>{V((c)=>c.map((s)=>s.data.active===(s.id===p)?s:{...s,data:{...s.data,active:s.id===p}}))},[p,V]),r.useEffect(()=>{let c=(s)=>{if(s.key==="Escape")k(null)};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]);let v=r.useMemo(()=>{let c=new Map;for(let s of E){let _1=z2(s.data.frame);c.set(_1,[...c.get(_1)??[],s])}return[...c].map(([s,_1])=>{let q1=Math.min(..._1.map((R1)=>R1.position.x))-C5,o=Math.min(..._1.map((R1)=>R1.position.y))-C5-S_,K1=_1[0].data.frame,$1=Math.max(..._1.map((R1)=>R1.position.x))+p2+C5-q1,M1=Math.max(..._1.map((R1)=>R1.position.y))+c2+C5-o;return{id:`box:${s}`,type:"section",position:{x:q1,y:o},width:$1,height:M1,zIndex:-1,draggable:!1,selectable:!1,data:{vendor:K1.vendor,label:`${Y1(K1.vendor)} · ${K1.section.title}`,width:$1,height:M1}}})},[E]),m=()=>y(w.id,(c)=>({...c,placed:{...c.placed??{},...Object.fromEntries(E.map((s)=>[s.id,{x:Math.round(s.position.x),y:Math.round(s.position.y)}]))}})),u=(c)=>{k(c);let s=b.getNode(c);if(!s)return;let _1=Math.min((window.innerWidth-300)/p2,(window.innerHeight-120)/c2,1);b.setCenter(s.position.x+p2/2-130/_1,s.position.y+c2/2,{zoom:_1,duration:400})},n=()=>{let c=`board-${Date.now().toString(36)}`;C(c),N((s)=>[...s,{id:c,name:`Board ${s.length}`,include:[]}])},e=()=>{let c=window.prompt("Name this board",w.name)?.trim();if(c)y(w.id,(s)=>({...s,name:c.slice(0,80)}))},t=()=>{let c=w.id;C("everything"),N((s)=>s.filter((_1)=>_1.id!==c))},a=[...new Map(A.map((c)=>[z2(c),c])).values()],g=w.include?[...a.filter((c)=>!Q8(c).some((s)=>w.include.includes(s))).map((c)=>({key:z2(c),label:`${Y1(c.vendor)} · ${c.section.title} (all)`})),...A.filter((c)=>!D.includes(c)).map((c)=>({key:E1(c),label:c.title}))]:[],J1=w.include?[]:A.filter((c)=>!D.includes(c)),G1=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,F1=J.state==="ok"&&L.state==="ok";return $.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"The World's board",children:$.jsxDEV($_,{nodes:F1?[...v,...E]:[],onNodesChange:(c)=>h(c.filter((s)=>!("id"in s)||!String(s.id).startsWith("box:"))),nodeTypes:qF,onNodeDragStop:m,onNodeClick:(c,s)=>{if(!s.id.startsWith("box:"))k(s.id)},onPaneClick:()=>k(null),minZoom:0.03,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!1,zoomOnDoubleClick:!1,colorMode:G1?"dark":"light",proOptions:{hideAttribution:!0},children:[$.jsxDEV(G_,{variant:M0.Dots,gap:28,size:1.4},void 0,!1,void 0,this),$.jsxDEV(X2,{position:"top-left",className:"float layers",children:[$.jsxDEV("div",{className:"float-head",children:[$.jsxDEV("button",{type:"button",className:"back",onClick:G,"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],U?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"board-tabs",role:"tablist","aria-label":"Boards",children:[T.map((c)=>$.jsxDEV("button",{type:"button",role:"tab","aria-selected":c.id===w.id,className:c.id===w.id?"on":void 0,onClick:()=>C(c.id),onDoubleClick:S&&c.id===w.id&&c.include?e:void 0,children:c.name},c.id,!1,void 0,this)),S?$.jsxDEV("button",{type:"button",className:"ghost",onClick:n,"aria-label":"A new board",children:"+"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),w.include&&S?$.jsxDEV("div",{className:"board-acts",children:[$.jsxDEV("button",{type:"button",className:"ghost",onClick:e,children:"Rename"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"ghost",onClick:t,children:"Delete board"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("ul",{className:"layer-list","aria-label":"Frames",children:[...new Set(D.map(z2))].map((c)=>{let s=D.filter((_1)=>z2(_1)===c);return $.jsxDEV("li",{children:[$.jsxDEV("span",{className:"layer-section",children:[$.jsxDEV(u1,{vendor:s[0].vendor},void 0,!1,void 0,this),Y1(s[0].vendor)," · ",s[0].section.title]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"layer-list inner",children:s.map((_1)=>$.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:p===E1(_1)?"on":void 0,onClick:()=>u(E1(_1)),children:[$.jsxDEV("span",{children:_1.title},void 0,!1,void 0,this),_1.changes?$.jsxDEV("span",{className:"layer-changed",title:`${V1(_1.changes,"change")}, not in a changeset`,children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),_1.changes]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},E1(_1),!1,void 0,this))},void 0,!1,void 0,this)]},c,!0,void 0,this)})},void 0,!1,void 0,this),w.include&&!D.length?$.jsxDEV("p",{className:"mode pad-s",children:"An empty board: add frames from Everything, or below."},void 0,!1,void 0,this):null,g.length&&S?$.jsxDEV("select",{className:"board-add",value:"","aria-label":"Add to this board",onChange:(c)=>{let s=c.target.value;if(s)y(w.id,(_1)=>({..._1,include:[..._1.include??[],s]}))},children:[$.jsxDEV("option",{value:"",children:"Add to this board…"},void 0,!1,void 0,this),g.map((c)=>$.jsxDEV("option",{value:c.key,children:c.label},c.key,!1,void 0,this))]},void 0,!0,void 0,this):null,J1.length?$.jsxDEV("details",{className:"board-hidden",children:[$.jsxDEV("summary",{children:["Hidden (",J1.length,")"]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"layer-list",children:J1.map((c)=>$.jsxDEV("li",{children:S?$.jsxDEV("button",{type:"button",onClick:()=>y(w.id,(s)=>({...s,hidden:(s.hidden??[]).filter((_1)=>_1!==E1(c))})),children:[$.jsxDEV("span",{children:c.title},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Show"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("span",{className:"pad-s",children:c.title},void 0,!1,void 0,this)},E1(c),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,l?$.jsxDEV("button",{type:"button",className:"board-elsewhere",onClick:()=>C("everything"),children:[$.jsxDEV(B1,{name:"square-dot",size:14},void 0,!1,void 0,this),V1(l,"change")," not on this board"]},void 0,!0,void 0,this):null,$.jsxDEV(r1,{load:L,what:"the board"},void 0,!1,void 0,this),W&&L.state==="ok"?$.jsxDEV("p",{role:"alert",className:"pad-s",children:["The board could not be read again (",W,"): it shows what was last read."]},void 0,!0,void 0,this):null,J.state==="pending"?$.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,J.state==="error"?$.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",J.error," ",$.jsxDEV("button",{type:"button",onClick:q,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(X2,{position:"top-center",className:"float hint mode",children:p?`Using ${D.find((c)=>E1(c)===p)?.title??p} · Esc to leave`:"Drag to pan · scroll to zoom · click a frame to use it"},void 0,!1,void 0,this),$.jsxDEV(F_,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),$.jsxDEV(K_,{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 t_=(_)=>_.actions.map((Q)=>({twin:Q.service,entry:{...Q.action,service:Q.service,op:Q.action.op??Q.action.operation??""}})),ZF=(_)=>{let Q=_.action.input??{};return!(typeof Q.operationId==="string"||Q.graphql!==void 0&&Q.graphql!==null)};function V4(_){let Q=_.actions.filter(ZF).length,J=_.actions.length-Q,q=_.applied?.receipts??[],U=_.deployed??[],G=new Set([...U.filter((X)=>X.status==="deployed"),...q.filter((X)=>X.status==="confirmed")].map((X)=>X.actionId)).size,Z=new Set([...U.filter((X)=>X.status==="refused"||X.status==="failed"),...q.filter((X)=>X.status==="failed")].map((X)=>X.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((X)=>X.status==="replayed")&&q.every((X)=>X.status==="replayed"||X.status==="skipped"))return{label:"Pushed",tone:"good",...F};return{label:"Not sent",tone:"plain",...F}}var a6=(_)=>_.message??_.narration?.split(`
37
- `)[0]?.replace(/ setting .*$/,"")??_.name;function o_(_,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 k_({name:_,token:Q,signsAs:J,c:q,canWrite:U,rooted:G,refused:Z,onChanged:F,part:X,required:Y}){let K=X==="head",H=X==="review",[L,z]=r.useState(null),[W,O]=r.useState(!1),[R,B]=r.useState(""),[P,A]=r.useState(""),[T,f]=r.useState(null),C=N1(Q,`/-/${_}/origin`),w=V4(q),S=o_(q,Y),N=t_(q),y=[...new Set(N.map((u)=>u.twin))],D=y.some((u)=>G.includes(u)),l=(u)=>u===(q.currentHash??q.contentHash),p=q.applied?.receipts??[],k=(q.deployed??[]).filter((u)=>u.status!=="landed"),b=p.filter((u)=>u.status==="confirmed").length,j=k.filter((u)=>u.status==="deployed"),E=async(u,n,e,t)=>{z(u),f(null);try{let a=await I1(Q,n,{method:"POST",...e===void 0?{}:{body:JSON.stringify(e)}});if(!a.ok)return Z(a),f({what:u,...b1(await C0(a))}),!1;if(t)j1(t);return F(),!0}catch(a){return f({what:u,text:`the World did not answer (${a instanceof Error?a.message:String(a)})`,acts:[]}),!1}finally{z(null)}},V=()=>{E("Verify",`/-/${_}/changesets/${q.name}/verify`,void 0,"Verified: the checks ran over it")},h=async(u)=>{if(u.preventDefault(),await E("Approve",`/-/${_}/changesets/${q.name}/approve`,{...R.trim()?{note:R.trim()}:{},...J===null&&P.trim()?{as:P.trim()}:{}},"Approved"))O(!1),B("")},I=async()=>{let u=y.filter((n)=>G.includes(n));if(!await T0({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 ",L2(u.map(Y1)),". This cannot be taken back here."]},void 0,!0,void 0,this),action:"Deploy",danger:!0,typed:q.name}))return;z("Deploy"),f(null);try{let n=await I1(Q,`/-/${_}/deploy/${q.name}`,{method:"POST",body:JSON.stringify({confirm:q.name})});if(!n.ok){Z(n),f({what:"Deploy",...b1(await C0(n))});return}let e=await I1(Q,`/-/${_}/changesets/${q.name}`),t=e.ok?await e.json():null;if(!t){j1("Deploy: sent; reading its receipts failed","info"),F();return}let a=V4(t);j1(`Deploy: ${a.performed} of ${a.total} change${a.total===1?"":"s"} performed at the vendor${a.failed?`; ${a.failed} refused or failed`:""}`,a.failed?"error":a.performed?"ok":"info"),F()}catch(n){f({what:"Deploy",text:`the World did not answer (${n instanceof Error?n.message:String(n)})`,acts:[]})}finally{z(null)}},v=!U?"This session reads the World; it changes nothing":w.label==="Deployed"?"Already deployed: every change was performed at the vendor":null,m=C.state==="ok"&&C.data.origin?_8(C.data.origin):null;return $.jsxDEV("div",{className:"changeset","aria-labelledby":"changeset-title",children:[K?$.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-${w.tone}`,children:w.label},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:`badge cs-${S.tone}`,children:S.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(w1,{iso:q.createdAt},void 0,!1,void 0,this)," · ",q.actions.length," change",q.actions.length===1?"":"s"," at ",L2(y.map(Y1))||"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(v)||L!==null,title:v??"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(v)||L!==null,title:v??"Sign its current contents as yourself",children:"Approve…"},void 0,!1,void 0,this),D?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>void I(),disabled:Boolean(v)||L!==null,title:v??"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),v&&w.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:[v,"."]},void 0,!0,void 0,this):null,T?$.jsxDEV("div",{role:"alert",className:"refusal",children:[$.jsxDEV("span",{children:[$.jsxDEV("b",{children:T.what},void 0,!1,void 0,this),": ",T.text]},void 0,!0,void 0,this),T.acts.includes("verify")&&U?$.jsxDEV("button",{type:"button",onClick:V,disabled:L!==null,children:"Verify"},void 0,!1,void 0,this):null,T.acts.includes("approve")&&U?$.jsxDEV("button",{type:"button",onClick:()=>O(!0),disabled:L!==null,children:"Approve…"},void 0,!1,void 0,this):null,$.jsxDEV(u_,{name:_,acts:T.acts},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):null,H?$.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:[w.performed>0?$.jsxDEV("p",{className:"pad",children:[w.performed>=w.total?"Deployed":"Partly deployed",": ",w.performed," of ",w.total," change",w.total===1?"":"s",w.own?` (and ${w.own} of the World's own, which stay in it)`:""," performed at ",L2([...new Set([...j.map((u)=>u.service),...p.filter((u)=>u.status==="confirmed").map((u)=>u.service)].map(Y1))]),j.length?` (${j.length} from here`:" (",j.length&&b?", ":"",b?`${b} by the remote`:"",")."]},void 0,!0,void 0,this):w.label==="Pushed"?$.jsxDEV("p",{className:"pad",children:["Pushed to the remote",m?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:m},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,q.applied?$.jsxDEV($.Fragment,{children:[" · ",$.jsxDEV(w1,{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):w.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",D?"; Deploy, to the real vendors behind it":"","."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,w.failed>0?$.jsxDEV("p",{className:"pad failed",role:"alert",children:[w.failed," change",w.failed===1?" was":"s were"," refused or failed at the vendor",[...k.filter((u)=>u.reason&&(u.status==="refused"||u.status==="failed")).map((u)=>u.reason),...p.filter((u)=>u.status==="failed"&&u.error).map((u)=>u.error)].slice(0,3).map((u)=>`: ${b1(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,n)=>$.jsxDEV("li",{className:"mode",children:b1(u).text},n,!1,void 0,this))},void 0,!1,void 0,this):null,k.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:k.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)," ",Y1(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:[" · ",b1(u.reason).text]},void 0,!0,void 0,this):null," ",$.jsxDEV("span",{className:"mode",children:["· ",$.jsxDEV(w1,{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,p.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:p.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)," ",Y1(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:[" · ",b1(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),!D&&w.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:`${L1}/${_}/~/settings/services`,onClick:(u)=>{u.preventDefault(),f1([..._.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:l(q.verification.contentHash)?"":"stale",children:[$.jsxDEV("p",{children:[q.verification.passed?"✓ Passed":"✗ Failed"," · ",$.jsxDEV(w1,{iso:q.verification.at},void 0,!1,void 0,this),l(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:Y1(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,n)=>$.jsxDEV("li",{children:["✗ ",$.jsxDEV("code",{children:u.check},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[Y1(u.service),": ",u.reason]},void 0,!0,void 0,this)]},n,!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,n)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:u.principal},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(w1,{iso:u.at},void 0,!1,void 0,this),l(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]},n,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(n1,{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 h(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:P,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:R,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 n_=(_,Q)=>JSON.stringify(_)===JSON.stringify(Q);function FF({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(u1,{vendor:q},void 0,!1,void 0,this),Y1(q)," ",$.jsxDEV("span",{className:"mode",children:["· ",V1(G.length,"record"),", ",V1(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((H)=>`${H.subject.type}:${H.subject.id}`===Z),X=F[F.length-1],Y=K0(X),K={};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:r0(X)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),F.map((H)=>{let L=H.fields??{},z=Object.entries(L).filter(([O,R])=>!(O in K)||!n_(K[O],R)),W=K;return K={...K,...L},$.jsxDEV("div",{className:"write",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"op",children:K0(H).what},void 0,!1,void 0,this)," · ",$.jsxDEV(w1,{iso:H.occurredAt},void 0,!1,void 0,this)," · ",k5(H)]},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 ${K0(H).what} set`,children:z.map(([O,R])=>$.jsxDEV(r.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(v0,{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(v0,{v:R},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV(v0,{v:R},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},O,!0,void 0,this))},void 0,!1,void 0,this)]},H.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 HF({name:_,token:Q,changes:J,canWrite:q,refused:U,onCut:G,pinned:Z,generated:F,inputRef:X,author:Y}){let[K,H]=r.useState(""),[L,z]=r.useState(!1),[W,O]=r.useState([]),R=(P,A,T)=>{O((f)=>[{ok:P,text:A,at:new Date().toISOString(),n:++j5,...T?.length?{acts:T}:{}},...f].slice(0,4))},B=async(P)=>{P.preventDefault(),z(!0);try{let A=await I1(Q,`/-/${_}/changesets`,{method:"POST",body:JSON.stringify(K.trim()?{message:K.trim()}:{})});if(!A.ok){U(A);let f=b1(await C0(A));R(!1,`Cut a changeset: ${f.text}`,f.acts);return}let T=await A.json();R(!0,`Cut ${T.name??"a changeset"}: ${V1(T.actions?.length??0,"change")}, ready to review in History and push.`),H(""),G()}catch(A){R(!1,`Cut a changeset: the World did not answer (${A instanceof Error?A.message:String(A)})`)}finally{z(!1)}};if(Z){let P=!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(i0,{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(),f1(Y.account.slice(L1.length+1).split("/"))},children:Y.face},void 0,!1,void 0,this):null,$.jsxDEV("input",{ref:X,name:"changesetMessage","aria-label":"Summary",value:K,onChange:(A)=>H(A.target.value),placeholder:J===0?"Nothing to cut":F?"Summary (optional)":"Summary (required)",required:!F,maxLength:200,disabled:Boolean(P),title:P??void 0},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(P)||L,title:P??void 0,children:L?"Cutting…":J===0?"Cut a changeset":$.jsxDEV($.Fragment,{children:["Cut ",V1(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(i0,{log:W,name:_},void 0,!1,void 0,this);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("form",{className:"block cut pad",onSubmit:(P)=>void B(P),"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:K,onChange:(P)=>H(P.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(i0,{log:W,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function KF({name:_,token:Q}){let[J,q]=r.useState(0),U=N1(Q,`/-/${_}/keys`,J),[G,Z]=r.useState(!1),[F,X]=r.useState(""),[Y,K]=r.useState("write"),[H,L]=r.useState(!1),[z,W]=r.useState(null),[O,R]=r.useState(null),[B,P]=r.useState(null),A=async()=>{let C=`Read-only link · ${new Date().toLocaleDateString(void 0,{month:"short",day:"numeric"})}`,w=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:C,scope:"read"})}).catch(()=>null),S=w?await w.json().catch(()=>({})):{error:`${O1} did not answer`};if(!w?.ok||!S.key){j1(S.error?b1(S.error).text:"refused","error");return}P(`${window.location.origin}${L1}/${_}#${new URLSearchParams({token:S.key}).toString()}`),q((N)=>N+1)},T=async(C)=>{C.preventDefault(),L(!0),W(null);let w=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:F.trim(),scope:Y})}).catch(()=>null);L(!1);let S=w?await w.json().catch(()=>({})):{error:`${O1} did not answer`};if(!w?.ok||!S.key){W(S.error?b1(S.error).text:"refused");return}Z(!1),R({key:S.key,name:F.trim()}),X(""),q((N)=>N+1)},f=async(C)=>{if(!await T0({title:`Revoke ${C.name}?`,body:"Whatever holds it loses this World at once.",action:"Revoke key",danger:!0}))return;let w=await I1(Q,`/-/${_}/keys/${C.id}`,{method:"DELETE"});if(w.ok)j1(`Revoked ${C.name}`);else j1(await q0(w),"error");q((S)=>S+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),i1()?$.jsxDEV("a",{className:"button primary",href:`${i1()}/${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(r1,{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:p6(C.createdAt),children:c6(C.createdAt)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:C.lastUsedAt?c6(C.lastUsedAt):"never"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:$.jsxDEV(T_,{label:`More for ${C.name}`,items:[{label:"Revoke…",danger:!0,onSelect:()=>void f(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(n1,{open:G,onClose:()=>{if(!H)Z(!1)},title:"Make a key",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>Z(!1),disabled:H,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"make-key",disabled:H||!F.trim(),children:H?"Making…":"Make key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"make-key",onSubmit:T,"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)=>K(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(n1,{open:Boolean(O),onClose:()=>R(null),title:`${O?.name??"The key"} is ready`,footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>R(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(r6,{label:"Key",value:O.key,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(n1,{open:Boolean(B),onClose:()=>P(null),title:"A read-only link",footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>P(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(r6,{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 j5=0;function i0({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(w1,{iso:J.at,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",J.text,J.acts?$.jsxDEV(u_,{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 e_(_,Q,J,q){let[U,G]=r.useState(0),Z=U*1e5+Math.floor(J/2),F=N1(Q,`/-/${_}/origin`,Z),X=N1(Q,`/-/${_}/diff`,Z),Y=N1(Q,`/-/${_}/changesets`,Z),[K,H]=r.useState([]),[L,z]=r.useState(null),W=(f,C,w)=>{if(H((S)=>[{ok:f,text:C,at:new Date().toISOString(),n:++j5,...w?.length?{acts:w}:{}},...S].slice(0,8)),!f)j1(C,"error")},O=async(f,C,w)=>{z(f);try{let S=await I1(Q,`/-/${_}/${C}`,w);if(!S.ok){q(S);let N=b1(await C0(S));return W(!1,`${f}: ${N.text}`,N.acts),null}return await S.json()}catch(S){return W(!1,`${f}: the World did not answer (${S instanceof Error?S.message:String(S)})`),null}finally{z(null),G((S)=>S+1)}},R=F.state==="ok"&&F.data.origin?_8(F.data.origin):null,B=X.state==="ok"?X.data.changes.length:null,P=Y.state==="ok"&&R?pZ(Y.data.changesets.filter((f)=>!f.pushedBy)).sort((f,C)=>f.createdAt.localeCompare(C.createdAt)):[];return{origin:F,diff:X,sets:Y,there:R,changes:B,waiting:P,log:K,busy:L,say:W,send:O,push:async()=>{let f=await O("Push","origin/push",{method:"POST"});if(!f)return;if(f.pushed.length===0){W(!0,"Nothing to push: every changeset is already at the remote.");return}for(let C of f.pushed){let w=C.receipts??[],S=w.filter((p)=>p.status==="replayed").length,N=w.filter((p)=>p.status==="confirmed").length,y=w.filter((p)=>p.status==="failed").length,D=C.outcome==="applied"&&y===0;if(C.outcome==="refused"){W(!1,`Push of ${C.changeset} was refused${C.refusal?.length?`: ${C.refusal.map((p)=>b1(p).text).join("; ")}`:""}.`);continue}let l=[`${S} of ${V1(w.length,"change")} replayed there`,...N?[`${N} performed at the vendor by the remote`]:[],...y?[`${y} failed`]:[]];W(D,`${C.outcome==="partial"?"Partly pushed":"Pushed"} ${C.changeset} to ${R??"the remote"}: ${l.join("; ")}${C.refusal?.length?` (${C.refusal.map((p)=>b1(p).text).join("; ")})`:""}.`)}},pull:async()=>{let f=await O("Pull","origin/pull",{method:"POST"});if(!f)return;let C=Object.entries(f.appended).filter(([,S])=>S>0),w=f.rebased.flatMap((S)=>S.conflicts.map((N)=>`${Y1(S.twin)} ${N.subject.type}:${N.subject.id} ${N.field}`));W(w.length===0,`Pulled from ${R??"the remote"}: ${C.length?C.map(([S,N])=>`${V1(N,"entry")} at ${Y1(S)}`).join(", "):"nothing new"}${w.length?`; conflicts at ${w.join(", ")}`:""}.`)}}}function XF({name:_,token:Q,canWrite:J,tick:q,refused:U}){let{origin:G,there:Z,changes:F,log:X,busy:Y,say:K,send:H,push:L,pull:z}=e_(_,Q,q,U),[W,O]=r.useState(""),[R,B]=r.useState(""),[P,A]=r.useState(!1),T=async(C)=>{C.preventDefault();let w=await H("Name the remote","origin",{method:"PUT",body:JSON.stringify({url:W.trim(),token:R.trim()})});if(w){let S=Object.values(w.appended??{}).reduce((N,y)=>N+y,0);K(!0,`The remote is ${_8(w.origin)}: its history came in (${V1(S,"entry")}).`),B(""),A(!1)}},f=!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(!P)},"aria-expanded":P,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(w1,{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(r1,{load:G,what:"the remote",lines:1},void 0,!1,void 0,this),P?$.jsxDEV("form",{className:"stack origin-form",onSubmit:(C)=>void T(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:R,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(i0,{log:X,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function YF({name:_,token:Q,canWrite:J,refused:q}){let[U,G]=r.useState(0),Z=N1(Q,`/-/${_}/twins`,U),F=N1(Q,`/-/${_}/links`,U),X=N1(Q,`/-/${_}/requests?hours=24`,U),[Y,K]=r.useState({}),[H,L]=r.useState(null),[z,W]=r.useState(""),[O,R]=r.useState(!1),[B,P]=r.useState([]),A=(N,y,D)=>{if(P((l)=>[{ok:N,text:y,at:new Date().toISOString(),n:++j5,...D?.length?{acts:D}:{}},...l].slice(0,6)),!N)j1(y,"error")},T=F.state==="ok"?Object.keys(F.data.links).sort():[];r.useEffect(()=>{let N=!0;return Promise.all(T.map(async(y)=>{let D=await I1(Q,`/-/${_}/twins/${y}/credential`).catch(()=>null),l=D?.ok?await D.json():null;return[y,l?.credential??null]})).then((y)=>{if(N)K(Object.fromEntries(y))}),()=>{N=!1}},[_,Q,T.join(","),U]);let f=async(N)=>{if(N.preventDefault(),!H||!z)return;R(!0);let y=await I1(Q,`/-/${_}/twins/${H.vendor}/credential`,{method:"PUT",body:z,headers:{"content-type":"text/plain"}}).catch(()=>null);if(R(!1),!y){A(!1,`Seal ${H.vendor}: ${O1} did not answer`);return}if(!y.ok){q(y);let l=b1(await C0(y));A(!1,`Seal ${Y1(H.vendor)}: ${l.text}`,l.acts);return}let D=await y.json().catch(()=>({}));A(!0,`Sealed a credential for ${Y1(H.vendor)}${D.fingerprint?` (${D.fingerprint})`:""}: it opens for ${D.boundTo??H.to} only, and is never shown again.`),W(""),L(null),G((l)=>l+1)},C=async(N)=>{if(!await T0({title:`Remove the link ${N}?`,body:`Requests to ${l0}/${_}/${N}/… stop being forwarded to ${F.state==="ok"?F.data.links[N]?.origin:"its origin"}.`,action:"Remove link",danger:!0}))return;let y=await I1(Q,`/-/${_}/links/${N}`,{method:"DELETE"}).catch(()=>null);if(!y?.ok){if(y)q(y);A(!1,`Remove ${N}: ${y?await q0(y):"the World did not answer"}`);return}A(!0,`Removed the link ${N}.`),G((D)=>D+1)},w=(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(w1,{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),S=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(i0,{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(r1,{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:S.map((N)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(u1,{vendor:N.twin},void 0,!1,void 0,this),Y1(N.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w(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 ${Y1(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"&&S.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(r1,{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"&&T.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:[l0,"/",_,"/<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,T.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:T.map((N)=>{let y=F.state==="ok"?F.data.links[N].origin:"",D=X.state==="ok"?X.data.twins.find((l)=>l.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:y},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:D?$.jsxDEV("span",{title:Object.entries(D.byStatus).map(([l,p])=>`${l}: ${p}`).join(" · "),children:D.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:[w(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:y})},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(n1,{open:Boolean(H),onClose:()=>{if(!O)L(null)},title:`Seal ${H?Y1(H.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 f(N),children:[$.jsxDEV("p",{className:"mode",children:["It is sealed for ",$.jsxDEV("code",{children:H?.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 LF({name:_,token:Q,admin:J,canWrite:q,refused:U,onRemoved:G,only:Z}){let F=(V)=>!Z||Z===V,[X,Y]=r.useState(0),K=N1(Q,`/-/${_}/twins`,X),H=N1(Q,`/-/${_}/checks`,X),[L,z]=r.useState(0),W=N1(Q,`/-/${_}/clock`,L),[O,R]=r.useState([]),[B,P]=r.useState(null),[A,T]=r.useState(null),[f,C]=r.useState(""),[w,S]=r.useState("gated"),[N,y]=r.useState(!1),D=(V,h,I)=>{if(R((v)=>[{ok:V,text:h,at:new Date().toISOString(),n:++j5,...I?.length?{acts:I}:{}},...v].slice(0,6)),!V)j1(h,"error")},l=async(V,h,I)=>{let v=await I1(Q,h,I).catch(()=>null);if(!v)return D(!1,`${V}: the World did not answer`),!1;if(!v.ok){U(v);let m=b1(await C0(v));return D(!1,`${V}: ${m.text}`,m.acts),!1}return D(!0,`${V}: done.`),Y((m)=>m+1),!0},p=async(V)=>{if(V.preventDefault(),!A)return;y(!0);let h=A.root??{},I=await l(f.trim()?`Connect ${Y1(A.twin)} to ${f.trim()}`:`Disconnect ${Y1(A.twin)}`,`/-/${_}/twins/${A.twin}/root`,{method:"PUT",body:JSON.stringify(f.trim()?{...h,url:f.trim(),deploy:w}:null)});if(y(!1),I)T(null)},k=async()=>{if(!await T0({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)P(await V.json()),D(!0,"Rotated: the new tokens are shown once, below.");else D(!1,`Rotate: ${await q0(V)}`)},b=async()=>{if(!await T0({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((h)=>h);if(V instanceof Error){D(!1,`Remove: the host did not answer (${V.message})`);return}if(V.ok)G();else D(!1,`Remove: ${await q0(V)}`)},j=K.state==="ok"?K.data.twins:[],E={gated:"gated: a person deploys an approved changeset",auto:"auto: a push deploys at once",hold:"hold: nothing deploys"};return $.jsxDEV($.Fragment,{children:[$.jsxDEV(i0,{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(KF,{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(r1,{load:K,what:"the vendors"},void 0,!1,void 0,this),K.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 h=V.root;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(u1,{vendor:V.twin},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${L1}/${_}/${V.twin}`,title:`Its log and stored state · ${V.position??0} entries`,onClick:(I)=>{I.preventDefault(),f1([..._.split("/"),V.twin])},children:Y1(V.twin)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:h?.url?$.jsxDEV("code",{children:h.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:h?.url?E[h.deploy??""]??h.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):h?.url?p6(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(h?.url??""),S(h?.deploy==="auto"||h?.deploy==="hold"?h.deploy:"gated"),T(V)},children:h?.url?"Change…":"Connect…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",disabled:!h?.url,title:h?.url?"Read the real service's current state into this World":"Connect it first",onClick:()=>void T0({title:`Read ${Y1(V.twin)} now?`,body:`The real ${Y1(V.twin)}'s current state is read into this World. Nothing is written to ${Y1(V.twin)}.`,action:"Read from it"}).then((I)=>{if(I)l(`Read from ${Y1(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(lZ,{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(r1,{load:H,what:"the checks"},void 0,!1,void 0,this),H.state==="ok"?H.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:H.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 k(),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(n1,{open:Boolean(A),onClose:()=>{if(!N)T(null)},title:`Connect ${A?Y1(A.twin):""} to its real service`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>T(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…":f.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 p(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:f,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:w,onChange:(V)=>S(V.target.value==="auto"?"auto":V.target.value==="hold"?"hold":"gated"),children:["gated","auto","hold"].map((V)=>$.jsxDEV("option",{value:V,children:E[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 oB(){return $.jsxDEV($.Fragment,{children:[$.jsxDEV(CZ,{},void 0,!1,void 0,this),$.jsxDEV(M_,{},void 0,!1,void 0,this),$.jsxDEV(B_,{},void 0,!1,void 0,this),$.jsxDEV(A_,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{tB as openAt,v5 as ROOT,oB as ConsolePage};
33
+ `)),K=Y.reduce((H,L)=>H.concat(...L),[]);return[Y,K]}return[[],[]]},[_]);return a.useEffect(()=>{let X=Q?.target??H9,Y=Q?.actInsideInputWithModifier??!0;if(_!==null){let K=(W)=>{if(U.current=W.ctrlKey||W.metaKey||W.shiftKey||W.altKey,(!U.current||U.current&&!Y)&&S6(W))return!1;let O=X9(W.code,F);if(G.current.add(W[O]),K9(Z,G.current,!1)){let T=W.composedPath?.()?.[0]||W.target,M=T?.nodeName==="BUTTON"||T?.nodeName==="A";if(Q.preventDefault!==!1&&(U.current||!M))W.preventDefault();q(!0)}},H=(W)=>{let B=X9(W.code,F);if(K9(Z,G.current,!0))q(!1),G.current.clear();else G.current.delete(W[B]);if(W.key==="Meta")G.current.clear();U.current=!1},L=()=>{G.current.clear(),q(!1)};return X?.addEventListener("keydown",K),X?.addEventListener("keyup",H),window.addEventListener("blur",L),window.addEventListener("contextmenu",L),()=>{X?.removeEventListener("keydown",K),X?.removeEventListener("keyup",H),window.removeEventListener("blur",L),window.removeEventListener("contextmenu",L)}}},[_,q]),J}function K9(_,Q,J){return _.filter((q)=>J||q.length===Q.size).some((q)=>q.every((U)=>Q.has(U)))}function X9(_,Q){return Q.includes(_)?"code":"key"}var MU=()=>{let _=v1();return a.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=k5(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},K=J.snapGrid??U,H=J.snapToGrid??G;return r2(Y,q,H,K)},flowToScreenPosition:(Q)=>{let{transform:J,domNode:q}=_.getState();if(!q)return Q;let{x:U,y:G}=q.getBoundingClientRect(),Z=M2(Q,J);return{x:Z.x+U,y:Z.y+G}}}},[])};function h9(_,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)TU(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 TU(_,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 D9(_,Q){return h9(_,Q)}function RU(_,Q){return h9(_,Q)}function O2(_,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(O2(G.id,Z))}}return q}function Y9({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 L9(_){return{id:_.id,type:"remove"}}var OU=I6("React Flow","https://reactflow.dev/");function IU(_,Q,J={}){return w7(_,Q,{...J,onError:J.onError??OU})}var z9=(_)=>L7(_),fU=(_)=>B6(_);function E9(_){return a.forwardRef(_)}var x9=typeof window<"u"?a.useLayoutEffect:a.useEffect;function W9(_){let[Q,J]=a.useState(BigInt(0)),[q]=a.useState(()=>wU(()=>J((U)=>U+BigInt(1))));return x9(()=>{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 m9=a.createContext(null);function PU({children:_}){let Q=v1(),J=a.useCallback((F)=>{let{nodes:X=[],setNodes:Y,hasDefaultNodes:K,onNodesChange:H,nodeLookup:L,fitViewQueued:W,onNodesChangeMiddlewareMap:B}=Q.getState(),O=X;for(let M of F)O=typeof M==="function"?M(O):M;let T=Y9({items:O,lookup:L});for(let M of B.values())T=M(T);if(K)Y(O);if(T.length>0)H?.(T);else if(W)window.requestAnimationFrame(()=>{let{fitViewQueued:M,nodes:P,setNodes:A}=Q.getState();if(M)A(P)})},[]),q=W9(J),U=a.useCallback((F)=>{let{edges:X=[],setEdges:Y,hasDefaultEdges:K,onEdgesChange:H,edgeLookup:L}=Q.getState(),W=X;for(let B of F)W=typeof B==="function"?B(W):B;if(K)Y(W);else if(H)H(Y9({items:W,lookup:L}))},[]),G=W9(U),Z=a.useMemo(()=>({nodeQueue:q,edgeQueue:G}),[]);return d.jsx(m9.Provider,{value:Z,children:_})}function NU(){let _=a.useContext(m9);if(!_)throw Error("useBatchContext must be used within a BatchProvider");return _}var CU=(_)=>!!_.panZoom;function V5(){let _=MU(),Q=v1(),J=NU(),q=O1(CU),U=a.useMemo(()=>{let G=(H)=>Q.getState().nodeLookup.get(H),Z=(H)=>{J.nodeQueue.push(H)},F=(H)=>{J.edgeQueue.push(H)},X=(H)=>{let{nodeLookup:L,nodeOrigin:W}=Q.getState(),B=z9(H)?H:L.get(H.id),O=B.parentId?w6(B.position,B.measured,B.parentId,L,W):B.position,T={...B,position:O,width:B.measured?.width??B.width,height:B.measured?.height??B.height};return c2(T)},Y=(H,L,W={replace:!1})=>{Z((B)=>B.map((O)=>{if(O.id===H){let T=typeof L==="function"?L(O):L;return W.replace&&z9(T)?T:{...O,...T}}return O}))},K=(H,L,W={replace:!1})=>{F((B)=>B.map((O)=>{if(O.id===H){let T=typeof L==="function"?L(O):L;return W.replace&&fU(T)?T:{...O,...T}}return O}))};return{getNodes:()=>Q.getState().nodes.map((H)=>({...H})),getNode:(H)=>G(H)?.internals.userNode,getInternalNode:G,getEdges:()=>{let{edges:H=[]}=Q.getState();return H.map((L)=>({...L}))},getEdge:(H)=>Q.getState().edgeLookup.get(H),setNodes:Z,setEdges:F,addNodes:(H)=>{let L=Array.isArray(H)?H:[H];J.nodeQueue.push((W)=>[...W,...L])},addEdges:(H)=>{let L=Array.isArray(H)?H:[H];J.edgeQueue.push((W)=>[...W,...L])},toObject:()=>{let{nodes:H=[],edges:L=[],transform:W}=Q.getState(),[B,O,T]=W;return{nodes:H.map((M)=>({...M})),edges:L.map((M)=>({...M})),viewport:{x:B,y:O,zoom:T}}},deleteElements:async({nodes:H=[],edges:L=[]})=>{let{nodes:W,edges:B,onNodesDelete:O,onEdgesDelete:T,triggerNodeChanges:M,triggerEdgeChanges:P,onDelete:A,onBeforeDelete:R}=Q.getState(),{nodes:f,edges:C}=await B7({nodesToRemove:H,edgesToRemove:L,nodes:W,edges:B,onBeforeDelete:R}),N=C.length>0,S=f.length>0;if(N){let w=C.map(L9);T?.(C),P(w)}if(S){let w=f.map(L9);O?.(f),M(w)}if(S||N)A?.({nodes:f,edges:C});return{deletedNodes:f,deletedEdges:C}},getIntersectingNodes:(H,L=!0,W)=>{let B=O6(H),O=B?H:X(H),T=W!==void 0;if(!O)return[];return(W||Q.getState().nodes).filter((M)=>{let P=Q.getState().nodeLookup.get(M.id);if(P&&!B&&(M.id===H.id||!P.internals.positionAbsolute))return!1;let A=c2(T?M:P),R=v5(A,O);return L&&R>0||R>=A.width*A.height||R>=O.width*O.height})},isNodeIntersecting:(H,L,W=!0)=>{let O=O6(H)?H:X(H);if(!O)return!1;let T=v5(O,L);return W&&T>0||T>=L.width*L.height||T>=O.width*O.height},updateNode:Y,updateNodeData:(H,L,W={replace:!1})=>{Y(H,(B)=>{let O=typeof L==="function"?L(B):L;return W.replace?{...B,data:O}:{...B,data:{...B.data,...O}}},W)},updateEdge:K,updateEdgeData:(H,L,W={replace:!1})=>{K(H,(B)=>{let O=typeof L==="function"?L(B):L;return W.replace?{...B,data:O}:{...B,data:{...B.data,...O}}},W)},getNodesBounds:(H)=>{let{nodeLookup:L,nodeOrigin:W}=Q.getState();return M6(H,{nodeLookup:L,nodeOrigin:W})},getHandleConnections:({type:H,id:L,nodeId:W})=>Array.from(Q.getState().connectionLookup.get(`${W}-${H}${L?`-${L}`:""}`)?.values()??[]),getNodeConnections:({type:H,handleId:L,nodeId:W})=>Array.from(Q.getState().connectionLookup.get(`${W}${H?L?`-${H}-${L}`:`-${H}`:""}`)?.values()??[]),fitView:async(H)=>{let L=Q.getState().fitViewResolver??T7();return Q.setState({fitViewQueued:!0,fitViewOptions:H,fitViewResolver:L}),J.nodeQueue.push((W)=>[...W]),L.promise}}},[]);return a.useMemo(()=>{return{...U,..._,viewportInitialized:q}},[q])}var B9=(_)=>_.selected,SU=typeof window<"u"?window:void 0;function vU({deleteKeyCode:_,multiSelectionKeyCode:Q}){let J=v1(),{deleteElements:q}=V5(),U=j5(_,{actInsideInputWithModifier:!1}),G=j5(Q,{target:SU});a.useEffect(()=>{if(U){let{edges:Z,nodes:F}=J.getState();q({nodes:F.filter(B9),edges:Z.filter(B9)}),J.setState({nodesSelectionActive:!1})}},[U]),a.useEffect(()=>{J.setState({multiSelectionActive:G})},[G])}function kU(_){let Q=v1();a.useEffect(()=>{let J=()=>{if(!_.current||!(_.current.checkVisibility?.()??!0))return!1;let q=B4(_.current);if(q.height===0||q.width===0)Q.getState().onError?.("004",_0.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 k4={position:"absolute",width:"100%",height:"100%",top:0,left:0},yU=(_)=>({userSelectionActive:_.userSelectionActive,lib:_.lib,connectionInProgress:_.connection.inProgress});function jU({onPaneContextMenu:_,zoomOnScroll:Q=!0,zoomOnPinch:J=!0,panOnScroll:q=!1,panActivationKeyPressed:U,panOnScrollSpeed:G=0.5,panOnScrollMode:Z=D0.Free,zoomOnDoubleClick:F=!0,panOnDrag:X=!0,defaultViewport:Y,translateExtent:K,minZoom:H,maxZoom:L,zoomActivationKeyCode:W,preventScrolling:B=!0,children:O,noWheelClassName:T,noPanClassName:M,onViewportChange:P,isControlledViewport:A,paneClickDistance:R,selectionOnDrag:f}){let C=v1(),N=a.useRef(null),{userSelectionActive:S,lib:w,connectionInProgress:j}=O1(yU,S1),x=j5(W),r=a.useRef();kU(N);let m=a.useCallback((v)=>{if(P?.({x:v[0],y:v[1],zoom:v[2]}),!A)C.setState({transform:v})},[P,A]);return a.useEffect(()=>{if(N.current){r.current=p7({domNode:N.current,minZoom:H,maxZoom:L,translateExtent:K,viewport:Y,onDraggingChange:(E)=>C.setState((u)=>u.paneDragging===E?u:{paneDragging:E}),onPanZoomStart:(E,u)=>{let{onViewportChangeStart:D,onMoveStart:I}=C.getState();I?.(E,u),D?.(u)},onPanZoom:(E,u)=>{let{onViewportChange:D,onMove:I}=C.getState();I?.(E,u),D?.(u)},onPanZoomEnd:(E,u)=>{let{onViewportChangeEnd:D,onMoveEnd:I}=C.getState();I?.(E,u),D?.(u)}});let{x:v,y:h,zoom:V}=r.current.getViewport();return C.setState({panZoom:r.current,transform:[v,h,V],domNode:N.current.closest(".react-flow")}),()=>{r.current?.destroy()}}},[]),a.useEffect(()=>{r.current?.update({onPaneContextMenu:_,zoomOnScroll:Q,zoomOnPinch:J,panOnScroll:q,panActivationKeyPressed:U,panOnScrollSpeed:G,panOnScrollMode:Z,zoomOnDoubleClick:F,panOnDrag:X,zoomActivationKeyPressed:x,preventScrolling:B,noPanClassName:M,userSelectionActive:S,noWheelClassName:T,lib:w,onTransformChange:m,connectionInProgress:j,selectionOnDrag:f,paneClickDistance:R})},[_,Q,J,q,U,G,Z,F,X,x,B,M,S,T,w,m,j,f,R]),d.jsx("div",{className:"react-flow__renderer",ref:N,style:k4,children:O})}var VU=(_)=>({userSelectionActive:_.userSelectionActive,userSelectionRect:_.userSelectionRect});function uU(){let{userSelectionActive:_,userSelectionRect:Q}=O1(VU,S1);if(!(_&&Q))return null;return d.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 E6=(_,Q)=>{return(J)=>{if(J.target!==Q.current)return;_?.(J)}},bU=(_)=>({userSelectionActive:_.userSelectionActive,elementsSelectable:_.elementsSelectable,dragging:_.paneDragging,panBy:_.panBy,autoPanSpeed:_.autoPanSpeed});function hU({isSelecting:_,selectionKeyPressed:Q,selectionMode:J=B2.Full,panOnDrag:q,autoPanOnSelection:U,paneClickDistance:G,selectionOnDrag:Z,onSelectionStart:F,onSelectionEnd:X,onPaneClick:Y,onPaneContextMenu:K,onPaneScroll:H,onPaneMouseEnter:L,onPaneMouseMove:W,onPaneMouseLeave:B,children:O}){let T=a.useRef(0),M=v1(),{userSelectionActive:P,elementsSelectable:A,dragging:R,panBy:f,autoPanSpeed:C}=O1(bU,S1),N=A&&(_||P),S=a.useRef(null),w=a.useRef(),j=a.useRef(new Set),x=a.useRef(new Set),r=a.useRef(!1),m=a.useRef(!1),v=a.useRef({x:0,y:0}),h=a.useRef(!1),V=(g)=>{if(m.current||r.current||M.getState().connection.inProgress){m.current=!1,r.current=!1;return}Y?.(g),M.getState().resetSelectedElements(),M.setState({nodesSelectionActive:!1})},E=(g)=>{if(Array.isArray(q)&&q?.includes(2)){g.preventDefault();return}K?.(g)},u=H?(g)=>H(g):void 0,D=(g)=>{if(m.current)g.stopPropagation(),m.current=!1},I=(g)=>{if(g.pointerType==="touch"&&q!==!1&&!Q)return;let{domNode:J1,transform:U1}=M.getState();if(w.current=J1?.getBoundingClientRect(),!w.current)return;let X1=g.target===S.current;if(!X1&&!!g.target.closest(".nokey")||!_||!(Z&&X1||Q)||g.button!==0||!g.isPrimary)return;g.target?.setPointerCapture?.(g.pointerId),m.current=!1;let{x:B1,y:Y1}=X0(g.nativeEvent,w.current),Q1=r2({x:B1,y:Y1},U1);if(M.setState({userSelectionRect:{width:0,height:0,startX:Q1.x,startY:Q1.y,x:B1,y:Y1}}),!X1)g.stopPropagation(),g.preventDefault()};function k(g,J1){let{userSelectionRect:U1}=M.getState();if(!U1)return;let{transform:X1,nodeLookup:G1,edgeLookup:F1,connectionLookup:B1,triggerNodeChanges:Y1,triggerEdgeChanges:Q1,defaultEdgeOptions:T1}=M.getState(),K1={x:U1.startX,y:U1.startY},{x:y1,y:p1}=M2(K1,X1),l1={startX:K1.x,startY:K1.y,x:g<y1?g:y1,y:J1<p1?J1:p1,width:Math.abs(g-y1),height:Math.abs(J1-p1)},z0=j.current,Z0=x.current;j.current=new Set(Y4(G1,l1,X1,J===B2.Partial,!0).map((o1)=>o1.id)),x.current=new Set;let F0=T1?.selectable??!0;for(let o1 of j.current){let Q0=B1.get(o1);if(!Q0)continue;for(let{edgeId:n1}of Q0.values()){let J0=F1.get(n1);if(J0&&(J0.selectable??F0))x.current.add(n1)}}if(!P6(z0,j.current)){let o1=d2(G1,j.current,!0);Y1(o1)}if(!P6(Z0,x.current)){let o1=d2(F1,x.current);Q1(o1)}M.setState({userSelectionRect:l1,userSelectionActive:!0,nodesSelectionActive:!1})}function p(){if(!U||!w.current)return;let[g,J1]=L4(v.current,w.current,C);f({x:g,y:J1}).then((U1)=>{if(!m.current||!U1){T.current=requestAnimationFrame(p);return}let{x:X1,y:G1}=v.current;k(X1,G1),T.current=requestAnimationFrame(p)})}let b=()=>{cancelAnimationFrame(T.current),T.current=0,h.current=!1};a.useEffect(()=>{return()=>b()},[]);let e=(g)=>{let{userSelectionRect:J1,transform:U1,resetSelectedElements:X1}=M.getState();if(!w.current||!J1)return;let{x:G1,y:F1}=X0(g.nativeEvent,w.current);v.current={x:G1,y:F1};let B1=M2({x:J1.startX,y:J1.startY},U1);if(!m.current){let Y1=Q?0:G;if(Math.hypot(G1-B1.x,F1-B1.y)<=Y1)return;X1(),F?.(g)}if(m.current=!0,!h.current)p(),h.current=!0;k(G1,F1)},t=(g)=>{if(!N){if(g.target===S.current&&M.getState().connection.inProgress)r.current=!0;return}if(g.button!==0)return;if(g.target?.releasePointerCapture?.(g.pointerId),!P&&g.target===S.current&&M.getState().userSelectionRect)V?.(g);if(M.setState({userSelectionActive:!1,userSelectionRect:null}),m.current)X?.(g),M.setState({nodesSelectionActive:j.current.size>0});b()},o=(g)=>{g.target?.releasePointerCapture?.(g.pointerId),b()},s=q===!0||Array.isArray(q)&&q.includes(0);return d.jsxs("div",{className:j1(["react-flow__pane",{draggable:s,dragging:R,selection:_}]),onClick:N?void 0:E6(V,S),onContextMenu:E6(E,S),onWheel:E6(u,S),onPointerEnter:N?void 0:L,onPointerMove:N?e:W,onPointerUp:t,onPointerCancel:N?o:void 0,onPointerDownCapture:N?I:void 0,onClickCapture:N?D:void 0,onPointerLeave:B,ref:S,style:k4,children:[O,d.jsx(uU,{})]})}function m6({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",_0.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 g9({nodeRef:_,disabled:Q=!1,noDragClassName:J,handleSelector:q,nodeId:U,isSelectable:G,nodeClickDistance:Z}){let F=v1(),[X,Y]=a.useState(!1),K=a.useRef();return a.useEffect(()=>{if(Q)return;return K.current=u7({getStoreItems:()=>F.getState(),onNodeMouseDown:(H)=>{m6({id:H,store:F,nodeRef:_})},onDragStart:()=>{Y(!0)},onDragStop:()=>{Y(!1)}}),()=>{K.current?.destroy(),K.current=void 0}},[Q,F,_]),a.useEffect(()=>{if(Q||!_.current||!K.current)return;K.current.update({noDragClassName:J,handleSelector:q,domNode:_.current,isSelectable:G,nodeId:U,nodeClickDistance:Z})},[J,q,Q,G,_,U,Z]),X}var DU=(_)=>(Q)=>Q.selected&&(Q.draggable||_&&typeof Q.draggable>"u");function p9(){let _=v1();return a.useCallback((J)=>{let{nodeExtent:q,snapToGrid:U,snapGrid:G,nodesDraggable:Z,onError:F,updateNodePositions:X,nodeLookup:Y,nodeOrigin:K}=_.getState(),H=new Map,L=DU(Z),W=U?G[0]:5,B=U?G[1]:5,O=J.direction.x*W*J.factor,T=J.direction.y*B*J.factor;for(let[,M]of Y){if(!L(M))continue;let P={x:M.internals.positionAbsolute.x+O,y:M.internals.positionAbsolute.y+T};if(U)P=l2(P,G);let{position:A,positionAbsolute:R}=T6({nodeId:M.id,nextPosition:P,nodeLookup:Y,nodeExtent:q,nodeOrigin:K,onError:F});M.position=A,M.internals.positionAbsolute=R,H.set(M.id,M)}X(H)},[])}var g6=a.createContext(null),EU=g6.Provider;g6.Consumer;var p6=()=>{return a.useContext(g6)},xU=(_)=>({connectOnClick:_.connectOnClick,noPanClassName:_.noPanClassName,rfId:_.rfId}),c9=a.createContext(null);function mU({children:_}){let Q=O1(xU,S1);return d.jsx(c9.Provider,{value:Q,children:_})}function gU(){let _=a.useContext(c9);if(!_)throw Error("useHandleConfig must be used within a HandleConfigProvider");return _}var pU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},cU=(_,Q,J)=>(q)=>{let{connectionClickStartHandle:U,connectionMode:G,connection:Z}=q,{fromHandle:F,toHandle:X,isValid:Y}=Z;if(!F&&!U)return pU;let K=X?.nodeId===_&&X?.id===Q&&X?.type===J;return{connectingFrom:F?.nodeId===_&&F?.id===Q&&F?.type===J,connectingTo:K,clickConnecting:U?.nodeId===_&&U?.id===Q&&U?.type===J,isPossibleEndHandle:G===n0.Strict?F?.type!==J:_!==F?.nodeId||Q!==F?.id,connectionInProcess:!!F,clickConnectionInProcess:!!U,valid:K&&Y}};function lU({type:_="source",position:Q=Z1.Top,isValidConnection:J,isConnectable:q=!0,isConnectableStart:U=!0,isConnectableEnd:G=!0,id:Z,onConnect:F,children:X,className:Y,onMouseDown:K,onTouchStart:H,...L},W){let B=Z||null,O=_==="target",T=v1(),M=p6(),{connectOnClick:P,noPanClassName:A,rfId:R}=gU(),{connectingFrom:f,connectingTo:C,clickConnecting:N,isPossibleEndHandle:S,connectionInProcess:w,clickConnectionInProcess:j,valid:x}=O1(cU(M,B,_),S1);if(!M)T.getState().onError?.("010",_0.error010());let r=(h)=>{let{defaultEdgeOptions:V,onConnect:E,hasDefaultEdges:u}=T.getState(),D={...V,...h};if(u){let{edges:I,setEdges:k,onError:p}=T.getState();k(IU(D,I,{onError:p}))}E?.(D),F?.(D)},m=(h)=>{if(!M)return;let V=v6(h.nativeEvent);if(U&&(V&&h.button===0||!V)){let E=T.getState();f4.onPointerDown(h.nativeEvent,{handleDomNode:h.currentTarget,autoPanOnConnect:E.autoPanOnConnect,connectionMode:E.connectionMode,connectionRadius:E.connectionRadius,domNode:E.domNode,nodeLookup:E.nodeLookup,lib:E.lib,isTarget:O,handleId:B,nodeId:M,flowId:E.rfId,panBy:E.panBy,cancelConnection:E.cancelConnection,onConnectStart:E.onConnectStart,onConnectEnd:(...u)=>T.getState().onConnectEnd?.(...u),updateConnection:E.updateConnection,onConnect:r,isValidConnection:J||((...u)=>T.getState().isValidConnection?.(...u)??!0),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:E.autoPanSpeed,dragThreshold:E.connectionDragThreshold})}if(V)K?.(h);else H?.(h)},v=(h)=>{let{onClickConnectStart:V,onClickConnectEnd:E,connectionClickStartHandle:u,connectionMode:D,isValidConnection:I,lib:k,rfId:p,nodeLookup:b,connection:e}=T.getState();if(!M||!u&&!U)return;if(!u){V?.(h.nativeEvent,{nodeId:M,handleId:B,handleType:_}),T.setState({connectionClickStartHandle:{nodeId:M,type:_,id:B}});return}let t=C6(h.target),o=J||I,{connection:s,isValid:g}=f4.isValid(h.nativeEvent,{handle:{nodeId:M,id:B,type:_},connectionMode:D,fromNodeId:u.nodeId,fromHandleId:u.id||null,fromType:u.type,isValidConnection:o,flowId:p,doc:t,lib:k,nodeLookup:b});if(g&&s)r(s);let J1=structuredClone(e);delete J1.inProgress,J1.toPosition=J1.toHandle?J1.toHandle.position:null,E?.(h,J1),T.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":B,"data-nodeid":M,"data-handlepos":Q,"data-id":`${R}-${M}-${B}-${_}`,className:j1(["react-flow__handle",`react-flow__handle-${Q}`,"nodrag",A,Y,{source:!O,target:O,connectable:q,connectablestart:U,connectableend:G,clickconnecting:N,connectingfrom:f,connectingto:C,valid:x,connectionindicator:q&&(!w||S)&&(w||j?G:U)}]),onMouseDown:m,onTouchStart:m,onClick:P?v:void 0,ref:W,...L,children:X})}var C4=a.memo(E9(lU));function rU({data:_,isConnectable:Q,sourcePosition:J=Z1.Bottom}){return d.jsxs(d.Fragment,{children:[_?.label,d.jsx(C4,{type:"source",position:J,isConnectable:Q})]})}function iU({data:_,isConnectable:Q,targetPosition:J=Z1.Top,sourcePosition:q=Z1.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(C4,{type:"target",position:J,isConnectable:Q}),_?.label,d.jsx(C4,{type:"source",position:q,isConnectable:Q})]})}function dU(){return null}function aU({data:_,isConnectable:Q,targetPosition:J=Z1.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(C4,{type:"target",position:J,isConnectable:Q}),_?.label]})}var S4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},A9={input:rU,default:iU,output:aU,group:dU};function sU(_){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 tU=(_)=>{let{width:Q,height:J,x:q,y:U}=R2(_.nodeLookup,{filter:(G)=>!!G.selected});return{width:K0(Q)?Q:null,height:K0(J)?J:null,userSelectionActive:_.userSelectionActive,transformString:`translate(${_.transform[0]}px,${_.transform[1]}px) scale(${_.transform[2]}) translate(${q}px,${U}px)`}};function oU({onSelectionContextMenu:_,noPanClassName:Q,disableKeyboardA11y:J}){let q=v1(),{width:U,height:G,transformString:Z,userSelectionActive:F}=O1(tU,S1),X=p9(),Y=a.useRef(null);a.useEffect(()=>{if(!J)Y.current?.focus({preventScroll:!0})},[J]);let K=!F&&U!==null&&G!==null;if(g9({nodeRef:Y,disabled:!K}),!K)return null;let H=_?(W)=>{let B=q.getState().nodes.filter((O)=>O.selected);_(W,B)}:void 0,L=(W)=>{if(Object.prototype.hasOwnProperty.call(S4,W.key))W.preventDefault(),X({direction:S4[W.key],factor:W.shiftKey?4:1})};return d.jsx("div",{className:j1(["react-flow__nodesselection","react-flow__container",Q]),style:{transform:Z},children:d.jsx("div",{ref:Y,className:"react-flow__nodesselection-rect",onContextMenu:H,tabIndex:J?void 0:-1,onKeyDown:J?void 0:L,style:{width:U,height:G}})})}var M9=typeof window<"u"?window:void 0,nU=(_)=>{return{nodesSelectionActive:_.nodesSelectionActive,userSelectionActive:_.userSelectionActive}};function l9({children:_,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,paneClickDistance:F,deleteKeyCode:X,selectionKeyCode:Y,selectionOnDrag:K,selectionMode:H,onSelectionStart:L,onSelectionEnd:W,multiSelectionKeyCode:B,panActivationKeyCode:O,zoomActivationKeyCode:T,elementsSelectable:M,zoomOnScroll:P,zoomOnPinch:A,panOnScroll:R,panOnScrollSpeed:f,panOnScrollMode:C,zoomOnDoubleClick:N,panOnDrag:S,autoPanOnSelection:w,defaultViewport:j,translateExtent:x,minZoom:r,maxZoom:m,preventScrolling:v,onSelectionContextMenu:h,noWheelClassName:V,noPanClassName:E,disableKeyboardA11y:u,onViewportChange:D,isControlledViewport:I}){let{nodesSelectionActive:k,userSelectionActive:p}=O1(nU,S1),b=j5(Y,{target:M9}),e=j5(O,{target:M9}),t=e||S,o=e||R,s=K&&t!==!0,g=b||p||s;return vU({deleteKeyCode:X,multiSelectionKeyCode:B}),d.jsx(jU,{onPaneContextMenu:G,elementsSelectable:M,zoomOnScroll:P,zoomOnPinch:A,panOnScroll:o,panActivationKeyPressed:e,panOnScrollSpeed:f,panOnScrollMode:C,zoomOnDoubleClick:N,panOnDrag:!b&&t,defaultViewport:j,translateExtent:x,minZoom:r,maxZoom:m,zoomActivationKeyCode:T,preventScrolling:v,noWheelClassName:V,noPanClassName:E,onViewportChange:D,isControlledViewport:I,paneClickDistance:F,selectionOnDrag:s,children:d.jsxs(hU,{onSelectionStart:L,onSelectionEnd:W,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:q,onPaneMouseLeave:U,onPaneContextMenu:G,onPaneScroll:Z,panOnDrag:t,autoPanOnSelection:w,isSelecting:!!g,selectionMode:H,selectionKeyPressed:b,paneClickDistance:F,selectionOnDrag:s,children:[_,k&&d.jsx(oU,{onSelectionContextMenu:h,noPanClassName:E,disableKeyboardA11y:u})]})})}l9.displayName="FlowRenderer";var eU=a.memo(l9),_G=(_)=>(Q)=>{return _?Y4(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 QG(_){return O1(a.useCallback(_G(_),[_]),S1)}var JG=(_)=>_.updateNodeInternals;function $G(){let _=O1(JG),[Q]=a.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 a.useEffect(()=>{return()=>{Q?.disconnect()}},[Q]),Q}function qG({node:_,nodeType:Q,hasDimensions:J,resizeObserver:q}){let U=v1(),G=a.useRef(null),Z=a.useRef(null),F=a.useRef(_.sourcePosition),X=a.useRef(_.targetPosition),Y=a.useRef(Q),K=J&&!!_.internals.handleBounds;return a.useEffect(()=>{if(G.current&&!_.hidden&&(!K||Z.current!==G.current)){if(Z.current)q?.unobserve(Z.current);q?.observe(G.current),Z.current=G.current}},[K,_.hidden]),a.useEffect(()=>{return()=>{if(Z.current)q?.unobserve(Z.current),Z.current=null}},[]),a.useEffect(()=>{if(G.current){let H=Y.current!==Q,L=F.current!==_.sourcePosition,W=X.current!==_.targetPosition;if(H||L||W)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 UG({id:_,onClick:Q,onMouseEnter:J,onMouseMove:q,onMouseLeave:U,onContextMenu:G,onDoubleClick:Z,nodesDraggable:F,elementsSelectable:X,nodesConnectable:Y,nodesFocusable:K,resizeObserver:H,noDragClassName:L,noPanClassName:W,disableKeyboardA11y:B,rfId:O,nodeTypes:T,nodeClickDistance:M,onError:P}){let{node:A,internals:R,isParent:f}=O1((g)=>{let J1=g.nodeLookup.get(_),U1=g.parentLookup.has(_);return{node:J1,internals:J1.internals,isParent:U1}},S1),C=A.type||"default",N=T?.[C]||A9[C];if(N===void 0)P?.("003",_0.error003(C)),C="default",N=T?.default||A9.default;let S=!!(A.draggable||F&&typeof A.draggable>"u"),w=!!(A.selectable||X&&typeof A.selectable>"u"),j=!!(A.connectable||Y&&typeof A.connectable>"u"),x=!!(A.focusable||K&&typeof A.focusable>"u"),r=v1(),m=f6(A),v=qG({node:A,nodeType:C,hasDimensions:m,resizeObserver:H}),h=g9({nodeRef:v,disabled:A.hidden||!S,noDragClassName:L,handleSelector:A.dragHandle,nodeId:_,isSelectable:w,nodeClickDistance:M}),V=p9();if(A.hidden)return null;let E=Y0(A),u=sU(A),D=w||S||Q||J||q||U,I=J?(g)=>J(g,{...R.userNode}):void 0,k=q?(g)=>q(g,{...R.userNode}):void 0,p=U?(g)=>U(g,{...R.userNode}):void 0,b=G?(g)=>G(g,{...R.userNode}):void 0,e=Z?(g)=>Z(g,{...R.userNode}):void 0,t=(g)=>{let{selectNodesOnDrag:J1,nodeDragThreshold:U1}=r.getState();if(w&&(!J1||!S||U1>0))m6({id:_,store:r,nodeRef:v});if(Q)Q(g,{...R.userNode})},o=(g)=>{if(S6(g.nativeEvent)||B)return;if(L6.includes(g.key)&&w){let J1=g.key==="Escape";m6({id:_,store:r,unselect:J1,nodeRef:v})}else if(S&&A.selected&&Object.prototype.hasOwnProperty.call(S4,g.key)){g.preventDefault();let{ariaLabelConfig:J1}=r.getState();r.setState({ariaLiveMessage:J1["node.a11yDescription.ariaLiveMessage"]({direction:g.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),V({direction:S4[g.key],factor:g.shiftKey?4:1})}},s=()=>{if(B||!v.current?.matches(":focus-visible"))return;let{transform:g,width:J1,height:U1,autoPanOnNodeFocus:X1,setCenter:G1}=r.getState();if(!X1)return;if(!(Y4(new Map([[_,A]]),{x:0,y:0,width:J1,height:U1},g,!0).length>0))G1(A.position.x+E.width/2,A.position.y+E.height/2,{zoom:g[2]})};return d.jsx("div",{className:j1(["react-flow__node",`react-flow__node-${C}`,{[W]:S},A.className,{selected:A.selected,selectable:w,parent:f,draggable:S,dragging:h}]),ref:v,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:m?"visible":"hidden",...A.style,...u},"data-id":_,"data-testid":`rf__node-${_}`,onMouseEnter:I,onMouseMove:k,onMouseLeave:p,onContextMenu:b,onClick:t,onDoubleClick:e,onKeyDown:x?o:void 0,tabIndex:x?0:void 0,onFocus:x?s:void 0,role:A.ariaRole??(x?"group":void 0),"aria-roledescription":"node","aria-describedby":B?void 0:`${V9}-${O}`,"aria-label":A.ariaLabel,...A.domAttributes,children:d.jsx(EU,{value:_,children:d.jsx(N,{id:_,data:A.data,type:C,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:A.selected??!1,selectable:w,draggable:S,deletable:A.deletable??!0,isConnectable:j,sourcePosition:A.sourcePosition,targetPosition:A.targetPosition,dragging:h,dragHandle:A.dragHandle,zIndex:R.z,parentId:A.parentId,...E})})})}var GG=a.memo(UG),ZG=(_)=>({nodesConnectable:_.nodesConnectable,nodesFocusable:_.nodesFocusable,elementsSelectable:_.elementsSelectable,onError:_.onError});function r9(_){let{nodesConnectable:Q,nodesFocusable:J,elementsSelectable:q,onError:U}=O1(ZG,S1),G=QG(_.onlyRenderVisibleElements),Z=$G();return d.jsx("div",{className:"react-flow__nodes",style:k4,children:G.map((F)=>{return d.jsx(GG,{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)})})}r9.displayName="NodeRenderer";var FG=a.memo(r9);function HG(_){return O1(a.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&&f7({sourceNode:G,targetNode:Z,width:J.width,height:J.height,transform:J.transform}))q.push(U.id)}return q},[_]),S1)}var KG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_}};return d.jsx("polyline",{className:"arrow",style:J,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},XG=({color:_="none",strokeWidth:Q=1})=>{let J={strokeWidth:Q,..._&&{stroke:_,fill:_}};return d.jsx("polyline",{className:"arrowclosed",style:J,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},T9={[m2.Arrow]:KG,[m2.ArrowClosed]:XG};function YG(_){let Q=v1();return a.useMemo(()=>{if(!Object.prototype.hasOwnProperty.call(T9,_))return Q.getState().onError?.("009",_0.error009(_)),null;return T9[_]},[_])}var LG=({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=YG(Q);if(!X)return null;return d.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:d.jsx(X,{color:J,strokeWidth:Z})})},i9=({defaultColor:_,rfId:Q})=>{let J=O1((G)=>G.edges),q=O1((G)=>G.defaultEdgeOptions),U=a.useMemo(()=>{return N7(J,{id:Q,defaultColor:_,defaultMarkerStart:q?.markerStart,defaultMarkerEnd:q?.markerEnd})},[J,q,Q,_]);if(!U.length)return null;return d.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:d.jsx("defs",{children:U.map((G)=>d.jsx(LG,{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))})})};i9.displayName="MarkerDefinitions";var zG=a.memo(i9);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,...K}){let[H,L]=a.useState({x:1,y:0,width:0,height:0}),W=j1(["react-flow__edge-textwrapper",Y]),B=a.useRef(null);if(a.useEffect(()=>{if(B.current){let O=B.current.getBBox();L({x:O.x,y:O.y,width:O.width,height:O.height})}},[J]),!J)return null;return d.jsxs("g",{transform:`translate(${_-H.width/2} ${Q-H.height/2})`,className:W,visibility:H.width?"visible":"hidden",...K,children:[U&&d.jsx("rect",{width:H.width+2*Z[0],x:-Z[0],y:-Z[1],height:H.height+2*Z[1],className:"react-flow__edge-textbg",style:G,rx:F,ry:F}),d.jsx("text",{className:"react-flow__edge-text",y:H.height/2,dy:"0.3em",ref:B,style:q,children:J}),X]})}d9.displayName="EdgeText";var WG=a.memo(d9);function y4({path:_,labelX:Q,labelY:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X,interactionWidth:Y=20,...K}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{...K,d:_,fill:"none",className:j1(["react-flow__edge-path",K.className])}),Y?d.jsx("path",{d:_,fill:"none",strokeOpacity:0,strokeWidth:Y,className:"react-flow__edge-interaction"}):null,q&&K0(Q)&&K0(J)?d.jsx(WG,{x:Q,y:J,label:q,labelStyle:U,labelShowBg:G,labelBgStyle:Z,labelBgPadding:F,labelBgBorderRadius:X}):null]})}function R9({pos:_,x1:Q,y1:J,x2:q,y2:U}){if(_===Z1.Left||_===Z1.Right)return[0.5*(Q+q),J];return[Q,0.5*(J+U)]}function a9({sourceX:_,sourceY:Q,sourcePosition:J=Z1.Bottom,targetX:q,targetY:U,targetPosition:G=Z1.Top}){let[Z,F]=R9({pos:J,x1:_,y1:Q,x2:q,y2:U}),[X,Y]=R9({pos:G,x1:q,y1:U,x2:_,y2:Q}),[K,H,L,W]=A4({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}`,K,H,L,W]}function s9(_){return a.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z,targetPosition:F,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:W,style:B,markerEnd:O,markerStart:T,interactionWidth:M})=>{let[P,A,R]=a9({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F}),f=_.isInternal?void 0:Q;return d.jsx(y4,{id:f,path:P,labelX:A,labelY:R,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:W,style:B,markerEnd:O,markerStart:T,interactionWidth:M})})}var BG=s9({isInternal:!1}),t9=s9({isInternal:!0});BG.displayName="SimpleBezierEdge";t9.displayName="SimpleBezierEdgeInternal";function o9(_){return a.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,sourcePosition:W=Z1.Bottom,targetPosition:B=Z1.Top,markerEnd:O,markerStart:T,pathOptions:M,interactionWidth:P})=>{let[A,R,f]=y5({sourceX:J,sourceY:q,sourcePosition:W,targetX:U,targetY:G,targetPosition:B,borderRadius:M?.borderRadius,offset:M?.offset,stepPosition:M?.stepPosition}),C=_.isInternal?void 0:Q;return d.jsx(y4,{id:C,path:A,labelX:R,labelY:f,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:O,markerStart:T,interactionWidth:P})})}var n9=o9({isInternal:!1}),e9=o9({isInternal:!0});n9.displayName="SmoothStepEdge";e9.displayName="SmoothStepEdgeInternal";function __(_){return a.memo(({id:Q,...J})=>{let q=_.isInternal?void 0:Q;return d.jsx(n9,{...J,id:q,pathOptions:a.useMemo(()=>({borderRadius:0,offset:J.pathOptions?.offset}),[J.pathOptions?.offset])})})}var AG=__({isInternal:!1}),Q_=__({isInternal:!0});AG.displayName="StepEdge";Q_.displayName="StepEdgeInternal";function J_(_){return a.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:W,markerStart:B,interactionWidth:O})=>{let[T,M,P]=T4({sourceX:J,sourceY:q,targetX:U,targetY:G}),A=_.isInternal?void 0:Q;return d.jsx(y4,{id:A,path:T,labelX:M,labelY:P,label:Z,labelStyle:F,labelShowBg:X,labelBgStyle:Y,labelBgPadding:K,labelBgBorderRadius:H,style:L,markerEnd:W,markerStart:B,interactionWidth:O})})}var MG=J_({isInternal:!1}),$_=J_({isInternal:!0});MG.displayName="StraightEdge";$_.displayName="StraightEdgeInternal";function q_(_){return a.memo(({id:Q,sourceX:J,sourceY:q,targetX:U,targetY:G,sourcePosition:Z=Z1.Bottom,targetPosition:F=Z1.Top,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:W,style:B,markerEnd:O,markerStart:T,pathOptions:M,interactionWidth:P})=>{let[A,R,f]=M4({sourceX:J,sourceY:q,sourcePosition:Z,targetX:U,targetY:G,targetPosition:F,curvature:M?.curvature}),C=_.isInternal?void 0:Q;return d.jsx(y4,{id:C,path:A,labelX:R,labelY:f,label:X,labelStyle:Y,labelShowBg:K,labelBgStyle:H,labelBgPadding:L,labelBgBorderRadius:W,style:B,markerEnd:O,markerStart:T,interactionWidth:P})})}var TG=q_({isInternal:!1}),U_=q_({isInternal:!0});TG.displayName="BezierEdge";U_.displayName="BezierEdgeInternal";var O9={default:U_,straight:$_,step:Q_,smoothstep:e9,simplebezier:t9},I9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},RG=(_,Q,J)=>{if(J===Z1.Left)return _-Q;if(J===Z1.Right)return _+Q;return _},OG=(_,Q,J)=>{if(J===Z1.Top)return _-Q;if(J===Z1.Bottom)return _+Q;return _},f9="react-flow__edgeupdater";function w9({position:_,centerX:Q,centerY:J,radius:q=10,onMouseDown:U,onMouseEnter:G,onMouseOut:Z,type:F}){return d.jsx("circle",{onMouseDown:U,onMouseEnter:G,onMouseOut:Z,className:j1([f9,`${f9}-${F}`]),cx:RG(Q,q,_),cy:OG(J,q,_),r:q,stroke:"transparent",fill:"transparent"})}function IG({isReconnectable:_,reconnectRadius:Q,edge:J,sourceX:q,sourceY:U,targetX:G,targetY:Z,sourcePosition:F,targetPosition:X,onReconnect:Y,onReconnectStart:K,onReconnectEnd:H,setReconnecting:L,setUpdateHover:W}){let B=v1(),O=(R,f)=>{if(R.button!==0)return;let{autoPanOnConnect:C,domNode:N,connectionMode:S,connectionRadius:w,lib:j,onConnectStart:x,cancelConnection:r,nodeLookup:m,rfId:v,panBy:h,updateConnection:V}=B.getState(),E=f.type==="target",u=(k,p)=>{L(!1),H?.(k,J,f.type,p)},D=(k)=>Y?.(J,k),I=(k,p)=>{L(!0),K?.(R,J,f.type),x?.(k,p)};f4.onPointerDown(R.nativeEvent,{autoPanOnConnect:C,connectionMode:S,connectionRadius:w,domNode:N,handleId:f.id,nodeId:f.nodeId,nodeLookup:m,isTarget:E,edgeUpdaterType:f.type,lib:j,flowId:v,cancelConnection:r,panBy:h,isValidConnection:(...k)=>B.getState().isValidConnection?.(...k)??!0,onConnect:D,onConnectStart:I,onConnectEnd:(...k)=>B.getState().onConnectEnd?.(...k),onReconnectEnd:u,updateConnection:V,getTransform:()=>B.getState().transform,getFromHandle:()=>B.getState().connection.fromHandle,dragThreshold:B.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},T=(R)=>O(R,{nodeId:J.target,id:J.targetHandle??null,type:"target"}),M=(R)=>O(R,{nodeId:J.source,id:J.sourceHandle??null,type:"source"}),P=()=>W(!0),A=()=>W(!1);return d.jsxs(d.Fragment,{children:[(_===!0||_==="source")&&d.jsx(w9,{position:F,centerX:q,centerY:U,radius:Q,onMouseDown:T,onMouseEnter:P,onMouseOut:A,type:"source"}),(_===!0||_==="target")&&d.jsx(w9,{position:X,centerX:G,centerY:Z,radius:Q,onMouseDown:M,onMouseEnter:P,onMouseOut:A,type:"target"})]})}function fG({id:_,edgesFocusable:Q,edgesReconnectable:J,elementsSelectable:q,onClick:U,onDoubleClick:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,reconnectRadius:K,onReconnect:H,onReconnectStart:L,onReconnectEnd:W,rfId:B,edgeTypes:O,noPanClassName:T,onError:M,disableKeyboardA11y:P}){let A=O1((G1)=>G1.edgeLookup.get(_)),R=O1((G1)=>G1.defaultEdgeOptions);A=R?{...R,...A}:A;let f=A.type||"default",C=O?.[f]||O9[f];if(C===void 0)M?.("011",_0.error011(f)),f="default",C=O?.default||O9.default;let N=!!(A.focusable||Q&&typeof A.focusable>"u"),S=typeof H<"u"&&(A.reconnectable||J&&typeof A.reconnectable>"u"),w=!!(A.selectable||q&&typeof A.selectable>"u"),j=a.useRef(null),[x,r]=a.useState(!1),[m,v]=a.useState(!1),h=v1(),{zIndex:V=A.zIndex,sourceX:E,sourceY:u,targetX:D,targetY:I,sourcePosition:k,targetPosition:p}=O1(a.useCallback((G1)=>{let F1=G1.nodeLookup.get(A.source),B1=G1.nodeLookup.get(A.target);if(!F1||!B1)return I9;let Y1=P7({id:_,sourceNode:F1,targetNode:B1,sourceHandle:A.sourceHandle||null,targetHandle:A.targetHandle||null,connectionMode:G1.connectionMode,onError:M}),Q1=I7({selected:A.selected,zIndex:A.zIndex,sourceNode:F1,targetNode:B1,elevateOnSelect:G1.elevateEdgesOnSelect,zIndexMode:G1.zIndexMode});return{...Y1||I9,zIndex:Q1}},[A.source,A.target,A.sourceHandle,A.targetHandle,A.selected,A.zIndex,M]),S1),b=a.useMemo(()=>A.markerStart?`url('#${R4(A.markerStart,B)}')`:void 0,[A.markerStart,B]),e=a.useMemo(()=>A.markerEnd?`url('#${R4(A.markerEnd,B)}')`:void 0,[A.markerEnd,B]);if(A.hidden||E===null||u===null||D===null||I===null)return null;let t=(G1)=>{let{addSelectedEdges:F1,unselectNodesAndEdges:B1,multiSelectionActive:Y1}=h.getState();if(w)if(h.setState({nodesSelectionActive:!1}),A.selected&&Y1)B1({nodes:[],edges:[A]}),j.current?.blur();else F1([_]);if(U)U(G1,A)},o=G?(G1)=>{G(G1,{...A})}:void 0,s=Z?(G1)=>{Z(G1,{...A})}:void 0,g=F?(G1)=>{F(G1,{...A})}:void 0,J1=X?(G1)=>{X(G1,{...A})}:void 0,U1=Y?(G1)=>{Y(G1,{...A})}:void 0,X1=(G1)=>{if(!P&&L6.includes(G1.key)&&w){let{unselectNodesAndEdges:F1,addSelectedEdges:B1}=h.getState();if(G1.key==="Escape")j.current?.blur(),F1({edges:[A]});else B1([_])}};return d.jsx("svg",{style:{zIndex:V},children:d.jsxs("g",{className:j1(["react-flow__edge",`react-flow__edge-${f}`,A.className,T,{selected:A.selected,animated:A.animated,inactive:!w&&!U,updating:x,selectable:w}]),onClick:t,onDoubleClick:o,onContextMenu:s,onMouseEnter:g,onMouseMove:J1,onMouseLeave:U1,onKeyDown:N?X1:void 0,tabIndex:N?0:void 0,role:A.ariaRole??(N?"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":N?`${u9}-${B}`:void 0,ref:j,...A.domAttributes,children:[!m&&d.jsx(C,{id:_,source:A.source,target:A.target,type:A.type,selected:A.selected,animated:A.animated,selectable:w,deletable:A.deletable??!0,label:A.label,labelStyle:A.labelStyle,labelShowBg:A.labelShowBg,labelBgStyle:A.labelBgStyle,labelBgPadding:A.labelBgPadding,labelBgBorderRadius:A.labelBgBorderRadius,sourceX:E,sourceY:u,targetX:D,targetY:I,sourcePosition:k,targetPosition:p,data:A.data,style:A.style,sourceHandleId:A.sourceHandle,targetHandleId:A.targetHandle,markerStart:b,markerEnd:e,pathOptions:"pathOptions"in A?A.pathOptions:void 0,interactionWidth:A.interactionWidth}),S&&d.jsx(IG,{edge:A,isReconnectable:S,reconnectRadius:K,onReconnect:H,onReconnectStart:L,onReconnectEnd:W,sourceX:E,sourceY:u,targetX:D,targetY:I,sourcePosition:k,targetPosition:p,setUpdateHover:r,setReconnecting:v})]})})}var wG=a.memo(fG),PG=(_)=>({edgesFocusable:_.edgesFocusable,edgesReconnectable:_.edgesReconnectable,elementsSelectable:_.elementsSelectable,connectionMode:_.connectionMode,onError:_.onError});function G_({defaultMarkerColor:_,onlyRenderVisibleElements:Q,rfId:J,edgeTypes:q,noPanClassName:U,onReconnect:G,onEdgeContextMenu:Z,onEdgeMouseEnter:F,onEdgeMouseMove:X,onEdgeMouseLeave:Y,onEdgeClick:K,reconnectRadius:H,onEdgeDoubleClick:L,onReconnectStart:W,onReconnectEnd:B,disableKeyboardA11y:O}){let{edgesFocusable:T,edgesReconnectable:M,elementsSelectable:P,onError:A}=O1(PG,S1),R=HG(Q);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(zG,{defaultColor:_,rfId:J}),R.map((f)=>{return d.jsx(wG,{id:f,edgesFocusable:T,edgesReconnectable:M,elementsSelectable:P,noPanClassName:U,onReconnect:G,onContextMenu:Z,onMouseEnter:F,onMouseMove:X,onMouseLeave:Y,onClick:K,reconnectRadius:H,onDoubleClick:L,onReconnectStart:W,onReconnectEnd:B,rfId:J,onError:A,edgeTypes:q,disableKeyboardA11y:O},f)})]})}G_.displayName="EdgeRenderer";var NG=a.memo(G_),P9=(_)=>`translate(${_[0]}px,${_[1]}px) scale(${_[2]})`;function CG({children:_}){let Q=v1(),J=a.useRef(null),[q]=a.useState(()=>Q.getState().transform);return x9(()=>{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=P9(Z)};return G(),Q.subscribe(G)},[Q]),d.jsx("div",{ref:J,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:P9(q)},children:_})}function SG(_){let Q=V5(),J=a.useRef(!1);a.useEffect(()=>{if(!J.current&&Q.viewportInitialized&&_)setTimeout(()=>_(Q),1),J.current=!0},[_,Q.viewportInitialized])}var vG=(_)=>_.panZoom?.syncViewport;function kG(_){let Q=O1(vG),J=v1();return a.useEffect(()=>{if(_)Q?.(_),J.setState({transform:[_.x,_.y,_.zoom]})},[_,Q]),null}function N9(_){return _.connection.inProgress?{..._.connection,to:r2(_.connection.to,_.transform)}:{..._.connection}}function yG(_){if(_)return(J)=>{let q=N9(J);return _(q)};return N9}function jG(_){let Q=yG(_);return O1(Q,S1)}var VG=(_)=>({nodesConnectable:_.nodesConnectable,isValid:_.connection.isValid,inProgress:_.connection.inProgress,width:_.width,height:_.height});function uG({containerStyle:_,style:Q,type:J,component:q}){let{nodesConnectable:U,width:G,height:Z,isValid:F,inProgress:X}=O1(VG,S1);if(!(G&&U&&X))return null;return d.jsx("svg",{style:_,width:G,height:Z,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:j1(["react-flow__connection",N6(F)]),children:d.jsx(Z_,{style:Q,type:J,CustomComponent:q,isValid:F})})})}var Z_=({style:_,type:Q=P0.Bezier,CustomComponent:J,isValid:q})=>{let{inProgress:U,from:G,fromNode:Z,fromHandle:F,fromPosition:X,to:Y,toNode:K,toHandle:H,toPosition:L,pointer:W}=jG();if(!U)return;if(J)return d.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:N6(q),toNode:K,toHandle:H,pointer:W});let B="",O={sourceX:G.x,sourceY:G.y,sourcePosition:X,targetX:Y.x,targetY:Y.y,targetPosition:L};switch(Q){case P0.Bezier:[B]=M4(O);break;case P0.SimpleBezier:[B]=a9(O);break;case P0.Step:[B]=y5({...O,borderRadius:0});break;case P0.SmoothStep:[B]=y5(O);break;default:[B]=T4(O)}return d.jsx("path",{d:B,fill:"none",className:"react-flow__connection-path",style:_})};Z_.displayName="ConnectionLine";var bG={};function C9(_=bG){let Q=a.useRef(_),J=v1();a.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",_0.error002());break}Q.current=_}},[_])}function hG(){let _=v1(),Q=a.useRef(!1);a.useEffect(()=>{if(!Q.current){let J=document.querySelector(".react-flow__pane");if(J&&window.getComputedStyle(J).zIndex!=="1")_.getState().onError?.("013",_0.error013("react"));Q.current=!0}},[])}function F_({nodeTypes:_,edgeTypes:Q,onInit:J,onNodeClick:q,onEdgeClick:U,onNodeDoubleClick:G,onEdgeDoubleClick:Z,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:K,onSelectionContextMenu:H,onSelectionStart:L,onSelectionEnd:W,connectionLineType:B,connectionLineStyle:O,connectionLineComponent:T,connectionLineContainerStyle:M,selectionKeyCode:P,selectionOnDrag:A,selectionMode:R,multiSelectionKeyCode:f,panActivationKeyCode:C,zoomActivationKeyCode:N,deleteKeyCode:S,onlyRenderVisibleElements:w,elementsSelectable:j,defaultViewport:x,translateExtent:r,minZoom:m,maxZoom:v,preventScrolling:h,defaultMarkerColor:V,zoomOnScroll:E,zoomOnPinch:u,panOnScroll:D,panOnScrollSpeed:I,panOnScrollMode:k,zoomOnDoubleClick:p,panOnDrag:b,autoPanOnSelection:e,onPaneClick:t,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:g,onPaneScroll:J1,onPaneContextMenu:U1,paneClickDistance:X1,nodeClickDistance:G1,onEdgeContextMenu:F1,onEdgeMouseEnter:B1,onEdgeMouseMove:Y1,onEdgeMouseLeave:Q1,reconnectRadius:T1,onReconnect:K1,onReconnectStart:y1,onReconnectEnd:p1,noDragClassName:l1,noWheelClassName:z0,noPanClassName:Z0,disableKeyboardA11y:F0,nodeExtent:o1,rfId:Q0,viewport:n1,onViewportChange:J0,nodesDraggable:r0}){return C9(_),C9(Q),hG(),SG(J),kG(n1),d.jsx(eU,{onPaneClick:t,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:g,onPaneContextMenu:U1,onPaneScroll:J1,paneClickDistance:X1,deleteKeyCode:S,selectionKeyCode:P,selectionOnDrag:A,selectionMode:R,onSelectionStart:L,onSelectionEnd:W,multiSelectionKeyCode:f,panActivationKeyCode:C,zoomActivationKeyCode:N,elementsSelectable:j,zoomOnScroll:E,zoomOnPinch:u,zoomOnDoubleClick:p,panOnScroll:D,panOnScrollSpeed:I,panOnScrollMode:k,panOnDrag:b,autoPanOnSelection:e,defaultViewport:x,translateExtent:r,minZoom:m,maxZoom:v,onSelectionContextMenu:H,preventScrolling:h,noDragClassName:l1,noWheelClassName:z0,noPanClassName:Z0,disableKeyboardA11y:F0,onViewportChange:J0,isControlledViewport:!!n1,children:d.jsxs(CG,{children:[d.jsx(NG,{edgeTypes:Q,onEdgeClick:U,onEdgeDoubleClick:Z,onReconnect:K1,onReconnectStart:y1,onReconnectEnd:p1,onlyRenderVisibleElements:w,onEdgeContextMenu:F1,onEdgeMouseEnter:B1,onEdgeMouseMove:Y1,onEdgeMouseLeave:Q1,reconnectRadius:T1,defaultMarkerColor:V,noPanClassName:Z0,disableKeyboardA11y:F0,rfId:Q0}),d.jsx(uG,{style:O,type:B,component:T,containerStyle:M}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(FG,{nodeTypes:_,onNodeClick:q,onNodeDoubleClick:G,onNodeMouseEnter:F,onNodeMouseMove:X,onNodeMouseLeave:Y,onNodeContextMenu:K,nodeClickDistance:G1,onlyRenderVisibleElements:w,noPanClassName:Z0,noDragClassName:l1,disableKeyboardA11y:F0,nodeExtent:o1,rfId:Q0,nodesDraggable:r0}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}F_.displayName="GraphView";var DG=a.memo(F_),EG=I6("React Flow","https://reactflow.dev/"),S9=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X=0.5,maxZoom:Y=2,nodeOrigin:K,nodeExtent:H,zIndexMode:L="basic"}={})=>{let W=new Map,B=new Map,O=new Map,T=new Map,M=q??Q??[],P=J??_??[],A=K??[0,0],R=H??p2;b6(O,T,M);let{nodesInitialized:f}=O4(P,W,B,{nodeOrigin:A,nodeExtent:R,zIndexMode:L}),C=[0,0,1];if(Z&&U&&G){let N=R2(W,{filter:(x)=>!!((x.width||x.initialWidth)&&(x.height||x.initialHeight))}),{x:S,y:w,zoom:j}=k5(N,U,G,X,Y,F?.padding??0.1);C=[S,w,j]}return{rfId:"1",width:U??0,height:G??0,transform:C,nodes:P,nodesInitialized:f,nodeLookup:W,parentLookup:B,edges:M,edgeLookup:T,connectionLookup:O,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:J!==void 0,hasDefaultEdges:q!==void 0,panZoom:null,minZoom:X,maxZoom:Y,translateExtent:p2,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:n0.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:{...W6},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:EG,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:z6,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}},xG=({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:K,nodeExtent:H,zIndexMode:L})=>_9((W,B)=>{async function O(){let{nodeLookup:T,panZoom:M,fitViewOptions:P,fitViewResolver:A,width:R,height:f,minZoom:C,maxZoom:N}=B();if(!M)return;await W7({nodes:T,width:R,height:f,panZoom:M,minZoom:C,maxZoom:N},P),A?.resolve(!0),W({fitViewResolver:null})}return{...S9({nodes:_,edges:Q,width:U,height:G,fitView:Z,fitViewOptions:F,minZoom:X,maxZoom:Y,nodeOrigin:K,nodeExtent:H,defaultNodes:J,defaultEdges:q,zIndexMode:L}),setNodes:(T)=>{let{nodeLookup:M,parentLookup:P,nodeOrigin:A,nodeExtent:R,elevateNodesOnSelect:f,fitViewQueued:C,zIndexMode:N,nodesSelectionActive:S}=B(),{nodesInitialized:w,hasSelectedNodes:j}=O4(T,M,P,{nodeOrigin:A,nodeExtent:R,elevateNodesOnSelect:f,checkEquality:!0,zIndexMode:N}),x=S&&j;if(C&&w)O(),W({nodes:T,nodesInitialized:w,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:x});else W({nodes:T,nodesInitialized:w,nodesSelectionActive:x})},setEdges:(T)=>{let{connectionLookup:M,edgeLookup:P}=B();b6(M,P,T),W({edges:T})},setDefaultNodesAndEdges:(T,M)=>{if(T){let{setNodes:P}=B();P(T),W({hasDefaultNodes:!0})}if(M){let{setEdges:P}=B();P(M),W({hasDefaultEdges:!0})}},updateNodeInternals:(T)=>{let{triggerNodeChanges:M,nodeLookup:P,parentLookup:A,domNode:R,nodeOrigin:f,nodeExtent:C,debug:N,fitViewQueued:S,zIndexMode:w}=B(),{changes:j,updatedInternals:x}=y7(T,P,A,R,f,C,w);if(!x)return;if(v7(P,A,{nodeOrigin:f,nodeExtent:C,zIndexMode:w}),S)O(),W({fitViewQueued:!1,fitViewOptions:void 0});else W({});if(j?.length>0){if(N)console.log("React Flow: trigger node changes",j);M?.(j)}},updateNodePositions:(T,M=!1)=>{let P=[],A=[],{nodeLookup:R,triggerNodeChanges:f,connection:C,updateConnection:N,onNodesChangeMiddlewareMap:S}=B();for(let[w,j]of T){let x=R.get(w),r=!!(x?.expandParent&&x?.parentId&&j?.position),m={id:w,type:"position",position:r?{x:Math.max(0,j.position.x),y:Math.max(0,j.position.y)}:j.position,dragging:M};if(x&&C.inProgress&&C.fromNode.id===x.id){let v=e0(x,C.fromHandle,Z1.Left,!0);N({...C,from:v})}if(r&&x.parentId)P.push({id:w,parentId:x.parentId,rect:{...j.internals.positionAbsolute,width:j.measured.width??0,height:j.measured.height??0}});A.push(m)}if(P.length>0){let{parentLookup:w,nodeOrigin:j}=B(),x=I4(P,R,w,j);A.push(...x)}for(let w of S.values())A=w(A);f(A)},triggerNodeChanges:(T)=>{let{onNodesChange:M,setNodes:P,nodes:A,hasDefaultNodes:R,debug:f}=B();if(T?.length){if(R){let C=D9(T,A);P(C)}if(f)console.log("React Flow: trigger node changes",T);M?.(T)}},triggerEdgeChanges:(T)=>{let{onEdgesChange:M,setEdges:P,edges:A,hasDefaultEdges:R,debug:f}=B();if(T?.length){if(R){let C=RU(T,A);P(C)}if(f)console.log("React Flow: trigger edge changes",T);M?.(T)}},addSelectedNodes:(T)=>{let{multiSelectionActive:M,edgeLookup:P,nodeLookup:A,triggerNodeChanges:R,triggerEdgeChanges:f}=B();if(M){let C=T.map((N)=>O2(N,!0));R(C);return}R(d2(A,new Set([...T]),!0)),f(d2(P))},addSelectedEdges:(T)=>{let{multiSelectionActive:M,edgeLookup:P,nodeLookup:A,triggerNodeChanges:R,triggerEdgeChanges:f}=B();if(M){let C=T.map((N)=>O2(N,!0));f(C);return}f(d2(P,new Set([...T]))),R(d2(A,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:M}={})=>{let{edges:P,nodes:A,nodeLookup:R,triggerNodeChanges:f,triggerEdgeChanges:C}=B(),N=T?T:A,S=M?M:P,w=[];for(let x of N){if(!x.selected)continue;let r=R.get(x.id);if(r)r.selected=!1;w.push(O2(x.id,!1))}let j=[];for(let x of S){if(!x.selected)continue;j.push(O2(x.id,!1))}f(w),C(j)},setMinZoom:(T)=>{let{panZoom:M,maxZoom:P}=B();M?.setScaleExtent([T,P]),W({minZoom:T})},setMaxZoom:(T)=>{let{panZoom:M,minZoom:P}=B();M?.setScaleExtent([P,T]),W({maxZoom:T})},setTranslateExtent:(T)=>{B().panZoom?.setTranslateExtent(T),W({translateExtent:T})},resetSelectedElements:()=>{let{edges:T,nodes:M,triggerNodeChanges:P,triggerEdgeChanges:A,elementsSelectable:R}=B();if(!R)return;let f=M.reduce((N,S)=>S.selected?[...N,O2(S.id,!1)]:N,[]),C=T.reduce((N,S)=>S.selected?[...N,O2(S.id,!1)]:N,[]);P(f),A(C)},setNodeExtent:(T)=>{let{nodes:M,nodeLookup:P,parentLookup:A,nodeOrigin:R,elevateNodesOnSelect:f,nodeExtent:C,zIndexMode:N}=B();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;O4(M,P,A,{nodeOrigin:R,nodeExtent:T,elevateNodesOnSelect:f,checkEquality:!1,zIndexMode:N}),W({nodeExtent:T})},panBy:(T)=>{let{transform:M,width:P,height:A,panZoom:R,translateExtent:f}=B();return j7({delta:T,panZoom:R,transform:M,translateExtent:f,width:P,height:A})},setCenter:async(T,M,P)=>{let{width:A,height:R,maxZoom:f,panZoom:C}=B();if(!C)return!1;let N=typeof P?.zoom<"u"?P.zoom:f;return await C.setViewport({x:A/2-T*N,y:R/2-M*N,zoom:N},{duration:P?.duration,ease:P?.ease,interpolate:P?.interpolate}),!0},cancelConnection:()=>{W({connection:{...W6}})},updateConnection:(T)=>{W({connection:T})},reset:()=>W({...S9()})}},Object.is);function c6({initialNodes:_,initialEdges:Q,defaultNodes:J,defaultEdges:q,initialWidth:U,initialHeight:G,initialMinZoom:Z,initialMaxZoom:F,initialFitViewOptions:X,fitView:Y,nodeOrigin:K,nodeExtent:H,zIndexMode:L,children:W}){let[B]=a.useState(()=>xG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,width:U,height:G,fitView:Y,minZoom:Z,maxZoom:F,fitViewOptions:X,nodeOrigin:K,nodeExtent:H,zIndexMode:L}));return d.jsx(_U,{value:B,children:d.jsx(PU,{children:d.jsx(mU,{children:W})})})}function mG({children:_,nodes:Q,edges:J,defaultNodes:q,defaultEdges:U,width:G,height:Z,fitView:F,fitViewOptions:X,minZoom:Y,maxZoom:K,nodeOrigin:H,nodeExtent:L,zIndexMode:W}){if(a.useContext(v4))return d.jsx(d.Fragment,{children:_});return d.jsx(c6,{initialNodes:Q,initialEdges:J,defaultNodes:q,defaultEdges:U,initialWidth:G,initialHeight:Z,fitView:F,initialFitViewOptions:X,initialMinZoom:Y,initialMaxZoom:K,nodeOrigin:H,nodeExtent:L,zIndexMode:W,children:_})}var gG={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function pG({nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,className:U,nodeTypes:G,edgeTypes:Z,onNodeClick:F,onEdgeClick:X,onInit:Y,onMove:K,onMoveStart:H,onMoveEnd:L,onConnect:W,onConnectStart:B,onConnectEnd:O,onClickConnectStart:T,onClickConnectEnd:M,onNodeMouseEnter:P,onNodeMouseMove:A,onNodeMouseLeave:R,onNodeContextMenu:f,onNodeDoubleClick:C,onNodeDragStart:N,onNodeDrag:S,onNodeDragStop:w,onNodesDelete:j,onEdgesDelete:x,onDelete:r,onSelectionChange:m,onSelectionDragStart:v,onSelectionDrag:h,onSelectionDragStop:V,onSelectionContextMenu:E,onSelectionStart:u,onSelectionEnd:D,onBeforeDelete:I,connectionMode:k,connectionLineType:p=P0.Bezier,connectionLineStyle:b,connectionLineComponent:e,connectionLineContainerStyle:t,deleteKeyCode:o="Backspace",selectionKeyCode:s="Shift",selectionOnDrag:g=!1,selectionMode:J1=B2.Full,panActivationKeyCode:U1="Space",multiSelectionKeyCode:X1=i2()?"Meta":"Control",zoomActivationKeyCode:G1=i2()?"Meta":"Control",snapToGrid:F1,snapGrid:B1,onlyRenderVisibleElements:Y1=!1,selectNodesOnDrag:Q1,nodesDraggable:T1,autoPanOnNodeFocus:K1,nodesConnectable:y1,nodesFocusable:p1,nodeOrigin:l1=b9,edgesFocusable:z0,edgesReconnectable:Z0,elementsSelectable:F0=!0,defaultViewport:o1=LU,minZoom:Q0=0.5,maxZoom:n1=2,translateExtent:J0=p2,preventScrolling:r0=!0,nodeExtent:H0,defaultMarkerColor:k0="#b1b1b7",zoomOnScroll:y0=!0,zoomOnPinch:q2=!0,panOnScroll:k2=!1,panOnScrollSpeed:c=0.5,panOnScrollMode:z=D0.Free,zoomOnDoubleClick:y=!0,panOnDrag:l=!0,onPaneClick:_1,onPaneMouseEnter:n,onPaneMouseMove:$1,onPaneMouseLeave:q1,onPaneScroll:H1,onPaneContextMenu:L1,paneClickDistance:M1=1,nodeClickDistance:E1=0,children:u1,onReconnect:_5,onReconnectStart:j0,onReconnectEnd:C1,onEdgeContextMenu:ZQ,onEdgeDoubleClick:FQ,onEdgeMouseEnter:HQ,onEdgeMouseMove:KQ,onEdgeMouseLeave:XQ,reconnectRadius:YQ=10,onNodesChange:LQ,onEdgesChange:zQ,noDragClassName:WQ="nodrag",noWheelClassName:BQ="nowheel",noPanClassName:U8="nopan",fitView:G8,fitViewOptions:Z8,connectOnClick:AQ,attributionPosition:MQ,proOptions:TQ,defaultEdgeOptions:RQ,elevateNodesOnSelect:OQ=!0,elevateEdgesOnSelect:IQ=!1,disableKeyboardA11y:F8=!1,autoPanOnConnect:fQ,autoPanOnNodeDrag:wQ,autoPanOnSelection:PQ=!0,autoPanSpeed:NQ,connectionRadius:CQ,isValidConnection:SQ,onError:vQ,style:kQ,id:H8,nodeDragThreshold:yQ,connectionDragThreshold:jQ,viewport:VQ,onViewportChange:uQ,width:bQ,height:hQ,colorMode:DQ="light",debug:EQ,onScroll:K8,ariaLabelConfig:xQ,zIndexMode:X8="basic",...mQ},gQ){let m4=H8||"1",pQ=AU(DQ),cQ=a.useCallback((Y8)=>{Y8.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),K8?.(Y8)},[K8]);return d.jsx("div",{"data-testid":"rf__wrapper",...mQ,onScroll:cQ,style:{...kQ,...gG},ref:gQ,className:j1(["react-flow",U,pQ]),id:H8,role:"application",children:d.jsxs(mG,{nodes:_,edges:Q,width:bQ,height:hQ,fitView:G8,fitViewOptions:Z8,minZoom:Q0,maxZoom:n1,nodeOrigin:l1,nodeExtent:H0,zIndexMode:X8,children:[d.jsx(BU,{nodes:_,edges:Q,defaultNodes:J,defaultEdges:q,onConnect:W,onConnectStart:B,onConnectEnd:O,onClickConnectStart:T,onClickConnectEnd:M,nodesDraggable:T1,autoPanOnNodeFocus:K1,nodesConnectable:y1,nodesFocusable:p1,edgesFocusable:z0,edgesReconnectable:Z0,elementsSelectable:F0,elevateNodesOnSelect:OQ,elevateEdgesOnSelect:IQ,minZoom:Q0,maxZoom:n1,nodeExtent:H0,onNodesChange:LQ,onEdgesChange:zQ,snapToGrid:F1,snapGrid:B1,connectionMode:k,translateExtent:J0,connectOnClick:AQ,defaultEdgeOptions:RQ,fitView:G8,fitViewOptions:Z8,onNodesDelete:j,onEdgesDelete:x,onDelete:r,onNodeDragStart:N,onNodeDrag:S,onNodeDragStop:w,onSelectionDrag:h,onSelectionDragStart:v,onSelectionDragStop:V,onMove:K,onMoveStart:H,onMoveEnd:L,noPanClassName:U8,nodeOrigin:l1,rfId:m4,autoPanOnConnect:fQ,autoPanOnNodeDrag:wQ,autoPanSpeed:NQ,onError:vQ,connectionRadius:CQ,isValidConnection:SQ,selectNodesOnDrag:Q1,nodeDragThreshold:yQ,connectionDragThreshold:jQ,onBeforeDelete:I,debug:EQ,ariaLabelConfig:xQ,zIndexMode:X8}),d.jsx(DG,{onInit:Y,onNodeClick:F,onEdgeClick:X,onNodeMouseEnter:P,onNodeMouseMove:A,onNodeMouseLeave:R,onNodeContextMenu:f,onNodeDoubleClick:C,nodeTypes:G,edgeTypes:Z,connectionLineType:p,connectionLineStyle:b,connectionLineComponent:e,connectionLineContainerStyle:t,selectionKeyCode:s,selectionOnDrag:g,selectionMode:J1,deleteKeyCode:o,multiSelectionKeyCode:X1,panActivationKeyCode:U1,zoomActivationKeyCode:G1,onlyRenderVisibleElements:Y1,defaultViewport:o1,translateExtent:J0,minZoom:Q0,maxZoom:n1,preventScrolling:r0,zoomOnScroll:y0,zoomOnPinch:q2,zoomOnDoubleClick:y,panOnScroll:k2,panOnScrollSpeed:c,panOnScrollMode:z,panOnDrag:l,autoPanOnSelection:PQ,onPaneClick:_1,onPaneMouseEnter:n,onPaneMouseMove:$1,onPaneMouseLeave:q1,onPaneScroll:H1,onPaneContextMenu:L1,paneClickDistance:M1,nodeClickDistance:E1,onSelectionContextMenu:E,onSelectionStart:u,onSelectionEnd:D,onReconnect:_5,onReconnectStart:j0,onReconnectEnd:C1,onEdgeContextMenu:ZQ,onEdgeDoubleClick:FQ,onEdgeMouseEnter:HQ,onEdgeMouseMove:KQ,onEdgeMouseLeave:XQ,reconnectRadius:YQ,defaultMarkerColor:k0,noDragClassName:WQ,noWheelClassName:BQ,noPanClassName:U8,rfId:m4,disableKeyboardA11y:F8,nodeExtent:H0,viewport:VQ,onViewportChange:uQ,nodesDraggable:T1}),d.jsx(YU,{onSelectionChange:m}),u1,d.jsx(ZU,{proOptions:TQ,position:MQ}),d.jsx(GU,{rfId:m4,disableKeyboardA11y:F8})]})})}var H_=E9(pG);function K_(_){let[Q,J]=a.useState(_),q=a.useCallback((U)=>J((G)=>D9(U,G)),[]);return[Q,J,q]}var bA=_0.error014();function cG({dimensions:_,lineWidth:Q,variant:J,className:q}){return d.jsx("path",{strokeWidth:Q,d:`M${_[0]/2} 0 V${_[1]} M0 ${_[1]/2} H${_[0]}`,className:j1(["react-flow__background-pattern",J,q])})}function lG({radius:_,className:Q}){return d.jsx("circle",{cx:_,cy:_,r:_,className:j1(["react-flow__background-pattern","dots",Q])})}var N0;(function(_){_.Lines="lines",_.Dots="dots",_.Cross="cross"})(N0||(N0={}));var rG={[N0.Dots]:1,[N0.Lines]:1,[N0.Cross]:6},iG=(_)=>({transform:_.transform,patternId:`pattern-${_.rfId}`});function X_({id:_,variant:Q=N0.Dots,gap:J=20,size:q,lineWidth:U=1,offset:G=0,color:Z,bgColor:F,style:X,className:Y,patternClassName:K}){let H=a.useRef(null),{transform:L,patternId:W}=O1(iG,S1),B=q||rG[Q],O=Q===N0.Dots,T=Q===N0.Cross,M=Array.isArray(J)?J:[J,J],P=[M[0]*L[2]||1,M[1]*L[2]||1],A=B*L[2],R=Array.isArray(G)?G:[G,G],f=T?[A,A]:P,C=[R[0]*L[2]+f[0]/2,R[1]*L[2]+f[1]/2],N=`${W}${_?_:""}`;return d.jsxs("svg",{className:j1(["react-flow__background",Y]),style:{...X,...k4,"--xy-background-color-props":F,"--xy-background-pattern-color-props":Z},ref:H,"data-testid":"rf__background",children:[d.jsx("pattern",{id:N,x:L[0]%P[0],y:L[1]%P[1],width:P[0],height:P[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:O?d.jsx(lG,{radius:A/2,className:K}):d.jsx(cG,{dimensions:f,lineWidth:U,variant:Q,className:K})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}X_.displayName="Background";var Y_=a.memo(X_);function dG(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:d.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function aG(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:d.jsx("path",{d:"M0 0h32v4.2H0z"})})}function sG(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:d.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 tG(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 oG(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 N4({children:_,className:Q,...J}){return d.jsx("button",{type:"button",className:j1(["react-flow__controls-button",Q]),...J,children:_})}var nG=(_)=>({isInteractive:_.nodesDraggable||_.nodesConnectable||_.elementsSelectable,minZoomReached:_.transform[2]<=_.minZoom,maxZoomReached:_.transform[2]>=_.maxZoom,ariaLabelConfig:_.ariaLabelConfig});function L_({style:_,showZoom:Q=!0,showFitView:J=!0,showInteractive:q=!0,fitViewOptions:U,onZoomIn:G,onZoomOut:Z,onFitView:F,onInteractiveChange:X,className:Y,children:K,position:H="bottom-left",orientation:L="vertical","aria-label":W}){let B=v1(),{isInteractive:O,minZoomReached:T,maxZoomReached:M,ariaLabelConfig:P}=O1(nG,S1),{zoomIn:A,zoomOut:R,fitView:f}=V5(),C=()=>{A(),G?.()},N=()=>{R(),Z?.()},S=()=>{f(U),F?.()},w=()=>{B.setState({nodesDraggable:!O,nodesConnectable:!O,elementsSelectable:!O}),X?.(!O)};return d.jsxs(C0,{className:j1(["react-flow__controls",L==="horizontal"?"horizontal":"vertical",Y]),position:H,style:_,"data-testid":"rf__controls","aria-label":W??P["controls.ariaLabel"],children:[Q&&d.jsxs(d.Fragment,{children:[d.jsx(N4,{onClick:C,className:"react-flow__controls-zoomin",title:P["controls.zoomIn.ariaLabel"],"aria-label":P["controls.zoomIn.ariaLabel"],disabled:M,children:d.jsx(dG,{})}),d.jsx(N4,{onClick:N,className:"react-flow__controls-zoomout",title:P["controls.zoomOut.ariaLabel"],"aria-label":P["controls.zoomOut.ariaLabel"],disabled:T,children:d.jsx(aG,{})})]}),J&&d.jsx(N4,{className:"react-flow__controls-fitview",onClick:S,title:P["controls.fitView.ariaLabel"],"aria-label":P["controls.fitView.ariaLabel"],children:d.jsx(sG,{})}),q&&d.jsx(N4,{className:"react-flow__controls-interactive",onClick:w,title:P["controls.interactive.ariaLabel"],"aria-label":P["controls.interactive.ariaLabel"],children:O?d.jsx(oG,{}):d.jsx(tG,{})}),K]})}L_.displayName="Controls";var z_=a.memo(L_);function eG({id:_,x:Q,y:J,width:q,height:U,style:G,color:Z,strokeColor:F,strokeWidth:X,className:Y,borderRadius:K,shapeRendering:H,selected:L,onClick:W}){let{background:B,backgroundColor:O}=G||{},T=Z||B||O;return d.jsx("rect",{className:j1(["react-flow__minimap-node",{selected:L},Y]),x:Q,y:J,rx:K,ry:K,width:q,height:U,style:{fill:T,stroke:F,strokeWidth:X},shapeRendering:H,onClick:W?(M)=>W(M,_):void 0})}var _Z=a.memo(eG),QZ=(_)=>_.nodes.map((Q)=>Q.id),x6=(_)=>_ instanceof Function?_:()=>_;function JZ({nodeStrokeColor:_,nodeColor:Q,nodeClassName:J="",nodeBorderRadius:q=5,nodeStrokeWidth:U,nodeComponent:G=_Z,onClick:Z}){let F=O1(QZ,S1),X=x6(Q),Y=x6(_),K=x6(J),H=typeof window>"u"||!!window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:F.map((L)=>d.jsx(qZ,{id:L,nodeColorFunc:X,nodeStrokeColorFunc:Y,nodeClassNameFunc:K,nodeBorderRadius:q,nodeStrokeWidth:U,NodeComponent:G,onClick:Z,shapeRendering:H},L))})}function $Z({id:_,nodeColorFunc:Q,nodeStrokeColorFunc:J,nodeClassNameFunc:q,nodeBorderRadius:U,nodeStrokeWidth:G,shapeRendering:Z,NodeComponent:F,onClick:X}){let{node:Y,x:K,y:H,width:L,height:W}=O1((B)=>{let O=B.nodeLookup.get(_);if(!O)return{node:void 0,x:0,y:0,width:0,height:0};let T=O.internals.userNode,{x:M,y:P}=O.internals.positionAbsolute,{width:A,height:R}=Y0(T);return{node:T,x:M,y:P,width:A,height:R}},S1);if(!Y||Y.hidden||!f6(Y))return null;return d.jsx(F,{x:K,y:H,width:L,height:W,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 qZ=a.memo($Z),UZ=a.memo(JZ),GZ=200,ZZ=150,FZ=(_)=>!_.hidden,HZ=(_)=>{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?R6(R2(_.nodeLookup,{filter:FZ}),Q):Q,rfId:_.rfId,panZoom:_.panZoom,translateExtent:_.translateExtent,flowWidth:_.width,flowHeight:_.height,ariaLabelConfig:_.ariaLabelConfig}},v9=(_,Q)=>_.x===Q.x&&_.y===Q.y&&_.width===Q.width&&_.height===Q.height,KZ=(_,Q)=>v9(_.viewBB,Q.viewBB)&&v9(_.boundingRect,Q.boundingRect)&&_.rfId===Q.rfId&&_.panZoom===Q.panZoom&&_.translateExtent===Q.translateExtent&&_.flowWidth===Q.flowWidth&&_.flowHeight===Q.flowHeight&&_.ariaLabelConfig===Q.ariaLabelConfig,XZ="react-flow__minimap-desc";function W_({style:_,className:Q,nodeStrokeColor:J,nodeColor:q,nodeClassName:U="",nodeBorderRadius:G=5,nodeStrokeWidth:Z,nodeComponent:F,bgColor:X,maskColor:Y,maskStrokeColor:K,maskStrokeWidth:H,position:L="bottom-right",onClick:W,onNodeClick:B,pannable:O=!1,zoomable:T=!1,ariaLabel:M,inversePan:P,zoomStep:A=1,offsetScale:R=5}){let f=v1(),C=a.useRef(null),{boundingRect:N,panZoom:S,viewBB:w,rfId:j,translateExtent:x,flowWidth:r,flowHeight:m,ariaLabelConfig:v}=O1(HZ,KZ),h=_?.width??GZ,V=_?.height??ZZ,E=N.width/h,u=N.height/V,D=Math.max(E,u),I=D*h,k=D*V,p=R*D,b=N.x-(I-N.width)/2-p,e=N.y-(k-N.height)/2-p,t=I+p*2,o=k+p*2,s=`${XZ}-${j}`,g=a.useRef(0),J1=a.useRef();g.current=D,a.useEffect(()=>{let B1=f.getState().panZoom;if(C.current&&B1)return J1.current=x7({domNode:C.current,panZoom:B1,getTransform:()=>f.getState().transform,getViewScale:()=>g.current}),()=>{J1.current?.destroy()}},[S]),a.useEffect(()=>{J1.current?.update({translateExtent:x,width:r,height:m,inversePan:P,pannable:O,zoomStep:A,zoomable:T})},[O,T,P,A,x,r,m]);let U1=W?(B1)=>{let[Y1,Q1]=J1.current?.pointer(B1)||[0,0];W(B1,{x:Y1,y:Q1})}:void 0,X1=a.useCallback((B1,Y1)=>{let Q1=f.getState().nodeLookup.get(Y1).internals.userNode;B?.(B1,Q1)},[B]),G1=B?X1:void 0,F1=M??v["minimap.ariaLabel"];return d.jsx(C0,{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 K==="string"?K:void 0,"--xy-minimap-mask-stroke-width-props":typeof H==="number"?H*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:j1(["react-flow__minimap",Q]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:h,height:V,viewBox:`${b} ${e} ${t} ${o}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":s,ref:C,onClick:U1,children:[F1&&d.jsx("title",{id:s,children:F1}),d.jsx(UZ,{onClick:G1,nodeColor:q,nodeStrokeColor:J,nodeBorderRadius:G,nodeClassName:U,nodeStrokeWidth:Z,nodeComponent:F}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${b-p},${e-p}h${t+p*2}v${o+p*2}h${-t-p*2}z
34
+ M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}W_.displayName="MiniMap";var B_=a.memo(W_),YZ=(_)=>(Q)=>_?`${Math.max(1/Q.transform[2],1)}`:void 0,LZ={[E0.Line]:"right",[E0.Handle]:"bottom-right"};function zZ({nodeId:_,position:Q,variant:J=E0.Handle,className:q,style:U=void 0,children:G,color:Z,minWidth:F=10,minHeight:X=10,maxWidth:Y=Number.MAX_VALUE,maxHeight:K=Number.MAX_VALUE,keepAspectRatio:H=!1,resizeDirection:L,autoScale:W=!0,shouldResize:B,onResizeStart:O,onResize:T,onResizeEnd:M}){let P=p6(),A=typeof _==="string"?_:P,R=v1(),f=a.useRef(null),C=J===E0.Handle,N=O1(a.useCallback(YZ(C&&W),[C,W]),S1),S=a.useRef(null),w=Q??LZ[J];a.useEffect(()=>{if(!f.current||!A)return;if(!S.current)S.current=i7({domNode:f.current,nodeId:A,getStoreItems:()=>{let{nodeLookup:x,transform:r,snapGrid:m,snapToGrid:v,nodeOrigin:h,domNode:V}=R.getState();return{nodeLookup:x,transform:r,snapGrid:m,snapToGrid:v,nodeOrigin:h,paneDomNode:V}},onChange:(x,r)=>{let{triggerNodeChanges:m,nodeLookup:v,parentLookup:h,nodeOrigin:V}=R.getState(),E=[],u={x:x.x,y:x.y},D=v.get(A);if(D&&D.expandParent&&D.parentId){let I=D.origin??V,k=x.width??D.measured.width??0,p=x.height??D.measured.height??0,b={id:D.id,parentId:D.parentId,rect:{width:k,height:p,...w6({x:x.x??D.position.x,y:x.y??D.position.y},{width:k,height:p},D.parentId,v,I)}},e=I4([b],v,h,V);E.push(...e),u.x=x.x?Math.max(I[0]*k,x.x):void 0,u.y=x.y?Math.max(I[1]*p,x.y):void 0}if(u.x!==void 0&&u.y!==void 0){let I={id:A,type:"position",position:{...u}};E.push(I)}if(x.width!==void 0&&x.height!==void 0){let k={id:A,type:"dimensions",resizing:!0,setAttributes:!L?!0:L==="horizontal"?"width":"height",dimensions:{width:x.width,height:x.height}};E.push(k)}for(let I of r){let k={...I,type:"position"};E.push(k)}m(E)},onEnd:({width:x,height:r})=>{let m={id:A,type:"dimensions",resizing:!1,dimensions:{width:x,height:r}};R.getState().triggerNodeChanges([m])}});return S.current.update({controlPosition:w,boundaries:{minWidth:F,minHeight:X,maxWidth:Y,maxHeight:K},keepAspectRatio:H,resizeDirection:L,onResizeStart:O,onResize:T,onResizeEnd:M,shouldResize:B}),()=>{S.current?.destroy()}},[w,F,X,Y,K,H,O,T,M,B]);let j=w.split("-");return d.jsx("div",{className:j1(["react-flow__resize-control","nodrag",...j,J,q]),ref:f,style:{...U,scale:N,...Z&&{[C?"backgroundColor":"borderColor"]:Z}},children:G})}var k9=a.memo(zZ);function A_({nodeId:_,isVisible:Q=!0,handleClassName:J,handleStyle:q,lineClassName:U,lineStyle:G,color:Z,minWidth:F=10,minHeight:X=10,maxWidth:Y=Number.MAX_VALUE,maxHeight:K=Number.MAX_VALUE,keepAspectRatio:H=!1,autoScale:L=!0,shouldResize:W,onResizeStart:B,onResize:O,onResizeEnd:T}){if(!Q)return null;return d.jsxs(d.Fragment,{children:[l7.map((M)=>d.jsx(k9,{className:U,style:G,nodeId:_,position:M,variant:E0.Line,color:Z,minWidth:F,minHeight:X,maxWidth:Y,maxHeight:K,onResizeStart:B,keepAspectRatio:H,autoScale:L,shouldResize:W,onResize:O,onResizeEnd:T},M)),c7.map((M)=>d.jsx(k9,{className:J,style:q,nodeId:_,position:M,color:Z,minWidth:F,minHeight:X,maxWidth:Y,maxHeight:K,onResizeStart:B,keepAspectRatio:H,autoScale:L,shouldResize:W,onResize:O,onResizeEnd:T},M))]})}var WZ=(_)=>_.domNode?.querySelector(".react-flow__renderer");function BZ({children:_}){let Q=O1(WZ);if(!Q)return null;return y9.createPortal(_,Q)}var AZ=(_,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,MZ=(_,Q)=>{if(_.size!==Q.size)return!1;for(let[J,q]of _)if(AZ(q,Q.get(J)))return!1;return!0},TZ=(_)=>({x:_.transform[0],y:_.transform[1],zoom:_.transform[2],selectedNodesCount:_.nodes.filter((Q)=>Q.selected).length});function l6({nodeId:_,children:Q,className:J,style:q,isVisible:U,position:G=Z1.Top,offset:Z=10,align:F="center",...X}){let Y=p6(),K=a.useCallback((f)=>{return(Array.isArray(_)?_:[_||Y||""]).reduce((S,w)=>{let j=f.nodeLookup.get(w);if(j)S.set(j.id,j);return S},new Map)},[_,Y]),H=O1(K,MZ),{x:L,y:W,zoom:B,selectedNodesCount:O}=O1(TZ,S1);if(!(typeof U==="boolean"?U:H.size===1&&H.values().next().value?.selected&&O===1)||!H.size)return null;let M=R2(H),P=Array.from(H.values()),A=Math.max(...P.map((f)=>f.internals.z+1)),R={position:"absolute",transform:C7(M,{x:L,y:W,zoom:B},G,Z,F),zIndex:A,...q};return d.jsx(BZ,{children:d.jsx("div",{style:R,className:j1(["react-flow__node-toolbar",J]),...X,"data-id":P.reduce((f,C)=>`${f}${C.id} `,"").trim(),children:Q})})}var c1=r1(O0(),1);var M_={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 z1=r1(u5(),1),OZ="https://brand.volter.ai/logo/twin-world/svg?size=64&variant=mono";function b5({href:_,onClick:Q}){return z1.jsxDEV("h1",{children:z1.jsxDEV("a",{href:_,onClick:Q,children:[z1.jsxDEV("img",{src:OZ,alt:"",width:24,height:24,style:{verticalAlign:"middle"}},void 0,!1,void 0,this),z1.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 m0(_){return(await _.json().catch(()=>({}))).error??`answered ${_.status}`}function R_(_,Q,J=0,q=""){let[U,G]=c1.useState({state:"loading"});return c1.useEffect(()=>{G({state:"loading"})},[q,Q]),c1.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 m0(F)};if(Z)G(X)}catch(F){if(Z)G({state:"error",status:0,error:String(F)})}})(),()=>{Z=!1}},[q,Q,J]),U}function s1({load:_,what:Q,retry:J,lines:q=3}){if(_.state==="loading")return z1.jsxDEV(IZ,{lines:q,label:`Loading ${Q}…`},void 0,!1,void 0,this);if(_.state==="error")return z1.jsxDEV("div",{role:"alert",className:"error-state",children:[z1.jsxDEV("span",{children:["Could not read ",Q,": ",_.error]},void 0,!0,void 0,this),J?z1.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 IZ({lines:_=3,label:Q="Loading…"}){return z1.jsxDEV("div",{className:"skeleton",role:"status","aria-label":Q,children:Array.from({length:_},(J,q)=>z1.jsxDEV("span",{style:{width:`${[92,76,84,64,88][q%5]}%`}},q,!1,void 0,this))},void 0,!1,void 0,this)}function P1({iso:_,time:Q}){if(!_)return z1.jsxDEV("span",{children:"—"},void 0,!1,void 0,this);let J=new Date(_);return z1.jsxDEV("time",{dateTime:_,title:_,children:Number.isNaN(J.getTime())?_:Q?J.toLocaleTimeString():J.toLocaleString()},void 0,!1,void 0,this)}var a2=(_)=>_?new Date(_).toLocaleString():"—";function d6(_){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 f2=(_)=>_.length<=1?_.join(""):`${_.slice(0,-1).join(", ")} and ${_[_.length-1]}`,fZ={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"},W1=(_)=>fZ[_]??_.charAt(0).toUpperCase()+_.slice(1);function h1({vendor:_}){let Q=M_[_];return z1.jsxDEV("span",{className:Q?"mark logo":"mark","aria-hidden":"true",children:Q?z1.jsxDEV("svg",{viewBox:"0 0 24 24",children:z1.jsxDEV("path",{d:Q.d,fill:Q.fill},void 0,!1,void 0,this)},void 0,!1,void 0,this):W1(_).charAt(0)},void 0,!1,void 0,this)}var T_=(_)=>{_.currentTarget.closest("details")?.removeAttribute("open")},wZ="volter.theme",a6=()=>{try{let _=localStorage.getItem(wZ);return _==="light"||_==="dark"?_:"system"}catch{return"system"}};function O_(_=a6()){let Q=document.documentElement;if(_==="system")Q.removeAttribute("data-theme");else Q.setAttribute("data-theme",_)}function I_(){return c1.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 U0({open:_,onClose:Q,title:J,children:q,footer:U,wide:G}){let Z=c1.useRef(null),F=c1.useId();return c1.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()},[_]),z1.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:_?z1.jsxDEV(z1.Fragment,{children:[z1.jsxDEV("div",{className:"dialog-head",children:[z1.jsxDEV("h2",{id:F,children:J},void 0,!1,void 0,this),z1.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),z1.jsxDEV("div",{className:"dialog-body",children:q},void 0,!1,void 0,this),U?z1.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 r6="volter:confirm";function S0(_){return new Promise((Q)=>{window.dispatchEvent(new CustomEvent(r6,{detail:{ask:_,resolve:Q}}))})}function f_(){let[_,Q]=c1.useState(null),[J,q]=c1.useState("");c1.useEffect(()=>{let F=(X)=>{q(""),Q(X.detail)};return window.addEventListener(r6,F),()=>window.removeEventListener(r6,F)},[]);let U=(F)=>{_?.resolve(F),Q(null)},G=_?.ask,Z=!G?.typed||J===G.typed;return z1.jsxDEV(U0,{open:Boolean(_),onClose:()=>U(!1),title:G?.title??"",footer:z1.jsxDEV(z1.Fragment,{children:[z1.jsxDEV("button",{type:"button",onClick:()=>U(!1),children:"Cancel"},void 0,!1,void 0,this),z1.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?z1.jsxDEV("div",{className:"confirm-body",children:G.body},void 0,!1,void 0,this):null,G?.typed?z1.jsxDEV("div",{className:"typed-confirm",children:[z1.jsxDEV("p",{children:["Type ",z1.jsxDEV("code",{children:G.typed},void 0,!1,void 0,this)," to confirm."]},void 0,!0,void 0,this),z1.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 i6="volter:toast";function V1(_,Q="ok"){window.dispatchEvent(new CustomEvent(i6,{detail:{text:_,kind:Q}}))}function w_(){let[_,Q]=c1.useState([]);return c1.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(i6,q),()=>window.removeEventListener(i6,q)},[]),z1.jsxDEV("div",{className:"toasts",role:"region","aria-label":"Notifications",children:_.map((J)=>z1.jsxDEV("div",{className:`toast ${J.kind}`,role:J.kind==="error"?"alert":"status",children:[z1.jsxDEV("span",{children:J.text},void 0,!1,void 0,this),z1.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 s6({value:_,label:Q,secret:J}){let[q,U]=c1.useState(!1);return z1.jsxDEV("div",{className:"copy-field",children:[Q?z1.jsxDEV("span",{className:"copy-label",children:Q},void 0,!1,void 0,this):null,z1.jsxDEV("div",{className:"copy-row",children:[z1.jsxDEV("input",{readOnly:!0,value:_,"aria-label":Q??"Value",onFocus:(Z)=>Z.currentTarget.select(),spellCheck:!1},void 0,!1,void 0,this),z1.jsxDEV("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>{U(!0),setTimeout(()=>U(!1),1600),V1(J?"Copied. Keep it somewhere safe":"Copied")}).catch(()=>V1("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 P_({label:_,items:Q}){return z1.jsxDEV("details",{className:"menu row-menu",children:[z1.jsxDEV("summary",{className:"icon-button",role:"button","aria-haspopup":"menu","aria-label":_,title:_,children:"⋯"},void 0,!1,void 0,this),z1.jsxDEV("div",{className:"popover menu-list",role:"menu",children:Q.filter((J)=>Boolean(J)).map((J)=>J.href?z1.jsxDEV("a",{role:"menuitem",href:J.href,className:J.danger?"danger-item":void 0,onClick:T_,children:J.label},J.label,!1,void 0,this):z1.jsxDEV("button",{type:"button",role:"menuitem",disabled:J.disabled,className:J.danger?"danger-item":void 0,onClick:(q)=>{T_(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 s2({title:_,children:Q,action:J}){return z1.jsxDEV("div",{className:"empty-state",children:[z1.jsxDEV("p",{className:"empty-title",children:_},void 0,!1,void 0,this),Q?z1.jsxDEV("div",{className:"empty-body",children:Q},void 0,!1,void 0,this):null,J?z1.jsxDEV("div",{className:"empty-action",children:J},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function N_(){return c1.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")PZ()};return document.addEventListener("click",_),document.addEventListener("keydown",Q),()=>{document.removeEventListener("click",_),document.removeEventListener("keydown",Q)}},[]),z1.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 PZ=()=>{document.querySelector("main.app")?.removeAttribute("data-drawer")};function j4(_={}){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 C_={"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 $=r1(u5(),1),u4="volter.console.token",E5=document.getElementById("root"),A1=E5.dataset.base??"/-/console",f1=window.location.origin,J2=(E5.dataset.worlds??f1).replace(/\/+$/,""),h_=(E5.dataset.names??"").split(",").filter((_)=>_!==""),_2=E5.dataset.worldOrigin==="1",S2=window.fetch.bind(window),Q2="(session)",D_="(pass)",h5=(_)=>{try{if(_&&!_2)sessionStorage.setItem(u4,_);else sessionStorage.removeItem(u4);localStorage.removeItem(u4)}catch{}},E_="volter.console.portal",x_=(_)=>{try{if(typeof _==="string"&&/^https?:$/.test(new URL(_).protocol))sessionStorage.setItem(E_,new URL(_).origin)}catch{}},NZ=()=>{return v2.get("token")??""},t1=()=>{try{let _=sessionStorage.getItem(E_)??"";return _&&/^https?:$/.test(new URL(_).protocol)?new URL(_).origin:""}catch{return""}},CZ=()=>{let _=NZ();if(_2){if(h5(""),v2.get("pass"))return D_;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?"":Q2)}if(_)return h5(_),_;try{return sessionStorage.getItem(u4)??""}catch{return""}};function x1(_){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: ${f2(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 ${W1(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(W1);return{text:`${f2(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 G0=async(_)=>x1(await m0(_)).text,SZ={vault:["vault","Open Vault"],remote:["remote","Open Remote"],settings:["settings/services","Open Real services"]};function m_({name:_,acts:Q}){let J=Q.map((q)=>SZ[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:`${A1}/${_}/~/${q}`,onClick:(G)=>{G.preventDefault(),w1([..._.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 S2(`${f1}${Q}`,{...J,headers:{...J.headers??{},..._===Q2?{}:{"x-volter-token":_},...J.body&&!J.headers?.["content-type"]?{"content-type":"application/json"}:{}}})}function N1(_,Q,J=0){let q=R_((U)=>I1(_,U),Q,J,_);return q.state==="error"?{...q,error:x1(q.error).text}:q}var n2=(_)=>{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())}`},S_=(_)=>new Date(Math.ceil(Date.parse(_)/60000)*60000).toISOString(),g_=(_)=>_.operation==="observed"?`observed${_.provenance==="placeholder"?" (default data)":" (vendor)"}`:_.receipt?`${_.receipt.status??""} ${_.receipt.externalId??""} ${_.receipt.reason??""}`.trim():_.provenance==="placeholder"?"default data":"unpushed",vZ=(_)=>{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},e6="volter.console.snapshots",p0=()=>{try{return JSON.parse(sessionStorage.getItem(e6)??"{}")}catch{return{}}},p_=new Map,_8=(_)=>{if(_2){if(_.token||_.readToken)p_.set(_.name,{token:_.token,readToken:_.readToken});_={..._,token:"",readToken:""}}try{sessionStorage.setItem(e6,JSON.stringify({...p0(),[_.name]:_}))}catch{}},Q8=(_)=>p_.get(_)?.readToken||p0()[_]?.readToken||"",b4=(_)=>{try{let Q=p0();delete Q[_],sessionStorage.setItem(e6,JSON.stringify(Q))}catch{}},v2=new URLSearchParams(window.location.hash.slice(1)),t2=v2.get("close")??"";function e2(_){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 J8(_){let Q=e2(_);if(!Q)return null;let J=new URL(f1);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 kZ(_){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:J8(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 _=v2.get("snapshot");if(_){let Q=kZ(_);if(Q&&!p0()[Q.name])_8(Q)}}var c_="volter.console.home",l_=(_)=>{let Q=e2(_);if(!Q)return null;let J=new URL(f1).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 _=l_(v2.get("home"));if(_)try{sessionStorage.setItem(c_,_)}catch{}}if(["token","pass","portal","snapshot","home","close"].some((_)=>v2.has(_)))try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}var R0=()=>{try{return l_(sessionStorage.getItem(c_))??""}catch{return""}};function $8(_,Q,J,q){let U=new URLSearchParams({token:Q,home:R0()||f1}),G=p0()[J];if(G)U.set("snapshot",JSON.stringify(G));window.location.replace(`${_}${q??`${window.location.pathname}${window.location.search}`}#${U.toString()}`)}var D4=E5.dataset.route==="memory"?"":null;function eA(_){D4=_,window.dispatchEvent(new PopStateEvent("popstate"))}function P2(){return(D4??window.location.pathname.slice(A1.length)).split("/").filter(Boolean).map((_)=>{try{return decodeURIComponent(_)}catch{return""}})}var v_=/^[a-z0-9](?:[a-z0-9]|-(?!-))*$/i,g0=(_,Q)=>_&&Q&&v_.test(_)&&v_.test(Q)?`${_}/${Q}`:"";function w1(_){let Q=`/${_.map(encodeURIComponent).join("/")}`;if(D4!==null)D4=Q;else window.history.pushState(null,"",`${A1}${Q}`);window.dispatchEvent(new PopStateEvent("popstate"))}function r_(_,Q){let J=J8(p0()[_]?.origin);if(J&&J!==f1){$8(J,Q8(_),_,`${A1}/${Q.map(encodeURIComponent).join("/")}`);return}w1(Q)}async function k_(){let[_,Q]=P2(),J=g0(_,Q),q=J?[J]:h_;if(q.length===0){let U=await S2(`${f1}/-/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&&g0(G,Z)===U});for(let U of q){let G=await S2(`${f1}/-/${U}/session`,{method:"POST"}).catch(()=>null);if(!G)continue;let Z=await G.json().catch(()=>({})),F=e2(Z.origin)?.origin;if(G.status===409&&F&&F!==f1)return window.location.replace(`${F}${A1}/${U}`),"moved";if(G.ok&&Z.local)return{token:typeof Z.token==="string"&&Z.token?Z.token:Q2}}return null}function yZ(){let[_,Q]=i.useState(a6),J=(q)=>()=>{try{if(q==="system")localStorage.removeItem("volter.theme");else localStorage.setItem("volter.theme",q)}catch{}O_(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 jZ(){let[_,Q]=i.useState(CZ()),[J,q]=i.useState(!1),[U,G]=i.useState(!1),[Z,F]=i.useState(""),[X,Y]=i.useState(null),[K,H]=i.useState(null),[L,W]=i.useState(P2());i.useEffect(()=>{let k=()=>W(P2());return window.addEventListener("popstate",k),()=>window.removeEventListener("popstate",k)},[]),i.useEffect(()=>{let[k,p]=P2(),b=g0(k,p),[e,t]=b?b.split("/"):[],o=p0()[t2];if(!t2||!_||!e||!t||!o?.made||o.parent!==`${e}/${t}`||g0(...t2.split("/"))!==t2)return;try{window.history.replaceState(null,"",window.location.pathname+window.location.search)}catch{}I1(_,`/-/${e}/${t}/branches/${t2}`,{method:"DELETE"}).catch(()=>null).then(()=>b4(t2))},[_]);let B=i.useCallback(async(k)=>{if(H(null),!k){let t=await k_();if(t==="moved")return;if(t){if(q(!0),t.token!==Q2)h5(t.token);Q(t.token);return}Y(null),G(!0);return}if(_2&&k===Q2){let t=await k_();if(t==="moved")return;if(t)q(!0)}if(_2&&k===D_){let[t,o]=P2(),s=g0(t,o),[g,J1]=s?s.split("/"):[],U1=g&&J1?await S2(`${f1}/-/${g}/${J1}/session`,{method:"POST",headers:{"x-volter-pass":v2.get("pass")??""}}).catch(()=>null):null;if(!U1){H(`${f1} did not answer: no session was opened`),Y(null);return}if(!U1.ok){H(`${await G0(U1)}. Open it again from the platform.`),Y(null);return}x_((await U1.json().catch(()=>({}))).issuer),Q(Q2);return}if(_2&&k!==Q2){let[t,o]=P2(),s=g0(t,o),[g,J1]=s?s.split("/"):[],U1=g&&J1?await S2(`${f1}/-/${g}/${J1}/session`,{method:"POST",headers:{"x-volter-token":k}}).catch(()=>null):null;if(!U1){H(`${f1} did not answer: no session was opened`),Y(null);return}if(!U1.ok){let X1=await G0(U1);H(U1.status===401||U1.status===403?`That token does not open ${g}/${J1}.`:U1.status===409?`${g}/${J1}'s session lives at another origin: ${X1}`:`The World could not open a session (${U1.status}): ${X1}`),Y(null);return}Q(Q2);return}let p=_2?new Response(null,{status:404}):await I1(k,"/-/worlds");if(p.ok){let{worlds:t}=await p.json();Y({kind:"admin",worlds:t});return}if(p.status===429){H("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(()=>({}));H(`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 b=h_;if(b.length===0){let t=await S2(`${f1}/-/ping`);if(!t.ok){H(`${f1} does not answer as a host`),Y(null);return}if(b=(await t.json()).worlds??[],b.length===0){H(`${f1} does not list its Worlds: open a World at its own address, ${f1}${A1}/<org>/<world>`),Y(null);return}}let e=[];for(let t of b){let o=await I1(k,`/-/${t}/twins`);if(o.ok){let s=await o.json();e.push({name:t,base:`${J2}/${t}`,twins:(s.twins??[]).map((g)=>({vendor:g.twin,protocol:g.protocol??null,root:g.root??null}))})}}if(e.length===0){H("This link or key opens no World here: it was revoked, or it has ended."),Y(null);return}Y({kind:"world",worlds:e})},[]);i.useEffect(()=>{B(_)},[_,B]);let O=(k)=>X?.kind==="admin"?X.worlds.find((p)=>p.name===k)?.token??_:_,[T,M]=i.useState("");if(!_||!X&&!K)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(b5,{href:`${A1}/`},void 0,!1,void 0,this),_&&!X&&!K||!_&&!U?$.jsxDEV("p",{className:"mode",children:"Opening…"},void 0,!1,void 0,this):$.jsxDEV("form",{onSubmit:(k)=>{k.preventDefault(),h5(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:(k)=>F(k.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 P=()=>{if(J){window.location.reload();return}if(_2){let[k,p]=P2(),b=g0(k,p),[e,t]=b?b.split("/"):[],o=()=>window.location.replace(t1()?`${t1()}/`:`${f1}${A1}/${e&&t?`${e}/${t}`:""}?signin`);if(setTimeout(o,2000),e&&t)S2(`${f1}/-/${e}/${t}/session/end`,{method:"POST"}).catch(()=>null).then(o);else o();return}if(X)for(let k of X.worlds)navigator.sendBeacon(`${k.base.replace(/\/[^/]+\/[^/]+$/,"")}/-/${k.name}/session/end`);h5(""),Q(""),F(""),Y(null),w1([])};if(K||!X)return $.jsxDEV("main",{className:"app gate",children:$.jsxDEV("div",{className:"gate-window",children:[$.jsxDEV(b5,{href:`${A1}/`},void 0,!1,void 0,this),$.jsxDEV("h2",{children:"Could not open it"},void 0,!1,void 0,this),$.jsxDEV("p",{role:"alert",children:K??"nothing answered"},void 0,!1,void 0,this),t1()?$.jsxDEV("a",{className:"button primary",href:`${t1()}/`,children:["Back to ",new URL(t1()).host]},void 0,!0,void 0,this):$.jsxDEV("button",{type:"button",className:"primary",onClick:P,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,f,C,N,S,w]=L,j=f==="~",x=/^[A-Za-z0-9_-]+$/,r=/^[^\u0000-\u001f\u007f]{1,200}$/,m=j||!f||!x.test(f)?void 0:f,v=N&&x.test(N)?S!==void 0&&C!=="changes"&&C!=="screens"?g0(N,S)||void 0:N:void 0,h=C==="changes"&&N==="changesets"&&S&&x.test(S)?S:C==="screens"&&S&&w&&/^[A-Za-z0-9_.-]+$/.test(S)&&r.test(w)?`${S}:${w}`:void 0,V=g0(A,R),E=V?p0()[V]??null:null,u=(k)=>Q8(k)||O(k),D=E?X.kind==="admin"?X.worlds.find((k)=>k.name===E.parent)?.token??null:X.worlds.some((k)=>k.name===E.parent)?_:null:null,I=async(k)=>{let p=J8(k.parentOrigin);if(p&&p!==f1){b4(k.name),window.location.assign(`${p}${A1}/${k.parent}#close=${encodeURIComponent(k.name)}`);return}if(k.made)await I1(O(k.parent),`/-/${k.parent}/branches/${k.name}`,{method:"DELETE"}).catch(()=>null),b4(k.name);w1(k.parent.split("/"))};return $.jsxDEV("main",{className:V?"app workspace":"app home",children:[V?null:$.jsxDEV("header",{children:[V?$.jsxDEV(N_,{},void 0,!1,void 0,this):null,$.jsxDEV(b5,{href:`${R0()&&R0()!==f1?R0():""}${A1}/`,onClick:(k)=>{if(R0()&&R0()!==f1)return;k.preventDefault(),w1([])}},void 0,!1,void 0,this),$.jsxDEV("nav",{"aria-label":"breadcrumb",className:"crumbs",children:[V?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"crumb-sep","aria-hidden":"true",children:"/"},void 0,!1,void 0,this),$.jsxDEV("span",{children:V.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:`${A1}/${V}`,className:"crumb-world",onClick:(k)=>{k.preventDefault(),w1(V.split("/"))},children:V.split("/")[1]},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,m?$.jsxDEV("span",{children:[" / ",m]},void 0,!0,void 0,this):null,j&&C==="trace"?$.jsxDEV("span",{children:" / trace"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),t1()?$.jsxDEV("a",{href:`${t1()}/${V?encodeURIComponent(V.split("/")[0]):""}`,title:`Back to the platform at ${new URL(t1()).host}`,className:"back-link",children:["← ",$.jsxDEV("span",{className:"back-text",children:V?`${V.split("/")[0]}'s Worlds`:new URL(t1()).host},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,V?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),V||J?null:$.jsxDEV("button",{onClick:P,children:"Sign out"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),V?$.jsxDEV(hZ,{name:V,token:u(V),twin:m,tab:j?C??"overview":"overview",arg:j?v:void 0,...j&&h?{sub:h}:{},admin:E?null:X.kind==="admin"?_:null,snapshot:E,parentToken:D,who:{local:J,person:T||null,admin:X.kind==="admin"},onSignOut:P,onReturn:I,opens:(k)=>!!p0()[k]||X.kind==="admin"&&X.worlds.some((p)=>p.name===k),onRemoved:()=>{B(_),w1([])},onWho:M,worlds:X.worlds.map((k)=>k.name)},V,!1,void 0,this):$.jsxDEV(VZ,{mode:X,admin:X.kind==="admin"?_:null,reload:()=>B(_)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function VZ({mode:_,admin:Q,reload:J}){let[q,U]=i.useState(""),[G,Z]=i.useState(""),[F,X]=i.useState(""),[Y,K]=i.useState(null),H=async(N)=>{if(!await S0({title:`Rotate the tokens of ${N}?`,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 S=await I1(Q,`/-/worlds/${N}/rotate`,{method:"POST"}),w=await S.json().catch(()=>({}));K(S.ok?`rotated ${N}: the new tokens are shown once — token ${w.token} · read token ${w.readToken}`:w.error?x1(w.error).text:`answered ${S.status}`),await J()},L=async(N)=>{let S=await I1(Q,`/-/worlds/${N}`,{method:"DELETE"}),w=await S.json().catch(()=>({}));K(S.ok?`removed ${N}`:w.error?x1(w.error).text:`answered ${S.status}`),await J()},[W,B]=i.useState(!1),[O,T]=i.useState(!1),[M,P]=i.useState(""),A=async(N)=>{N.preventDefault(),K(null),B(!0);try{let S=await I1(Q,"/-/worlds",{method:"POST",body:JSON.stringify({org:q,world:G,vendors:F.split(",").map((j)=>j.trim()).filter(Boolean)})}),w=await S.json();if(!S.ok){K(w.error?x1(w.error).text:`the host answered ${S.status}`);return}K(`provisioned ${w.name}`),Z(""),X(""),T(!1),await J()}finally{B(!1)}},R=M.trim().toLowerCase(),f=_.worlds.filter((N)=>!R||N.name.toLowerCase().includes(R)||N.twins.some((S)=>S.vendor.includes(R))),C=[...new Set(f.map((N)=>N.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:()=>{K(null),T(!0)},children:[$.jsxDEV(R1,{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:M,onChange:(N)=>P(N.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((N)=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("p",{className:"menu-label home-org",children:N},void 0,!1,void 0,this),$.jsxDEV("ul",{className:"home-list",children:f.filter((S)=>S.name.split("/")[0]===N).map((S)=>$.jsxDEV("li",{children:[$.jsxDEV("a",{href:`${A1}/${S.name}`,onClick:(w)=>{w.preventDefault(),w1(S.name.split("/"))},children:[$.jsxDEV(R1,{name:"globe",size:20},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:S.name.split("/")[1]},void 0,!1,void 0,this),$.jsxDEV("small",{children:$.jsxDEV("code",{children:S.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:S.twins.map((w)=>$.jsxDEV("span",{title:W1(w.vendor),children:$.jsxDEV(h1,{vendor:w.vendor},void 0,!1,void 0,this)},w.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 ${S.name}`,children:"⋯"},void 0,!1,void 0,this),$.jsxDEV("div",{className:"popover menu-list",children:[$.jsxDEV("button",{type:"button",onClick:(w)=>{w.currentTarget.closest("details")?.removeAttribute("open"),H(S.name)},children:"Rotate tokens…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"danger-item",onClick:(w)=>{w.currentTarget.closest("details")?.removeAttribute("open"),S0({title:`Remove ${S.name}?`,body:"The host stops serving it and its whole history goes with it. This cannot be undone.",action:"Remove World",danger:!0,typed:S.name}).then((j)=>{if(j)L(S.name)})},children:"Remove World…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},S.name,!0,void 0,this))},void 0,!1,void 0,this)]},N,!0,void 0,this)),f.length===0?$.jsxDEV("p",{className:"mode home-note",children:R?`No World matches ${M}.`:"No Worlds here yet."},void 0,!1,void 0,this):null,$.jsxDEV(U0,{open:O,onClose:()=>{if(!W)T(!1)},title:"New World",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>T(!1),disabled:W,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"provision",className:"primary",disabled:W,children:W?"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:(N)=>U(N.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:(N)=>Z(N.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:(N)=>X(N.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 uZ=["changes","events","trace","vendors","screens","canvas","branches","settings","remote","vault"],bZ=(_,Q)=>{let J=Q?.screens?.find((q)=>q.path.replace(/\/+$/,"")==="")??Q?.screens?.find((q)=>!/[{<]/.test(q.path));return Q&&J?`${J2}/${_}/${Q.twin}${J.path.startsWith("/")?J.path:`/${J.path}`}`:null},y_={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 L0(_){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`:y_[J]?`${U} ${y_[J]}`:`${Z.charAt(0).toUpperCase()}${Z.slice(1)}`,X=_.fields??{},Y=["title","name","email","text","subject","summary","description"].map((H)=>X[H]).find((H)=>typeof H==="string"&&H.trim()!=="")??null,K=Y===null?null:Y.replace(/<([@#!])[^|>]*\|([^>]+)>/g,(H,L,W)=>`${L==="!"?"@":L}${W}`).replace(/<(?:https?:[^|>]+)\|([^>]+)>/g,"$1").replace(/<(https?:[^>]+)>/g,"$1");return{what:F,label:K===null?null:K.length>80?`${K.slice(0,79)}…`:K}}var c0=(_)=>/token|password|secret|key|credential/i.test(_.subject.type)&&_.subject.id.length>6?`••••${_.subject.id.slice(-4)}`:_.subject.id;function hZ({name:_,token:Q,twin:J,tab:q,arg:U,sub:G,admin:Z,snapshot:F,parentToken:X,who:Y,onSignOut:K,onReturn:H,opens:L,onRemoved:W,onWho:B,worlds:O=[]}){let[T,M]=i.useState("pending"),[P,A]=i.useState(null),[R,f]=i.useState(0),[C,N]=i.useState(null);i.useEffect(()=>{let s=!0;return A(null),I1(Q,`/-/${_}/session`,{method:"POST"}).then(async(g)=>{let J1=await g.json().catch(()=>({}));if(x_(J1.issuer),J1.who)B?.(J1.who);N(typeof J1.signsAs==="string"?J1.signsAs:null);let U1=e2(J1.origin)?.origin;if(g.status===409&&U1&&U1!==f1){$8(U1,Q,_);return}if(!s)return;if(M(!g.ok?"unknown":J1.scope==="read"?"read":J1.scope==="write"?"write":"unknown"),!g.ok)A(J1.error?x1(J1.error).text:`answered ${g.status}`)}).catch((g)=>{if(s)M("unknown"),A(`the World did not answer: ${g instanceof Error?g.message:String(g)}`)}),()=>{s=!1}},[_,Q,R]);let S=P?{state:"error",error:P}:T==="pending"?{state:"pending"}:{state:"ok",scope:T},w=T==="write",j=(s)=>{if(s.status!==403)return;s.clone().json().then((g)=>{if(/read token|opens only reads|write access|reads only/i.test(g?.error??""))M("read")},()=>null)},[x,r]=i.useState(0);i.useEffect(()=>{let s=setInterval(()=>{if(!document.hidden)r((g)=>g+1)},5000);return()=>clearInterval(s)},[]);let[m,v]=i.useState(0),h=N1(Q,`/-/${_}/clock`,x+m),V=N1(Q,`/-/${_}/twins`),E=N1(Q,`/-/${_}/branches`,m),u=N1(Q,`/-/${_}/map`,Math.floor(x/2)),D=!(E.state==="error"&&(E.status===404||E.status===405)),I=uZ.includes(q)?q:"overview",k=V.state==="ok"?V.data.twins.map((s)=>s.twin):[];if(J&&V.state==="ok"&&!k.includes(J))return $.jsxDEV("main",{className:"center",children:$.jsxDEV(s2,{title:`${_} has no ${J}`,action:$.jsxDEV("a",{href:`${A1}/${_}`,onClick:(s)=>{s.preventDefault(),w1(_.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=I==="vendors"&&U?U:void 0,b=()=>{M("pending"),f((s)=>s+1)};if(I==="canvas"||I==="vendors"&&!p||q==="screens"&&!U)return $.jsxDEV(XF,{name:_,token:Q,twins:V,session:S,retry:b,snapshot:F,back:()=>w1(_.split("/")),canWrite:w&&!F},void 0,!1,void 0,this);let t=q==="settings"?{kind:"settings",tab:((s)=>i_.find(([g])=>g===s)?.[0]??"account")(U)}:q==="remote"?{kind:"settings",tab:"remote"}:q==="vault"?{kind:"settings",tab:"vault"}:q==="branches"?{kind:"branches",...U?{open:U}:{}}:null,o=J?"vendor":q==="screens"&&U?"screen":I==="vendors"&&p?"vendor":q==="trace"?"trace":q==="events"?"events":q==="changes"&&U==="changesets"?"history":"changes";return $.jsxDEV(iZ,{name:_,token:Q,view:o,win:t,who:Y,snapshot:F,onReturn:H,onSignOut:K,worlds:O,session:S,retry:b,...o==="vendor"?{arg:J??p}:o==="events"||o==="trace"||o==="screen"?U?{arg:U}:{}:{},...G?{sub:G}:{},twins:V,map:u,branches:D?E:null,clock:h,canWrite:w&&!F,refused:j,signsAs:C,opens:L,tick:x,admin:Z,onRemoved:W,onClock:()=>v((s)=>s+1),scope:F?"read":T},void 0,!1,void 0,this)}function R1({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:(C_[_]??[]).map(([J,q],U)=>i.default.createElement(J,{key:U,...q}))},void 0,!1,void 0,this)}function E4(_){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 i_=[["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"]],DZ=(_,Q)=>{let J=Q.split("/").pop()??Q,q=_.split("/").pop()??"";return J.startsWith(`${q}-`)?J.slice(q.length+1):J},N2=(_)=>_.replace(/^_+/,"").replace(/[_-]+/g," ");function d_({record:_,history:Q}){let J=_.writes[_.writes.length-1],q=L0(J),U=E4(_.writes),G=new Set(_.writes.map((H)=>H.id)),Z=_.writes[0].occurredAt,F={};if(Q){for(let H of Q)if(!G.has(H.id)&&!H.landsId&&!H.aliasOf&&H.subject.type===J.subject.type&&H.subject.id===J.subject.id&&H.occurredAt<=Z)Object.assign(F,H.fields??{})}let X={...F};for(let H of _.writes)Object.assign(X,H.fields??{});let Y=U.tone==="added"&&Object.keys(F).length===0,K=[...new Set([...Object.keys(F),...Object.keys(X)])].filter((H)=>!UQ(F[H],X[H]));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(R1,{name:U.icon,size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(h1,{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:[W1(_.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((H)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:L0(H).what},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(P1,{iso:H.occurredAt},void 0,!1,void 0,this)," · ",D5(H)]},void 0,!0,void 0,this)]},H.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):K.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:K.map((H)=>$.jsxDEV("tr",{children:[$.jsxDEV("th",{scope:"row",children:$.jsxDEV("code",{children:H},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y?null:$.jsxDEV("td",{className:H in F?"was":"none",children:H in F?$.jsxDEV(l0,{v:F[H]},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:H in X?"now":"none",children:H in X?$.jsxDEV(l0,{v:X[H]},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},H,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function a_({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,K)=>{let H=Y.writes[Y.writes.length-1],L=L0(H),W=E4(Y.writes);return $.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:[Q===Y.key?"on":"",K?"nested":""].join(" ").trim()||void 0,"aria-pressed":Q===Y.key,onClick:()=>J(Y.key),children:[K?null:$.jsxDEV(h1,{vendor:Y.twin},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:L.label??c0(H)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[N2(H.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 ${W.tone}`,title:W.word,"aria-label":W.word,children:$.jsxDEV(R1,{name:W.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 K=_.filter((H)=>H.twin===Y);return $.jsxDEV("li",{className:"ws-group",children:[$.jsxDEV("p",{className:"ws-group-head",children:[$.jsxDEV(h1,{vendor:Y},void 0,!1,void 0,this),$.jsxDEV("b",{children:W1(Y)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:K.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:K.map((H)=>F(H,!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 EZ({name:_,token:Q,branches:J,opens:q,refused:U,onChanged:G}){let[Z,F]=i.useState(""),[X,Y]=i.useState(!1),K=J?.state==="ok"&&J.data.checkedOut||_.split("/")[1],H=J?.state==="ok"&&J.data.named?.length?J.data.named:[{name:K,running:!0}],L=J?.state==="ok"?J.data.branches:[],W=Z.trim().toLowerCase(),B=(T)=>!W||T.toLowerCase().includes(W),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(R1,{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:K},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(R1,{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:H.filter((T)=>B(T.name)).map((T)=>$.jsxDEV("li",{className:T.name===K?"current":void 0,children:[$.jsxDEV("span",{className:"tick",children:T.name===K?$.jsxDEV(R1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(R1,{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===K?"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)=>B(T.name)).map((T)=>{let M=$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"tick",children:$.jsxDEV(R1,{name:"git-branch",size:16},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"name",children:DZ(_,T.name)},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:T.at?.instant?$.jsxDEV($.Fragment,{children:["as of ",$.jsxDEV(P1,{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),P=T.expiresAt?`Goes away ${new Date(T.expiresAt).toLocaleString()}`:"Kept";return $.jsxDEV("li",{children:q(T.name)?$.jsxDEV("a",{href:`${A1}/${T.name}`,title:P,onClick:(A)=>{A.preventDefault(),O(A),r_(T.name,T.name.split("/"))},children:M},void 0,!1,void 0,this):$.jsxDEV("span",{title:`${P}. Its tokens went to whoever made it; it opens from their page.`,children:M},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:`${A1}/${_}/~/branches`,onClick:(T)=>{T.preventDefault(),O(T),w1([..._.split("/"),"~","branches"])},children:"Manage branches…"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(o_,{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 s_({name:_,view:Q,changes:J,changesets:q}){let U=(G)=>(Z)=>{Z.preventDefault(),w1([..._.split("/"),"~",...G])};return $.jsxDEV("nav",{className:"tabs ws-pane-tabs","aria-label":"Changes and history",children:[$.jsxDEV("a",{href:`${A1}/${_}/~/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:`${A1}/${_}/~/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 xZ({name:_,token:Q,sets:J,sub:q,signsAs:U,canWrite:G,rooted:Z,refused:F,onChanged:X,changes:Y,withScreens:K,required:H}){let[L,W]=i.useState(null),[B,O]=i.useState(!1),T=J.state==="ok"?[...J.data.changesets].sort((S,w)=>w.createdAt.localeCompare(S.createdAt)):[],M=T.find((S)=>S.name===q)??T[0],P=i.useMemo(()=>{let S=new Map;for(let w of M?$Q(M):[]){let j=`${w.twin}:${w.entry.subject.type}:${w.entry.subject.id}`,x=S.get(j)??{key:j,twin:w.twin,writes:[]};x.writes.push(w.entry),S.set(j,x)}return[...S.values()]},[M]),A=P.find((S)=>S.key===L)??P[0],R=N1(Q,A?`/-/${_}/log/${A.twin}`:null),f={added:0,removed:0,changed:0};for(let S of P)f[E4(S.writes).tone]=(f[E4(S.writes).tone]??0)+1;let C=M?x4(M):null,N=M?qQ(M,H):null;return $.jsxDEV("div",{className:"ws-two",children:[$.jsxDEV("div",{className:"ws-files",children:[$.jsxDEV(s_,{name:_,view:"history",changes:Y,changesets:T.length},void 0,!1,void 0,this),$.jsxDEV(s1,{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((S)=>{let w=M?.name===S.name,j=x4(S).label==="Not sent";return $.jsxDEV("li",{children:$.jsxDEV("a",{href:`${A1}/${_}/~/changes/changesets/${S.name}`,className:w?"on":void 0,"aria-current":w?"true":void 0,onClick:(x)=>{x.preventDefault(),W(null),w1([..._.split("/"),"~","changes","changesets",S.name])},children:[$.jsxDEV("span",{className:"ws-row-text",children:[$.jsxDEV("b",{children:n6(S)},void 0,!1,void 0,this),$.jsxDEV("small",{children:[S.owner??(S.cutBy?h4(S.cutBy):"unrecorded")," • ",$.jsxDEV(P1,{iso:S.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),j?$.jsxDEV("span",{className:"ws-unpushed",title:"Not pushed to the remote yet",children:$.jsxDEV(R1,{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)},S.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"&&!M?$.jsxDEV(s2,{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,M&&C&&N?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-commit-head",children:[$.jsxDEV("div",{className:"ws-commit-title",children:[$.jsxDEV("h3",{children:n6(M)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"ws-commit-stat",children:[$.jsxDEV(R1,{name:"file-diff",size:16},void 0,!1,void 0,this)," ",k1(P.length,"changed record"),f.added?$.jsxDEV("span",{className:"plus",children:[" +",f.added]},void 0,!0,void 0,this):null,f.removed?$.jsxDEV("span",{className:"minus",children:[" −",f.removed]},void 0,!0,void 0,this):null,f.changed?$.jsxDEV("span",{className:"dot",children:[" •",f.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:M.name},void 0,!1,void 0,this)," · ",$.jsxDEV(P1,{iso:M.createdAt},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("p",{className:"ws-commit-who",children:[["Owner",M.owner??(M.cutBy&&/^(token|token:read)$|^key:(?!.* for:)/.test(M.cutBy)?"no person: a service’s":"unrecorded")],["Cut by",M.cutBy?M.pushedBy&&M.applied===null&&M.cutBy==="machine"?"the machine it was cut on":h4(M.cutBy):"unrecorded"],...M.pushedBy?[["Pushed by",h4(M.pushedBy)]]:[]].map(([S,w])=>$.jsxDEV("span",{children:[$.jsxDEV("span",{className:"mode",children:S},void 0,!1,void 0,this)," ",w]},S,!0,void 0,this))},void 0,!1,void 0,this),M.pushedBy?$.jsxDEV("p",{className:"mode ws-commit-meta",children:M.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-${N.tone}`,children:N.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(a_,{records:P,...A?{selected:A.key}:{},onPick:W,label:"Records it changed"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:A?$.jsxDEV(d_,{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(U0,{open:B,onClose:()=>O(!1),title:`Review: ${n6(M)}`,wide:!0,children:[$.jsxDEV(b_,{name:_,token:Q,signsAs:U,c:M,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"head",required:H},`h:${M.name}`,!1,void 0,this),$.jsxDEV(b_,{name:_,token:Q,signsAs:U,c:M,canWrite:G,rooted:Z,refused:F,onChanged:X,part:"review",required:H},`r:${M.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 mZ({name:_,token:Q,vendors:J,vendor:q,tick:U}){let[G,Z]=i.useState(j_*4),[F,X]=i.useState(""),[Y,K]=i.useState(null),H=N1(Q,`/-/${_}/timeline?limit=${G}${q?`&twin=${encodeURIComponent(q)}`:""}`,Math.floor(U/2)),L=H.state==="ok"?qF(H.data.entries):[],W=[...new Set(L.map((f)=>L0(f.entry).what))].sort(),B=L.filter((f)=>!F||L0(f.entry).what===F),O=B.find((f)=>o2(f)===Y)??B[0],T=(f)=>(C)=>{C.preventDefault(),K(null),w1([..._.split("/"),"~","events",...f?[f]:[]])},M=O?.entry.input&&typeof O.entry.input==="object"?O.entry.input.body:void 0,P=O?vZ(O.entry.traceparent):null,A=O?V_(O):null,R=O?_F(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:`${A1}/${_}/~/events`,className:!q?"on":void 0,"aria-current":!q?"page":void 0,onClick:T(),children:"All"},void 0,!1,void 0,this),J.map((f)=>$.jsxDEV("a",{href:`${A1}/${_}/~/events/${f}`,className:q===f?"on":void 0,"aria-current":q===f?"page":void 0,onClick:T(f),children:[$.jsxDEV(h1,{vendor:f},void 0,!1,void 0,this),W1(f)]},f,!0,void 0,this))]},void 0,!0,void 0,this),$.jsxDEV("select",{"aria-label":"Operation",value:F,onChange:(f)=>{X(f.target.value),K(null)},children:[$.jsxDEV("option",{value:"",children:"Every operation"},void 0,!1,void 0,this),W.map((f)=>$.jsxDEV("option",{value:f,children:f},f,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-grid-wrap",children:[$.jsxDEV(s1,{load:H,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:B.map((f)=>{let C=L0(f.entry),N=V_(f),S=O&&o2(f)===o2(O);return $.jsxDEV("tr",{className:S?"on":void 0,"aria-selected":S,onClick:()=>K(o2(f)),children:[$.jsxDEV("td",{className:"mono",children:$.jsxDEV(P1,{iso:f.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(h1,{vendor:f.twin},void 0,!1,void 0,this),W1(f.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(f.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:D5(f.entry,f.caller)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N?$.jsxDEV("span",{className:N.bad?"badge cs-bad":N.status==="deployed"?"badge cs-done":"badge",children:N.status},void 0,!1,void 0,this):$.jsxDEV("span",{className:"mode",children:g_(f.entry)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},o2(f),!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:e_(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(P1,{iso:O.entry.occurredAt},void 0,!1,void 0,this)," · ",D5(O.entry,O.caller)]},void 0,!0,void 0,this),P?$.jsxDEV("a",{href:`${A1}/${_}/~/trace/${P.trace}`,onClick:(f)=>{f.preventDefault(),w1([..._.split("/"),"~","trace",P.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),M!==void 0?$.jsxDEV(JF,{body:M},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(([f,C])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:f},void 0,!1,void 0,this),$.jsxDEV("dd",{children:C},void 0,!1,void 0,this)]},f,!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(QQ,{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((f)=>f.entry.receipt?.status??"landed copy").join(" · "):$F(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?`${B.indexOf(O)+1} of ${B.length}`:B.length," events",q?` at ${W1(q)}`:""]},void 0,!0,void 0,this),H.state==="ok"&&H.data.next?$.jsxDEV("button",{type:"button",onClick:()=>Z((f)=>f+j_*4),children:"Load older"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function gZ({name:_,token:Q,id:J}){let q=/^[0-9a-f]{32}$/.test(J),U=N1(Q,q?`/-/${_}/timeline?trace=${J}&limit=500`:null),G=U.state==="ok"?[...U.data.entries].sort((H,L)=>-n_(H,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,K=[...new Set(G.map((H)=>H.twin))];return $.jsxDEV("div",{className:"ws-sheet ws-trace",children:[$.jsxDEV("p",{className:"crumbs-line",children:$.jsxDEV("a",{href:`${A1}/${_}/~/events`,onClick:(H)=>{H.preventDefault(),w1([..._.split("/"),"~","events"])},children:[$.jsxDEV(R1,{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]?`${L0(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(s1,{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(P1,{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:K.map(W1).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(s2,{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((H)=>{let L=Date.parse(H.entry.occurredAt)-X,W=o2(H),B=L0(H.entry);return $.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("div",{className:Z===W?"ws-span on":"ws-span",role:"row",onClick:()=>F(Z===W?null:W),children:[$.jsxDEV("span",{role:"cell",className:"ws-span-name",children:[$.jsxDEV(h1,{vendor:H.twin},void 0,!1,void 0,this),$.jsxDEV("b",{children:W1(H.twin)},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[B.what,B.label?` “${B.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===W?$.jsxDEV("div",{className:"ws-span-detail",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("code",{children:e_(H.entry)},void 0,!1,void 0,this)," on ",$.jsxDEV("code",{children:[H.entry.subject.type,":",c0(H.entry)]},void 0,!0,void 0,this)," · ",D5(H.entry,H.caller)," · ",g_(H.entry)]},void 0,!0,void 0,this),$.jsxDEV(QQ,{fields:H.entry.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},W,!0,void 0,this)})]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function pZ({name:_,token:Q,vendor:J,withScreens:q,tick:U}){let G=N1(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((f)=>f.type===R).length})).sort((R,f)=>Number(R.type.startsWith("_"))-Number(f.type.startsWith("_"))||N2(R.type).localeCompare(N2(f.type))),[X,Y]=i.useState(null),[K,H]=i.useState(null),L=F.some((R)=>R.type===X)?X:F[0]?.type,W=Z.filter((R)=>R.type===L),B=W.find((R)=>R.id===K)??W[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"]),M=(R)=>!T.has(R)&&W.some((f)=>f[R]!==void 0&&f[R]!==null&&typeof f[R]!=="object"),P=[...new Set(W.flatMap((R)=>Object.keys(R)))],A=[...O.filter(M),...P.filter((R)=>!O.includes(R)&&M(R))].slice(0,4);return $.jsxDEV("div",{className:"ws-table-app",children:[$.jsxDEV("nav",{className:"ws-tables","aria-label":`${W1(J)}'s records`,children:[$.jsxDEV("div",{className:"ws-list-head",children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(h1,{vendor:J},void 0,!1,void 0,this),W1(J)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(s1,{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:(f)=>{f.preventDefault(),Y(R.type),H(null)},children:[$.jsxDEV(R1,{name:"table-2",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:N2(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:`${A1}/${_}/~/events/${J}`,onClick:(R)=>{R.preventDefault(),w1([..._.split("/"),"~","events",J])},children:[$.jsxDEV(R1,{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:`${A1}/${_}/~/screens/${J}`,onClick:(R)=>{R.preventDefault(),w1([..._.split("/"),"~","screens",J])},children:[$.jsxDEV(R1,{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(s2,{title:`${W1(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,W.length?$.jsxDEV("table",{className:"ws-grid","aria-label":`${N2(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:W.map((R)=>$.jsxDEV("tr",{className:B?.id===R.id?"on":void 0,"aria-selected":B?.id===R.id,onClick:()=>H(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((f)=>$.jsxDEV("td",{className:"ws-cell-clip",children:R[f]===void 0||R[f]===null?$.jsxDEV("span",{className:"mode",children:"—"},void 0,!1,void 0,this):String(R[f])},f,!1,void 0,this)),$.jsxDEV("td",{className:"mode",children:typeof R.updatedAt==="string"?$.jsxDEV(P1,{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:B?$.jsxDEV($.Fragment,{children:[$.jsxDEV("div",{className:"ws-list-head",children:[$.jsxDEV("span",{children:N2(B.type)},void 0,!1,void 0,this),$.jsxDEV("code",{children:B.id},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("dl",{className:"ws-record-fields",children:Object.entries(B).filter(([R])=>R!=="type"&&R!=="id").map(([R,f])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:R},void 0,!1,void 0,this),$.jsxDEV("dd",{children:$.jsxDEV(l0,{v:f},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:B?`${W.indexOf(B)+1} of ${k1(W.length,N2(L??"record"))}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function cZ({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(h1,{vendor:Q},void 0,!1,void 0,this),$.jsxDEV("b",{children:W1(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:`${A1}/${_}/~/vendors/${Q}`,onClick:(F)=>{F.preventDefault(),w1([..._.split("/"),"~","vendors",Q])},children:[$.jsxDEV(R1,{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(R1,{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:[W1(Q),"'s pack lists no screens."]},void 0,!0,void 0,this):null,G.state==="ok"&&J?$.jsxDEV("iframe",{title:`${W1(Q)}, as this World shows it`,src:J},Q,!1,void 0,this):null]},void 0,!0,void 0,this)}function lZ({name:_,token:Q,who:J,scope:q}){let[U,G]=i.useState(0),Z=N1(Q,`/-/${_}/twins`),F=N1(Q,`/-/${_}/rules`,U),X=F.state==="ok"?F.data.changesets:null,[Y,K]=i.useState(null),[H,L]=i.useState(null),[W,B]=i.useState(!1),[O,T]=i.useState([]),M=Y??X?.approvals??1,P=H??X?.summary??"required",A=X!==null&&(M!==(X.approvals??1)||P!==(X.summary??"required")),R=(j,x)=>{if(T((r)=>[{ok:j,text:x,at:new Date().toISOString(),n:++x5},...r].slice(0,3)),!j)V1(x,"error")},f=async(j)=>{j.preventDefault(),B(!0);try{let x=await I1(Q,`/-/${_}/rules`,{method:"PUT",body:JSON.stringify({changesets:{approvals:M,summary:P}})});if(!x.ok){R(!1,`Save: ${await G0(x)}`);return}R(!0,`Saved: ${M===0?"no approval":k1(M,"approval")} before a deploy; a summary ${P==="required"?"required":"generated when none is given"}.`),K(null),L(null),G((r)=>r+1)}finally{B(!1)}},C={gated:"a person deploys an approved changeset",auto:"a push deploys at once",hold:"nothing deploys"},N=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),S=Z.state==="ok"?Z.data.twins.filter((j)=>j.root?.url):[],w=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(s1,{load:F,what:"the rules",lines:2},void 0,!1,void 0,this),$.jsxDEV("form",{className:"ws-rules",onSubmit:(j)=>void f(j),"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 ",N,". 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(w)||X===null,children:[$.jsxDEV("label",{className:"check",children:[$.jsxDEV("input",{type:"radio",name:"summary",checked:P==="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:P==="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(R1,{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:M,onChange:(j)=>K(Number(j.target.value)),disabled:Boolean(w)||X===null,"aria-label":"Approvals required",children:[0,1,2,3,4,5].map((j)=>$.jsxDEV("option",{value:j,children:j===0?"no one: verified is enough":j===1?"1 person":`${j} different people`},j,!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"&&S.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,S.length?$.jsxDEV("ul",{className:"ws-rule-list",children:S.map((j)=>$.jsxDEV("li",{children:[$.jsxDEV(h1,{vendor:j.twin},void 0,!1,void 0,this),W1(j.twin),": ",C[j.root.deploy??"gated"]??"gated"]},j.twin,!0,void 0,this))},void 0,!1,void 0,this):null,$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("a",{href:`${A1}/${_}/~/settings/services`,onClick:(j)=>{j.preventDefault(),w1([..._.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($2,{log:O,name:_},void 0,!1,void 0,this),$.jsxDEV("div",{className:"row-actions",children:[$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(w)||W||!A,title:w??void 0,children:W?"Saving…":"Save"},void 0,!1,void 0,this),A?$.jsxDEV("button",{type:"button",onClick:()=>{K(null),L(null)},children:"Cancel"},void 0,!1,void 0,this):null,w?$.jsxDEV("span",{className:"mode",children:[w,"."]},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 rZ({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(R1,{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(R1,{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 iZ({name:_,token:Q,view:J,sub:q,arg:U,win:G,who:Z,snapshot:F,onReturn:X,onSignOut:Y,worlds:K,session:H,retry:L,twins:W,map:B,branches:O,clock:T,canWrite:M,refused:P,signsAs:A,opens:R,tick:f,admin:C,onRemoved:N,onClock:S,scope:w}){let j=GQ(_,Q,f,P),[x,r]=i.useState(0),m=x*1e5+Math.floor(f/2),v=N1(Q,`/-/${_}/diff`,m),h=N1(Q,`/-/${_}/changesets`,m),V=N1(Q,`/-/${_}/rules`,m),[E,u]=i.useState(null),D=(Q1)=>(T1)=>{T1?.preventDefault(),w1([..._.split("/"),"~",...Q1])},I=W.state==="ok"?W.data.twins.map((Q1)=>Q1.twin):[],k=new Map((B.state==="ok"?B.data.twins:[]).flatMap((Q1)=>{let T1=bZ(_,Q1);return T1?[[Q1.twin,T1]]:[]})),p=[...k.keys()],b=B.state==="ok"?B.data.twins.filter((Q1)=>Q1.root).map((Q1)=>Q1.twin):[],e=(Q1)=>B.state==="ok"?(B.data.twins.find((T1)=>T1.twin===Q1)?.resources??[]).reduce((T1,K1)=>T1+K1.count,0):0,t=O?.state==="ok"&&O.data.checkedOut||_.split("/")[1],o=i.useMemo(()=>{if(v.state!=="ok")return[];let Q1=new Map;for(let T1 of v.data.changes){let K1=`${T1.twin}:${T1.entry.subject.type}:${T1.entry.subject.id}`,y1=Q1.get(K1)??{key:K1,twin:T1.twin,writes:[]};y1.writes.push(T1.entry),Q1.set(K1,y1)}return[...Q1.values()]},[v]),s=o.find((Q1)=>Q1.key===E)??o[0],g=N1(Q,J==="changes"&&s?`/-/${_}/log/${s.twin}`:null,m),J1=v.state==="ok"?v.data.changes.length:0,U1=j.waiting.length,X1=j.there,G1=j.origin.state==="ok"?j.origin.data.origin:null,F1=!M?"This session reads the World; it changes nothing":!X1?"No remote: name one in Settings › Remote":null,B1=(Q1,T1,K1,y1,p1,l1)=>$.jsxDEV("a",{href:`${A1}/${_}/~/${y1}`,className:Q1?"on":void 0,"aria-current":Q1?"page":void 0,onClick:p1,children:[T1,$.jsxDEV("span",{children:K1},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),Y1=(Q1)=>{Q1.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(b5,{href:`${A1}/${_}`,onClick:(Q1)=>{Q1.preventDefault(),D(["changes"])()}},void 0,!1,void 0,this),$.jsxDEV("details",{className:"menu ws-pick",children:[$.jsxDEV("summary",{title:"This World",children:[$.jsxDEV(R1,{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(R1,{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),K.map((Q1)=>$.jsxDEV("a",{href:`${A1}/${Q1}`,className:Q1===_?"on":void 0,onClick:(T1)=>{T1.preventDefault(),Y1(T1),w1(Q1.split("/"))},children:[Q1===_?$.jsxDEV(R1,{name:"check",size:16},void 0,!1,void 0,this):$.jsxDEV(R1,{name:"globe",size:16},void 0,!1,void 0,this),Q1]},Q1,!0,void 0,this)),$.jsxDEV("a",{href:`${R0()&&R0()!==f1?R0():""}${A1}/`,onClick:(Q1)=>{if(R0()&&R0()!==f1)return;Q1.preventDefault(),Y1(Q1),w1([])},children:[$.jsxDEV(R1,{name:"layout-grid",size:16},void 0,!1,void 0,this),"All Worlds",t1()?` on ${new URL(t1()).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),t1()?$.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:[J2,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(t6,{text:j4({platform:t1(),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:[J2,"/",_,"/<vendor>"]},void 0,!0,void 0,this),$.jsxDEV(t6,{text:j4()},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:[J2,"/",_,"/<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(t6,{text:j4()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("hr",{},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${A1}/${_}/~/settings`,onClick:(Q1)=>{Y1(Q1),D(["settings"])(Q1)},children:[$.jsxDEV(R1,{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(EZ,{name:_,token:Q,branches:O,opens:R,refused:P,onChanged:S},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),G1?$.jsxDEV("a",{href:`${A1}/${_}/~/remote`,onClick:D(["remote"]),children:["origin ",G1.namespace,U1?$.jsxDEV("b",{children:[" ↑",U1]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):$.jsxDEV("a",{href:`${A1}/${_}/~/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:`${A1}/${_}/~/settings/clock`,onClick:D(["settings","clock"]),children:T.state==="ok"?$.jsxDEV($.Fragment,{children:[T.data.frozen?"stopped at ":"",$.jsxDEV(P1,{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 j.pull(),disabled:Boolean(F1)||j.busy!==null,title:F1??`Fetch what ${X1} has and move this branch onto it`,children:[$.jsxDEV(R1,{name:"arrow-down-to-line",size:16},void 0,!1,void 0,this),j.busy==="Pull"?"Pulling…":"Pull"]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ws-btn",onClick:()=>void j.push(),disabled:Boolean(F1)||j.busy!==null||U1===0,title:F1??(U1?`Push ${k1(U1,"changeset")} to ${X1}`:`Every changeset is at ${X1}`),children:[$.jsxDEV(R1,{name:"arrow-up-from-line",size:16},void 0,!1,void 0,this),j.busy==="Push"?"Pushing…":"Push",U1?$.jsxDEV("span",{className:"ws-btn-count",children:U1},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(R1,{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(R1,{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(P1,{iso:F.at},void 0,!1,void 0,this),": a read-only snapshot",F.expiresAt?$.jsxDEV($.Fragment,{children:[", gone ",$.jsxDEV(P1,{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,j.log.length?$.jsxDEV("div",{className:"ws-said",children:$.jsxDEV($2,{log:j.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:[I.length?$.jsxDEV("a",{href:`${A1}/${_}/~/screens`,className:J==="screen"?"ws-screens-entry on":"ws-screens-entry",onClick:D(["screens"]),title:`The board: ${f2(I.map(W1))}`,children:[$.jsxDEV(R1,{name:"layout-grid",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Board"},void 0,!1,void 0,this),$.jsxDEV("span",{className:"ws-screens-marks",children:[I.slice(0,3).map((Q1)=>$.jsxDEV(h1,{vendor:Q1},Q1,!1,void 0,this)),I.length>3?$.jsxDEV("span",{className:"more",children:["+",I.length-3]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{className:"side-group",children:"Workspace"},void 0,!1,void 0,this),B1(J==="changes"||J==="history",$.jsxDEV(R1,{name:"file-diff",size:16},void 0,!1,void 0,this),"Changes","changes",D(["changes"]),o.length?String(o.length):void 0),B1(J==="events"&&!U||J==="trace",$.jsxDEV(R1,{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),I.map((Q1)=>$.jsxDEV(i.default.Fragment,{children:B1(J==="vendor"&&U===Q1,$.jsxDEV(h1,{vendor:Q1},void 0,!1,void 0,this),W1(Q1),`vendors/${Q1}`,D(["vendors",Q1]),e(Q1)?String(e(Q1)):void 0)},Q1,!1,void 0,this)),$.jsxDEV("p",{className:"side-group",children:"Remote"},void 0,!1,void 0,this),B1(!1,$.jsxDEV(R1,{name:"cloud",size:16},void 0,!1,void 0,this),X1?"origin":"Name a remote…","remote",D(["remote"]),U1?`↑${U1}`: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(s_,{name:_,view:"changes",changes:o.length,changesets:h.state==="ok"?h.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:v.state==="ok"?`${k1(o.length,"record")} · ${k1(J1,"write")}`:""},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(s1,{load:v,what:"the changes",lines:4},void 0,!1,void 0,this),$.jsxDEV(a_,{records:o,...s?{selected:s.key}:{},onPick:u,label:"Changed records"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"ws-detail",children:[v.state==="ok"&&!s?$.jsxDEV(s2,{title:"No changes on this branch",action:U1>0&&X1?$.jsxDEV("button",{type:"button",className:"primary",disabled:Boolean(F1)||j.busy!==null,onClick:()=>void j.push(),children:["Push ",k1(U1,"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 ",v.data.base.at?$.jsxDEV(P1,{iso:v.data.base.at},void 0,!1,void 0,this):$.jsxDEV("code",{children:v.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,s?$.jsxDEV(d_,{record:s,history:g.state==="ok"?g.data.entries:g.state==="error"?[]:null},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(WF,{pinned:!0,generated:V.state==="ok"&&V.data.changesets.summary==="generated",author:{face:$.jsxDEV(R1,{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:`${A1}/${_}/~/settings/account`,branch:t},name:_,token:Q,changes:J1,canWrite:M,refused:P,onCut:()=>{r((Q1)=>Q1+1),u(null)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,J==="history"?$.jsxDEV(xZ,{name:_,token:Q,sets:h,changes:o.length,withScreens:p,required:V.state==="ok"?V.data.changesets.approvals??1:1,...q?{sub:q}:{},signsAs:A,canWrite:M,rooted:b,refused:P,onChanged:()=>r((Q1)=>Q1+1)},void 0,!1,void 0,this):null,J==="events"?$.jsxDEV(mZ,{name:_,token:Q,vendors:I,...U&&I.includes(U)?{vendor:U}:{},tick:f},U??"",!1,void 0,this):null,J==="trace"?$.jsxDEV(gZ,{name:_,token:Q,id:U??""},void 0,!1,void 0,this):null,J==="vendor"&&U?$.jsxDEV(pZ,{name:_,token:Q,vendor:U,withScreens:p.includes(U),tick:f},U,!1,void 0,this):null,J==="screen"&&U?$.jsxDEV(cZ,{name:_,vendor:U,url:B.state==="ok"?k.get(U)??null:void 0,...B.state==="error"?{mapError:B.error}:{},holding:aZ(B.state==="ok"?B.data.twins.find((Q1)=>Q1.twin===U)?.resources??[]:[]),session:H,retry:L},U,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV(U0,{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:i_.map(([Q1,T1,K1])=>$.jsxDEV("a",{href:`${A1}/${_}/~/settings/${Q1}`,className:G.tab===Q1?"on":void 0,"aria-current":G.tab===Q1?"page":void 0,onClick:D(["settings",Q1]),children:[$.jsxDEV(R1,{name:K1,size:16},void 0,!1,void 0,this),T1]},Q1,!0,void 0,this))},void 0,!1,void 0,this),$.jsxDEV("div",{className:"ws-settings-pane",children:[w==="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(rZ,{who:Z,scope:w,snapshot:F,portal:t1(),onSignOut:Y},void 0,!1,void 0,this):null,G.tab==="changesets"?$.jsxDEV(lZ,{name:_,token:Q,who:Z,scope:w},void 0,!1,void 0,this):null,G.tab==="remote"?$.jsxDEV(AF,{name:_,token:Q,canWrite:M,tick:f,refused:P},void 0,!1,void 0,this):null,G.tab==="access"||G.tab==="services"||G.tab==="checks"||G.tab==="clock"?$.jsxDEV(TF,{name:_,token:Q,admin:C,canWrite:M,refused:P,onRemoved:N,only:G.tab},void 0,!1,void 0,this):null,G.tab==="vault"?$.jsxDEV(MF,{name:_,token:Q,canWrite:M,refused:P},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(yZ,{},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(U0,{open:G?.kind==="branches",onClose:()=>D(["changes"])(),title:"Branches",wide:!0,children:G?.kind==="branches"?$.jsxDEV(oZ,{name:_,token:Q,canWrite:M,branches:O,opens:R,...G.open?{open:G.open}:{},onChanged:S,refused:P},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function t6({text:_}){return $.jsxDEV("button",{type:"button",className:"agent-prompt-button",onClick:()=>{navigator.clipboard?.writeText(_).then(()=>V1("Copied the prompt: paste it into your coding agent"),()=>V1("Could not copy the prompt","error"))},children:"Copy a prompt for your coding agent"},void 0,!1,void 0,this)}var q8=(_)=>`${_.url.replace(/\/+$/,"")}/${_.namespace}`,dZ=(_)=>_.filter((Q)=>Q.applied===null||Q.applied.outcome==="refused"),aZ=(_,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"},t_=$.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 sZ({name:_,token:Q,clock:J,canWrite:q,onChanged:U,refused:G,open:Z}){let[F,X]=i.useState(!1),[Y,K]=i.useState(""),[H,L]=i.useState(""),[W,B]=i.useState(null),[O,T]=i.useState(!1),M=J.state==="ok"?J.data:null,P=async(C,N,S)=>{T(!0),B(null);try{let w=await I1(Q,`/-/${_}/${N}`,{method:N==="clock"?"PUT":"POST",body:JSON.stringify(S)});if(!w.ok){G(w),B({ok:!1,text:await G0(w)});return}let j=await w.json();B({ok:!0,text:`${C} — the World is at ${new Date(j.at).toLocaleString()}`}),X(!1),U()}catch(w){B({ok:!1,text:`the World did not answer: ${w instanceof Error?w.message:String(w)}`})}finally{T(!1)}},A=(C)=>{C.preventDefault();let N=new Date(Y);if(Number.isNaN(N.getTime())){B({ok:!1,text:"Pick a date and time."});return}if(M&&N.getTime()<Date.parse(M.at)){B({ok:!1,text:`The World's clock only moves forward: pick a time after ${new Date(M.at).toLocaleString()}.`});return}P("Clock set","clock",{at:N.toISOString()})},R=(C,N)=>{P(`Advanced ${N}`,"clock/advance",{by:C})},f=[["1h","1 hour"],["1d","1 day"],["7d","1 week"],["30d","30 days"]];return $.jsxDEV("div",{className:`clock${M?.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):M.frozen?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge",children:"Simulation"},void 0,!1,void 0,this)," World time ",$.jsxDEV("strong",{children:$.jsxDEV(P1,{iso:M.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(P1,{iso:M.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&&M?$.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),K(n2(S_(M.at))),B(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),f.map(([C,N])=>$.jsxDEV("button",{type:"button","aria-label":`Advance ${N}`,disabled:O||!M.frozen,title:M.frozen?void 0:"Set the time first: advancing moves a set clock",onClick:()=>R(C,N),children:N},C,!1,void 0,this)),$.jsxDEV("form",{className:"inline",onSubmit:(C)=>{if(C.preventDefault(),!/^\d+[smhd]$/.test(H.trim())){B({ok:!1,text:"Advance by a number and a unit: 90m, 12h, 3d."});return}R(H.trim(),`by ${H.trim()}`)},children:[$.jsxDEV("label",{className:"sr",children:["Advance by ",$.jsxDEV("input",{name:"advanceBy",value:H,onChange:(C)=>L(C.target.value),placeholder:"90m, 12h, 3d",size:9,disabled:!M.frozen},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"submit",disabled:O||!M.frozen,children:"Advance"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!M.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:n2(S_(M.at)),onChange:(C)=>K(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,W?$.jsxDEV("p",{role:W.ok?"status":"alert",children:W.text},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}function tZ({name:_,token:Q,clock:J,refused:q}){let[U,G]=i.useState(!1),[Z,F]=i.useState(""),[X,Y]=i.useState(null),[K,H]=i.useState(!1),L=J.state==="ok"?J.data.at:new Date().toISOString(),W=i.useRef(null);return i.useEffect(()=>{if(!U)return;let O=(M)=>{if(M.key==="Escape"&&!document.querySelector("dialog[open]"))G(!1),W.current?.querySelector("button")?.focus()},T=(M)=>{if(!W.current?.contains(M.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:W,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(n2(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}H(!0);try{let M=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({at:{instant:T.toISOString()},ttl:3600})});if(!M.ok){q(M),Y(await G0(M));return}let P=await M.json();_8({name:P.name,parent:_,token:P.token,readToken:P.readToken,at:T.toISOString(),expiresAt:P.expiresAt??null,parentOrigin:f1,made:!0});let A=e2(P.origin)?.origin;if(A&&A!==f1){$8(A,P.readToken,P.name,`${A1}/${P.name}`);return}w1(P.name.split("/"))}catch(M){Y(`the World did not answer: ${M instanceof Error?M.message:String(M)}`)}finally{H(!1)}},noValidate:!0,children:[$.jsxDEV("label",{children:["As of ",$.jsxDEV("input",{name:"asOf",type:"datetime-local",value:Z,max:n2(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:K,children:K?"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 o_({name:_,token:Q,open:J,onClose:q,onMade:U,refused:G}){let Z=(N)=>N.split("/").pop()??N,[F,X]=i.useState(!1),[Y,K]=i.useState(null),[H,L]=i.useState(""),[W,B]=i.useState("now"),[O,T]=i.useState(""),[M,P]=i.useState("24"),[A,R]=i.useState(!0);i.useEffect(()=>{if(J)K(null),T(n2(new Date().toISOString()))},[J]);let f=async(N)=>{N.preventDefault(),K(null);let S=W==="at"?new Date(O):null;if(S&&Number.isNaN(S.getTime())){K("Pick a date and time, or make it as of now.");return}if(S&&S.getTime()>Date.now()){K("A branch is made as of now or a moment before it.");return}X(!0);let w=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({ttl:Math.round(Number(M)*3600),...S?{at:{instant:S.toISOString()}}:A?{live:!0}:{},...H.trim()?{label:H.trim()}:{}})}).catch(()=>null);if(X(!1),!w){K(`${f1} did not answer`);return}if(!w.ok){G(w),K(await G0(w));return}let j=await w.json();_8({name:j.name,parent:_,token:j.token??"",readToken:j.readToken,at:(S??new Date).toISOString(),expiresAt:j.expiresAt??null,parentOrigin:f1,...j.origin?{origin:j.origin}:{}}),q(),L(""),V1(`Made ${Z(j.name)}`),U()};return $.jsxDEV(U0,{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:(N)=>void f(N),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:H,onChange:(N)=>L(N.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:W==="now",onChange:()=>B("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),W==="now"?$.jsxDEV("label",{className:"check sub",children:[$.jsxDEV("input",{type:"checkbox",name:"branchLive",checked:A,onChange:(N)=>R(N.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:W==="at",onChange:()=>B("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),W==="at"?$.jsxDEV("input",{type:"datetime-local","aria-label":"As of",value:O,max:n2(new Date().toISOString()),onChange:(N)=>T(N.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:M,onChange:(N)=>P(N.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 oZ({name:_,token:Q,canWrite:J,branches:q,opens:U,open:G,onChanged:Z,refused:F,snapshotOf:X}){let Y=N1(Q,`/-/${_}/clock`),K=(P)=>P.split("/").pop()??P,[H,L]=i.useState(!1),W=(P)=>(A)=>{A.preventDefault(),w1([..._.split("/"),"~","branches",...P?P.split("/"):[]])};if(!q)return $.jsxDEV("p",{className:"mode",children:"This host makes no branches of a World."},void 0,!1,void 0,this);let B=q.state==="ok"?q.data.branches:[],O=q.state==="ok"&&(q.data.named?.length??0)>0?q.data.named:[{name:K(_),running:!0}],T=q.state==="ok"?q.data.checkedOut??K(_):K(_),M=async(P)=>{if(!await S0({title:`Remove the branch ${K(P)}?`,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/${P}`,{method:"DELETE"}).catch((R)=>R);if(A instanceof Error){V1(`Remove ${K(P)}: the World did not answer (${A.message})`,"error");return}if(!A.ok){F(A),V1(`Remove ${K(P)}: ${await G0(A)}`,"error");return}b4(P),V1(`Removed ${K(P)}`),Z(),w1([..._.split("/"),"~","branches"])};if(G){let P=G.includes("/")?B.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:`${A1}/${_}/~/branches`,onClick:W(),children:"← Branches"},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(s1,{load:q,what:"the branches"},void 0,!1,void 0,this),q.state==="ok"&&!P&&!A?$.jsxDEV("p",{className:"mode",children:["This World has no branch named ",G,"."]},void 0,!0,void 0,this):null,P?$.jsxDEV(nZ,{name:_,b:P,canWrite:J,opens:U(P.name),remove:()=>void M(P.name)},void 0,!1,void 0,this):null,A&&!P?$.jsxDEV(eZ,{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(tZ,{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(s1,{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((P)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:[$.jsxDEV("a",{href:`${A1}/${_}/~/branches/${P.name}`,onClick:W(P.name),children:$.jsxDEV("b",{children:P.name},void 0,!1,void 0,this)},void 0,!1,void 0,this),P.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):P.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:${P.name}`,!0,void 0,this)),B.map((P)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("a",{href:`${A1}/${_}/~/branches/${P.name}`,onClick:W(P.name),children:$.jsxDEV("b",{children:K(P.name)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:K(P.from??_)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P.at?.instant?$.jsxDEV(P1,{iso:P.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(P1,{iso:P.createdAt},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:P.expiresAt?$.jsxDEV(P1,{iso:P.expiresAt},void 0,!1,void 0,this):"kept"},void 0,!1,void 0,this)]},P.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(o_,{name:_,token:Q,open:H,onClose:()=>L(!1),onMade:Z,refused:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function nZ({name:_,b:Q,canWrite:J,opens:q,remove:U}){let G=(X)=>X.split("/").pop()??X,Z=Q8(Q.name),F=N1(Z,Z?`/-/${Q.name}/diff`:null);return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[t_," ",G(Q.name)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"changeset-actions",children:[q?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>r_(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(P1,{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(P1,{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(P1,{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(zF,{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 eZ({name:_,token:Q,b:J,served:q,canWrite:U,canServe:G}){let[Z,F]=i.useState(!1),[X,Y]=i.useState(null),K=async()=>{F(!0),Y(null);let H=await I1(Q,`/-/${_}/branches/${encodeURIComponent(J.name)}/serve`,{method:"POST"}).catch(()=>null);if(H?.ok){location.reload();return}F(!1),Y(H?await G0(H):`${f1} did not answer`)};return $.jsxDEV("div",{className:"branch-page",children:[$.jsxDEV("div",{className:"changeset-head",children:[$.jsxDEV("h3",{children:[t_," ",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 K(),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:`${A1}/${_}/~/changes`,onClick:(H)=>{H.preventDefault(),w1([..._.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 j_=50,o2=(_)=>`${_.twin}:${_.position}`,n_=(_,Q)=>Date.parse(Q.entry.occurredAt)-Date.parse(_.entry.occurredAt)||_.twin.localeCompare(Q.twin)||Q.position-_.position,h4=(_)=>{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":_},D5=(_,Q)=>{let J=typeof Q==="string"?Q:typeof _.caller==="string"?_.caller:"";if(J.startsWith("key:")&&J.length>4)return`by ${h4(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"},e_=(_)=>_.operation??_.op;function _F(_){let Q=_.fields??{},J=Q.usage!==null&&typeof Q.usage==="object"?Q.usage:Q,q=(...Y)=>Y.map((K)=>J[K]??Q[K]).find((K)=>typeof K==="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 _Q({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 l0({v:_}){if(typeof _==="string")return $.jsxDEV(_Q,{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 QF=(_)=>typeof _==="string"?_:Array.isArray(_)?_.map((Q)=>Q&&typeof Q==="object"&&typeof Q.text==="string"?Q.text:"").filter(Boolean).join(`
36
+ `):JSON.stringify(_??"");function JF({body:_}){if(_===null||typeof _!=="object"||Array.isArray(_))return $.jsxDEV(l0,{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(l0,{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(_Q,{text:QF(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 QQ({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(l0,{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 $F=(_)=>_.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 qF(_){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(n_)}var o6={deployed:5,confirmed:4,landed:3,replayed:2,skipped:1};function V_(_){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)=>(o6[G.status]??0)-(o6[U.status]??0))[0];return J&&!(o6[q.status]>=5)?{status:J.status,bad:!0}:{status:q.status,bad:!1}}var T0=1280,v0=820,V4=160,M0=72,UF=72,D1=(_)=>`${_.vendor}:${_.id}`,w2=(_)=>`${_.vendor}:section:${_.section.id}`,C2=(_)=>[_.section.id,..._.section.aka??[]].map((Q)=>`${_.vendor}:section:${Q}`),JQ=(_,Q)=>Q.at&&("site"in Q.at)?Q.at.site:Q.at?`${J2}/${_}/${Q.vendor}${Q.at.screen}`:null,GF=(_,Q)=>_.include?Q.filter((J)=>_.include.includes(D1(J))||C2(J).some((q)=>_.include.includes(q))):Q.filter((J)=>!(_.hidden??[]).includes(D1(J)));function ZF({data:_}){let{frame:Q,url:J,active:q,picked:U,boards:G,addTo:Z,remove:F,compare:X}=_,Y=D1(Q),K=G.filter((H)=>H.include&&!H.include.includes(Y)&&!C2(Q).some((L)=>H.include.includes(L)));return $.jsxDEV($.Fragment,{children:[$.jsxDEV(l6,{isVisible:!0,position:Z1.Top,align:"start",className:"frame-label",children:[$.jsxDEV(h1,{vendor:Q.vendor},void 0,!1,void 0,this),$.jsxDEV("span",{children:Q.title},void 0,!1,void 0,this),Q.changes?$.jsxDEV("button",{type:"button",className:"frame-changed nodrag",onClick:()=>X(Y),title:`${k1(Q.changes,"change")} here, not in a changeset: compare before and now`,children:[$.jsxDEV(R1,{name:"square-dot",size:14},void 0,!1,void 0,this),Q.changes]},void 0,!0,void 0,this):null,U&&K.length?$.jsxDEV("select",{className:"nodrag frame-add",value:"","aria-label":`Add ${Q.title} to a board`,onChange:(H)=>{if(H.target.value)Z(H.target.value,Y)},children:[$.jsxDEV("option",{value:"",children:"Add to board…"},void 0,!1,void 0,this),K.map((H)=>$.jsxDEV("option",{value:H.id,children:H.name},H.id,!1,void 0,this))]},void 0,!0,void 0,this):null,U&&F?$.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>F.act(Y),title:F.label,"aria-label":F.label,children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:q?"frame on":U?"frame picked":"frame",style:{width:T0,height:v0},children:[$.jsxDEV("div",{className:"frame-bar",title:"Drag to move · double-click to use",children:[$.jsxDEV(h1,{vendor:Q.vendor},void 0,!1,void 0,this),$.jsxDEV("strong",{children:[W1(Q.vendor)," · ",Q.kind]},void 0,!0,void 0,this),$.jsxDEV("span",{className:"frame-url",children:Q.url.replace(/^https?:\/\//,"")},void 0,!1,void 0,this),J?$.jsxDEV("a",{className:"nodrag",href:J,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${Q.title} in a new tab`,children:"↗"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:q?"frame-body nodrag nopan nowheel":"frame-body",children:J?$.jsxDEV("iframe",{title:Q.title,src:J,loading:"lazy",style:{pointerEvents:q?"auto":"none"}},void 0,!1,void 0,this):$.jsxDEV("div",{className:"frame-none",children:[$.jsxDEV("p",{children:$.jsxDEV("strong",{children:Q.unseen==="sites-not-routed"?`This World shows ${Q.title} only at its own local address.`:`${W1(Q.vendor)}'s twin draws no page for this ${Q.kind} yet.`},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("p",{className:"mode",children:Q.url},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function FF({data:_}){return $.jsxDEV($.Fragment,{children:[$.jsxDEV(A_,{isVisible:_.picked&&_.editable,minWidth:480,minHeight:360,color:"var(--accent)",onResizeEnd:_.resized},void 0,!1,void 0,this),$.jsxDEV(l6,{isVisible:!0,position:Z1.Top,align:"start",offset:6,className:"section-tag",children:[$.jsxDEV("button",{type:"button",className:_.picked?"nodrag on":"nodrag",onClick:()=>_.pick(_.key),onDoubleClick:()=>{if(_.editable)_.rename(_.key)},title:_.editable?"Double-click to rename":void 0,children:[_.vendor?$.jsxDEV(h1,{vendor:_.vendor},void 0,!1,void 0,this):null,$.jsxDEV("span",{children:_.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_.picked&&_.editable?$.jsxDEV("button",{type:"button",className:"ghost nodrag",onClick:()=>_.remove(_.key),"aria-label":`Remove the section ${_.name}`,title:"Remove the section (its frames stay)",children:"✕"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("div",{className:_.picked?"section-box on":"section-box"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function u_({url:_,title:Q}){return $.jsxDEV("div",{className:"compare-thumb",style:{width:420,height:420*v0/T0},children:$.jsxDEV("iframe",{title:Q,src:_,loading:"lazy",style:{width:T0,height:v0,transform:`scale(${420/T0})`}},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function HF({name:_,token:Q,frame:J,onClose:q,reads:U}){let[G,Z]=i.useState({state:"opening"}),F=N1(Q,`/-/${_}/board/changes?frame=${encodeURIComponent(D1(J))}`,U);i.useEffect(()=>{if(!J.since){Z({state:"none",why:"Nothing here has changed since the World was last cut."});return}if(!J.at||!("site"in J.at)){Z({state:"none",why:`A ${W1(J.vendor)} page as it was needs a signed-in copy of the World; its changes are listed below.`});return}let Y=new Date(Date.parse(J.since)-1).toISOString(),K=null,H=!1,L=setTimeout(()=>void(async()=>{let W=await I1(Q,`/-/${_}/branches`,{method:"POST",body:JSON.stringify({at:{instant:Y},ttl:3600}),signal:AbortSignal.timeout(60000)}).catch(()=>null);if(!W?.ok){Z({state:"none",why:`The World made no copy of itself as it was then${W?`: ${await G0(W)}`:""}.`});return}let B=await W.json();if(K=B.name,H){I1(Q,`/-/${_}/branches/${B.name}`,{method:"DELETE"}).catch(()=>null);return}let O=e2(B.origin);if(!O){Z({state:"none",why:"This World shows sites only at its own local address."});return}let T=new URL(J.url);Z({state:"ok",url:`${O.protocol}//${T.hostname}.${O.host}${T.pathname}${T.search}`,at:Y})})(),500);return()=>{if(H=!0,clearTimeout(L),K)I1(Q,`/-/${_}/branches/${K}`,{method:"DELETE"}).catch(()=>null)}},[_,Q,J.vendor,J.id,J.since]);let X=JQ(_,J);return $.jsxDEV("div",{className:"compare",role:"dialog","aria-label":`Changes to ${J.title}`,children:[$.jsxDEV("div",{className:"compare-head",children:[$.jsxDEV(h1,{vendor:J.vendor},void 0,!1,void 0,this),$.jsxDEV("strong",{children:J.title},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:[k1(J.changes,"change")," not yet cut",J.since?`, since ${a2(J.since)}`:""]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",className:"ghost",onClick:q,"aria-label":"Close the comparison",children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"compare-sides",children:[$.jsxDEV("figure",{children:[$.jsxDEV("figcaption",{children:["Before",G.state==="ok"?` · as of ${a2(G.at)}`:""]},void 0,!0,void 0,this),G.state==="ok"?$.jsxDEV(u_,{url:G.url,title:`${J.title} before`},void 0,!1,void 0,this):G.state==="opening"?$.jsxDEV("p",{className:"mode compare-note",role:"status",children:"Opening the World as it was…"},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode compare-note",children:G.why},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("figure",{children:[$.jsxDEV("figcaption",{children:"Now"},void 0,!1,void 0,this),X?$.jsxDEV(u_,{url:X,title:`${J.title} now`},void 0,!1,void 0,this):$.jsxDEV("p",{className:"mode compare-note",children:[W1(J.vendor),"'s twin draws no page for this ",J.kind," yet."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),F.state==="error"?$.jsxDEV("p",{role:"alert",className:"mode",children:["Its changes could not be read: ",F.error]},void 0,!0,void 0,this):null,$.jsxDEV("ol",{className:"compare-acts",children:(F.state==="ok"?F.data.acts:[]).map((Y)=>{let K=Y.entries[0],H=L0({...K,service:J.vendor,id:"",occurredAt:Y.at});return $.jsxDEV("li",{children:[$.jsxDEV("span",{className:"mode",children:a2(Y.at)},void 0,!1,void 0,this),$.jsxDEV("details",{children:[$.jsxDEV("summary",{children:[$.jsxDEV("strong",{children:H.what},void 0,!1,void 0,this),H.label?` · ${H.label}`:"",Y.writes>1?$.jsxDEV("span",{className:"mode",children:[" and ",k1(Y.writes-1,"more write")]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV("ul",{children:[Y.entries.map((L,W)=>$.jsxDEV("li",{children:[$.jsxDEV("code",{children:L.operation??L.op},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[L.subject.type," ",c0(L)]},void 0,!0,void 0,this)]},W,!0,void 0,this)),Y.writes>Y.entries.length?$.jsxDEV("li",{className:"mode",children:["and ",k1(Y.writes-Y.entries.length,"more write")]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},`${Y.at}:${K.subject.type}:${K.subject.id}`,!0,void 0,this)})},void 0,!1,void 0,this),F.state==="ok"&&F.data.total>F.data.acts.length?$.jsxDEV("p",{className:"mode",children:["and ",k1(F.data.total-F.data.acts.length,"earlier change"),", in Changes"]},void 0,!0,void 0,this):null,$.jsxDEV("a",{className:"compare-all",href:`${A1}/${_}/~/changes`,onClick:(Y)=>{Y.preventDefault(),w1([..._.split("/"),"~","changes"])},children:"Every change in the World →"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var KF={screen:ZF,section:FF};function XF(_){return $.jsxDEV(c6,{children:$.jsxDEV(YF,{..._},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function YF({name:_,token:Q,session:J,retry:q,snapshot:U,back:G,canWrite:Z}){let F=i.useRef(null),X=i.useRef(0),Y=i.useRef(Promise.resolve()),K=i.useRef(0),[,H]=i.useState(0),[L,W]=i.useState({state:"loading"}),[B,O]=i.useState(null),[T,M]=i.useState(0),P=i.useRef(0),A=i.useRef(0),R=i.useCallback(async()=>{let c=K.current,z=++P.current,y=await I1(Q,`/-/${_}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),l=y?.ok?await y.json().catch(()=>null):null;if(z<A.current)return;if(A.current=z,!l?.frames||!l.boards||!l.version){let _1=y?`the World answered ${y.status}`:"the World did not answer";W((n)=>n.state==="ok"?n:{state:"error",status:y?.status??0,error:_1}),O(_1);return}if(O(null),M((_1)=>_1+1),c===K.current&&X.current===0)F.current={boards:l.boards,version:l.version};W({state:"ok",data:l})},[Q,_]);i.useEffect(()=>{R();let c=setInterval(()=>{if(!document.hidden)R()},1e4);return()=>clearInterval(c)},[R]);let f=L.state==="ok"?L.data.frames:[],C=F.current?.boards??[{id:"everything",name:"Everything"}],[N,S]=i.useState("everything"),w=C.find((c)=>c.id===N)??C[0],j=Z&&!U,x=i.useCallback((c)=>{if(!F.current)return V1("The board is being read again: make that change once it shows","error"),Promise.resolve();F.current={...F.current,boards:c(F.current.boards)},X.current+=1,K.current+=1,H((y)=>y+1);let z=Y.current.then(async()=>{let y=F.current;if(!y)return;try{let l=await I1(Q,`/-/${_}/board`,{method:"PUT",body:JSON.stringify({boards:y.boards,version:y.version}),signal:AbortSignal.timeout(15000)}),_1=await l.json().catch(()=>null);if(l.ok&&_1?.boards&&_1.version)F.current={boards:X.current>1&&F.current?F.current.boards:_1.boards,version:_1.version};else if(l.status===409&&_1?.boards&&_1.version)F.current={boards:_1.boards,version:_1.version},V1("Someone else changed the board first: it is shown as they left it","error");else throw Error(_1?.error??`the World answered ${l.status}`)}catch(l){V1(`The board was not kept: ${l instanceof Error?l.message:String(l)}`,"error"),F.current=null;let _1=await I1(Q,`/-/${_}/board`,{signal:AbortSignal.timeout(15000)}).catch(()=>null),n=_1?.ok?await _1.json().catch(()=>null):null;if(n?.boards&&n.version)F.current={boards:n.boards,version:n.version}}}).finally(()=>{if(X.current-=1,K.current+=1,H((y)=>y+1),X.current===0&&!F.current)R()});return Y.current=z,z},[Q,_,R]),r=(c,z)=>{x((y)=>y.map((l)=>l.id===c?z(l):l))},m=GF(w,f),v=f.filter((c)=>c.changes&&!m.includes(c)).reduce((c,z)=>c+z.changes,0),[h,V]=i.useState(null),[E,u]=i.useState(null),[D,I]=i.useState(null),k=V5(),p=C.filter((c)=>c.include),b=(c,z)=>r(c,(y)=>({...y,include:[...y.include??[],z]})),e={label:w.include?"Take it off this board":"Hide it",act:(c)=>{u(null),r(w.id,(z)=>z.include?{...z,include:z.include.filter((y)=>y!==c)}:{...z,hidden:[...z.hidden??[],c]})}},t=(c)=>({x:c.position.x,y:c.position.y,w:c.width??c.measured?.width??T0,h:c.height??c.measured?.height??v0}),o=(c,z)=>{let y=t(c),l=y.x+y.w/2,_1=y.y+y.h/2;return z.filter((n)=>n.type==="section").map((n,$1)=>({s:n,i:$1})).filter(({s:n})=>{let $1=t(n);return l>=$1.x&&l<=$1.x+$1.w&&_1>=$1.y&&_1<=$1.y+$1.h}).sort((n,$1)=>t(n.s).w*t(n.s).h-t($1.s).w*t($1.s).h||$1.i-n.i)[0]?.s},s=i.useCallback(()=>{let c=new Map;for(let q1 of m){let H1=w.placed?.[D1(q1)];if(H1)c.set(D1(q1),H1)}let z=Math.max(-V4,...[...c.values()].map((q1)=>q1.y+v0)),y=[...new Set(m.map(w2))];for(let q1 of y){let H1=m.filter((u1)=>w2(u1)===q1),L1=H1.filter((u1)=>c.has(D1(u1))).map((u1)=>c.get(D1(u1))),M1=L1.length?Math.max(...L1.map((u1)=>u1.x))+T0+V4:0,E1=L1.length?Math.min(...L1.map((u1)=>u1.y)):z+V4+M0*2+UF;for(let u1 of H1)if(!c.has(D1(u1)))c.set(D1(u1),{x:M1,y:E1}),M1+=T0+V4;z=Math.max(z,E1+v0)}let l=w.sections??{},_1=(q1,H1,L1,M1,E1)=>({id:`sec:${q1}`,type:"section",position:{x:H1.x,y:H1.y},width:H1.w,height:H1.h,zIndex:0,draggable:j,data:{key:q1,name:L1,vendor:M1,named:E1}}),n=[];for(let q1 of y){let H1=m.find((C1)=>w2(C1)===q1),L1=C2(H1).find((C1)=>l[C1])??q1,M1=l[L1];if(M1?.gone)continue;let E1=m.filter((C1)=>w2(C1)===q1).map((C1)=>c.get(D1(C1))),u1={x:Math.min(...E1.map((C1)=>C1.x))-M0,y:Math.min(...E1.map((C1)=>C1.y))-M0,w:0,h:0};u1.w=Math.max(...E1.map((C1)=>C1.x))+T0+M0-u1.x,u1.h=Math.max(...E1.map((C1)=>C1.y))+v0+M0-u1.y;let _5=m.filter((C1)=>w2(C1)===q1&&!w.placed?.[D1(C1)]).map((C1)=>c.get(D1(C1))),j0=M1?{...M1}:u1;if(M1)for(let C1 of _5)j0.w=Math.max(j0.w,C1.x+T0+M0-j0.x),j0.h=Math.max(j0.h,C1.y+v0+M0-j0.y);n.push(_1(L1,j0,M1?.name??`${W1(H1.vendor)} · ${H1.section.title}`,H1.vendor,Boolean(M1?.name)))}for(let[q1,H1]of Object.entries(l))if(q1.startsWith("user:")&&!H1.gone)n.push(_1(q1,H1,H1.name??"Section",null,!0));let $1=m.map((q1)=>({id:D1(q1),type:"screen",zIndex:1,width:T0,height:v0,dragHandle:".frame-bar",draggable:j,position:c.get(D1(q1)),data:{world:_,frame:q1,url:JQ(_,q1)}}));return[...n,...$1]},[JSON.stringify(m),JSON.stringify(w),_,j]),[g,J1,U1]=K_([]),X1=i.useRef("");i.useEffect(()=>{let c=s();if(J1(c),c.length&&X1.current!==w.id)X1.current=w.id,requestAnimationFrame(()=>{k.fitView({padding:{top:"72px",left:"272px",right:"40px",bottom:"72px"},duration:0})})},[s,J1]);let G1=(c,z=[],y={})=>{let l=Object.fromEntries(z.map((n)=>{let $1=k.getNode(`sec:${n}`);if(!$1)return[n,void 0];let q1=t($1),H1=$1.data,L1=y[n]??(H1.named?H1.name:void 0);return[n,{x:Math.round(q1.x),y:Math.round(q1.y),w:Math.round(q1.w),h:Math.round(q1.h),...L1?{name:L1.slice(0,80)}:{}}]}).filter(([,n])=>n!==void 0)),_1=Object.fromEntries(Object.entries(c).map(([n,$1])=>[n,{x:Math.round($1.x),y:Math.round($1.y)}]));r(w.id,(n)=>({...n,placed:{...n.placed??{},..._1},sections:{...n.sections??{},...l}}))},F1=i.useRef(null),B1=(c,z)=>{if(z.type!=="section"){F1.current=null;return}let y=k.getNodes(),l=t(z),_1=(n)=>{let $1=t(n);if(n.type==="screen"){let q1=$1.x+$1.w/2,H1=$1.y+$1.h/2;return q1>=l.x&&q1<=l.x+l.w&&H1>=l.y&&H1<=l.y+l.h}return n.id!==z.id&&$1.x>=l.x&&$1.y>=l.y&&$1.x+$1.w<=l.x+l.w&&$1.y+$1.h<=l.y+l.h};F1.current={id:z.id,from:{...z.position},members:y.filter(_1).map((n)=>({id:n.id,x:n.position.x,y:n.position.y}))}},Y1=(c,z)=>{let y=F1.current;if(!y||y.id!==z.id)return;let l=z.position.x-y.from.x,_1=z.position.y-y.from.y,n=new Map(y.members.map(($1)=>[$1.id,$1]));J1(($1)=>$1.map((q1)=>{let H1=n.get(q1.id);return H1?{...q1,position:{x:H1.x+l,y:H1.y+_1}}:q1}))},Q1=(c,z)=>{let y=F1.current;F1.current=null;let l=z.position.x-(y?.from.x??z.position.x),_1=z.position.y-(y?.from.y??z.position.y),n=z.type==="screen"?[{id:z.id,x:z.position.x,y:z.position.y}]:(y?.members??[]).map(($1)=>({...$1,x:$1.x+l,y:$1.y+_1}));requestAnimationFrame(()=>{let $1=k.getNodes(),q1=new Map(n.filter((M1)=>!M1.id.startsWith("sec:")).map((M1)=>[M1.id,{x:M1.x,y:M1.y}])),H1=new Set([...z.type==="section"?[z.data.key]:[],...n.filter((M1)=>M1.id.startsWith("sec:")).map((M1)=>M1.id.slice(4))]),L1=new Set($1.filter((M1)=>q1.has(M1.id)).flatMap((M1)=>C2(M1.data.frame)));for(let M1 of $1){if(M1.type==="screen"&&C2(M1.data.frame).some((E1)=>L1.has(E1))&&!q1.has(M1.id))q1.set(M1.id,{x:M1.position.x,y:M1.position.y});if(M1.type==="section"&&L1.has(M1.data.key))H1.add(M1.data.key)}G1(Object.fromEntries(q1),[...H1])})},T1=(c)=>Object.fromEntries(k.getNodes().filter((z)=>z.type==="screen"&&C2(z.data.frame).includes(c)).map((z)=>[z.id,{x:z.position.x,y:z.position.y}])),K1=(c)=>{let y=k.getNode(`sec:${c}`)?.data?.name??"Section",l=window.prompt("Name this section",y)?.trim();if(!l)return;J1((_1)=>_1.map((n)=>n.id===`sec:${c}`?{...n,data:{...n.data,name:l.slice(0,80),named:!0}}:n)),requestAnimationFrame(()=>G1(T1(c),[c],{[c]:l}))},y1=(c)=>{u(null);let z=k.getNode(`sec:${c}`);r(w.id,(y)=>{let l=Object.fromEntries(Object.entries(y.sections??{}).filter(([_1])=>_1!==c));return{...y,sections:c.startsWith("user:")?l:{...l,[c]:{...z?{x:Math.round(z.position.x),y:Math.round(z.position.y),w:Math.round(t(z).w),h:Math.round(t(z).h)}:{x:0,y:0,w:0,h:0},gone:!0}}}})},p1=()=>{let c=E?k.getNode(E):void 0,z=k.screenToFlowPosition({x:window.innerWidth/2,y:window.innerHeight/2}),y=c?.type==="screen"?{x:c.position.x-M0,y:c.position.y-M0,w:T0+M0*2,h:v0+M0*2}:{x:z.x-900,y:z.y-600,w:1800,h:1200},l=`user:${Date.now().toString(36)}`,_1=Object.keys(w.sections??{}).filter((n)=>n.startsWith("user:")).length+1;u(`sec:${l}`),r(w.id,(n)=>({...n,sections:{...n.sections??{},[l]:{x:Math.round(y.x),y:Math.round(y.y),w:Math.round(y.w),h:Math.round(y.h),name:`Section ${_1}`}}}))},l1=g.map((c)=>c.type==="section"?{...c,data:{...c.data,picked:E===c.id,editable:j,pick:(z)=>u(`sec:${z}`),rename:K1,remove:y1,resized:()=>requestAnimationFrame(()=>{let z=c.data.key;G1(T1(z),[z])})}}:{...c,data:{...c.data,active:h===c.id,picked:E===c.id,boards:j?p:[],addTo:b,remove:!j||w.include&&!w.include.includes(c.id)?null:e,compare:(z)=>{u(z),I(z)}}});i.useEffect(()=>{let c=(z)=>{if(z.target?.closest("input, textarea, select, [contenteditable]"))return;if(z.key==="Escape"){if(h)V(null);else u(null);return}if(!j||h)return;if((z.key==="Delete"||z.key==="Backspace")&&E){if(z.preventDefault(),E.startsWith("sec:"))y1(E.slice(4));else if(!w.include||w.include.includes(E))e.act(E);else V1("It is on this board with its whole group: take the group off in the list to remove it","error");return}if(z.key==="S"&&z.shiftKey&&!z.metaKey&&!z.ctrlKey)z.preventDefault(),p1()};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)});let z0=(c)=>{u(c);let z=k.getNode(c);if(!z)return;let y=t(z);k.fitBounds({x:y.x,y:y.y,width:y.w,height:y.h},{padding:0.15,duration:400})},Z0=()=>{let c=`board-${Date.now().toString(36)}`;S(c),x((z)=>[...z,{id:c,name:`Board ${z.length}`,include:[]}])},F0=()=>{let c=window.prompt("Name this board",w.name)?.trim();if(c)r(w.id,(z)=>({...z,name:c.slice(0,80)}))},o1=()=>{let c=w.id;S("everything"),x((z)=>z.filter((y)=>y.id!==c))},Q0=[...new Map(f.map((c)=>[w2(c),c])).values()],n1=w.include?[...Q0.filter((c)=>!C2(c).some((z)=>w.include.includes(z))).map((c)=>({key:w2(c),label:`${W1(c.vendor)} · ${c.section.title} (all)`})),...f.filter((c)=>!m.includes(c)).map((c)=>({key:D1(c),label:c.title}))]:[],J0=w.include?[]:f.filter((c)=>!m.includes(c)),r0=g.filter((c)=>c.type==="section"),H0=g.filter((c)=>c.type==="screen"),k0=new Map(H0.map((c)=>[c.id,o(c,g)?.id??null])),y0=(c)=>{let z=c.data.frame;return $.jsxDEV("li",{children:$.jsxDEV("button",{type:"button",className:E===c.id?"on":void 0,onClick:()=>z0(c.id),onDoubleClick:()=>V(c.id),children:[$.jsxDEV(h1,{vendor:z.vendor},void 0,!1,void 0,this),$.jsxDEV("span",{children:z.title},void 0,!1,void 0,this),z.changes?$.jsxDEV("span",{className:"layer-changed",title:`${k1(z.changes,"change")}, not in a changeset: its mark on the board compares before and now`,children:[$.jsxDEV(R1,{name:"square-dot",size:14},void 0,!1,void 0,this),z.changes]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},c.id,!1,void 0,this)},q2=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,k2=J.state==="ok"&&L.state==="ok";return $.jsxDEV("div",{className:"canvas full",role:"region","aria-label":"The World's board",children:$.jsxDEV(H_,{nodes:k2?l1:[],onNodesChange:U1,nodeTypes:KF,onNodeDragStart:B1,onNodeDrag:Y1,onNodeDragStop:Q1,onNodeClick:(c,z)=>{if(z.id!==h)u(z.id)},onNodeDoubleClick:(c,z)=>{if(z.type==="screen")u(z.id),V(z.id)},onPaneClick:()=>{V(null),u(null)},minZoom:0.03,maxZoom:1.5,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!0,zoomOnPinch:!0,zoomOnScroll:!1,zoomOnDoubleClick:!1,colorMode:q2?"dark":"light",proOptions:{hideAttribution:!0},children:[$.jsxDEV(Y_,{variant:N0.Dots,gap:28,size:1.4},void 0,!1,void 0,this),$.jsxDEV(C0,{position:"top-left",className:"float layers",children:[$.jsxDEV("div",{className:"float-head",children:[$.jsxDEV("button",{type:"button",className:"back",onClick:G,"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],U?" · snapshot":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("div",{className:"board-tabs",role:"tablist","aria-label":"Boards",children:[C.map((c)=>$.jsxDEV("button",{type:"button",role:"tab","aria-selected":c.id===w.id,className:c.id===w.id?"on":void 0,onClick:()=>{u(null),V(null),S(c.id)},onDoubleClick:j&&c.id===w.id&&c.include?F0:void 0,children:c.name},c.id,!1,void 0,this)),j?$.jsxDEV("button",{type:"button",className:"ghost",onClick:Z0,"aria-label":"A new board",children:"+"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),w.include&&j?$.jsxDEV("div",{className:"board-acts",children:[$.jsxDEV("button",{type:"button",className:"ghost",onClick:F0,children:"Rename"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",className:"ghost",onClick:o1,children:"Delete board"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("ul",{className:"layer-list","aria-label":"Layers",children:[r0.map((c)=>{let z=c.data;return $.jsxDEV("li",{children:[$.jsxDEV("button",{type:"button",className:E===c.id?"layer-section on":"layer-section",onClick:()=>z0(c.id),onDoubleClick:()=>{if(j)K1(z.key)},children:[z.vendor?$.jsxDEV(h1,{vendor:z.vendor},void 0,!1,void 0,this):$.jsxDEV(R1,{name:"layout-grid",size:14},void 0,!1,void 0,this),$.jsxDEV("span",{children:z.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"layer-list inner",children:H0.filter((y)=>k0.get(y.id)===c.id).map(y0)},void 0,!1,void 0,this)]},c.id,!0,void 0,this)}),H0.filter((c)=>!k0.get(c.id)).map(y0)]},void 0,!0,void 0,this),w.include&&!m.length?$.jsxDEV("p",{className:"mode pad-s",children:"An empty board: add frames from Everything, or below."},void 0,!1,void 0,this):null,n1.length&&j?$.jsxDEV("select",{className:"board-add",value:"","aria-label":"Add to this board",onChange:(c)=>{let z=c.target.value;if(z)r(w.id,(y)=>({...y,include:[...y.include??[],z]}))},children:[$.jsxDEV("option",{value:"",children:"Add to this board…"},void 0,!1,void 0,this),n1.map((c)=>$.jsxDEV("option",{value:c.key,children:c.label},c.key,!1,void 0,this))]},void 0,!0,void 0,this):null,J0.length?$.jsxDEV("details",{className:"board-hidden",children:[$.jsxDEV("summary",{children:["Hidden (",J0.length,")"]},void 0,!0,void 0,this),$.jsxDEV("ul",{className:"layer-list",children:J0.map((c)=>$.jsxDEV("li",{children:j?$.jsxDEV("button",{type:"button",onClick:()=>r(w.id,(z)=>({...z,hidden:(z.hidden??[]).filter((y)=>y!==D1(c))})),children:[$.jsxDEV("span",{children:c.title},void 0,!1,void 0,this),$.jsxDEV("span",{className:"mode",children:"Show"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV("span",{className:"pad-s",children:c.title},void 0,!1,void 0,this)},D1(c),!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,v?$.jsxDEV("button",{type:"button",className:"board-elsewhere",onClick:()=>S("everything"),children:[$.jsxDEV(R1,{name:"square-dot",size:14},void 0,!1,void 0,this),k1(v,"change")," not on this board"]},void 0,!0,void 0,this):null,$.jsxDEV(s1,{load:L,what:"the board"},void 0,!1,void 0,this),B&&L.state==="ok"?$.jsxDEV("p",{role:"alert",className:"pad-s",children:["The board could not be read again (",B,"): it shows what was last read."]},void 0,!0,void 0,this):null,J.state==="pending"?$.jsxDEV("p",{className:"mode",role:"status",children:"Opening…"},void 0,!1,void 0,this):null,J.state==="error"?$.jsxDEV("p",{role:"alert",children:["The World did not open its screens: ",J.error," ",$.jsxDEV("button",{type:"button",onClick:q,children:"Try again"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),h?$.jsxDEV(C0,{position:"top-center",className:"float hint using",children:[$.jsxDEV("span",{className:"mode",children:["Using ",m.find((c)=>D1(c)===h)?.title??h]},void 0,!0,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>V(null),children:["Done ",$.jsxDEV("kbd",{children:"Esc"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV(C0,{position:"top-center",className:"float hint mode",children:"Scroll to pan · pinch or ⌘ scroll to zoom · double-click a frame to use it"},void 0,!1,void 0,this),j?$.jsxDEV(C0,{position:"bottom-center",className:"float board-tools",children:$.jsxDEV("button",{type:"button",className:"ghost",onClick:p1,title:"Section (⇧S): around the selected frame, else in the middle",children:[$.jsxDEV(R1,{name:"layout-grid",size:16},void 0,!1,void 0,this),$.jsxDEV("span",{children:"Section"},void 0,!1,void 0,this),$.jsxDEV("kbd",{children:"⇧S"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this):null,D&&m.some((c)=>D1(c)===D)?$.jsxDEV(C0,{position:"top-right",className:"float compare-panel",children:$.jsxDEV(HF,{name:_,token:Q,frame:m.find((c)=>D1(c)===D),onClose:()=>I(null),reads:T},D,!1,void 0,this)},void 0,!1,void 0,this):null,$.jsxDEV(z_,{showInteractive:!1,position:"bottom-left"},void 0,!1,void 0,this),$.jsxDEV(B_,{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 $Q=(_)=>_.actions.map((Q)=>({twin:Q.service,entry:{...Q.action,service:Q.service,op:Q.action.op??Q.action.operation??""}})),LF=(_)=>{let Q=_.action.input??{};return!(typeof Q.operationId==="string"||Q.graphql!==void 0&&Q.graphql!==null)};function x4(_){let Q=_.actions.filter(LF).length,J=_.actions.length-Q,q=_.applied?.receipts??[],U=_.deployed??[],G=new Set([...U.filter((X)=>X.status==="deployed"),...q.filter((X)=>X.status==="confirmed")].map((X)=>X.actionId)).size,Z=new Set([...U.filter((X)=>X.status==="refused"||X.status==="failed"),...q.filter((X)=>X.status==="failed")].map((X)=>X.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((X)=>X.status==="replayed")&&q.every((X)=>X.status==="replayed"||X.status==="skipped"))return{label:"Pushed",tone:"good",...F};return{label:"Not sent",tone:"plain",...F}}var n6=(_)=>_.message??_.narration?.split(`
37
+ `)[0]?.replace(/ setting .*$/,"")??_.name;function qQ(_,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 b_({name:_,token:Q,signsAs:J,c:q,canWrite:U,rooted:G,refused:Z,onChanged:F,part:X,required:Y}){let K=X==="head",H=X==="review",[L,W]=i.useState(null),[B,O]=i.useState(!1),[T,M]=i.useState(""),[P,A]=i.useState(""),[R,f]=i.useState(null),C=N1(Q,`/-/${_}/origin`),N=x4(q),S=qQ(q,Y),w=$Q(q),j=[...new Set(w.map((b)=>b.twin))],x=j.some((b)=>G.includes(b)),r=(b)=>b===(q.currentHash??q.contentHash),m=q.applied?.receipts??[],v=(q.deployed??[]).filter((b)=>b.status!=="landed"),h=m.filter((b)=>b.status==="confirmed").length,V=v.filter((b)=>b.status==="deployed"),E=async(b,e,t,o)=>{W(b),f(null);try{let s=await I1(Q,e,{method:"POST",...t===void 0?{}:{body:JSON.stringify(t)}});if(!s.ok)return Z(s),f({what:b,...x1(await m0(s))}),!1;if(o)V1(o);return F(),!0}catch(s){return f({what:b,text:`the World did not answer (${s instanceof Error?s.message:String(s)})`,acts:[]}),!1}finally{W(null)}},u=()=>{E("Verify",`/-/${_}/changesets/${q.name}/verify`,void 0,"Verified: the checks ran over it")},D=async(b)=>{if(b.preventDefault(),await E("Approve",`/-/${_}/changesets/${q.name}/approve`,{...T.trim()?{note:T.trim()}:{},...J===null&&P.trim()?{as:P.trim()}:{}},"Approved"))O(!1),M("")},I=async()=>{let b=j.filter((e)=>G.includes(e));if(!await S0({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",b.length===1?"":"s"," behind ",f2(b.map(W1)),". This cannot be taken back here."]},void 0,!0,void 0,this),action:"Deploy",danger:!0,typed:q.name}))return;W("Deploy"),f(null);try{let e=await I1(Q,`/-/${_}/deploy/${q.name}`,{method:"POST",body:JSON.stringify({confirm:q.name})});if(!e.ok){Z(e),f({what:"Deploy",...x1(await m0(e))});return}let t=await I1(Q,`/-/${_}/changesets/${q.name}`),o=t.ok?await t.json():null;if(!o){V1("Deploy: sent; reading its receipts failed","info"),F();return}let s=x4(o);V1(`Deploy: ${s.performed} of ${s.total} change${s.total===1?"":"s"} performed at the vendor${s.failed?`; ${s.failed} refused or failed`:""}`,s.failed?"error":s.performed?"ok":"info"),F()}catch(e){f({what:"Deploy",text:`the World did not answer (${e instanceof Error?e.message:String(e)})`,acts:[]})}finally{W(null)}},k=!U?"This session reads the World; it changes nothing":N.label==="Deployed"?"Already deployed: every change was performed at the vendor":null,p=C.state==="ok"&&C.data.origin?q8(C.data.origin):null;return $.jsxDEV("div",{className:"changeset","aria-labelledby":"changeset-title",children:[K?$.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-${N.tone}`,children:N.label},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:`badge cs-${S.tone}`,children:S.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(P1,{iso:q.createdAt},void 0,!1,void 0,this)," · ",q.actions.length," change",q.actions.length===1?"":"s"," at ",f2(j.map(W1))||"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:u,disabled:Boolean(k)||L!==null,title:k??"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(k)||L!==null,title:k??"Sign its current contents as yourself",children:"Approve…"},void 0,!1,void 0,this),x?$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>void I(),disabled:Boolean(k)||L!==null,title:k??"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),k&&N.label!=="Deployed"?$.jsxDEV("p",{className:"mode",children:[k,"."]},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:u,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(m_,{name:_,acts:R.acts},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this):null,H?$.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:[N.performed>0?$.jsxDEV("p",{className:"pad",children:[N.performed>=N.total?"Deployed":"Partly deployed",": ",N.performed," of ",N.total," change",N.total===1?"":"s",N.own?` (and ${N.own} of the World's own, which stay in it)`:""," performed at ",f2([...new Set([...V.map((b)=>b.service),...m.filter((b)=>b.status==="confirmed").map((b)=>b.service)].map(W1))]),V.length?` (${V.length} from here`:" (",V.length&&h?", ":"",h?`${h} by the remote`:"",")."]},void 0,!0,void 0,this):N.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(P1,{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):N.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",x?"; Deploy, to the real vendors behind it":"","."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null,N.failed>0?$.jsxDEV("p",{className:"pad failed",role:"alert",children:[N.failed," change",N.failed===1?" was":"s were"," refused or failed at the vendor",[...v.filter((b)=>b.reason&&(b.status==="refused"||b.status==="failed")).map((b)=>b.reason),...m.filter((b)=>b.status==="failed"&&b.error).map((b)=>b.error)].slice(0,3).map((b)=>`: ${x1(b).text}`).join(""),"."]},void 0,!0,void 0,this):null,q.applied?.refusal?.length?$.jsxDEV("ul",{className:"checks pad",children:q.applied.refusal.map((b,e)=>$.jsxDEV("li",{className:"mode",children:x1(b).text},e,!1,void 0,this))},void 0,!1,void 0,this):null,v.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:v.map((b)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:b.status==="refused"||b.status==="failed"?"badge cs-bad":b.status==="deployed"?"badge cs-done":"badge",children:b.status},void 0,!1,void 0,this)," ",W1(b.service)," ",b.status==="deployed"?b.url?$.jsxDEV("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",children:b.externalId??b.url},void 0,!1,void 0,this):b.externalId?$.jsxDEV("code",{children:b.externalId},void 0,!1,void 0,this):null:null,b.reason?$.jsxDEV("span",{className:"mode",children:[" · ",x1(b.reason).text]},void 0,!0,void 0,this):null," ",$.jsxDEV("span",{className:"mode",children:["· ",$.jsxDEV(P1,{iso:b.at},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},`v:${b.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,m.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:m.map((b)=>$.jsxDEV("li",{children:[$.jsxDEV("span",{className:b.status==="failed"?"badge cs-bad":b.status==="confirmed"?"badge cs-done":"badge",children:b.status},void 0,!1,void 0,this)," ",W1(b.service)," ",$.jsxDEV("span",{className:"mode",children:b.status==="replayed"?"replayed at the remote World":b.status==="confirmed"?"performed at the vendor by the remote":""},void 0,!1,void 0,this),b.status==="confirmed"&&b.externalId?$.jsxDEV($.Fragment,{children:[" ",$.jsxDEV("code",{children:b.externalId},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,b.error?$.jsxDEV("span",{className:"mode",children:[" · ",x1(b.error).text]},void 0,!0,void 0,this):null]},`r:${b.actionId}`,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),!x&&N.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:`${A1}/${_}/~/settings/services`,onClick:(b)=>{b.preventDefault(),w1([..._.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:r(q.verification.contentHash)?"":"stale",children:[$.jsxDEV("p",{children:[q.verification.passed?"✓ Passed":"✗ Failed"," · ",$.jsxDEV(P1,{iso:q.verification.at},void 0,!1,void 0,this),r(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((b)=>$.jsxDEV("li",{children:[b.passed?"✓":"✗"," ",$.jsxDEV("code",{children:b.id},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:W1(b.service)},void 0,!1,void 0,this)]},b.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((b,e)=>$.jsxDEV("li",{children:["✗ ",$.jsxDEV("code",{children:b.check},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[W1(b.service),": ",b.reason]},void 0,!0,void 0,this)]},e,!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((b,e)=>$.jsxDEV("li",{children:[$.jsxDEV("b",{children:b.principal},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[$.jsxDEV(P1,{iso:b.at},void 0,!1,void 0,this),r(b.contentHash)?"":" · signed an earlier version"]},void 0,!0,void 0,this),b.note?$.jsxDEV("div",{className:"mode",children:["“",b.note,"”"]},void 0,!0,void 0,this):null]},e,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV(U0,{open:B,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:(b)=>void D(b),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:P,onChange:(b)=>A(b.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:(b)=>M(b.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 UQ=(_,Q)=>JSON.stringify(_)===JSON.stringify(Q);function zF({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(h1,{vendor:q},void 0,!1,void 0,this),W1(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((H)=>`${H.subject.type}:${H.subject.id}`===Z),X=F[F.length-1],Y=L0(X),K={};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((H)=>{let L=H.fields??{},W=Object.entries(L).filter(([O,T])=>!(O in K)||!UQ(K[O],T)),B=K;return K={...K,...L},$.jsxDEV("div",{className:"write",children:[$.jsxDEV("p",{className:"mode",children:[$.jsxDEV("span",{className:"op",children:L0(H).what},void 0,!1,void 0,this)," · ",$.jsxDEV(P1,{iso:H.occurredAt},void 0,!1,void 0,this)," · ",D5(H)]},void 0,!0,void 0,this),W.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 ${L0(H).what} set`,children:W.map(([O,T])=>$.jsxDEV(i.default.Fragment,{children:[$.jsxDEV("dt",{children:O},void 0,!1,void 0,this),$.jsxDEV("dd",{children:O in B?$.jsxDEV("span",{className:"changed",children:[$.jsxDEV("del",{children:$.jsxDEV(l0,{v:B[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(l0,{v:T},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):$.jsxDEV(l0,{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)]},H.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 WF({name:_,token:Q,changes:J,canWrite:q,refused:U,onCut:G,pinned:Z,generated:F,inputRef:X,author:Y}){let[K,H]=i.useState(""),[L,W]=i.useState(!1),[B,O]=i.useState([]),T=(P,A,R)=>{O((f)=>[{ok:P,text:A,at:new Date().toISOString(),n:++x5,...R?.length?{acts:R}:{}},...f].slice(0,4))},M=async(P)=>{P.preventDefault(),W(!0);try{let A=await I1(Q,`/-/${_}/changesets`,{method:"POST",body:JSON.stringify(K.trim()?{message:K.trim()}:{})});if(!A.ok){U(A);let f=x1(await m0(A));T(!1,`Cut a changeset: ${f.text}`,f.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.`),H(""),G()}catch(A){T(!1,`Cut a changeset: the World did not answer (${A instanceof Error?A.message:String(A)})`)}finally{W(!1)}};if(Z){let P=!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($2,{log:B,name:_},void 0,!1,void 0,this),$.jsxDEV("form",{onSubmit:(A)=>void M(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(),w1(Y.account.slice(A1.length+1).split("/"))},children:Y.face},void 0,!1,void 0,this):null,$.jsxDEV("input",{ref:X,name:"changesetMessage","aria-label":"Summary",value:K,onChange:(A)=>H(A.target.value),placeholder:J===0?"Nothing to cut":F?"Summary (optional)":"Summary (required)",required:!F,maxLength:200,disabled:Boolean(P),title:P??void 0},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",className:"primary",disabled:Boolean(P)||L,title:P??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($2,{log:B,name:_},void 0,!1,void 0,this);return $.jsxDEV($.Fragment,{children:[$.jsxDEV("form",{className:"block cut pad",onSubmit:(P)=>void M(P),"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:K,onChange:(P)=>H(P.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($2,{log:B,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function BF({name:_,token:Q}){let[J,q]=i.useState(0),U=N1(Q,`/-/${_}/keys`,J),[G,Z]=i.useState(!1),[F,X]=i.useState(""),[Y,K]=i.useState("write"),[H,L]=i.useState(!1),[W,B]=i.useState(null),[O,T]=i.useState(null),[M,P]=i.useState(null),A=async()=>{let C=`Read-only link · ${new Date().toLocaleDateString(void 0,{month:"short",day:"numeric"})}`,N=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:C,scope:"read"})}).catch(()=>null),S=N?await N.json().catch(()=>({})):{error:`${f1} did not answer`};if(!N?.ok||!S.key){V1(S.error?x1(S.error).text:"refused","error");return}P(`${window.location.origin}${A1}/${_}#${new URLSearchParams({token:S.key}).toString()}`),q((w)=>w+1)},R=async(C)=>{C.preventDefault(),L(!0),B(null);let N=await I1(Q,`/-/${_}/keys`,{method:"POST",body:JSON.stringify({name:F.trim(),scope:Y})}).catch(()=>null);L(!1);let S=N?await N.json().catch(()=>({})):{error:`${f1} did not answer`};if(!N?.ok||!S.key){B(S.error?x1(S.error).text:"refused");return}Z(!1),T({key:S.key,name:F.trim()}),X(""),q((w)=>w+1)},f=async(C)=>{if(!await S0({title:`Revoke ${C.name}?`,body:"Whatever holds it loses this World at once.",action:"Revoke key",danger:!0}))return;let N=await I1(Q,`/-/${_}/keys/${C.id}`,{method:"DELETE"});if(N.ok)V1(`Revoked ${C.name}`);else V1(await G0(N),"error");q((S)=>S+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),t1()?$.jsxDEV("a",{className:"button primary",href:`${t1()}/${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:()=>{B(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(s1,{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:a2(C.createdAt),children:d6(C.createdAt)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"mode",children:C.lastUsedAt?d6(C.lastUsedAt):"never"},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:$.jsxDEV(P_,{label:`More for ${C.name}`,items:[{label:"Revoke…",danger:!0,onSelect:()=>void f(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(U0,{open:G,onClose:()=>{if(!H)Z(!1)},title:"Make a key",footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>Z(!1),disabled:H,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"make-key",disabled:H||!F.trim(),children:H?"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)=>K(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),W?$.jsxDEV("p",{role:"alert",children:W},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV(U0,{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(s6,{label:"Key",value:O.key,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(U0,{open:Boolean(M),onClose:()=>P(null),title:"A read-only link",footer:$.jsxDEV("button",{type:"button",className:"primary",onClick:()=>P(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),M?$.jsxDEV(s6,{label:"Link",value:M,secret:!0},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var x5=0;function $2({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(P1,{iso:J.at,time:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)," ",J.text,J.acts?$.jsxDEV(m_,{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 GQ(_,Q,J,q){let[U,G]=i.useState(0),Z=U*1e5+Math.floor(J/2),F=N1(Q,`/-/${_}/origin`,Z),X=N1(Q,`/-/${_}/diff`,Z),Y=N1(Q,`/-/${_}/changesets`,Z),[K,H]=i.useState([]),[L,W]=i.useState(null),B=(f,C,N)=>{if(H((S)=>[{ok:f,text:C,at:new Date().toISOString(),n:++x5,...N?.length?{acts:N}:{}},...S].slice(0,8)),!f)V1(C,"error")},O=async(f,C,N)=>{W(f);try{let S=await I1(Q,`/-/${_}/${C}`,N);if(!S.ok){q(S);let w=x1(await m0(S));return B(!1,`${f}: ${w.text}`,w.acts),null}return await S.json()}catch(S){return B(!1,`${f}: the World did not answer (${S instanceof Error?S.message:String(S)})`),null}finally{W(null),G((S)=>S+1)}},T=F.state==="ok"&&F.data.origin?q8(F.data.origin):null,M=X.state==="ok"?X.data.changes.length:null,P=Y.state==="ok"&&T?dZ(Y.data.changesets.filter((f)=>!f.pushedBy)).sort((f,C)=>f.createdAt.localeCompare(C.createdAt)):[];return{origin:F,diff:X,sets:Y,there:T,changes:M,waiting:P,log:K,busy:L,say:B,send:O,push:async()=>{let f=await O("Push","origin/push",{method:"POST"});if(!f)return;if(f.pushed.length===0){B(!0,"Nothing to push: every changeset is already at the remote.");return}for(let C of f.pushed){let N=C.receipts??[],S=N.filter((m)=>m.status==="replayed").length,w=N.filter((m)=>m.status==="confirmed").length,j=N.filter((m)=>m.status==="failed").length,x=C.outcome==="applied"&&j===0;if(C.outcome==="refused"){B(!1,`Push of ${C.changeset} was refused${C.refusal?.length?`: ${C.refusal.map((m)=>x1(m).text).join("; ")}`:""}.`);continue}let r=[`${S} of ${k1(N.length,"change")} replayed there`,...w?[`${w} performed at the vendor by the remote`]:[],...j?[`${j} failed`]:[]];B(x,`${C.outcome==="partial"?"Partly pushed":"Pushed"} ${C.changeset} to ${T??"the remote"}: ${r.join("; ")}${C.refusal?.length?` (${C.refusal.map((m)=>x1(m).text).join("; ")})`:""}.`)}},pull:async()=>{let f=await O("Pull","origin/pull",{method:"POST"});if(!f)return;let C=Object.entries(f.appended).filter(([,S])=>S>0),N=f.rebased.flatMap((S)=>S.conflicts.map((w)=>`${W1(S.twin)} ${w.subject.type}:${w.subject.id} ${w.field}`));B(N.length===0,`Pulled from ${T??"the remote"}: ${C.length?C.map(([S,w])=>`${k1(w,"entry")} at ${W1(S)}`).join(", "):"nothing new"}${N.length?`; conflicts at ${N.join(", ")}`:""}.`)}}}function AF({name:_,token:Q,canWrite:J,tick:q,refused:U}){let{origin:G,there:Z,changes:F,log:X,busy:Y,say:K,send:H,push:L,pull:W}=GQ(_,Q,q,U),[B,O]=i.useState(""),[T,M]=i.useState(""),[P,A]=i.useState(!1),R=async(C)=>{C.preventDefault();let N=await H("Name the remote","origin",{method:"PUT",body:JSON.stringify({url:B.trim(),token:T.trim()})});if(N){let S=Object.values(N.appended??{}).reduce((w,j)=>w+j,0);K(!0,`The remote is ${q8(N.origin)}: its history came in (${k1(S,"entry")}).`),M(""),A(!1)}},f=!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(!P)},"aria-expanded":P,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(P1,{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(s1,{load:G,what:"the remote",lines:1},void 0,!1,void 0,this),P?$.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:B,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)=>M(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($2,{log:X,name:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function MF({name:_,token:Q,canWrite:J,refused:q}){let[U,G]=i.useState(0),Z=N1(Q,`/-/${_}/twins`,U),F=N1(Q,`/-/${_}/links`,U),X=N1(Q,`/-/${_}/requests?hours=24`,U),[Y,K]=i.useState({}),[H,L]=i.useState(null),[W,B]=i.useState(""),[O,T]=i.useState(!1),[M,P]=i.useState([]),A=(w,j,x)=>{if(P((r)=>[{ok:w,text:j,at:new Date().toISOString(),n:++x5,...x?.length?{acts:x}:{}},...r].slice(0,6)),!w)V1(j,"error")},R=F.state==="ok"?Object.keys(F.data.links).sort():[];i.useEffect(()=>{let w=!0;return Promise.all(R.map(async(j)=>{let x=await I1(Q,`/-/${_}/twins/${j}/credential`).catch(()=>null),r=x?.ok?await x.json():null;return[j,r?.credential??null]})).then((j)=>{if(w)K(Object.fromEntries(j))}),()=>{w=!1}},[_,Q,R.join(","),U]);let f=async(w)=>{if(w.preventDefault(),!H||!W)return;T(!0);let j=await I1(Q,`/-/${_}/twins/${H.vendor}/credential`,{method:"PUT",body:W,headers:{"content-type":"text/plain"}}).catch(()=>null);if(T(!1),!j){A(!1,`Seal ${H.vendor}: ${f1} did not answer`);return}if(!j.ok){q(j);let r=x1(await m0(j));A(!1,`Seal ${W1(H.vendor)}: ${r.text}`,r.acts);return}let x=await j.json().catch(()=>({}));A(!0,`Sealed a credential for ${W1(H.vendor)}${x.fingerprint?` (${x.fingerprint})`:""}: it opens for ${x.boundTo??H.to} only, and is never shown again.`),B(""),L(null),G((r)=>r+1)},C=async(w)=>{if(!await S0({title:`Remove the link ${w}?`,body:`Requests to ${J2}/${_}/${w}/… stop being forwarded to ${F.state==="ok"?F.data.links[w]?.origin:"its origin"}.`,action:"Remove link",danger:!0}))return;let j=await I1(Q,`/-/${_}/links/${w}`,{method:"DELETE"}).catch(()=>null);if(!j?.ok){if(j)q(j);A(!1,`Remove ${w}: ${j?await G0(j):"the World did not answer"}`);return}A(!0,`Removed the link ${w}.`),G((x)=>x+1)},N=(w)=>w?$.jsxDEV($.Fragment,{children:[$.jsxDEV("span",{className:"badge rooted",children:"sealed"},void 0,!1,void 0,this)," ",$.jsxDEV("span",{className:"mode",children:[w.fingerprint?$.jsxDEV("code",{children:w.fingerprint},void 0,!1,void 0,this):null," · ",$.jsxDEV(P1,{iso:w.placedAt},void 0,!1,void 0,this),w.sealedBy?` · by ${w.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),S=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($2,{log:M,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(s1,{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:S.map((w)=>$.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(h1,{vendor:w.twin},void 0,!1,void 0,this),W1(w.twin)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:N(w.credential)},void 0,!1,void 0,this),$.jsxDEV("td",{children:w.credential?.boundTo?$.jsxDEV("code",{children:w.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:w.root?.url?$.jsxDEV("code",{children:w.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:!w.root?.url,title:w.root?.url?`Seal ${W1(w.twin)}'s real credential for ${w.root.url}`:"Connect it to its real service first (Settings › Real services): a credential is sealed for where it goes",onClick:()=>{B(""),L({vendor:w.twin,to:w.root.url})},children:w.credential?"Replace…":"Seal a credential…"},void 0,!1,void 0,this)},void 0,!1,void 0,this):null]},w.twin,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,Z.state==="ok"&&S.every((w)=>!w.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(s1,{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:[J2,"/",_,"/<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((w)=>{let j=F.state==="ok"?F.data.links[w].origin:"",x=X.state==="ok"?X.data.twins.find((r)=>r.twin===w):void 0;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("b",{children:w},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{children:$.jsxDEV("code",{children:j},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.jsxDEV("td",{className:"num",children:x?$.jsxDEV("span",{title:Object.entries(x.byStatus).map(([r,m])=>`${r}: ${m}`).join(" · "),children:x.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:[N(Y[w]??null),Y[w]?.boundTo?$.jsxDEV("div",{className:"mode",children:["bound to ",$.jsxDEV("code",{children:Y[w].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:()=>{B(""),L({vendor:w,to:j})},children:Y[w]?"Replace…":"Seal a credential…"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"button",onClick:()=>void C(w),children:"Remove…"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},w,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this),$.jsxDEV(U0,{open:Boolean(H),onClose:()=>{if(!O)L(null)},title:`Seal ${H?W1(H.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||!W,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:(w)=>void f(w),children:[$.jsxDEV("p",{className:"mode",children:["It is sealed for ",$.jsxDEV("code",{children:H?.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:W,onChange:(w)=>B(w.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 TF({name:_,token:Q,admin:J,canWrite:q,refused:U,onRemoved:G,only:Z}){let F=(u)=>!Z||Z===u,[X,Y]=i.useState(0),K=N1(Q,`/-/${_}/twins`,X),H=N1(Q,`/-/${_}/checks`,X),[L,W]=i.useState(0),B=N1(Q,`/-/${_}/clock`,L),[O,T]=i.useState([]),[M,P]=i.useState(null),[A,R]=i.useState(null),[f,C]=i.useState(""),[N,S]=i.useState("gated"),[w,j]=i.useState(!1),x=(u,D,I)=>{if(T((k)=>[{ok:u,text:D,at:new Date().toISOString(),n:++x5,...I?.length?{acts:I}:{}},...k].slice(0,6)),!u)V1(D,"error")},r=async(u,D,I)=>{let k=await I1(Q,D,I).catch(()=>null);if(!k)return x(!1,`${u}: the World did not answer`),!1;if(!k.ok){U(k);let p=x1(await m0(k));return x(!1,`${u}: ${p.text}`,p.acts),!1}return x(!0,`${u}: done.`),Y((p)=>p+1),!0},m=async(u)=>{if(u.preventDefault(),!A)return;j(!0);let D=A.root??{},I=await r(f.trim()?`Connect ${W1(A.twin)} to ${f.trim()}`:`Disconnect ${W1(A.twin)}`,`/-/${_}/twins/${A.twin}/root`,{method:"PUT",body:JSON.stringify(f.trim()?{...D,url:f.trim(),deploy:N}:null)});if(j(!1),I)R(null)},v=async()=>{if(!await S0({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 u=await I1(J,`/-/worlds/${_}/rotate`,{method:"POST"});if(u.ok)P(await u.json()),x(!0,"Rotated: the new tokens are shown once, below.");else x(!1,`Rotate: ${await G0(u)}`)},h=async()=>{if(!await S0({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 u=await I1(J,`/-/worlds/${_}`,{method:"DELETE"}).catch((D)=>D);if(u instanceof Error){x(!1,`Remove: the host did not answer (${u.message})`);return}if(u.ok)G();else x(!1,`Remove: ${await G0(u)}`)},V=K.state==="ok"?K.data.twins:[],E={gated:"gated: a person deploys an approved changeset",auto:"auto: a push deploys at once",hold:"hold: nothing deploys"};return $.jsxDEV($.Fragment,{children:[$.jsxDEV($2,{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(BF,{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:[V.some((u)=>u.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(s1,{load:K,what:"the vendors"},void 0,!1,void 0,this),K.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:V.map((u)=>{let D=u.root;return $.jsxDEV("tr",{children:[$.jsxDEV("td",{children:$.jsxDEV("span",{className:"vendor-cell",children:[$.jsxDEV(h1,{vendor:u.twin},void 0,!1,void 0,this),$.jsxDEV("a",{href:`${A1}/${_}/${u.twin}`,title:`Its log and stored state · ${u.position??0} entries`,onClick:(I)=>{I.preventDefault(),w1([..._.split("/"),u.twin])},children:W1(u.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?E[D.deploy??""]??D.deploy??"—":"—"},void 0,!1,void 0,this),$.jsxDEV("td",{children:u.refresh?.failed?$.jsxDEV("span",{role:"alert",children:["failed ×",u.refresh.failed.count??1,": ",u.refresh.failed.reason??""]},void 0,!0,void 0,this):D?.url?a2(u.refresh?.observedAt??u.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??""),S(D?.deploy==="auto"||D?.deploy==="hold"?D.deploy:"gated"),R(u)},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 S0({title:`Read ${W1(u.twin)} now?`,body:`The real ${W1(u.twin)}'s current state is read into this World. Nothing is written to ${W1(u.twin)}.`,action:"Read from it"}).then((I)=>{if(I)r(`Read from ${W1(u.twin)}`,`/-/${_}/twins/${u.twin}/refresh`,{method:"POST"})}),children:"Read from it"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},u.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(sZ,{name:_,token:Q,clock:B,canWrite:q,onChanged:()=>W((u)=>u+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(s1,{load:H,what:"the checks"},void 0,!1,void 0,this),H.state==="ok"?H.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:H.data.checks.map((u)=>$.jsxDEV("tr",{children:$.jsxDEV("td",{children:$.jsxDEV("code",{children:u},void 0,!1,void 0,this)},void 0,!1,void 0,this)},u,!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),M?$.jsxDEV("p",{role:"status",children:["token ",$.jsxDEV("code",{children:M.token},void 0,!1,void 0,this)," · read token ",$.jsxDEV("code",{children:M.readToken},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,$.jsxDEV("p",{children:[$.jsxDEV("button",{type:"button",onClick:()=>void v(),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 h(),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(U0,{open:Boolean(A),onClose:()=>{if(!w)R(null)},title:`Connect ${A?W1(A.twin):""} to its real service`,footer:$.jsxDEV($.Fragment,{children:[$.jsxDEV("button",{type:"button",onClick:()=>R(null),disabled:w,children:"Cancel"},void 0,!1,void 0,this),$.jsxDEV("button",{type:"submit",form:"connect-root",className:"primary",disabled:w,children:w?"Saving…":f.trim()?"Connect":"Disconnect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),children:$.jsxDEV("form",{id:"connect-root",className:"stack",onSubmit:(u)=>void m(u),children:[$.jsxDEV("label",{children:[$.jsxDEV("span",{children:"The real service's API address"},void 0,!1,void 0,this),$.jsxDEV("input",{name:"rootUrl",value:f,onChange:(u)=>C(u.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:N,onChange:(u)=>S(u.target.value==="auto"?"auto":u.target.value==="hold"?"hold":"gated"),children:["gated","auto","hold"].map((u)=>$.jsxDEV("option",{value:u,children:E[u]},u,!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 _M(){return $.jsxDEV($.Fragment,{children:[$.jsxDEV(jZ,{},void 0,!1,void 0,this),$.jsxDEV(w_,{},void 0,!1,void 0,this),$.jsxDEV(f_,{},void 0,!1,void 0,this),$.jsxDEV(I_,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}export{eA as openAt,E5 as ROOT,_M as ConsolePage};